Skip to content

Commit

Permalink
Allow chaining of Database methods
Browse files Browse the repository at this point in the history
  • Loading branch information
notheotherben committed Aug 8, 2014
1 parent cd0a269 commit e5b3d97
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Database.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,16 @@ Database.prototype.connect = function (cb) {

cb(null, $);
});

return this;
};

Database.prototype.close = Database.prototype.disconnect = function() {
if(!this.connection) return;
this.connection.close();
this.connection = null;

return this;
};

Database.prototype.express = function() {
Expand Down Expand Up @@ -171,4 +175,5 @@ Database.prototype.register = function () {
});
}

return this;
};

0 comments on commit e5b3d97

Please sign in to comment.