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 = {}) {
2424 let length = 0
2525 let messages = [ ]
2626 let timer
27+ let statement_id = 1
2728 let ended
2829 let open = false
2930 let ready = false
@@ -32,6 +33,7 @@ function Connection(options = {}) {
3233
3334 const queries = Queue ( )
3435 , id = count ++
36+ , uid = Math . random ( ) . toString ( 36 ) . slice ( 2 )
3537 , connection = { send, end, destroy }
3638
3739 const socket = postgresSocket ( options , {
@@ -154,7 +156,7 @@ function Connection(options = {}) {
154156 }
155157
156158 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 }
158160 return Buffer . concat ( [
159161 frontend . Parse ( query . statement . name , str , args ) ,
160162 bind ( query , args )
You can’t perform that action at this time.
0 commit comments