File tree 1 file changed +17
-0
lines changed 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,22 @@ function Client_PG(config) {
25
25
inherits ( Client_PG , Client ) ;
26
26
27
27
Object . assign ( Client_PG . prototype , {
28
+ validateConnection ( connection ) {
29
+ // TODO: This is just an experimental fix.
30
+
31
+ const c = connection . connection ;
32
+ // pg has not even attempted to establish a connection yet.
33
+ // Which means: pg will establish a connection upon first use.
34
+ if ( ! c ) {
35
+ return true ;
36
+ }
37
+
38
+ // pg has established a connection already. Let's confirm that
39
+ // it's still connected.
40
+ const s = c . stream ;
41
+ return ! s . connecting || ( s . readable && s . writable ) ;
42
+ } ,
43
+
28
44
queryCompiler ( ) {
29
45
return new QueryCompiler ( this , ...arguments ) ;
30
46
} ,
@@ -124,6 +140,7 @@ Object.assign(Client_PG.prototype, {
124
140
resolver ( connection ) ;
125
141
} ) ;
126
142
}
143
+ console . log ( connection ) ;
127
144
resolver ( connection ) ;
128
145
} ) ;
129
146
} ) . then ( function setSearchPath ( connection ) {
You can’t perform that action at this time.
0 commit comments