typeorm-extensions 2.0.0 → 2.2.0-rc.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/LICENSE +21 -0
- package/README.md +9 -8
- package/dist/decorators/calculated-column.decorator.d.ts +30 -0
- package/dist/decorators/calculated-column.decorator.js +82 -0
- package/dist/decorators/index.d.ts +1 -0
- package/dist/decorators/index.js +17 -0
- package/dist/extensions/calculated-column.extension.d.ts +33 -0
- package/dist/extensions/calculated-column.extension.js +33 -0
- package/dist/extensions/cursor-pagination.extension.d.ts +2 -1
- package/dist/extensions/cursor-pagination.extension.js +4 -3
- package/dist/extensions/get-many-with-totals.extension.d.ts +9 -1
- package/dist/extensions/get-many-with-totals.extension.js +158 -10
- package/dist/extensions/index.d.ts +7 -0
- package/dist/extensions/index.js +7 -0
- package/dist/extensions/join-lateral.extension.d.ts +19 -0
- package/dist/extensions/join-lateral.extension.js +50 -0
- package/dist/extensions/join-unnest.extension.d.ts +19 -0
- package/dist/extensions/join-unnest.extension.js +40 -0
- package/dist/extensions/order.extension.js +18 -7
- package/dist/extensions/query-returning.extension.d.ts +29 -0
- package/dist/extensions/query-returning.extension.js +50 -0
- package/dist/extensions/typed/index.d.ts +3 -0
- package/dist/extensions/typed/index.js +3 -2
- package/dist/extensions/typed/typed-distinct/typed-distinct.extension.d.ts +3 -2
- package/dist/extensions/typed/typed-group-by/typed-group-by.extension.d.ts +24 -0
- package/dist/extensions/typed/typed-group-by/typed-group-by.extension.js +31 -0
- package/dist/extensions/typed/typed-having/typed-having.extension.d.ts +36 -0
- package/dist/extensions/typed/typed-having/typed-having.extension.js +42 -0
- package/dist/extensions/typed/typed-joins/typed-joins.extension.d.ts +5 -4
- package/dist/extensions/typed/typed-order-by/typed-order-by-array-position.extension.d.ts +3 -2
- package/dist/extensions/typed/typed-order-by/typed-order-by-array-position.extension.js +10 -2
- package/dist/extensions/typed/typed-order-by/typed-order-by.extension.d.ts +3 -2
- package/dist/extensions/typed/typed-order-by/typed-order-by.extension.js +3 -2
- package/dist/extensions/typed/typed-root.extension.d.ts +25 -0
- package/dist/extensions/typed/typed-root.extension.js +13 -0
- package/dist/extensions/typed/typed-select/typed-select.extension.d.ts +5 -4
- package/dist/extensions/typed/typed-select/typed-select.extension.js +3 -2
- package/dist/extensions/typed/typed-where/typed-period-filter.extension.d.ts +2 -1
- package/dist/extensions/typed/typed-where/typed-period-filter.extension.js +1 -1
- package/dist/extensions/typed/typed-where/typed-where-array.extension.d.ts +10 -9
- package/dist/extensions/typed/typed-where/typed-where-array.extension.js +32 -0
- package/dist/extensions/typed/typed-where/typed-where-ilike.extension.d.ts +7 -6
- package/dist/extensions/typed/typed-where/typed-where-is-any.extension.d.ts +39 -129
- package/dist/extensions/typed/typed-where/typed-where-is-any.extension.js +2 -1
- package/dist/extensions/typed/typed-where/typed-where-is-distinct-from.extension.d.ts +7 -6
- package/dist/extensions/typed/typed-where/typed-where-is-distinct-from.extension.js +1 -1
- package/dist/extensions/typed/typed-where/typed-where-is-in.extension.d.ts +36 -117
- package/dist/extensions/typed/typed-where/typed-where-is-in.extension.js +11 -19
- package/dist/extensions/typed/typed-where/typed-where-json.extension.d.ts +7 -6
- package/dist/extensions/typed/typed-where/typed-where-json.extension.js +1 -1
- package/dist/extensions/typed/typed-where/typed-where-lower.extension.d.ts +7 -6
- package/dist/extensions/typed/typed-where/typed-where-similar.extension.d.ts +5 -4
- package/dist/extensions/typed/typed-where/typed-where.extension.d.ts +30 -73
- package/dist/extensions/typed/typed-where/typed-where.extension.js +10 -10
- package/dist/extensions/union.extension.d.ts +22 -0
- package/dist/extensions/union.extension.js +52 -0
- package/dist/extensions/where-exists.extension.d.ts +50 -0
- package/dist/extensions/where-exists.extension.js +64 -0
- package/dist/extensions/where-relation-exists.extension.d.ts +38 -0
- package/dist/extensions/where-relation-exists.extension.js +95 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -0
- package/dist/types/extensions/cursor-pagination.types.d.ts +5 -0
- package/dist/types/extensions/get-many-with-totals.types.d.ts +19 -0
- package/dist/types/extensions/index.d.ts +5 -0
- package/dist/types/extensions/index.js +5 -0
- package/dist/types/extensions/join-lateral.types.d.ts +6 -0
- package/dist/types/extensions/join-lateral.types.js +2 -0
- package/dist/types/extensions/period.types.d.ts +8 -0
- package/dist/types/extensions/query-returning.types.d.ts +11 -0
- package/dist/types/extensions/query-returning.types.js +2 -0
- package/dist/types/extensions/typed-group-by.types.d.ts +8 -0
- package/dist/types/extensions/typed-group-by.types.js +2 -0
- package/dist/types/extensions/typed-having.types.d.ts +2 -0
- package/dist/types/extensions/typed-having.types.js +2 -0
- package/dist/types/extensions/union.types.d.ts +12 -0
- package/dist/types/extensions/union.types.js +2 -0
- package/dist/types/extensions/where.types.d.ts +1 -0
- package/dist/types/interfaces/config.interface.d.ts +17 -0
- package/dist/types/interfaces/config.interface.js +2 -0
- package/dist/types/interfaces/index.d.ts +1 -0
- package/dist/types/interfaces/index.js +1 -0
- package/dist/types/modules/proxy-callback.types.d.ts +28 -4
- package/dist/types/modules/typed-params.types.d.ts +45 -0
- package/dist/types/modules/typed-params.types.js +2 -0
- package/dist/types/modules/typed-root.types.d.ts +13 -0
- package/dist/types/modules/typed-root.types.js +2 -0
- package/dist/utils/calculated-column.utils.d.ts +21 -0
- package/dist/utils/calculated-column.utils.js +63 -0
- package/dist/utils/json-path.utils.d.ts +22 -0
- package/dist/utils/json-path.utils.js +57 -0
- package/dist/utils/parameter.utils.d.ts +7 -0
- package/dist/utils/parameter.utils.js +21 -0
- package/dist/utils/period.utils.js +7 -2
- package/dist/utils/prototype.utils.d.ts +5 -1
- package/dist/utils/prototype.utils.js +4 -1
- package/dist/utils/proxy-key.utils.d.ts +9 -4
- package/dist/utils/proxy-key.utils.js +21 -14
- package/dist/utils/query-builder.utils.d.ts +13 -3
- package/dist/utils/query-builder.utils.js +95 -18
- package/dist/utils/sql.utils.d.ts +2 -0
- package/dist/utils/sql.utils.js +5 -1
- package/dist/utils/table.utils.d.ts +112 -2
- package/dist/utils/table.utils.js +206 -22
- package/dist/utils/time-zone.utils.d.ts +8 -0
- package/dist/utils/time-zone.utils.js +102 -0
- package/dist/utils/where.utils.d.ts +2 -2
- package/dist/utils/where.utils.js +23 -2
- package/package.json +4 -3
|
@@ -2,6 +2,7 @@ import '../../where-array.extension';
|
|
|
2
2
|
import { ObjectLiteral } from 'typeorm';
|
|
3
3
|
import { DeepUnwrapArray, ProxyColumnValueType } from '../../../types/modules/proxy-callback.types';
|
|
4
4
|
import { ArgsType } from '../../../types/util-types';
|
|
5
|
+
import type { TypedRoot } from '../../../types/modules/typed-root.types';
|
|
5
6
|
/**
|
|
6
7
|
* Typesafe conditions on PostgreSQL array columns: the column comes from an entity property.
|
|
7
8
|
* See {@link WhereArrayMethods}.
|
|
@@ -12,43 +13,43 @@ export interface TypedWhereArrayMethods<Entity extends ObjectLiteral> {
|
|
|
12
13
|
* If you had previously WHERE expression defined,
|
|
13
14
|
* calling this function will override previously set WHERE conditions.
|
|
14
15
|
*/
|
|
15
|
-
whereArrayContainsTyped<Type extends ObjectLiteral = Entity
|
|
16
|
+
whereArrayContainsTyped<Type extends ObjectLiteral = TypedRoot<Entity>>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, values: ArgsType, arrayType?: string): this;
|
|
16
17
|
/**
|
|
17
18
|
* Adds new AND WHERE `column @> :values` condition (PostgreSQL): the array column contains every value.
|
|
18
19
|
*/
|
|
19
|
-
andWhereArrayContainsTyped<Type extends ObjectLiteral = Entity
|
|
20
|
+
andWhereArrayContainsTyped<Type extends ObjectLiteral = TypedRoot<Entity>>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, values: ArgsType, arrayType?: string): this;
|
|
20
21
|
/**
|
|
21
22
|
* Adds new OR WHERE `column @> :values` condition (PostgreSQL): the array column contains every value.
|
|
22
23
|
*/
|
|
23
|
-
orWhereArrayContainsTyped<Type extends ObjectLiteral = Entity
|
|
24
|
+
orWhereArrayContainsTyped<Type extends ObjectLiteral = TypedRoot<Entity>>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, values: ArgsType, arrayType?: string): this;
|
|
24
25
|
/**
|
|
25
26
|
* Sets WHERE `column <@ :values` condition (PostgreSQL): every element of the array column is one of the values.
|
|
26
27
|
* If you had previously WHERE expression defined,
|
|
27
28
|
* calling this function will override previously set WHERE conditions.
|
|
28
29
|
*/
|
|
29
|
-
whereArrayContainedByTyped<Type extends ObjectLiteral = Entity
|
|
30
|
+
whereArrayContainedByTyped<Type extends ObjectLiteral = TypedRoot<Entity>>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, values: ArgsType, arrayType?: string): this;
|
|
30
31
|
/**
|
|
31
32
|
* Adds new AND WHERE `column <@ :values` condition (PostgreSQL): every element of the array column is one of the values.
|
|
32
33
|
*/
|
|
33
|
-
andWhereArrayContainedByTyped<Type extends ObjectLiteral = Entity
|
|
34
|
+
andWhereArrayContainedByTyped<Type extends ObjectLiteral = TypedRoot<Entity>>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, values: ArgsType, arrayType?: string): this;
|
|
34
35
|
/**
|
|
35
36
|
* Adds new OR WHERE `column <@ :values` condition (PostgreSQL): every element of the array column is one of the values.
|
|
36
37
|
*/
|
|
37
|
-
orWhereArrayContainedByTyped<Type extends ObjectLiteral = Entity
|
|
38
|
+
orWhereArrayContainedByTyped<Type extends ObjectLiteral = TypedRoot<Entity>>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, values: ArgsType, arrayType?: string): this;
|
|
38
39
|
/**
|
|
39
40
|
* Sets WHERE `column && :values` condition (PostgreSQL): the array column has at least one of the values.
|
|
40
41
|
* If you had previously WHERE expression defined,
|
|
41
42
|
* calling this function will override previously set WHERE conditions.
|
|
42
43
|
*/
|
|
43
|
-
whereArrayOverlapsTyped<Type extends ObjectLiteral = Entity
|
|
44
|
+
whereArrayOverlapsTyped<Type extends ObjectLiteral = TypedRoot<Entity>>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, values: ArgsType, arrayType?: string): this;
|
|
44
45
|
/**
|
|
45
46
|
* Adds new AND WHERE `column && :values` condition (PostgreSQL): the array column has at least one of the values.
|
|
46
47
|
*/
|
|
47
|
-
andWhereArrayOverlapsTyped<Type extends ObjectLiteral = Entity
|
|
48
|
+
andWhereArrayOverlapsTyped<Type extends ObjectLiteral = TypedRoot<Entity>>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, values: ArgsType, arrayType?: string): this;
|
|
48
49
|
/**
|
|
49
50
|
* Adds new OR WHERE `column && :values` condition (PostgreSQL): the array column has at least one of the values.
|
|
50
51
|
*/
|
|
51
|
-
orWhereArrayOverlapsTyped<Type extends ObjectLiteral = Entity
|
|
52
|
+
orWhereArrayOverlapsTyped<Type extends ObjectLiteral = TypedRoot<Entity>>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, values: ArgsType, arrayType?: string): this;
|
|
52
53
|
}
|
|
53
54
|
declare module 'typeorm/query-builder/WhereExpressionBuilder' {
|
|
54
55
|
interface WhereExpressionBuilder extends TypedWhereArrayMethods<ObjectLiteral> {
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
require("../../where-array.extension");
|
|
4
4
|
const typeorm_1 = require("typeorm");
|
|
5
5
|
const query_builder_utils_1 = require("../../../utils/query-builder.utils");
|
|
6
|
+
const sql_utils_1 = require("../../../utils/sql.utils");
|
|
6
7
|
const prototype_utils_1 = require("../../../utils/prototype.utils");
|
|
7
8
|
/* eslint-enable @typescript-eslint/no-empty-interface */
|
|
8
9
|
// patching
|
|
@@ -36,6 +37,37 @@ function attachWhereArrayTyped(builder, method, where, values, arrayType) {
|
|
|
36
37
|
return builder;
|
|
37
38
|
}
|
|
38
39
|
const key = (0, query_builder_utils_1.getTypedSingleColumnKey)(builder, where, `${method}Typed`);
|
|
40
|
+
if ((0, query_builder_utils_1.isTypedJsonPath)(builder, where)) {
|
|
41
|
+
return attachWhereJsonArray(builder, method, where, values, arrayType);
|
|
42
|
+
}
|
|
39
43
|
// .andWhereArrayContains(`"table"."column"`, ['value'])
|
|
40
44
|
return builder[method](key, values, arrayType);
|
|
41
45
|
}
|
|
46
|
+
const JSON_ARRAY_METHOD = /^(where|andWhere|orWhere)Array(Contains|ContainedBy|Overlaps)$/;
|
|
47
|
+
const JSON_ARRAY_OPERATORS = { Contains: '@>', ContainedBy: '<@', Overlaps: '?|' };
|
|
48
|
+
/**
|
|
49
|
+
* The array conditions on an array inside a JSON column, with jsonb operators: `@>` and `<@` against the
|
|
50
|
+
* values as a JSON array, and `?|` (any of the strings is an element) for the overlap. Empty arrays keep
|
|
51
|
+
* PostgreSQL's semantics, as for array columns.
|
|
52
|
+
*/
|
|
53
|
+
function attachWhereJsonArray(builder, method, where, values, arrayType) {
|
|
54
|
+
const methodName = `${method}Typed`;
|
|
55
|
+
const [, whereMethod, condition] = JSON_ARRAY_METHOD.exec(method);
|
|
56
|
+
if (!Array.isArray(values)) {
|
|
57
|
+
throw new TypeError(`${methodName} expects an array of values, got ${values}`);
|
|
58
|
+
}
|
|
59
|
+
if (arrayType !== undefined) {
|
|
60
|
+
throw new TypeError(`${methodName}: arrayType is for array columns, not for an array inside a JSON column`);
|
|
61
|
+
}
|
|
62
|
+
const jsonArray = `CAST(${(0, query_builder_utils_1.getTypedSingleColumnKey)(builder, where, methodName, { accessor: 'json' })} AS jsonb)`;
|
|
63
|
+
const paramName = (0, sql_utils_1.createUniqueParameterName)(whereMethod);
|
|
64
|
+
// a string or an object at the path isn't an array, but <@ and ?| would match it
|
|
65
|
+
const onArray = (condition) => `(jsonb_typeof(${jsonArray}) = 'array' AND ${condition})`;
|
|
66
|
+
if (condition === 'Overlaps') {
|
|
67
|
+
if (!values.every((value) => typeof value === 'string')) {
|
|
68
|
+
throw new TypeError(`${methodName} on an array inside a JSON column takes strings: the ?| operator matches string elements`);
|
|
69
|
+
}
|
|
70
|
+
return builder[whereMethod](onArray(`${jsonArray} ?| CAST(:${paramName} AS text[])`), { [paramName]: values });
|
|
71
|
+
}
|
|
72
|
+
return builder[whereMethod](onArray(`${jsonArray} ${JSON_ARRAY_OPERATORS[condition]} CAST(:${paramName} AS jsonb)`), { [paramName]: JSON.stringify(values) });
|
|
73
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ObjectLiteral } from 'typeorm';
|
|
2
2
|
import { DeepUnwrapArray, ProxyColumnValueType } from '../../../types/modules/proxy-callback.types';
|
|
3
3
|
import type { SearchSelector, TypedILikeOptions, TypedSearchOptions } from '../../../types/extensions/search.types';
|
|
4
|
+
import type { TypedRoot } from '../../../types/modules/typed-root.types';
|
|
4
5
|
/**
|
|
5
6
|
* Case-insensitive search methods: `ILIKE` on PostgreSQL, `LIKE` on MySQL / MariaDB and SQLite.
|
|
6
7
|
* `%`, `_` and `\` in the value are escaped, and a blank value adds no condition.
|
|
@@ -13,17 +14,17 @@ export interface TypedWhereILikeMethods<Entity extends ObjectLiteral> {
|
|
|
13
14
|
* If you had previously WHERE expression defined,
|
|
14
15
|
* calling this function will override previously set WHERE conditions.
|
|
15
16
|
*/
|
|
16
|
-
whereILikeTyped<Type extends ObjectLiteral = Entity
|
|
17
|
+
whereILikeTyped<Type extends ObjectLiteral = TypedRoot<Entity>>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, value: string | null | undefined, options?: TypedILikeOptions): this;
|
|
17
18
|
/**
|
|
18
19
|
* Adds new AND WHERE `column ILIKE :pattern` condition in the query builder.
|
|
19
20
|
* `null`, `undefined` or a blank value adds no condition.
|
|
20
21
|
*/
|
|
21
|
-
andWhereILikeTyped<Type extends ObjectLiteral = Entity
|
|
22
|
+
andWhereILikeTyped<Type extends ObjectLiteral = TypedRoot<Entity>>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, value: string | null | undefined, options?: TypedILikeOptions): this;
|
|
22
23
|
/**
|
|
23
24
|
* Adds new OR WHERE `column ILIKE :pattern` condition in the query builder.
|
|
24
25
|
* `null`, `undefined` or a blank value adds no condition.
|
|
25
26
|
*/
|
|
26
|
-
orWhereILikeTyped<Type extends ObjectLiteral = Entity
|
|
27
|
+
orWhereILikeTyped<Type extends ObjectLiteral = TypedRoot<Entity>>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, value: string | null | undefined, options?: TypedILikeOptions): this;
|
|
27
28
|
/**
|
|
28
29
|
* Sets WHERE `(col1 ILIKE :pattern OR col2 ILIKE :pattern …)` condition in the query builder:
|
|
29
30
|
* one group, one parameter for every column. A selector is a typed callback (it may select
|
|
@@ -32,17 +33,17 @@ export interface TypedWhereILikeMethods<Entity extends ObjectLiteral> {
|
|
|
32
33
|
* If you had previously WHERE expression defined,
|
|
33
34
|
* calling this function will override previously set WHERE conditions.
|
|
34
35
|
*/
|
|
35
|
-
whereSearchTyped<Type extends ObjectLiteral = Entity
|
|
36
|
+
whereSearchTyped<Type extends ObjectLiteral = TypedRoot<Entity>>(selectors: ReadonlyArray<SearchSelector<Type>>, value: string | null | undefined, options?: TypedSearchOptions): this;
|
|
36
37
|
/**
|
|
37
38
|
* Adds new AND WHERE `(col1 ILIKE :pattern OR col2 ILIKE :pattern …)` condition in the query builder.
|
|
38
39
|
* A value shorter than `options.minLength` (default 1, after trimming) adds no condition.
|
|
39
40
|
*/
|
|
40
|
-
andWhereSearchTyped<Type extends ObjectLiteral = Entity
|
|
41
|
+
andWhereSearchTyped<Type extends ObjectLiteral = TypedRoot<Entity>>(selectors: ReadonlyArray<SearchSelector<Type>>, value: string | null | undefined, options?: TypedSearchOptions): this;
|
|
41
42
|
/**
|
|
42
43
|
* Adds new OR WHERE `(col1 ILIKE :pattern OR col2 ILIKE :pattern …)` condition in the query builder.
|
|
43
44
|
* A value shorter than `options.minLength` (default 1, after trimming) adds no condition.
|
|
44
45
|
*/
|
|
45
|
-
orWhereSearchTyped<Type extends ObjectLiteral = Entity
|
|
46
|
+
orWhereSearchTyped<Type extends ObjectLiteral = TypedRoot<Entity>>(selectors: ReadonlyArray<SearchSelector<Type>>, value: string | null | undefined, options?: TypedSearchOptions): this;
|
|
46
47
|
}
|
|
47
48
|
declare module 'typeorm/query-builder/WhereExpressionBuilder' {
|
|
48
49
|
interface WhereExpressionBuilder extends TypedWhereILikeMethods<ObjectLiteral> {
|
|
@@ -1,144 +1,54 @@
|
|
|
1
1
|
import '../../where-is-any.extension';
|
|
2
2
|
import { ObjectLiteral } from 'typeorm';
|
|
3
3
|
import { DeepUnwrapArray, ProxyColumnValueType } from '../../../types/modules/proxy-callback.types';
|
|
4
|
-
import {
|
|
4
|
+
import { TypedArrayArg, TypeOrDefault, UnsetType } from '../../../types/modules/typed-params.types';
|
|
5
|
+
import type { TypedRoot } from '../../../types/modules/typed-root.types';
|
|
6
|
+
export interface TypedWhereIsAnyMethods<Entity extends ObjectLiteral> {
|
|
7
|
+
/**
|
|
8
|
+
* Sets WHERE `column = ANY(:array)` condition in the query builder (PostgreSQL).
|
|
9
|
+
* The array is bound as a single parameter instead of one parameter per value.
|
|
10
|
+
* `arrayType` (e.g. `'uuid[]'`) casts the parameter: `= ANY(CAST(:array AS uuid[]))`.
|
|
11
|
+
* If you had previously WHERE expression defined,
|
|
12
|
+
* calling this function will override previously set WHERE conditions.
|
|
13
|
+
*/
|
|
14
|
+
whereIsAnyTyped<Type extends ObjectLiteral = UnsetType, Value extends ProxyColumnValueType = ProxyColumnValueType>(where: (proxy: DeepUnwrapArray<TypeOrDefault<Type, TypedRoot<Entity>>>) => Value, array?: TypedArrayArg<Type, Value>, arrayType?: string): this;
|
|
15
|
+
/**
|
|
16
|
+
* Adds new AND WHERE `column = ANY(:array)` condition in the query builder (PostgreSQL).
|
|
17
|
+
*/
|
|
18
|
+
andWhereIsAnyTyped<Type extends ObjectLiteral = UnsetType, Value extends ProxyColumnValueType = ProxyColumnValueType>(where: (proxy: DeepUnwrapArray<TypeOrDefault<Type, TypedRoot<Entity>>>) => Value, array?: TypedArrayArg<Type, Value>, arrayType?: string): this;
|
|
19
|
+
/**
|
|
20
|
+
* Adds new OR WHERE `column = ANY(:array)` condition in the query builder (PostgreSQL).
|
|
21
|
+
*/
|
|
22
|
+
orWhereIsAnyTyped<Type extends ObjectLiteral = UnsetType, Value extends ProxyColumnValueType = ProxyColumnValueType>(where: (proxy: DeepUnwrapArray<TypeOrDefault<Type, TypedRoot<Entity>>>) => Value, array?: TypedArrayArg<Type, Value>, arrayType?: string): this;
|
|
23
|
+
/**
|
|
24
|
+
* Sets WHERE `column <> ALL(:array)` condition in the query builder (PostgreSQL):
|
|
25
|
+
* the column differs from every value of the array.
|
|
26
|
+
* If you had previously WHERE expression defined,
|
|
27
|
+
* calling this function will override previously set WHERE conditions.
|
|
28
|
+
*/
|
|
29
|
+
whereIsNotAnyTyped<Type extends ObjectLiteral = UnsetType, Value extends ProxyColumnValueType = ProxyColumnValueType>(where: (proxy: DeepUnwrapArray<TypeOrDefault<Type, TypedRoot<Entity>>>) => Value, array?: TypedArrayArg<Type, Value>, arrayType?: string): this;
|
|
30
|
+
/**
|
|
31
|
+
* Adds new AND WHERE `column <> ALL(:array)` condition in the query builder (PostgreSQL).
|
|
32
|
+
*/
|
|
33
|
+
andWhereIsNotAnyTyped<Type extends ObjectLiteral = UnsetType, Value extends ProxyColumnValueType = ProxyColumnValueType>(where: (proxy: DeepUnwrapArray<TypeOrDefault<Type, TypedRoot<Entity>>>) => Value, array?: TypedArrayArg<Type, Value>, arrayType?: string): this;
|
|
34
|
+
/**
|
|
35
|
+
* Adds new OR WHERE `column <> ALL(:array)` condition in the query builder (PostgreSQL).
|
|
36
|
+
*/
|
|
37
|
+
orWhereIsNotAnyTyped<Type extends ObjectLiteral = UnsetType, Value extends ProxyColumnValueType = ProxyColumnValueType>(where: (proxy: DeepUnwrapArray<TypeOrDefault<Type, TypedRoot<Entity>>>) => Value, array?: TypedArrayArg<Type, Value>, arrayType?: string): this;
|
|
38
|
+
}
|
|
5
39
|
declare module 'typeorm/query-builder/WhereExpressionBuilder' {
|
|
6
|
-
interface WhereExpressionBuilder {
|
|
7
|
-
/**
|
|
8
|
-
* Sets WHERE `column = ANY(:array)` condition in the query builder (PostgreSQL).
|
|
9
|
-
* The array is bound as a single parameter instead of one parameter per value.
|
|
10
|
-
* `arrayType` (e.g. `'uuid[]'`) casts the parameter: `= ANY(CAST(:array AS uuid[]))`.
|
|
11
|
-
* If you had previously WHERE expression defined,
|
|
12
|
-
* calling this function will override previously set WHERE conditions.
|
|
13
|
-
*/
|
|
14
|
-
whereIsAnyTyped<Type extends ObjectLiteral>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
15
|
-
/**
|
|
16
|
-
* Adds new AND WHERE `column = ANY(:array)` condition in the query builder (PostgreSQL).
|
|
17
|
-
*/
|
|
18
|
-
andWhereIsAnyTyped<Type extends ObjectLiteral>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
19
|
-
/**
|
|
20
|
-
* Adds new OR WHERE `column = ANY(:array)` condition in the query builder (PostgreSQL).
|
|
21
|
-
*/
|
|
22
|
-
orWhereIsAnyTyped<Type extends ObjectLiteral>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
23
|
-
/**
|
|
24
|
-
* Sets WHERE `column <> ALL(:array)` condition in the query builder (PostgreSQL):
|
|
25
|
-
* the column differs from every value of the array.
|
|
26
|
-
* If you had previously WHERE expression defined,
|
|
27
|
-
* calling this function will override previously set WHERE conditions.
|
|
28
|
-
*/
|
|
29
|
-
whereIsNotAnyTyped<Type extends ObjectLiteral>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
30
|
-
/**
|
|
31
|
-
* Adds new AND WHERE `column <> ALL(:array)` condition in the query builder (PostgreSQL).
|
|
32
|
-
*/
|
|
33
|
-
andWhereIsNotAnyTyped<Type extends ObjectLiteral>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
34
|
-
/**
|
|
35
|
-
* Adds new OR WHERE `column <> ALL(:array)` condition in the query builder (PostgreSQL).
|
|
36
|
-
*/
|
|
37
|
-
orWhereIsNotAnyTyped<Type extends ObjectLiteral>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
40
|
+
interface WhereExpressionBuilder extends TypedWhereIsAnyMethods<ObjectLiteral> {
|
|
38
41
|
}
|
|
39
42
|
}
|
|
40
43
|
declare module 'typeorm/query-builder/SelectQueryBuilder' {
|
|
41
|
-
interface SelectQueryBuilder<Entity extends ObjectLiteral> {
|
|
42
|
-
/**
|
|
43
|
-
* Sets WHERE `column = ANY(:array)` condition in the query builder (PostgreSQL).
|
|
44
|
-
* The array is bound as a single parameter instead of one parameter per value.
|
|
45
|
-
* `arrayType` (e.g. `'uuid[]'`) casts the parameter: `= ANY(CAST(:array AS uuid[]))`.
|
|
46
|
-
* If you had previously WHERE expression defined,
|
|
47
|
-
* calling this function will override previously set WHERE conditions.
|
|
48
|
-
*/
|
|
49
|
-
whereIsAnyTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
50
|
-
/**
|
|
51
|
-
* Adds new AND WHERE `column = ANY(:array)` condition in the query builder (PostgreSQL).
|
|
52
|
-
*/
|
|
53
|
-
andWhereIsAnyTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
54
|
-
/**
|
|
55
|
-
* Adds new OR WHERE `column = ANY(:array)` condition in the query builder (PostgreSQL).
|
|
56
|
-
*/
|
|
57
|
-
orWhereIsAnyTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
58
|
-
/**
|
|
59
|
-
* Sets WHERE `column <> ALL(:array)` condition in the query builder (PostgreSQL):
|
|
60
|
-
* the column differs from every value of the array.
|
|
61
|
-
* If you had previously WHERE expression defined,
|
|
62
|
-
* calling this function will override previously set WHERE conditions.
|
|
63
|
-
*/
|
|
64
|
-
whereIsNotAnyTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
65
|
-
/**
|
|
66
|
-
* Adds new AND WHERE `column <> ALL(:array)` condition in the query builder (PostgreSQL).
|
|
67
|
-
*/
|
|
68
|
-
andWhereIsNotAnyTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
69
|
-
/**
|
|
70
|
-
* Adds new OR WHERE `column <> ALL(:array)` condition in the query builder (PostgreSQL).
|
|
71
|
-
*/
|
|
72
|
-
orWhereIsNotAnyTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
44
|
+
interface SelectQueryBuilder<Entity extends ObjectLiteral> extends TypedWhereIsAnyMethods<Entity> {
|
|
73
45
|
}
|
|
74
46
|
}
|
|
75
47
|
declare module 'typeorm/query-builder/UpdateQueryBuilder' {
|
|
76
|
-
interface UpdateQueryBuilder<Entity extends ObjectLiteral> {
|
|
77
|
-
/**
|
|
78
|
-
* Sets WHERE `column = ANY(:array)` condition in the query builder (PostgreSQL).
|
|
79
|
-
* The array is bound as a single parameter instead of one parameter per value.
|
|
80
|
-
* `arrayType` (e.g. `'uuid[]'`) casts the parameter: `= ANY(CAST(:array AS uuid[]))`.
|
|
81
|
-
* If you had previously WHERE expression defined,
|
|
82
|
-
* calling this function will override previously set WHERE conditions.
|
|
83
|
-
*/
|
|
84
|
-
whereIsAnyTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
85
|
-
/**
|
|
86
|
-
* Adds new AND WHERE `column = ANY(:array)` condition in the query builder (PostgreSQL).
|
|
87
|
-
*/
|
|
88
|
-
andWhereIsAnyTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
89
|
-
/**
|
|
90
|
-
* Adds new OR WHERE `column = ANY(:array)` condition in the query builder (PostgreSQL).
|
|
91
|
-
*/
|
|
92
|
-
orWhereIsAnyTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
93
|
-
/**
|
|
94
|
-
* Sets WHERE `column <> ALL(:array)` condition in the query builder (PostgreSQL):
|
|
95
|
-
* the column differs from every value of the array.
|
|
96
|
-
* If you had previously WHERE expression defined,
|
|
97
|
-
* calling this function will override previously set WHERE conditions.
|
|
98
|
-
*/
|
|
99
|
-
whereIsNotAnyTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
100
|
-
/**
|
|
101
|
-
* Adds new AND WHERE `column <> ALL(:array)` condition in the query builder (PostgreSQL).
|
|
102
|
-
*/
|
|
103
|
-
andWhereIsNotAnyTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
104
|
-
/**
|
|
105
|
-
* Adds new OR WHERE `column <> ALL(:array)` condition in the query builder (PostgreSQL).
|
|
106
|
-
*/
|
|
107
|
-
orWhereIsNotAnyTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
48
|
+
interface UpdateQueryBuilder<Entity extends ObjectLiteral> extends TypedWhereIsAnyMethods<Entity> {
|
|
108
49
|
}
|
|
109
50
|
}
|
|
110
51
|
declare module 'typeorm/query-builder/DeleteQueryBuilder' {
|
|
111
|
-
interface DeleteQueryBuilder<Entity extends ObjectLiteral> {
|
|
112
|
-
/**
|
|
113
|
-
* Sets WHERE `column = ANY(:array)` condition in the query builder (PostgreSQL).
|
|
114
|
-
* The array is bound as a single parameter instead of one parameter per value.
|
|
115
|
-
* `arrayType` (e.g. `'uuid[]'`) casts the parameter: `= ANY(CAST(:array AS uuid[]))`.
|
|
116
|
-
* If you had previously WHERE expression defined,
|
|
117
|
-
* calling this function will override previously set WHERE conditions.
|
|
118
|
-
*/
|
|
119
|
-
whereIsAnyTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
120
|
-
/**
|
|
121
|
-
* Adds new AND WHERE `column = ANY(:array)` condition in the query builder (PostgreSQL).
|
|
122
|
-
*/
|
|
123
|
-
andWhereIsAnyTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
124
|
-
/**
|
|
125
|
-
* Adds new OR WHERE `column = ANY(:array)` condition in the query builder (PostgreSQL).
|
|
126
|
-
*/
|
|
127
|
-
orWhereIsAnyTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
128
|
-
/**
|
|
129
|
-
* Sets WHERE `column <> ALL(:array)` condition in the query builder (PostgreSQL):
|
|
130
|
-
* the column differs from every value of the array.
|
|
131
|
-
* If you had previously WHERE expression defined,
|
|
132
|
-
* calling this function will override previously set WHERE conditions.
|
|
133
|
-
*/
|
|
134
|
-
whereIsNotAnyTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
135
|
-
/**
|
|
136
|
-
* Adds new AND WHERE `column <> ALL(:array)` condition in the query builder (PostgreSQL).
|
|
137
|
-
*/
|
|
138
|
-
andWhereIsNotAnyTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
139
|
-
/**
|
|
140
|
-
* Adds new OR WHERE `column <> ALL(:array)` condition in the query builder (PostgreSQL).
|
|
141
|
-
*/
|
|
142
|
-
orWhereIsNotAnyTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType, arrayType?: string): this;
|
|
52
|
+
interface DeleteQueryBuilder<Entity extends ObjectLiteral> extends TypedWhereIsAnyMethods<Entity> {
|
|
143
53
|
}
|
|
144
54
|
}
|
|
@@ -4,6 +4,7 @@ require("../../where-is-any.extension");
|
|
|
4
4
|
const typeorm_1 = require("typeorm");
|
|
5
5
|
const query_builder_utils_1 = require("../../../utils/query-builder.utils");
|
|
6
6
|
const prototype_utils_1 = require("../../../utils/prototype.utils");
|
|
7
|
+
/* eslint-enable @typescript-eslint/no-empty-interface */
|
|
7
8
|
// patching
|
|
8
9
|
const createWhereIsAnyTypedMethod = (method) => function (where, array, arrayType) {
|
|
9
10
|
return attachWhereIsAnyTyped(this, method, where, array, arrayType);
|
|
@@ -31,7 +32,7 @@ function attachWhereIsAnyTyped(builder, method, where, array, arrayType) {
|
|
|
31
32
|
if (typeof where !== 'function') {
|
|
32
33
|
return builder;
|
|
33
34
|
}
|
|
34
|
-
const key = (0, query_builder_utils_1.getTypedSingleColumnKey)(builder, where, `${method}Typed
|
|
35
|
+
const key = (0, query_builder_utils_1.getTypedSingleColumnKey)(builder, where, `${method}Typed`, { value: array });
|
|
35
36
|
// .andWhere(`"table"."column" = ANY(:param)`, { param: ['value'] })
|
|
36
37
|
return builder[method](key, array, arrayType);
|
|
37
38
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import '../../where-is-distinct-from.extension';
|
|
2
2
|
import { ObjectLiteral } from 'typeorm';
|
|
3
3
|
import { DeepUnwrapArray, ProxyColumnValueType } from '../../../types/modules/proxy-callback.types';
|
|
4
|
+
import type { TypedRoot } from '../../../types/modules/typed-root.types';
|
|
4
5
|
/**
|
|
5
6
|
* Typesafe null-safe comparisons: the column comes from an entity property.
|
|
6
7
|
* See {@link WhereDistinctMethods}.
|
|
@@ -11,29 +12,29 @@ export interface TypedWhereDistinctMethods<Entity extends ObjectLiteral> {
|
|
|
11
12
|
* If you had previously WHERE expression defined,
|
|
12
13
|
* calling this function will override previously set WHERE conditions.
|
|
13
14
|
*/
|
|
14
|
-
whereIsDistinctFromTyped<Type extends ObjectLiteral = Entity
|
|
15
|
+
whereIsDistinctFromTyped<Type extends ObjectLiteral = TypedRoot<Entity>>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, value: unknown): this;
|
|
15
16
|
/**
|
|
16
17
|
* Adds new AND WHERE `column IS DISTINCT FROM :value` condition: the column differs from the value, `NULL` included.
|
|
17
18
|
*/
|
|
18
|
-
andWhereIsDistinctFromTyped<Type extends ObjectLiteral = Entity
|
|
19
|
+
andWhereIsDistinctFromTyped<Type extends ObjectLiteral = TypedRoot<Entity>>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, value: unknown): this;
|
|
19
20
|
/**
|
|
20
21
|
* Adds new OR WHERE `column IS DISTINCT FROM :value` condition: the column differs from the value, `NULL` included.
|
|
21
22
|
*/
|
|
22
|
-
orWhereIsDistinctFromTyped<Type extends ObjectLiteral = Entity
|
|
23
|
+
orWhereIsDistinctFromTyped<Type extends ObjectLiteral = TypedRoot<Entity>>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, value: unknown): this;
|
|
23
24
|
/**
|
|
24
25
|
* Sets WHERE `column IS NOT DISTINCT FROM :value` condition: the column equals the value, `NULL` included.
|
|
25
26
|
* If you had previously WHERE expression defined,
|
|
26
27
|
* calling this function will override previously set WHERE conditions.
|
|
27
28
|
*/
|
|
28
|
-
whereIsNotDistinctFromTyped<Type extends ObjectLiteral = Entity
|
|
29
|
+
whereIsNotDistinctFromTyped<Type extends ObjectLiteral = TypedRoot<Entity>>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, value: unknown): this;
|
|
29
30
|
/**
|
|
30
31
|
* Adds new AND WHERE `column IS NOT DISTINCT FROM :value` condition: the column equals the value, `NULL` included.
|
|
31
32
|
*/
|
|
32
|
-
andWhereIsNotDistinctFromTyped<Type extends ObjectLiteral = Entity
|
|
33
|
+
andWhereIsNotDistinctFromTyped<Type extends ObjectLiteral = TypedRoot<Entity>>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, value: unknown): this;
|
|
33
34
|
/**
|
|
34
35
|
* Adds new OR WHERE `column IS NOT DISTINCT FROM :value` condition: the column equals the value, `NULL` included.
|
|
35
36
|
*/
|
|
36
|
-
orWhereIsNotDistinctFromTyped<Type extends ObjectLiteral = Entity
|
|
37
|
+
orWhereIsNotDistinctFromTyped<Type extends ObjectLiteral = TypedRoot<Entity>>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, value: unknown): this;
|
|
37
38
|
}
|
|
38
39
|
declare module 'typeorm/query-builder/WhereExpressionBuilder' {
|
|
39
40
|
interface WhereExpressionBuilder extends TypedWhereDistinctMethods<ObjectLiteral> {
|
|
@@ -32,7 +32,7 @@ function attachWhereDistinctTyped(builder, method, where, value) {
|
|
|
32
32
|
if (typeof where !== 'function') {
|
|
33
33
|
return builder;
|
|
34
34
|
}
|
|
35
|
-
const key = (0, query_builder_utils_1.getTypedSingleColumnKey)(builder, where, `${method}Typed
|
|
35
|
+
const key = (0, query_builder_utils_1.getTypedSingleColumnKey)(builder, where, `${method}Typed`, { value });
|
|
36
36
|
// .andWhereIsDistinctFrom(`"table"."column"`, value)
|
|
37
37
|
return builder[method](key, value);
|
|
38
38
|
}
|
|
@@ -1,132 +1,51 @@
|
|
|
1
1
|
import '../../where-is-in.extension';
|
|
2
2
|
import { ObjectLiteral } from 'typeorm';
|
|
3
3
|
import { DeepUnwrapArray, ProxyColumnValueType } from '../../../types/modules/proxy-callback.types';
|
|
4
|
-
import {
|
|
4
|
+
import { TypedArrayArg, TypeOrDefault, UnsetType } from '../../../types/modules/typed-params.types';
|
|
5
|
+
import type { TypedRoot } from '../../../types/modules/typed-root.types';
|
|
6
|
+
export interface TypedWhereIsInMethods<Entity extends ObjectLiteral> {
|
|
7
|
+
/**
|
|
8
|
+
* Sets WHERE IN condition in the query builder.
|
|
9
|
+
* If you had previously WHERE expression defined,
|
|
10
|
+
* calling this function will override previously set WHERE conditions.
|
|
11
|
+
*/
|
|
12
|
+
whereIsInTyped<Type extends ObjectLiteral = UnsetType, Value extends ProxyColumnValueType = ProxyColumnValueType>(where: (proxy: DeepUnwrapArray<TypeOrDefault<Type, TypedRoot<Entity>>>) => Value, array?: TypedArrayArg<Type, Value>): this;
|
|
13
|
+
/**
|
|
14
|
+
* Adds new AND WHERE IN condition in the query builder.
|
|
15
|
+
*/
|
|
16
|
+
andWhereIsInTyped<Type extends ObjectLiteral = UnsetType, Value extends ProxyColumnValueType = ProxyColumnValueType>(where: (proxy: DeepUnwrapArray<TypeOrDefault<Type, TypedRoot<Entity>>>) => Value, array?: TypedArrayArg<Type, Value>): this;
|
|
17
|
+
/**
|
|
18
|
+
* Adds new OR WHERE IN condition in the query builder.
|
|
19
|
+
*/
|
|
20
|
+
orWhereIsInTyped<Type extends ObjectLiteral = UnsetType, Value extends ProxyColumnValueType = ProxyColumnValueType>(where: (proxy: DeepUnwrapArray<TypeOrDefault<Type, TypedRoot<Entity>>>) => Value, array?: TypedArrayArg<Type, Value>): this;
|
|
21
|
+
/**
|
|
22
|
+
* Sets WHERE NOT IN condition in the query builder.
|
|
23
|
+
* If you had previously WHERE expression defined,
|
|
24
|
+
* calling this function will override previously set WHERE conditions.
|
|
25
|
+
*/
|
|
26
|
+
whereIsNotInTyped<Type extends ObjectLiteral = UnsetType, Value extends ProxyColumnValueType = ProxyColumnValueType>(where: (proxy: DeepUnwrapArray<TypeOrDefault<Type, TypedRoot<Entity>>>) => Value, array?: TypedArrayArg<Type, Value>): this;
|
|
27
|
+
/**
|
|
28
|
+
* Adds new AND WHERE NOT IN condition in the query builder.
|
|
29
|
+
*/
|
|
30
|
+
andWhereIsNotInTyped<Type extends ObjectLiteral = UnsetType, Value extends ProxyColumnValueType = ProxyColumnValueType>(where: (proxy: DeepUnwrapArray<TypeOrDefault<Type, TypedRoot<Entity>>>) => Value, array?: TypedArrayArg<Type, Value>): this;
|
|
31
|
+
/**
|
|
32
|
+
* Adds new OR WHERE NOT IN condition in the query builder.
|
|
33
|
+
*/
|
|
34
|
+
orWhereIsNotInTyped<Type extends ObjectLiteral = UnsetType, Value extends ProxyColumnValueType = ProxyColumnValueType>(where: (proxy: DeepUnwrapArray<TypeOrDefault<Type, TypedRoot<Entity>>>) => Value, array?: TypedArrayArg<Type, Value>): this;
|
|
35
|
+
}
|
|
5
36
|
declare module 'typeorm/query-builder/WhereExpressionBuilder' {
|
|
6
|
-
interface WhereExpressionBuilder {
|
|
7
|
-
/**
|
|
8
|
-
* Sets WHERE IN condition in the query builder.
|
|
9
|
-
* If you had previously WHERE expression defined,
|
|
10
|
-
* calling this function will override previously set WHERE conditions.
|
|
11
|
-
*/
|
|
12
|
-
whereIsInTyped<Type extends ObjectLiteral>(subQuery: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
13
|
-
/**
|
|
14
|
-
* Adds new AND WHERE IN condition in the query builder.
|
|
15
|
-
*/
|
|
16
|
-
andWhereIsInTyped<Type extends ObjectLiteral>(subQuery: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
17
|
-
/**
|
|
18
|
-
* Adds new OR WHERE IN condition in the query builder.
|
|
19
|
-
*/
|
|
20
|
-
orWhereIsInTyped<Type extends ObjectLiteral>(subQuery: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
21
|
-
/**
|
|
22
|
-
* Sets WHERE NOT IN condition in the query builder.
|
|
23
|
-
* If you had previously WHERE expression defined,
|
|
24
|
-
* calling this function will override previously set WHERE conditions.
|
|
25
|
-
*/
|
|
26
|
-
whereIsNotInTyped<Type extends ObjectLiteral>(subQuery: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
27
|
-
/**
|
|
28
|
-
* Adds new AND WHERE NOT IN condition in the query builder.
|
|
29
|
-
*/
|
|
30
|
-
andWhereIsNotInTyped<Type extends ObjectLiteral>(subQuery: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
31
|
-
/**
|
|
32
|
-
* Adds new OR WHERE NOT IN condition in the query builder.
|
|
33
|
-
*/
|
|
34
|
-
orWhereIsNotInTyped<Type extends ObjectLiteral>(subQuery: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
37
|
+
interface WhereExpressionBuilder extends TypedWhereIsInMethods<ObjectLiteral> {
|
|
35
38
|
}
|
|
36
39
|
}
|
|
37
40
|
declare module 'typeorm/query-builder/SelectQueryBuilder' {
|
|
38
|
-
interface SelectQueryBuilder<Entity extends ObjectLiteral> {
|
|
39
|
-
/**
|
|
40
|
-
* Sets WHERE IN condition in the query builder.
|
|
41
|
-
* If you had previously WHERE expression defined,
|
|
42
|
-
* calling this function will override previously set WHERE conditions.
|
|
43
|
-
*/
|
|
44
|
-
whereIsInTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
45
|
-
/**
|
|
46
|
-
* Adds new AND WHERE IN condition in the query builder.
|
|
47
|
-
*/
|
|
48
|
-
andWhereIsInTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
49
|
-
/**
|
|
50
|
-
* Adds new OR WHERE IN condition in the query builder.
|
|
51
|
-
*/
|
|
52
|
-
orWhereIsInTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
53
|
-
/**
|
|
54
|
-
* Sets WHERE NOT IN condition in the query builder.
|
|
55
|
-
* If you had previously WHERE expression defined,
|
|
56
|
-
* calling this function will override previously set WHERE conditions.
|
|
57
|
-
*/
|
|
58
|
-
whereIsNotInTyped<Type extends ObjectLiteral = Entity>(subQuery: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
59
|
-
/**
|
|
60
|
-
* Adds new AND WHERE NOT IN condition in the query builder.
|
|
61
|
-
*/
|
|
62
|
-
andWhereIsNotInTyped<Type extends ObjectLiteral = Entity>(subQuery: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
63
|
-
/**
|
|
64
|
-
* Adds new OR WHERE NOT IN condition in the query builder.
|
|
65
|
-
*/
|
|
66
|
-
orWhereIsNotInTyped<Type extends ObjectLiteral = Entity>(subQuery: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
41
|
+
interface SelectQueryBuilder<Entity extends ObjectLiteral> extends TypedWhereIsInMethods<Entity> {
|
|
67
42
|
}
|
|
68
43
|
}
|
|
69
44
|
declare module 'typeorm/query-builder/UpdateQueryBuilder' {
|
|
70
|
-
interface UpdateQueryBuilder<Entity extends ObjectLiteral> {
|
|
71
|
-
/**
|
|
72
|
-
* Sets WHERE IN condition in the query builder.
|
|
73
|
-
* If you had previously WHERE expression defined,
|
|
74
|
-
* calling this function will override previously set WHERE conditions.
|
|
75
|
-
*/
|
|
76
|
-
whereIsInTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
77
|
-
/**
|
|
78
|
-
* Adds new AND WHERE IN condition in the query builder.
|
|
79
|
-
*/
|
|
80
|
-
andWhereIsInTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
81
|
-
/**
|
|
82
|
-
* Adds new OR WHERE IN condition in the query builder.
|
|
83
|
-
*/
|
|
84
|
-
orWhereIsInTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
85
|
-
/**
|
|
86
|
-
* Sets WHERE NOT IN condition in the query builder.
|
|
87
|
-
* If you had previously WHERE expression defined,
|
|
88
|
-
* calling this function will override previously set WHERE conditions.
|
|
89
|
-
*/
|
|
90
|
-
whereIsNotInTyped<Type extends ObjectLiteral = Entity>(subQuery: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
91
|
-
/**
|
|
92
|
-
* Adds new AND WHERE NOT IN condition in the query builder.
|
|
93
|
-
*/
|
|
94
|
-
andWhereIsNotInTyped<Type extends ObjectLiteral = Entity>(subQuery: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
95
|
-
/**
|
|
96
|
-
* Adds new OR WHERE NOT IN condition in the query builder.
|
|
97
|
-
*/
|
|
98
|
-
orWhereIsNotInTyped<Type extends ObjectLiteral = Entity>(subQuery: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
45
|
+
interface UpdateQueryBuilder<Entity extends ObjectLiteral> extends TypedWhereIsInMethods<Entity> {
|
|
99
46
|
}
|
|
100
47
|
}
|
|
101
48
|
declare module 'typeorm/query-builder/DeleteQueryBuilder' {
|
|
102
|
-
interface DeleteQueryBuilder<Entity extends ObjectLiteral> {
|
|
103
|
-
/**
|
|
104
|
-
* Sets WHERE IN condition in the query builder.
|
|
105
|
-
* If you had previously WHERE expression defined,
|
|
106
|
-
* calling this function will override previously set WHERE conditions.
|
|
107
|
-
*/
|
|
108
|
-
whereIsInTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
109
|
-
/**
|
|
110
|
-
* Adds new AND WHERE IN condition in the query builder.
|
|
111
|
-
*/
|
|
112
|
-
andWhereIsInTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
113
|
-
/**
|
|
114
|
-
* Adds new OR WHERE IN condition in the query builder.
|
|
115
|
-
*/
|
|
116
|
-
orWhereIsInTyped<Type extends ObjectLiteral = Entity>(where: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
117
|
-
/**
|
|
118
|
-
* Sets WHERE NOT IN condition in the query builder.
|
|
119
|
-
* If you had previously WHERE expression defined,
|
|
120
|
-
* calling this function will override previously set WHERE conditions.
|
|
121
|
-
*/
|
|
122
|
-
whereIsNotInTyped<Type extends ObjectLiteral = Entity>(subQuery: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
123
|
-
/**
|
|
124
|
-
* Adds new AND WHERE NOT IN condition in the query builder.
|
|
125
|
-
*/
|
|
126
|
-
andWhereIsNotInTyped<Type extends ObjectLiteral = Entity>(subQuery: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
127
|
-
/**
|
|
128
|
-
* Adds new OR WHERE NOT IN condition in the query builder.
|
|
129
|
-
*/
|
|
130
|
-
orWhereIsNotInTyped<Type extends ObjectLiteral = Entity>(subQuery: (proxy: DeepUnwrapArray<Type>) => ProxyColumnValueType, array?: ArgsType): this;
|
|
49
|
+
interface DeleteQueryBuilder<Entity extends ObjectLiteral> extends TypedWhereIsInMethods<Entity> {
|
|
131
50
|
}
|
|
132
51
|
}
|