ismx-nexo-node-app 0.4.134 → 0.4.136
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/dist/js/repository/RepositoryDatabasePostgres.js +1 -2
- package/dist/js/repository/utils/PostgresUtils.js +4 -0
- package/dist/types/repository/RepositoryDatabasePostgres.d.ts +1 -1
- package/dist/types/repository/utils/PostgresUtils.d.ts +2 -1
- package/package.json +1 -1
- package/src/main/node/repository/RepositoryDatabasePostgres.ts +1 -2
- package/src/main/node/repository/utils/PostgresUtils.ts +4 -0
|
@@ -283,9 +283,8 @@ class RepositoryDatabasePostgres extends RepositoryDatabase_1.default {
|
|
|
283
283
|
values.push(value);
|
|
284
284
|
}
|
|
285
285
|
else if (value instanceof PgOperator) {
|
|
286
|
-
let idxs = value.vals.map((v) => `\$${iter++}
|
|
286
|
+
let idxs = value.vals.map((v) => { values.push(v); return `\$${iter++}`; });
|
|
287
287
|
where += ` AND ${value.toWhere(`${alias}${column}`, idxs)}`;
|
|
288
|
-
values.push(...value.vals);
|
|
289
288
|
}
|
|
290
289
|
else if (value === null) {
|
|
291
290
|
where += ` AND ${alias}${column} IS NULL`;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const RepositoryDatabasePostgres_1 = require("../RepositoryDatabasePostgres");
|
|
3
4
|
class PostgresUtils {
|
|
4
5
|
static camelToSnake(column) {
|
|
5
6
|
return column.replace(/([A-Z])/g, '_$1').toLowerCase();
|
|
@@ -53,5 +54,8 @@ class PostgresUtils {
|
|
|
53
54
|
result[key] = value;
|
|
54
55
|
return result;
|
|
55
56
|
}
|
|
57
|
+
static op(vals, toWhere) {
|
|
58
|
+
return new RepositoryDatabasePostgres_1.PgOperator(vals, toWhere);
|
|
59
|
+
}
|
|
56
60
|
}
|
|
57
61
|
exports.default = PostgresUtils;
|
|
@@ -64,7 +64,7 @@ export default class RepositoryDatabasePostgres extends RepositoryDatabase {
|
|
|
64
64
|
[key: string]: Valuable | Array<Valuable> | PgOperator;
|
|
65
65
|
}, alias?: string, index?: number): {
|
|
66
66
|
where: string;
|
|
67
|
-
values: (string | number | symbol | Date | Valuable[]
|
|
67
|
+
values: (string | number | symbol | Date | Valuable[])[];
|
|
68
68
|
};
|
|
69
69
|
anyWhere(filters: any, alias?: string, index?: number): {
|
|
70
70
|
where: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Column } from "../RepositoryDatabasePostgres";
|
|
1
|
+
import { Column, PgOperator } from "../RepositoryDatabasePostgres";
|
|
2
2
|
import { Valuable } from "../RepositoryDatabase";
|
|
3
3
|
export default abstract class PostgresUtils {
|
|
4
4
|
static camelToSnake(column: string): string;
|
|
@@ -15,4 +15,5 @@ export default abstract class PostgresUtils {
|
|
|
15
15
|
static fromEntries(iterable: [string, any][]): {
|
|
16
16
|
[key: string]: any;
|
|
17
17
|
};
|
|
18
|
+
static op(vals: Valuable[], toWhere: (column: string, params: string[]) => string): PgOperator;
|
|
18
19
|
}
|
package/package.json
CHANGED
|
@@ -250,9 +250,8 @@ export default class RepositoryDatabasePostgres extends RepositoryDatabase
|
|
|
250
250
|
values.push(value);
|
|
251
251
|
|
|
252
252
|
} else if (value instanceof PgOperator) {
|
|
253
|
-
let idxs = value.vals.map((v) => `\$${iter++}`)
|
|
253
|
+
let idxs = value.vals.map((v) => { values.push(v); return `\$${iter++}` });
|
|
254
254
|
where += ` AND ${value.toWhere(`${alias}${column}`, idxs)}`
|
|
255
|
-
values.push(...value.vals);
|
|
256
255
|
|
|
257
256
|
} else if (value === null) {
|
|
258
257
|
where += ` AND ${alias}${column} IS NULL`
|