ee-mysql-connection
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -204,2 +204,3 @@ !function(){ | ||
async.each(databases, function(databaseName, next){ | ||
// get relations | ||
@@ -210,2 +211,3 @@ async.wait(function(done){ | ||
// get table definitions | ||
@@ -216,2 +218,9 @@ , function(done){ | ||
// check if the schema exists | ||
, function(done){ | ||
this.schemaExists(databaseName, done); | ||
}.bind(this) | ||
// clean up results | ||
@@ -225,2 +234,3 @@ , function(err, results){ | ||
, tables: results[1] | ||
, exists: results[2] | ||
}); | ||
@@ -245,2 +255,5 @@ } | ||
}); | ||
Object.defineProperty(dbs[db.databaseName], 'schemaExists', { | ||
value: function(){return db.exists;} | ||
}); | ||
} | ||
@@ -473,2 +486,16 @@ database = dbs[db.databaseName]; | ||
/** | ||
* checks if a given schema exists | ||
* | ||
* @param <String> schemanem | ||
*/ | ||
, schemaExists: function(schemaName, callback) { | ||
this.listDatabases(function(err, schemas) { | ||
if (err) callback(err); | ||
else callback(null, !!schemas.filter(function(schema) {return schema === schemaName}).length); | ||
}.bind(this)); | ||
} | ||
/** | ||
* the _handleConnectionError() method handles connection errors | ||
@@ -475,0 +502,0 @@ * |
{ | ||
"name" : "ee-mysql-connection" | ||
, "description" : "mysql connection abstraction for ee-orm" | ||
, "version" : "0.3.0" | ||
, "version" : "0.3.1" | ||
, "homepage" : "https://github.com/eventEmitter/ee-mysql-connection" | ||
@@ -6,0 +6,0 @@ , "author" : "Michael van der Weg <michael@eventemitter.com> (http://eventemitter.com/)" |
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
26588
714