From 122fdb23e34f92398789210043e04375ff4dc5a7 Mon Sep 17 00:00:00 2001 From: Rasmus Porsager Date: Wed, 10 Apr 2024 00:50:52 +0200 Subject: [PATCH] build --- cf/src/connection.js | 7 +++++-- cf/src/index.js | 1 + cjs/src/connection.js | 7 +++++-- cjs/src/index.js | 1 + deno/src/connection.js | 7 +++++-- deno/src/index.js | 1 + 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/cf/src/connection.js b/cf/src/connection.js index c9231dc6..dab19c44 100644 --- a/cf/src/connection.js +++ b/cf/src/connection.js @@ -213,8 +213,11 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose function unnamed(q) { return Buffer.concat([ Parse(q.statement.string, q.parameters, q.statement.types), + Bind(q.parameters, q.statement.types, q.statement.name, q.cursorName), DescribeUnnamed, - prepared(q) + q.cursorFn + ? Execute('', q.cursorRows) + : ExecuteUnnamed ]) } @@ -232,7 +235,7 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose q.onlyDescribe && (delete statements[q.signature]) q.parameters = q.parameters || parameters q.prepared = q.prepare && q.signature in statements - q.describeFirst = q.onlyDescribe || (parameters.length && !q.prepared) + q.describeFirst = options.describe !== false && (q.onlyDescribe || (parameters.length && !q.prepared)) q.statement = q.prepared ? statements[q.signature] : { string, types, name: q.prepare ? statementId + statementCount++ : '' } diff --git a/cf/src/index.js b/cf/src/index.js index d24e9f9c..9fa12d78 100644 --- a/cf/src/index.js +++ b/cf/src/index.js @@ -455,6 +455,7 @@ function parseOptions(a, b) { backoff : backoff, keep_alive : 60, prepare : true, + describe : true, debug : false, fetch_types : true, publications : 'alltables', diff --git a/cjs/src/connection.js b/cjs/src/connection.js index 10184ca3..0bbb6786 100644 --- a/cjs/src/connection.js +++ b/cjs/src/connection.js @@ -211,8 +211,11 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose function unnamed(q) { return Buffer.concat([ Parse(q.statement.string, q.parameters, q.statement.types), + Bind(q.parameters, q.statement.types, q.statement.name, q.cursorName), DescribeUnnamed, - prepared(q) + q.cursorFn + ? Execute('', q.cursorRows) + : ExecuteUnnamed ]) } @@ -230,7 +233,7 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose q.onlyDescribe && (delete statements[q.signature]) q.parameters = q.parameters || parameters q.prepared = q.prepare && q.signature in statements - q.describeFirst = q.onlyDescribe || (parameters.length && !q.prepared) + q.describeFirst = options.describe !== false && (q.onlyDescribe || (parameters.length && !q.prepared)) q.statement = q.prepared ? statements[q.signature] : { string, types, name: q.prepare ? statementId + statementCount++ : '' } diff --git a/cjs/src/index.js b/cjs/src/index.js index 40ac2c18..34c132ff 100644 --- a/cjs/src/index.js +++ b/cjs/src/index.js @@ -454,6 +454,7 @@ function parseOptions(a, b) { backoff : backoff, keep_alive : 60, prepare : true, + describe : true, debug : false, fetch_types : true, publications : 'alltables', diff --git a/deno/src/connection.js b/deno/src/connection.js index 81f26c08..f26fe43f 100644 --- a/deno/src/connection.js +++ b/deno/src/connection.js @@ -214,8 +214,11 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose function unnamed(q) { return Buffer.concat([ Parse(q.statement.string, q.parameters, q.statement.types), + Bind(q.parameters, q.statement.types, q.statement.name, q.cursorName), DescribeUnnamed, - prepared(q) + q.cursorFn + ? Execute('', q.cursorRows) + : ExecuteUnnamed ]) } @@ -233,7 +236,7 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose q.onlyDescribe && (delete statements[q.signature]) q.parameters = q.parameters || parameters q.prepared = q.prepare && q.signature in statements - q.describeFirst = q.onlyDescribe || (parameters.length && !q.prepared) + q.describeFirst = options.describe !== false && (q.onlyDescribe || (parameters.length && !q.prepared)) q.statement = q.prepared ? statements[q.signature] : { string, types, name: q.prepare ? statementId + statementCount++ : '' } diff --git a/deno/src/index.js b/deno/src/index.js index 3bbdf2ba..ba558364 100644 --- a/deno/src/index.js +++ b/deno/src/index.js @@ -455,6 +455,7 @@ function parseOptions(a, b) { backoff : backoff, keep_alive : 60, prepare : true, + describe : true, debug : false, fetch_types : true, publications : 'alltables',