@snowtop/ent 0.1.0-alpha156 → 0.1.0-alpha157
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/core/clause.d.ts +3 -2
- package/core/clause.js +6 -1
- package/package.json +1 -1
package/core/clause.d.ts
CHANGED
|
@@ -11,11 +11,12 @@ export interface SensitiveValue {
|
|
|
11
11
|
value(): any;
|
|
12
12
|
logValue(): any;
|
|
13
13
|
}
|
|
14
|
+
type InClauseOperator = "IN" | "NOT IN";
|
|
14
15
|
export declare class inClause<T extends Data, K = keyof T> implements Clause<T, K> {
|
|
15
16
|
private col;
|
|
16
17
|
private value;
|
|
17
18
|
private type;
|
|
18
|
-
protected op:
|
|
19
|
+
protected op: InClauseOperator;
|
|
19
20
|
static getPostgresInClauseValuesThreshold(): number;
|
|
20
21
|
constructor(col: K, value: any[], type?: string);
|
|
21
22
|
clause(idx: number): string;
|
|
@@ -25,7 +26,7 @@ export declare class inClause<T extends Data, K = keyof T> implements Clause<T,
|
|
|
25
26
|
instanceKey(): string;
|
|
26
27
|
}
|
|
27
28
|
export declare class notInClause<T extends Data, K = keyof T> extends inClause<T, K> {
|
|
28
|
-
protected op:
|
|
29
|
+
protected op: InClauseOperator;
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
31
32
|
* creates a clause to determine if the given value is contained in the array stored in the column in the db
|
package/core/clause.js
CHANGED
|
@@ -241,7 +241,12 @@ class inClause {
|
|
|
241
241
|
clause(idx) {
|
|
242
242
|
// do a simple = when only one item
|
|
243
243
|
if (this.value.length === 1) {
|
|
244
|
-
|
|
244
|
+
if (this.op === "IN") {
|
|
245
|
+
return new simpleClause(this.col, this.value[0], "=").clause(idx);
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
return new simpleClause(this.col, this.value[0], "!=").clause(idx);
|
|
249
|
+
}
|
|
245
250
|
}
|
|
246
251
|
const postgres = db_1.default.getDialect() === db_1.Dialect.Postgres;
|
|
247
252
|
const postgresValuesList = postgres &&
|