We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 80a46e6 commit 4a785bfCopy full SHA for 4a785bf
lib/connection.js
@@ -24,6 +24,7 @@ function Connection(options = {}) {
24
let length = 0
25
let messages = []
26
let timer
27
+ let statement_id = 1
28
let ended
29
let open = false
30
let ready = false
@@ -32,6 +33,7 @@ function Connection(options = {}) {
32
33
34
const queries = Queue()
35
, id = count++
36
+ , uid = Math.random().toString(36).slice(2)
37
, connection = { send, end, destroy }
38
39
const socket = postgresSocket(options, {
@@ -154,7 +156,7 @@ function Connection(options = {}) {
154
156
}
155
157
158
function prepare(sig, str, args, query) {
- query.statement = { name: sig ? 'p' + Math.random().toString(30).slice(2) : '', sig }
159
+ query.statement = { name: sig ? 'p' + uid + statement_id++ : '', sig }
160
return Buffer.concat([
161
frontend.Parse(query.statement.name, str, args),
162
bind(query, args)
0 commit comments