Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Added support for the mysql@2.0.0-alpha3 driver #41

Merged
merged 5 commits into from

2 participants

@tvernon

Requires the latest version of node-db-meta (with support for new mysql driver).
Maintains backwards compatibility with older mysql drivers.

@tvernon

This should fix issue #25.

@kunklejr
Owner

Can you please update the package.json file to include the needed version of db-meta?

@tvernon
Tyler Vernon added some commits
@kunklejr kunklejr merged commit 907f73d into db-migrate:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 7, 2012
  1. added support for the mysql@2.0.0-alpha3 driver

    Tyler Vernon authored
Commits on Aug 14, 2012
  1. Fixed spacing issues.

    Tyler Vernon authored
  2. Fixed spacing issues

    Tyler Vernon authored
  3. Fixed spacing issues

    Tyler Vernon authored
This page is out of date. Refresh to see the latest.
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 = config.db || new mysql.createClient(config);
+ } else {
+ db = config.db || new mysql.createConnection(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() {
Something went wrong with that request. Please try again.