@prisma-next/sql-contract 0.14.0-dev.5 → 0.14.0-dev.51
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/contract-view.d.mts +61 -0
- package/dist/contract-view.d.mts.map +1 -0
- package/dist/contract-view.mjs +39 -0
- package/dist/contract-view.mjs.map +1 -0
- package/dist/entity-kinds-CHiydmat.mjs +131 -0
- package/dist/entity-kinds-CHiydmat.mjs.map +1 -0
- package/dist/entity-kinds.d.mts +2 -1
- package/dist/entity-kinds.d.mts.map +1 -1
- package/dist/entity-kinds.mjs +1 -1
- package/dist/factories.d.mts +6 -4
- package/dist/factories.d.mts.map +1 -1
- package/dist/factories.mjs +5 -4
- package/dist/factories.mjs.map +1 -1
- package/dist/{foreign-key-BATxB95l.d.mts → foreign-key-DM1UTydh.d.mts} +3 -41
- package/dist/foreign-key-DM1UTydh.d.mts.map +1 -0
- package/dist/index-type-validation.d.mts +1 -1
- package/dist/referential-action-sql.d.mts +1 -1
- package/dist/resolve-storage-table.d.mts +2 -2
- package/dist/sql-node-V214WXQD.d.mts +42 -0
- package/dist/sql-node-V214WXQD.d.mts.map +1 -0
- package/dist/{sql-storage-Dga0jwP2.d.mts → sql-storage-BRB55sCP.d.mts} +62 -20
- package/dist/sql-storage-BRB55sCP.d.mts.map +1 -0
- package/dist/{storage-value-set-WnYsIFM8.d.mts → storage-table-Bj1ZN1P7.d.mts} +16 -39
- package/dist/storage-table-Bj1ZN1P7.d.mts.map +1 -0
- package/dist/{entity-kinds-Cl36zL5j.mjs → storage-value-set-C4XInPlX.mjs} +21 -128
- package/dist/storage-value-set-C4XInPlX.mjs.map +1 -0
- package/dist/storage-value-set-D-jww77l.d.mts +41 -0
- package/dist/storage-value-set-D-jww77l.d.mts.map +1 -0
- package/dist/types-KiOT4SAV.mjs +114 -0
- package/dist/types-KiOT4SAV.mjs.map +1 -0
- package/dist/{types-B1N8w0I2.d.mts → types-zBvpNCmg.d.mts} +25 -55
- package/dist/types-zBvpNCmg.d.mts.map +1 -0
- package/dist/types.d.mts +13 -5
- package/dist/types.d.mts.map +1 -0
- package/dist/types.mjs +3 -3
- package/dist/validators.d.mts +10 -7
- package/dist/validators.d.mts.map +1 -1
- package/dist/validators.mjs +109 -17
- package/dist/validators.mjs.map +1 -1
- package/dist/value-set-derivation-hook.d.mts +35 -0
- package/dist/value-set-derivation-hook.d.mts.map +1 -0
- package/dist/value-set-derivation-hook.mjs +22 -0
- package/dist/value-set-derivation-hook.mjs.map +1 -0
- package/package.json +9 -7
- package/src/column-type-resolution.ts +26 -0
- package/src/contract-view.ts +98 -0
- package/src/exports/contract-view.ts +11 -0
- package/src/exports/types.ts +17 -4
- package/src/exports/value-set-derivation-hook.ts +2 -0
- package/src/factories.ts +12 -2
- package/src/ir/sql-storage.ts +80 -17
- package/src/ir/storage-column.ts +3 -0
- package/src/ir/storage-entry-schemas.ts +1 -0
- package/src/ir/storage-table.ts +21 -0
- package/src/ir/storage-value-set.ts +5 -0
- package/src/types.ts +51 -8
- package/src/validators.ts +215 -40
- package/src/value-set-derivation-hook.ts +47 -0
- package/dist/entity-kinds-Cl36zL5j.mjs.map +0 -1
- package/dist/foreign-key-BATxB95l.d.mts.map +0 -1
- package/dist/sql-storage-Dga0jwP2.d.mts.map +0 -1
- package/dist/storage-value-set-WnYsIFM8.d.mts.map +0 -1
- package/dist/types-B-eiQXff.mjs +0 -191
- package/dist/types-B-eiQXff.mjs.map +0 -1
- package/dist/types-B1N8w0I2.d.mts.map +0 -1
- package/src/ir/build-sql-namespace.ts +0 -110
- package/src/ir/sql-unbound-namespace.ts +0 -74
|
@@ -1,56 +1,7 @@
|
|
|
1
|
-
import { r as ReferentialAction } from "./foreign-key-
|
|
2
|
-
import { r as StorageTable } from "./storage-value-set-WnYsIFM8.mjs";
|
|
3
|
-
import { n as SqlNamespaceEntries, r as SqlNamespaceTablesInput, t as SqlNamespace } from "./sql-storage-Dga0jwP2.mjs";
|
|
4
|
-
import { Namespace, NamespaceBase } from "@prisma-next/framework-components/ir";
|
|
1
|
+
import { r as ReferentialAction } from "./foreign-key-DM1UTydh.mjs";
|
|
5
2
|
import { CodecTrait } from "@prisma-next/framework-components/codec";
|
|
6
3
|
import { ControlDriverInstance } from "@prisma-next/framework-components/control";
|
|
7
4
|
|
|
8
|
-
//#region src/ir/build-sql-namespace.d.ts
|
|
9
|
-
declare function buildSqlNamespace(input: SqlNamespaceTablesInput): SqlNamespace;
|
|
10
|
-
declare function buildSqlNamespaceMap(namespaces: Readonly<Record<string, Namespace | SqlNamespaceTablesInput>>): Readonly<Record<string, SqlNamespace>>;
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/ir/sql-unbound-namespace.d.ts
|
|
13
|
-
/**
|
|
14
|
-
* Family-layer placeholder for the SQL unbound-namespace singleton —
|
|
15
|
-
* the late-bound slot whose binding the target resolves at connection
|
|
16
|
-
* time rather than at authoring time.
|
|
17
|
-
*
|
|
18
|
-
* SQL contracts honour the framework `Storage.namespaces` invariant from
|
|
19
|
-
* the moment they appear in the IR. Today `SqlStorage` is family-shared
|
|
20
|
-
* (Postgres + SQLite consume the same class); a per-target namespace
|
|
21
|
-
* concretion (`PostgresSchema.unbound`, `SqliteUnboundDatabase.instance`)
|
|
22
|
-
* earns its existence when each target's namespace shape lands. Until
|
|
23
|
-
* then the family ships a single placeholder singleton so the JSON
|
|
24
|
-
* envelope and runtime walk are honest at every layer.
|
|
25
|
-
*
|
|
26
|
-
* The `kind` discriminator is installed as a non-enumerable own property
|
|
27
|
-
* so the JSON envelope reads `{ "id": "__unbound__", "entries": { … } }`
|
|
28
|
-
* — symmetric with the family-level non-enumerable `kind` on `SqlNode`
|
|
29
|
-
* and bounded to the minimum data the framework `Namespace` interface
|
|
30
|
-
* promises.
|
|
31
|
-
*
|
|
32
|
-
* **Freeze-trap warning.** The leaf constructor calls
|
|
33
|
-
* `freezeNode(this)` after installing `kind`. The leaf-class shape
|
|
34
|
-
* works today only because `NamespaceBase` does NOT freeze in its
|
|
35
|
-
* constructor — the `Object.defineProperty(this, 'kind', …)` call after
|
|
36
|
-
* `super()` succeeds because the instance is still mutable at that
|
|
37
|
-
* point. Subclasses that add instance fields will still hit the freeze
|
|
38
|
-
* trap once leaf-class `freezeNode(this)` runs; and if a future
|
|
39
|
-
* framework change lifts the freeze to `NamespaceBase`, even the
|
|
40
|
-
* `defineProperty` here would silently fail. To add subclass instance
|
|
41
|
-
* fields safely, lift `freezeNode` to a leaf-class `seal()` hook each
|
|
42
|
-
* leaf calls explicitly at the end of its own constructor.
|
|
43
|
-
*/
|
|
44
|
-
declare class SqlUnboundNamespace extends NamespaceBase {
|
|
45
|
-
static readonly instance: SqlUnboundNamespace;
|
|
46
|
-
readonly id: "__unbound__";
|
|
47
|
-
readonly entries: SqlNamespaceEntries;
|
|
48
|
-
readonly kind: string;
|
|
49
|
-
private constructor();
|
|
50
|
-
get table(): Readonly<Record<string, StorageTable>>;
|
|
51
|
-
qualifyTable(tableName: string): string;
|
|
52
|
-
}
|
|
53
|
-
//#endregion
|
|
54
5
|
//#region src/types.d.ts
|
|
55
6
|
interface SqlControlDriverInstance<T extends string = string> extends ControlDriverInstance<'sql', T> {
|
|
56
7
|
query<Row = Record<string, unknown>>(sql: string, params?: readonly unknown[]): Promise<{
|
|
@@ -85,13 +36,16 @@ declare function applyFkDefaults(fk: {
|
|
|
85
36
|
index: boolean;
|
|
86
37
|
};
|
|
87
38
|
type NamespacedFieldTypeMap = Record<string, Record<string, Record<string, unknown>>>;
|
|
39
|
+
type NamespacedStorageColumnTypeMap = Record<string, Record<string, Record<string, unknown>>>;
|
|
88
40
|
type TypeMaps<TCodecTypes extends Record<string, {
|
|
89
41
|
output: unknown;
|
|
90
|
-
}> = Record<string, never>, TQueryOperationTypes extends Record<string, unknown> = Record<string, never>, TFieldOutputTypes extends NamespacedFieldTypeMap = Record<string, never>, TFieldInputTypes extends NamespacedFieldTypeMap = Record<string, never>> = {
|
|
42
|
+
}> = Record<string, never>, TQueryOperationTypes extends Record<string, unknown> = Record<string, never>, TFieldOutputTypes extends NamespacedFieldTypeMap = Record<string, never>, TFieldInputTypes extends NamespacedFieldTypeMap = Record<string, never>, TStorageColumnTypes extends NamespacedStorageColumnTypeMap = Record<string, never>, TStorageColumnInputTypes extends NamespacedStorageColumnTypeMap = Record<string, never>> = {
|
|
91
43
|
readonly codecTypes: TCodecTypes;
|
|
92
44
|
readonly queryOperationTypes: TQueryOperationTypes;
|
|
93
45
|
readonly fieldOutputTypes: TFieldOutputTypes;
|
|
94
46
|
readonly fieldInputTypes: TFieldInputTypes;
|
|
47
|
+
readonly storageColumnTypes: TStorageColumnTypes;
|
|
48
|
+
readonly storageColumnInputTypes: TStorageColumnInputTypes;
|
|
95
49
|
};
|
|
96
50
|
type CodecTypesOf<T> = [T] extends [never] ? Record<string, never> : T extends {
|
|
97
51
|
readonly codecTypes: infer C;
|
|
@@ -102,15 +56,23 @@ type CodecTypesOf<T> = [T] extends [never] ? Record<string, never> : T extends {
|
|
|
102
56
|
* Dispatch hint identifying the first-argument target of an operation.
|
|
103
57
|
*
|
|
104
58
|
* Used by ORM column helpers to decide whether an operation is reachable on a
|
|
105
|
-
* field.
|
|
106
|
-
*
|
|
59
|
+
* field. Names a concrete codec identity, a set of capability traits the
|
|
60
|
+
* field's codec must carry, or targets list-typed (`many`) fields. Element
|
|
61
|
+
* capability gating for list ops travels in `elementTraits`.
|
|
107
62
|
*/
|
|
108
63
|
type QueryOperationSelfSpec = {
|
|
109
64
|
readonly codecId: string;
|
|
110
65
|
readonly traits?: never;
|
|
66
|
+
readonly many?: never;
|
|
111
67
|
} | {
|
|
112
68
|
readonly traits: readonly CodecTrait[];
|
|
113
69
|
readonly codecId?: never;
|
|
70
|
+
readonly many?: never;
|
|
71
|
+
} | {
|
|
72
|
+
readonly many: true;
|
|
73
|
+
readonly elementTraits?: readonly CodecTrait[];
|
|
74
|
+
readonly codecId?: never;
|
|
75
|
+
readonly traits?: never;
|
|
114
76
|
};
|
|
115
77
|
/**
|
|
116
78
|
* Structural shape an operation's impl must return: any value carrying a
|
|
@@ -147,11 +109,19 @@ type FieldOutputTypesOf<T> = [T] extends [never] ? Record<string, never> : T ext
|
|
|
147
109
|
type FieldInputTypesOf<T> = [T] extends [never] ? Record<string, never> : T extends {
|
|
148
110
|
readonly fieldInputTypes: infer F;
|
|
149
111
|
} ? F extends NamespacedFieldTypeMap ? F : Record<string, never> : Record<string, never>;
|
|
112
|
+
type StorageColumnTypesOf<T> = [T] extends [never] ? Record<string, never> : T extends {
|
|
113
|
+
readonly storageColumnTypes: infer F;
|
|
114
|
+
} ? F extends NamespacedStorageColumnTypeMap ? F : Record<string, never> : Record<string, never>;
|
|
115
|
+
type StorageColumnInputTypesOf<T> = [T] extends [never] ? Record<string, never> : T extends {
|
|
116
|
+
readonly storageColumnInputTypes: infer F;
|
|
117
|
+
} ? F extends NamespacedStorageColumnTypeMap ? F : Record<string, never> : Record<string, never>;
|
|
150
118
|
type ExtractCodecTypes<T> = CodecTypesOf<ExtractTypeMapsFromContract<T>>;
|
|
151
119
|
type ExtractQueryOperationTypes<T> = QueryOperationTypesOf<ExtractTypeMapsFromContract<T>>;
|
|
152
120
|
type ExtractFieldOutputTypes<T> = FieldOutputTypesOf<ExtractTypeMapsFromContract<T>>;
|
|
153
121
|
type ExtractFieldInputTypes<T> = FieldInputTypesOf<ExtractTypeMapsFromContract<T>>;
|
|
122
|
+
type ExtractStorageColumnTypes<T> = StorageColumnTypesOf<ExtractTypeMapsFromContract<T>>;
|
|
123
|
+
type ExtractStorageColumnInputTypes<T> = StorageColumnInputTypesOf<ExtractTypeMapsFromContract<T>>;
|
|
154
124
|
type ResolveCodecTypes<TContract, TTypeMaps> = [TTypeMaps] extends [never] ? ExtractCodecTypes<TContract> : CodecTypesOf<TTypeMaps>;
|
|
155
125
|
//#endregion
|
|
156
|
-
export {
|
|
157
|
-
//# sourceMappingURL=types-
|
|
126
|
+
export { TypeMapsPhantomKey as A, SqlControlDriverInstance as C, StorageColumnInputTypesOf as D, SqlQueryOperationTypes as E, StorageColumnTypesOf as O, ResolveCodecTypes as S, SqlModelStorage as T, QueryOperationReturn as _, ExtractCodecTypes as a, QueryOperationTypesBase as b, ExtractQueryOperationTypes as c, ExtractTypeMapsFromContract as d, FieldInputTypesOf as f, NamespacedStorageColumnTypeMap as g, NamespacedFieldTypeMap as h, DEFAULT_FK_INDEX as i, applyFkDefaults as j, TypeMaps as k, ExtractStorageColumnInputTypes as l, ForeignKeyOptions as m, ContractWithTypeMaps as n, ExtractFieldInputTypes as o, FieldOutputTypesOf as p, DEFAULT_FK_CONSTRAINT as r, ExtractFieldOutputTypes as s, CodecTypesOf as t, ExtractStorageColumnTypes as u, QueryOperationSelfSpec as v, SqlModelFieldStorage as w, QueryOperationTypesOf as x, QueryOperationTypeEntry as y };
|
|
127
|
+
//# sourceMappingURL=types-zBvpNCmg.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-zBvpNCmg.d.mts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;UAIiB,wBAAA,oCACP,qBAAA,QAA6B,CAAA;EACrC,KAAA,OAAY,MAAA,mBACV,GAAA,UACA,MAAA,wBACC,OAAA;IAAA,SAAmB,IAAA,EAAM,GAAA;EAAA;AAAA;AAAA,KAgDlB,iBAAA;EAAA,SACD,IAAA;EAAA,SACA,QAAA,GAAW,iBAAA;EAAA,SACX,QAAA,GAAW,iBAAiB;AAAA;AAAA,KAG3B,oBAAA;EAAA,SACD,MAAA;EAAA,SACA,OAAA;EAAA,SACA,QAAA;AAAA;AAAA,KAGC,eAAA;EAAA,SACD,KAAA;EAAA,SACA,WAAA;EAAA,SACA,MAAA,EAAQ,MAAM,SAAS,oBAAA;AAAA;AAAA,cAGrB,qBAAA;AAAA,cACA,gBAAA;AAAA,iBAEG,eAAA,CACd,EAAA;EAAM,UAAA;EAAkC,KAAA;AAAA,GACxC,gBAAA;EAAqB,UAAA;EAAkC,KAAA;AAA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iBAAA,CAAkB,2BAAA,CAA4B,CAAA;AAAA,KAC1E,yBAAA,MAA+B,oBAAA,CAAqB,2BAAA,CAA4B,CAAA;AAAA,KAChF,8BAAA,MAAoC,yBAAA,CAC9C,2BAAA,CAA4B,CAAA;AAAA,KAGlB,iBAAA,0BAA2C,SAAA,oBACnD,iBAAA,CAAkB,SAAA,IAClB,YAAA,CAAa,SAAA"}
|
package/dist/types.d.mts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { t as SqlNode } from "./sql-node-V214WXQD.mjs";
|
|
2
|
+
import { a as StorageColumn, c as IndexInput, d as CheckConstraint, f as CheckConstraintInput, i as UniqueConstraintInput, l as PrimaryKey, n as StorageTableInput, o as StorageColumnInput, r as UniqueConstraint, s as Index, t as StorageTable, u as PrimaryKeyInput } from "./storage-table-Bj1ZN1P7.mjs";
|
|
3
|
+
import { a as ForeignKeyReferenceInput, i as ForeignKeyReference, n as ForeignKeyInput, r as ReferentialAction, t as ForeignKey } from "./foreign-key-DM1UTydh.mjs";
|
|
4
|
+
import { a as SqlNamespaceFactory, c as SqlStorageInput, d as isSqlAuthoringContributions, f as CODEC_INSTANCE_KIND, g as toStorageTypeInstance, h as isStorageTypeInstance, i as SqlNamespaceEntries, l as SqlStorageTypeEntry, m as StorageTypeInstanceInput, n as SqlNamespace, o as SqlNamespaceInput, p as StorageTypeInstance, r as SqlNamespaceBase, s as SqlStorage, t as SqlAuthoringContributions, u as isMaterializedSqlNamespace } from "./sql-storage-BRB55sCP.mjs";
|
|
5
|
+
import { n as StorageValueSetInput, r as isStorageValueSet, t as StorageValueSet } from "./storage-value-set-D-jww77l.mjs";
|
|
6
|
+
import { A as TypeMapsPhantomKey, C as SqlControlDriverInstance, D as StorageColumnInputTypesOf, E as SqlQueryOperationTypes, O as StorageColumnTypesOf, S as ResolveCodecTypes, T as SqlModelStorage, _ as QueryOperationReturn, a as ExtractCodecTypes, b as QueryOperationTypesBase, c as ExtractQueryOperationTypes, d as ExtractTypeMapsFromContract, f as FieldInputTypesOf, g as NamespacedStorageColumnTypeMap, h as NamespacedFieldTypeMap, i as DEFAULT_FK_INDEX, j as applyFkDefaults, k as TypeMaps, l as ExtractStorageColumnInputTypes, m as ForeignKeyOptions, n as ContractWithTypeMaps, o as ExtractFieldInputTypes, p as FieldOutputTypesOf, r as DEFAULT_FK_CONSTRAINT, s as ExtractFieldOutputTypes, t as CodecTypesOf, u as ExtractStorageColumnTypes, v as QueryOperationSelfSpec, w as SqlModelFieldStorage, x as QueryOperationTypesOf, y as QueryOperationTypeEntry } from "./types-zBvpNCmg.mjs";
|
|
7
|
+
|
|
8
|
+
//#region src/column-type-resolution.d.ts
|
|
9
|
+
type StorageColumnMapAt<SCT, NsId extends string, TableName extends string> = string extends keyof SCT ? never : NsId extends keyof SCT ? string extends keyof SCT[NsId] ? never : TableName extends keyof SCT[NsId] ? SCT[NsId][TableName] : never : never;
|
|
10
|
+
type StorageColumnTypeAcrossNamespaces<SCT, TableName extends string, ColumnName extends string> = { [Ns in keyof SCT]: TableName extends keyof SCT[Ns] ? ColumnName extends keyof SCT[Ns][TableName] ? SCT[Ns][TableName][ColumnName] : never : never }[keyof SCT];
|
|
11
|
+
//#endregion
|
|
12
|
+
export { CODEC_INSTANCE_KIND, CheckConstraint, type CheckConstraintInput, type CodecTypesOf, type ContractWithTypeMaps, DEFAULT_FK_CONSTRAINT, DEFAULT_FK_INDEX, type ExtractCodecTypes, type ExtractFieldInputTypes, type ExtractFieldOutputTypes, type ExtractQueryOperationTypes, type ExtractStorageColumnInputTypes, type ExtractStorageColumnTypes, type ExtractTypeMapsFromContract, type FieldInputTypesOf, type FieldOutputTypesOf, ForeignKey, type ForeignKeyInput, type ForeignKeyOptions, ForeignKeyReference, type ForeignKeyReferenceInput, Index, type IndexInput, type NamespacedFieldTypeMap, type NamespacedStorageColumnTypeMap, PrimaryKey, type PrimaryKeyInput, type QueryOperationReturn, type QueryOperationSelfSpec, type QueryOperationTypeEntry, type QueryOperationTypesBase, type QueryOperationTypesOf, type ReferentialAction, type ResolveCodecTypes, type SqlAuthoringContributions, type SqlControlDriverInstance, type SqlModelFieldStorage, type SqlModelStorage, type SqlNamespace, SqlNamespaceBase, type SqlNamespaceEntries, type SqlNamespaceFactory, type SqlNamespaceInput, SqlNode, type SqlQueryOperationTypes, SqlStorage, type SqlStorageInput, type SqlStorageTypeEntry, StorageColumn, type StorageColumnInput, type StorageColumnInputTypesOf, type StorageColumnMapAt, type StorageColumnTypeAcrossNamespaces, type StorageColumnTypesOf, StorageTable, type StorageTableInput, type StorageTypeInstance, type StorageTypeInstanceInput, StorageValueSet, type StorageValueSetInput, type TypeMaps, type TypeMapsPhantomKey, UniqueConstraint, type UniqueConstraintInput, applyFkDefaults, isMaterializedSqlNamespace, isSqlAuthoringContributions, isStorageTypeInstance, isStorageValueSet, toStorageTypeInstance };
|
|
13
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../src/column-type-resolution.ts"],"mappings":";;;;;;;;KACY,kBAAA,4EAIa,GAAA,WAErB,IAAA,eAAmB,GAAA,wBACI,GAAA,CAAI,IAAA,YAEvB,SAAA,eAAwB,GAAA,CAAI,IAAA,IAC1B,GAAA,CAAI,IAAA,EAAM,SAAA;AAAA,KAIR,iCAAA,4EAKG,GAAA,GAAM,SAAA,eAAwB,GAAA,CAAI,EAAA,IAC3C,UAAA,eAAyB,GAAA,CAAI,EAAA,EAAI,SAAA,IAC/B,GAAA,CAAI,EAAA,EAAI,SAAA,EAAW,UAAA,0BAGnB,GAAA"}
|
package/dist/types.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { a as
|
|
3
|
-
export { CODEC_INSTANCE_KIND, CheckConstraint, DEFAULT_FK_CONSTRAINT, DEFAULT_FK_INDEX, ForeignKey, ForeignKeyReference, Index, PrimaryKey, SqlNode, SqlStorage,
|
|
1
|
+
import { a as StorageColumn, c as ForeignKey, d as SqlNode, i as UniqueConstraint, l as ForeignKeyReference, n as isStorageValueSet, o as Index, r as StorageTable, s as PrimaryKey, t as StorageValueSet, u as CheckConstraint } from "./storage-value-set-C4XInPlX.mjs";
|
|
2
|
+
import { a as SqlStorage, c as CODEC_INSTANCE_KIND, i as SqlNamespaceBase, l as isStorageTypeInstance, n as DEFAULT_FK_INDEX, o as isMaterializedSqlNamespace, r as applyFkDefaults, s as isSqlAuthoringContributions, t as DEFAULT_FK_CONSTRAINT, u as toStorageTypeInstance } from "./types-KiOT4SAV.mjs";
|
|
3
|
+
export { CODEC_INSTANCE_KIND, CheckConstraint, DEFAULT_FK_CONSTRAINT, DEFAULT_FK_INDEX, ForeignKey, ForeignKeyReference, Index, PrimaryKey, SqlNamespaceBase, SqlNode, SqlStorage, StorageColumn, StorageTable, StorageValueSet, UniqueConstraint, applyFkDefaults, isMaterializedSqlNamespace, isSqlAuthoringContributions, isStorageTypeInstance, isStorageValueSet, toStorageTypeInstance };
|
package/dist/validators.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Type } from "arktype";
|
|
1
|
+
import { i as UniqueConstraintInput, u as PrimaryKeyInput } from "./storage-table-Bj1ZN1P7.mjs";
|
|
2
|
+
import { n as ForeignKeyInput, r as ReferentialAction } from "./foreign-key-DM1UTydh.mjs";
|
|
3
|
+
import { s as SqlStorage } from "./sql-storage-BRB55sCP.mjs";
|
|
5
4
|
import { AnyEntityKindDescriptor } from "@prisma-next/framework-components/ir";
|
|
5
|
+
import { Type } from "arktype";
|
|
6
6
|
import { Contract } from "@prisma-next/contract/types";
|
|
7
7
|
|
|
8
8
|
//#region src/ir/storage-entry-schemas.d.ts
|
|
@@ -62,6 +62,7 @@ declare const StorageTableSchema: import("arktype/internal/variants/object.ts").
|
|
|
62
62
|
nativeType: string;
|
|
63
63
|
codecId: string;
|
|
64
64
|
nullable: boolean;
|
|
65
|
+
many?: boolean;
|
|
65
66
|
typeParams?: Record<string, unknown>;
|
|
66
67
|
typeRef?: string;
|
|
67
68
|
default?: ColumnDefaultLiteral | ColumnDefaultFunction;
|
|
@@ -133,13 +134,15 @@ declare function createSqlStorageSchema(kinds: ReadonlyMap<string, AnyEntityKind
|
|
|
133
134
|
*/
|
|
134
135
|
declare function createSqlContractSchema(kinds: ReadonlyMap<string, AnyEntityKindDescriptor>): Type<unknown>;
|
|
135
136
|
/**
|
|
136
|
-
* Validates the structural shape of SqlStorage using Arktype.
|
|
137
|
+
* Validates the structural shape of SqlStorage using Arktype. Pure
|
|
138
|
+
* structural check: namespace IR is never materialized here (that needs
|
|
139
|
+
* a target concretion via the serializer hydration path), so this throws
|
|
140
|
+
* on invalid input and constructs nothing.
|
|
137
141
|
*
|
|
138
142
|
* @param value - The storage value to validate
|
|
139
|
-
* @returns The validated storage if structure is valid
|
|
140
143
|
* @throws Error if the storage structure is invalid
|
|
141
144
|
*/
|
|
142
|
-
declare function validateStorage(value: unknown):
|
|
145
|
+
declare function validateStorage(value: unknown): void;
|
|
143
146
|
declare function validateModel(value: unknown): unknown;
|
|
144
147
|
/**
|
|
145
148
|
* Validates semantic constraints on SqlStorage that cannot be expressed in Arktype schemas.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.mts","names":[],"sources":["../src/ir/storage-entry-schemas.ts","../src/validators.ts"],"mappings":";;;;;;;;KAMK,oBAAA;EAAA,SACM,IAAA;EAAA,SACA,KAAA,8BAAmC,MAAM;AAAA;AAAA,KAE/C,qBAAA;EAAA,SAAmC,IAAA;EAAA,SAA2B,UAAU;AAAA;AAAA,cAMhE,0BAAA,gDAA0B,UAAA,CAAA,oBAAA;AAAA,cAK1B,2BAAA,gDAA2B,UAAA,CAAA,qBAAA;AAAA,cAK3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;;;;iBC4TgB,eAAA,CAAgB,KAAc;AAAA,iBAQ9B,aAAA,CAAc,KAAc;;;;ADnT5C;;;;;;;;;;iBCiXgB,wBAAA,CAAyB,OAAmB,EAAV,UAAU;;AD1W5D;;;;;iBC+gBgB,8BAAA,CAA+B,QAAA,EAAU,QAAQ,CAAC,UAAA;;;;;;ADvgBlE;iBCmkBgB,6BAAA,CAA8B,QAAA,EAAU,QAAQ,CAAC,UAAA;AAAA,UAwGhD,+BAAA;EDtqB0B;;;;;;;AAE3C;EAF2C,SC+qBhC,cAAA,GAAiB,IAAI;AAAA;;AD7qBI;AAIpC;;;;AAA6B;AAU7B;iBC0qBgB,wBAAA,WAAmC,QAAA,CAAS,UAAA,GAC1D,KAAA,WACA,OAAA,GAAU,+BAAA,GACT,CAAA"}
|
package/dist/validators.mjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { a as ColumnDefaultFunctionSchema, c as ForeignKeyReferenceSchema, d as IndexSchema, f as ReferentialActionSchema, i as CheckConstraintSchema, l as ForeignKeySchema, m as StorageValueSetSchema, o as ColumnDefaultLiteralSchema, p as StorageTableSchema, s as ColumnDefaultSchema, t as composeSqlEntityKinds, u as ForeignKeySourceSchema } from "./entity-kinds-CHiydmat.mjs";
|
|
2
|
+
import { isPlainRecord } from "@prisma-next/framework-components/ir";
|
|
3
3
|
import { type } from "arktype";
|
|
4
|
-
import { UNBOUND_NAMESPACE_ID, isPlainRecord } from "@prisma-next/framework-components/ir";
|
|
5
4
|
import { CrossReferenceSchema } from "@prisma-next/contract/types";
|
|
6
|
-
import { blindCast } from "@prisma-next/utils/casts";
|
|
7
5
|
import { ContractValidationError } from "@prisma-next/contract/contract-validation-error";
|
|
8
6
|
import { validateContractDomain } from "@prisma-next/contract/validate-domain";
|
|
7
|
+
import { blindCast } from "@prisma-next/utils/casts";
|
|
9
8
|
import { ifDefined } from "@prisma-next/utils/defined";
|
|
10
9
|
//#region src/validators.ts
|
|
11
10
|
const generatorKindSchema = type("'generator'");
|
|
@@ -236,10 +235,12 @@ function createSqlContractSchema(kinds) {
|
|
|
236
235
|
}
|
|
237
236
|
const SqlContractSchema = createSqlContractSchema(DEFAULT_SQL_KINDS);
|
|
238
237
|
/**
|
|
239
|
-
* Validates the structural shape of SqlStorage using Arktype.
|
|
238
|
+
* Validates the structural shape of SqlStorage using Arktype. Pure
|
|
239
|
+
* structural check: namespace IR is never materialized here (that needs
|
|
240
|
+
* a target concretion via the serializer hydration path), so this throws
|
|
241
|
+
* on invalid input and constructs nothing.
|
|
240
242
|
*
|
|
241
243
|
* @param value - The storage value to validate
|
|
242
|
-
* @returns The validated storage if structure is valid
|
|
243
244
|
* @throws Error if the storage structure is invalid
|
|
244
245
|
*/
|
|
245
246
|
function validateStorage(value) {
|
|
@@ -248,17 +249,6 @@ function validateStorage(value) {
|
|
|
248
249
|
const messages = result.map((p) => p.message).join("; ");
|
|
249
250
|
throw new Error(`Storage validation failed: ${messages}`);
|
|
250
251
|
}
|
|
251
|
-
const validated = blindCast(result);
|
|
252
|
-
const namespaces = buildSqlNamespaceMap(validated.namespaces ?? {});
|
|
253
|
-
const unbound = namespaces[UNBOUND_NAMESPACE_ID] ?? SqlUnboundNamespace.instance;
|
|
254
|
-
return new SqlStorage({
|
|
255
|
-
storageHash: validated.storageHash,
|
|
256
|
-
...ifDefined("types", validated.types),
|
|
257
|
-
namespaces: {
|
|
258
|
-
...namespaces,
|
|
259
|
-
[UNBOUND_NAMESPACE_ID]: unbound
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
252
|
}
|
|
263
253
|
function validateModel(value) {
|
|
264
254
|
const result = ModelSchema(value);
|
|
@@ -463,8 +453,110 @@ function validateSqlContractFully(value, options) {
|
|
|
463
453
|
const semanticErrors = validateStorageSemantics(validated.storage);
|
|
464
454
|
if (semanticErrors.length > 0) throw new ContractValidationError(`Contract semantic validation failed: ${semanticErrors.join("; ")}`, "storage");
|
|
465
455
|
validateModelStorageReferences(validated);
|
|
456
|
+
validateRelationThroughConsistency(validated);
|
|
466
457
|
return validated;
|
|
467
458
|
}
|
|
459
|
+
/** Storage column lookup for through-consistency validation. */
|
|
460
|
+
function lookupStorageColumn(contract, namespaceId, tableName, columnName) {
|
|
461
|
+
const rawTable = contract.storage.namespaces[namespaceId]?.entries.table?.[tableName];
|
|
462
|
+
if (rawTable === void 0) return;
|
|
463
|
+
return blindCast(rawTable).columns[columnName];
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Two storage columns share a type when their `nativeType` and `typeParams`
|
|
467
|
+
* match. The contract is canonicalized, so `typeParams` key order is stable and
|
|
468
|
+
* a JSON comparison is exact. `codecId` and `nullable` are intentionally not
|
|
469
|
+
* compared: they do not change the database-level type that governs a join.
|
|
470
|
+
*/
|
|
471
|
+
function sameStorageType(a, b) {
|
|
472
|
+
return a.nativeType === b.nativeType && JSON.stringify(a.typeParams ?? null) === JSON.stringify(b.typeParams ?? null);
|
|
473
|
+
}
|
|
474
|
+
function describeColumnType(column) {
|
|
475
|
+
return column.typeParams === void 0 ? column.nativeType : `${column.nativeType} ${JSON.stringify(column.typeParams)}`;
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Validates one side of an N:M join: the junction columns and the model
|
|
479
|
+
* columns they pair against positionally must be equal in number, exist in
|
|
480
|
+
* their tables, and share the same storage type (`nativeType` + `typeParams`).
|
|
481
|
+
* The junction's storage foreign keys already guarantee this for user-declared
|
|
482
|
+
* FK constraints, but `through` is a logical descriptor never tied to them by
|
|
483
|
+
* the rest of validation — and the TS builder accepts explicit join columns
|
|
484
|
+
* without requiring a junction FK at all — so this checks the columns directly
|
|
485
|
+
* against storage, one path regardless of how the junction was authored.
|
|
486
|
+
*
|
|
487
|
+
* Joined columns must be the *same* storage type, not merely compatible:
|
|
488
|
+
* relying on implicit conversion (e.g. `text`↔`character`) is unsafe on writes
|
|
489
|
+
* — `character(n)` space-padding makes such coercions non-associative — and no
|
|
490
|
+
* ADR sanctions heterogeneous junction columns. Equality is the conservative
|
|
491
|
+
* default; it can be relaxed deliberately if a real use case ever appears.
|
|
492
|
+
*/
|
|
493
|
+
function validateThroughJoinSide(input) {
|
|
494
|
+
const fail = (detail) => new ContractValidationError(`Many-to-many relation "${input.qualifiedName}" ${detail}`, "storage");
|
|
495
|
+
if (input.junctionColumns.length !== input.modelColumns.length) throw fail(`pairs ${input.junctionColumnsLabel} (${input.junctionColumns.length}) with ${input.modelColumnsLabel} (${input.modelColumns.length}) of differing length; they join positionally and must match.`);
|
|
496
|
+
for (const [index, junctionColumnName] of input.junctionColumns.entries()) {
|
|
497
|
+
const modelColumnRef = input.modelColumns[index];
|
|
498
|
+
if (modelColumnRef === void 0) continue;
|
|
499
|
+
const junctionColumn = lookupStorageColumn(input.contract, input.junctionNamespaceId, input.junctionTable, junctionColumnName);
|
|
500
|
+
if (junctionColumn === void 0) throw fail(`${input.junctionColumnsLabel} references column "${junctionColumnName}" absent from junction table "${input.junctionNamespaceId}.${input.junctionTable}".`);
|
|
501
|
+
const model = input.model;
|
|
502
|
+
if (model === void 0) continue;
|
|
503
|
+
let modelColumnName = modelColumnRef;
|
|
504
|
+
if (model.fieldToColumn !== void 0) {
|
|
505
|
+
const mapped = model.fieldToColumn[modelColumnRef];
|
|
506
|
+
if (mapped === void 0) throw fail(`${input.modelColumnsLabel} references field "${modelColumnRef}" absent from model on table "${model.namespaceId}.${model.table}".`);
|
|
507
|
+
modelColumnName = mapped.column;
|
|
508
|
+
}
|
|
509
|
+
const modelColumn = lookupStorageColumn(input.contract, model.namespaceId, model.table, modelColumnName);
|
|
510
|
+
if (modelColumn === void 0) throw fail(`${input.modelColumnsLabel} references column "${modelColumnName}" absent from table "${model.namespaceId}.${model.table}".`);
|
|
511
|
+
if (!sameStorageType(junctionColumn, modelColumn)) throw fail(`joins "${input.junctionTable}.${junctionColumnName}" (${describeColumnType(junctionColumn)}) with "${model.table}.${modelColumnName}" (${describeColumnType(modelColumn)}) of differing storage type; junction columns must match the type of the column they reference.`);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* Validates that every N:M relation's `through` descriptor is consistent with
|
|
516
|
+
* the storage columns it joins: both join sides match in column count,
|
|
517
|
+
* reference columns that exist in their tables, and pair columns of the same
|
|
518
|
+
* storage type. Without this, a `through` that disagrees with storage surfaces
|
|
519
|
+
* as a silently wrong JOIN at query time rather than a validation error here.
|
|
520
|
+
*/
|
|
521
|
+
function validateRelationThroughConsistency(contract) {
|
|
522
|
+
for (const [namespaceId, namespace] of Object.entries(contract.domain.namespaces)) for (const [modelName, model] of Object.entries(namespace.models)) for (const [relationName, relation] of Object.entries(model.relations)) {
|
|
523
|
+
if (relation.cardinality !== "N:M") continue;
|
|
524
|
+
const qualifiedName = `${namespaceId}.${modelName}.${relationName}`;
|
|
525
|
+
const { on, through } = relation;
|
|
526
|
+
const modelStorage = blindCast(model.storage);
|
|
527
|
+
validateThroughJoinSide({
|
|
528
|
+
contract,
|
|
529
|
+
qualifiedName,
|
|
530
|
+
modelColumns: on.localFields,
|
|
531
|
+
modelColumnsLabel: "on.localFields",
|
|
532
|
+
model: {
|
|
533
|
+
namespaceId,
|
|
534
|
+
table: modelStorage.table,
|
|
535
|
+
fieldToColumn: modelStorage.fields
|
|
536
|
+
},
|
|
537
|
+
junctionColumns: through.parentColumns,
|
|
538
|
+
junctionColumnsLabel: "through.parentColumns",
|
|
539
|
+
junctionNamespaceId: through.namespaceId,
|
|
540
|
+
junctionTable: through.table
|
|
541
|
+
});
|
|
542
|
+
const targetModel = relation.to.space === void 0 ? contract.domain.namespaces[relation.to.namespace]?.models[relation.to.model] : void 0;
|
|
543
|
+
const targetModelSide = targetModel === void 0 ? void 0 : {
|
|
544
|
+
namespaceId: relation.to.namespace,
|
|
545
|
+
table: blindCast(targetModel.storage).table
|
|
546
|
+
};
|
|
547
|
+
validateThroughJoinSide({
|
|
548
|
+
contract,
|
|
549
|
+
qualifiedName,
|
|
550
|
+
modelColumns: through.targetColumns,
|
|
551
|
+
modelColumnsLabel: "through.targetColumns",
|
|
552
|
+
...ifDefined("model", targetModelSide),
|
|
553
|
+
junctionColumns: through.childColumns,
|
|
554
|
+
junctionColumnsLabel: "through.childColumns",
|
|
555
|
+
junctionNamespaceId: through.namespaceId,
|
|
556
|
+
junctionTable: through.table
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
}
|
|
468
560
|
//#endregion
|
|
469
561
|
export { CheckConstraintSchema, ColumnDefaultFunctionSchema, ColumnDefaultLiteralSchema, ColumnDefaultSchema, ContractEnumSchema, ForeignKeyReferenceSchema, ForeignKeySchema, ForeignKeySourceSchema, IndexSchema, ReferentialActionSchema, StorageTableSchema, StorageValueSetSchema, createNamespaceEntrySchema, createSqlContractSchema, createSqlStorageSchema, validateModel, validateModelStorageReferences, validateSqlContractFully, validateSqlStorageConsistency, validateStorage, validateStorageSemantics };
|
|
470
562
|
|