@danceroutine/tango-orm 1.11.1 → 1.11.3
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/Adapter-DKxAaL4l.d.ts +73 -0
- package/dist/DBClient-DuYcXolQ.d.ts +27 -0
- package/dist/{InternalDialect-ClSaUNso.js → InternalDialect-U3mwJjKA.js} +3 -4
- package/dist/InternalDialect-U3mwJjKA.js.map +1 -0
- package/dist/QuerySetState-CjyvAUBs.d.ts +1310 -0
- package/dist/SqliteAdapter-6oyUmoJf.js +279 -0
- package/dist/SqliteAdapter-6oyUmoJf.js.map +1 -0
- package/dist/chunk-8H4AJuhK.js +14 -0
- package/dist/connection/index.d.ts +4 -11
- package/dist/connection/index.js +3 -6
- package/dist/{connection-Dmhgx31M.js → connection-D-E6_Yf1.js} +28 -30
- package/dist/connection-D-E6_Yf1.js.map +1 -0
- package/dist/{defaultRuntime-DzqBQ9Hb.js → defaultRuntime-CdTX8cXm.js} +41 -35
- package/dist/defaultRuntime-CdTX8cXm.js.map +1 -0
- package/dist/index-B-aibguC.d.ts +226 -0
- package/dist/index-D9B6gKez.d.ts +70 -0
- package/dist/index-rjKca3U_.d.ts +31 -0
- package/dist/index-uuG57Y7C.d.ts +97 -0
- package/dist/index.d.ts +9 -22
- package/dist/index.js +9 -12
- package/dist/manager/index.d.ts +4 -12
- package/dist/manager/index.js +3 -9
- package/dist/{manager-DrDTiCAz.js → manager-CiYqAYpn.js} +7 -11
- package/dist/{manager-DrDTiCAz.js.map → manager-CiYqAYpn.js.map} +1 -1
- package/dist/query/index.d.ts +3 -14
- package/dist/query/index.js +2 -4
- package/dist/{query-DUZnBFhf.js → query-CP1UMIX6.js} +163 -121
- package/dist/query-CP1UMIX6.js.map +1 -0
- package/dist/registerModelObjects-C-MliIiM.d.ts +229 -0
- package/dist/{registerModelObjects-22ZJKoit.js → registerModelObjects-DZfZ20fa.js} +119 -69
- package/dist/registerModelObjects-DZfZ20fa.js.map +1 -0
- package/dist/runtime/index.d.ts +3 -15
- package/dist/runtime/index.js +15 -8
- package/dist/runtime/index.js.map +1 -0
- package/dist/transaction/index.d.ts +2 -6
- package/dist/transaction/index.js +2 -7
- package/dist/{transaction-ZhfDf-f8.js → transaction-2_2m7VUo.js} +26 -10
- package/dist/transaction-2_2m7VUo.js.map +1 -0
- package/package.json +7 -7
- package/dist/InternalDialect-ClSaUNso.js.map +0 -1
- package/dist/PostgresAdapter-CXKdKBG-.js +0 -4
- package/dist/PostgresAdapter-DySFW6vy.js +0 -128
- package/dist/PostgresAdapter-DySFW6vy.js.map +0 -1
- package/dist/SqliteAdapter-CDdOjRmW.js +0 -151
- package/dist/SqliteAdapter-CDdOjRmW.js.map +0 -1
- package/dist/SqliteAdapter-mjtXuVTg.js +0 -4
- package/dist/chunk-DLY2FNSh.js +0 -12
- package/dist/connection/adapters/Adapter.d.ts +0 -60
- package/dist/connection/adapters/AdapterRegistry.d.ts +0 -44
- package/dist/connection/adapters/dialects/PostgresAdapter.d.ts +0 -30
- package/dist/connection/adapters/dialects/SqliteAdapter.d.ts +0 -22
- package/dist/connection/adapters/dialects/index.d.ts +0 -5
- package/dist/connection/adapters/index.d.ts +0 -8
- package/dist/connection/clients/DBClient.d.ts +0 -23
- package/dist/connection/clients/dialects/PostgresClient.d.ts +0 -54
- package/dist/connection/clients/dialects/SqliteClient.d.ts +0 -54
- package/dist/connection/clients/dialects/index.d.ts +0 -5
- package/dist/connection/clients/index.d.ts +0 -7
- package/dist/connection-Dmhgx31M.js.map +0 -1
- package/dist/defaultRuntime-DzqBQ9Hb.js.map +0 -1
- package/dist/manager/ManagerLike.d.ts +0 -34
- package/dist/manager/ModelManager.d.ts +0 -106
- package/dist/manager/internal/MutationCompiler.d.ts +0 -23
- package/dist/manager/internal/RuntimeBoundClient.d.ts +0 -20
- package/dist/manager/registerModelObjects.d.ts +0 -5
- package/dist/manager/relations/ManyToManyRelatedManager.d.ts +0 -181
- package/dist/manager/relations/ManyToManyRelatedQuerySet.d.ts +0 -62
- package/dist/manager/relations/MaterializedModelRecord.d.ts +0 -28
- package/dist/manager/relations/index.d.ts +0 -9
- package/dist/manager/relations/internal/ThroughTableManager.d.ts +0 -85
- package/dist/query/ModelQuerySet.d.ts +0 -20
- package/dist/query/QBuilder.d.ts +0 -29
- package/dist/query/QuerySet.d.ts +0 -215
- package/dist/query/compiler/QueryCompiler.d.ts +0 -49
- package/dist/query/compiler/index.d.ts +0 -4
- package/dist/query/domain/CompiledQuery.d.ts +0 -209
- package/dist/query/domain/Dialect.d.ts +0 -2
- package/dist/query/domain/Direction.d.ts +0 -2
- package/dist/query/domain/FilterInput.d.ts +0 -3
- package/dist/query/domain/FilterKey.d.ts +0 -4
- package/dist/query/domain/FilterValue.d.ts +0 -1
- package/dist/query/domain/LookupType.d.ts +0 -2
- package/dist/query/domain/OrderSpec.d.ts +0 -5
- package/dist/query/domain/OrderToken.d.ts +0 -1
- package/dist/query/domain/QNode.d.ts +0 -9
- package/dist/query/domain/QueryResult.d.ts +0 -35
- package/dist/query/domain/QuerySetState.d.ts +0 -13
- package/dist/query/domain/RelationMeta.d.ts +0 -56
- package/dist/query/domain/RelationTyping.d.ts +0 -163
- package/dist/query/domain/TableMeta.d.ts +0 -16
- package/dist/query/domain/TableMetaFactory.d.ts +0 -10
- package/dist/query/domain/WhereClause.d.ts +0 -4
- package/dist/query/domain/index.d.ts +0 -21
- package/dist/query/domain/internal/InternalDialect.d.ts +0 -4
- package/dist/query/domain/internal/InternalDirection.d.ts +0 -4
- package/dist/query/domain/internal/InternalLookupType.d.ts +0 -15
- package/dist/query/domain/internal/InternalPrefetchQueryKind.d.ts +0 -20
- package/dist/query/domain/internal/InternalQNodeType.d.ts +0 -6
- package/dist/query/domain/internal/InternalRelationKind.d.ts +0 -6
- package/dist/query/internal/isQNodeLike.d.ts +0 -3
- package/dist/query/planning/QueryPlanner.d.ts +0 -16
- package/dist/query/planning/domain/QueryHydrationPlan.d.ts +0 -20
- package/dist/query/planning/index.d.ts +0 -2
- package/dist/query-DUZnBFhf.js.map +0 -1
- package/dist/registerModelObjects-22ZJKoit.js.map +0 -1
- package/dist/runtime/TangoRuntime.d.ts +0 -56
- package/dist/runtime/defaultRuntime.d.ts +0 -13
- package/dist/runtime/internal/DBClientProvider.d.ts +0 -12
- package/dist/runtime/internal/PostgresDBClientProvider.d.ts +0 -12
- package/dist/runtime/internal/SqliteDBClientProvider.d.ts +0 -19
- package/dist/runtime/internal/createDBClientProvider.d.ts +0 -5
- package/dist/runtime-1H88J3nN.js +0 -18
- package/dist/runtime-1H88J3nN.js.map +0 -1
- package/dist/transaction/AtomicTransaction.d.ts +0 -32
- package/dist/transaction/UnitOfWork.d.ts +0 -52
- package/dist/transaction/atomic.d.ts +0 -2
- package/dist/transaction/internal/context/AsyncLocalTransactionEngine.d.ts +0 -21
- package/dist/transaction/internal/context/CallbackRecord.d.ts +0 -5
- package/dist/transaction/internal/context/FrameBoundTransaction.d.ts +0 -20
- package/dist/transaction/internal/context/FrameTransactionHandle.d.ts +0 -4
- package/dist/transaction/internal/context/TransactionEngine.d.ts +0 -16
- package/dist/transaction/internal/context/TransactionFrame.d.ts +0 -7
- package/dist/transaction/internal/context/TransactionState.d.ts +0 -10
- package/dist/transaction/internal/context/index.d.ts +0 -1
- package/dist/transaction-ZhfDf-f8.js.map +0 -1
- package/dist/validation/OrmSqlSafetyAdapter.d.ts +0 -22
- package/dist/validation/SQLValidationEngine.d.ts +0 -68
- package/dist/validation/SqlValidationPlan.d.ts +0 -43
- package/dist/validation/index.d.ts +0 -3
- package/dist/validation/internal/InternalSqlValidationPlanKind.d.ts +0 -25
- package/dist/validation/internal/InternalValidatedFilterDescriptorKind.d.ts +0 -4
package/dist/query/QuerySet.d.ts
DELETED
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import type { DBClient } from '../connection/clients/DBClient';
|
|
2
|
-
import type { Adapter } from '../connection/adapters/Adapter';
|
|
3
|
-
import type { QuerySetState } from './domain/QuerySetState';
|
|
4
|
-
import type { TableMeta } from './domain/TableMeta';
|
|
5
|
-
import type { QNode } from './domain/QNode';
|
|
6
|
-
import { QueryResult } from './domain/QueryResult';
|
|
7
|
-
import type { OrderToken } from './domain/OrderToken';
|
|
8
|
-
import type { OrderSpec } from './domain/OrderSpec';
|
|
9
|
-
import type { FilterInput } from './domain/FilterInput';
|
|
10
|
-
import type { CompiledQuery } from './domain/CompiledQuery';
|
|
11
|
-
import type { GeneratedHydratedRelationMap, GeneratedPrefetchRelatedPathKeys, GeneratedSelectRelatedPathKeys, HydratedQueryResult, ManyRelationHydrationCardinality, MaybeHydratedRelationMap, PrefetchRelatedRelations, RelationKeys, SelectRelatedRelations, SingleRelationHydrationCardinality } from './domain/RelationTyping';
|
|
12
|
-
/**
|
|
13
|
-
* Query execution seam consumed by `QuerySet`.
|
|
14
|
-
*
|
|
15
|
-
* Application code usually reaches this through `Model.objects` or testing
|
|
16
|
-
* fixtures rather than implementing it directly.
|
|
17
|
-
*
|
|
18
|
-
* @template TModel - The model row type returned by the database client
|
|
19
|
-
*/
|
|
20
|
-
export interface QueryExecutor<TModel> {
|
|
21
|
-
meta: TableMeta;
|
|
22
|
-
client: DBClient;
|
|
23
|
-
adapter: Adapter;
|
|
24
|
-
run(compiled: CompiledQuery): Promise<TModel[]>;
|
|
25
|
-
/**
|
|
26
|
-
* Optional hook invoked by `QuerySet` after a record has been
|
|
27
|
-
* materialized so executors can attach related-manager accessors
|
|
28
|
-
* (such as the many-to-many related manager) onto the record.
|
|
29
|
-
*
|
|
30
|
-
* The optional `modelKey` argument lets the executor route the attach
|
|
31
|
-
* call to the correct model when the record belongs to a related
|
|
32
|
-
* model rather than the executor's own source model. Implementations
|
|
33
|
-
* must not overwrite existing properties on the record so prior
|
|
34
|
-
* hydration assignments survive the attach pass.
|
|
35
|
-
*/
|
|
36
|
-
attachPersistedRecordAccessors?(record: Record<string, unknown>, modelKey?: string): void;
|
|
37
|
-
}
|
|
38
|
-
type QueryShapeFunction<TInput, TOutput> = (row: TInput) => TOutput;
|
|
39
|
-
type QueryShapeParser<TInput, TOutput> = {
|
|
40
|
-
parse: (row: TInput) => TOutput;
|
|
41
|
-
};
|
|
42
|
-
type QueryShape<TInput> = QueryShapeFunction<TInput, unknown> | QueryShapeParser<TInput, unknown>;
|
|
43
|
-
type QueryShapeOutput<TInput, TShape> = TShape extends QueryShapeFunction<TInput, infer TOutput> ? TOutput : TShape extends QueryShapeParser<TInput, infer TOutput> ? TOutput : never;
|
|
44
|
-
type ProjectedResult<TModel extends Record<string, unknown>, TKeys extends readonly (keyof TModel)[]> = number extends TKeys['length'] ? TModel : [TKeys[number]] extends [never] ? TModel : Pick<TModel, TKeys[number]>;
|
|
45
|
-
/**
|
|
46
|
-
* Django-inspired query builder for constructing and executing database queries.
|
|
47
|
-
* Provides a fluent API for filtering, ordering, pagination, projection, and
|
|
48
|
-
* nested relation hydration.
|
|
49
|
-
*
|
|
50
|
-
* @template TModel - The full model row type used for query composition
|
|
51
|
-
* @template TBaseResult - The selected base-row shape returned by execution methods
|
|
52
|
-
* @template TSourceModel - The source Tango model used for typed relation metadata
|
|
53
|
-
* @template THydrated - Relation properties accumulated by eager-loading calls
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```typescript
|
|
57
|
-
* const users = await TodoModel.objects
|
|
58
|
-
* .query()
|
|
59
|
-
* .filter({ active: true })
|
|
60
|
-
* .filter(Q.or({ role: 'admin' }, { role: 'moderator' }))
|
|
61
|
-
* .orderBy('-createdAt')
|
|
62
|
-
* .limit(10)
|
|
63
|
-
* .fetch();
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
export declare abstract class QuerySet<TModel extends Record<string, unknown>, TBaseResult extends Record<string, unknown> = TModel, TSourceModel = unknown, THydrated extends Record<string, unknown> = Record<never, never>> implements AsyncIterable<HydratedQueryResult<TBaseResult, THydrated>> {
|
|
67
|
-
[Symbol.asyncIterator]: () => AsyncIterator<HydratedQueryResult<TBaseResult, THydrated>>;
|
|
68
|
-
protected executor: QueryExecutor<TModel>;
|
|
69
|
-
protected state: QuerySetState<TModel, TSourceModel>;
|
|
70
|
-
static readonly BRAND: "tango.orm.query_set";
|
|
71
|
-
readonly __tangoBrand: typeof QuerySet.BRAND;
|
|
72
|
-
private evaluationCache?;
|
|
73
|
-
constructor(executor: QueryExecutor<TModel>, state?: QuerySetState<TModel, TSourceModel>);
|
|
74
|
-
/**
|
|
75
|
-
* Create another queryset of the same runtime family with the supplied
|
|
76
|
-
* query state. Concrete subclasses implement this so fluent calls keep
|
|
77
|
-
* their subclass-specific execution behavior instead of falling back to
|
|
78
|
-
* the standard queryset implementation.
|
|
79
|
-
*/
|
|
80
|
-
protected abstract spawn<TNextBaseResult extends Record<string, unknown> = TBaseResult, TNextHydrated extends Record<string, unknown> = THydrated>(state: QuerySetState<TModel, TSourceModel>): QuerySet<TModel, TNextBaseResult, TSourceModel, TNextHydrated>;
|
|
81
|
-
/**
|
|
82
|
-
* Narrow an unknown value to `QuerySet`.
|
|
83
|
-
*/
|
|
84
|
-
static isQuerySet<TModel extends Record<string, unknown>, TResult extends Record<string, unknown> = TModel>(value: unknown): value is QuerySet<TModel, TResult>;
|
|
85
|
-
/**
|
|
86
|
-
* Translate user-facing order tokens like `'name'` or `'-createdAt'` into
|
|
87
|
-
* the internal `OrderSpec` array used by `QuerySetState`.
|
|
88
|
-
*
|
|
89
|
-
* Exposed as `protected` so subclasses can compose the same parse logic
|
|
90
|
-
* when they need to return their own concrete type from `orderBy` without
|
|
91
|
-
* reaching into a base-class instance's protected state.
|
|
92
|
-
*/
|
|
93
|
-
protected static buildOrderSpecs<T extends Record<string, unknown>>(tokens: readonly OrderToken<T>[]): OrderSpec<T>[];
|
|
94
|
-
private static invertOrderSpec;
|
|
95
|
-
/**
|
|
96
|
-
* Add a filter expression to the query.
|
|
97
|
-
*
|
|
98
|
-
* Multiple `filter()` calls are composed with `AND`.
|
|
99
|
-
*/
|
|
100
|
-
filter(q: FilterInput<TModel, TSourceModel> | QNode<TModel, TSourceModel>): QuerySet<TModel, TBaseResult, TSourceModel, THydrated>;
|
|
101
|
-
/**
|
|
102
|
-
* Add an exclusion expression to the query.
|
|
103
|
-
*
|
|
104
|
-
* Exclusions are translated to `NOT (...)` predicates.
|
|
105
|
-
*/
|
|
106
|
-
exclude(q: FilterInput<TModel, TSourceModel> | QNode<TModel, TSourceModel>): QuerySet<TModel, TBaseResult, TSourceModel, THydrated>;
|
|
107
|
-
/**
|
|
108
|
-
* Apply ordering tokens such as `'name'` or `'-createdAt'`.
|
|
109
|
-
*/
|
|
110
|
-
orderBy(...tokens: OrderToken<TModel>[]): QuerySet<TModel, TBaseResult, TSourceModel, THydrated>;
|
|
111
|
-
/**
|
|
112
|
-
* Limit the maximum number of rows returned.
|
|
113
|
-
*/
|
|
114
|
-
limit(n: number): QuerySet<TModel, TBaseResult, TSourceModel, THydrated>;
|
|
115
|
-
/**
|
|
116
|
-
* Skip the first `n` rows.
|
|
117
|
-
*/
|
|
118
|
-
offset(n: number): QuerySet<TModel, TBaseResult, TSourceModel, THydrated>;
|
|
119
|
-
/**
|
|
120
|
-
* Restrict selected fields and narrow the fetched row type when the
|
|
121
|
-
* selected keys are known precisely at the call site.
|
|
122
|
-
*
|
|
123
|
-
* Empty selections reset back to the full model row, and repeated
|
|
124
|
-
* `select(...)` calls replace the previous projection rather than
|
|
125
|
-
* intersecting it.
|
|
126
|
-
*/
|
|
127
|
-
select<const TKeys extends readonly (keyof TModel)[]>(fields: TKeys): QuerySet<TModel, ProjectedResult<TModel, TKeys>, TSourceModel, THydrated>;
|
|
128
|
-
select(fields: readonly (keyof TModel)[]): QuerySet<TModel, ProjectedResult<TModel, readonly (keyof TModel)[]>, TSourceModel, THydrated>;
|
|
129
|
-
/**
|
|
130
|
-
* Hydrate single-valued relation paths through SQL joins.
|
|
131
|
-
*
|
|
132
|
-
* Forward `belongsTo` relations can be inferred from the source model's
|
|
133
|
-
* field-authored relation metadata. Reverse `hasOne` relations can be
|
|
134
|
-
* selected with a target model generic when the target model points back to
|
|
135
|
-
* the source model. Generated relation typing also enables nested `__`
|
|
136
|
-
* path keys for applications that keep the app-local registry current.
|
|
137
|
-
*/
|
|
138
|
-
selectRelated<TTargetModel = undefined, const TRelationName extends RelationKeys<SelectRelatedRelations<TSourceModel, NoInfer<TTargetModel>>> | GeneratedSelectRelatedPathKeys<TSourceModel> = RelationKeys<SelectRelatedRelations<TSourceModel, NoInfer<TTargetModel>>> | GeneratedSelectRelatedPathKeys<TSourceModel>>(...rels: readonly TRelationName[]): QuerySet<TModel, TBaseResult, TSourceModel, THydrated & MaybeHydratedRelationMap<TSourceModel, SelectRelatedRelations<TSourceModel, NoInfer<TTargetModel>>, Extract<TRelationName, RelationKeys<SelectRelatedRelations<TSourceModel, NoInfer<TTargetModel>>>>, SingleRelationHydrationCardinality> & GeneratedHydratedRelationMap<TSourceModel, Extract<TRelationName, GeneratedSelectRelatedPathKeys<TSourceModel>>>>;
|
|
139
|
-
/**
|
|
140
|
-
* Hydrate collection-rooted relation paths with follow-up queries.
|
|
141
|
-
*
|
|
142
|
-
* Reverse `hasMany` relations can be prefetched with a target model generic
|
|
143
|
-
* when the target model points back to the source model. Generated relation
|
|
144
|
-
* typing also enables nested `__` path keys for applications that keep the
|
|
145
|
-
* app-local registry current.
|
|
146
|
-
*/
|
|
147
|
-
prefetchRelated<TTargetModel = undefined, const TRelationName extends RelationKeys<PrefetchRelatedRelations<TSourceModel, NoInfer<TTargetModel>>> | GeneratedPrefetchRelatedPathKeys<TSourceModel> = RelationKeys<PrefetchRelatedRelations<TSourceModel, NoInfer<TTargetModel>>> | GeneratedPrefetchRelatedPathKeys<TSourceModel>>(...rels: readonly TRelationName[]): QuerySet<TModel, TBaseResult, TSourceModel, THydrated & MaybeHydratedRelationMap<TSourceModel, PrefetchRelatedRelations<TSourceModel, NoInfer<TTargetModel>>, Extract<TRelationName, RelationKeys<PrefetchRelatedRelations<TSourceModel, NoInfer<TTargetModel>>>>, ManyRelationHydrationCardinality> & GeneratedHydratedRelationMap<TSourceModel, Extract<TRelationName, GeneratedPrefetchRelatedPathKeys<TSourceModel>>>>;
|
|
148
|
-
all(): QuerySet<TModel, TBaseResult, TSourceModel, THydrated>;
|
|
149
|
-
/**
|
|
150
|
-
* Execute the query and optionally shape each row.
|
|
151
|
-
*
|
|
152
|
-
* When the queryset has been narrowed by `select(...)`, rows passed to the
|
|
153
|
-
* shaping callback or parser use that narrowed fetched-row type.
|
|
154
|
-
*/
|
|
155
|
-
fetch(): Promise<QueryResult<HydratedQueryResult<TBaseResult, THydrated>>>;
|
|
156
|
-
fetch<Out>(shape: QueryShapeFunction<HydratedQueryResult<TBaseResult, THydrated>, Out>): Promise<QueryResult<Out>>;
|
|
157
|
-
fetch<Out>(shape: QueryShapeParser<HydratedQueryResult<TBaseResult, THydrated>, Out>): Promise<QueryResult<Out>>;
|
|
158
|
-
fetch<TShape extends QueryShape<HydratedQueryResult<TBaseResult, THydrated>> | undefined>(shape: TShape): Promise<QueryResult<HydratedQueryResult<TBaseResult, THydrated> | QueryShapeOutput<HydratedQueryResult<TBaseResult, THydrated>, NonNullable<TShape>>>>;
|
|
159
|
-
/**
|
|
160
|
-
* Async iterable surface for `for await (... of queryset)`.
|
|
161
|
-
*
|
|
162
|
-
* Evaluates this queryset on first use by awaiting `fetch()` without
|
|
163
|
-
* arguments, then yields each element from that materialized result.
|
|
164
|
-
* Later async iterations over the same queryset instance reuse the cached
|
|
165
|
-
* materialized result instead of issuing another database round-trip.
|
|
166
|
-
*/
|
|
167
|
-
[Symbol.asyncIterator](): AsyncIterator<HydratedQueryResult<TBaseResult, THydrated>>;
|
|
168
|
-
/**
|
|
169
|
-
* Execute the query and return the first row, or `null`.
|
|
170
|
-
*
|
|
171
|
-
* As with `fetch(...)`, parser and function overloads receive the current
|
|
172
|
-
* fetched-row type after any `select(...)` projection narrowing.
|
|
173
|
-
*/
|
|
174
|
-
fetchOne(): Promise<HydratedQueryResult<TBaseResult, THydrated> | null>;
|
|
175
|
-
fetchOne<Out>(shape: QueryShapeFunction<HydratedQueryResult<TBaseResult, THydrated>, Out>): Promise<Out | null>;
|
|
176
|
-
fetchOne<Out>(shape: QueryShapeParser<HydratedQueryResult<TBaseResult, THydrated>, Out>): Promise<Out | null>;
|
|
177
|
-
fetchOne<TShape extends QueryShape<HydratedQueryResult<TBaseResult, THydrated>> | undefined>(shape: TShape): Promise<HydratedQueryResult<TBaseResult, THydrated> | QueryShapeOutput<HydratedQueryResult<TBaseResult, THydrated>, NonNullable<TShape>> | null>;
|
|
178
|
-
first(): Promise<HydratedQueryResult<TBaseResult, THydrated> | null>;
|
|
179
|
-
first<Out>(shape: QueryShapeFunction<HydratedQueryResult<TBaseResult, THydrated>, Out>): Promise<Out | null>;
|
|
180
|
-
first<Out>(shape: QueryShapeParser<HydratedQueryResult<TBaseResult, THydrated>, Out>): Promise<Out | null>;
|
|
181
|
-
last(): Promise<HydratedQueryResult<TBaseResult, THydrated> | null>;
|
|
182
|
-
last<Out>(shape: QueryShapeFunction<HydratedQueryResult<TBaseResult, THydrated>, Out>): Promise<Out | null>;
|
|
183
|
-
last<Out>(shape: QueryShapeParser<HydratedQueryResult<TBaseResult, THydrated>, Out>): Promise<Out | null>;
|
|
184
|
-
get(q: FilterInput<TModel, TSourceModel> | QNode<TModel, TSourceModel>): Promise<HydratedQueryResult<TBaseResult, THydrated>>;
|
|
185
|
-
get<Out>(q: FilterInput<TModel, TSourceModel> | QNode<TModel, TSourceModel>, shape: QueryShapeFunction<HydratedQueryResult<TBaseResult, THydrated>, Out>): Promise<Out>;
|
|
186
|
-
get<Out>(q: FilterInput<TModel, TSourceModel> | QNode<TModel, TSourceModel>, shape: QueryShapeParser<HydratedQueryResult<TBaseResult, THydrated>, Out>): Promise<Out>;
|
|
187
|
-
/**
|
|
188
|
-
* Execute a `COUNT(*)` query for the current filtered state.
|
|
189
|
-
*/
|
|
190
|
-
count(): Promise<number>;
|
|
191
|
-
/**
|
|
192
|
-
* Return whether at least one row matches the current query state.
|
|
193
|
-
*/
|
|
194
|
-
exists(): Promise<boolean>;
|
|
195
|
-
private shapeFetchedRow;
|
|
196
|
-
private getOrCreateEvaluationCache;
|
|
197
|
-
private evaluateRows;
|
|
198
|
-
private normalizeRowsForSchemaParsing;
|
|
199
|
-
private normalizeHydratedRowsForParserShape;
|
|
200
|
-
private hydrateRows;
|
|
201
|
-
private primeManyToManyOwnerCache;
|
|
202
|
-
private attachRootRecordAccessors;
|
|
203
|
-
private hydrateJoinNodesForOwner;
|
|
204
|
-
private hydratePrefetchNode;
|
|
205
|
-
private chunkValues;
|
|
206
|
-
private groupOwnersByAccessor;
|
|
207
|
-
private canonicalizeEntity;
|
|
208
|
-
private normalizeTargetRow;
|
|
209
|
-
private normalizeColumnValue;
|
|
210
|
-
private isBooleanColumnType;
|
|
211
|
-
private normalizeSqliteBoolean;
|
|
212
|
-
private normalizeBooleanColumns;
|
|
213
|
-
private withoutHydrationState;
|
|
214
|
-
}
|
|
215
|
-
export {};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { QuerySetState } from '../domain/QuerySetState';
|
|
2
|
-
import type { TableMeta } from '../domain/TableMeta';
|
|
3
|
-
import type { CompiledHydrationNode, CompiledPrefetchQuery, CompiledQuery } from '../domain/CompiledQuery';
|
|
4
|
-
import type { Adapter } from '../../connection/adapters/Adapter';
|
|
5
|
-
/**
|
|
6
|
-
* Compiles immutable `QuerySet` state into parameterized SQL and recursive
|
|
7
|
-
* hydration execution artifacts.
|
|
8
|
-
*/
|
|
9
|
-
export declare class QueryCompiler {
|
|
10
|
-
private meta;
|
|
11
|
-
private adapter;
|
|
12
|
-
static readonly BRAND: "tango.orm.query_compiler";
|
|
13
|
-
readonly __tangoBrand: typeof QueryCompiler.BRAND;
|
|
14
|
-
private readonly placeholders;
|
|
15
|
-
constructor(meta: TableMeta, adapter: Adapter);
|
|
16
|
-
static isQueryCompiler(value: unknown): value is QueryCompiler;
|
|
17
|
-
compile<T, TSourceModel = unknown>(state: QuerySetState<T, TSourceModel>): CompiledQuery;
|
|
18
|
-
compilePrefetch(node: CompiledHydrationNode, sourceValues: readonly (string | number)[]): CompiledPrefetchQuery;
|
|
19
|
-
compileManyToManyTargets(node: CompiledHydrationNode, targetIds: readonly (string | number)[]): {
|
|
20
|
-
sql: string;
|
|
21
|
-
params: readonly unknown[];
|
|
22
|
-
};
|
|
23
|
-
private compileManyToManyPrefetch;
|
|
24
|
-
private compileHydrationNode;
|
|
25
|
-
private validateHydrationRelation;
|
|
26
|
-
private buildRootHiddenSelects;
|
|
27
|
-
private validatePrefetchTarget;
|
|
28
|
-
private collectNestedJoinSql;
|
|
29
|
-
private validatePrefetchJoinTarget;
|
|
30
|
-
private validateInternalAlias;
|
|
31
|
-
private buildJoinAlias;
|
|
32
|
-
private buildPrefetchBaseAlias;
|
|
33
|
-
private buildHydrationColumnAlias;
|
|
34
|
-
private buildPrefetchSourceAlias;
|
|
35
|
-
private buildFilterAlias;
|
|
36
|
-
private sanitizeRelationPath;
|
|
37
|
-
private assertInternalAliasDoesNotCollide;
|
|
38
|
-
private compileQNode;
|
|
39
|
-
private compileAtom;
|
|
40
|
-
private compileAnd;
|
|
41
|
-
private compileOr;
|
|
42
|
-
private compileNot;
|
|
43
|
-
private compileRelationFilter;
|
|
44
|
-
private buildRelationFilterExists;
|
|
45
|
-
private lookupToSQL;
|
|
46
|
-
private normalizeParam;
|
|
47
|
-
private collectStateFilterKeys;
|
|
48
|
-
private collectNodeFilterKeys;
|
|
49
|
-
}
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import type { RelationHydrationLoadMode } from './RelationMeta';
|
|
2
|
-
import type { RelationHydrationCardinality } from './RelationTyping';
|
|
3
|
-
import { InternalPrefetchQueryKind } from './internal/InternalPrefetchQueryKind';
|
|
4
|
-
/**
|
|
5
|
-
* Result of compiling a {@link QuerySet} into an executable SQL statement plus
|
|
6
|
-
* the hydration plan the executor needs to reshape flat rows into nested
|
|
7
|
-
* relation graphs.
|
|
8
|
-
*/
|
|
9
|
-
export interface CompiledQuery {
|
|
10
|
-
/**
|
|
11
|
-
* Parameterized SQL string ready for `client.query(...)`. Identifiers and
|
|
12
|
-
* relation names are pre-validated; values never appear inline.
|
|
13
|
-
*/
|
|
14
|
-
sql: string;
|
|
15
|
-
/**
|
|
16
|
-
* Parameter values bound to the SQL statement in the same order the
|
|
17
|
-
* placeholders appear.
|
|
18
|
-
*/
|
|
19
|
-
params: readonly unknown[];
|
|
20
|
-
/**
|
|
21
|
-
* Optional hydration plan produced when the query declared selected or
|
|
22
|
-
* prefetched relations. Absent for plain row reads that do no
|
|
23
|
-
* relation-shaping work.
|
|
24
|
-
*/
|
|
25
|
-
hydrationPlan?: CompiledHydrationPlanRoot;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Top-level hydration plan for a compiled query. Groups the join-time
|
|
29
|
-
* hydration nodes (emitted inline with the root query) with the prefetch
|
|
30
|
-
* hydration nodes (executed as follow-up queries after the root rows land).
|
|
31
|
-
*/
|
|
32
|
-
export interface CompiledHydrationPlanRoot {
|
|
33
|
-
/**
|
|
34
|
-
* The relation paths the caller originally requested via
|
|
35
|
-
* `selectRelated(...)` / `prefetchRelated(...)`. Retained for diagnostic
|
|
36
|
-
* messages and snapshot stability.
|
|
37
|
-
*/
|
|
38
|
-
requestedPaths: readonly string[];
|
|
39
|
-
/**
|
|
40
|
-
* Column aliases on the root query that exist solely to support hydration
|
|
41
|
-
* (for example, join-mirrored primary keys). The hydrator strips these
|
|
42
|
-
* before handing rows back to application code.
|
|
43
|
-
*/
|
|
44
|
-
hiddenRootAliases: readonly string[];
|
|
45
|
-
/**
|
|
46
|
-
* Hydration nodes whose rows arrive joined into the root query's result
|
|
47
|
-
* set. Each node describes how to fold those joined columns back into a
|
|
48
|
-
* nested relation attribute.
|
|
49
|
-
*/
|
|
50
|
-
joinNodes: readonly CompiledHydrationNode[];
|
|
51
|
-
/**
|
|
52
|
-
* Hydration nodes that require a follow-up prefetch query after the root
|
|
53
|
-
* rows land. Each node drives one or more `compilePrefetch(...)` calls.
|
|
54
|
-
*/
|
|
55
|
-
prefetchNodes: readonly CompiledHydrationNode[];
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Recursive description of how to hydrate one relation edge and its
|
|
59
|
-
* descendants. The same node shape is used for join-loaded and
|
|
60
|
-
* prefetch-loaded relations; {@link loadMode} distinguishes them.
|
|
61
|
-
*/
|
|
62
|
-
export interface CompiledHydrationNode {
|
|
63
|
-
/** Stable identifier for this node in the plan. */
|
|
64
|
-
nodeId: string;
|
|
65
|
-
/**
|
|
66
|
-
* Public relation name as declared in the schema, mirrored onto the
|
|
67
|
-
* hydrated record (for example, `author` or `tags`).
|
|
68
|
-
*/
|
|
69
|
-
relationName: string;
|
|
70
|
-
/**
|
|
71
|
-
* Dot-less path expression that reaches this node from the root, used in
|
|
72
|
-
* error messages and plan diagnostics.
|
|
73
|
-
*/
|
|
74
|
-
relationPath: string;
|
|
75
|
-
/** Model key of the owner side of this edge. */
|
|
76
|
-
ownerModelKey: string;
|
|
77
|
-
/** Model key of the target side of this edge. */
|
|
78
|
-
targetModelKey: string;
|
|
79
|
-
/** Join-inline vs follow-up prefetch load strategy. */
|
|
80
|
-
loadMode: RelationHydrationLoadMode;
|
|
81
|
-
/** Whether this edge yields one target or many. */
|
|
82
|
-
cardinality: RelationHydrationCardinality;
|
|
83
|
-
/**
|
|
84
|
-
* Owner-side column whose value scopes the hydration read. For
|
|
85
|
-
* foreign-key relations this is the local column; for many-to-many this
|
|
86
|
-
* is the owner primary key.
|
|
87
|
-
*/
|
|
88
|
-
sourceKey: string;
|
|
89
|
-
/**
|
|
90
|
-
* Column alias on the root SQL row that surfaces `sourceKey` to the
|
|
91
|
-
* hydrator after projection.
|
|
92
|
-
*/
|
|
93
|
-
ownerSourceAccessor: string;
|
|
94
|
-
/**
|
|
95
|
-
* Target-side column that matches `sourceKey` during resolution.
|
|
96
|
-
*/
|
|
97
|
-
targetKey: string;
|
|
98
|
-
/** Target table name for the related rows. */
|
|
99
|
-
targetTable: string;
|
|
100
|
-
/** Primary-key column name on the target table. */
|
|
101
|
-
targetPrimaryKey: string;
|
|
102
|
-
/** Join table name for many-to-many edges. */
|
|
103
|
-
throughTable?: string;
|
|
104
|
-
/**
|
|
105
|
-
* Join-table column storing the owner-side primary key for many-to-many
|
|
106
|
-
* edges.
|
|
107
|
-
*/
|
|
108
|
-
throughSourceKey?: string;
|
|
109
|
-
/**
|
|
110
|
-
* Join-table column storing the target-side primary key for many-to-many
|
|
111
|
-
* edges.
|
|
112
|
-
*/
|
|
113
|
-
throughTargetKey?: string;
|
|
114
|
-
/**
|
|
115
|
-
* SQL type of the owner-side join column, used to validate compiled
|
|
116
|
-
* placeholder values.
|
|
117
|
-
*/
|
|
118
|
-
throughSourceColumnType?: string;
|
|
119
|
-
/**
|
|
120
|
-
* SQL type of the target-side join column, used to validate compiled
|
|
121
|
-
* placeholder values.
|
|
122
|
-
*/
|
|
123
|
-
throughTargetColumnType?: string;
|
|
124
|
-
/**
|
|
125
|
-
* Column map for the target table keyed by column name. Used by the
|
|
126
|
-
* hydrator to materialize target rows and by the compiler to emit a
|
|
127
|
-
* stable projection.
|
|
128
|
-
*/
|
|
129
|
-
targetColumns: Record<string, string>;
|
|
130
|
-
/**
|
|
131
|
-
* Ordered trail of relation names that led to this node. Used to produce
|
|
132
|
-
* precise error messages when a hydration plan fails to compile.
|
|
133
|
-
*/
|
|
134
|
-
provenance: readonly string[];
|
|
135
|
-
/** Child nodes whose rows arrive joined with this node's rows. */
|
|
136
|
-
joinChildren: readonly CompiledHydrationNode[];
|
|
137
|
-
/** Child nodes that require their own follow-up prefetch. */
|
|
138
|
-
prefetchChildren: readonly CompiledHydrationNode[];
|
|
139
|
-
/** SQL join descriptor attached when this node is loaded inline. */
|
|
140
|
-
join?: CompiledJoinHydrationDescriptor;
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Join-specific details for a hydration node loaded inline with its parent
|
|
144
|
-
* query. Captures the alias the compiler emitted for the joined table and
|
|
145
|
-
* the column aliases under which each projected column appears in the result
|
|
146
|
-
* row.
|
|
147
|
-
*/
|
|
148
|
-
export interface CompiledJoinHydrationDescriptor {
|
|
149
|
-
/** SQL alias emitted for the joined table. */
|
|
150
|
-
alias: string;
|
|
151
|
-
/**
|
|
152
|
-
* Aliases for each projected target column, keyed by column name.
|
|
153
|
-
* Ensures the hydrator can pull the column out of the flat SQL row.
|
|
154
|
-
*/
|
|
155
|
-
columns: Record<string, string>;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Discriminated union describing a prefetch query that must run after the
|
|
159
|
-
* root rows load. `direct` is a one-shot select against the target table;
|
|
160
|
-
* `manyToMany` is a two-phase plan that first reads join rows, then loads
|
|
161
|
-
* the target rows by primary key.
|
|
162
|
-
*/
|
|
163
|
-
export type CompiledPrefetchQuery = {
|
|
164
|
-
/** Marks a single-query prefetch against the target table. */
|
|
165
|
-
kind: typeof InternalPrefetchQueryKind.DIRECT;
|
|
166
|
-
/** Parameterized select statement to execute. */
|
|
167
|
-
sql: string;
|
|
168
|
-
/** Parameter values bound to the statement. */
|
|
169
|
-
params: readonly unknown[];
|
|
170
|
-
/**
|
|
171
|
-
* Target column whose value matches the owner-side `sourceKey`. The
|
|
172
|
-
* hydrator buckets the returned rows by this column.
|
|
173
|
-
*/
|
|
174
|
-
targetKey: string;
|
|
175
|
-
/** Column map for the target rows the hydrator will materialize. */
|
|
176
|
-
targetColumns: Record<string, string>;
|
|
177
|
-
} | {
|
|
178
|
-
/**
|
|
179
|
-
* Marks a two-phase many-to-many prefetch: the join-row query runs
|
|
180
|
-
* first, then a follow-up target query resolves the actual rows by
|
|
181
|
-
* primary key.
|
|
182
|
-
*/
|
|
183
|
-
kind: typeof InternalPrefetchQueryKind.MANY_TO_MANY;
|
|
184
|
-
/**
|
|
185
|
-
* SQL for the first phase: select owner/target id pairs from the
|
|
186
|
-
* join table.
|
|
187
|
-
*/
|
|
188
|
-
throughSql: string;
|
|
189
|
-
/** Parameter values bound to the join-row statement. */
|
|
190
|
-
throughParams: readonly unknown[];
|
|
191
|
-
/**
|
|
192
|
-
* Alias the compiler assigned to the owner-side join column in the
|
|
193
|
-
* join-row result set. The hydrator uses it to group targets by
|
|
194
|
-
* owner.
|
|
195
|
-
*/
|
|
196
|
-
ownerAlias: string;
|
|
197
|
-
/**
|
|
198
|
-
* Alias the compiler assigned to the target-side join column in
|
|
199
|
-
* the join-row result set. The hydrator uses it to assemble the
|
|
200
|
-
* target primary-key list for phase two.
|
|
201
|
-
*/
|
|
202
|
-
targetAlias: string;
|
|
203
|
-
/** Target table name for the phase-two read. */
|
|
204
|
-
targetTable: string;
|
|
205
|
-
/** Primary-key column on the target table for the phase-two read. */
|
|
206
|
-
targetPrimaryKey: string;
|
|
207
|
-
/** Column map for the target rows the hydrator will materialize. */
|
|
208
|
-
targetColumns: Record<string, string>;
|
|
209
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type FilterValue = string | number | boolean | Date | null | undefined | Array<string | number>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type OrderToken<T> = keyof T | `-${string & keyof T}`;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { FilterInput } from './FilterInput';
|
|
2
|
-
import type { InternalQNodeType } from './internal/InternalQNodeType';
|
|
3
|
-
export type QNodeType = (typeof InternalQNodeType)[keyof typeof InternalQNodeType];
|
|
4
|
-
export interface QNode<T, TSourceModel = unknown> {
|
|
5
|
-
kind: QNodeType;
|
|
6
|
-
where?: FilterInput<T, TSourceModel>;
|
|
7
|
-
nodes?: QNode<T, TSourceModel>[];
|
|
8
|
-
node?: QNode<T, TSourceModel>;
|
|
9
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Values materialized by {@link QuerySet.fetch}, iterable like an array plus `length`, `map`, `at`, and `toArray`.
|
|
3
|
-
*
|
|
4
|
-
* Prefer iteration or `items` over the deprecated `results` getter, which warns once per process when accessed.
|
|
5
|
-
*/
|
|
6
|
-
export declare class QueryResult<T> implements Iterable<T> {
|
|
7
|
-
/**
|
|
8
|
-
* Sync iteration over materialized rows.
|
|
9
|
-
*/
|
|
10
|
-
[Symbol.iterator]: () => Iterator<T>;
|
|
11
|
-
static readonly BRAND: "tango.orm.query_result";
|
|
12
|
-
readonly __tangoBrand: typeof QueryResult.BRAND;
|
|
13
|
-
readonly items: readonly T[];
|
|
14
|
-
constructor(items: readonly T[]);
|
|
15
|
-
/**
|
|
16
|
-
* Runtime narrowing for values that may be a plain array or a `QueryResult` instance.
|
|
17
|
-
*/
|
|
18
|
-
static isQueryResult<T>(value: unknown): value is QueryResult<T>;
|
|
19
|
-
/**
|
|
20
|
-
* Sync iteration over materialized rows.
|
|
21
|
-
*/
|
|
22
|
-
[Symbol.iterator](): Iterator<T>;
|
|
23
|
-
/** Number of materialized rows. */
|
|
24
|
-
get length(): number;
|
|
25
|
-
/** Same as `Array#map` on the materialized rows. */
|
|
26
|
-
map<U>(callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: unknown): U[];
|
|
27
|
-
/** Indexed read with support for negative indices, like `Array#at`. */
|
|
28
|
-
at(index: number): T | undefined;
|
|
29
|
-
/** Returns a shallow copy of the materialized rows as a plain array. */
|
|
30
|
-
toArray(): T[];
|
|
31
|
-
/**
|
|
32
|
-
* @deprecated Use iteration, `length`, `map`, or `toArray()` instead.
|
|
33
|
-
*/
|
|
34
|
-
get results(): readonly T[];
|
|
35
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { OrderSpec } from './OrderSpec';
|
|
2
|
-
import type { QNode } from './QNode';
|
|
3
|
-
export interface QuerySetState<T, TSourceModel = unknown> {
|
|
4
|
-
q?: QNode<T, TSourceModel>;
|
|
5
|
-
excludes?: QNode<T, TSourceModel>[];
|
|
6
|
-
order?: OrderSpec<T>[];
|
|
7
|
-
limit?: number;
|
|
8
|
-
offset?: number;
|
|
9
|
-
cursor?: string | null;
|
|
10
|
-
selectRelated?: string[];
|
|
11
|
-
prefetchRelated?: string[];
|
|
12
|
-
select?: (keyof T)[];
|
|
13
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { InternalRelationKind } from './internal/InternalRelationKind';
|
|
2
|
-
import type { RelationHydrationCardinality } from './RelationTyping';
|
|
3
|
-
import type { TableMeta } from './TableMeta';
|
|
4
|
-
export type RelationKind = (typeof InternalRelationKind)[keyof typeof InternalRelationKind];
|
|
5
|
-
export declare const InternalRelationHydrationLoadMode: {
|
|
6
|
-
readonly JOIN: "join";
|
|
7
|
-
readonly PREFETCH: "prefetch";
|
|
8
|
-
};
|
|
9
|
-
export type RelationHydrationLoadMode = (typeof InternalRelationHydrationLoadMode)[keyof typeof InternalRelationHydrationLoadMode];
|
|
10
|
-
export interface RelationHydrationCapabilities {
|
|
11
|
-
queryable: boolean;
|
|
12
|
-
hydratable: boolean;
|
|
13
|
-
joinable: boolean;
|
|
14
|
-
prefetchable: boolean;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Runtime relation metadata consumed by validation, planning, compilation, and
|
|
18
|
-
* hydration.
|
|
19
|
-
*/
|
|
20
|
-
export interface RelationMeta {
|
|
21
|
-
/** Stable edge identity from the resolved relation graph. */
|
|
22
|
-
edgeId: string;
|
|
23
|
-
/** Model key that owns the public relation name. */
|
|
24
|
-
sourceModelKey: string;
|
|
25
|
-
/** Model key reached by traversing this relation. */
|
|
26
|
-
targetModelKey: string;
|
|
27
|
-
/** Public relation kind such as belongsTo or hasMany. */
|
|
28
|
-
kind: RelationKind;
|
|
29
|
-
/** Hydration cardinality used by eager-loading APIs. */
|
|
30
|
-
cardinality: RelationHydrationCardinality;
|
|
31
|
-
/** Capability flags distilled from the resolved relation graph. */
|
|
32
|
-
capabilities: RelationHydrationCapabilities;
|
|
33
|
-
/** Physical table storing the target model rows. */
|
|
34
|
-
table: string;
|
|
35
|
-
/** Owner-side column used to attach or query related rows. */
|
|
36
|
-
sourceKey: string;
|
|
37
|
-
/** Target-side column matched against the source key. */
|
|
38
|
-
targetKey: string;
|
|
39
|
-
/** Many-to-many through table name when applicable. */
|
|
40
|
-
throughTable?: string;
|
|
41
|
-
throughModelKey?: string;
|
|
42
|
-
/** Many-to-many through column that matches the owner source key. */
|
|
43
|
-
throughSourceKey?: string;
|
|
44
|
-
/** Many-to-many through column that matches the target primary key. */
|
|
45
|
-
throughTargetKey?: string;
|
|
46
|
-
throughSourceColumnType?: string;
|
|
47
|
-
throughTargetColumnType?: string;
|
|
48
|
-
/** Primary key column for the target model. */
|
|
49
|
-
targetPrimaryKey: string;
|
|
50
|
-
/** Target model columns and their storage types. */
|
|
51
|
-
targetColumns: Record<string, string>;
|
|
52
|
-
/** Deterministic alias base used by join compilation. */
|
|
53
|
-
alias: string;
|
|
54
|
-
/** Recursive target metadata used for nested planning. */
|
|
55
|
-
targetMeta?: TableMeta;
|
|
56
|
-
}
|