Skip to content

Commit 5e99d31

Browse files
committed
Fix simple
1 parent a19e436 commit 5e99d31

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

coverage/tmp/coverage-41783-1574895879667-0.json

+1
Large diffs are not rendered by default.

lib/connection.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export default function Connection(options = {}) {
101101
: (backend.query = query)
102102

103103
const buffer = query.simple
104-
? frontend.Query(str)
104+
? simple(str, query)
105105
: statements.has(sig)
106106
? prepared(statements.get(sig), args, query)
107107
: prepare(sig, str, args, query)
@@ -111,6 +111,11 @@ export default function Connection(options = {}) {
111111
: (messages.push(buffer), socket.connect())
112112
}
113113

114+
function simple(str, query) {
115+
query.statement = {}
116+
return frontend.Query(str)
117+
}
118+
114119
function prepared(statement, args, query) {
115120
query.statement = statement
116121
return frontend.Bind(statement.name, args)

lib/frontend.js

+1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ function SASLFinal(type, x, options) {
122122
}
123123
}
124124

125+
/* c8 ignore next */
125126
function authNotImplemented(type) {
126127
throw errors.generic({
127128
message: 'Auth type ' + (authNames[type] || type) + ' not implemented',

lib/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ export default function Postgres(url, options) {
299299
? listeners[x].push(fn)
300300
: (listeners[x] = [fn])
301301

302-
return query({ raw: true}, getListener(), 'listen "' + x + '"').then(() => x)
302+
return query({ raw: true }, getListener(), 'listen "' + x + '"').then(() => x)
303303
}
304304

305305
function getListener() {

0 commit comments

Comments
 (0)