File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ function Connection(options = {}) {
24
24
let length = 0
25
25
let messages = [ ]
26
26
let timer
27
+ let statement_id = 1
27
28
let ended
28
29
let open = false
29
30
let ready = false
@@ -32,6 +33,7 @@ function Connection(options = {}) {
32
33
33
34
const queries = Queue ( )
34
35
, id = count ++
36
+ , uid = Math . random ( ) . toString ( 36 ) . slice ( 2 )
35
37
, connection = { send, end, destroy }
36
38
37
39
const socket = postgresSocket ( options , {
@@ -154,7 +156,7 @@ function Connection(options = {}) {
154
156
}
155
157
156
158
function prepare ( sig , str , args , query ) {
157
- query . statement = { name : sig ? 'p' + Math . random ( ) . toString ( 30 ) . slice ( 2 ) : '' , sig }
159
+ query . statement = { name : sig ? 'p' + uid + statement_id ++ : '' , sig }
158
160
return Buffer . concat ( [
159
161
frontend . Parse ( query . statement . name , str , args ) ,
160
162
bind ( query , args )
You can’t perform that action at this time.
0 commit comments