2014-10-20 16:56:45 -04:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Driver for MySQL databases
|
|
|
|
*
|
2014-10-23 10:53:16 -04:00
|
|
|
* @module drivers/mysql
|
2014-10-20 16:56:45 -04:00
|
|
|
*/
|
2014-10-23 10:53:16 -04:00
|
|
|
module.exports = (function() {
|
2014-10-27 15:46:54 -04:00
|
|
|
delete require.cache[require.resolve('../driver')];
|
|
|
|
var driver = require('../driver');
|
2014-10-20 16:56:45 -04:00
|
|
|
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;
|
2014-10-23 10:53:16 -04:00
|
|
|
|
|
|
|
}());
|