@prisma/orm-family-sql 8.0.0-rc.18-dev.30 → 8.0.0-rc.18-dev.32
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/{ast-CBO3PEJF.mjs → ast-BJs2669T.mjs} +47 -12
- package/dist/ast-BJs2669T.mjs.map +1 -0
- package/dist/{ast-Cq7uhA86.d.mts → ast-DB7g9Mh2.d.mts} +29 -2
- package/dist/ast-DB7g9Mh2.d.mts.map +1 -0
- package/dist/builder.d.mts +1 -1
- package/dist/builder__runtime.d.mts +1 -1
- package/dist/builder__runtime.mjs +1 -1
- package/dist/builder__types.d.mts +1 -1
- package/dist/{config-types-vu5fTaRa.mjs → config-types-BkcCqeAg.mjs} +2 -2
- package/dist/{config-types-vu5fTaRa.mjs.map → config-types-BkcCqeAg.mjs.map} +1 -1
- package/dist/{contract-builder-DmX4XnJa.mjs → contract-builder-D3XaKpyw.mjs} +3 -3
- package/dist/{contract-builder-DmX4XnJa.mjs.map → contract-builder-D3XaKpyw.mjs.map} +1 -1
- package/dist/contract-prisma7__provider.mjs +6 -6
- package/dist/contract-psl.mjs +1 -1
- package/dist/contract-psl__attribute-specs.mjs +1 -1
- package/dist/contract-psl__diagnostics.mjs +1 -1
- package/dist/contract-psl__provider.mjs +2 -2
- package/dist/contract-ts.mjs +3 -3
- package/dist/contract-ts__config-types.mjs +1 -1
- package/dist/contract-ts__contract-builder.mjs +2 -2
- package/dist/contract.d.mts +3 -3
- package/dist/contract.mjs +6 -6
- package/dist/contract__data-type.d.mts +2 -2
- package/dist/contract__data-type.mjs +3 -3
- package/dist/contract__foreign-key-materialization.d.mts +1 -1
- package/dist/contract__foreign-key-materialization.mjs +2 -2
- package/dist/contract__validators.mjs +1 -1
- package/dist/{control-B8tb6SEt.d.mts → control-Db07JiRl.d.mts} +24 -7
- package/dist/control-Db07JiRl.d.mts.map +1 -0
- package/dist/{control-DNE-Chse.mjs → control-DbHnaxDE.mjs} +10 -9
- package/dist/control-DbHnaxDE.mjs.map +1 -0
- package/dist/{control-adapter-DhX77V61.mjs → control-adapter-BX5COBWO.mjs} +2 -2
- package/dist/{control-adapter-DhX77V61.mjs.map → control-adapter-BX5COBWO.mjs.map} +1 -1
- package/dist/{control-adapter-Bn0uhplA-rhq_JtYp.d.mts → control-adapter-Bn0uhplA-BnsQY8_q.d.mts} +4 -4
- package/dist/{control-adapter-Bn0uhplA-rhq_JtYp.d.mts.map → control-adapter-Bn0uhplA-BnsQY8_q.d.mts.map} +1 -1
- package/dist/{control-adapter-RwLtGiwa.d.mts → control-adapter-DgxEVzhZ.d.mts} +4 -4
- package/dist/{control-adapter-RwLtGiwa.d.mts.map → control-adapter-DgxEVzhZ.d.mts.map} +1 -1
- package/dist/{data-type-C84xngfv.d.mts → data-type-DMk-fLAZ.d.mts} +38 -8
- package/dist/data-type-DMk-fLAZ.d.mts.map +1 -0
- package/dist/data-type-HNhSslwG.mjs +67 -0
- package/dist/data-type-HNhSslwG.mjs.map +1 -0
- package/dist/{db-BmrN9nRS-BzK96yVh.d.mts → db-BmrN9nRS-BGnRxI7X.d.mts} +2 -2
- package/dist/{db-BmrN9nRS-BzK96yVh.d.mts.map → db-BmrN9nRS-BGnRxI7X.d.mts.map} +1 -1
- package/dist/{derived-checks-CdPHpJSv-B7Bgj3Ao.mjs → derived-checks-B1qNxwBL-DFoGexId.mjs} +17 -5
- package/dist/derived-checks-B1qNxwBL-DFoGexId.mjs.map +1 -0
- package/dist/{diagnostics-C8YevjSU.mjs → diagnostics-xqFRhSin.mjs} +2 -2
- package/dist/{diagnostics-C8YevjSU.mjs.map → diagnostics-xqFRhSin.mjs.map} +1 -1
- package/dist/{diff-B9Z47nHf.d.mts → diff-BN_3K9lv.d.mts} +5 -5
- package/dist/{diff-B9Z47nHf.d.mts.map → diff-BN_3K9lv.d.mts.map} +1 -1
- package/dist/family.d.mts +10 -10
- package/dist/family.mjs +8 -8
- package/dist/family__control-adapter.d.mts +2 -2
- package/dist/family__control-adapter.mjs +1 -1
- package/dist/family__control.d.mts +3 -3
- package/dist/family__control.mjs +3 -3
- package/dist/family__diff.d.mts +1 -1
- package/dist/family__diff.mjs +1 -1
- package/dist/family__ir.mjs +1 -1
- package/dist/family__migration.d.mts +1 -1
- package/dist/family__pack.d.mts +1 -1
- package/dist/family__pack.mjs +2 -2
- package/dist/family__pack.mjs.map +1 -1
- package/dist/family__psl-build.d.mts +1 -1
- package/dist/family__psl-build.mjs +1 -1
- package/dist/family__psl-infer.d.mts +1 -1
- package/dist/family__psl-infer.mjs +1 -1
- package/dist/{foreign-key-materialization-C_FPLzj3.mjs → foreign-key-materialization-BPQqd0qF.mjs} +2 -2
- package/dist/{foreign-key-materialization-C_FPLzj3.mjs.map → foreign-key-materialization-BPQqd0qF.mjs.map} +1 -1
- package/dist/{foreign-key-materialization-3vQnPT_D.d.mts → foreign-key-materialization-bL-t2oPB.d.mts} +3 -3
- package/dist/{foreign-key-materialization-3vQnPT_D.d.mts.map → foreign-key-materialization-bL-t2oPB.d.mts.map} +1 -1
- package/dist/{generator-functions-B4gRRYZB-BTtC2KQz.mjs → generator-functions-BoE7Lc9d-MgcgdnPZ.mjs} +37 -20
- package/dist/generator-functions-BoE7Lc9d-MgcgdnPZ.mjs.map +1 -0
- package/dist/{index-B0hZw3uT.d.mts → index-Bw9Y19Js.d.mts} +3 -3
- package/dist/{index-B0hZw3uT.d.mts.map → index-Bw9Y19Js.d.mts.map} +1 -1
- package/dist/{index-equivalence-DswCiq5l-C6SAs-Yz.mjs → index-equivalence-DswCiq5l-D5VK0qTy.mjs} +2 -2
- package/dist/{index-equivalence-DswCiq5l-C6SAs-Yz.mjs.map → index-equivalence-DswCiq5l-D5VK0qTy.mjs.map} +1 -1
- package/dist/{interpreter-Bk0xpelv-BifV9Yib.mjs → interpreter-Bk0xpelv-4laiO5dH.mjs} +4 -4
- package/dist/{interpreter-Bk0xpelv-BifV9Yib.mjs.map → interpreter-Bk0xpelv-4laiO5dH.mjs.map} +1 -1
- package/dist/{migration-CSv3UpiC.d.mts → migration-go6YP7-v.d.mts} +2 -2
- package/dist/{migration-CSv3UpiC.d.mts.map → migration-go6YP7-v.d.mts.map} +1 -1
- package/dist/orm-client.d.mts +3 -3
- package/dist/orm-client.mjs +1 -1
- package/dist/{pack-COEyiyfL.d.mts → pack-DXEOdHaM.d.mts} +18 -1
- package/dist/pack-DXEOdHaM.d.mts.map +1 -0
- package/dist/{psl-build-BkxAXTwj.mjs → psl-build-BYqCjsqi.mjs} +4 -4
- package/dist/psl-build-BYqCjsqi.mjs.map +1 -0
- package/dist/{psl-build-O7_tXQ1E.d.mts → psl-build-C41KHJL_.d.mts} +4 -4
- package/dist/{psl-build-O7_tXQ1E.d.mts.map → psl-build-C41KHJL_.d.mts.map} +1 -1
- package/dist/{psl-field-resolution-BET6wtHZ-CX2xL99Q.mjs → psl-field-resolution-BET6wtHZ-C_hO6YE1.mjs} +3 -3
- package/dist/{psl-field-resolution-BET6wtHZ-CX2xL99Q.mjs.map → psl-field-resolution-BET6wtHZ-C_hO6YE1.mjs.map} +1 -1
- package/dist/{psl-infer-I75woGr4.d.mts → psl-infer-CALmBIqX.d.mts} +3 -3
- package/dist/{psl-infer-I75woGr4.d.mts.map → psl-infer-CALmBIqX.d.mts.map} +1 -1
- package/dist/{psl-infer-Bz34csvN.mjs → psl-infer-CaEnF_x3.mjs} +2 -2
- package/dist/{psl-infer-Bz34csvN.mjs.map → psl-infer-CaEnF_x3.mjs.map} +1 -1
- package/dist/relational-core.d.mts +2 -2
- package/dist/relational-core.mjs +2 -2
- package/dist/relational-core__ast.d.mts +2 -2
- package/dist/relational-core__ast.mjs +2 -2
- package/dist/runtime.d.mts +3 -3
- package/dist/runtime__internal__prepared-query.d.mts +1 -1
- package/dist/{schema-differ-DmP74bB8-CIQ17HTk.d.mts → schema-differ-DmP74bB8-BfEQ_9cY.d.mts} +3 -3
- package/dist/{schema-differ-DmP74bB8-CIQ17HTk.d.mts.map → schema-differ-DmP74bB8-BfEQ_9cY.d.mts.map} +1 -1
- package/dist/schema-ir.d.mts +1 -1
- package/dist/schema-ir.mjs +1 -1
- package/dist/schema-ir__types.d.mts +2 -2
- package/dist/schema-ir__types.mjs +1 -1
- package/dist/{schema-verify-BwRdzbHb-nDeE75xa.mjs → schema-verify-BwRdzbHb-BzdgK4xv.mjs} +2 -2
- package/dist/{schema-verify-BwRdzbHb-nDeE75xa.mjs.map → schema-verify-BwRdzbHb-BzdgK4xv.mjs.map} +1 -1
- package/dist/{sql-contract-serializer-sMY3prTx-BT6HdXAE.mjs → sql-contract-serializer-sMY3prTx-D-xfnqyD.mjs} +2 -2
- package/dist/{sql-contract-serializer-sMY3prTx-BT6HdXAE.mjs.map → sql-contract-serializer-sMY3prTx-D-xfnqyD.mjs.map} +1 -1
- package/dist/{sql-data-type-BSi0X331-OXbBFXDh.mjs → sql-data-type-D5cI3M07-DIcPP8s1.mjs} +26 -9
- package/dist/sql-data-type-D5cI3M07-DIcPP8s1.mjs.map +1 -0
- package/dist/{transaction-state-DR3nKTmH-DbyhuL-z.d.mts → transaction-state-DR3nKTmH-D_pb9QgR.d.mts} +2 -2
- package/dist/{transaction-state-DR3nKTmH-DbyhuL-z.d.mts.map → transaction-state-DR3nKTmH-D_pb9QgR.d.mts.map} +1 -1
- package/dist/types-D_nlUp-1.d.mts +1 -0
- package/dist/{types-B3AHHPDh-BHh-89fY.d.mts → types-DiD6BqoN-ZF53hwPp.d.mts} +11 -3
- package/dist/types-DiD6BqoN-ZF53hwPp.d.mts.map +1 -0
- package/dist/{types-DlFdMaDJ-DekbNgDh.d.mts → types-DlFdMaDJ-BEDwj-Qv.d.mts} +4 -4
- package/dist/{types-DlFdMaDJ-DekbNgDh.d.mts.map → types-DlFdMaDJ-BEDwj-Qv.d.mts.map} +1 -1
- package/dist/{types-egs_vme1-DRhYFwIT.mjs → types-DoyiTsjg-DDTmYyNY.mjs} +22 -2
- package/dist/types-DoyiTsjg-DDTmYyNY.mjs.map +1 -0
- package/dist/{validators-BCRydDG7.mjs → validators-BlONfdFH.mjs} +3 -3
- package/dist/{validators-BCRydDG7.mjs.map → validators-BlONfdFH.mjs.map} +1 -1
- package/package.json +18 -18
- package/dist/ast-CBO3PEJF.mjs.map +0 -1
- package/dist/ast-Cq7uhA86.d.mts.map +0 -1
- package/dist/control-B8tb6SEt.d.mts.map +0 -1
- package/dist/control-DNE-Chse.mjs.map +0 -1
- package/dist/data-type-C84xngfv.d.mts.map +0 -1
- package/dist/data-type-DKk8Unnz.mjs +0 -20
- package/dist/data-type-DKk8Unnz.mjs.map +0 -1
- package/dist/derived-checks-CdPHpJSv-B7Bgj3Ao.mjs.map +0 -1
- package/dist/generator-functions-B4gRRYZB-BTtC2KQz.mjs.map +0 -1
- package/dist/pack-COEyiyfL.d.mts.map +0 -1
- package/dist/psl-build-BkxAXTwj.mjs.map +0 -1
- package/dist/sql-data-type-BSi0X331-OXbBFXDh.mjs.map +0 -1
- package/dist/types-B3AHHPDh-BHh-89fY.d.mts.map +0 -1
- package/dist/types-BGERR8XF.d.mts +0 -1
- package/dist/types-egs_vme1-DRhYFwIT.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as ReportedSqlType } from "./types-
|
|
2
|
-
import "./types-
|
|
1
|
+
import { i as ReportedSqlType } from "./types-DiD6BqoN-ZF53hwPp.mjs";
|
|
2
|
+
import "./types-D_nlUp-1.mjs";
|
|
3
3
|
import { DataType, DataTypeId, DataTypeLookup, DataTypeSpec, TypeLookups } from "@prisma/orm-framework/components/codec";
|
|
4
4
|
import { Type } from "arktype";
|
|
5
5
|
//#region ../../../2-sql/1-core/contract/dist/data-type.d.mts
|
|
@@ -31,8 +31,15 @@ interface SqlDataTypeSpec<Params extends SqlTypeParams = SqlTypeParams> extends
|
|
|
31
31
|
/** The id of the type a column of this type is stored as, with the same parameters. A type stored as another declares no texts. */
|
|
32
32
|
readonly storedAs?: DataTypeId;
|
|
33
33
|
readonly normalize?: (params: Params) => Params;
|
|
34
|
+
/** The type's name from its parameters, for a type that claims a kind or whose name is its catalog text. */
|
|
34
35
|
readonly render?: (params: Params) => string;
|
|
35
36
|
readonly fromReported?: (reported: ReportedSqlType) => Params;
|
|
37
|
+
/**
|
|
38
|
+
* The name `render` writes is the text the database catalog prints, exactly. Such a type has no
|
|
39
|
+
* texts and claims no kind; it has no base name; verify compares its name with the reported text
|
|
40
|
+
* unchanged; and a target writes and sends it as given. ADR 273.
|
|
41
|
+
*/
|
|
42
|
+
readonly nameIsCatalogText?: true;
|
|
36
43
|
}
|
|
37
44
|
interface SqlDataTypeFacts<Params extends SqlTypeParams = SqlTypeParams> {
|
|
38
45
|
readonly texts: readonly SqlTypeText[];
|
|
@@ -42,6 +49,7 @@ interface SqlDataTypeFacts<Params extends SqlTypeParams = SqlTypeParams> {
|
|
|
42
49
|
readonly normalize: (params: Params) => Params;
|
|
43
50
|
readonly render: ((params: Params) => string) | undefined;
|
|
44
51
|
readonly fromReported: ((reported: ReportedSqlType) => Params) | undefined;
|
|
52
|
+
readonly nameIsCatalogText: boolean;
|
|
45
53
|
}
|
|
46
54
|
interface SqlDataType<Params extends SqlTypeParams = SqlTypeParams> extends DataType {
|
|
47
55
|
readonly params?: Type<Params>;
|
|
@@ -54,16 +62,23 @@ interface ResolvedSqlType {
|
|
|
54
62
|
}
|
|
55
63
|
/** Declare a SQL data type, refusing a declaration that breaks a rule of the module. */
|
|
56
64
|
declare function sqlDataType<Params extends SqlTypeParams = SqlTypeParams>(id: string, spec: SqlDataTypeSpec<Params>): SqlDataType<Params>;
|
|
65
|
+
/** Whether the name of `type` is the text the database catalog prints, as declared by {@link SqlDataTypeSpec.nameIsCatalogText}. */
|
|
66
|
+
declare function nameIsCatalogText<Params extends SqlTypeParams>(type: SqlDataType<Params>): boolean;
|
|
57
67
|
/** Whether `type` is a data type a SQL column can have. `sql/expression` is the one data type no column has. */
|
|
58
68
|
declare function isSqlDataType(type: DataType): type is SqlDataType;
|
|
59
69
|
/** The parameters, when `type` accepts them; otherwise `CONTRACT.TYPE_PARAMS_INVALID` naming each parameter it refuses. */
|
|
60
70
|
declare function validateSqlTypeParams<Params extends SqlTypeParams>(type: SqlDataType<Params>, params: SqlTypeParams): Params;
|
|
61
|
-
/**
|
|
71
|
+
/**
|
|
72
|
+
* The name of `type` with no parameters, for places where parameters must not appear, such as a
|
|
73
|
+
* cast. A type whose name is its catalog text has none: its parameters cannot be separated from its
|
|
74
|
+
* name, so it is refused.
|
|
75
|
+
*/
|
|
62
76
|
declare function sqlBaseName<Params extends SqlTypeParams>(type: SqlDataType<Params>, params: SqlTypeParams): string;
|
|
63
77
|
/**
|
|
64
|
-
* The base name of `type` with `params`, unquoted. It differs from {@link sqlBaseName}
|
|
65
|
-
* type that claims a kind
|
|
66
|
-
* `sqlBaseName` gives the quoted name `render` writes into SQL (`"app"."status"`)
|
|
78
|
+
* The base name of `type` with `params`, unquoted, for display. It differs from {@link sqlBaseName}
|
|
79
|
+
* for a type that claims a kind, where it is the `typeName` parameter as written (`app.status`)
|
|
80
|
+
* while `sqlBaseName` gives the quoted name `render` writes into SQL (`"app"."status"`), and for a
|
|
81
|
+
* type whose name is its catalog text, where it is that whole text.
|
|
67
82
|
*/
|
|
68
83
|
declare function unquotedSqlBaseName<Params extends SqlTypeParams>(type: SqlDataType<Params>, params: SqlTypeParams): string;
|
|
69
84
|
/** The SQL data type the codec `codecId` represents. */
|
|
@@ -122,5 +137,20 @@ declare function resolveReportedSqlType(reported: ReportedSqlType, dataTypes: re
|
|
|
122
137
|
*/
|
|
123
138
|
declare function resolveWrittenSqlTypes(text: string, dataTypes: readonly DataType[]): readonly ResolvedSqlType[];
|
|
124
139
|
//#endregion
|
|
125
|
-
|
|
126
|
-
|
|
140
|
+
//#region src/sql-raw.d.ts
|
|
141
|
+
declare const SQL_RAW_DATA_TYPE_ID: DataTypeId;
|
|
142
|
+
type SqlRawTypeParams = {
|
|
143
|
+
readonly sql: string;
|
|
144
|
+
};
|
|
145
|
+
/** Returns undefined when `text` may be written as a column's type, else the reason. */
|
|
146
|
+
declare function checkRawTypeText(text: string): string | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* The data type of a column whose type no other data type claims. Its `sql` parameter is the type
|
|
149
|
+
* exactly as the database catalog prints it, which migrations write and verify compares. It claims
|
|
150
|
+
* no reported type, so introspection never reads a column as raw. It has no literal values: it
|
|
151
|
+
* declares no casts, and its reader refuses every value. ADR 273.
|
|
152
|
+
*/
|
|
153
|
+
declare const sqlRawDataType: SqlDataType<SqlRawTypeParams>;
|
|
154
|
+
//#endregion
|
|
155
|
+
export { validateSqlTypeParams as A, sqlDataTypeOfCodec as C, sqlStorageTypeOfCodec as D, sqlStorageTypeId as E, unquotedSqlBaseName as O, sqlDataType as S, sqlStorageType as T, renderSqlTypeName as _, SqlDataTypeCollision as a, sameSqlColumnType as b, SqlRawTypeParams as c, checkRawTypeText as d, findSqlDataTypeCollision as f, renderSqlCatalogText as g, numeralText as h, SqlDataType as i, unquotedSqlBaseNameOfCodec as k, SqlTypeParams as l, nameIsCatalogText as m, SQL_RAW_DATA_TYPE_ID as n, SqlDataTypeFacts as o, isSqlDataType as p, SqlColumnTypeFields as r, SqlDataTypeSpec as s, ResolvedSqlType as t, SqlTypeText as u, resolveReportedSqlType as v, sqlRawDataType as w, sqlBaseName as x, resolveWrittenSqlTypes as y };
|
|
156
|
+
//# sourceMappingURL=data-type-DMk-fLAZ.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-type-DMk-fLAZ.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/data-type.d.mts"],"mappings":";;;;;;;;;;iBAQiB,YAAY;;;;UAInB;;WAEC;;WAEA;;WAEA;;WAEA;;KAEN,gBAAgB,SAAS;UACpB,gBAAgB,eAAe,gBAAgB,uBAAuB,KAAK;WAC1E,SAAS,KAAK;WACd,iBAAiB;;WAEjB;;WAEA,WAAW;WACX,aAAa,QAAQ,WAAW;;WAEhC,UAAU,QAAQ;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B;;;cAGlF,sBAAsB;KAC/B;WACM;;;iBAGM,iBAAiB;;;;;;;cAOpB,gBAAgB,YAAY"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { u as sqlDataType } from "./sql-data-type-D5cI3M07-DIcPP8s1.mjs";
|
|
2
|
+
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
3
|
+
import { dataTypeId } from "@prisma/orm-framework/components/codec";
|
|
4
|
+
import { type } from "arktype";
|
|
5
|
+
//#region ../../../2-sql/1-core/contract/dist/data-type.mjs
|
|
6
|
+
/**
|
|
7
|
+
* A number as a contract source writes it: no exponent, because no schema language has that syntax,
|
|
8
|
+
* so the decimal point moves to where the exponent puts it. A non-finite number is its own word.
|
|
9
|
+
*/
|
|
10
|
+
function numeralText(value) {
|
|
11
|
+
const [coefficient = "", exponent] = String(value).split("e");
|
|
12
|
+
if (exponent === void 0) return coefficient;
|
|
13
|
+
const sign = coefficient.startsWith("-") ? "-" : "";
|
|
14
|
+
const [whole = "", fraction = ""] = coefficient.slice(sign.length).split(".");
|
|
15
|
+
const digits = `${whole}${fraction}`;
|
|
16
|
+
const point = whole.length + Number(exponent);
|
|
17
|
+
if (point <= 0) return `${sign}0.${"0".repeat(-point)}${digits}`;
|
|
18
|
+
if (point >= digits.length) return `${sign}${digits}${"0".repeat(point - digits.length)}`;
|
|
19
|
+
return `${sign}${digits.slice(0, point)}.${digits.slice(point)}`;
|
|
20
|
+
}
|
|
21
|
+
const SQL_RAW_DATA_TYPE_ID = dataTypeId("sql/raw");
|
|
22
|
+
const NAME = `(?:[A-Za-z0-9_]+|"(?:[^"]|"")+")`;
|
|
23
|
+
const TOKEN = `${NAME}(?:\\((?:[A-Za-z0-9_, ]|-(?=[0-9]))*\\))?`;
|
|
24
|
+
/**
|
|
25
|
+
* The texts a raw type may be: words and double-quoted names, with each double quote inside doubled, separated by single spaces, the first
|
|
26
|
+
* optionally after one schema name and a dot, each optionally followed by parentheses holding only
|
|
27
|
+
* letters, digits, underscores, commas, spaces and a minus sign before a digit, then at most one
|
|
28
|
+
* `[]`. Postgres prints a schema only for a type off the `search_path` that is not a base type.
|
|
29
|
+
*/
|
|
30
|
+
const RAW_TYPE_TEXT = new RegExp(`^(?:${NAME}\\.)?${TOKEN}(?: ${TOKEN})*(?:\\[\\])?$`);
|
|
31
|
+
/** Returns undefined when `text` may be written as a column's type, else the reason. */
|
|
32
|
+
function checkRawTypeText(text) {
|
|
33
|
+
return RAW_TYPE_TEXT.test(text) ? void 0 : "A raw type is one type name as the database catalog prints it, such as tsvector, double precision, geometry(Point,4326), app.email or \"MyType\"[]: words of letters, digits and underscores separated by single spaces, or double-quoted names with each double quote inside doubled; the first optionally after one schema name and a dot; each optionally followed by parentheses holding only letters, digits, underscores, commas, spaces and a minus sign before a digit; and at most one trailing [].";
|
|
34
|
+
}
|
|
35
|
+
const sqlRawParams = type({ sql: "string" }).narrow((params, ctx) => {
|
|
36
|
+
const refused = checkRawTypeText(params.sql);
|
|
37
|
+
return refused === void 0 || ctx.reject({
|
|
38
|
+
path: ["sql"],
|
|
39
|
+
message: refused
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
/**
|
|
43
|
+
* The refusal of a literal value of a raw column, which has none: Prisma does not interpret a raw
|
|
44
|
+
* column's values. Every literal reaches it through the data type's reader.
|
|
45
|
+
*/
|
|
46
|
+
function refuseLiteralValue() {
|
|
47
|
+
throw structuredError("CONTRACT.LITERAL_VALUES_ABSENT", "A raw column has no literal values, so its default cannot be a literal. Write the default as a SQL expression: sql`...`.", {
|
|
48
|
+
why: "Prisma does not interpret the values of a raw column, so it cannot write or compare a literal of its type.",
|
|
49
|
+
fix: "Write the default as a sql expression, such as @default(sql`...`) in a schema or .default(sql`...`) in TypeScript."
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The data type of a column whose type no other data type claims. Its `sql` parameter is the type
|
|
54
|
+
* exactly as the database catalog prints it, which migrations write and verify compares. It claims
|
|
55
|
+
* no reported type, so introspection never reads a column as raw. It has no literal values: it
|
|
56
|
+
* declares no casts, and its reader refuses every value. ADR 273.
|
|
57
|
+
*/
|
|
58
|
+
const sqlRawDataType = sqlDataType(SQL_RAW_DATA_TYPE_ID, {
|
|
59
|
+
params: sqlRawParams,
|
|
60
|
+
nameIsCatalogText: true,
|
|
61
|
+
render: ({ sql }) => sql,
|
|
62
|
+
read: refuseLiteralValue
|
|
63
|
+
});
|
|
64
|
+
//#endregion
|
|
65
|
+
export { sqlRawDataType as i, checkRawTypeText as n, numeralText as r, SQL_RAW_DATA_TYPE_ID as t };
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=data-type-HNhSslwG.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-type-HNhSslwG.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/data-type.mjs"],"sourcesContent":["import { _ as validateSqlTypeParams, a as renderSqlTypeName, c as sameSqlColumnType, d as sqlDataTypeOfCodec, f as sqlStorageType, g as unquotedSqlBaseNameOfCodec, h as unquotedSqlBaseName, i as renderSqlCatalogText, l as sqlBaseName, m as sqlStorageTypeOfCodec, n as isSqlDataType, o as resolveReportedSqlType, p as sqlStorageTypeId, r as nameIsCatalogText, s as resolveWrittenSqlTypes, t as findSqlDataTypeCollision, u as sqlDataType } from \"./sql-data-type-D5cI3M07.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { dataTypeId } from \"@internal/framework-components/codec\";\nimport { type } from \"arktype\";\n//#region src/numeral-text.ts\n/**\n* A number as a contract source writes it: no exponent, because no schema language has that syntax,\n* so the decimal point moves to where the exponent puts it. A non-finite number is its own word.\n*/\nfunction numeralText(value) {\n\tconst [coefficient = \"\", exponent] = String(value).split(\"e\");\n\tif (exponent === void 0) return coefficient;\n\tconst sign = coefficient.startsWith(\"-\") ? \"-\" : \"\";\n\tconst [whole = \"\", fraction = \"\"] = coefficient.slice(sign.length).split(\".\");\n\tconst digits = `${whole}${fraction}`;\n\tconst point = whole.length + Number(exponent);\n\tif (point <= 0) return `${sign}0.${\"0\".repeat(-point)}${digits}`;\n\tif (point >= digits.length) return `${sign}${digits}${\"0\".repeat(point - digits.length)}`;\n\treturn `${sign}${digits.slice(0, point)}.${digits.slice(point)}`;\n}\n//#endregion\n//#region src/sql-raw.ts\nconst SQL_RAW_DATA_TYPE_ID = dataTypeId(\"sql/raw\");\nconst NAME = `(?:[A-Za-z0-9_]+|\"(?:[^\"]|\"\")+\")`;\nconst TOKEN = `${NAME}(?:\\\\((?:[A-Za-z0-9_, ]|-(?=[0-9]))*\\\\))?`;\n/**\n* The texts a raw type may be: words and double-quoted names, with each double quote inside doubled, separated by single spaces, the first\n* optionally after one schema name and a dot, each optionally followed by parentheses holding only\n* letters, digits, underscores, commas, spaces and a minus sign before a digit, then at most one\n* `[]`. Postgres prints a schema only for a type off the `search_path` that is not a base type.\n*/\nconst RAW_TYPE_TEXT = new RegExp(`^(?:${NAME}\\\\.)?${TOKEN}(?: ${TOKEN})*(?:\\\\[\\\\])?$`);\n/** Returns undefined when `text` may be written as a column's type, else the reason. */\nfunction checkRawTypeText(text) {\n\treturn RAW_TYPE_TEXT.test(text) ? void 0 : \"A raw type is one type name as the database catalog prints it, such as tsvector, double precision, geometry(Point,4326), app.email or \\\"MyType\\\"[]: words of letters, digits and underscores separated by single spaces, or double-quoted names with each double quote inside doubled; the first optionally after one schema name and a dot; each optionally followed by parentheses holding only letters, digits, underscores, commas, spaces and a minus sign before a digit; and at most one trailing [].\";\n}\nconst sqlRawParams = type({ sql: \"string\" }).narrow((params, ctx) => {\n\tconst refused = checkRawTypeText(params.sql);\n\treturn refused === void 0 || ctx.reject({\n\t\tpath: [\"sql\"],\n\t\tmessage: refused\n\t});\n});\n/**\n* The refusal of a literal value of a raw column, which has none: Prisma does not interpret a raw\n* column's values. Every literal reaches it through the data type's reader.\n*/\nfunction refuseLiteralValue() {\n\tthrow structuredError(\"CONTRACT.LITERAL_VALUES_ABSENT\", \"A raw column has no literal values, so its default cannot be a literal. Write the default as a SQL expression: sql`...`.\", {\n\t\twhy: \"Prisma does not interpret the values of a raw column, so it cannot write or compare a literal of its type.\",\n\t\tfix: \"Write the default as a sql expression, such as @default(sql`...`) in a schema or .default(sql`...`) in TypeScript.\"\n\t});\n}\n/**\n* The data type of a column whose type no other data type claims. Its `sql` parameter is the type\n* exactly as the database catalog prints it, which migrations write and verify compares. It claims\n* no reported type, so introspection never reads a column as raw. It has no literal values: it\n* declares no casts, and its reader refuses every value. ADR 273.\n*/\nconst sqlRawDataType = sqlDataType(SQL_RAW_DATA_TYPE_ID, {\n\tparams: sqlRawParams,\n\tnameIsCatalogText: true,\n\trender: ({ sql }) => sql,\n\tread: refuseLiteralValue\n});\n//#endregion\nexport { SQL_RAW_DATA_TYPE_ID, checkRawTypeText, findSqlDataTypeCollision, isSqlDataType, nameIsCatalogText, numeralText, renderSqlCatalogText, renderSqlTypeName, resolveReportedSqlType, resolveWrittenSqlTypes, sameSqlColumnType, sqlBaseName, sqlDataType, sqlDataTypeOfCodec, sqlRawDataType, sqlStorageType, sqlStorageTypeId, sqlStorageTypeOfCodec, unquotedSqlBaseName, unquotedSqlBaseNameOfCodec, validateSqlTypeParams };\n\n//# sourceMappingURL=data-type.mjs.map"],"mappings":";;;;;;;;;AASA,SAAS,YAAY,OAAO;CAC3B,MAAM,CAAC,cAAc,IAAI,YAAY,OAAO,KAAK,CAAC,CAAC,MAAM,GAAG;CAC5D,IAAI,aAAa,KAAK,GAAG,OAAO;CAChC,MAAM,OAAO,YAAY,WAAW,GAAG,IAAI,MAAM;CACjD,MAAM,CAAC,QAAQ,IAAI,WAAW,MAAM,YAAY,MAAM,KAAK,MAAM,CAAC,CAAC,MAAM,GAAG;CAC5E,MAAM,SAAS,GAAG,QAAQ;CAC1B,MAAM,QAAQ,MAAM,SAAS,OAAO,QAAQ;CAC5C,IAAI,SAAS,GAAG,OAAO,GAAG,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,IAAI;CACxD,IAAI,SAAS,OAAO,QAAQ,OAAO,GAAG,OAAO,SAAS,IAAI,OAAO,QAAQ,OAAO,MAAM;CACtF,OAAO,GAAG,OAAO,OAAO,MAAM,GAAG,KAAK,EAAE,GAAG,OAAO,MAAM,KAAK;AAC9D;AAGA,MAAM,uBAAuB,WAAW,SAAS;AACjD,MAAM,OAAO;AACb,MAAM,QAAQ,GAAG,KAAK;;;;;;;AAOtB,MAAM,gBAAgB,IAAI,OAAO,OAAO,KAAK,OAAO,MAAM,MAAM,MAAM,eAAe;;AAErF,SAAS,iBAAiB,MAAM;CAC/B,OAAO,cAAc,KAAK,IAAI,IAAI,KAAK,IAAI;AAC5C;AACA,MAAM,eAAe,KAAK,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,QAAQ,QAAQ;CACpE,MAAM,UAAU,iBAAiB,OAAO,GAAG;CAC3C,OAAO,YAAY,KAAK,KAAK,IAAI,OAAO;EACvC,MAAM,CAAC,KAAK;EACZ,SAAS;CACV,CAAC;AACF,CAAC;;;;;AAKD,SAAS,qBAAqB;CAC7B,MAAM,gBAAgB,kCAAkC,4HAA4H;EACnL,KAAK;EACL,KAAK;CACN,CAAC;AACF;;;;;;;AAOA,MAAM,iBAAiB,YAAY,sBAAsB;CACxD,QAAQ;CACR,mBAAmB;CACnB,SAAS,EAAE,UAAU;CACrB,MAAM;AACP,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { n as SqlQueryPlan } from "./plan-Cbed2eDu-3c5s1Aq5.mjs";
|
|
|
6
6
|
import { C as TraitExpression, S as StorageColumnScopeField, c as RawAffectedCountQuery, f as RawRowQuery, g as RawSqlInterpolation, h as RawSqlBuilder, i as CodecTypesBase, o as Expression, s as NoReservedRowColumn, x as ScopeField } from "./expression-BzrfOiPC-CXjjRKqc.mjs";
|
|
7
7
|
import "./expression-CIBqCwC1.mjs";
|
|
8
8
|
import { a as Subquery, r as Functions, t as BooleanCodecType } from "./functions-LyIMc_v9.mjs";
|
|
9
|
-
import { c as LockOptionCapabilities, l as LockStrengthCapabilities, u as LockWaitOptions } from "./ast-
|
|
9
|
+
import { c as LockOptionCapabilities, l as LockStrengthCapabilities, u as LockWaitOptions } from "./ast-DB7g9Mh2.mjs";
|
|
10
10
|
import { r as TableIndexReferences } from "./index-reference-DJaQLZA3-DS-GPKXs.mjs";
|
|
11
11
|
import "./index-reference-CsxaNof9.mjs";
|
|
12
12
|
import "./plan-BOyVvttx.mjs";
|
|
@@ -531,4 +531,4 @@ type Namespace<C extends TableProxyContract, NsId extends string & keyof C['stor
|
|
|
531
531
|
type Db<C extends TableProxyContract> = { readonly [Ns in keyof C['storage']['namespaces'] & string]: Namespace<C, Ns>; };
|
|
532
532
|
//#endregion
|
|
533
533
|
export { WhereFilter as C, UpdateQuery as S, TableInAnyNamespace as _, FieldProxy as a, TableProxyContract as b, IndexReferences as c, QueryContext as d, RawLane as f, SelectQuery as g, Scope as h, DeleteQuery as i, InsertQuery as l, ResolveRow as m, ContractRawTag as n, GatedMethod as o, RawTagFor as p, Db as r, GroupedQuery as s, AggregateFunctions as t, Namespace as u, TableNamesAcrossNamespaces as v, UnboundTables as x, TableProxy as y };
|
|
534
|
-
//# sourceMappingURL=db-BmrN9nRS-
|
|
534
|
+
//# sourceMappingURL=db-BmrN9nRS-BGnRxI7X.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-BmrN9nRS-BzK96yVh.d.mts","names":[],"sources":["../../../../2-sql/4-lanes/sql-builder/dist/db-BmrN9nRS.d.mts"],"mappings":";;;;;;;;;;;;;;;KAQK,YAAY,cAAc,UAAU,UAAU,qBAAqB,WAAW;cACrE;KACT,OAAO,QAAQ,WAAW,IAAI,EAAE;KAChC,WAAW,cAAc;KACzB,aAAa,eAAe;KAC5B;EACH,UAAU;EACV,YAAY,eAAe;;KAExB,WAAW,YAAY,YAAY;YAC5B;IACR,UAAU;IACV,YAAY,OAAO,OAAO;;EAE5B,qBAAqB;EACrB,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AAU,UAAU,oBAAoB,4BAA4B,0CAA0C,cAAc,kBAAkB,2BAA2B,kBAAkB,WAAW,GAAG,MAAM;;;;;;;;;KAS/M,GAAG,UAAU,kCAAkC,YAAY,sCAAsC,UAAU,GAAG"}
|
|
@@ -3,14 +3,14 @@ import { i as computeCheckContentHash, r as composeCheckWirePrefix, s as derived
|
|
|
3
3
|
import { r as lowerAuthoredIndex } from "./index-naming-BOcJT1B3-18gQUduD.mjs";
|
|
4
4
|
import { t as lowerAuthoredCheck } from "./authored-check-naming-CIX7Bbyh.mjs";
|
|
5
5
|
import { t as sqlContractCanonicalizationHooks } from "./canonicalization-hooks-dmXkOR4a.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { _ as validateSqlTypeParams, d as sqlDataTypeOfCodec } from "./sql-data-type-D5cI3M07-DIcPP8s1.mjs";
|
|
7
7
|
import { c as StorageTable, i as Index, t as CheckConstraint } from "./storage-table-DN36E2yE-0ncS821l.mjs";
|
|
8
8
|
import { n as checkConstraintInputFromSerialized } from "./serialized-index-52COq1yV-CUJ2F65u.mjs";
|
|
9
9
|
import { m as valueSetEntityKind, p as tableEntityKind } from "./entity-kinds-CQ_jwgYv-DoOBWwvX.mjs";
|
|
10
|
-
import { a as materializeForeignKeysAndIndexes } from "./foreign-key-materialization-
|
|
10
|
+
import { a as materializeForeignKeysAndIndexes } from "./foreign-key-materialization-BPQqd0qF.mjs";
|
|
11
11
|
import { t as validateIndexTypes } from "./index-type-validation-Bcme_Ust.mjs";
|
|
12
12
|
import { c as isMaterializedSqlNamespace, d as resolvedTypeParams, f as toStorageTypeInstance, o as SqlStorage, s as applyFkDefaults } from "./types-M_FeBD9w.mjs";
|
|
13
|
-
import { h as validateStorageSemantics } from "./validators-
|
|
13
|
+
import { h as validateStorageSemantics } from "./validators-BlONfdFH.mjs";
|
|
14
14
|
import { t as deriveValueSetFromEntity } from "./value-set-derivation-hook-Di9JZ0X7.mjs";
|
|
15
15
|
import { isStructuredError, structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
16
16
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
@@ -26,7 +26,7 @@ import { encodeEnumTypeMembers, resolveToOneRelationNullable } from "@prisma/orm
|
|
|
26
26
|
import { buildExecutionSection, computeProfileHash, computeStorageHash } from "@prisma/orm-framework/contract/hashing";
|
|
27
27
|
import { invariant } from "@prisma/orm-framework/utils/assertions";
|
|
28
28
|
import { applySpecifierDefaultControlPolicy } from "@prisma/orm-framework/contract/apply-specifier-default-control-policy";
|
|
29
|
-
//#region ../../../2-sql/2-authoring/contract-ts/dist/derived-checks-
|
|
29
|
+
//#region ../../../2-sql/2-authoring/contract-ts/dist/derived-checks-B1qNxwBL.mjs
|
|
30
30
|
function contractError(code, message, options) {
|
|
31
31
|
return structuredError(code, message, options);
|
|
32
32
|
}
|
|
@@ -592,11 +592,23 @@ function defaultRefusal(site, cause, elementPosition) {
|
|
|
592
592
|
}
|
|
593
593
|
});
|
|
594
594
|
}
|
|
595
|
+
/** The refusal of a literal default by a data type that has no literal values, such as a raw column's. */
|
|
596
|
+
function noLiteralValuesRefusal(site, cause) {
|
|
597
|
+
return contractError("CONTRACT.DEFAULT_INVALID", `${columnSiteSubject(site)} has a literal default. ${cause.message}`, {
|
|
598
|
+
cause,
|
|
599
|
+
meta: {
|
|
600
|
+
...columnSiteMeta(site),
|
|
601
|
+
codecId: site.codecId,
|
|
602
|
+
reason: "no-literal-values"
|
|
603
|
+
}
|
|
604
|
+
});
|
|
605
|
+
}
|
|
595
606
|
function encodeDefaultValue(value, codec, site, elementPosition) {
|
|
596
607
|
try {
|
|
597
608
|
return encodeViaCodec(value, codec);
|
|
598
609
|
} catch (cause) {
|
|
599
610
|
if (cause instanceof InternalError) throw cause;
|
|
611
|
+
if (isStructuredError(cause) && cause.code === "CONTRACT.LITERAL_VALUES_ABSENT") throw noLiteralValuesRefusal(site, cause);
|
|
600
612
|
throw defaultRefusal(site, cause, elementPosition);
|
|
601
613
|
}
|
|
602
614
|
}
|
|
@@ -1489,4 +1501,4 @@ function withoutDerivedChecks(tableName, table, contractDefault) {
|
|
|
1489
1501
|
//#endregion
|
|
1490
1502
|
export { storedAsListColumn as a, isValueObjectMember as i, buildSqlContractFromDefinition as n, toOneNullabilityContradictionMessage as o, contractError as r, applySqlSpecifierControlPolicy as t };
|
|
1491
1503
|
|
|
1492
|
-
//# sourceMappingURL=derived-checks-
|
|
1504
|
+
//# sourceMappingURL=derived-checks-B1qNxwBL-DFoGexId.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derived-checks-B1qNxwBL-DFoGexId.mjs","names":[],"sources":["../../../../2-sql/2-authoring/contract-ts/dist/derived-checks-B1qNxwBL.mjs"],"sourcesContent":["import { encodeEnumTypeMembers, resolveToOneRelationNullable } from \"@internal/contract-authoring\";\nimport { flushAuthoringWarnings, isAuthoringEntityTypeDescriptor } from \"@internal/framework-components/authoring\";\nimport { mergeCapabilityMatrices } from \"@internal/framework-components/components\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { CheckConstraint, Index, SqlStorage, StorageTable, applyFkDefaults, checkConstraintInputFromSerialized, isMaterializedSqlNamespace, resolvedTypeParams, toStorageTypeInstance } from \"@internal/sql-contract/types\";\nimport { isStructuredError, structuredError } from \"@internal/utils/structured-error\";\nimport { asNamespaceId, coreHash, crossRef, effectiveControlPolicy } from \"@internal/contract/types\";\nimport { validateStorageSemantics } from \"@internal/sql-contract/validators\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { buildExecutionSection, computeProfileHash, computeStorageHash } from \"@internal/contract/hashing\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { sqlContractCanonicalizationHooks } from \"@internal/sql-contract/canonicalization-hooks\";\nimport { sqlDataTypeOfCodec, validateSqlTypeParams } from \"@internal/sql-contract/data-type\";\nimport { validateIndexTypes } from \"@internal/sql-contract/index-type-validation\";\nimport { indexTypeRegistryOf } from \"@internal/sql-contract/index-types\";\nimport { invariant } from \"@internal/utils/assertions\";\nimport { compareCodeUnits } from \"@internal/contract/hashing-utils\";\nimport { lowerAuthoredCheck } from \"@internal/sql-contract/authored-check-naming\";\nimport { materializeForeignKeysAndIndexes } from \"@internal/sql-contract/foreign-key-materialization\";\nimport { lowerAuthoredIndex } from \"@internal/sql-contract/index-naming\";\nimport { composeCheckWirePrefix, computeCheckContentHash, derivedCheckPrefixes } from \"@internal/sql-schema-ir/naming\";\nimport { codecForRef, dataTypeParams } from \"@internal/framework-components/codec\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { tableEntityKind, valueSetEntityKind } from \"@internal/sql-contract/entity-kinds\";\nimport { deriveValueSetFromEntity } from \"@internal/sql-contract/value-set-derivation-hook\";\nimport { applySpecifierDefaultControlPolicy } from \"@internal/contract/apply-specifier-default-control-policy\";\n//#region src/contract-errors.ts\nfunction contractError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/contract-definition.ts\n/**\n* Whether a field is stored in a list column. A list of scalars is; a list of value objects is not, because it is stored in one column whose value is the whole list, as one JSON array.\n*/\nfunction storedAsListColumn(field) {\n\treturn field.list && !field.typedByValueObject;\n}\n/** Whether a field or member is typed by a value object. */\nfunction isValueObjectMember(field) {\n\treturn \"valueObjectName\" in field;\n}\n//#endregion\n//#region src/describe-column.ts\n/** Describes one column, declared by a model's field or by a table node. */\nfunction describeColumn(column, site) {\n\treturn {\n\t\tcolumnName: column.columnName,\n\t\tdescriptor: column.descriptor,\n\t\tnullable: column.nullable,\n\t\tmany: column.many === true ? { elementNullable: column.elementNullable === true } : false,\n\t\tdefault: column.default,\n\t\tenumTypeHandle: column.enumTypeHandle,\n\t\tsite\n\t};\n}\n//#endregion\n//#region src/enum-members.ts\n/**\n* The member values a membership check must enforce, encoded exactly as the\n* column stores them. Membership predicates support strings and finite numbers.\n*/\nfunction checkMemberValues(handle, codecLookup) {\n\tconst encoded = encodeEnumTypeMembers(handle, codecLookup, \"the column\").map((member) => member.value);\n\tconst values = [];\n\tfor (const value of encoded) {\n\t\tif (typeof value !== \"string\" && !(typeof value === \"number\" && Number.isFinite(value))) throw contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${handle.enumName}\"): CHECK constraint members must encode to strings or finite numbers.`, { meta: {\n\t\t\tenumName: handle.enumName,\n\t\t\treason: \"unsupported-member-value\"\n\t\t} });\n\t\tvalues.push(value);\n\t}\n\treturn values;\n}\n/**\n* The refs of a field typed by an authored enum: the domain enum and its storage value set. Authored enums are registered in the default namespace, whatever namespace the field's model is in.\n*/\nfunction enumValueSetRefs(enumHandle, defaultNamespaceId) {\n\tif (enumHandle === void 0) return void 0;\n\tconst common = {\n\t\tnamespaceId: defaultNamespaceId,\n\t\tentityName: enumHandle.enumName\n\t};\n\treturn {\n\t\tdomain: {\n\t\t\tplane: \"domain\",\n\t\t\tentityKind: \"enum\",\n\t\t\t...common\n\t\t},\n\t\tstorage: {\n\t\t\tplane: \"storage\",\n\t\t\tentityKind: \"valueSet\",\n\t\t\t...common\n\t\t}\n\t};\n}\n//#endregion\n//#region src/domain-fields.ts\nfunction buildDomainField(field, defaultNamespaceId, storageTypes) {\n\tif (isValueObjectMember(field)) return {\n\t\ttype: {\n\t\t\tkind: \"valueObject\",\n\t\t\tname: field.valueObjectName\n\t\t},\n\t\tnullable: field.nullable,\n\t\tmany: field.many ? { elementNullable: field.elementNullable === true } : false\n\t};\n\treturn {\n\t\ttype: {\n\t\t\tkind: \"scalar\",\n\t\t\tcodecId: field.descriptor.codecId,\n\t\t\t...ifDefined(\"typeParams\", resolvedTypeParams(field.descriptor, storageTypes))\n\t\t},\n\t\tnullable: field.nullable,\n\t\tmany: field.many ? { elementNullable: field.elementNullable === true } : false,\n\t\t...ifDefined(\"valueSet\", enumValueSetRefs(field.enumTypeHandle, defaultNamespaceId)?.domain)\n\t};\n}\n//#endregion\n//#region src/declaration-sites.ts\n/** How an error message names the column: `Field \"Model.field\"` or `Column \"table.column\"`. */\nfunction columnSiteSubject(site) {\n\treturn site.kind === \"field\" ? `Field \"${site.modelName}.${site.fieldName}\"` : `Column \"${site.tableName}.${site.columnName}\"`;\n}\n/** The error metadata that locates the column. */\nfunction columnSiteMeta(site) {\n\treturn site.kind === \"field\" ? {\n\t\tmodelName: site.modelName,\n\t\tfieldName: site.fieldName\n\t} : {\n\t\tnamespaceId: site.namespaceId,\n\t\ttableName: site.tableName,\n\t\tcolumnName: site.columnName\n\t};\n}\n/** How an error message names the owner: `model \"User\"` or `table \"audit_rows\" in namespace \"public\"`. */\nfunction referenceOwnerSubject(owner) {\n\treturn owner.kind === \"model\" ? `model \"${owner.modelName}\"` : `table \"${owner.tableName}\" in namespace \"${owner.namespaceId}\"`;\n}\n/** The error metadata that locates the owner. */\nfunction referenceOwnerMeta(owner) {\n\treturn owner.kind === \"model\" ? { sourceModel: owner.modelName } : {\n\t\tsourceTable: owner.tableName,\n\t\tsourceNamespaceId: owner.namespaceId\n\t};\n}\n//#endregion\n//#region src/namespace-id.ts\n/** A declared namespace coordinate, where an omitted or empty one means the target's default namespace. */\nfunction namespaceIdOrDefault(namespaceId, defaultNamespaceId) {\n\treturn namespaceId !== void 0 && namespaceId.length > 0 ? namespaceId : defaultNamespaceId;\n}\n//#endregion\n//#region src/model-references.ts\nfunction assertKnownTargetModel(modelsByName, modelsByCoordinate, owner, targetModelName, targetNamespaceId, context) {\n\tconst targetModel = targetNamespaceId !== void 0 && targetNamespaceId.length > 0 ? modelsByCoordinate.get(`${targetNamespaceId}:${targetModelName}`) : modelsByName.get(targetModelName);\n\tif (!targetModel) {\n\t\tconst qualified = targetNamespaceId !== void 0 && targetNamespaceId.length > 0 ? `${targetNamespaceId}.${targetModelName}` : targetModelName;\n\t\tthrow contractError(\"CONTRACT.MODEL_UNKNOWN\", `${context} on ${referenceOwnerSubject(owner)} references unknown model \"${qualified}\"`, { meta: {\n\t\t\t...referenceOwnerMeta(owner),\n\t\t\ttargetModel: qualified,\n\t\t\tcontext\n\t\t} });\n\t}\n\treturn targetModel;\n}\nfunction assertTargetTableMatches(owner, targetModel, referencedTableName, context) {\n\tif (targetModel.tableName !== referencedTableName) throw contractError(\"CONTRACT.TABLE_MISMATCH\", `${context} on ${referenceOwnerSubject(owner)} references table \"${referencedTableName}\" but model \"${targetModel.modelName}\" maps to \"${targetModel.tableName}\"`, { meta: {\n\t\t...referenceOwnerMeta(owner),\n\t\treferencedTable: referencedTableName,\n\t\tmappedTable: targetModel.tableName,\n\t\tcontext\n\t} });\n}\nfunction modelNamespaceId(model, defaultNamespaceId) {\n\treturn namespaceIdOrDefault(model.namespaceId, defaultNamespaceId);\n}\nfunction modelLookupsOf(definition) {\n\tconst defaultNamespaceId = definition.target.defaultNamespaceId;\n\tconst { models } = definition;\n\treturn {\n\t\tdefaultNamespaceId,\n\t\tmodelsByName: new Map(models.map((m) => [m.modelName, m])),\n\t\tmodelsByCoordinate: new Map(models.map((m) => [`${modelNamespaceId(m, defaultNamespaceId)}:${m.modelName}`, m])),\n\t\ttableNamespaceByName: new Map(models.map((m) => [m.tableName, modelNamespaceId(m, defaultNamespaceId)]))\n\t};\n}\n//#endregion\n//#region src/to-one-nullability-message.ts\nfunction toOneNullabilityContradictionMessage(location, contradiction) {\n\treturn contradiction === \"declared-optional\" ? `${location} is optional but every local field it joins on is required` : `${location} is required but a local field it joins on is nullable`;\n}\n//#endregion\n//#region src/model-relations.ts\nfunction toOneRelationNullable(semanticModel, relation) {\n\tconst location = `Relation \"${semanticModel.modelName}.${relation.fieldName}\"`;\n\tif (relation.nullable === void 0) throw contractError(\"CONTRACT.RELATION_INVALID\", `${location} with cardinality \"${relation.cardinality}\" must state whether it is nullable`, { meta: {\n\t\tmodelName: semanticModel.modelName,\n\t\trelationName: relation.fieldName,\n\t\treason: \"to-one-nullability-missing\"\n\t} });\n\tconst localColumns = relation.on.parentColumns;\n\tconst { contradiction } = resolveToOneRelationNullable({\n\t\tdeclaredNullable: relation.nullable,\n\t\tlocalFieldNullability: semanticModel.fields.filter((field) => localColumns.includes(field.columnName)).map((field) => field.nullable),\n\t\townsReference: relation.cardinality === \"N:1\"\n\t});\n\tif (contradiction !== void 0) throw contractError(\"CONTRACT.RELATION_INVALID\", relation.cardinality === \"N:1\" ? toOneNullabilityContradictionMessage(location, contradiction) : `${location} is required but does not own the foreign key, so nothing in storage guarantees the related row exists`, { meta: {\n\t\tmodelName: semanticModel.modelName,\n\t\trelationName: relation.fieldName,\n\t\treason: \"to-one-nullability-mismatch\"\n\t} });\n\treturn relation.nullable;\n}\nfunction buildThroughDescriptor(through, tableNamespaceByName, targetModel, modelName, fieldName, defaultNamespaceId) {\n\tif (!tableNamespaceByName.has(through.table)) throw contractError(\"CONTRACT.MODEL_UNKNOWN\", `buildSqlContractFromDefinition: junction table \"${through.table}\" for relation \"${modelName}.${fieldName}\" is not a declared model.`, { meta: {\n\t\tsourceModel: modelName,\n\t\trelationName: fieldName,\n\t\tjunctionTable: through.table\n\t} });\n\tconst namespaceId = through.namespaceId ?? defaultNamespaceId;\n\treturn {\n\t\ttable: through.table,\n\t\tnamespaceId,\n\t\tparentColumns: through.parentColumns,\n\t\tchildColumns: through.childColumns,\n\t\ttargetColumns: targetColumnsForJunction(targetModel, fieldName)\n\t};\n}\nfunction targetColumnsForJunction(targetModel, fieldName) {\n\tconst primaryKeyColumns = targetModel.id?.columns;\n\tif (primaryKeyColumns && primaryKeyColumns.length > 0) return primaryKeyColumns;\n\tconst firstUnique = targetModel.uniques?.find((u) => u.columns.length > 0);\n\tif (firstUnique) return firstUnique.columns;\n\tthrow contractError(\"CONTRACT.IDENTITY_INVALID\", `M:N target model \"${targetModel.modelName}\" (relation field \"${fieldName}\") has no primary id or unique key to derive junction targetColumns.`, { meta: {\n\t\tmodelName: targetModel.modelName,\n\t\treason: \"no-key-for-junction-target-columns\"\n\t} });\n}\n/** The field of `model` that maps a relation's join column. A relation joins on fields, so a column no field maps is refused. */\nfunction joinFieldOf(owner, relation, model, columnToField, column) {\n\tconst field = columnToField.get(column);\n\tif (field !== void 0) return field;\n\tthrow contractError(\"CONTRACT.RELATION_INVALID\", `Relation \"${owner.modelName}.${relation.fieldName}\" joins on column \"${column}\" of table \"${model.tableName}\", which no field of model \"${model.modelName}\" maps. A relation joins on fields; declare a field for the column.`, { meta: {\n\t\tmodelName: owner.modelName,\n\t\trelationName: relation.fieldName,\n\t\tcolumn,\n\t\treason: \"join-column-not-a-field\"\n\t} });\n}\n/** Lowers a model's relations. `columnToField` maps the model's columns to the fields that hold them. */\nfunction lowerRelations(semanticModel, columnToField, lookups) {\n\tconst { defaultNamespaceId } = lookups;\n\tconst modelRelations = {};\n\tfor (const relation of semanticModel.relations ?? []) {\n\t\tif (relation.spaceId !== void 0) {\n\t\t\tconst targetNamespaceId = relation.namespaceId ?? defaultNamespaceId;\n\t\t\tconst localFields = relation.on.parentColumns.map((col) => joinFieldOf(semanticModel, relation, semanticModel, columnToField, col));\n\t\t\tmodelRelations[relation.fieldName] = {\n\t\t\t\tto: crossRef(relation.toModel, targetNamespaceId, relation.spaceId),\n\t\t\t\tcardinality: \"N:1\",\n\t\t\t\tnullable: toOneRelationNullable(semanticModel, relation),\n\t\t\t\ton: {\n\t\t\t\t\tlocalFields,\n\t\t\t\t\ttargetFields: relation.on.childColumns\n\t\t\t\t}\n\t\t\t};\n\t\t\tcontinue;\n\t\t}\n\t\tconst owner = {\n\t\t\tkind: \"model\",\n\t\t\tmodelName: semanticModel.modelName\n\t\t};\n\t\tconst targetModel = assertKnownTargetModel(lookups.modelsByName, lookups.modelsByCoordinate, owner, relation.toModel, relation.toNamespaceId, \"Relation\");\n\t\tinvariant(relation.toTable !== void 0, `Relation \"${semanticModel.modelName}.${relation.fieldName}\" is local but carries no target table; only cross-space relations may leave it unset.`);\n\t\tassertTargetTableMatches(owner, targetModel, relation.toTable, \"Relation\");\n\t\tconst targetColumnToField = new Map(targetModel.fields.map((f) => [f.columnName, f.fieldName]));\n\t\tconst to = crossRef(relation.toModel, relation.toNamespaceId !== void 0 && relation.toNamespaceId.length > 0 ? relation.toNamespaceId : modelNamespaceId(targetModel, defaultNamespaceId));\n\t\tconst joinField = (model, fields, column) => joinFieldOf(semanticModel, relation, model, fields, column);\n\t\tconst on = {\n\t\t\tlocalFields: relation.on.parentColumns.map((col) => joinField(semanticModel, columnToField, col)),\n\t\t\ttargetFields: relation.through !== void 0 ? [...relation.on.childColumns] : relation.on.childColumns.map((col) => joinField(targetModel, targetColumnToField, col))\n\t\t};\n\t\tif (relation.cardinality === \"N:M\") {\n\t\t\tif (!relation.through) throw contractError(\"CONTRACT.RELATION_INVALID\", `Relation \"${semanticModel.modelName}.${relation.fieldName}\" with cardinality \"N:M\" requires through metadata`, { meta: {\n\t\t\t\tmodelName: semanticModel.modelName,\n\t\t\t\trelationName: relation.fieldName,\n\t\t\t\treason: \"many-to-many-missing-through\"\n\t\t\t} });\n\t\t\tmodelRelations[relation.fieldName] = {\n\t\t\t\tto,\n\t\t\t\tcardinality: \"N:M\",\n\t\t\t\ton,\n\t\t\t\tthrough: buildThroughDescriptor(relation.through, lookups.tableNamespaceByName, targetModel, semanticModel.modelName, relation.fieldName, defaultNamespaceId)\n\t\t\t};\n\t\t} else if (relation.cardinality === \"1:N\") modelRelations[relation.fieldName] = {\n\t\t\tto,\n\t\t\tcardinality: \"1:N\",\n\t\t\ton\n\t\t};\n\t\telse modelRelations[relation.fieldName] = {\n\t\t\tto,\n\t\t\tcardinality: relation.cardinality,\n\t\t\tnullable: toOneRelationNullable(semanticModel, relation),\n\t\t\ton\n\t\t};\n\t}\n\treturn modelRelations;\n}\n//#endregion\n//#region src/storage-description.ts\n/** The key of a table among all tables of a contract: its namespace and its name. */\nfunction tableKey(namespaceId, tableName) {\n\treturn JSON.stringify([namespaceId, tableName]);\n}\n//#endregion\n//#region src/resolve-foreign-key.ts\n/** Resolves a foreign key's target. A cross-space key keeps its foreign space; a local key names either a model of this definition and that model's table, or a table a model or table node declares. */\nfunction resolveForeignKey(fk, sourceTable, context) {\n\tconst source = {\n\t\tnamespaceId: asNamespaceId(sourceTable.namespaceId),\n\t\ttableName: sourceTable.tableName,\n\t\tcolumns: fk.columns\n\t};\n\tconst options = {\n\t\t...applyFkDefaults({\n\t\t\t...ifDefined(\"constraint\", fk.constraint),\n\t\t\t...ifDefined(\"index\", fk.index)\n\t\t}, context.foreignKeyDefaults),\n\t\t...ifDefined(\"name\", fk.name),\n\t\t...ifDefined(\"onDelete\", fk.onDelete),\n\t\t...ifDefined(\"onUpdate\", fk.onUpdate)\n\t};\n\tif (fk.references.spaceId !== void 0) return {\n\t\tsource,\n\t\ttarget: {\n\t\t\tnamespaceId: asNamespaceId(fk.references.namespaceId ?? context.defaultNamespaceId),\n\t\t\ttableName: fk.references.table,\n\t\t\tcolumns: fk.references.columns,\n\t\t\tspaceId: fk.references.spaceId\n\t\t},\n\t\t...options\n\t};\n\tconst { references } = fk;\n\tif (references.model === void 0) {\n\t\tconst namespaceId = namespaceIdOrDefault(references.namespaceId, context.defaultNamespaceId);\n\t\tif (!context.declaredTables.has(tableKey(namespaceId, references.table))) throw contractError(\"CONTRACT.TABLE_UNKNOWN\", `Foreign key on ${referenceOwnerSubject(sourceTable.owner)} references table \"${references.table}\" in namespace \"${namespaceId}\", which no model or table node declares. Declare the table with a model or a table node, or correct the name.`, { meta: {\n\t\t\t...referenceOwnerMeta(sourceTable.owner),\n\t\t\treferencedTable: references.table,\n\t\t\tnamespaceId\n\t\t} });\n\t\treturn {\n\t\t\tsource,\n\t\t\ttarget: {\n\t\t\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\t\t\ttableName: references.table,\n\t\t\t\tcolumns: references.columns\n\t\t\t},\n\t\t\t...options\n\t\t};\n\t}\n\tconst targetModel = assertKnownTargetModel(context.modelsByName, context.modelsByCoordinate, sourceTable.owner, references.model, fk.references.namespaceId, \"Foreign key\");\n\tassertTargetTableMatches(sourceTable.owner, targetModel, fk.references.table, \"Foreign key\");\n\treturn {\n\t\tsource,\n\t\ttarget: {\n\t\t\tnamespaceId: asNamespaceId(namespaceIdOrDefault(fk.references.namespaceId, modelNamespaceId(targetModel, context.defaultNamespaceId))),\n\t\t\ttableName: fk.references.table,\n\t\t\tcolumns: fk.references.columns\n\t\t},\n\t\t...options\n\t};\n}\n//#endregion\n//#region src/target-authoring-hooks.ts\n/**\n* Resolves a deferred entity-ref column descriptor (e.g. a `pg.enum(handle)`\n* column) against the field's now-known owning namespace: attaches the\n* storage `valueSet` ref the collected entity's derived value-set is stored\n* under. `typeParams.typeName` stays bare here — schema\n* qualification (e.g. `auth.aal_level`) is a target concern applied in the\n* next step, `qualifyColumnDescriptor`. A descriptor with no `entityRef` (the\n* ordinary case) passes through unchanged.\n*/\nfunction resolveEntityRefDescriptor(descriptor, namespaceId) {\n\tconst entityRef = descriptor.entityRef;\n\tif (entityRef === void 0) return descriptor;\n\treturn {\n\t\t...descriptor,\n\t\tvalueSet: {\n\t\t\tplane: \"storage\",\n\t\t\tentityKind: \"valueSet\",\n\t\t\tnamespaceId,\n\t\t\tentityName: entityRef.entityName\n\t\t}\n\t};\n}\n/**\n* Structural check for a target that contributes a `qualifyColumnType` hook\n* on its authoring contributions. Duck-typed (mirroring\n* `contract-psl`'s `hasColumnFromEntityHook`) so the SQL family stays blind\n* to the target's qualification logic and no framework/family interface has\n* to name the hook.\n*/\nfunction hasColumnTypeQualifier(authoring) {\n\treturn \"qualifyColumnType\" in authoring && typeof authoring.qualifyColumnType === \"function\";\n}\n/**\n* Structural check for a target that contributes a `renderCheckExpressions`\n* hook, duck-typed for the same reason {@link hasColumnTypeQualifier} is: the\n* SQL family stays blind to the target's predicate syntax.\n*/\nfunction hasCheckExpressionRenderer(authoring) {\n\treturn \"renderCheckExpressions\" in authoring && typeof authoring.renderCheckExpressions === \"function\";\n}\nfunction resolveCheckExpressionRenderer(target) {\n\tconst authoring = target.authoring;\n\tif (authoring === void 0) return void 0;\n\treturn hasCheckExpressionRenderer(authoring) ? authoring.renderCheckExpressions : void 0;\n}\nfunction resolveColumnTypeQualifier(target) {\n\tconst authoring = target.authoring;\n\tif (authoring === void 0) return void 0;\n\treturn hasColumnTypeQualifier(authoring) ? authoring.qualifyColumnType : void 0;\n}\n/**\n* Applies the target's `qualifyColumnType` hook to a scalar column descriptor.\n* A descriptor whose codec the target leaves unchanged passes through untouched.\n*/\nfunction qualifyColumnDescriptor(descriptor, namespaceId, qualify) {\n\tif (qualify === void 0) return descriptor;\n\tconst qualified = qualify({\n\t\tcodecId: descriptor.codecId,\n\t\t...ifDefined(\"typeParams\", descriptor.typeParams)\n\t}, namespaceId);\n\tif (qualified.typeParams === descriptor.typeParams) return descriptor;\n\treturn {\n\t\t...descriptor,\n\t\t...ifDefined(\"typeParams\", qualified.typeParams)\n\t};\n}\n/**\n* A column's descriptor as its namespace makes it: a deferred entity ref gets its storage value set, and the target's `qualifyColumnType` hook qualifies the type for the namespace.\n*/\nfunction resolveColumnDescriptor(descriptor, namespaceId, qualify) {\n\tconst resolved = resolveEntityRefDescriptor(descriptor, namespaceId);\n\treturn qualifyColumnDescriptor(resolved, resolved.valueSet?.namespaceId ?? namespaceId, qualify);\n}\n//#endregion\n//#region src/describe-model.ts\n/**\n* Converts one model into the storage it implies and its domain model. Other models are read only to resolve the references this one makes to them.\n*/\nfunction describeModel(model, context) {\n\tconst namespaceId = modelNamespaceId(model, context.defaultNamespaceId);\n\tconst { tableName } = model;\n\tconst fieldToColumn = {};\n\tconst domainFields = {};\n\tconst executionDefaults = [];\n\tfor (const field of model.fields) {\n\t\tconst executionDefault = executionDefaultOf(field);\n\t\tfieldToColumn[field.fieldName] = field.columnName;\n\t\tdomainFields[field.fieldName] = buildDomainField(isValueObjectMember(field) ? field : {\n\t\t\t...field,\n\t\t\tdescriptor: resolveColumnDescriptor(field.descriptor, namespaceId, context.qualifyColumnType)\n\t\t}, context.defaultNamespaceId, context.storageTypes);\n\t\tif (executionDefault) executionDefaults.push({\n\t\t\tref: {\n\t\t\t\tnamespace: namespaceId,\n\t\t\t\tentry: tableName,\n\t\t\t\tfield: field.columnName\n\t\t\t},\n\t\t\t...ifDefined(\"onCreate\", executionDefault.onCreate),\n\t\t\t...ifDefined(\"onUpdate\", executionDefault.onUpdate)\n\t\t});\n\t}\n\tconst storage = describeModelStorage(model, namespaceId, (model.foreignKeys ?? []).map((fk) => resolveForeignKey(fk, {\n\t\tnamespaceId,\n\t\ttableName: model.tableName,\n\t\towner: {\n\t\t\tkind: \"model\",\n\t\t\tmodelName: model.modelName\n\t\t}\n\t}, context)));\n\tconst storageFields = {};\n\tfor (const [fieldName, columnName] of Object.entries(fieldToColumn)) storageFields[fieldName] = { column: columnName };\n\tconst columnToField = new Map(Object.entries(fieldToColumn).map(([field, col]) => [col, field]));\n\treturn {\n\t\tstorage,\n\t\tdomain: {\n\t\t\tnamespaceId,\n\t\t\tmodelName: model.modelName,\n\t\t\tmodel: {\n\t\t\t\tstorage: {\n\t\t\t\t\ttable: tableName,\n\t\t\t\t\tnamespaceId,\n\t\t\t\t\tfields: storageFields\n\t\t\t\t},\n\t\t\t\tfields: domainFields,\n\t\t\t\trelations: lowerRelations(model, columnToField, context)\n\t\t\t},\n\t\t\texecutionDefaults\n\t\t}\n\t};\n}\n/**\n* Single-table-inheritance variants share their base model's table: the variant's columns must already be on that table, and it has no table of its own. That leaves an authored check nowhere to attach, so it is refused here as a backstop; the PSL surface refuses it earlier, at interpretation, with a diagnostic that names the base model.\n*/\nfunction describeModelStorage(model, namespaceId, foreignKeys) {\n\tconst { tableName } = model;\n\tconst columns = model.fields.map((field) => describeFieldColumn(model.modelName, field));\n\tif (model.sharesBaseTable) {\n\t\tif (model.checks && model.checks.length > 0) throw contractError(\"CONTRACT.CHECK_ON_STI_VARIANT\", `Model \"${model.modelName}\" declares a check constraint but shares its base model's storage table (single-table inheritance) and has no table of its own to declare it on. Declare the check on the base model instead.`, { meta: {\n\t\t\ttableName,\n\t\t\tmodelName: model.modelName\n\t\t} });\n\t\treturn {\n\t\t\tkind: \"baseTable\",\n\t\t\tmodelName: model.modelName,\n\t\t\tnamespaceId,\n\t\t\ttableName,\n\t\t\tcolumns\n\t\t};\n\t}\n\treturn {\n\t\tkind: \"ownTable\",\n\t\tmodelName: model.modelName,\n\t\ttable: {\n\t\t\tnamespaceId,\n\t\t\ttableName,\n\t\t\tcolumns,\n\t\t\tcontrol: model.control,\n\t\t\tid: model.id,\n\t\t\tuniques: model.uniques ?? [],\n\t\t\tindexes: model.indexes ?? [],\n\t\t\tchecks: model.checks ?? [],\n\t\t\tforeignKeys\n\t\t}\n\t};\n}\nfunction describeFieldColumn(modelName, field) {\n\tconst site = {\n\t\tkind: \"field\",\n\t\tmodelName,\n\t\tfieldName: field.fieldName\n\t};\n\tif (isValueObjectMember(field)) return describeColumn({\n\t\tcolumnName: field.columnName,\n\t\tdescriptor: field.descriptor,\n\t\tnullable: field.nullable,\n\t\t...ifDefined(\"default\", field.default)\n\t}, site);\n\treturn describeColumn(field, site);\n}\nfunction executionDefaultOf(field) {\n\treturn field.executionDefaults?.onCreate || field.executionDefaults?.onUpdate ? field.executionDefaults : void 0;\n}\n//#endregion\n//#region src/describe-table-node.ts\n/** Describes a table node: its columns, and its foreign keys resolved against the definition's models and tables. */\nfunction describeTableNode(table, context) {\n\tconst namespaceId = namespaceIdOrDefault(table.namespaceId, context.defaultNamespaceId);\n\tconst { tableName } = table;\n\tconst owner = {\n\t\tkind: \"tableNode\",\n\t\tnamespaceId,\n\t\ttableName\n\t};\n\treturn {\n\t\tnamespaceId,\n\t\ttableName,\n\t\tcolumns: table.columns.map((column) => describeColumn(column, {\n\t\t\tkind: \"tableNode\",\n\t\t\tnamespaceId,\n\t\t\ttableName,\n\t\t\tcolumnName: column.columnName\n\t\t})),\n\t\tid: table.id,\n\t\tuniques: table.uniques ?? [],\n\t\tindexes: table.indexes ?? [],\n\t\tchecks: table.checks ?? [],\n\t\tforeignKeys: (table.foreignKeys ?? []).map((fk) => resolveForeignKey(fk, {\n\t\t\tnamespaceId,\n\t\t\ttableName,\n\t\t\towner\n\t\t}, context)),\n\t\tcontrol: table.control\n\t};\n}\n//#endregion\n//#region src/column-defaults.ts\n/**\n* The codec that encodes one column's default, built with the column's own `typeParams`, because a parameterized codec checks its params when it encodes and reads a default. Only a column has params; every other encode site takes the representative instance.\n*/\nfunction columnCodec(codecId, typeParams, codecLookup) {\n\treturn codecForRef(codecLookup, {\n\t\tcodecId,\n\t\t...ifDefined(\"typeParams\", typeParams === void 0 ? void 0 : blindCast(typeParams))\n\t});\n}\n/** The JSON the contract stores for a value: the codec gives the value of its data type under the column's parameters, which the type refuses when they exclude it, and the codec reads it back, refusing a value its application value cannot hold. */\nfunction encodeViaCodec(value, codec) {\n\tif (codec) {\n\t\tconst stored = codec.toDataTypeValue(value);\n\t\tcodec.fromDataTypeValue(stored);\n\t\treturn codec.dataType.toContract(stored);\n\t}\n\treturn blindCast(value);\n}\nfunction defaultRefusal(site, cause, elementPosition) {\n\tconst subject = elementPosition === void 0 ? \"default\" : `default (element ${elementPosition})`;\n\tconst reason = cause instanceof Error ? cause.message : String(cause);\n\treturn contractError(\"CONTRACT.DEFAULT_INVALID\", `${columnSiteSubject(site)} has a ${subject} that its codec refuses: ${reason}`, {\n\t\tcause,\n\t\tmeta: {\n\t\t\t...columnSiteMeta(site),\n\t\t\tcodecId: site.codecId,\n\t\t\treason: \"codec-refused-default\",\n\t\t\t...ifDefined(\"elementPosition\", elementPosition)\n\t\t}\n\t});\n}\n/** The refusal of a literal default by a data type that has no literal values, such as a raw column's. */\nfunction noLiteralValuesRefusal(site, cause) {\n\treturn contractError(\"CONTRACT.DEFAULT_INVALID\", `${columnSiteSubject(site)} has a literal default. ${cause.message}`, {\n\t\tcause,\n\t\tmeta: {\n\t\t\t...columnSiteMeta(site),\n\t\t\tcodecId: site.codecId,\n\t\t\treason: \"no-literal-values\"\n\t\t}\n\t});\n}\nfunction encodeDefaultValue(value, codec, site, elementPosition) {\n\ttry {\n\t\treturn encodeViaCodec(value, codec);\n\t} catch (cause) {\n\t\tif (cause instanceof InternalError) throw cause;\n\t\tif (isStructuredError(cause) && cause.code === \"CONTRACT.LITERAL_VALUES_ABSENT\") throw noLiteralValuesRefusal(site, cause);\n\t\tthrow defaultRefusal(site, cause, elementPosition);\n\t}\n}\nfunction codecForDefault(codecLookup, resolveCodec, site) {\n\tconst codec = buildCodecForDefault(codecLookup, resolveCodec, site);\n\tif (codec === void 0) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `${columnSiteSubject(site)} has a default, but no pack in the contract declares its codec \"${site.codecId}\", so the default cannot be checked. List the pack that owns the codec in \\`extensions\\`.`, { meta: {\n\t\t...columnSiteMeta(site),\n\t\tcodecId: site.codecId,\n\t\treason: \"codec-not-found\"\n\t} });\n\treturn codec;\n}\nfunction buildCodecForDefault(codecLookup, resolveCodec, site) {\n\ttry {\n\t\treturn resolveCodec(codecLookup);\n\t} catch (cause) {\n\t\tif (!isStructuredError(cause) || cause.code !== \"RUNTIME.TYPE_PARAMS_INVALID\") throw cause;\n\t\tthrow contractError(\"CONTRACT.ARGUMENT_INVALID\", `${columnSiteSubject(site)} has type parameters that its codec does not accept: ${cause.message}`, {\n\t\t\tcause,\n\t\t\tmeta: {\n\t\t\t\t...columnSiteMeta(site),\n\t\t\t\tcodecId: site.codecId,\n\t\t\t\treason: \"type-params-invalid\"\n\t\t\t}\n\t\t});\n\t}\n}\nfunction encodeColumnDefault(defaultInput, codecLookup, resolveCodec, site, many = false, elementNullable = false) {\n\tif (defaultInput.kind === \"function\") return {\n\t\tkind: \"function\",\n\t\texpression: defaultInput.expression\n\t};\n\tif (\"inStoredForm\" in defaultInput && defaultInput.inStoredForm === true) return {\n\t\tkind: \"literal\",\n\t\tvalue: blindCast(defaultInput.value)\n\t};\n\tif (many) {\n\t\tif (!Array.isArray(defaultInput.value)) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `${columnSiteSubject(site)} is a list field, so its default is an array; received ${typeof defaultInput.value}. Call .many() before .default().`, { meta: {\n\t\t\t...columnSiteMeta(site),\n\t\t\tcodecId: site.codecId,\n\t\t\treason: \"list-default-not-array\"\n\t\t} });\n\t\tconst codec = codecForDefault(codecLookup, resolveCodec, site);\n\t\treturn {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: defaultInput.value.map((element, index) => {\n\t\t\t\tif (element !== null) return encodeDefaultValue(element, codec, site, index + 1);\n\t\t\t\tif (elementNullable) return null;\n\t\t\t\tthrow new InternalError(\"Literal default on a strict list column cannot contain null elements.\");\n\t\t\t})\n\t\t};\n\t}\n\treturn {\n\t\tkind: \"literal\",\n\t\tvalue: encodeDefaultValue(defaultInput.value, codecForDefault(codecLookup, resolveCodec, site), site)\n\t};\n}\n//#endregion\n//#region src/pack-entities.ts\n/**\n* Records a deferred column's entity-ref into the namespace-scoped collection\n* accumulator (`namespaceId → entityKind → entityName`) — folded into the same\n* namespace assembly `deriveEntityValueSets`/`entries.<kind>` step as the\n* entities-channel attachments, so a column-collected entity gets its\n* value-set the same way an entities-channel one does.\n*\n* The same handle reused by many columns in one namespace is normal (a native\n* enum type backs any number of columns) and records the identical entity once.\n* Two *different* entity instances sharing a name+kind in one namespace is a\n* name collision — the emitted `entries.valueSet.<name>` could only reflect one\n* of them, silently mismatching the other column's type/cast. PSL hard-errors\n* on the equivalent (`PSL_DUPLICATE_DECLARATION`); the TS path rejects it too.\n*/\nfunction collectEntityFromColumn(collected, namespaceId, entityRef) {\n\tconst forNs = collected[namespaceId] ?? {};\n\tconst forKind = forNs[entityRef.entityKind] ?? {};\n\tconst existing = forKind[entityRef.entityName];\n\tif (existing !== void 0 && existing !== entityRef.entity) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `buildSqlContractFromDefinition: two different \"${entityRef.entityKind}\" entities named \"${entityRef.entityName}\" in namespace \"${namespaceId}\" — pack-entity names must be unique per namespace.`, { meta: {\n\t\tkind: entityRef.entityKind,\n\t\tname: entityRef.entityName,\n\t\tnamespaceId\n\t} });\n\tforKind[entityRef.entityName] = entityRef.entity;\n\tforNs[entityRef.entityKind] = forKind;\n\tcollected[namespaceId] = forNs;\n}\n/**\n* Merges a namespace's entities-channel attachments (lowered from the\n* `entities` handle list, carried on `ContractDefinition.attachedEntities`)\n* with the entities collected from that namespace's deferred entity-ref\n* columns. A column-collected entity that shadows a *different* attached\n* entity of the same kind+name (or vice-versa) is the same name-collision bug\n* `collectEntityFromColumn` guards against across columns, so it is rejected\n* the same way — by entity identity, so the same handle attached and used by\n* a column does not throw.\n*/\nfunction mergeColumnAndAttachedEntities(namespaceId, attached, columnCollected) {\n\tif (attached === void 0) return columnCollected;\n\tif (columnCollected === void 0) return attached;\n\tconst kinds = /* @__PURE__ */ new Set([...Object.keys(attached), ...Object.keys(columnCollected)]);\n\tconst result = {};\n\tfor (const kind of kinds) {\n\t\tconst attachedForKind = attached[kind];\n\t\tconst columnForKind = columnCollected[kind];\n\t\tfor (const [name, entity] of Object.entries(columnForKind ?? {})) {\n\t\t\tconst existing = attachedForKind?.[name];\n\t\t\tif (existing !== void 0 && existing !== entity) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `buildSqlContractFromDefinition: two different \"${kind}\" entities named \"${name}\" in namespace \"${namespaceId}\" — a column-referenced entity conflicts with an attached one; pack-entity names must be unique per namespace.`, { meta: {\n\t\t\t\tkind,\n\t\t\t\tname,\n\t\t\t\tnamespaceId\n\t\t\t} });\n\t\t}\n\t\tresult[kind] = {\n\t\t\t...attachedForKind,\n\t\t\t...columnForKind\n\t\t};\n\t}\n\treturn result;\n}\n/**\n* Entry kinds the framework assembler itself manages (`table` from models,\n* `valueSet` from `enums` and attached-entity value-set derivation). A\n* pack-attached entity claiming one of these would silently clobber or be\n* clobbered by the managed slot, so it is rejected outright.\n*/\nconst MANAGED_ENTRY_KINDS = /* @__PURE__ */ new Set([tableEntityKind.kind, valueSetEntityKind.kind]);\nfunction assertNoManagedEntityKinds(namespaceId, entitiesForNs) {\n\tif (entitiesForNs === void 0) return;\n\tfor (const kind of Object.keys(entitiesForNs)) if (MANAGED_ENTRY_KINDS.has(kind)) throw contractError(\"CONTRACT.ENTITY_KIND_INVALID\", `buildSqlContractFromDefinition: attached entity in namespace \"${namespaceId}\" declares entry kind \"${kind}\", which is managed by the framework (table/valueSet) and cannot be attached.`, { meta: {\n\t\tentityKind: kind,\n\t\tnamespaceId\n\t} });\n}\n/**\n* Walks the flat `entityTypes` namespace tree contributed by the target pack\n* and every extension pack, indexing descriptors by their `discriminator` —\n* the same string a pack entity's entries-map key (`entries.<kind>`) uses.\n* Mirrors `contract-psl`'s `buildEntityTypesByDiscriminator`, recomposed here\n* from the packs `ContractDefinition` already carries (`target` +\n* `extensions`) since the TS assembler has no single pre-merged\n* `AuthoringContributions` input to read the way the PSL interpreter does.\n*/\nfunction collectEntityTypeDescriptorsByDiscriminator(definition) {\n\tconst result = /* @__PURE__ */ new Map();\n\tconst walk = (namespace) => {\n\t\tfor (const value of Object.values(namespace)) if (isAuthoringEntityTypeDescriptor(value)) result.set(value.discriminator, value);\n\t\telse walk(value);\n\t};\n\tconst components = [definition.target, ...Object.values(definition.extensions ?? {})];\n\tfor (const component of components) {\n\t\tconst entityTypes = component.authoring?.entityTypes;\n\t\tif (entityTypes !== void 0) walk(entityTypes);\n\t}\n\treturn result;\n}\n/**\n* Derives value-sets for every pack entity declared in one namespace,\n* reusing the same `SqlValueSetDerivingEntityTypeOutput.deriveValueSet` hook\n* `contract-psl`'s `lowerExtensionBlocksForNamespace` folds into\n* `entries.valueSet` on the PSL path — so a TS-attached entity (e.g. a\n* native enum) gets its value-set the same way. Entity kinds with no\n* registered descriptor, or whose descriptor output doesn't derive a\n* value-set, contribute nothing.\n*/\nfunction deriveEntityValueSets(entitiesForNs, entityTypesByDiscriminator) {\n\tif (entitiesForNs === void 0) return void 0;\n\tlet result;\n\tfor (const [kind, entitiesByName] of Object.entries(entitiesForNs)) {\n\t\tconst descriptor = entityTypesByDiscriminator.get(kind);\n\t\tif (descriptor === void 0) continue;\n\t\tfor (const [name, entity] of Object.entries(entitiesByName)) {\n\t\t\tconst derivedValueSet = deriveValueSetFromEntity(descriptor.output, entity);\n\t\t\tif (derivedValueSet === void 0) continue;\n\t\t\tresult ??= {};\n\t\t\tresult[name] = derivedValueSet;\n\t\t}\n\t}\n\treturn result;\n}\n/**\n* Merges a namespace's `enumType()`-derived value-sets with its pack-entity-\n* derived value-sets. Both land in the same `entries.valueSet[name]` slot —\n* which drives value-set → codec typing and the domain-enum CHECK — so a\n* same-named entry in both would let one silently overwrite the other and\n* corrupt whichever column resolves against it. The same collision class the\n* `mergeColumnAndAttachedEntities` guard rejects; the PSL path already hard-errors\n* on the equivalent (`interpretPslDocumentToSqlContract`). Reject it here too.\n*/\nfunction mergeNamespaceValueSets(namespaceId, enumValueSets, packValueSets) {\n\tif (enumValueSets !== void 0 && packValueSets !== void 0) {\n\t\tfor (const name of Object.keys(packValueSets)) if (Object.hasOwn(enumValueSets, name)) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `buildSqlContractFromDefinition: value-set \"${name}\" in namespace \"${namespaceId}\" is derived from both an enum and a pack entity — names must be unique per namespace.`, { meta: {\n\t\t\tkind: \"valueSet\",\n\t\t\tname,\n\t\t\tnamespaceId\n\t\t} });\n\t}\n\treturn {\n\t\t...enumValueSets,\n\t\t...packValueSets\n\t};\n}\n//#endregion\n//#region src/lower-column.ts\n/**\n* Names the target's rendered checks and lowers them into contract entities.\n*\n* Naming is composed family-side ({@link composeCheckWirePrefix}) rather than\n* by the target, and suffixed with the predicate's content hash. Composing\n* family-side is what makes the truncation safe — two prefixes that truncate\n* alike still differ in their hashes, and the family can see that the\n* (table, column, kind) triple they were built from is unique per table,\n* rather than having to assume something about SQL text it declares itself\n* unable to read.\n*/\nfunction lowerRenderedChecks(tableName, candidates) {\n\treturn candidates.map((candidate) => new CheckConstraint({\n\t\tnaming: {\n\t\t\tkind: \"wire\",\n\t\t\tprefix: composeCheckWirePrefix(tableName, candidate.columnName, candidate.kind),\n\t\t\thash: computeCheckContentHash(candidate.expression)\n\t\t},\n\t\texpression: candidate.expression\n\t}));\n}\nfunction validateColumnTypeParams(dataType, typeParams, site) {\n\ttry {\n\t\tvalidateSqlTypeParams(dataType, dataTypeParams(dataType, typeParams));\n\t} catch (cause) {\n\t\tif (!isStructuredError(cause) || cause.code !== \"CONTRACT.TYPE_PARAMS_INVALID\") throw cause;\n\t\tthrow contractError(\"CONTRACT.TYPE_PARAMS_INVALID\", `${columnSiteSubject(site)} has type parameters that its data type does not accept: ${cause.message}`, {\n\t\t\tcause,\n\t\t\tmeta: {\n\t\t\t\t...cause.meta,\n\t\t\t\t...columnSiteMeta(site)\n\t\t\t}\n\t\t});\n\t}\n}\n/**\n* Lowers one column into its storage column and the enforcement checks its shape derives.\n*\n* A column whose type constructor refers to a pack entity (e.g. `pg.enum(handle)`) records that entity, and its descriptor is resolved against the column's namespace and handed to the target's `qualifyColumnType` hook. An opt-out from derived checks on a table that derives none is dropped, never persisted: the policy may also be stamped after the build by a specifier.\n*\n* Member values reach the check renderer only for a column typed by an `enumType()` handle: that column is a plain scalar with no native type of its own to enforce membership. A value set resolved by a type constructor binds the column to a native type that already enforces it.\n*/\nfunction lowerColumn(description, placement, context) {\n\tconst { site, many } = description;\n\tconst { codecLookup } = context.lookups;\n\tconst entityRef = description.descriptor.entityRef;\n\tif (entityRef !== void 0) collectEntityFromColumn(context.collectedColumnEntities, placement.namespaceId, entityRef);\n\tconst descriptor = resolveColumnDescriptor(description.descriptor, placement.namespaceId, context.qualifyColumnType);\n\tconst elementNullable = many !== false && many.elementNullable;\n\tconst codecId = descriptor.codecId;\n\tconst typeParams = resolvedTypeParams(descriptor, context.storageTypes);\n\tconst dataType = sqlDataTypeOfCodec(codecId, context.lookups);\n\tvalidateColumnTypeParams(dataType, typeParams, site);\n\tconst encodedDefault = description.default !== void 0 ? encodeColumnDefault(description.default, codecLookup, (lookup) => columnCodec(codecId, typeParams, lookup), {\n\t\t...site,\n\t\tcodecId\n\t}, many !== false, elementNullable) : void 0;\n\tconst enumRefs = enumValueSetRefs(description.enumTypeHandle, context.defaultNamespaceId);\n\tinvariant(enumRefs === void 0 || descriptor.valueSet === void 0, `${columnSiteSubject(site)} is typed by a domain enum and also carries a storage value set from its type constructor.`);\n\tconst valueSet = enumRefs?.storage ?? descriptor.valueSet;\n\tconst column = {\n\t\tdataType: dataType.id,\n\t\tcodecId,\n\t\tnullable: description.nullable,\n\t\tmany,\n\t\t...ifDefined(\"typeParams\", descriptor.typeParams),\n\t\t...ifDefined(\"default\", encodedDefault),\n\t\t...ifDefined(\"typeRef\", descriptor.typeRef),\n\t\t...ifDefined(\"valueSet\", valueSet)\n\t};\n\tconst render = context.renderCheckExpressions;\n\tif (render === void 0 || !placement.derivesChecks) return {\n\t\tcolumn,\n\t\tderivedChecks: []\n\t};\n\tconst { enumTypeHandle } = description;\n\tconst candidates = render({\n\t\ttableName: placement.tableName,\n\t\tcolumnName: description.columnName,\n\t\tmany: many !== false,\n\t\telementNullable,\n\t\tmemberValues: enumTypeHandle !== void 0 ? checkMemberValues(enumTypeHandle, codecLookup) : void 0\n\t});\n\treturn {\n\t\tcolumn,\n\t\tderivedChecks: lowerRenderedChecks(placement.tableName, candidates)\n\t};\n}\n//#endregion\n//#region src/lower-table.ts\nconst DERIVABLE_CHECK_KINDS = [\"membership\", \"elementNotNull\"];\n/**\n* Which of `columnNames` could have produced `prefix` for some\n* {@link CheckKind} — the reverse of {@link derivedCheckPrefixes}, used only\n* to name the collision in `CONTRACT.CHECK_NAME_RESERVED`'s message. Callers\n* already know `prefix` is a member of `derivedCheckPrefixes(tableName,\n* columnNames)`, so the result is never empty.\n*/\nfunction columnsProducingCheckPrefix(tableName, columnNames, prefix) {\n\treturn columnNames.filter((columnName) => DERIVABLE_CHECK_KINDS.some((kind) => composeCheckWirePrefix(tableName, columnName, kind) === prefix));\n}\n/**\n* Lowers one table: each of its columns, then its indexes, checks, primary key, uniques and foreign keys, with the backing indexes its foreign keys need.\n*\n* Checks are derived only for tables Prisma 8 owns: the contract describes an external schema, it does not prescribe enforcement for it. This reads the policy the source declares; a policy applied by a contract specifier lands after the build and is handled by `stripDerivedChecksFromNonManagedTables`. Authored checks are kept whatever the policy: they are the author's statement about a constraint they know exists.\n*/\nfunction lowerTable(table, context) {\n\tconst { tableName } = table;\n\tconst derivesChecks = effectiveControlPolicy(table.control, context.defaultControlPolicy) === \"managed\";\n\tconst placement = {\n\t\tnamespaceId: table.namespaceId,\n\t\ttableName,\n\t\tderivesChecks\n\t};\n\tconst columns = {};\n\tconst checks = [];\n\tfor (const description of table.columns) {\n\t\tconst lowered = lowerColumn(description, placement, context);\n\t\tcolumns[description.columnName] = lowered.column;\n\t\tchecks.push(...lowered.derivedChecks);\n\t}\n\tconst uniques = table.uniques.map((u) => ({\n\t\tcolumns: u.columns,\n\t\t...ifDefined(\"name\", u.name)\n\t}));\n\tconst declaredIndexes = table.indexes.map((index) => ({\n\t\tnamedByUser: index.name !== void 0 || index.map !== void 0,\n\t\tindex: lowerAuthoredIndex(tableName, authoredIndexInput(index), context.warnings, context.indexTypeRegistry)\n\t}));\n\tchecks.push(...lowerAuthoredChecks(tableName, Object.keys(columns), table.checks, context));\n\tconst primaryKey = table.id ? {\n\t\tcolumns: table.id.columns,\n\t\t...ifDefined(\"name\", table.id.name)\n\t} : void 0;\n\tconst { foreignKeys, indexes } = materializeForeignKeysAndIndexes({\n\t\ttableName,\n\t\tforeignKeys: table.foreignKeys,\n\t\tdeclaredIndexes,\n\t\tuniques,\n\t\tprimaryKey,\n\t\twarnings: context.warnings,\n\t\tindexTypes: context.indexTypeRegistry\n\t});\n\treturn {\n\t\tcolumns,\n\t\t...ifDefined(\"control\", table.control),\n\t\tuniques,\n\t\tindexes: indexes.map((i) => new Index(i)),\n\t\tforeignKeys,\n\t\t...primaryKey ? { primaryKey } : {},\n\t\t...checks.length > 0 ? { checks: inCanonicalOrder(checks) } : {}\n\t};\n}\n/**\n* The checks sorted by name in UTF-16 code-unit order, the order contract canonicalization gives them. The table's storage is then the same whichever declaration each column came from and in whatever order the columns were listed.\n*/\nfunction inCanonicalOrder(checks) {\n\treturn [...checks].sort((a, b) => compareCodeUnits(a.name, b.name));\n}\nfunction authoredIndexInput(index) {\n\treturn blindCast({\n\t\t...ifDefined(\"columns\", index.columns),\n\t\t...ifDefined(\"expression\", index.expression),\n\t\twhere: index.where,\n\t\tunique: index.unique,\n\t\tmap: index.map,\n\t\tname: index.name,\n\t\ttype: index.type,\n\t\toptions: index.options\n\t});\n}\n/** Names the authored checks, and refuses one whose name could be taken for a derived check of a column of this table. */\nfunction lowerAuthoredChecks(tableName, tableColumnNames, authoredChecks, context) {\n\tif (authoredChecks.length === 0) return [];\n\tconst reservedCheckPrefixes = derivedCheckPrefixes(tableName, tableColumnNames);\n\treturn authoredChecks.map((authoredCheck) => {\n\t\tconst lowered = lowerAuthoredCheck(tableName, authoredCheck, context.warnings);\n\t\tif (lowered.naming.kind === \"wire\" && reservedCheckPrefixes.has(lowered.naming.prefix)) {\n\t\t\tconst collidingColumns = columnsProducingCheckPrefix(tableName, tableColumnNames, lowered.naming.prefix);\n\t\t\tconst columnList = collidingColumns.map((name) => `\"${name}\"`).join(\", \");\n\t\t\tthrow contractError(\"CONTRACT.CHECK_NAME_RESERVED\", `Check \"${lowered.naming.prefix}\" on table \"${tableName}\": this name's prefix matches the shape a derived enforcement check would use for column${collidingColumns.length === 1 ? \"\" : \"s\"} ${columnList} of this table, so it can't be told apart from one. Choose a different name.`, { meta: {\n\t\t\t\ttableName,\n\t\t\t\tprefix: lowered.naming.prefix,\n\t\t\t\tcollidingColumns\n\t\t\t} });\n\t\t}\n\t\treturn new CheckConstraint(lowered);\n\t});\n}\n//#endregion\n//#region src/merge-tables.ts\n/** How a refusal names each table-level property. Typed by every key of {@link TableProperties}, so a new property cannot be left out of the check. */\nconst tablePropertyLabels = {\n\tid: \"a primary key\",\n\tuniques: \"unique constraints\",\n\tindexes: \"indexes\",\n\tchecks: \"check constraints\",\n\tforeignKeys: \"foreign keys\",\n\tcontrol: \"a control policy\"\n};\nfunction isTableProperty(key) {\n\treturn Object.hasOwn(tablePropertyLabels, key);\n}\n/**\n* Collects the tables the models and table nodes describe, one per namespace and table name: the models' tables in model order, then the tables only table nodes declare.\n*\n* A table node for a table a model maps adds its columns to that table and nothing else, because the model owns the table's table-level properties. A table node for any other table is the whole table. A single-table variant adds nothing: each of its columns must already be on its base's table, which the base owns, and no table node may declare a column a variant's field maps. A variant whose table no model owns is not checked.\n*\n* Every table comes out with its foreign keys from exactly one declaration, a model or a table node, in the order that declaration lists them.\n*/\nfunction mergeTables(storages, tableNodes) {\n\tconst tables = /* @__PURE__ */ new Map();\n\tconst modelOfTable = /* @__PURE__ */ new Map();\n\tfor (const storage of storages) {\n\t\tif (storage.kind !== \"ownTable\") continue;\n\t\tconst { table } = storage;\n\t\tconst key = tableKey(table.namespaceId, table.tableName);\n\t\tif (tables.has(key)) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `buildSqlContractFromDefinition: duplicate table \"${table.tableName}\" in namespace \"${table.namespaceId}\".`, { meta: {\n\t\t\tkind: \"table\",\n\t\t\tname: table.tableName,\n\t\t\tnamespaceId: table.namespaceId\n\t\t} });\n\t\ttables.set(key, table);\n\t\tmodelOfTable.set(key, storage.modelName);\n\t}\n\tconst variants = storages.filter((storage) => storage.kind === \"baseTable\");\n\tconst variantColumnSites = variantColumnSitesByTable(variants);\n\tconst tableNodeKeys = /* @__PURE__ */ new Set();\n\tfor (const tableNode of tableNodes) {\n\t\tconst key = tableKey(tableNode.namespaceId, tableNode.tableName);\n\t\tif (tableNodeKeys.has(key)) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `Table \"${tableNode.tableName}\" in namespace \"${tableNode.namespaceId}\" is declared by two table nodes.`, { meta: {\n\t\t\tkind: \"table\",\n\t\t\tname: tableNode.tableName,\n\t\t\tnamespaceId: tableNode.namespaceId\n\t\t} });\n\t\ttableNodeKeys.add(key);\n\t\tconst columnSites = variantColumnSites.get(key) ?? /* @__PURE__ */ new Map();\n\t\tconst modelName = modelOfTable.get(key);\n\t\tconst modelled = tables.get(key);\n\t\tif (modelName === void 0 || modelled === void 0) {\n\t\t\ttables.set(key, {\n\t\t\t\t...tableNode,\n\t\t\t\tcolumns: withColumns([], tableNode, columnSites)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tassertOnlyColumns(tableNode, modelName);\n\t\ttables.set(key, {\n\t\t\t...modelled,\n\t\t\tcolumns: withColumns(modelled.columns, tableNode, columnSites)\n\t\t});\n\t}\n\tfor (const variant of variants) {\n\t\tconst table = tables.get(tableKey(variant.namespaceId, variant.tableName));\n\t\tif (table !== void 0) assertVariantColumnsOnBaseTable(variant, table);\n\t}\n\treturn [...tables.values()];\n}\n/** For each table, the variant field that maps each variant column; the first variant to map a column names it. */\nfunction variantColumnSitesByTable(variants) {\n\tconst sites = /* @__PURE__ */ new Map();\n\tfor (const variant of variants) {\n\t\tconst key = tableKey(variant.namespaceId, variant.tableName);\n\t\tconst byColumn = sites.get(key) ?? /* @__PURE__ */ new Map();\n\t\tfor (const column of variant.columns) if (!byColumn.has(column.columnName)) byColumn.set(column.columnName, column.site);\n\t\tsites.set(key, byColumn);\n\t}\n\treturn sites;\n}\n/**\n* The table's columns with the table node's columns added. A column some field already declares is refused, and the error names the field the author wrote: a single-table variant's field when a variant maps the column, even though the base table carries a copy of it.\n*/\nfunction withColumns(columns, tableNode, variantColumnSites) {\n\tconst sites = new Map(columns.map((column) => [column.columnName, column.site]));\n\tfor (const column of tableNode.columns) {\n\t\tconst earlier = variantColumnSites.get(column.columnName) ?? sites.get(column.columnName);\n\t\tif (earlier !== void 0) {\n\t\t\tconst problem = earlier.kind === \"field\" ? `is declared by field \"${earlier.modelName}.${earlier.fieldName}\" and again by a table node` : \"is listed twice by its table node\";\n\t\t\tthrow contractError(\"CONTRACT.NAME_DUPLICATE\", `Column \"${column.columnName}\" of table \"${tableNode.tableName}\" ${problem}.`, { meta: {\n\t\t\t\tkind: \"column\",\n\t\t\t\tname: column.columnName,\n\t\t\t\ttableName: tableNode.tableName,\n\t\t\t\tnamespaceId: tableNode.namespaceId\n\t\t\t} });\n\t\t}\n\t\tsites.set(column.columnName, column.site);\n\t}\n\treturn [...columns, ...tableNode.columns];\n}\nfunction isStated(value) {\n\treturn Array.isArray(value) ? value.length > 0 : value !== void 0;\n}\nfunction assertOnlyColumns(tableNode, modelName) {\n\tconst property = Object.keys(tablePropertyLabels).filter(isTableProperty).find((name) => isStated(tableNode[name]));\n\tif (property === void 0) return;\n\tthrow contractError(\"CONTRACT.TABLE_OWNED_BY_MODEL\", `A table node for table \"${tableNode.tableName}\" states ${tablePropertyLabels[property]}, but model \"${modelName}\" maps that table and owns its table-level properties. A table node for a modelled table may only add columns.`, { meta: {\n\t\tnamespaceId: tableNode.namespaceId,\n\t\ttableName: tableNode.tableName,\n\t\tmodelName,\n\t\tproperty\n\t} });\n}\nfunction assertVariantColumnsOnBaseTable(variant, table) {\n\tconst present = new Set(table.columns.map((column) => column.columnName));\n\tconst missing = variant.columns.find((column) => !present.has(column.columnName));\n\tif (missing === void 0) return;\n\tthrow contractError(\"CONTRACT.VARIANT_COLUMN_NOT_ON_BASE_TABLE\", `Model \"${variant.modelName}\" shares table \"${variant.tableName}\" with its base model (single-table inheritance), but its column \"${missing.columnName}\" is not on that table. The base model owns the table; declare the column there.`, { meta: {\n\t\tmodelName: variant.modelName,\n\t\tnamespaceId: variant.namespaceId,\n\t\ttableName: variant.tableName,\n\t\tcolumnName: missing.columnName\n\t} });\n}\n//#endregion\n//#region src/unmapped-column-warnings.ts\n/**\n* A warning for each column a table node adds to a table some model maps, when the column is required and has no default. The ORM writes only the columns fields map, so every insert it makes into that table fails. Prisma 7 accepts such a schema, so this warns rather than refuses.\n*/\nfunction requiredUnmappedColumnWarnings(storages, tables) {\n\tconst modelOfTable = /* @__PURE__ */ new Map();\n\tfor (const storage of storages) if (storage.kind === \"ownTable\") modelOfTable.set(tableKey(storage.table.namespaceId, storage.table.tableName), storage.modelName);\n\tconst warnings = [];\n\tfor (const table of tables) {\n\t\tconst modelName = modelOfTable.get(tableKey(table.namespaceId, table.tableName));\n\t\tif (modelName === void 0) continue;\n\t\tfor (const column of table.columns) {\n\t\t\tif (column.site.kind !== \"tableNode\" || column.nullable || column.default !== void 0) continue;\n\t\t\twarnings.push({\n\t\t\t\tcode: \"PN_COLUMN_REQUIRED_UNMAPPED\",\n\t\t\t\tmessage: `Column \"${column.columnName}\" of table \"${table.tableName}\" is required and has no default, and no field of model \"${modelName}\" maps it, so every insert the ORM makes into the table fails. Make the column nullable, give it a database default, or map it with a field.`,\n\t\t\t\titem: `table \"${table.tableName}\": column \"${column.columnName}\"`,\n\t\t\t\tsummary: \"columns are required, have no default, and no field maps them, so every insert the ORM makes into their tables fails. Make each column nullable, give it a database default, or map it with a field.\"\n\t\t\t});\n\t\t}\n\t}\n\treturn warnings;\n}\n//#endregion\n//#region src/build-contract.ts\nfunction assertStorageSemantics(contract, indexTypeRegistry, codecLookup) {\n\tconst semanticErrors = validateStorageSemantics(contract.storage);\n\tif (semanticErrors.length > 0) throw contractError(\"CONTRACT.VALIDATION_FAILED\", `Contract semantic validation failed: ${semanticErrors.join(\"; \")}`, { meta: { errors: semanticErrors } });\n\tvalidateIndexTypes(contract, indexTypeRegistry, (codecId) => codecLookup.descriptorFor(codecId)?.traits);\n}\nfunction collectStorageNamespaceCoordinateIds(definition) {\n\tconst defaultNamespaceId = definition.target.defaultNamespaceId;\n\tconst declared = [\n\t\t...definition.namespaces ?? [],\n\t\t...definition.models.map((model) => model.namespaceId),\n\t\t...(definition.tables ?? []).map((table) => table.namespaceId),\n\t\t...Object.keys(definition.attachedEntities ?? {})\n\t];\n\treturn /* @__PURE__ */ new Set([defaultNamespaceId, ...declared.map((id) => namespaceIdOrDefault(id, defaultNamespaceId))]);\n}\nfunction ensureUnboundNamespaceSlot(namespaces, createNamespace) {\n\tif (Object.hasOwn(namespaces, UNBOUND_NAMESPACE_ID)) return namespaces;\n\tconst unbound = createNamespace({\n\t\tid: UNBOUND_NAMESPACE_ID,\n\t\tentries: { table: {} }\n\t});\n\treturn {\n\t\t[UNBOUND_NAMESPACE_ID]: unbound,\n\t\t...namespaces\n\t};\n}\nfunction declaredTableKeys(definition) {\n\tconst defaultNamespaceId = definition.target.defaultNamespaceId;\n\treturn /* @__PURE__ */ new Set([...definition.models.map((model) => tableKey(modelNamespaceId(model, defaultNamespaceId), model.tableName)), ...(definition.tables ?? []).map((table) => tableKey(namespaceIdOrDefault(table.namespaceId, defaultNamespaceId), table.tableName))]);\n}\n/**\n* Builds the contract in two stages. First each model is converted on its own into the table it describes and its domain model, and each table node into the table it describes. Then the tables are merged, each is lowered, and the contract is assembled.\n*/\nfunction enabledCapabilities(matrix) {\n\tconst enabled = {};\n\tfor (const [namespace, flags] of Object.entries(matrix)) {\n\t\tconst enabledFlags = Object.fromEntries(Object.entries(flags).filter(([, flag]) => flag).map(([name]) => [name, true]));\n\t\tif (Object.keys(enabledFlags).length > 0) enabled[namespace] = enabledFlags;\n\t}\n\treturn enabled;\n}\nfunction buildSqlContractFromDefinition(definition, codecLookup, dataTypeLookup) {\n\tconst lookups = {\n\t\tcodecLookup,\n\t\tdataTypeLookup\n\t};\n\tconst target = definition.target.targetId;\n\tconst defaultNamespaceId = definition.target.defaultNamespaceId;\n\tconst indexTypeRegistry = indexTypeRegistryOf(definition.target, Object.values(definition.extensions ?? {}));\n\tconst qualifyColumnType = resolveColumnTypeQualifier(definition.target);\n\tconst storageTypes = definition.storageTypes ?? {};\n\tconst targetFamily = \"sql\";\n\tconst modelDescriptionContext = {\n\t\t...modelLookupsOf(definition),\n\t\tdeclaredTables: declaredTableKeys(definition),\n\t\tforeignKeyDefaults: definition.foreignKeyDefaults,\n\t\tstorageTypes,\n\t\tqualifyColumnType\n\t};\n\tconst components = definition.models.map((model) => describeModel(model, modelDescriptionContext));\n\tconst tableNodes = (definition.tables ?? []).map((table) => describeTableNode(table, modelDescriptionContext));\n\tconst authoringWarnings = [...definition.warnings ?? []];\n\tconst collectedColumnEntities = {};\n\tconst tableLoweringContext = {\n\t\tlookups,\n\t\tstorageTypes,\n\t\tdefaultNamespaceId,\n\t\tqualifyColumnType,\n\t\trenderCheckExpressions: resolveCheckExpressionRenderer(definition.target),\n\t\tcollectedColumnEntities,\n\t\tdefaultControlPolicy: definition.defaultControlPolicy,\n\t\tindexTypeRegistry,\n\t\twarnings: authoringWarnings\n\t};\n\tconst tablesByNamespace = {};\n\tconst modelStorages = components.map((c) => c.storage);\n\tconst tables = mergeTables(modelStorages, tableNodes);\n\tauthoringWarnings.push(...requiredUnmappedColumnWarnings(modelStorages, tables));\n\tfor (const table of tables) {\n\t\tconst namespaceTables = tablesByNamespace[table.namespaceId] ?? {};\n\t\tnamespaceTables[table.tableName] = lowerTable(table, tableLoweringContext);\n\t\ttablesByNamespace[table.namespaceId] = namespaceTables;\n\t}\n\tconst executionDefaults = components.flatMap((c) => c.domain.executionDefaults);\n\tconst modelsByNamespace = {};\n\tfor (const { domain } of components) {\n\t\tconst namespaceModels = modelsByNamespace[domain.namespaceId] ?? {};\n\t\tnamespaceModels[domain.modelName] = domain.model;\n\t\tmodelsByNamespace[domain.namespaceId] = namespaceModels;\n\t}\n\tconst roots = buildRoots(components);\n\tconst documentTypes = Object.fromEntries(Object.entries(storageTypes).map(([name, entry]) => [name, toStorageTypeInstance({\n\t\tcodecId: entry.codecId,\n\t\tdataType: sqlDataTypeOfCodec(entry.codecId, lookups).id,\n\t\ttypeParams: entry.typeParams\n\t})]));\n\tconst namespaceCoordinateIds = collectStorageNamespaceCoordinateIds(definition);\n\tconst domainEnumsByNs = {};\n\tconst storageValueSetsByNs = {};\n\tfor (const [enumName, handle] of Object.entries(definition.enums ?? {})) {\n\t\tif (enumName !== handle.enumName) throw contractError(\"CONTRACT.ENUM_INVALID\", `enum declaration key \"${enumName}\" must match enumType name \"${handle.enumName}\". Aliases are not supported.`, { meta: {\n\t\t\tenumName: handle.enumName,\n\t\t\tdeclarationKey: enumName,\n\t\t\treason: \"key-name-mismatch\"\n\t\t} });\n\t\tconst nsId = defaultNamespaceId;\n\t\tlet domainSlot = domainEnumsByNs[nsId];\n\t\tif (domainSlot === void 0) {\n\t\t\tdomainSlot = {};\n\t\t\tdomainEnumsByNs[nsId] = domainSlot;\n\t\t}\n\t\tconst storedMembers = encodeEnumTypeMembers(handle, codecLookup, \"the column\");\n\t\tdomainSlot[enumName] = {\n\t\t\tcodecId: handle.codecId,\n\t\t\tmembers: storedMembers\n\t\t};\n\t\tlet storageSlot = storageValueSetsByNs[nsId];\n\t\tif (storageSlot === void 0) {\n\t\t\tstorageSlot = {};\n\t\t\tstorageValueSetsByNs[nsId] = storageSlot;\n\t\t}\n\t\tstorageSlot[enumName] = {\n\t\t\tkind: \"valueSet\",\n\t\t\tvalues: storedMembers.map((member) => member.value)\n\t\t};\n\t}\n\tconst { createNamespace } = definition;\n\tconst entityTypesByDiscriminator = collectEntityTypeDescriptorsByDiscriminator(definition);\n\tconst namespaces = Object.fromEntries([...namespaceCoordinateIds].sort().map((id) => {\n\t\tconst entitiesForNs = mergeColumnAndAttachedEntities(id, definition.attachedEntities?.[id], collectedColumnEntities[id]);\n\t\tassertNoManagedEntityKinds(id, entitiesForNs);\n\t\tconst enumValueSetEntries = storageValueSetsByNs[id];\n\t\tconst packValueSetEntries = deriveEntityValueSets(entitiesForNs, entityTypesByDiscriminator);\n\t\tconst valueSetEntries = enumValueSetEntries !== void 0 || packValueSetEntries !== void 0 ? mergeNamespaceValueSets(id, enumValueSetEntries, packValueSetEntries) : void 0;\n\t\tconst nsInput = {\n\t\t\tid,\n\t\t\tentries: {\n\t\t\t\ttable: tablesByNamespace[id] ?? {},\n\t\t\t\t...entitiesForNs,\n\t\t\t\t...valueSetEntries !== void 0 && Object.keys(valueSetEntries).length > 0 ? { valueSet: valueSetEntries } : {}\n\t\t\t}\n\t\t};\n\t\treturn [id, createNamespace(nsInput)];\n\t}));\n\tconst storageWithoutHash = {\n\t\t...Object.keys(documentTypes).length > 0 ? { types: documentTypes } : {},\n\t\tnamespaces: defaultNamespaceId === UNBOUND_NAMESPACE_ID ? ensureUnboundNamespaceSlot(namespaces, createNamespace) : namespaces\n\t};\n\tconst storageHash = definition.storageHash ? coreHash(definition.storageHash) : computeStorageHash({\n\t\ttarget,\n\t\ttargetFamily,\n\t\tstorage: blindCast(storageWithoutHash),\n\t\t...sqlContractCanonicalizationHooks\n\t});\n\tconst storage = new SqlStorage({\n\t\t...storageWithoutHash,\n\t\tstorageHash\n\t});\n\tconst extensionNamespaces = definition.extensions ? Object.values(definition.extensions).map((pack) => pack.id) : void 0;\n\tconst extensions = { ...definition.extensions || {} };\n\tif (extensionNamespaces) {\n\t\tfor (const namespace of extensionNamespaces) if (!Object.hasOwn(extensions, namespace)) extensions[namespace] = {};\n\t}\n\tconst capabilities = enabledCapabilities(mergeCapabilityMatrices({}, [\n\t\tdefinition.target,\n\t\t...definition.capabilities ? [{ capabilities: definition.capabilities }] : [],\n\t\t...Object.values(definition.extensions ?? {})\n\t]));\n\tconst profileHash = computeProfileHash({\n\t\ttarget,\n\t\ttargetFamily,\n\t\tcapabilities: {}\n\t});\n\tconst executionWithHash = buildExecutionSection({\n\t\ttarget,\n\t\ttargetFamily,\n\t\tdefaults: executionDefaults\n\t});\n\tconst valueObjects = definition.valueObjects && definition.valueObjects.length > 0 ? Object.fromEntries(definition.valueObjects.map((vo) => [vo.name, { fields: Object.fromEntries(vo.fields.map((f) => [f.fieldName, buildDomainField(f, defaultNamespaceId, storageTypes)])) }])) : void 0;\n\tconst domainNamespaceIds = new Set(Object.keys(modelsByNamespace));\n\tif (domainNamespaceIds.size === 0) domainNamespaceIds.add(defaultNamespaceId);\n\tif (valueObjects !== void 0) domainNamespaceIds.add(defaultNamespaceId);\n\tfor (const nsId of Object.keys(domainEnumsByNs)) domainNamespaceIds.add(nsId);\n\tconst domainNamespaces = Object.fromEntries([...domainNamespaceIds].sort().map((namespaceId) => {\n\t\tconst modelsInNs = modelsByNamespace[namespaceId] ?? {};\n\t\tconst enumsInNs = domainEnumsByNs[namespaceId];\n\t\treturn [namespaceId, {\n\t\t\tmodels: modelsInNs,\n\t\t\t...namespaceId === defaultNamespaceId && valueObjects !== void 0 ? { valueObjects } : {},\n\t\t\t...enumsInNs !== void 0 && Object.keys(enumsInNs).length > 0 ? { enum: enumsInNs } : {}\n\t\t}];\n\t}));\n\tconst contract = {\n\t\ttarget,\n\t\ttargetFamily,\n\t\t...ifDefined(\"defaultControlPolicy\", definition.defaultControlPolicy),\n\t\tdomain: { namespaces: domainNamespaces },\n\t\troots,\n\t\tstorage,\n\t\t...executionWithHash ? { execution: executionWithHash } : {},\n\t\textensions,\n\t\tcapabilities,\n\t\tprofileHash,\n\t\tmeta: {}\n\t};\n\tassertStorageSemantics(contract, indexTypeRegistry, codecLookup);\n\tflushAuthoringWarnings(authoringWarnings);\n\treturn contract;\n}\n/**\n* Aggregate roots, one per model that owns a table, keyed by bare storage table name. When two models in different namespaces map to the same bare table name, the bare key would collide, so those entries fall back to a namespace-qualified key. Single-namespace contracts never collide and keep their bare keys.\n*/\nfunction buildRoots(components) {\n\tconst rootEntries = components.flatMap(({ storage, domain }) => storage.kind === \"ownTable\" ? [{\n\t\ttableName: storage.table.tableName,\n\t\tnamespaceId: domain.namespaceId,\n\t\tref: crossRef(domain.modelName, domain.namespaceId)\n\t}] : []);\n\tconst rootTableNameCounts = /* @__PURE__ */ new Map();\n\tfor (const entry of rootEntries) rootTableNameCounts.set(entry.tableName, (rootTableNameCounts.get(entry.tableName) ?? 0) + 1);\n\tconst roots = {};\n\tfor (const entry of rootEntries) {\n\t\tconst key = (rootTableNameCounts.get(entry.tableName) ?? 0) > 1 ? `${entry.namespaceId}.${entry.tableName}` : entry.tableName;\n\t\troots[key] = entry.ref;\n\t}\n\treturn roots;\n}\n//#endregion\n//#region src/derived-checks.ts\n/**\n* The one step every SQL contract specifier funnels its loaded contract\n* through: stamp the specifier's default control policy, then strip derived\n* checks from every table the stamped policy leaves non-managed. Composing the\n* two here is what keeps the managed-only consequence from being skipped on\n* any specifier route.\n*/\nfunction applySqlSpecifierControlPolicy(contract, defaultControlPolicy, createNamespace) {\n\treturn stripDerivedChecksFromNonManagedTables(applySpecifierDefaultControlPolicy(contract, defaultControlPolicy), createNamespace);\n}\n/**\n* Removes generated enforcement checks from every table whose effective\n* control policy is not `managed`.\n*\n* A check is derived iff its wire prefix is one derivation would produce for\n* some column of its table — {@link derivedCheckPrefixes} enumerates that\n* set. Wire-naming alone no longer identifies derivation: an authored\n* `name:` check (`@@check` / `check()`) is wire-named too, so a bare\n* `check.prefix === undefined` test would delete an author's own constraint\n* from every non-`managed` table. The prefix-shape rule tests against the\n* table's own columns instead of the naming mode, so an authored check with\n* an unrelated prefix survives.\n*\n* The rule is weaker than recomputing the content hash `contract infer`\n* uses: that needs `postgresRenderCheckExpressions` to know what a kind\n* renders, and this funnel has no target descriptor to reach it through. It\n* can only ask whether some column could have produced a prefix of this\n* shape, not whether this exact column produced this exact check. The gap\n* that opens — an authored name that collides with a derived-prefix shape —\n* is closed at authoring time instead: such a name is rejected\n* (`CONTRACT.CHECK_NAME_RESERVED`) before it ever reaches storage.\n*\n* Why derivation stops at the namespace boundary: the contract *describes* an\n* external schema, it does not *prescribe* enforcement for it. Deriving a check\n* for a table Prisma 8 never creates declares a constraint the live database\n* has no reason to carry, and `external` fails verify on a declared shape the\n* database lacks — an unfixable failure, since no plan may emit DDL there\n* either.\n*\n* This is the post-build half of the rule. Authoring skips derivation for a\n* table whose policy is known in the source; this pass catches the policy a\n* contract *specifier* applies after the contract is already built, which is\n* the only signal a pack like the Supabase extension gives. Specifiers reach\n* it through `applySqlSpecifierControlPolicy` above.\n*\n* Returns the contract unchanged (same reference) when nothing is stripped.\n* When something is, the storage hash is recomputed — the stripped contract\n* describes different storage.\n*/\nfunction stripDerivedChecksFromNonManagedTables(contract, createNamespace) {\n\tconst storage = contract.storage;\n\tif (!isSqlStorageShaped(storage)) return contract;\n\tlet anyStripped = false;\n\tconst namespaces = {};\n\tfor (const [namespaceId, namespace] of Object.entries(storage.namespaces)) {\n\t\tif (!isMaterializedSqlNamespace(namespace)) return contract;\n\t\tconst tables = namespace.entries[\"table\"];\n\t\tif (tables === void 0) {\n\t\t\tnamespaces[namespaceId] = namespace;\n\t\t\tcontinue;\n\t\t}\n\t\tlet namespaceStripped = false;\n\t\tconst nextTables = {};\n\t\tfor (const [tableName, table] of Object.entries(tables)) {\n\t\t\tconst stripped = StorageTable.is(table) ? withoutDerivedChecks(tableName, table, contract.defaultControlPolicy) : table;\n\t\t\tif (stripped !== table) namespaceStripped = true;\n\t\t\tnextTables[tableName] = stripped;\n\t\t}\n\t\tif (!namespaceStripped) {\n\t\t\tnamespaces[namespaceId] = namespace;\n\t\t\tcontinue;\n\t\t}\n\t\tanyStripped = true;\n\t\tnamespaces[namespaceId] = createNamespace({\n\t\t\tid: namespace.id,\n\t\t\tentries: {\n\t\t\t\t...namespace.entries,\n\t\t\t\ttable: nextTables\n\t\t\t}\n\t\t});\n\t}\n\tif (!anyStripped) return contract;\n\tconst storageWithoutHash = {\n\t\tnamespaces,\n\t\t...ifDefined(\"types\", storage.types)\n\t};\n\treturn {\n\t\t...contract,\n\t\tstorage: new SqlStorage({\n\t\t\t...storageWithoutHash,\n\t\t\tstorageHash: computeStorageHash({\n\t\t\t\ttarget: contract.target,\n\t\t\t\ttargetFamily: contract.targetFamily,\n\t\t\t\tstorage: storageWithoutHash,\n\t\t\t\t...sqlContractCanonicalizationHooks\n\t\t\t})\n\t\t})\n\t};\n}\n/**\n* Structural stand-in for `instanceof SqlStorage`: like the checks it wraps, a\n* storage instance can arrive from a realm whose IR classes are a separate\n* copy (the dist e2e shape), where an `instanceof` test would miss.\n*/\nfunction isSqlStorageShaped(x) {\n\tif (typeof x !== \"object\" || x === null || !(\"namespaces\" in x)) return false;\n\treturn typeof x.namespaces === \"object\" && x.namespaces !== null;\n}\n/** The table itself when it keeps every check, a rebuilt one when it does not. */\nfunction withoutDerivedChecks(tableName, table, contractDefault) {\n\tconst checks = table.checks;\n\tif (checks === void 0 || checks.length === 0) return table;\n\tif (effectiveControlPolicy(table.control, contractDefault) === \"managed\") return table;\n\tconst columnNames = Object.keys(table.columns);\n\tinvariant(columnNames.length > 0, `withoutDerivedChecks: table \"${tableName}\" carries checks but its column map is empty. The caller must pass the table's real, complete column set — an empty or partial map makes every check misclassify as non-derived and survive the strip.`);\n\tconst derivedPrefixes = derivedCheckPrefixes(tableName, columnNames);\n\tconst kept = checks.filter((check) => check.prefix === void 0 || !derivedPrefixes.has(check.prefix));\n\tif (kept.length === checks.length) return table;\n\treturn new StorageTable({\n\t\tcolumns: table.columns,\n\t\tuniques: table.uniques,\n\t\tindexes: table.indexes,\n\t\tforeignKeys: table.foreignKeys,\n\t\t...ifDefined(\"primaryKey\", table.primaryKey),\n\t\t...ifDefined(\"control\", table.control),\n\t\t...kept.length > 0 ? { checks: kept.map((check) => checkConstraintInputFromSerialized({\n\t\t\tname: check.name,\n\t\t\t...ifDefined(\"prefix\", check.prefix),\n\t\t\texpression: check.expression\n\t\t})) } : {}\n\t});\n}\n//#endregion\nexport { storedAsListColumn as a, isValueObjectMember as i, buildSqlContractFromDefinition as n, contractError as o, toOneNullabilityContradictionMessage as r, applySqlSpecifierControlPolicy as t };\n\n//# sourceMappingURL=derived-checks-B1qNxwBL.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAS,cAAc,MAAM,SAAS,SAAS;CAC9C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;;;;AAMA,SAAS,mBAAmB,OAAO;CAClC,OAAO,MAAM,QAAQ,CAAC,MAAM;AAC7B;;AAEA,SAAS,oBAAoB,OAAO;CACnC,OAAO,qBAAqB;AAC7B;;AAIA,SAAS,eAAe,QAAQ,MAAM;CACrC,OAAO;EACN,YAAY,OAAO;EACnB,YAAY,OAAO;EACnB,UAAU,OAAO;EACjB,MAAM,OAAO,SAAS,OAAO,EAAE,iBAAiB,OAAO,oBAAoB,KAAK,IAAI;EACpF,SAAS,OAAO;EAChB,gBAAg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F"}
|
|
@@ -12,10 +12,10 @@ function describeUnresolvedSqlType() {
|
|
|
12
12
|
const [argument] = call.args;
|
|
13
13
|
const typeName = argument?.kind === "positional" ? parseQuotedStringLiteral(argument.value) : void 0;
|
|
14
14
|
if (typeName === void 0) return void 0;
|
|
15
|
-
return `Unsupported(${JSON.stringify(typeName)}) is not a Prisma 8 type. Write the column's type with a type constructor. If ${JSON.stringify(typeName)} comes from a database extension that has a Prisma 8 pack, add the pack to extensions in prisma.config.ts.`;
|
|
15
|
+
return `Unsupported(${JSON.stringify(typeName)}) is not a Prisma 8 type. Write the column's type with a type constructor, or as Raw(${JSON.stringify(typeName)}) when no type constructor names it. If ${JSON.stringify(typeName)} comes from a database extension that has a Prisma 8 pack, add the pack to extensions in prisma.config.ts.`;
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
//#endregion
|
|
19
19
|
export { describeUnresolvedSqlType as t };
|
|
20
20
|
|
|
21
|
-
//# sourceMappingURL=diagnostics-
|
|
21
|
+
//# sourceMappingURL=diagnostics-xqFRhSin.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostics-
|
|
1
|
+
{"version":3,"file":"diagnostics-xqFRhSin.mjs","names":[],"sources":["../../../../2-sql/2-authoring/contract-psl/dist/diagnostics.mjs"],"sourcesContent":["import { a as parseQuotedStringLiteral } from \"./psl-attribute-parsing-BCsFWsSp.mjs\";\n//#region src/unresolved-type.ts\n/**\n* The message for a field type the binder cannot find. `Unsupported(\"x\")`, the Prisma 6 and\n* Prisma 7 way to keep a column of a type those versions do not know, is named as no Prisma 8\n* type; any other name keeps the binder's message.\n*/\nfunction describeUnresolvedSqlType() {\n\treturn ({ field, written }) => {\n\t\tconst call = field.typeConstructor;\n\t\tif (written !== \"Unsupported\" || call === void 0 || call.args.length !== 1) return;\n\t\tconst [argument] = call.args;\n\t\tconst typeName = argument?.kind === \"positional\" ? parseQuotedStringLiteral(argument.value) : void 0;\n\t\tif (typeName === void 0) return void 0;\n\t\treturn `Unsupported(${JSON.stringify(typeName)}) is not a Prisma 8 type. Write the column's type with a type constructor, or as Raw(${JSON.stringify(typeName)}) when no type constructor names it. If ${JSON.stringify(typeName)} comes from a database extension that has a Prisma 8 pack, add the pack to extensions in prisma.config.ts.`;\n\t};\n}\n//#endregion\nexport { describeUnresolvedSqlType };\n\n//# sourceMappingURL=diagnostics.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,4BAA4B;CACpC,QAAQ,EAAE,OAAO,cAAc;EAC9B,MAAM,OAAO,MAAM;EACnB,IAAI,YAAY,iBAAiB,SAAS,KAAK,KAAK,KAAK,KAAK,WAAW,GAAG;EAC5E,MAAM,CAAC,YAAY,KAAK;EACxB,MAAM,WAAW,UAAU,SAAS,eAAe,yBAAyB,SAAS,KAAK,IAAI,KAAK;EACnG,IAAI,aAAa,KAAK,GAAG,OAAO,KAAK;EACrC,OAAO,eAAe,KAAK,UAAU,QAAQ,EAAE,uFAAuF,KAAK,UAAU,QAAQ,EAAE,0CAA0C,KAAK,UAAU,QAAQ,EAAE;CACnO;AACD"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { l as SqlStorage } from "./sql-storage-tZhB8nS5-8NSWT0TW.mjs";
|
|
2
2
|
import "./types-B2Dee96w.mjs";
|
|
3
|
-
import { S as SqlSchemaIRNode } from "./types-
|
|
4
|
-
import "./types-
|
|
5
|
-
import { n as CodecControlHooks } from "./types-DlFdMaDJ-
|
|
6
|
-
import { t as SqlSchemaDiffFn } from "./schema-differ-DmP74bB8-
|
|
3
|
+
import { S as SqlSchemaIRNode } from "./types-DiD6BqoN-ZF53hwPp.mjs";
|
|
4
|
+
import "./types-D_nlUp-1.mjs";
|
|
5
|
+
import { n as CodecControlHooks } from "./types-DlFdMaDJ-BEDwj-Qv.mjs";
|
|
6
|
+
import { t as SqlSchemaDiffFn } from "./schema-differ-DmP74bB8-BfEQ_9cY.mjs";
|
|
7
7
|
import { Contract, ControlPolicy } from "@prisma/orm-framework/contract/types";
|
|
8
8
|
import { TargetBoundComponentDescriptor } from "@prisma/orm-framework/components/components";
|
|
9
9
|
import { DiffSubjectGranularity, SchemaDiffIssue, VerifierIssueCategory, VerifyDatabaseSchemaResult } from "@prisma/orm-framework/components/control";
|
|
@@ -114,4 +114,4 @@ declare function verifySqlSchemaByDiff(input: VerifySqlSchemaByDiffInput): Verif
|
|
|
114
114
|
declare function arraysEqual(a: readonly string[], b: readonly string[]): boolean;
|
|
115
115
|
//#endregion
|
|
116
116
|
export { VerifySqlSchemaByDiffInput as a, classifySqlDiffIssue as c, verifySqlSchemaByDiff as d, StorageTypeVerdictInput as i, computeSqlDiffVerdict as l, SqlDiffVerdictInput as n, arraysEqual as o, StorageTypeVerdict as r, classifyDiffSubjectGranularity as s, SqlDiffVerdict as t, computeStorageTypeVerdict as u };
|
|
117
|
-
//# sourceMappingURL=diff-
|
|
117
|
+
//# sourceMappingURL=diff-BN_3K9lv.d.mts.map
|