Skip to content

Commit 34e9f7e

Browse files
committed
Add describe option that can be set to false
1 parent cc688c6 commit 34e9f7e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/connection.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,11 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
211211
function unnamed(q) {
212212
return Buffer.concat([
213213
Parse(q.statement.string, q.parameters, q.statement.types),
214+
Bind(q.parameters, q.statement.types, q.statement.name, q.cursorName),
214215
DescribeUnnamed,
215-
prepared(q)
216+
q.cursorFn
217+
? Execute('', q.cursorRows)
218+
: ExecuteUnnamed
216219
])
217220
}
218221

@@ -230,7 +233,7 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
230233
q.onlyDescribe && (delete statements[q.signature])
231234
q.parameters = q.parameters || parameters
232235
q.prepared = q.prepare && q.signature in statements
233-
q.describeFirst = q.onlyDescribe || (parameters.length && !q.prepared)
236+
q.describeFirst = options.describe !== false && (q.onlyDescribe || (parameters.length && !q.prepared))
234237
q.statement = q.prepared
235238
? statements[q.signature]
236239
: { string, types, name: q.prepare ? statementId + statementCount++ : '' }

src/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ function parseOptions(a, b) {
454454
backoff : backoff,
455455
keep_alive : 60,
456456
prepare : true,
457+
describe : true,
457458
debug : false,
458459
fetch_types : true,
459460
publications : 'alltables',

0 commit comments

Comments
 (0)