pg-promise 11.5.4 → 11.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/lib/database.js +1 -1
- package/lib/formatting.js +5 -4
- package/lib/helpers/column.js +2 -2
- package/lib/main.js +1 -1
- package/lib/query.js +1 -3
- package/lib/utils/index.js +1 -1
- package/lib/utils/public.js +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -2,8 +2,8 @@ pg-promise
|
|
|
2
2
|
==========
|
|
3
3
|
|
|
4
4
|
[](https://github.com/vitaly-t/pg-promise/actions?query=workflow%3Aci+branch%3Amaster)
|
|
5
|
-
[](https://nodejs.org)
|
|
6
|
+
[](https://www.postgresql.org)
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
package/lib/database.js
CHANGED
package/lib/formatting.js
CHANGED
|
@@ -170,7 +170,7 @@ const formatAs = {
|
|
|
170
170
|
array({query, array, raw, options}) {
|
|
171
171
|
options = options && typeof options === 'object' ? options : {};
|
|
172
172
|
return query.replace(npm.patterns.multipleValues, name => {
|
|
173
|
-
const v = formatAs.stripName(name.
|
|
173
|
+
const v = formatAs.stripName(name.substring(1), raw);
|
|
174
174
|
const idx = v.name - 1;
|
|
175
175
|
if (idx >= maxVariable) {
|
|
176
176
|
throw new RangeError(`Variable $${v.name} exceeds supported maximum of $${maxVariable}`);
|
|
@@ -200,7 +200,7 @@ const formatAs = {
|
|
|
200
200
|
const mod = name.match(npm.patterns.hasValidModifier);
|
|
201
201
|
if (mod) {
|
|
202
202
|
return {
|
|
203
|
-
name: name.
|
|
203
|
+
name: name.substring(0, mod.index),
|
|
204
204
|
fm: fmMap[mod[0]] | (raw ? fmFlags.raw : 0)
|
|
205
205
|
};
|
|
206
206
|
}
|
|
@@ -839,7 +839,7 @@ const $as = {
|
|
|
839
839
|
* - `obj` - the formatting object, and is the same as `this` context
|
|
840
840
|
*
|
|
841
841
|
* - For $[Index Variables] formatting:
|
|
842
|
-
* - `index` - element's index (starts with 1) that's outside
|
|
842
|
+
* - `index` - element's index (starts with 1) that's outside the input array
|
|
843
843
|
* - `arr` - the formatting/input array, and is the same as `this` context
|
|
844
844
|
*
|
|
845
845
|
* You can tell which type of call it is by checking the type of the first parameter.
|
|
@@ -884,7 +884,8 @@ const $to = {
|
|
|
884
884
|
},
|
|
885
885
|
number(num) {
|
|
886
886
|
if (typeof num === 'bigint' || Number.isFinite(num)) {
|
|
887
|
-
|
|
887
|
+
const s = num.toString();
|
|
888
|
+
return num < 0 ? `(${s})` : s;
|
|
888
889
|
}
|
|
889
890
|
// Converting NaN/+Infinity/-Infinity according to Postgres documentation:
|
|
890
891
|
// http://www.postgresql.org/docs/9.6/static/datatype-numeric.html#DATATYPE-FLOAT
|
package/lib/helpers/column.js
CHANGED
|
@@ -266,11 +266,11 @@ function parseColumn(name) {
|
|
|
266
266
|
const res = {};
|
|
267
267
|
if (name[0] === '?') {
|
|
268
268
|
res.cnd = true;
|
|
269
|
-
name = name.
|
|
269
|
+
name = name.substring(1);
|
|
270
270
|
}
|
|
271
271
|
const mod = name.match(npm.patterns.hasValidModifier);
|
|
272
272
|
if (mod) {
|
|
273
|
-
res.name = name.
|
|
273
|
+
res.name = name.substring(0, mod.index);
|
|
274
274
|
res.mod = mod[0];
|
|
275
275
|
} else {
|
|
276
276
|
res.name = name;
|
package/lib/main.js
CHANGED
package/lib/query.js
CHANGED
|
@@ -263,9 +263,7 @@ function $query(ctx, query, values, qrm, config) {
|
|
|
263
263
|
}
|
|
264
264
|
|
|
265
265
|
// Extends Result to provide iterable for the rows;
|
|
266
|
-
//
|
|
267
|
-
// To be removed once the following PR is merged amd released:
|
|
268
|
-
// https://github.com/brianc/node-postgres/pull/2861
|
|
266
|
+
// See: https://github.com/brianc/node-postgres/pull/2861
|
|
269
267
|
function makeIterable(r) {
|
|
270
268
|
r[Symbol.iterator] = function () {
|
|
271
269
|
return this.rows.values();
|
package/lib/utils/index.js
CHANGED
|
@@ -162,7 +162,7 @@ function addInspection(type, cb) {
|
|
|
162
162
|
// This is for detecting when to skip executing ROLLBACK for a failed transaction.
|
|
163
163
|
function isConnectivityError(err) {
|
|
164
164
|
const code = err && typeof err.code === 'string' && err.code;
|
|
165
|
-
const cls = code && code.
|
|
165
|
+
const cls = code && code.substring(0, 2); // Error Class
|
|
166
166
|
// istanbul ignore next (we cannot test-cover all error cases):
|
|
167
167
|
return code === 'ECONNRESET' || (cls === '08' && code !== '08P01') || (cls === '57' && code !== '57014');
|
|
168
168
|
// Code 'ECONNRESET' - Connectivity issue handled by the driver.
|
package/lib/utils/public.js
CHANGED
|
@@ -39,7 +39,7 @@ const npm = {
|
|
|
39
39
|
*/
|
|
40
40
|
function camelize(text) {
|
|
41
41
|
text = text.replace(/[-_\s.]+(.)?/g, (_, c) => c ? c.toUpperCase() : '');
|
|
42
|
-
return text.
|
|
42
|
+
return text.substring(0, 1).toLowerCase() + text.substring(1);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pg-promise",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.6.0",
|
|
4
4
|
"description": "PostgreSQL interface for Node.js",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "typescript/pg-promise.d.ts",
|
|
@@ -42,22 +42,22 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"assert-options": "0.8.1",
|
|
45
|
-
"pg": "8.11.
|
|
45
|
+
"pg": "8.11.5",
|
|
46
46
|
"pg-minify": "1.6.3",
|
|
47
47
|
"spex": "3.3.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@types/node": "20.5
|
|
50
|
+
"@types/node": "20.12.5",
|
|
51
51
|
"bluebird": "3.7.2",
|
|
52
52
|
"coveralls": "3.1.1",
|
|
53
|
-
"cspell": "
|
|
54
|
-
"eslint": "8.
|
|
53
|
+
"cspell": "8.6.1",
|
|
54
|
+
"eslint": "8.57.0",
|
|
55
55
|
"istanbul": "0.4.5",
|
|
56
56
|
"jasmine-node": "3.0.0",
|
|
57
57
|
"jsdoc": "4.0.2",
|
|
58
58
|
"JSONStream": "1.3.5",
|
|
59
|
-
"pg-query-stream": "4.5.
|
|
59
|
+
"pg-query-stream": "4.5.5",
|
|
60
60
|
"tslint": "6.1.3",
|
|
61
|
-
"typescript": "5.
|
|
61
|
+
"typescript": "5.4.4"
|
|
62
62
|
}
|
|
63
63
|
}
|