Comparing version 0.0.3 to 0.1.0
@@ -108,2 +108,12 @@ var _ = require('underscore'); | ||
Connection.prototype.escape = function(str) { | ||
// copy-paste from mysql-native. Currenty only used by benchmark | ||
str = str.replace(/\0/g, "\\0"); | ||
str = str.replace(/\n/g, "\\n"); | ||
str = str.replace(/\r/g, "\\r"); | ||
str = str.replace(/\032/g, "\\Z"); | ||
str = str.replace(/([\'\"]+)/g, "\\$1"); | ||
return str; | ||
}; | ||
module.exports = Connection; | ||
@@ -110,0 +120,0 @@ |
{ | ||
"name": "mysql2", | ||
"version": "0.0.3", | ||
"version": "0.1.0", | ||
"description": "fast mysql driver", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -11,3 +11,8 @@ module.exports.createConnection = function() { | ||
return require('../index.js').createConnection({ | ||
var driver = require('../index.js'); | ||
// uncomment to benchmark against mysql: | ||
//var driver = require('mysql'); | ||
return driver.createConnection({ | ||
host: process.env.MYSQL_HOST || '127.0.0.1', | ||
@@ -21,1 +26,4 @@ user: process.env.MYSQL_USER || 'root', | ||
module.exports.hrdiff = function(t1, t2) { | ||
return t2[1] - t1[1] + (t2[0] - t1[0])*1e9; | ||
}; |
@@ -9,2 +9,4 @@ #!/usr/bin/env node | ||
require('urun')(__dirname, options); | ||
require('../benchmarks/bench-insert-select.js')(function() { | ||
require('urun')(__dirname, options); | ||
}); |
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
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
35890
35
1017