Fixed mysql tests

This commit is contained in:
Will Johnston 2014-08-03 16:44:58 -05:00
parent b8ce2bd4c0
commit 4f562b1706
2 changed files with 3 additions and 4 deletions

View File

@ -109,7 +109,7 @@ sql = mysql.format(sql, inserts);
connection.config.queryFormat = function (query, values) {
if (!values) return query;
return query.replace(/\:(\w+)/g, function (txt, key) {
return query.replace(/\:(\w+)/g, function (txt: string, key: string) {
if (values.hasOwnProperty(key)) {
return this.escape(values[key]);
}
@ -173,7 +173,7 @@ pool.on('connection', function (connection) {
connection.query('SET SESSION auto_increment_increment=1')
});
pool.getConnection(function (err, connection: mysql.IConnection) {
pool.getConnection(function (err, connection) {
// Use the connection
connection.query('SELECT something FROM sometable', function (err, rows) {
// And done with the connection.
@ -368,7 +368,7 @@ var query = connection.query({ sql: '...', typeCast: false }, function (err, res
connection.query({
sql: '...',
typeCast: function (field, next) {
typeCast: function (field: any, next: Function) {
if (field.type == 'TINY' && field.length == 1) {
return (field.string() == '1'); // 1 = true, 0 = false
}

1
mysql/mysql.d.ts vendored
View File

@ -44,7 +44,6 @@ declare module mysql {
query: IQueryFunction;
end(): void;
end(options: any): void;
end(callback: (err: IError, ...args: any[]) => void): void;
end(options: any, callback: (err: IError, ...args: any[]) => void): void;