@danceroutine/tango-orm 1.6.0 → 1.8.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/dist/InternalDialect-ClSaUNso.js +10 -0
- package/dist/InternalDialect-ClSaUNso.js.map +1 -0
- package/dist/PostgresAdapter-CXKdKBG-.js +4 -0
- package/dist/PostgresAdapter-DySFW6vy.js +128 -0
- package/dist/PostgresAdapter-DySFW6vy.js.map +1 -0
- package/dist/{SqliteClient-CjOK9-ki.js → SqliteAdapter-CDdOjRmW.js} +57 -3
- package/dist/SqliteAdapter-CDdOjRmW.js.map +1 -0
- package/dist/SqliteAdapter-mjtXuVTg.js +4 -0
- package/dist/connection/adapters/Adapter.d.ts +32 -1
- package/dist/connection/adapters/dialects/PostgresAdapter.d.ts +5 -6
- package/dist/connection/adapters/dialects/SqliteAdapter.d.ts +4 -6
- package/dist/connection/adapters/index.d.ts +1 -1
- package/dist/connection/index.d.ts +1 -1
- package/dist/connection/index.js +4 -5
- package/dist/{connection-B_K2ZAf7.js → connection-Dmhgx31M.js} +5 -7
- package/dist/{connection-B_K2ZAf7.js.map → connection-Dmhgx31M.js.map} +1 -1
- package/dist/{defaultRuntime-BPK9kWEW.js → defaultRuntime-DzqBQ9Hb.js} +63 -16
- package/dist/defaultRuntime-DzqBQ9Hb.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +11 -12
- package/dist/manager/ManagerLike.d.ts +19 -0
- package/dist/manager/ModelManager.d.ts +45 -2
- package/dist/manager/index.d.ts +6 -0
- package/dist/manager/index.js +8 -7
- package/dist/manager/internal/MutationCompiler.d.ts +14 -6
- package/dist/manager/relations/ManyToManyRelatedManager.d.ts +147 -0
- package/dist/manager/relations/ManyToManyRelatedQuerySet.d.ts +62 -0
- package/dist/manager/relations/MaterializedModelRecord.d.ts +28 -0
- package/dist/manager/relations/index.d.ts +9 -0
- package/dist/manager/relations/internal/ThroughTableManager.d.ts +79 -0
- package/dist/manager-DrDTiCAz.js +24 -0
- package/dist/manager-DrDTiCAz.js.map +1 -0
- package/dist/query/ModelQuerySet.d.ts +20 -0
- package/dist/query/QBuilder.d.ts +3 -3
- package/dist/query/QuerySet.d.ts +58 -18
- package/dist/query/compiler/QueryCompiler.d.ts +13 -4
- package/dist/query/domain/CompiledQuery.d.ts +169 -2
- package/dist/query/domain/FilterInput.d.ts +1 -1
- package/dist/query/domain/FilterKey.d.ts +4 -2
- package/dist/query/domain/QNode.d.ts +4 -4
- package/dist/query/domain/QuerySetState.d.ts +3 -3
- package/dist/query/domain/RelationMeta.d.ts +9 -0
- package/dist/query/domain/RelationTyping.d.ts +47 -0
- package/dist/query/domain/TableMetaFactory.d.ts +1 -14
- package/dist/query/domain/index.d.ts +1 -1
- package/dist/query/domain/internal/InternalPrefetchQueryKind.d.ts +20 -0
- package/dist/query/index.d.ts +1 -0
- package/dist/query/index.js +3 -2
- package/dist/query/internal/isQNodeLike.d.ts +3 -0
- package/dist/query/planning/QueryPlanner.d.ts +1 -1
- package/dist/{query-C6So1r6H.js → query-DUZnBFhf.js} +474 -156
- package/dist/query-DUZnBFhf.js.map +1 -0
- package/dist/registerModelObjects-DxlBfuUN.js +797 -0
- package/dist/registerModelObjects-DxlBfuUN.js.map +1 -0
- package/dist/runtime/TangoRuntime.d.ts +9 -0
- package/dist/runtime/index.d.ts +3 -2
- package/dist/runtime/index.js +7 -6
- package/dist/runtime/internal/SqliteDBClientProvider.d.ts +3 -0
- package/dist/{runtime-ByXbpVBS.js → runtime-1H88J3nN.js} +3 -3
- package/dist/runtime-1H88J3nN.js.map +1 -0
- package/dist/transaction/index.js +5 -4
- package/dist/{transaction-Cs0Z9tbW.js → transaction-ZhfDf-f8.js} +2 -2
- package/dist/{transaction-Cs0Z9tbW.js.map → transaction-ZhfDf-f8.js.map} +1 -1
- package/dist/validation/SQLValidationEngine.d.ts +22 -5
- package/dist/validation/SqlValidationPlan.d.ts +5 -4
- package/dist/validation/internal/InternalSqlValidationPlanKind.d.ts +25 -0
- package/dist/validation/internal/InternalValidatedFilterDescriptorKind.d.ts +4 -0
- package/package.json +6 -6
- package/dist/PostgresAdapter-BFdo_nIt.js +0 -4
- package/dist/PostgresAdapter-CMiEpHya.js +0 -49
- package/dist/PostgresAdapter-CMiEpHya.js.map +0 -1
- package/dist/PostgresClient-BQJZfEOT.js +0 -68
- package/dist/PostgresClient-BQJZfEOT.js.map +0 -1
- package/dist/SqliteAdapter-A-P9zUhP.js +0 -4
- package/dist/SqliteAdapter-CeqhyrPC.js +0 -44
- package/dist/SqliteAdapter-CeqhyrPC.js.map +0 -1
- package/dist/SqliteClient-CjOK9-ki.js.map +0 -1
- package/dist/defaultRuntime-BPK9kWEW.js.map +0 -1
- package/dist/manager-C6oJ2tAF.js +0 -13
- package/dist/manager-C6oJ2tAF.js.map +0 -1
- package/dist/query-C6So1r6H.js.map +0 -1
- package/dist/registerModelObjects-BKMpfc4Z.js +0 -263
- package/dist/registerModelObjects-BKMpfc4Z.js.map +0 -1
- package/dist/runtime-ByXbpVBS.js.map +0 -1
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
import type { Model as SchemaModel } from '@danceroutine/tango-schema/domain';
|
|
2
2
|
import type { TableMeta } from './TableMeta';
|
|
3
|
-
type ModelMetadataLike = Omit<SchemaModel['metadata'], 'key' | 'namespace' | 'fields'> & {
|
|
4
|
-
key?: string;
|
|
5
|
-
namespace?: string;
|
|
6
|
-
fields: Array<{
|
|
7
|
-
name: string;
|
|
8
|
-
type: string;
|
|
9
|
-
primaryKey?: boolean;
|
|
10
|
-
}>;
|
|
11
|
-
};
|
|
12
|
-
type TableMetaModel = {
|
|
13
|
-
metadata: ModelMetadataLike;
|
|
14
|
-
};
|
|
15
3
|
/**
|
|
16
4
|
* Build registry-backed recursive table metadata for query planning and
|
|
17
5
|
* hydration execution.
|
|
18
6
|
*/
|
|
19
7
|
export declare class TableMetaFactory {
|
|
20
|
-
static create(model:
|
|
8
|
+
static create(model: SchemaModel): TableMeta;
|
|
21
9
|
private static createWithCache;
|
|
22
10
|
}
|
|
23
|
-
export {};
|
|
@@ -14,7 +14,7 @@ export type { QNode } from './QNode';
|
|
|
14
14
|
export { QueryResult } from './QueryResult';
|
|
15
15
|
export type { QuerySetState } from './QuerySetState';
|
|
16
16
|
export type { RelationMeta } from './RelationMeta';
|
|
17
|
-
export type { ForwardSingleRelations, GeneratedHydratedRelationMap, GeneratedPrefetchRelatedPathKeys, GeneratedSelectRelatedPathKeys, HydratedQueryResult, HydratedRelationMap, ManyRelationHydrationCardinality, MaybeHydratedRelationMap, PrefetchRelatedRelations, RelationKeys, RelationHydrationCardinality, ReverseCollectionRelations, ReverseSingleRelations, SelectRelatedRelations, SingleRelationHydrationCardinality, } from './RelationTyping';
|
|
17
|
+
export type { ForwardSingleRelations, GeneratedRelationFilterKeys, GeneratedHydratedRelationMap, GeneratedPrefetchRelatedPathKeys, GeneratedSelectRelatedPathKeys, HydratedQueryResult, HydratedRelationMap, ManyRelationHydrationCardinality, MaybeHydratedRelationMap, PrefetchRelatedRelations, RelationKeys, RelationHydrationCardinality, ReverseCollectionRelations, ReverseSingleRelations, SelectRelatedRelations, SingleRelationHydrationCardinality, } from './RelationTyping';
|
|
18
18
|
export { InternalRelationHydrationCardinality } from './RelationTyping';
|
|
19
19
|
export type { TableMeta } from './TableMeta';
|
|
20
20
|
export { TableMetaFactory } from './TableMetaFactory';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discriminator strings for compiled prefetch hydration: how `QueryCompiler.compilePrefetch`
|
|
3
|
+
* batches related rows for hydration (`CompiledPrefetchQuery`).
|
|
4
|
+
*/
|
|
5
|
+
export declare const InternalPrefetchQueryKind: {
|
|
6
|
+
/**
|
|
7
|
+
* Single-query prefetch against the related table (`SELECT … FROM target WHERE fk IN (...)`).
|
|
8
|
+
* Used when each related row is reachable from one physical table via a foreign key or
|
|
9
|
+
* symmetric join path (belongsTo, hasMany, hasOne, reverse one-to-one).
|
|
10
|
+
*/
|
|
11
|
+
readonly DIRECT: "direct";
|
|
12
|
+
/**
|
|
13
|
+
* Two-phase many-to-many prefetch: first query reads join (through) rows pairing owner ids to
|
|
14
|
+
* target ids (`throughSql`), then target rows load by primary key (`compileManyToManyTargets`).
|
|
15
|
+
* Distinct from relation metadata’s `manyToMany` relation *kind* on an endpoint—this marks the
|
|
16
|
+
* compiled prefetch *strategy*, not the schema edge type.
|
|
17
|
+
*/
|
|
18
|
+
readonly MANY_TO_MANY: "manyToMany";
|
|
19
|
+
};
|
|
20
|
+
export type PrefetchQueryKind = (typeof InternalPrefetchQueryKind)[keyof typeof InternalPrefetchQueryKind];
|
package/dist/query/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export type * from './domain/index';
|
|
|
8
8
|
export type { TableMeta } from './domain/index';
|
|
9
9
|
export { QueryResult } from './domain/index';
|
|
10
10
|
export { QuerySet } from './QuerySet';
|
|
11
|
+
export { ModelQuerySet } from './ModelQuerySet';
|
|
11
12
|
export type { QueryExecutor } from './QuerySet';
|
|
12
13
|
export { QBuilder, QBuilder as Q } from './QBuilder';
|
|
13
14
|
export { QueryCompiler } from './compiler/index';
|
package/dist/query/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../InternalDialect-ClSaUNso.js";
|
|
2
|
+
import { ModelQuerySet, QBuilder, QueryCompiler, QueryResult, QuerySet, compiler_exports, domain_exports } from "../query-DUZnBFhf.js";
|
|
2
3
|
|
|
3
|
-
export { QBuilder as Q, QBuilder, QueryCompiler, QueryResult, QuerySet, compiler_exports as compiler, domain_exports as domain };
|
|
4
|
+
export { ModelQuerySet, QBuilder as Q, QBuilder, QueryCompiler, QueryResult, QuerySet, compiler_exports as compiler, domain_exports as domain };
|
|
@@ -10,7 +10,7 @@ export declare class QueryPlanner {
|
|
|
10
10
|
readonly __tangoBrand: typeof QueryPlanner.BRAND;
|
|
11
11
|
constructor(meta: TableMeta);
|
|
12
12
|
static isQueryPlanner(value: unknown): value is QueryPlanner;
|
|
13
|
-
plan<T>(state: QuerySetState<T>): QueryHydrationPlanRoot;
|
|
13
|
+
plan<T, TSourceModel = unknown>(state: QuerySetState<T, TSourceModel>): QueryHydrationPlanRoot;
|
|
14
14
|
private addPath;
|
|
15
15
|
private buildPlannedChildren;
|
|
16
16
|
}
|