@sqb/postgres-dialect 4.19.1 → 4.19.4
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/cjs/postgres-serializer.js +12 -7
- package/esm/postgres-serializer.js +12 -7
- package/package.json +3 -3
|
@@ -37,13 +37,18 @@ class PostgresSerializer {
|
|
|
37
37
|
if ((o.right.expression && o.right?.expression === 'null') ||
|
|
38
38
|
(o.right.value == null && (!o.right.expression || o.right.expression.startsWith('$')))) {
|
|
39
39
|
if (o.right.expression?.startsWith('$')) {
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
const i = parseInt(o.right.expression.substring(1), 10);
|
|
41
|
+
if (i > 0) {
|
|
42
|
+
const _ctx = ctx;
|
|
43
|
+
_ctx.removedParams = _ctx.removedParams || [];
|
|
44
|
+
if (!_ctx.removedParams.includes(i)) {
|
|
45
|
+
_ctx.removedParams.push(i);
|
|
46
|
+
if (Array.isArray(ctx.preparedParams))
|
|
47
|
+
ctx.preparedParams.splice(i - 1, 1);
|
|
48
|
+
if (Array.isArray(ctx.paramOptions))
|
|
49
|
+
ctx.paramOptions.splice(i - 1, 1);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
47
52
|
o.right.expression = 'null';
|
|
48
53
|
o.right.isParam = false;
|
|
49
54
|
}
|
|
@@ -34,13 +34,18 @@ export class PostgresSerializer {
|
|
|
34
34
|
if ((o.right.expression && o.right?.expression === 'null') ||
|
|
35
35
|
(o.right.value == null && (!o.right.expression || o.right.expression.startsWith('$')))) {
|
|
36
36
|
if (o.right.expression?.startsWith('$')) {
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
const i = parseInt(o.right.expression.substring(1), 10);
|
|
38
|
+
if (i > 0) {
|
|
39
|
+
const _ctx = ctx;
|
|
40
|
+
_ctx.removedParams = _ctx.removedParams || [];
|
|
41
|
+
if (!_ctx.removedParams.includes(i)) {
|
|
42
|
+
_ctx.removedParams.push(i);
|
|
43
|
+
if (Array.isArray(ctx.preparedParams))
|
|
44
|
+
ctx.preparedParams.splice(i - 1, 1);
|
|
45
|
+
if (Array.isArray(ctx.paramOptions))
|
|
46
|
+
ctx.paramOptions.splice(i - 1, 1);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
44
49
|
o.right.expression = 'null';
|
|
45
50
|
o.right.isParam = false;
|
|
46
51
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqb/postgres-dialect",
|
|
3
3
|
"description": "SQB serialization extension for PostgreSQL database",
|
|
4
|
-
"version": "4.19.
|
|
4
|
+
"version": "4.19.4",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"tslib": "^2.
|
|
8
|
+
"tslib": "^2.8.0"
|
|
9
9
|
},
|
|
10
10
|
"peerDependencies": {
|
|
11
|
-
"@sqb/builder": "^4.19.
|
|
11
|
+
"@sqb/builder": "^4.19.4"
|
|
12
12
|
},
|
|
13
13
|
"type": "module",
|
|
14
14
|
"exports": {
|