@sqb/postgres-dialect 4.12.1 → 4.14.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/cjs/index.js +1 -1
- package/cjs/postgres-serializer.js +6 -2
- package/esm/index.js +2 -2
- package/esm/postgres-serializer.js +6 -2
- package/package.json +2 -2
package/cjs/index.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const builder_1 = require("@sqb/builder");
|
|
4
4
|
const postgres_serializer_js_1 = require("./postgres-serializer.js");
|
|
5
|
-
|
|
5
|
+
builder_1.SerializerRegistry.register(new postgres_serializer_js_1.PostgresSerializer());
|
|
@@ -18,6 +18,8 @@ class PostgresSerializer {
|
|
|
18
18
|
return this._serializeComparison(ctx, o, defFn);
|
|
19
19
|
case builder_1.SerializationType.EXTERNAL_PARAMETER:
|
|
20
20
|
return this._serializeParameter(ctx, o, defFn);
|
|
21
|
+
default:
|
|
22
|
+
return undefined;
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
_serializeSelect(ctx, o, defFn) {
|
|
@@ -40,10 +42,12 @@ class PostgresSerializer {
|
|
|
40
42
|
return defFn(ctx, { ...o, operatorType: builder_1.OperatorType.isNot, symbol: 'is not' });
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
|
-
if (o.left.isParam && o.left.isArray && o.left.value != null && !Array.isArray(o.left.value))
|
|
45
|
+
if (o.left.isParam && o.left.isArray && o.left.value != null && !Array.isArray(o.left.value)) {
|
|
44
46
|
o.left.value = [o.left.value];
|
|
45
|
-
|
|
47
|
+
}
|
|
48
|
+
if (o.right.isParam && o.right.isArray && o.right.value != null && !Array.isArray(o.right.value)) {
|
|
46
49
|
o.right.value = [o.right.value];
|
|
50
|
+
}
|
|
47
51
|
if (o.operatorType === 'in' || o.operatorType === 'notIn') {
|
|
48
52
|
if (o.left.isArray && !o.right.isArray && o.right.isParam) {
|
|
49
53
|
const left = o.left;
|
package/esm/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SerializerRegistry } from '@sqb/builder';
|
|
2
2
|
import { PostgresSerializer } from './postgres-serializer.js';
|
|
3
|
-
|
|
3
|
+
SerializerRegistry.register(new PostgresSerializer());
|
|
@@ -15,6 +15,8 @@ export class PostgresSerializer {
|
|
|
15
15
|
return this._serializeComparison(ctx, o, defFn);
|
|
16
16
|
case SerializationType.EXTERNAL_PARAMETER:
|
|
17
17
|
return this._serializeParameter(ctx, o, defFn);
|
|
18
|
+
default:
|
|
19
|
+
return undefined;
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
22
|
_serializeSelect(ctx, o, defFn) {
|
|
@@ -37,10 +39,12 @@ export class PostgresSerializer {
|
|
|
37
39
|
return defFn(ctx, { ...o, operatorType: OperatorType.isNot, symbol: 'is not' });
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
|
-
if (o.left.isParam && o.left.isArray && o.left.value != null && !Array.isArray(o.left.value))
|
|
42
|
+
if (o.left.isParam && o.left.isArray && o.left.value != null && !Array.isArray(o.left.value)) {
|
|
41
43
|
o.left.value = [o.left.value];
|
|
42
|
-
|
|
44
|
+
}
|
|
45
|
+
if (o.right.isParam && o.right.isArray && o.right.value != null && !Array.isArray(o.right.value)) {
|
|
43
46
|
o.right.value = [o.right.value];
|
|
47
|
+
}
|
|
44
48
|
if (o.operatorType === 'in' || o.operatorType === 'notIn') {
|
|
45
49
|
if (o.left.isArray && !o.right.isArray && o.right.isParam) {
|
|
46
50
|
const left = o.left;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqb/postgres-dialect",
|
|
3
3
|
"description": "SQB serialization extension for PostgreSQL database",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.14.0",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Eray Hanoglu <e.hanoglu@panates.com>",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"clean:cover": "rimraf ../../coverage/postgres-dialect"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@sqb/builder": "^4.
|
|
38
|
+
"@sqb/builder": "^4.14.0"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
41
|
"node": ">=16.0",
|