postgrejs 2.12.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 +814 -0
- package/LICENSE +21 -0
- package/README.md +200 -0
- package/cjs/connection/bind-param.js +10 -0
- package/cjs/connection/connection.js +279 -0
- package/cjs/connection/cursor.js +93 -0
- package/cjs/connection/intl-connection.js +243 -0
- package/cjs/connection/pool.js +226 -0
- package/cjs/connection/portal.js +148 -0
- package/cjs/connection/prepared-statement.js +217 -0
- package/cjs/constants.js +250 -0
- package/cjs/data-type-map.js +119 -0
- package/cjs/data-types/bool-type.js +27 -0
- package/cjs/data-types/box-type.js +52 -0
- package/cjs/data-types/bytea-type.js +29 -0
- package/cjs/data-types/char-type.js +27 -0
- package/cjs/data-types/circle-type.js +48 -0
- package/cjs/data-types/date-type.js +67 -0
- package/cjs/data-types/float4-type.js +25 -0
- package/cjs/data-types/float8-type.js +25 -0
- package/cjs/data-types/int2-type.js +26 -0
- package/cjs/data-types/int2-vector-type.js +38 -0
- package/cjs/data-types/int4-type.js +26 -0
- package/cjs/data-types/int8-type.js +31 -0
- package/cjs/data-types/json-type.js +38 -0
- package/cjs/data-types/jsonb-type.js +42 -0
- package/cjs/data-types/lseg-type.js +52 -0
- package/cjs/data-types/numeric-type.js +125 -0
- package/cjs/data-types/oid-type.js +32 -0
- package/cjs/data-types/point-type.js +39 -0
- package/cjs/data-types/time-type.js +54 -0
- package/cjs/data-types/timestamp-type.js +81 -0
- package/cjs/data-types/timestamptz-type.js +73 -0
- package/cjs/data-types/uuid-type.js +39 -0
- package/cjs/data-types/varchar-type.js +27 -0
- package/cjs/index.js +41 -0
- package/cjs/interfaces/command-result.js +2 -0
- package/cjs/interfaces/data-mapping-options.js +2 -0
- package/cjs/interfaces/data-type.js +2 -0
- package/cjs/interfaces/database-connection-params.js +2 -0
- package/cjs/interfaces/field-info.js +2 -0
- package/cjs/interfaces/query-options.js +2 -0
- package/cjs/interfaces/query-result.js +2 -0
- package/cjs/interfaces/script-execute-options.js +2 -0
- package/cjs/interfaces/script-result.js +2 -0
- package/cjs/interfaces/statement-prepare-options.js +2 -0
- package/cjs/package.json +3 -0
- package/cjs/protocol/backend.js +256 -0
- package/cjs/protocol/buffer-reader.js +78 -0
- package/cjs/protocol/database-error.js +17 -0
- package/cjs/protocol/frontend.js +218 -0
- package/cjs/protocol/pg-socket.js +345 -0
- package/cjs/protocol/protocol.js +71 -0
- package/cjs/protocol/sasl.js +108 -0
- package/cjs/protocol/smart-buffer.js +195 -0
- package/cjs/safe-event-emitter.js +17 -0
- package/cjs/types.js +2 -0
- package/cjs/util/array-calculatedim.js +19 -0
- package/cjs/util/bigint-methods.js +42 -0
- package/cjs/util/config-from-env.js +30 -0
- package/cjs/util/connection-config.js +65 -0
- package/cjs/util/convert-row-to-object.js +13 -0
- package/cjs/util/decode-binaryarray.js +39 -0
- package/cjs/util/encode-binaryarray.js +45 -0
- package/cjs/util/escape-literal.js +27 -0
- package/cjs/util/fast-parseint.js +32 -0
- package/cjs/util/get-parsers.js +42 -0
- package/cjs/util/parse-array.js +61 -0
- package/cjs/util/parse-datetime.js +38 -0
- package/cjs/util/parse-row.js +11 -0
- package/cjs/util/parse-time.js +29 -0
- package/cjs/util/stringify-arrayliteral.js +38 -0
- package/cjs/util/stringify-for-sql.js +30 -0
- package/cjs/util/wrap-row-description.js +35 -0
- package/esm/connection/bind-param.js +6 -0
- package/esm/connection/connection.js +275 -0
- package/esm/connection/cursor.js +86 -0
- package/esm/connection/intl-connection.js +238 -0
- package/esm/connection/pool.js +222 -0
- package/esm/connection/portal.js +144 -0
- package/esm/connection/prepared-statement.js +213 -0
- package/esm/constants.js +247 -0
- package/esm/data-type-map.js +115 -0
- package/esm/data-types/bool-type.js +24 -0
- package/esm/data-types/box-type.js +49 -0
- package/esm/data-types/bytea-type.js +23 -0
- package/esm/data-types/char-type.js +24 -0
- package/esm/data-types/circle-type.js +45 -0
- package/esm/data-types/date-type.js +64 -0
- package/esm/data-types/float4-type.js +22 -0
- package/esm/data-types/float8-type.js +22 -0
- package/esm/data-types/int2-type.js +23 -0
- package/esm/data-types/int2-vector-type.js +35 -0
- package/esm/data-types/int4-type.js +23 -0
- package/esm/data-types/int8-type.js +28 -0
- package/esm/data-types/json-type.js +35 -0
- package/esm/data-types/jsonb-type.js +39 -0
- package/esm/data-types/lseg-type.js +49 -0
- package/esm/data-types/numeric-type.js +121 -0
- package/esm/data-types/oid-type.js +29 -0
- package/esm/data-types/point-type.js +36 -0
- package/esm/data-types/time-type.js +51 -0
- package/esm/data-types/timestamp-type.js +78 -0
- package/esm/data-types/timestamptz-type.js +70 -0
- package/esm/data-types/uuid-type.js +36 -0
- package/esm/data-types/varchar-type.js +24 -0
- package/esm/index.js +25 -0
- package/esm/interfaces/command-result.js +1 -0
- package/esm/interfaces/data-mapping-options.js +1 -0
- package/esm/interfaces/data-type.js +1 -0
- package/esm/interfaces/database-connection-params.js +1 -0
- package/esm/interfaces/field-info.js +1 -0
- package/esm/interfaces/query-options.js +1 -0
- package/esm/interfaces/query-result.js +1 -0
- package/esm/interfaces/script-execute-options.js +1 -0
- package/esm/interfaces/script-result.js +1 -0
- package/esm/interfaces/statement-prepare-options.js +1 -0
- package/esm/protocol/backend.js +252 -0
- package/esm/protocol/buffer-reader.js +74 -0
- package/esm/protocol/database-error.js +13 -0
- package/esm/protocol/frontend.js +214 -0
- package/esm/protocol/pg-socket.js +338 -0
- package/esm/protocol/protocol.js +68 -0
- package/esm/protocol/sasl.js +102 -0
- package/esm/protocol/smart-buffer.js +168 -0
- package/esm/safe-event-emitter.js +13 -0
- package/esm/types.js +1 -0
- package/esm/util/array-calculatedim.js +15 -0
- package/esm/util/bigint-methods.js +37 -0
- package/esm/util/config-from-env.js +26 -0
- package/esm/util/connection-config.js +57 -0
- package/esm/util/convert-row-to-object.js +9 -0
- package/esm/util/decode-binaryarray.js +35 -0
- package/esm/util/encode-binaryarray.js +41 -0
- package/esm/util/escape-literal.js +23 -0
- package/esm/util/fast-parseint.js +28 -0
- package/esm/util/get-parsers.js +38 -0
- package/esm/util/parse-array.js +57 -0
- package/esm/util/parse-datetime.js +34 -0
- package/esm/util/parse-row.js +7 -0
- package/esm/util/parse-time.js +25 -0
- package/esm/util/stringify-arrayliteral.js +34 -0
- package/esm/util/stringify-for-sql.js +25 -0
- package/esm/util/wrap-row-description.js +31 -0
- package/package.json +54 -0
- package/typings/connection/bind-param.d.ts +6 -0
- package/typings/connection/connection.d.ts +110 -0
- package/typings/connection/cursor.d.ts +25 -0
- package/typings/connection/intl-connection.d.ts +40 -0
- package/typings/connection/pool.d.ts +52 -0
- package/typings/connection/portal.d.ts +23 -0
- package/typings/connection/prepared-statement.d.ts +27 -0
- package/typings/constants.d.ts +130 -0
- package/typings/data-type-map.d.ts +11 -0
- package/typings/data-types/bool-type.d.ts +3 -0
- package/typings/data-types/box-type.d.ts +3 -0
- package/typings/data-types/bytea-type.d.ts +3 -0
- package/typings/data-types/char-type.d.ts +3 -0
- package/typings/data-types/circle-type.d.ts +3 -0
- package/typings/data-types/date-type.d.ts +3 -0
- package/typings/data-types/float4-type.d.ts +3 -0
- package/typings/data-types/float8-type.d.ts +3 -0
- package/typings/data-types/int2-type.d.ts +3 -0
- package/typings/data-types/int2-vector-type.d.ts +3 -0
- package/typings/data-types/int4-type.d.ts +3 -0
- package/typings/data-types/int8-type.d.ts +3 -0
- package/typings/data-types/json-type.d.ts +3 -0
- package/typings/data-types/jsonb-type.d.ts +3 -0
- package/typings/data-types/lseg-type.d.ts +3 -0
- package/typings/data-types/numeric-type.d.ts +12 -0
- package/typings/data-types/oid-type.d.ts +4 -0
- package/typings/data-types/point-type.d.ts +3 -0
- package/typings/data-types/time-type.d.ts +3 -0
- package/typings/data-types/timestamp-type.d.ts +3 -0
- package/typings/data-types/timestamptz-type.d.ts +3 -0
- package/typings/data-types/uuid-type.d.ts +3 -0
- package/typings/data-types/varchar-type.d.ts +3 -0
- package/typings/index.d.ts +25 -0
- package/typings/interfaces/command-result.d.ts +28 -0
- package/typings/interfaces/data-mapping-options.d.ts +9 -0
- package/typings/interfaces/data-type.d.ts +31 -0
- package/typings/interfaces/database-connection-params.d.ts +38 -0
- package/typings/interfaces/field-info.d.ts +46 -0
- package/typings/interfaces/query-options.d.ts +46 -0
- package/typings/interfaces/query-result.d.ts +8 -0
- package/typings/interfaces/script-execute-options.d.ts +26 -0
- package/typings/interfaces/script-result.d.ts +15 -0
- package/typings/interfaces/statement-prepare-options.d.ts +13 -0
- package/typings/protocol/backend.d.ts +9 -0
- package/typings/protocol/buffer-reader.d.ts +18 -0
- package/typings/protocol/database-error.d.ts +20 -0
- package/typings/protocol/frontend.d.ts +59 -0
- package/typings/protocol/pg-socket.d.ts +51 -0
- package/typings/protocol/protocol.d.ts +180 -0
- package/typings/protocol/sasl.d.ts +13 -0
- package/typings/protocol/smart-buffer.d.ts +39 -0
- package/typings/safe-event-emitter.d.ts +5 -0
- package/typings/types.d.ts +15 -0
- package/typings/util/array-calculatedim.d.ts +1 -0
- package/typings/util/bigint-methods.d.ts +3 -0
- package/typings/util/config-from-env.d.ts +2 -0
- package/typings/util/connection-config.d.ts +3 -0
- package/typings/util/convert-row-to-object.d.ts +2 -0
- package/typings/util/decode-binaryarray.d.ts +4 -0
- package/typings/util/encode-binaryarray.d.ts +5 -0
- package/typings/util/escape-literal.d.ts +1 -0
- package/typings/util/fast-parseint.d.ts +1 -0
- package/typings/util/get-parsers.d.ts +4 -0
- package/typings/util/parse-array.d.ts +5 -0
- package/typings/util/parse-datetime.d.ts +1 -0
- package/typings/util/parse-row.d.ts +3 -0
- package/typings/util/parse-time.d.ts +3 -0
- package/typings/util/stringify-arrayliteral.d.ts +3 -0
- package/typings/util/stringify-for-sql.d.ts +4 -0
- package/typings/util/wrap-row-description.d.ts +5 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { DataTypeOIDs } from '../constants.js';
|
|
2
|
+
const CIRCLE_PATTERN1 = /^< *\( *(-?\d+\.?\d*) *, *(-?\d+\.?\d*) *\) *, *(-?\d+\.?\d*) *>$/;
|
|
3
|
+
const CIRCLE_PATTERN2 = /^\( *\( *(-?\d+\.?\d*) *, *(-?\d+\.?\d*) *\) *, *(-?\d+\.?\d*) *\)$/;
|
|
4
|
+
const CIRCLE_PATTERN3 = /^\( *(-?\d+\.?\d*) *, *(-?\d+\.?\d*) *\) *, *(-?\d+\.?\d*)$/;
|
|
5
|
+
const CIRCLE_PATTERN4 = /^(-?\d+\.?\d*) *, *(-?\d+\.?\d*) *, *(-?\d+\.?\d*)$/;
|
|
6
|
+
export const CircleType = {
|
|
7
|
+
name: 'circle',
|
|
8
|
+
oid: DataTypeOIDs.circle,
|
|
9
|
+
jsType: 'object',
|
|
10
|
+
parseBinary(v) {
|
|
11
|
+
return {
|
|
12
|
+
x: v.readDoubleBE(0),
|
|
13
|
+
y: v.readDoubleBE(8),
|
|
14
|
+
r: v.readDoubleBE(16),
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
encodeBinary(buf, v) {
|
|
18
|
+
buf.writeDoubleBE(v.x);
|
|
19
|
+
buf.writeDoubleBE(v.y);
|
|
20
|
+
buf.writeDoubleBE(v.r);
|
|
21
|
+
},
|
|
22
|
+
parseText(v) {
|
|
23
|
+
const m = v.match(CIRCLE_PATTERN1) || v.match(CIRCLE_PATTERN2) || v.match(CIRCLE_PATTERN3) || v.match(CIRCLE_PATTERN4);
|
|
24
|
+
if (!m)
|
|
25
|
+
return undefined;
|
|
26
|
+
return {
|
|
27
|
+
x: parseFloat(m[1]),
|
|
28
|
+
y: parseFloat(m[2]),
|
|
29
|
+
r: parseFloat(m[3]),
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
isType(v) {
|
|
33
|
+
return (typeof v === 'object' &&
|
|
34
|
+
Object.keys(v).length === 3 &&
|
|
35
|
+
typeof v.x === 'number' &&
|
|
36
|
+
typeof v.y === 'number' &&
|
|
37
|
+
typeof v.r === 'number');
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
export const ArrayCircleType = {
|
|
41
|
+
...CircleType,
|
|
42
|
+
name: '_circle',
|
|
43
|
+
oid: DataTypeOIDs._circle,
|
|
44
|
+
elementsOID: DataTypeOIDs.circle,
|
|
45
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { DataTypeOIDs } from '../constants.js';
|
|
2
|
+
import { parseDateTime } from '../util/parse-datetime.js';
|
|
3
|
+
const timeShift = 946684800000;
|
|
4
|
+
export const DateType = {
|
|
5
|
+
name: 'date',
|
|
6
|
+
oid: DataTypeOIDs.date,
|
|
7
|
+
jsType: 'Date',
|
|
8
|
+
parseBinary(v, options) {
|
|
9
|
+
const fetchAsString = options.fetchAsString && options.fetchAsString.includes(DataTypeOIDs.date);
|
|
10
|
+
const t = v.readInt32BE();
|
|
11
|
+
if (t === 0x7fffffff)
|
|
12
|
+
return fetchAsString ? 'infinity' : Infinity;
|
|
13
|
+
if (t === -0x80000000)
|
|
14
|
+
return fetchAsString ? '-infinity' : -Infinity;
|
|
15
|
+
// Shift from 2000 to 1970
|
|
16
|
+
let d = new Date(t * 1000 * 86400 + timeShift);
|
|
17
|
+
if (fetchAsString || !options.utcDates)
|
|
18
|
+
d = new Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate());
|
|
19
|
+
return fetchAsString ? dateToDateString(d) : d;
|
|
20
|
+
},
|
|
21
|
+
encodeBinary(buf, v, options) {
|
|
22
|
+
if (typeof v === 'string')
|
|
23
|
+
v = parseDateTime(v, false, false, options.utcDates);
|
|
24
|
+
if (v === Infinity) {
|
|
25
|
+
buf.writeInt32BE(0x7fffffff);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (v === -Infinity) {
|
|
29
|
+
buf.writeInt32BE(-0x80000000);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (!(v instanceof Date))
|
|
33
|
+
v = new Date(v);
|
|
34
|
+
let n = options.utcDates ? v.getTime() : v.getTime() - v.getTimezoneOffset() * 60 * 1000;
|
|
35
|
+
n = (n - timeShift) / 1000 / 86400;
|
|
36
|
+
const t = Math.trunc(n + Number.EPSILON);
|
|
37
|
+
buf.writeInt32BE(t);
|
|
38
|
+
},
|
|
39
|
+
parseText(v, options) {
|
|
40
|
+
const fetchAsString = options.fetchAsString && options.fetchAsString.includes(DataTypeOIDs.date);
|
|
41
|
+
if (fetchAsString)
|
|
42
|
+
return v;
|
|
43
|
+
return parseDateTime(v, false, false, options.utcDates);
|
|
44
|
+
},
|
|
45
|
+
isType(v) {
|
|
46
|
+
return (v instanceof Date &&
|
|
47
|
+
v.getHours() === 0 &&
|
|
48
|
+
v.getMinutes() === 0 &&
|
|
49
|
+
v.getSeconds() === 0 &&
|
|
50
|
+
v.getMilliseconds() === 0);
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
function padZero(v) {
|
|
54
|
+
return v < 9 ? '0' + v : '' + v;
|
|
55
|
+
}
|
|
56
|
+
function dateToDateString(d) {
|
|
57
|
+
return d.getFullYear() + '-' + padZero(d.getMonth() + 1) + '-' + padZero(d.getDate());
|
|
58
|
+
}
|
|
59
|
+
export const ArrayDateType = {
|
|
60
|
+
...DateType,
|
|
61
|
+
name: '_date',
|
|
62
|
+
oid: DataTypeOIDs._date,
|
|
63
|
+
elementsOID: DataTypeOIDs.date,
|
|
64
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DataTypeOIDs } from '../constants.js';
|
|
2
|
+
export const Float4Type = {
|
|
3
|
+
name: 'float4',
|
|
4
|
+
oid: DataTypeOIDs.float4,
|
|
5
|
+
jsType: 'number',
|
|
6
|
+
parseBinary(v) {
|
|
7
|
+
return Math.round((v.readFloatBE(0) + Number.EPSILON) * 100) / 100;
|
|
8
|
+
},
|
|
9
|
+
encodeBinary(buf, v) {
|
|
10
|
+
buf.writeFloatBE(typeof v === 'number' ? v : parseFloat(v));
|
|
11
|
+
},
|
|
12
|
+
parseText: parseFloat,
|
|
13
|
+
isType(v) {
|
|
14
|
+
return typeof v === 'number';
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
export const ArrayFloat4Type = {
|
|
18
|
+
...Float4Type,
|
|
19
|
+
name: '_float4',
|
|
20
|
+
oid: DataTypeOIDs._float4,
|
|
21
|
+
elementsOID: DataTypeOIDs.float4,
|
|
22
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DataTypeOIDs } from '../constants.js';
|
|
2
|
+
export const Float8Type = {
|
|
3
|
+
name: 'float8',
|
|
4
|
+
oid: DataTypeOIDs.float8,
|
|
5
|
+
jsType: 'number',
|
|
6
|
+
parseBinary(v) {
|
|
7
|
+
return v.readDoubleBE(0);
|
|
8
|
+
},
|
|
9
|
+
encodeBinary(buf, v) {
|
|
10
|
+
buf.writeDoubleBE(typeof v === 'number' ? v : parseFloat(v));
|
|
11
|
+
},
|
|
12
|
+
parseText: parseFloat,
|
|
13
|
+
isType(v) {
|
|
14
|
+
return typeof v === 'number';
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
export const ArrayFloat8Type = {
|
|
18
|
+
...Float8Type,
|
|
19
|
+
name: '_float8',
|
|
20
|
+
oid: DataTypeOIDs._float8,
|
|
21
|
+
elementsOID: DataTypeOIDs.float8,
|
|
22
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DataTypeOIDs } from '../constants.js';
|
|
2
|
+
import { fastParseInt } from '../util/fast-parseint.js';
|
|
3
|
+
export const Int2Type = {
|
|
4
|
+
name: 'int2',
|
|
5
|
+
oid: DataTypeOIDs.int2,
|
|
6
|
+
jsType: 'number',
|
|
7
|
+
parseBinary(v) {
|
|
8
|
+
return v.readInt16BE(0);
|
|
9
|
+
},
|
|
10
|
+
encodeBinary(buf, v) {
|
|
11
|
+
buf.writeInt16BE(fastParseInt(v));
|
|
12
|
+
},
|
|
13
|
+
parseText: fastParseInt,
|
|
14
|
+
isType(v) {
|
|
15
|
+
return typeof v === 'number' && Number.isInteger(v) && v >= -32768 && v <= 32767;
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
export const ArrayInt2Type = {
|
|
19
|
+
...Int2Type,
|
|
20
|
+
name: '_int2',
|
|
21
|
+
oid: DataTypeOIDs._int2,
|
|
22
|
+
elementsOID: DataTypeOIDs.int2,
|
|
23
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { DataTypeOIDs } from '../constants.js';
|
|
2
|
+
import { decodeBinaryArray } from '../util/decode-binaryarray.js';
|
|
3
|
+
import { encodeBinaryArray } from '../util/encode-binaryarray.js';
|
|
4
|
+
import { fastParseInt } from '../util/fast-parseint.js';
|
|
5
|
+
export const Int2VectorType = {
|
|
6
|
+
name: 'int2vector',
|
|
7
|
+
oid: DataTypeOIDs.int2vector,
|
|
8
|
+
jsType: 'array',
|
|
9
|
+
parseBinary(v) {
|
|
10
|
+
return decodeBinaryArray(v, b => b.readInt16BE()) || undefined;
|
|
11
|
+
},
|
|
12
|
+
encodeBinary(buf, v) {
|
|
13
|
+
encodeBinaryArray(buf, v, DataTypeOIDs.int2, {}, (io, x) => {
|
|
14
|
+
io.writeInt16BE(x);
|
|
15
|
+
});
|
|
16
|
+
},
|
|
17
|
+
encodeCalculateDim(v) {
|
|
18
|
+
return [v.length];
|
|
19
|
+
},
|
|
20
|
+
parseText(str) {
|
|
21
|
+
return str.split(' ').map(fastParseInt);
|
|
22
|
+
},
|
|
23
|
+
encodeText(v) {
|
|
24
|
+
return v.join(' ');
|
|
25
|
+
},
|
|
26
|
+
isType(v) {
|
|
27
|
+
return (Array.isArray(v) && !v.find(x => !(typeof x === 'number' && Number.isInteger(x) && x >= -32768 && x <= 32767)));
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export const ArrayInt2VectorType = {
|
|
31
|
+
...Int2VectorType,
|
|
32
|
+
name: '_int2vector',
|
|
33
|
+
oid: DataTypeOIDs._int2vector,
|
|
34
|
+
elementsOID: DataTypeOIDs.int2vector,
|
|
35
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DataTypeOIDs } from '../constants.js';
|
|
2
|
+
import { fastParseInt } from '../util/fast-parseint.js';
|
|
3
|
+
export const Int4Type = {
|
|
4
|
+
name: 'int4',
|
|
5
|
+
oid: DataTypeOIDs.int4,
|
|
6
|
+
jsType: 'number',
|
|
7
|
+
parseBinary(v) {
|
|
8
|
+
return v.readInt32BE(0);
|
|
9
|
+
},
|
|
10
|
+
encodeBinary(buf, v) {
|
|
11
|
+
buf.writeInt32BE(fastParseInt(v));
|
|
12
|
+
},
|
|
13
|
+
parseText: fastParseInt,
|
|
14
|
+
isType(v) {
|
|
15
|
+
return typeof v === 'number' && Number.isInteger(v) && v <= Number.MAX_SAFE_INTEGER;
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
export const ArrayInt4Type = {
|
|
19
|
+
...Int4Type,
|
|
20
|
+
name: '_int4',
|
|
21
|
+
oid: DataTypeOIDs._int4,
|
|
22
|
+
elementsOID: DataTypeOIDs.int4,
|
|
23
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DataTypeOIDs } from '../constants.js';
|
|
2
|
+
import { readBigInt64BE } from '../util/bigint-methods.js';
|
|
3
|
+
const maxSafeInteger = BigInt(Number.MAX_SAFE_INTEGER);
|
|
4
|
+
export const Int8Type = {
|
|
5
|
+
name: 'int8',
|
|
6
|
+
oid: DataTypeOIDs.int8,
|
|
7
|
+
jsType: 'BigInt',
|
|
8
|
+
parseBinary(buf) {
|
|
9
|
+
const v = typeof buf.readBigInt64BE === 'function' ? buf.readBigInt64BE(0) : readBigInt64BE(buf);
|
|
10
|
+
return v >= -maxSafeInteger && v <= maxSafeInteger ? Number(v) : v;
|
|
11
|
+
},
|
|
12
|
+
encodeBinary(buf, v) {
|
|
13
|
+
buf.writeBigInt64BE(v);
|
|
14
|
+
},
|
|
15
|
+
parseText(s) {
|
|
16
|
+
const v = BigInt(s);
|
|
17
|
+
return v >= -maxSafeInteger && v <= maxSafeInteger ? Number(v) : v;
|
|
18
|
+
},
|
|
19
|
+
isType(v) {
|
|
20
|
+
return typeof v === 'bigint' || (typeof v === 'number' && Number.isInteger(v) && v > Number.MAX_SAFE_INTEGER);
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
export const ArrayInt8Type = {
|
|
24
|
+
...Int8Type,
|
|
25
|
+
name: '_int8',
|
|
26
|
+
oid: DataTypeOIDs._int8,
|
|
27
|
+
elementsOID: DataTypeOIDs.int8,
|
|
28
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { DataTypeOIDs } from '../constants.js';
|
|
2
|
+
export const JsonType = {
|
|
3
|
+
name: 'json',
|
|
4
|
+
oid: DataTypeOIDs.json,
|
|
5
|
+
jsType: 'string',
|
|
6
|
+
parseBinary(v, options) {
|
|
7
|
+
const content = v.toString('utf8');
|
|
8
|
+
const fetchAsString = options.fetchAsString && options.fetchAsString.includes(DataTypeOIDs.jsonb);
|
|
9
|
+
if (fetchAsString)
|
|
10
|
+
return content;
|
|
11
|
+
return content ? JSON.parse(content) : undefined;
|
|
12
|
+
},
|
|
13
|
+
encodeText(v) {
|
|
14
|
+
if (typeof v === 'object' || typeof v === 'bigint')
|
|
15
|
+
return JSON.stringify(v);
|
|
16
|
+
if (typeof v === 'boolean')
|
|
17
|
+
return v ? 'true' : 'false';
|
|
18
|
+
return '' + v;
|
|
19
|
+
},
|
|
20
|
+
parseText(v, options) {
|
|
21
|
+
const fetchAsString = options.fetchAsString && options.fetchAsString.includes(DataTypeOIDs.jsonb);
|
|
22
|
+
if (fetchAsString)
|
|
23
|
+
return v;
|
|
24
|
+
return v ? JSON.parse(v) : null;
|
|
25
|
+
},
|
|
26
|
+
isType(v) {
|
|
27
|
+
return v && typeof v === 'object';
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export const ArrayJsonType = {
|
|
31
|
+
...JsonType,
|
|
32
|
+
name: '_json',
|
|
33
|
+
oid: DataTypeOIDs._json,
|
|
34
|
+
elementsOID: DataTypeOIDs.json,
|
|
35
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DataTypeOIDs } from '../constants.js';
|
|
2
|
+
import { BufferReader } from '../protocol/buffer-reader.js';
|
|
3
|
+
export const JsonbType = {
|
|
4
|
+
name: 'jsonb',
|
|
5
|
+
oid: DataTypeOIDs.jsonb,
|
|
6
|
+
jsType: 'string',
|
|
7
|
+
parseBinary(v, options) {
|
|
8
|
+
const buf = new BufferReader(v);
|
|
9
|
+
if (buf.readUInt8() !== 1)
|
|
10
|
+
throw new Error('Unexpected Jsonb version value in header');
|
|
11
|
+
const fetchAsString = options.fetchAsString && options.fetchAsString.includes(DataTypeOIDs.json);
|
|
12
|
+
const content = buf.readLString(buf.length - buf.offset);
|
|
13
|
+
if (fetchAsString)
|
|
14
|
+
return content;
|
|
15
|
+
return content ? JSON.parse(content) : undefined;
|
|
16
|
+
},
|
|
17
|
+
encodeText(v) {
|
|
18
|
+
if (typeof v === 'object' || typeof v === 'bigint')
|
|
19
|
+
return JSON.stringify(v);
|
|
20
|
+
if (typeof v === 'boolean')
|
|
21
|
+
return v ? 'true' : 'false';
|
|
22
|
+
return '\x0001' + v;
|
|
23
|
+
},
|
|
24
|
+
parseText(v, options) {
|
|
25
|
+
const fetchAsString = options.fetchAsString && options.fetchAsString.includes(DataTypeOIDs.json);
|
|
26
|
+
if (fetchAsString)
|
|
27
|
+
return v;
|
|
28
|
+
return v ? JSON.parse(v) : null;
|
|
29
|
+
},
|
|
30
|
+
isType(v) {
|
|
31
|
+
return v && typeof v === 'object';
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export const ArrayJsonbType = {
|
|
35
|
+
...JsonbType,
|
|
36
|
+
name: '_jsonb',
|
|
37
|
+
oid: DataTypeOIDs._jsonb,
|
|
38
|
+
elementsOID: DataTypeOIDs.jsonb,
|
|
39
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { DataTypeOIDs } from '../constants.js';
|
|
2
|
+
const LSEG_PATTERN1 = /^\[ *\( *(-?\d+\.?\d*) *, *(-?\d+\.?\d*) *\) *, *\( *(-?\d+\.?\d*) *, *(-?\d+\.?\d*) *\) *]$/;
|
|
3
|
+
const LSEG_PATTERN2 = /^\( *\( *(-?\d+\.?\d*) *, *(-?\d+\.?\d*) *\) *, *\( *(-?\d+\.?\d*) *, *(-?\d+\.?\d*) *\) *\)$/;
|
|
4
|
+
const LSEG_PATTERN3 = /^\( *(-?\d+\.?\d*) *, *(-?\d+\.?\d*) *\) *, *\( *(-?\d+\.?\d*) *, *(-?\d+\.?\d*) *\)$/;
|
|
5
|
+
const LSEG_PATTERN4 = /^(-?\d+\.?\d*) *, *(-?\d+\.?\d*) *, *(-?\d+\.?\d*) *, *(-?\d+\.?\d*)$/;
|
|
6
|
+
export const LsegType = {
|
|
7
|
+
name: 'lseg',
|
|
8
|
+
oid: DataTypeOIDs.lseg,
|
|
9
|
+
jsType: 'object',
|
|
10
|
+
parseBinary(v) {
|
|
11
|
+
return {
|
|
12
|
+
x1: v.readDoubleBE(0),
|
|
13
|
+
y1: v.readDoubleBE(8),
|
|
14
|
+
x2: v.readDoubleBE(16),
|
|
15
|
+
y2: v.readDoubleBE(24),
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
encodeBinary(buf, v) {
|
|
19
|
+
buf.writeDoubleBE(v.x1);
|
|
20
|
+
buf.writeDoubleBE(v.y1);
|
|
21
|
+
buf.writeDoubleBE(v.x2);
|
|
22
|
+
buf.writeDoubleBE(v.y2);
|
|
23
|
+
},
|
|
24
|
+
parseText(v) {
|
|
25
|
+
const m = v.match(LSEG_PATTERN1) || v.match(LSEG_PATTERN2) || v.match(LSEG_PATTERN3) || v.match(LSEG_PATTERN4);
|
|
26
|
+
if (!m)
|
|
27
|
+
return undefined;
|
|
28
|
+
return {
|
|
29
|
+
x1: parseFloat(m[1]),
|
|
30
|
+
y1: parseFloat(m[2]),
|
|
31
|
+
x2: parseFloat(m[3]),
|
|
32
|
+
y2: parseFloat(m[4]),
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
isType(v) {
|
|
36
|
+
return (typeof v === 'object' &&
|
|
37
|
+
Object.keys(v).length === 4 &&
|
|
38
|
+
typeof v.x1 === 'number' &&
|
|
39
|
+
typeof v.y1 === 'number' &&
|
|
40
|
+
typeof v.x2 === 'number' &&
|
|
41
|
+
typeof v.y2 === 'number');
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
export const ArrayLsegType = {
|
|
45
|
+
...LsegType,
|
|
46
|
+
name: '_lseg',
|
|
47
|
+
oid: DataTypeOIDs._lseg,
|
|
48
|
+
elementsOID: DataTypeOIDs.lseg,
|
|
49
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { DataTypeOIDs } from '../constants.js';
|
|
2
|
+
const NUMERIC_NEG = 0x4000;
|
|
3
|
+
const NUMERIC_NAN = 0xc000;
|
|
4
|
+
const DEC_DIGITS = 4;
|
|
5
|
+
const ROUND_POWERS = [0, 1000, 100, 10];
|
|
6
|
+
export const NumericType = {
|
|
7
|
+
name: 'numeric',
|
|
8
|
+
oid: DataTypeOIDs.numeric,
|
|
9
|
+
jsType: 'number',
|
|
10
|
+
parseBinary(v) {
|
|
11
|
+
const len = v.readInt16BE();
|
|
12
|
+
const weight = v.readInt16BE(2);
|
|
13
|
+
const sign = v.readInt16BE(4);
|
|
14
|
+
const scale = v.readInt16BE(6);
|
|
15
|
+
if (sign === NUMERIC_NAN)
|
|
16
|
+
return NaN;
|
|
17
|
+
const digits = [];
|
|
18
|
+
for (let i = 0; i < len; i++) {
|
|
19
|
+
digits[i] = v.readInt16BE(8 + i * 2);
|
|
20
|
+
}
|
|
21
|
+
const numString = numberBytesToString(digits, scale, weight, sign);
|
|
22
|
+
return parseFloat(numString);
|
|
23
|
+
},
|
|
24
|
+
encodeText(v) {
|
|
25
|
+
const n = typeof v === 'number' ? v : parseFloat(v);
|
|
26
|
+
return '' + n;
|
|
27
|
+
},
|
|
28
|
+
parseText: parseFloat,
|
|
29
|
+
isType(v) {
|
|
30
|
+
return typeof v === 'number';
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
export const ArrayNumericType = {
|
|
34
|
+
...NumericType,
|
|
35
|
+
name: '_numeric',
|
|
36
|
+
oid: DataTypeOIDs._numeric,
|
|
37
|
+
elementsOID: DataTypeOIDs.numeric,
|
|
38
|
+
};
|
|
39
|
+
/* https://github.com/pgjdbc/pgjdbc/blob/3eca3a76aa4a04cb28cb960ed674cb67db30b5e3/pgjdbc/src/main/java/org/postgresql/util/ByteConverter.java */
|
|
40
|
+
/**
|
|
41
|
+
* Convert a number from binary representation to text representation.
|
|
42
|
+
* @param digits array of shorts that can be decoded as the number String
|
|
43
|
+
* @param scale the scale of the number binary representation
|
|
44
|
+
* @param weight the weight of the number binary representation
|
|
45
|
+
* @param sign the sign of the number
|
|
46
|
+
* @return String the number as String
|
|
47
|
+
*/
|
|
48
|
+
export function numberBytesToString(digits, scale, weight, sign) {
|
|
49
|
+
let i;
|
|
50
|
+
let d;
|
|
51
|
+
/*
|
|
52
|
+
* Allocate space for the result.
|
|
53
|
+
*
|
|
54
|
+
* i is set to the # of decimal digits before decimal point.
|
|
55
|
+
* dscale is the # of decimal digits we will print after decimal point.
|
|
56
|
+
* We may generate as many as DEC_DIGITS-1 excess digits at the end, and in addition we
|
|
57
|
+
* need room for sign, decimal point, null terminator.
|
|
58
|
+
*/
|
|
59
|
+
i = (weight + 1) * DEC_DIGITS;
|
|
60
|
+
if (i <= 0)
|
|
61
|
+
i = 1;
|
|
62
|
+
/*
|
|
63
|
+
* Output a dash for negative values
|
|
64
|
+
*/
|
|
65
|
+
let out = sign === NUMERIC_NEG ? '-' : '';
|
|
66
|
+
/*
|
|
67
|
+
* Output all digits before the decimal point
|
|
68
|
+
*/
|
|
69
|
+
if (weight < 0) {
|
|
70
|
+
d = weight + 1;
|
|
71
|
+
out += '0';
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
for (d = 0; d <= weight; d++) {
|
|
75
|
+
/* In the first digit, suppress extra leading decimal zeroes */
|
|
76
|
+
out += digitToString(d, digits, d !== 0);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/*
|
|
80
|
+
* If requested, output a decimal point and all the digits that follow it.
|
|
81
|
+
* We initially put out a multiple of DEC_DIGITS digits, then truncate if
|
|
82
|
+
* needed.
|
|
83
|
+
*/
|
|
84
|
+
if (scale > 0) {
|
|
85
|
+
out += '.';
|
|
86
|
+
for (i = 0; i < scale; d++, i += DEC_DIGITS) {
|
|
87
|
+
out += digitToString(d, digits, true);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const extra = (i - scale) % DEC_DIGITS;
|
|
91
|
+
return out.substr(0, out.length - extra);
|
|
92
|
+
}
|
|
93
|
+
/* https://github.com/pgjdbc/pgjdbc/blob/3eca3a76aa4a04cb28cb960ed674cb67db30b5e3/pgjdbc/src/main/java/org/postgresql/util/ByteConverter.java */
|
|
94
|
+
/**
|
|
95
|
+
* Convert a number from binary representation to text representation.
|
|
96
|
+
* @param idx index of the digit to be converted in the digits array
|
|
97
|
+
* @param digits array of shorts that can be decoded as the number String
|
|
98
|
+
* @param alwaysPutIt a flag that indicate whether or not to put the digit char even if it is zero
|
|
99
|
+
* @return String the number as String
|
|
100
|
+
*/
|
|
101
|
+
function digitToString(idx, digits, alwaysPutIt) {
|
|
102
|
+
let out = '';
|
|
103
|
+
let dig = idx >= 0 && idx < digits.length ? digits[idx] : 0;
|
|
104
|
+
// Each dig represents 4 decimal digits (e.g. 9999)
|
|
105
|
+
// If we continue the number, then we need to print 0 as 0000 (alwaysPutIt parameter is true)
|
|
106
|
+
for (let p = 1; p < ROUND_POWERS.length; p++) {
|
|
107
|
+
const pow = ROUND_POWERS[p];
|
|
108
|
+
const d1 = Math.trunc(dig / pow);
|
|
109
|
+
dig -= d1 * pow;
|
|
110
|
+
const putit = d1 > 0;
|
|
111
|
+
if (putit || alwaysPutIt) {
|
|
112
|
+
out += d1;
|
|
113
|
+
// We printed a character, so we need to print the rest of the current digits in dig
|
|
114
|
+
// For instance, we need to keep printing 000 from 1000 even if idx==0 (== it is the very
|
|
115
|
+
// beginning)
|
|
116
|
+
alwaysPutIt = true;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
out += dig;
|
|
120
|
+
return out;
|
|
121
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DataTypeNames, DataTypeOIDs } from '../constants.js';
|
|
2
|
+
import { fastParseInt } from '../util/fast-parseint.js';
|
|
3
|
+
export const OidType = {
|
|
4
|
+
name: 'oid',
|
|
5
|
+
oid: DataTypeOIDs.oid,
|
|
6
|
+
jsType: 'number',
|
|
7
|
+
parseBinary(v) {
|
|
8
|
+
return v.readUInt32BE(0);
|
|
9
|
+
},
|
|
10
|
+
encodeBinary(buf, v) {
|
|
11
|
+
buf.writeUInt32BE(fastParseInt(v));
|
|
12
|
+
},
|
|
13
|
+
parseText: fastParseInt,
|
|
14
|
+
isType(v) {
|
|
15
|
+
return typeof v === 'number' && Number.isInteger(v) && !!DataTypeNames[v];
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
export const ArrayOidType = {
|
|
19
|
+
...OidType,
|
|
20
|
+
name: '_oid',
|
|
21
|
+
oid: DataTypeOIDs._oid,
|
|
22
|
+
elementsOID: DataTypeOIDs.oid,
|
|
23
|
+
};
|
|
24
|
+
export const VectorOidType = {
|
|
25
|
+
...OidType,
|
|
26
|
+
name: '_oidvector',
|
|
27
|
+
oid: DataTypeOIDs.oidvector,
|
|
28
|
+
elementsOID: DataTypeOIDs.oid,
|
|
29
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { DataTypeOIDs } from '../constants.js';
|
|
2
|
+
const POINT_PATTERN1 = /^\( *(-?\d+\.?\d*) *, *(-?\d+\.?\d*) *\)$/;
|
|
3
|
+
const POINT_PATTERN2 = /^(-?\d+\.?\d*) *, *(-?\d+\.?\d*)$/;
|
|
4
|
+
export const PointType = {
|
|
5
|
+
name: 'point',
|
|
6
|
+
oid: DataTypeOIDs.point,
|
|
7
|
+
jsType: 'object',
|
|
8
|
+
parseBinary(v) {
|
|
9
|
+
return {
|
|
10
|
+
x: v.readDoubleBE(0),
|
|
11
|
+
y: v.readDoubleBE(8),
|
|
12
|
+
};
|
|
13
|
+
},
|
|
14
|
+
encodeBinary(buf, v) {
|
|
15
|
+
buf.writeDoubleBE(v.x);
|
|
16
|
+
buf.writeDoubleBE(v.y);
|
|
17
|
+
},
|
|
18
|
+
parseText(v) {
|
|
19
|
+
const m = v.match(POINT_PATTERN1) || v.match(POINT_PATTERN2);
|
|
20
|
+
if (!m)
|
|
21
|
+
return undefined;
|
|
22
|
+
return {
|
|
23
|
+
x: parseFloat(m[1]),
|
|
24
|
+
y: parseFloat(m[2]),
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
isType(v) {
|
|
28
|
+
return typeof v === 'object' && Object.keys(v).length === 2 && typeof v.x === 'number' && typeof v.y === 'number';
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
export const ArrayPointType = {
|
|
32
|
+
...PointType,
|
|
33
|
+
name: '_point',
|
|
34
|
+
oid: DataTypeOIDs._point,
|
|
35
|
+
elementsOID: DataTypeOIDs.point,
|
|
36
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { DataTypeOIDs } from '../constants.js';
|
|
2
|
+
import { parseTime, STRICT_TIME_PATTERN } from '../util/parse-time.js';
|
|
3
|
+
const timeMul = 4294967296;
|
|
4
|
+
export const TimeType = {
|
|
5
|
+
name: 'time',
|
|
6
|
+
oid: DataTypeOIDs.time,
|
|
7
|
+
jsType: 'string',
|
|
8
|
+
parseBinary(v, options) {
|
|
9
|
+
const fetchAsString = options.fetchAsString && options.fetchAsString.includes(DataTypeOIDs.time);
|
|
10
|
+
const hi = v.readInt32BE();
|
|
11
|
+
const lo = v.readUInt32BE(4);
|
|
12
|
+
let d = new Date((lo + hi * timeMul) / 1000);
|
|
13
|
+
if (fetchAsString || !options.utcDates)
|
|
14
|
+
d = new Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds());
|
|
15
|
+
return fetchAsString ? dateToTimeString(d) : d;
|
|
16
|
+
},
|
|
17
|
+
encodeBinary(buf, v, options) {
|
|
18
|
+
if (typeof v === 'string')
|
|
19
|
+
v = parseTime(v, false, options.utcDates);
|
|
20
|
+
if (!(v instanceof Date))
|
|
21
|
+
v = new Date(v);
|
|
22
|
+
// Postgresql ignores timezone data so we are
|
|
23
|
+
let n = options.utcDates ? v.getTime() : v.getTime() - v.getTimezoneOffset() * 60 * 1000;
|
|
24
|
+
n = n * 1000;
|
|
25
|
+
const hi = Math.floor(n / timeMul);
|
|
26
|
+
const lo = n - hi * timeMul;
|
|
27
|
+
buf.writeInt32BE(hi);
|
|
28
|
+
buf.writeUInt32BE(lo);
|
|
29
|
+
},
|
|
30
|
+
parseText(v, options) {
|
|
31
|
+
if (options.fetchAsString && options.fetchAsString.includes(DataTypeOIDs.time))
|
|
32
|
+
return v;
|
|
33
|
+
return parseTime(v, false, options.utcDates);
|
|
34
|
+
},
|
|
35
|
+
isType(v) {
|
|
36
|
+
return ((v instanceof Date && v.getFullYear() === 1970 && v.getMonth() === 0 && v.getDate() === 1) ||
|
|
37
|
+
(typeof v === 'string' && STRICT_TIME_PATTERN.test(v)));
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
function padZero(v) {
|
|
41
|
+
return v < 9 ? '0' + v : '' + v;
|
|
42
|
+
}
|
|
43
|
+
function dateToTimeString(d) {
|
|
44
|
+
return padZero(d.getHours()) + ':' + padZero(d.getMinutes()) + ':' + padZero(d.getSeconds());
|
|
45
|
+
}
|
|
46
|
+
export const ArrayTimeType = {
|
|
47
|
+
...TimeType,
|
|
48
|
+
name: '_time',
|
|
49
|
+
oid: DataTypeOIDs._time,
|
|
50
|
+
elementsOID: DataTypeOIDs.time,
|
|
51
|
+
};
|