Attach Query constructors to Client constructors

This commit is contained in:
Stephen Sugden 2012-12-10 22:50:29 -08:00 committed by bmc
parent 5d25bcdcf0
commit 903e9b25ea
3 changed files with 7 additions and 1 deletions

View File

@ -218,4 +218,7 @@ Client.md5 = function(string) {
return crypto.createHash('md5').update(string).digest('hex');
};
// expose a Query constructor
Client.Query = Query;
module.exports = Client;

View File

@ -13,7 +13,7 @@ var PG = function(clientConstructor) {
EventEmitter.call(this);
this.Client = clientConstructor;
this.Connection = require(__dirname + '/connection');
this.Query = require(__dirname + '/query');
this.Query = clientConstructor.Query
this.defaults = defaults;
};

View File

@ -171,4 +171,7 @@ var clientBuilder = function(config) {
return connection;
};
// expose a Query constructor
clientBuilder.Query = NativeQuery;
module.exports = clientBuilder;