Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added support for the mysql@2.0.0-alpha3 driver

  • Loading branch information...
commit 780f427bf2f6690ee997161b270913cc0884666c 1 parent 5ea2915
Tyler Vernon authored
Showing with 7 additions and 2 deletions.
  1. +6 −1 lib/driver/mysql.js
  2. +1 −1  test/driver/mysql_test.js
View
7 lib/driver/mysql.js
@@ -106,6 +106,11 @@ var MysqlDriver = Base.extend({
});
exports.connect = function(config, callback) {
- var db = config.db || new mysql.createClient(config);
+ var db;
+ if(typeof(mysql.createConnection != 'undefined')){
+ db = new mysql.createConnection(config);
+ }else{
+ db = new mysql.createClient(config);
+ }
callback(null, new MysqlDriver(db));
};
View
2  test/driver/mysql_test.js
@@ -4,7 +4,7 @@ var dbmeta = require('db-meta');
var dataType = require('../../lib/data_type');
var driver = require('../../lib/driver');
-driver.connect({ driver: 'mysql', database: 'db_migrate_test' }, function(err, db) {
+driver.connect({ driver: 'mysql', database: 'db_migrate_test', user:'root' }, function(err, db) {
vows.describe('mysql').addBatch({
'createTable': {
topic: function() {
Please sign in to comment.
Something went wrong with that request. Please try again.