node-query/lib/drivers/mysql.js
2014-10-27 15:46:54 -04:00

30 lines
588 B
JavaScript
Executable File

"use strict";
/**
* Driver for MySQL databases
*
* @module drivers/mysql
*/
module.exports = (function() {
delete require.cache[require.resolve('../driver')];
var driver = require('../driver');
var driver = require('../driver'),
helpers = require('../helpers');
driver.identifierChar = '`';
/**
* Override default limit method because mysql likes to be different
*/
driver.limit = function(sql, limit, offset) {
if ( ! helpers.isNumber(offset))
{
return sql += " LIMIT " + limit;
}
return sql += " LIMIT " + offset + "," + limit;
};
return driver;
}());