Comparing version 0.2.1 to 0.2.2
var mysql = require('../test/common').createConnection(); | ||
mysql.execute("select * from foos limit ?", [10], function(err, rows, fields) { | ||
mysql.execute(process.argv[2], [10], function(err, rows, fields) { | ||
// Work in progress | ||
console.log(err, rows, fields); | ||
}); |
@@ -20,3 +20,42 @@ module.exports = | ||
CLIENT_MULTI_STATEMENTS: 65536 ,/* Enable/disable multi-stmt support */ | ||
CLIENT_MULTI_RESULTS: 131072 /* Enable/disable multi-results */ | ||
CLIENT_MULTI_RESULTS: 131072, /* Enable/disable multi-results */ | ||
// types | ||
MYSQL_TYPE_DECIMAL: 0, | ||
MYSQL_TYPE_TINY: 1, | ||
MYSQL_TYPE_SHORT: 2, | ||
MYSQL_TYPE_LONG: 3, | ||
MYSQL_TYPE_FLOAT: 4, | ||
MYSQL_TYPE_DOUBLE: 5, | ||
MYSQL_TYPE_NULL: 6, | ||
MYSQL_TYPE_TIMESTAMP: 7, | ||
MYSQL_TYPE_LONGLONG: 8, | ||
MYSQL_TYPE_INT24: 9, | ||
MYSQL_TYPE_DATE: 10, | ||
MYSQL_TYPE_TIME: 11, | ||
MYSQL_TYPE_DATETIME: 12, | ||
MYSQL_TYPE_YEAR: 13, | ||
MYSQL_TYPE_NEWDATE: 14, | ||
MYSQL_TYPE_VARCHAR: 15, | ||
MYSQL_TYPE_BIT: 16, | ||
MYSQL_TYPE_NEWDECIMAL: 246, | ||
MYSQL_TYPE_ENUM: 247, | ||
MYSQL_TYPE_SET: 248, | ||
MYSQL_TYPE_TINY_BLOB: 249, | ||
MYSQL_TYPE_MEDIUM_BLOB: 250, | ||
MYSQL_TYPE_LONG_BLOB: 251, | ||
MYSQL_TYPE_BLOB: 252, | ||
MYSQL_TYPE_VAR_STRING: 253, | ||
MYSQL_TYPE_STRING: 254, | ||
MYSQL_TYPE_GEOMETRY: 255, | ||
// field flags | ||
FIELD_NOT_NULL: 1, /* Field can't be NULL */ | ||
FIELD_PRI_KEY: 2, /* Field is part of a primary key */ | ||
FIELD_UNIQUE_KEY: 4, /* Field is part of a unique key */ | ||
FIELD_MULTIPLE_KEY: 8, /* Field is part of a key */ | ||
FIELD_BLOB: 16, /* Field is a blob */ | ||
FIELD_UNSIGNED: 32, /* Field is unsigned */ | ||
FIELD_ZEROFILL: 64, /* Field is zerofill */ | ||
FIELD_BINARY: 128 | ||
}; |
{ | ||
"name": "mysql2", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "fast mysql driver", | ||
@@ -22,4 +22,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"underscore": "~1.4.4", | ||
"readable-stream": "~1.0.2" | ||
"underscore": "~1.4.4" | ||
}, | ||
@@ -26,0 +25,0 @@ "devDependencies": { |
@@ -1,2 +0,2 @@ | ||
module.exports.createConnection = function() { | ||
module.exports.createConnection = function(callback) { | ||
// hrtime polyfill for old node versions: | ||
@@ -11,2 +11,31 @@ if (!process.hrtime) | ||
if (process.env.BENCHMARK_MARIA) { | ||
var Client = require('mariasql'); | ||
var c = new Client(); | ||
c.connect({ | ||
host: '127.0.0.1', | ||
user: 'root', | ||
password: 'test', | ||
db: 'test' | ||
}); | ||
//c.on('connect', function() { | ||
// | ||
//}); | ||
setTimeout( function() { | ||
console.log('altering client...'); | ||
c.oldQuery = c.query; | ||
c.query = function(sql, callback) { | ||
var rows = []; | ||
var q = c.oldQuery(sql); | ||
q.on('result', function(res) { | ||
res.on('row', function(row) { rows.push(row) }); | ||
res.on('end', function() { | ||
callback(null, rows); | ||
}); | ||
}); | ||
}; | ||
}, 1000); | ||
return c; | ||
} | ||
var driver = require('../index.js'); | ||
@@ -25,4 +54,10 @@ if (process.env.BENCHMARK_MYSQL1) | ||
module.exports.createTemplate = function() { | ||
var jade = require('jade'); | ||
var template = require('fs').readFileSync(__dirname + '/template.jade', 'ascii'); | ||
return jade.compile(template); | ||
}; | ||
module.exports.hrdiff = function(t1, t2) { | ||
return t2[1] - t1[1] + (t2[0] - t1[0])*1e9; | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48259
1
43
1390
14
2
- Removedreadable-stream@~1.0.2
- Removedcore-util-is@1.0.3(transitive)
- Removedinherits@2.0.4(transitive)
- Removedisarray@0.0.1(transitive)
- Removedreadable-stream@1.0.34(transitive)
- Removedstring_decoder@0.10.31(transitive)