@@ -24,9 +24,9 @@ function Connection(options = {}) {
24
24
let id = 1
25
25
let ended
26
26
let ready = false
27
+ let statements = { }
27
28
28
29
const queries = Queue ( )
29
- , statements = new Map ( )
30
30
, connection = { send, end, destroy }
31
31
32
32
const socket = postgresSocket ( options , {
@@ -52,8 +52,8 @@ function Connection(options = {}) {
52
52
return connection
53
53
54
54
function onparse ( ) {
55
- if ( backend . query && backend . query . statement . name )
56
- statements [ backend . query . statement . sig ] = backend . query . statement . name
55
+ if ( backend . query && backend . query . statement . sig )
56
+ statements [ backend . query . statement . sig ] = backend . query . statement
57
57
}
58
58
59
59
function onauth ( type , x ) {
@@ -102,8 +102,8 @@ function Connection(options = {}) {
102
102
103
103
const buffer = query . simple
104
104
? simple ( str , query )
105
- : statements . has ( sig )
106
- ? prepared ( statements . get ( sig ) , args , query )
105
+ : sig in statements
106
+ ? prepared ( statements [ sig ] , args , query )
107
107
: prepare ( sig , str , args , query )
108
108
109
109
backend . query || ! ready
@@ -169,7 +169,7 @@ function Connection(options = {}) {
169
169
170
170
function close ( ) {
171
171
error ( errors . connection ( 'CLOSED' , options ) )
172
- statements . clear ( )
172
+ statements = { }
173
173
ready = false
174
174
}
175
175
0 commit comments