Skip to content

Commit 903e9b2

Browse files
grncdrbrianc
authored andcommitted
Attach Query constructors to Client constructors
1 parent 5d25bcd commit 903e9b2

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

lib/client.js

+3
Original file line numberDiff line numberDiff line change
@@ -218,4 +218,7 @@ Client.md5 = function(string) {
218218
return crypto.createHash('md5').update(string).digest('hex');
219219
};
220220

221+
// expose a Query constructor
222+
Client.Query = Query;
223+
221224
module.exports = Client;

lib/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var PG = function(clientConstructor) {
1313
EventEmitter.call(this);
1414
this.Client = clientConstructor;
1515
this.Connection = require(__dirname + '/connection');
16-
this.Query = require(__dirname + '/query');
16+
this.Query = clientConstructor.Query
1717
this.defaults = defaults;
1818
};
1919

lib/native/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,7 @@ var clientBuilder = function(config) {
171171
return connection;
172172
};
173173

174+
// expose a Query constructor
175+
clientBuilder.Query = NativeQuery;
176+
174177
module.exports = clientBuilder;

0 commit comments

Comments
 (0)