diff --git a/lib/schema.js b/lib/schema.js index 2809e173..e65529c7 100644 --- a/lib/schema.js +++ b/lib/schema.js @@ -122,16 +122,20 @@ function Schema(name, settings) { schema.connect = function(cb) { var schema = this; schema.connecting = true; - schema.adapter.connect(function(err) { - if (!err) { - schema.connected = true; - schema.connecting = false; - schema.emit('connected'); - } - if (cb) { - cb(err); - } - }); + if (schema.adapter.connect) { + schema.adapter.connect(function(err) { + if (!err) { + schema.connected = true; + schema.connecting = false; + schema.emit('connected'); + } + if (cb) { + cb(err); + } + }); + } else { + process.nextTick(cb); + } }; };