@@ -14,21 +14,23 @@ const poolFactory = (Client) => {
14
14
}
15
15
}
16
16
17
- var PG = function ( clientConstructor ) {
18
- this . defaults = defaults
19
- this . Client = clientConstructor
20
- this . Query = this . Client . Query
21
- this . Pool = poolFactory ( this . Client )
22
- this . _pools = [ ]
23
- this . Connection = Connection
24
- this . types = require ( 'pg-types' )
25
- this . DatabaseError = DatabaseError
17
+ module . exports = {
18
+ defaults : defaults ,
19
+ _pools : [ ] ,
20
+ Connection : Connection ,
21
+ types : require ( 'pg-types' ) ,
22
+ DatabaseError : DatabaseError ,
26
23
}
27
24
28
25
if ( typeof process . env . NODE_PG_FORCE_NATIVE !== 'undefined' ) {
29
- module . exports = new PG ( require ( './native' ) )
26
+ var nativeClient = require ( './native' )
27
+ module . exports . Client = nativeClient
28
+ module . exports . Query = nativeClient . Query
29
+ module . exports . Pool = poolFactory ( nativeClient )
30
30
} else {
31
- module . exports = new PG ( Client )
31
+ module . exports . Client = Client
32
+ module . exports . Query = Client . Query
33
+ module . exports . Pool = poolFactory ( Client )
32
34
33
35
// lazy require native module...the native module may not have installed
34
36
Object . defineProperty ( module . exports , 'native' , {
0 commit comments