Comparing version 2.0.0-beta.1 to 2.0.0-beta.2
@@ -99,3 +99,3 @@ const net = require('net') | ||
process.nextTick(() => ready && ended()) | ||
process.nextTick(() => (ready || !backend.query) && ended()) | ||
@@ -326,3 +326,3 @@ return promise | ||
end: () => { | ||
return new Promise(r => socket ? socket.end(r) : r()) | ||
return new Promise(r => socket && !closed ? (socket.once('close', r), socket.end()) : r()) | ||
}, | ||
@@ -329,0 +329,0 @@ connect |
@@ -203,3 +203,3 @@ const fs = require('fs') | ||
o.first = first | ||
o.rest = rest.flat() | ||
o.rest = rest.reduce((acc, val) => acc.concat(val), []) | ||
return o | ||
@@ -357,3 +357,3 @@ } | ||
delete listeners[channel] | ||
Promise.allSettled(fns.map(fn => listen(channel, fn))) | ||
Promise.all(fns.map(fn => listen(channel, fn).catch(() => { /* noop */ }))) | ||
}) | ||
@@ -360,0 +360,0 @@ } |
@@ -13,3 +13,3 @@ const char = module.exports.char = (acc, [k, v]) => (acc[k.charCodeAt(0)] = v, acc) | ||
to: 0, | ||
from: [21, 23, 26, 700], | ||
from: [21, 23, 26, 700, 701], | ||
serialize: x => '' + x, | ||
@@ -16,0 +16,0 @@ parse: x => +x |
{ | ||
"name": "postgres", | ||
"version": "2.0.0-beta.1", | ||
"version": "2.0.0-beta.2", | ||
"description": "Fastest full featured PostgreSQL client for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -36,6 +36,6 @@ <img align="left" width="440" height="140" alt="Fastest full PostgreSQL nodejs client" src="https://raw.githubusercontent.com/porsager/postgres/master/postgresjs.svg?sanitize=true" /> | ||
await sql` | ||
const users = await sql` | ||
select name, age from users | ||
` | ||
// > [{ name: 'Murray', age: 68 }, { name: 'Walter', age 78 }] | ||
// users: [{ name: 'Murray', age: 68 }, { name: 'Walter', age: 78 }] | ||
``` | ||
@@ -42,0 +42,0 @@ |
74387