postgrejs 2.15.2 → 2.16.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/CHANGELOG.md +21 -0
- package/esm/connection/bind-param.js +5 -1
- package/esm/connection/connection.js +20 -16
- package/esm/connection/cursor.js +15 -10
- package/esm/connection/intl-connection.js +46 -41
- package/esm/connection/pool.js +32 -28
- package/esm/connection/portal.js +31 -27
- package/esm/connection/prepared-statement.js +35 -31
- package/esm/constants.js +125 -122
- package/esm/data-type-map.js +75 -71
- package/esm/data-types/bool-type.js +10 -7
- package/esm/data-types/box-type.js +10 -7
- package/esm/data-types/bytea-type.js +13 -9
- package/esm/data-types/char-type.js +10 -7
- package/esm/data-types/circle-type.js +10 -7
- package/esm/data-types/date-type.js +15 -12
- package/esm/data-types/float4-type.js +10 -7
- package/esm/data-types/float8-type.js +10 -7
- package/esm/data-types/int2-type.js +13 -10
- package/esm/data-types/int2-vector-type.js +16 -13
- package/esm/data-types/int4-type.js +13 -10
- package/esm/data-types/int8-type.js +12 -9
- package/esm/data-types/json-type.js +12 -9
- package/esm/data-types/jsonb-type.js +14 -11
- package/esm/data-types/lseg-type.js +10 -7
- package/esm/data-types/numeric-type.js +12 -8
- package/esm/data-types/oid-type.js +18 -15
- package/esm/data-types/point-type.js +10 -7
- package/esm/data-types/time-type.js +16 -13
- package/esm/data-types/timestamp-type.js +15 -12
- package/esm/data-types/timestamptz-type.js +15 -12
- package/esm/data-types/uuid-type.js +10 -7
- package/esm/data-types/varchar-type.js +10 -7
- package/esm/index.js +28 -25
- package/esm/interfaces/command-result.js +2 -1
- package/esm/interfaces/data-mapping-options.js +2 -1
- package/esm/interfaces/data-type.js +2 -1
- package/esm/interfaces/database-connection-params.js +2 -1
- package/esm/interfaces/field-info.js +2 -1
- package/esm/interfaces/query-options.js +2 -1
- package/esm/interfaces/query-result.js +2 -1
- package/esm/interfaces/script-execute-options.js +2 -1
- package/esm/interfaces/script-result.js +2 -1
- package/esm/interfaces/statement-prepare-options.js +2 -1
- package/esm/protocol/backend.js +28 -24
- package/esm/protocol/buffer-reader.js +5 -1
- package/esm/protocol/database-error.js +5 -1
- package/esm/protocol/frontend.js +31 -27
- package/esm/protocol/pg-socket.js +53 -48
- package/esm/protocol/protocol.js +5 -2
- package/esm/protocol/sasl.js +11 -7
- package/esm/protocol/smart-buffer.js +10 -5
- package/esm/safe-event-emitter.js +6 -2
- package/esm/types.js +2 -1
- package/esm/util/array-calculatedim.js +4 -1
- package/esm/util/bigint-methods.js +6 -2
- package/esm/util/config-from-env.js +8 -5
- package/esm/util/connection-config.js +13 -8
- package/esm/util/convert-row-to-object.js +4 -1
- package/esm/util/decode-binaryarray.js +6 -3
- package/esm/util/encode-binaryarray.js +8 -5
- package/esm/util/escape-literal.js +4 -1
- package/esm/util/fast-parseint.js +4 -1
- package/esm/util/get-parsers.js +11 -8
- package/esm/util/parse-array.js +4 -1
- package/esm/util/parse-datetime.js +8 -5
- package/esm/util/parse-row.js +4 -1
- package/esm/util/parse-time.js +12 -8
- package/esm/util/stringify-arrayliteral.js +6 -3
- package/esm/util/stringify-for-sql.js +12 -8
- package/esm/util/wrap-row-description.js +9 -6
- package/package.json +23 -16
- package/cjs/package.json +0 -3
- /package/{typings → types}/connection/bind-param.d.ts +0 -0
- /package/{typings → types}/connection/connection.d.ts +0 -0
- /package/{typings → types}/connection/cursor.d.ts +0 -0
- /package/{typings → types}/connection/intl-connection.d.ts +0 -0
- /package/{typings → types}/connection/pool.d.ts +0 -0
- /package/{typings → types}/connection/portal.d.ts +0 -0
- /package/{typings → types}/connection/prepared-statement.d.ts +0 -0
- /package/{typings → types}/constants.d.ts +0 -0
- /package/{typings → types}/data-type-map.d.ts +0 -0
- /package/{typings → types}/data-types/bool-type.d.ts +0 -0
- /package/{typings → types}/data-types/box-type.d.ts +0 -0
- /package/{typings → types}/data-types/bytea-type.d.ts +0 -0
- /package/{typings → types}/data-types/char-type.d.ts +0 -0
- /package/{typings → types}/data-types/circle-type.d.ts +0 -0
- /package/{typings → types}/data-types/date-type.d.ts +0 -0
- /package/{typings → types}/data-types/float4-type.d.ts +0 -0
- /package/{typings → types}/data-types/float8-type.d.ts +0 -0
- /package/{typings → types}/data-types/int2-type.d.ts +0 -0
- /package/{typings → types}/data-types/int2-vector-type.d.ts +0 -0
- /package/{typings → types}/data-types/int4-type.d.ts +0 -0
- /package/{typings → types}/data-types/int8-type.d.ts +0 -0
- /package/{typings → types}/data-types/json-type.d.ts +0 -0
- /package/{typings → types}/data-types/jsonb-type.d.ts +0 -0
- /package/{typings → types}/data-types/lseg-type.d.ts +0 -0
- /package/{typings → types}/data-types/numeric-type.d.ts +0 -0
- /package/{typings → types}/data-types/oid-type.d.ts +0 -0
- /package/{typings → types}/data-types/point-type.d.ts +0 -0
- /package/{typings → types}/data-types/time-type.d.ts +0 -0
- /package/{typings → types}/data-types/timestamp-type.d.ts +0 -0
- /package/{typings → types}/data-types/timestamptz-type.d.ts +0 -0
- /package/{typings → types}/data-types/uuid-type.d.ts +0 -0
- /package/{typings → types}/data-types/varchar-type.d.ts +0 -0
- /package/{typings → types}/index.d.ts +0 -0
- /package/{typings → types}/interfaces/command-result.d.ts +0 -0
- /package/{typings → types}/interfaces/data-mapping-options.d.ts +0 -0
- /package/{typings → types}/interfaces/data-type.d.ts +0 -0
- /package/{typings → types}/interfaces/database-connection-params.d.ts +0 -0
- /package/{typings → types}/interfaces/field-info.d.ts +0 -0
- /package/{typings → types}/interfaces/query-options.d.ts +0 -0
- /package/{typings → types}/interfaces/query-result.d.ts +0 -0
- /package/{typings → types}/interfaces/script-execute-options.d.ts +0 -0
- /package/{typings → types}/interfaces/script-result.d.ts +0 -0
- /package/{typings → types}/interfaces/statement-prepare-options.d.ts +0 -0
- /package/{typings → types}/protocol/backend.d.ts +0 -0
- /package/{typings → types}/protocol/buffer-reader.d.ts +0 -0
- /package/{typings → types}/protocol/database-error.d.ts +0 -0
- /package/{typings → types}/protocol/frontend.d.ts +0 -0
- /package/{typings → types}/protocol/pg-socket.d.ts +0 -0
- /package/{typings → types}/protocol/protocol.d.ts +0 -0
- /package/{typings → types}/protocol/sasl.d.ts +0 -0
- /package/{typings → types}/protocol/smart-buffer.d.ts +0 -0
- /package/{typings → types}/safe-event-emitter.d.ts +0 -0
- /package/{typings → types}/types.d.ts +0 -0
- /package/{typings → types}/util/array-calculatedim.d.ts +0 -0
- /package/{typings → types}/util/bigint-methods.d.ts +0 -0
- /package/{typings → types}/util/config-from-env.d.ts +0 -0
- /package/{typings → types}/util/connection-config.d.ts +0 -0
- /package/{typings → types}/util/convert-row-to-object.d.ts +0 -0
- /package/{typings → types}/util/decode-binaryarray.d.ts +0 -0
- /package/{typings → types}/util/encode-binaryarray.d.ts +0 -0
- /package/{typings → types}/util/escape-literal.d.ts +0 -0
- /package/{typings → types}/util/fast-parseint.d.ts +0 -0
- /package/{typings → types}/util/get-parsers.d.ts +0 -0
- /package/{typings → types}/util/parse-array.d.ts +0 -0
- /package/{typings → types}/util/parse-datetime.d.ts +0 -0
- /package/{typings → types}/util/parse-row.d.ts +0 -0
- /package/{typings → types}/util/parse-time.d.ts +0 -0
- /package/{typings → types}/util/stringify-arrayliteral.d.ts +0 -0
- /package/{typings → types}/util/stringify-for-sql.d.ts +0 -0
- /package/{typings → types}/util/wrap-row-description.d.ts +0 -0
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stringifyArrayLiteral = stringifyArrayLiteral;
|
|
4
|
+
const array_calculatedim_js_1 = require("./array-calculatedim.js");
|
|
5
|
+
function stringifyArrayLiteral(value, options, encode) {
|
|
6
|
+
const dim = (0, array_calculatedim_js_1.arrayCalculateDim)(value);
|
|
4
7
|
const writeDim = (arr, level) => {
|
|
5
8
|
const elemCount = dim[level];
|
|
6
9
|
const out = [];
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stringifyArrayForSQL = stringifyArrayForSQL;
|
|
4
|
+
exports.stringifyValueForSQL = stringifyValueForSQL;
|
|
5
|
+
const uuid_type_js_1 = require("../data-types/uuid-type.js");
|
|
6
|
+
const escape_literal_js_1 = require("./escape-literal.js");
|
|
7
|
+
function stringifyArrayForSQL(v, options, encode) {
|
|
4
8
|
const arr = v.map(x => stringifyValueForSQL(x, options, encode));
|
|
5
9
|
return 'ARRAY[' + arr.join(',') + ']';
|
|
6
10
|
}
|
|
7
|
-
|
|
11
|
+
function stringifyValueForSQL(v, options, encode) {
|
|
8
12
|
if (v == null)
|
|
9
13
|
return 'null';
|
|
10
14
|
if (typeof v === 'boolean')
|
|
@@ -17,9 +21,9 @@ export function stringifyValueForSQL(v, options, encode) {
|
|
|
17
21
|
return '' + v;
|
|
18
22
|
if (typeof v === 'bigint')
|
|
19
23
|
return v.toString();
|
|
20
|
-
if (typeof v === 'string' && UuidType.isType(v))
|
|
21
|
-
return escapeLiteral('' + v) + '::uuid';
|
|
24
|
+
if (typeof v === 'string' && uuid_type_js_1.UuidType.isType(v))
|
|
25
|
+
return (0, escape_literal_js_1.escapeLiteral)('' + v) + '::uuid';
|
|
22
26
|
if (typeof v === 'object')
|
|
23
|
-
return escapeLiteral(JSON.stringify(v)) + '::json';
|
|
24
|
-
return escapeLiteral('' + v);
|
|
27
|
+
return (0, escape_literal_js_1.escapeLiteral)(JSON.stringify(v)) + '::json';
|
|
28
|
+
return (0, escape_literal_js_1.escapeLiteral)('' + v);
|
|
25
29
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.wrapRowDescription = wrapRowDescription;
|
|
4
|
+
const constants_js_1 = require("../constants.js");
|
|
5
|
+
function wrapRowDescription(typeMap, fields, columnFormat) {
|
|
3
6
|
return fields.map((f, idx) => {
|
|
4
7
|
const cf = Array.isArray(columnFormat) ? columnFormat[idx] : columnFormat;
|
|
5
8
|
const x = {
|
|
@@ -7,14 +10,14 @@ export function wrapRowDescription(typeMap, fields, columnFormat) {
|
|
|
7
10
|
tableId: f.tableId,
|
|
8
11
|
columnId: f.columnId,
|
|
9
12
|
dataTypeId: f.dataTypeId,
|
|
10
|
-
dataTypeName: DataTypeNames[f.dataTypeId] || '',
|
|
11
|
-
jsType: cf === DataFormat.binary ? 'Buffer' : 'string',
|
|
13
|
+
dataTypeName: constants_js_1.DataTypeNames[f.dataTypeId] || '',
|
|
14
|
+
jsType: cf === constants_js_1.DataFormat.binary ? 'Buffer' : 'string',
|
|
12
15
|
};
|
|
13
16
|
x.isArray = x.dataTypeName.startsWith('_');
|
|
14
17
|
if (x.isArray) {
|
|
15
18
|
x.elementDataTypeName = x.dataTypeName.substring(1);
|
|
16
|
-
for (const oid of Object.keys(DataTypeNames)) {
|
|
17
|
-
if (DataTypeNames[oid] === x.elementDataTypeName)
|
|
19
|
+
for (const oid of Object.keys(constants_js_1.DataTypeNames)) {
|
|
20
|
+
if (constants_js_1.DataTypeNames[oid] === x.elementDataTypeName)
|
|
18
21
|
x.elementDataTypeId = parseInt(oid, 10);
|
|
19
22
|
}
|
|
20
23
|
}
|
package/package.json
CHANGED
|
@@ -1,37 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "postgrejs",
|
|
3
3
|
"description": "Professional PostgreSQL client NodeJS",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.16.0",
|
|
5
5
|
"author": "Panates",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"doublylinked": "^2.5.4",
|
|
9
|
+
"lightning-pool": "^4.5.0",
|
|
10
|
+
"postgres-bytea": "^3.0.0",
|
|
11
|
+
"power-tasks": "^1.8.0",
|
|
12
|
+
"putil-merge": "^3.13.0",
|
|
13
|
+
"putil-promisify": "^1.10.1",
|
|
14
|
+
"putil-varhelpers": "^1.6.5",
|
|
15
|
+
"tslib": "^2.6.3"
|
|
16
|
+
},
|
|
17
|
+
"main": "./cjs/index.js",
|
|
18
|
+
"module": "./esm/index.js",
|
|
19
|
+
"types": "./types/index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"require": "./cjs/index.js",
|
|
23
|
+
"import": "./esm/index.js",
|
|
24
|
+
"types": "./types/index.d.ts"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
6
27
|
"homepage": "https://postgrejs.panates.com/",
|
|
7
28
|
"contributors": [
|
|
8
29
|
"Eray Hanoglu <e.hanoglu@panates.com>"
|
|
9
30
|
],
|
|
10
|
-
"license": "MIT",
|
|
11
31
|
"repository": {
|
|
12
32
|
"type": "git",
|
|
13
33
|
"url": "https://github.com/panates/postgrejs.git"
|
|
14
34
|
},
|
|
15
|
-
"type": "module",
|
|
16
|
-
"main": "./cjs/index.js",
|
|
17
|
-
"module": "./esm/index.js",
|
|
18
|
-
"types": "typings/index.d.ts",
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"doublylinked": "^2.5.4",
|
|
21
|
-
"lightning-pool": "^4.2.2",
|
|
22
|
-
"postgres-bytea": "^3.0.0",
|
|
23
|
-
"power-tasks": "^1.7.4",
|
|
24
|
-
"putil-merge": "^3.12.1",
|
|
25
|
-
"putil-promisify": "^1.10.1",
|
|
26
|
-
"putil-varhelpers": "^1.6.5"
|
|
27
|
-
},
|
|
28
35
|
"engines": {
|
|
29
36
|
"node": ">=16.0"
|
|
30
37
|
},
|
|
31
38
|
"files": [
|
|
32
39
|
"cjs/",
|
|
33
40
|
"esm/",
|
|
34
|
-
"
|
|
41
|
+
"types/",
|
|
35
42
|
"LICENSE",
|
|
36
43
|
"README.md",
|
|
37
44
|
"CHANGELOG.md"
|
package/cjs/package.json
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|