@uql/core 1.0.11 → 1.0.12
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/README.md +9 -11
- package/entity/decorator/relation.d.ts +1 -1
- package/package.json +3 -3
- package/type/entity.d.ts +26 -26
- package/type/querier.d.ts +2 -2
- package/type/querierPool.d.ts +1 -1
- package/type/query.d.ts +34 -34
- package/type/repository.d.ts +1 -1
- package/type/utility.d.ts +7 -7
- package/util/dialect.util.d.ts +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
# [uql](https://
|
|
2
|
-
|
|
3
|
-
Learn more of uql in the website https://uql.io :high_brightness:
|
|
1
|
+
# [uql](https://nukak.org) · [](https://github.com/rogerpadilla/uql/blob/main/LICENSE) [](https://github.com/rogerpadilla/uql) [](https://coveralls.io/r/rogerpadilla/uql?branch=main) [](https://badge.fury.io/js/%40uql%2Fcore)
|
|
4
2
|
|
|
5
3
|
## Quick Start
|
|
6
4
|
|
|
@@ -10,13 +8,13 @@ The `uql` queries can be safely written in the frontend (browser/mobile) and sen
|
|
|
10
8
|
|
|
11
9
|
### <a name="features"></a> Features
|
|
12
10
|
|
|
13
|
-
- `JSON` (serializable) syntax for all the [queries](https://
|
|
14
|
-
- uses the power of `TypeScript` to get smart type-safety [everywhere](https://
|
|
15
|
-
- the generated queries are [performant](https://
|
|
16
|
-
- `$project`, `$filter`, `$sort`, `$limit` works at [multiple levels](https://
|
|
17
|
-
- [declarative](https://
|
|
18
|
-
- [soft-delete](https://
|
|
19
|
-
- transparent support for [inheritance](https://
|
|
11
|
+
- `JSON` (serializable) syntax for all the [queries](https://nukak.org/docs/querying-logical-operators).
|
|
12
|
+
- uses the power of `TypeScript` to get smart type-safety [everywhere](https://nukak.org/docs/api-repository).
|
|
13
|
+
- the generated queries are [performant](https://nukak.org/docs/querying-retrieve-relations), safe, and human-readable.
|
|
14
|
+
- `$project`, `$filter`, `$sort`, `$limit` works at [multiple levels](https://nukak.org/docs/querying-retrieve-relations) (including deep relations and their fields).
|
|
15
|
+
- [declarative](https://nukak.org/docs/transactions-declarative) and [imperative](https://nukak.org/docs/transactions-imperative) `transactions`.
|
|
16
|
+
- [soft-delete](https://nukak.org/docs/entities-soft-delete), [virtual fields](https://nukak.org/docs/entities-virtual-fields), [repositories](https://nukak.org/docs/api-repository), `connection pooling`.
|
|
17
|
+
- transparent support for [inheritance](https://nukak.org/docs/entities-advanced) between entities.
|
|
20
18
|
- supports `Postgres`, `MySQL`, `MariaDB`, `SQLite`, `MongoDB`.
|
|
21
19
|
|
|
22
20
|
### <a name="installation"></a> Installation
|
|
@@ -176,4 +174,4 @@ await querier.release();
|
|
|
176
174
|
|
|
177
175
|
---
|
|
178
176
|
|
|
179
|
-
See more in https://
|
|
177
|
+
See more in https://nukak.org :high_brightness:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RelationOptions, RelationOneToOneOptions, RelationOneToManyOptions, RelationManyToOneOptions, RelationManyToManyOptions } from '../../type';
|
|
2
2
|
declare function Relation<E>(opts: RelationOptions<E>): (target: object, key: string) => void;
|
|
3
|
-
|
|
3
|
+
type RelationReturn = ReturnType<typeof Relation>;
|
|
4
4
|
export declare function OneToOne<E>(opts?: RelationOneToOneOptions<E>): RelationReturn;
|
|
5
5
|
export declare function ManyToOne<E>(opts?: RelationManyToOneOptions<E>): RelationReturn;
|
|
6
6
|
export declare function OneToMany<E>(opts: RelationOneToManyOptions<E>): RelationReturn;
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uql/core",
|
|
3
|
-
"homepage": "https://
|
|
3
|
+
"homepage": "https://nukak.org",
|
|
4
4
|
"description": "flexible and efficient ORM, with declarative JSON syntax and smart type-safety",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.12",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"types": "./index.d.ts",
|
|
9
9
|
"scripts": {
|
|
@@ -60,4 +60,4 @@
|
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
62
|
"gitHead": "3ced0c218364ddcd9e234096155ff205a7583b13"
|
|
63
|
-
}
|
|
63
|
+
}
|
package/type/entity.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { QueryRaw } from './query';
|
|
2
2
|
import { Scalar, Type } from './utility';
|
|
3
3
|
export declare const idKey: unique symbol;
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type Key<E> = keyof E & string;
|
|
5
|
+
export type FieldKey<E> = {
|
|
6
6
|
readonly [K in keyof E]: E[K] extends Scalar ? K : never;
|
|
7
7
|
}[Key<E>];
|
|
8
|
-
export
|
|
8
|
+
export type RelationKey<E> = {
|
|
9
9
|
readonly [K in keyof E]: E[K] extends Scalar ? never : K;
|
|
10
10
|
}[Key<E>];
|
|
11
|
-
export
|
|
12
|
-
export
|
|
11
|
+
export type FieldValue<E> = E[FieldKey<E>];
|
|
12
|
+
export type IdKey<E> = E extends {
|
|
13
13
|
[idKey]?: infer K;
|
|
14
14
|
} ? K & FieldKey<E> : E extends {
|
|
15
15
|
_id?: unknown;
|
|
16
16
|
} ? '_id' & FieldKey<E> : E extends {
|
|
17
17
|
id?: unknown;
|
|
18
18
|
} ? 'id' & FieldKey<E> : FieldKey<E>;
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
19
|
+
export type IdValue<E> = E[IdKey<E>];
|
|
20
|
+
export type RelationValue<E> = E[RelationKey<E>];
|
|
21
|
+
export type EntityOptions = {
|
|
22
22
|
readonly name?: string;
|
|
23
23
|
readonly softDelete?: boolean;
|
|
24
24
|
};
|
|
25
|
-
export
|
|
25
|
+
export type FieldOptions = {
|
|
26
26
|
readonly name?: string;
|
|
27
27
|
readonly isId?: true;
|
|
28
28
|
readonly type?: any;
|
|
@@ -32,10 +32,10 @@ export declare type FieldOptions = {
|
|
|
32
32
|
readonly onUpdate?: OnFieldCallback;
|
|
33
33
|
readonly onDelete?: OnFieldCallback;
|
|
34
34
|
};
|
|
35
|
-
export
|
|
36
|
-
export
|
|
37
|
-
export
|
|
38
|
-
export
|
|
35
|
+
export type OnFieldCallback = Scalar | QueryRaw | (() => Scalar | QueryRaw);
|
|
36
|
+
export type EntityGetter<E = any> = () => Type<E>;
|
|
37
|
+
export type CascadeType = 'persist' | 'delete';
|
|
38
|
+
export type RelationOptions<E = any> = {
|
|
39
39
|
entity?: EntityGetter<E>;
|
|
40
40
|
cardinality: RelationCardinality;
|
|
41
41
|
readonly cascade?: boolean | CascadeType;
|
|
@@ -43,24 +43,24 @@ export declare type RelationOptions<E = any> = {
|
|
|
43
43
|
through?: EntityGetter<RelationValue<E>>;
|
|
44
44
|
references?: RelationReferences;
|
|
45
45
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
export
|
|
46
|
+
type RelationOptionsOwner<E> = Pick<RelationOptions<E>, 'entity' | 'references' | 'cascade'>;
|
|
47
|
+
type RelationOptionsInverseSide<E> = Required<Pick<RelationOptions<E>, 'entity' | 'mappedBy'>> & Pick<RelationOptions<E>, 'cascade'>;
|
|
48
|
+
type RelationOptionsThroughOwner<E> = Required<Pick<RelationOptions<E>, 'entity'>> & Pick<RelationOptions<E>, 'through' | 'references' | 'cascade'>;
|
|
49
|
+
export type RelationKeyMap<E> = {
|
|
50
50
|
readonly [K in keyof E]: K;
|
|
51
51
|
};
|
|
52
|
-
export
|
|
53
|
-
export
|
|
52
|
+
export type RelationKeyMapper<E> = (keyMap: RelationKeyMap<E>) => Key<E>;
|
|
53
|
+
export type RelationReferences = {
|
|
54
54
|
readonly local: string;
|
|
55
55
|
readonly foreign: string;
|
|
56
56
|
}[];
|
|
57
|
-
export
|
|
58
|
-
export
|
|
59
|
-
export
|
|
60
|
-
export
|
|
61
|
-
export
|
|
62
|
-
export
|
|
63
|
-
export
|
|
57
|
+
export type RelationMappedBy<E> = Key<E> | RelationKeyMapper<E>;
|
|
58
|
+
export type RelationCardinality = '11' | 'm1' | '1m' | 'mm';
|
|
59
|
+
export type RelationOneToOneOptions<E> = RelationOptionsOwner<E> | RelationOptionsInverseSide<E>;
|
|
60
|
+
export type RelationOneToManyOptions<E> = RelationOptionsInverseSide<E> | RelationOptionsThroughOwner<E>;
|
|
61
|
+
export type RelationManyToOneOptions<E> = RelationOptionsOwner<E> | RelationOptionsInverseSide<E>;
|
|
62
|
+
export type RelationManyToManyOptions<E> = RelationOptionsThroughOwner<E> | RelationOptionsInverseSide<E>;
|
|
63
|
+
export type EntityMeta<E> = {
|
|
64
64
|
readonly entity: Type<E>;
|
|
65
65
|
name?: string;
|
|
66
66
|
id?: IdKey<E>;
|
package/type/querier.d.ts
CHANGED
|
@@ -6,11 +6,11 @@ import { UniversalQuerier } from './universalQuerier';
|
|
|
6
6
|
/**
|
|
7
7
|
* logger function to debug queries.
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export type QuerierLogger = (message: any, ...args: any[]) => any;
|
|
10
10
|
/**
|
|
11
11
|
* Isolation levels for transactions.
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export type IsolationLevel = 'read uncommitted' | 'read committed' | 'repeteable read' | 'serializable';
|
|
14
14
|
export interface Querier extends UniversalQuerier {
|
|
15
15
|
count<E>(entity: Type<E>, qm?: QuerySearch<E>): Promise<number>;
|
|
16
16
|
findOneById<E>(entity: Type<E>, id: IdValue<E>, qm?: QueryUnique<E>): Promise<E>;
|
package/type/querierPool.d.ts
CHANGED
package/type/query.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FieldKey, IdValue, Key, RelationKey } from './entity';
|
|
2
2
|
import { BooleanLike, ExpandScalar, Scalar, Type, Unpacked } from './utility';
|
|
3
|
-
export
|
|
3
|
+
export type QueryOptions = {
|
|
4
4
|
/**
|
|
5
5
|
* use or omit `softDelete` attribute.
|
|
6
6
|
*/
|
|
@@ -14,7 +14,7 @@ export declare type QueryOptions = {
|
|
|
14
14
|
*/
|
|
15
15
|
readonly autoPrefix?: boolean;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type QueryProjectOptions = {
|
|
18
18
|
/**
|
|
19
19
|
* prefix the query with this.
|
|
20
20
|
*/
|
|
@@ -27,19 +27,19 @@ export declare type QueryProjectOptions = {
|
|
|
27
27
|
/**
|
|
28
28
|
* query projection as an array.
|
|
29
29
|
*/
|
|
30
|
-
export
|
|
30
|
+
export type QueryProjectArray<E> = readonly (Key<E> | QueryRaw)[];
|
|
31
31
|
/**
|
|
32
32
|
* query projection as a map.
|
|
33
33
|
*/
|
|
34
|
-
export
|
|
34
|
+
export type QueryProjectMap<E> = QueryProjectFieldMap<E> | QueryProjectRelationMap<E>;
|
|
35
35
|
/**
|
|
36
36
|
* query projection.
|
|
37
37
|
*/
|
|
38
|
-
export
|
|
38
|
+
export type QueryProject<E> = QueryProjectArray<E> | QueryProjectMap<E>;
|
|
39
39
|
/**
|
|
40
40
|
* query projection of fields as a map.
|
|
41
41
|
*/
|
|
42
|
-
export
|
|
42
|
+
export type QueryProjectFieldMap<E> = {
|
|
43
43
|
[K in FieldKey<E>]?: BooleanLike;
|
|
44
44
|
} | {
|
|
45
45
|
[K: string]: QueryRaw;
|
|
@@ -47,19 +47,19 @@ export declare type QueryProjectFieldMap<E> = {
|
|
|
47
47
|
/**
|
|
48
48
|
* query projection of relations as a map.
|
|
49
49
|
*/
|
|
50
|
-
export
|
|
50
|
+
export type QueryProjectRelationMap<E> = {
|
|
51
51
|
[K in RelationKey<E>]?: BooleanLike | readonly Key<Unpacked<E[K]>>[] | QueryProjectRelationOptions<E[K]>;
|
|
52
52
|
};
|
|
53
53
|
/**
|
|
54
54
|
* options to project a relation.
|
|
55
55
|
*/
|
|
56
|
-
export
|
|
56
|
+
export type QueryProjectRelationOptions<E> = (E extends any[] ? Query<Unpacked<E>> : QueryUnique<Unpacked<E>>) & {
|
|
57
57
|
readonly $required?: boolean;
|
|
58
58
|
};
|
|
59
59
|
/**
|
|
60
60
|
* options for full-text-search operator.
|
|
61
61
|
*/
|
|
62
|
-
export
|
|
62
|
+
export type QueryTextSearchOptions<E> = {
|
|
63
63
|
/**
|
|
64
64
|
* text to search for.
|
|
65
65
|
*/
|
|
@@ -72,17 +72,17 @@ export declare type QueryTextSearchOptions<E> = {
|
|
|
72
72
|
/**
|
|
73
73
|
* value for a logical filtering.
|
|
74
74
|
*/
|
|
75
|
-
export
|
|
75
|
+
export type QueryFilterLogical<E> = readonly QueryFilter<E>[];
|
|
76
76
|
/**
|
|
77
77
|
* comparison by fields.
|
|
78
78
|
*/
|
|
79
|
-
export
|
|
79
|
+
export type QueryFilterFieldMap<E> = {
|
|
80
80
|
readonly [K in FieldKey<E>]?: QueryFilterFieldValue<E[K]>;
|
|
81
81
|
};
|
|
82
82
|
/**
|
|
83
83
|
* complex operators.
|
|
84
84
|
*/
|
|
85
|
-
export
|
|
85
|
+
export type QueryFilterMap<E> = QueryFilterFieldMap<E> & {
|
|
86
86
|
/**
|
|
87
87
|
* joins query clauses with a logical `AND`, returns records that match all the clauses.
|
|
88
88
|
*/
|
|
@@ -112,7 +112,7 @@ export declare type QueryFilterMap<E> = QueryFilterFieldMap<E> & {
|
|
|
112
112
|
*/
|
|
113
113
|
readonly $nexists?: QueryRaw;
|
|
114
114
|
};
|
|
115
|
-
export
|
|
115
|
+
export type QueryFilterFieldOperatorMap<T> = {
|
|
116
116
|
/**
|
|
117
117
|
* whether a value is equal to the given value.
|
|
118
118
|
*/
|
|
@@ -189,57 +189,57 @@ export declare type QueryFilterFieldOperatorMap<T> = {
|
|
|
189
189
|
/**
|
|
190
190
|
* Value for a field comparison.
|
|
191
191
|
*/
|
|
192
|
-
export
|
|
192
|
+
export type QueryFilterFieldValue<T> = T | readonly T[] | QueryFilterFieldOperatorMap<T> | QueryRaw;
|
|
193
193
|
/**
|
|
194
194
|
* query filter.
|
|
195
195
|
*/
|
|
196
|
-
export
|
|
196
|
+
export type QueryFilter<E> = IdValue<E> | readonly IdValue<E>[] | QueryRaw | QueryFilterMap<E>;
|
|
197
197
|
/**
|
|
198
198
|
* direction for the sort.
|
|
199
199
|
*/
|
|
200
|
-
export
|
|
200
|
+
export type QuerySortDirection = -1 | 1 | 'asc' | 'desc';
|
|
201
201
|
/**
|
|
202
202
|
* sort by tuples
|
|
203
203
|
*/
|
|
204
|
-
export
|
|
204
|
+
export type QuerySortTuples<E> = readonly [FieldKey<E>, QuerySortDirection][];
|
|
205
205
|
/**
|
|
206
206
|
* sort by objects.
|
|
207
207
|
*/
|
|
208
|
-
export
|
|
208
|
+
export type QuerySortObjects<E> = readonly {
|
|
209
209
|
readonly field: FieldKey<E>;
|
|
210
210
|
readonly sort: QuerySortDirection;
|
|
211
211
|
}[];
|
|
212
212
|
/**
|
|
213
213
|
* sort by fields.
|
|
214
214
|
*/
|
|
215
|
-
export
|
|
215
|
+
export type QuerySortFieldMap<E> = {
|
|
216
216
|
[K in FieldKey<E>]?: QuerySortDirection;
|
|
217
217
|
};
|
|
218
218
|
/**
|
|
219
219
|
* sort by relations fields.
|
|
220
220
|
*/
|
|
221
|
-
export
|
|
221
|
+
export type QuerySortRelationMap<E> = {
|
|
222
222
|
[K in RelationKey<E>]?: QuerySortMap<Unpacked<E[K]>>;
|
|
223
223
|
};
|
|
224
224
|
/**
|
|
225
225
|
* sort by map.
|
|
226
226
|
*/
|
|
227
|
-
export
|
|
227
|
+
export type QuerySortMap<E> = QuerySortFieldMap<E> | QuerySortRelationMap<E>;
|
|
228
228
|
/**
|
|
229
229
|
* sort options.
|
|
230
230
|
*/
|
|
231
|
-
export
|
|
231
|
+
export type QuerySort<E> = QuerySortMap<E> | QuerySortTuples<E> | QuerySortObjects<E>;
|
|
232
232
|
/**
|
|
233
233
|
* pager options.
|
|
234
234
|
*/
|
|
235
|
-
export
|
|
235
|
+
export type QueryPager = {
|
|
236
236
|
$skip?: number;
|
|
237
237
|
$limit?: number;
|
|
238
238
|
};
|
|
239
239
|
/**
|
|
240
240
|
* search options.
|
|
241
241
|
*/
|
|
242
|
-
export
|
|
242
|
+
export type QuerySearch<E> = {
|
|
243
243
|
/**
|
|
244
244
|
* filtering options.
|
|
245
245
|
*/
|
|
@@ -256,7 +256,7 @@ export declare type QuerySearch<E> = {
|
|
|
256
256
|
/**
|
|
257
257
|
* criteria options.
|
|
258
258
|
*/
|
|
259
|
-
export
|
|
259
|
+
export type QueryCriteria<E> = QuerySearch<E> & {
|
|
260
260
|
/**
|
|
261
261
|
* sorting options.
|
|
262
262
|
*/
|
|
@@ -265,7 +265,7 @@ export declare type QueryCriteria<E> = QuerySearch<E> & {
|
|
|
265
265
|
/**
|
|
266
266
|
* query options.
|
|
267
267
|
*/
|
|
268
|
-
export
|
|
268
|
+
export type Query<E> = {
|
|
269
269
|
/**
|
|
270
270
|
* projection options.
|
|
271
271
|
*/
|
|
@@ -274,21 +274,21 @@ export declare type Query<E> = {
|
|
|
274
274
|
/**
|
|
275
275
|
* options to get a single record.
|
|
276
276
|
*/
|
|
277
|
-
export
|
|
277
|
+
export type QueryOne<E> = Omit<Query<E>, '$limit'>;
|
|
278
278
|
/**
|
|
279
279
|
* options to get an unique record.
|
|
280
280
|
*/
|
|
281
|
-
export
|
|
281
|
+
export type QueryUnique<E> = Pick<Query<E>, '$project' | '$filter'>;
|
|
282
282
|
/**
|
|
283
283
|
* stringified query.
|
|
284
284
|
*/
|
|
285
|
-
export
|
|
285
|
+
export type QueryStringified = {
|
|
286
286
|
readonly [K in keyof Query<any>]?: string;
|
|
287
287
|
};
|
|
288
288
|
/**
|
|
289
289
|
* result of an update operation.
|
|
290
290
|
*/
|
|
291
|
-
export
|
|
291
|
+
export type QueryUpdateResult = {
|
|
292
292
|
/**
|
|
293
293
|
* number of changes.
|
|
294
294
|
*/
|
|
@@ -301,7 +301,7 @@ export declare type QueryUpdateResult = {
|
|
|
301
301
|
/**
|
|
302
302
|
* options for the `raw` function.
|
|
303
303
|
*/
|
|
304
|
-
export
|
|
304
|
+
export type QueryRawFnOptions = {
|
|
305
305
|
/**
|
|
306
306
|
* the current dialect.
|
|
307
307
|
*/
|
|
@@ -318,7 +318,7 @@ export declare type QueryRawFnOptions = {
|
|
|
318
318
|
/**
|
|
319
319
|
* a `raw` function
|
|
320
320
|
*/
|
|
321
|
-
export
|
|
321
|
+
export type QueryRawFn = (opts?: QueryRawFnOptions) => string;
|
|
322
322
|
export declare class QueryRaw {
|
|
323
323
|
readonly value: Scalar | QueryRawFn;
|
|
324
324
|
readonly alias?: string;
|
|
@@ -327,7 +327,7 @@ export declare class QueryRaw {
|
|
|
327
327
|
/**
|
|
328
328
|
* comparison options.
|
|
329
329
|
*/
|
|
330
|
-
export
|
|
330
|
+
export type QueryComparisonOptions = QueryOptions & {
|
|
331
331
|
/**
|
|
332
332
|
* use precedence for the comparison or not.
|
|
333
333
|
*/
|
|
@@ -336,7 +336,7 @@ export declare type QueryComparisonOptions = QueryOptions & {
|
|
|
336
336
|
/**
|
|
337
337
|
* query filter options.
|
|
338
338
|
*/
|
|
339
|
-
export
|
|
339
|
+
export type QueryFilterOptions = QueryComparisonOptions & {
|
|
340
340
|
/**
|
|
341
341
|
* clause to be used in the filter.
|
|
342
342
|
*/
|
package/type/repository.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Type } from './utility';
|
|
|
5
5
|
/**
|
|
6
6
|
* A `repository` allows to interact with the datasource to perform persistence operations on a specific entity.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type UniversalRepository<E> = {
|
|
9
9
|
/**
|
|
10
10
|
* counts the number of records matching the given search parameters.
|
|
11
11
|
* @param qm the search options
|
package/type/utility.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
2
|
+
export type Type<T> = new (...args: any[]) => T;
|
|
3
|
+
export type BooleanLike = boolean | 0 | 1;
|
|
4
|
+
export type MongoId = {
|
|
5
5
|
toHexString: () => string;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
7
|
+
export type Scalar = string | number | boolean | bigint | Symbol | Date | RegExp | Buffer | MongoId;
|
|
8
|
+
export type ExpandScalar<T> = null | (T extends Date ? Date | string : T);
|
|
9
|
+
export type Writable<T> = {
|
|
10
10
|
-readonly [K in keyof T]: T[K];
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type Unpacked<T> = T extends (infer U)[] ? U : T extends (...args: any[]) => infer U ? U : T extends Promise<infer U> ? U : T;
|
package/util/dialect.util.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EntityMeta, QueryProject, CascadeType, RelationKey, FieldOptions, QueryRaw, QuerySort, QuerySortMap, QueryRawFnOptions, QueryFilter, QueryFilterMap, OnFieldCallback } from '../type';
|
|
2
|
-
|
|
2
|
+
type CallbackKey = keyof Pick<FieldOptions, 'onInsert' | 'onUpdate' | 'onDelete'>;
|
|
3
3
|
export declare function getRawValue(opts: QueryRawFnOptions & {
|
|
4
4
|
value: QueryRaw;
|
|
5
5
|
autoPrefixAlias?: boolean;
|