@prisma/orm-family-sql 8.0.0-rc.13-dev.10 → 8.0.0-rc.13-dev.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ast-Bhj549wG.mjs → ast-CJd4157-.mjs} +262 -2
- package/dist/ast-CJd4157-.mjs.map +1 -0
- package/dist/{ast-B9jF6tRJ.d.mts → ast-DQU1yUQ5.d.mts} +30 -2
- package/dist/ast-DQU1yUQ5.d.mts.map +1 -0
- package/dist/{authored-check-naming-9UFx77db.mjs → authored-check-naming-CJRDf9-V.mjs} +3 -3
- package/dist/{authored-check-naming-9UFx77db.mjs.map → authored-check-naming-CJRDf9-V.mjs.map} +1 -1
- package/dist/{authoring-type-constructors-DQZEX4Sb-DORF5BnN.mjs → authoring-type-constructors-DQZEX4Sb-DXWRbv5g.mjs} +2 -2
- package/dist/{authoring-type-constructors-DQZEX4Sb-DORF5BnN.mjs.map → authoring-type-constructors-DQZEX4Sb-DXWRbv5g.mjs.map} +1 -1
- package/dist/builder.d.mts +1 -1
- package/dist/builder__runtime.d.mts +2 -2
- package/dist/builder__runtime.mjs +1 -1
- package/dist/builder__types.d.mts +1 -1
- package/dist/{codec-descriptor-registry-ECZ4ohtG.mjs → codec-descriptor-registry-Cj-tqpFL.mjs} +2 -2
- package/dist/{codec-descriptor-registry-ECZ4ohtG.mjs.map → codec-descriptor-registry-Cj-tqpFL.mjs.map} +1 -1
- package/dist/{config-types-DlxXpXqA.mjs → config-types-Di1Q5l7a.mjs} +2 -2
- package/dist/{config-types-DlxXpXqA.mjs.map → config-types-Di1Q5l7a.mjs.map} +1 -1
- package/dist/{contract-builder-BKfGg37_.mjs → contract-builder-CqKOW_SG.mjs} +4 -4
- package/dist/{contract-builder-BKfGg37_.mjs.map → contract-builder-CqKOW_SG.mjs.map} +1 -1
- package/dist/contract-prisma7__provider.mjs +3 -3
- package/dist/contract-psl.mjs +1 -1
- package/dist/contract-psl__attribute-specs.mjs +1 -1
- package/dist/contract-psl__provider.mjs +2 -2
- package/dist/contract-psl__provider.mjs.map +1 -1
- 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.mjs +9 -9
- package/dist/contract__authored-check-naming.mjs +1 -1
- package/dist/contract__entity-kinds.mjs +1 -1
- package/dist/contract__factories.mjs +1 -1
- package/dist/contract__foreign-key-materialization.mjs +1 -1
- package/dist/contract__index-naming.mjs +1 -1
- package/dist/contract__types.mjs +3 -3
- package/dist/contract__validators.mjs +2 -2
- package/dist/{control-DUrW46cS.mjs → control-D2BWxH9A.mjs} +35 -18
- package/dist/control-D2BWxH9A.mjs.map +1 -0
- package/dist/{control-adapter-C99J7aEF-Bu-VCRbv.d.mts → control-adapter-C99J7aEF-B571Jffd.d.mts} +4 -4
- package/dist/{control-adapter-C99J7aEF-Bu-VCRbv.d.mts.map → control-adapter-C99J7aEF-B571Jffd.d.mts.map} +1 -1
- package/dist/control-adapter-jmL_K-jB.d.mts +1 -0
- package/dist/{control-VctoviCf.d.mts → control-kbS8DWF0.d.mts} +26 -9
- package/dist/{control-VctoviCf.d.mts.map → control-kbS8DWF0.d.mts.map} +1 -1
- package/dist/{db-DLjWu9-f-6BG2QArC.d.mts → db-DLjWu9-f-CVAu8jgd.d.mts} +2 -2
- package/dist/{db-DLjWu9-f-6BG2QArC.d.mts.map → db-DLjWu9-f-CVAu8jgd.d.mts.map} +1 -1
- package/dist/{derived-checks-Bsrdb2Wk-D4UfM06W.mjs → derived-checks-Bsrdb2Wk-rF0rGsWO.mjs} +10 -10
- package/dist/{derived-checks-Bsrdb2Wk-D4UfM06W.mjs.map → derived-checks-Bsrdb2Wk-rF0rGsWO.mjs.map} +1 -1
- package/dist/{diff-B2b34L_E.d.mts → diff-BxwNI8yE.d.mts} +6 -6
- package/dist/{diff-B2b34L_E.d.mts.map → diff-BxwNI8yE.d.mts.map} +1 -1
- package/dist/{entity-kinds-D7vwoN_T-CCBwFJy0.mjs → entity-kinds-D7vwoN_T-NmeI6TpT.mjs} +3 -3
- package/dist/{entity-kinds-D7vwoN_T-CCBwFJy0.mjs.map → entity-kinds-D7vwoN_T-NmeI6TpT.mjs.map} +1 -1
- package/dist/{factories-SVor5xIT.mjs → factories-aJoZYxkD.mjs} +3 -3
- package/dist/{factories-SVor5xIT.mjs.map → factories-aJoZYxkD.mjs.map} +1 -1
- package/dist/family.d.mts +9 -9
- package/dist/family.mjs +7 -7
- package/dist/family__control-adapter.d.mts +2 -2
- package/dist/family__control.d.mts +4 -4
- package/dist/family__control.mjs +4 -4
- package/dist/family__diff.d.mts +2 -2
- 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.mjs +2 -2
- 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-B3HQzQIA.mjs → foreign-key-materialization-DiOhEeAz.mjs} +3 -3
- package/dist/{foreign-key-materialization-B3HQzQIA.mjs.map → foreign-key-materialization-DiOhEeAz.mjs.map} +1 -1
- package/dist/{index-naming-Cj1Anq-T-w1JL7-EM.mjs → index-naming-Cj1Anq-T-C9TevpPR.mjs} +2 -2
- package/dist/{index-naming-Cj1Anq-T-w1JL7-EM.mjs.map → index-naming-Cj1Anq-T-C9TevpPR.mjs.map} +1 -1
- package/dist/{index-B-CraAhf.d.mts → index-yNeNt2GO.d.mts} +3 -3
- package/dist/{index-B-CraAhf.d.mts.map → index-yNeNt2GO.d.mts.map} +1 -1
- package/dist/{interpreter-BMMGMTBa-CT5iKl13.mjs → interpreter-gs7fSAIb-BamHnI2q.mjs} +202 -224
- package/dist/interpreter-gs7fSAIb-BamHnI2q.mjs.map +1 -0
- package/dist/{migration-9GrLWqGg.d.mts → migration-BJCmLNwu.d.mts} +2 -2
- package/dist/{migration-9GrLWqGg.d.mts.map → migration-BJCmLNwu.d.mts.map} +1 -1
- package/dist/{naming-DKr4TJd7-Cszhq9RV.mjs → naming-Cc_t1q6s-CouBOmqZ.mjs} +2 -2
- package/dist/{naming-DKr4TJd7-Cszhq9RV.mjs.map → naming-Cc_t1q6s-CouBOmqZ.mjs.map} +1 -1
- package/dist/orm-client.d.mts +3 -3
- package/dist/orm-client.mjs +2 -2
- package/dist/{prepared-statement-BHSj2pDk-CRzjNpcv.d.mts → prepared-statement-BHSj2pDk-BL0wOCnq.d.mts} +2 -2
- package/dist/{prepared-statement-BHSj2pDk-CRzjNpcv.d.mts.map → prepared-statement-BHSj2pDk-BL0wOCnq.d.mts.map} +1 -1
- package/dist/{psl-build-Cp32ahjI.mjs → psl-build-SOpIFu24.mjs} +7 -4
- package/dist/psl-build-SOpIFu24.mjs.map +1 -0
- package/dist/{psl-infer-DwMyO-IV.mjs → psl-infer-8kKfa-Ts.mjs} +2 -2
- package/dist/{psl-infer-DwMyO-IV.mjs.map → psl-infer-8kKfa-Ts.mjs.map} +1 -1
- package/dist/{psl-infer-BzjA7U3b.d.mts → psl-infer-C8hg8mIS.d.mts} +3 -3
- package/dist/{psl-infer-BzjA7U3b.d.mts.map → psl-infer-C8hg8mIS.d.mts.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/relational-core__codec-descriptor-registry.mjs +1 -1
- package/dist/runtime.d.mts +3 -3
- package/dist/runtime.mjs +1 -1
- package/dist/runtime__internal__prepared-query.d.mts +1 -1
- package/dist/{schema-differ-DpG_gnur-B_rj2WAH.d.mts → schema-differ-DpG_gnur-3ciAcy28.d.mts} +3 -3
- package/dist/{schema-differ-DpG_gnur-B_rj2WAH.d.mts.map → schema-differ-DpG_gnur-3ciAcy28.d.mts.map} +1 -1
- package/dist/schema-ir.d.mts +2 -2
- package/dist/schema-ir.mjs +2 -2
- package/dist/schema-ir__naming.mjs +1 -1
- package/dist/schema-ir__types.d.mts +3 -3
- package/dist/schema-ir__types.mjs +2 -2
- package/dist/{schema-verify-DI0aJQ9d-D5SmSZg3.mjs → schema-verify-DI0aJQ9d-Bgbmen10.mjs} +2 -2
- package/dist/{schema-verify-DI0aJQ9d-D5SmSZg3.mjs.map → schema-verify-DI0aJQ9d-Bgbmen10.mjs.map} +1 -1
- package/dist/{serialized-index-nBTwanKy-_ddEK4tk.mjs → serialized-index-nBTwanKy-B0C03Q_R.mjs} +3 -3
- package/dist/{serialized-index-nBTwanKy-_ddEK4tk.mjs.map → serialized-index-nBTwanKy-B0C03Q_R.mjs.map} +1 -1
- package/dist/{sql-attribute-specs-4YqT9Gt_-DkPyYEaE.mjs → sql-attribute-specs-Bs9QDuS7-DmIRJUz9.mjs} +38 -8
- package/dist/sql-attribute-specs-Bs9QDuS7-DmIRJUz9.mjs.map +1 -0
- package/dist/{sql-contract-serializer-C90xg7_q-A3_F0w7f.mjs → sql-contract-serializer-C90xg7_q-DERDzTD5.mjs} +4 -4
- package/dist/{sql-contract-serializer-C90xg7_q-A3_F0w7f.mjs.map → sql-contract-serializer-C90xg7_q-DERDzTD5.mjs.map} +1 -1
- package/dist/{storage-table-ZzbR-xzQ-BRoTQE_2.mjs → storage-table-ZzbR-xzQ-C8gXT45E.mjs} +2 -2
- package/dist/{storage-table-ZzbR-xzQ-BRoTQE_2.mjs.map → storage-table-ZzbR-xzQ-C8gXT45E.mjs.map} +1 -1
- package/dist/types-BBT7jidC.d.mts +1 -0
- package/dist/{types-BFPRCYGW-DWAEoFj7.d.mts → types-BFPRCYGW-BLH0sK1Y.d.mts} +4 -4
- package/dist/{types-BFPRCYGW-DWAEoFj7.d.mts.map → types-BFPRCYGW-BLH0sK1Y.d.mts.map} +1 -1
- package/dist/{types-D0B65hip.mjs → types-D8Se4rnB.mjs} +2 -2
- package/dist/{types-D0B65hip.mjs.map → types-D8Se4rnB.mjs.map} +1 -1
- package/dist/{types-CHOgKgHg-BxgkL3GS.d.mts → types-DinsvYdY-Dv_n3Tac.d.mts} +43 -6
- package/dist/types-DinsvYdY-Dv_n3Tac.d.mts.map +1 -0
- package/dist/{types-DvrIPGUN-wxavfzyJ.mjs → types-yyhkYQNT-Dmoq-giA.mjs} +82 -45
- package/dist/types-yyhkYQNT-Dmoq-giA.mjs.map +1 -0
- package/dist/{validators-DecqO0rE.mjs → validators-BlqrBU7I.mjs} +3 -3
- package/dist/{validators-DecqO0rE.mjs.map → validators-BlqrBU7I.mjs.map} +1 -1
- package/package.json +18 -18
- package/dist/ast-B9jF6tRJ.d.mts.map +0 -1
- package/dist/ast-Bhj549wG.mjs.map +0 -1
- package/dist/control-DUrW46cS.mjs.map +0 -1
- package/dist/control-adapter-D4_Oipv6.d.mts +0 -1
- package/dist/interpreter-BMMGMTBa-CT5iKl13.mjs.map +0 -1
- package/dist/psl-build-Cp32ahjI.mjs.map +0 -1
- package/dist/sql-attribute-specs-4YqT9Gt_-DkPyYEaE.mjs.map +0 -1
- package/dist/types-BijNazlM.d.mts +0 -1
- package/dist/types-CHOgKgHg-BxgkL3GS.d.mts.map +0 -1
- package/dist/types-DvrIPGUN-wxavfzyJ.mjs.map +0 -1
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
import { r as SqlObjectNaming } from "./naming-CV9j2pXl-KARaDReS.mjs";
|
|
2
2
|
import { IRNodeBase } from "@prisma/orm-framework/components/ir";
|
|
3
|
-
import { ColumnDefault } from "@prisma/orm-framework/contract/types";
|
|
4
|
-
import { CodecRef } from "@prisma/orm-framework/components/codec";
|
|
3
|
+
import { ColumnDefault, ColumnDefaultLiteralInputValue } from "@prisma/orm-framework/contract/types";
|
|
4
|
+
import { CodecRef, DataType, ToCanonicalForm } from "@prisma/orm-framework/components/codec";
|
|
5
5
|
import { DiffSubjectGranularity, DiffableNode, SchemaNodeRef } from "@prisma/orm-framework/components/control";
|
|
6
|
-
//#region ../../../2-sql/1-core/schema-ir/dist/types-
|
|
6
|
+
//#region ../../../2-sql/1-core/schema-ir/dist/types-DinsvYdY.d.mts
|
|
7
|
+
//#region src/ir/default-in-canonical-form.d.ts
|
|
8
|
+
interface DefaultInCanonicalForm {
|
|
9
|
+
readonly value: ColumnDefaultLiteralInputValue;
|
|
10
|
+
/** The data type's message for the value, or the first list element, it refuses. */
|
|
11
|
+
readonly refusal: string | undefined;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A literal default in the canonical form of the column's data type (ADR 254), element by element
|
|
15
|
+
* for a list column. A `Date` is read as its ISO text first. A value the type refuses is kept as it
|
|
16
|
+
* is, with the type's message.
|
|
17
|
+
*/
|
|
18
|
+
declare function defaultInCanonicalForm(value: ColumnDefaultLiteralInputValue, toCanonicalForm: ToCanonicalForm | undefined, list: boolean): DefaultInCanonicalForm;
|
|
19
|
+
/**
|
|
20
|
+
* The refusal of a contract's literal default that its column's data type does not hold, which a
|
|
21
|
+
* contract emitted by an earlier version can carry, with what to do about it.
|
|
22
|
+
*/
|
|
23
|
+
declare function contractDefaultRefusal(columnDefault: ColumnDefault | undefined, toCanonicalForm: ToCanonicalForm | undefined, list: boolean): string | undefined;
|
|
24
|
+
//#endregion
|
|
7
25
|
//#region src/ir/sql-schema-ir-node.d.ts
|
|
8
26
|
/**
|
|
9
27
|
* SQL Schema IR node base. Carries the family-level
|
|
@@ -205,6 +223,8 @@ interface SqlColumnDefaultIRInput {
|
|
|
205
223
|
readonly codecBaseNativeType?: string;
|
|
206
224
|
/** See {@link import('./sql-column-ir').SqlColumnIRInput.codecNamedType}. */
|
|
207
225
|
readonly codecNamedType?: boolean;
|
|
226
|
+
/** See {@link import('./sql-column-ir').SqlColumnIRInput.dataType}. */
|
|
227
|
+
readonly dataType?: DataType;
|
|
208
228
|
}
|
|
209
229
|
/**
|
|
210
230
|
* Schema-diff node for a column's default value. The default is the one
|
|
@@ -234,6 +254,8 @@ declare class SqlColumnDefaultIR extends SqlSchemaIRNode implements DiffableNode
|
|
|
234
254
|
readonly codecBaseNativeType?: string;
|
|
235
255
|
/** See {@link SqlColumnDefaultIRInput.codecNamedType}. Non-enumerable, same reason as {@link many}. */
|
|
236
256
|
readonly codecNamedType?: boolean;
|
|
257
|
+
/** See {@link SqlColumnDefaultIRInput.dataType}. Non-enumerable, same reason as {@link many}. */
|
|
258
|
+
readonly dataType?: DataType;
|
|
237
259
|
constructor(input: SqlColumnDefaultIRInput);
|
|
238
260
|
get id(): string;
|
|
239
261
|
children(): readonly DiffableNode[];
|
|
@@ -241,11 +263,17 @@ declare class SqlColumnDefaultIR extends SqlSchemaIRNode implements DiffableNode
|
|
|
241
263
|
/**
|
|
242
264
|
* Structured comparison with `this` as the expected side: both sides
|
|
243
265
|
* resolved compare per the relational walk's `columnDefaultsEqual`
|
|
244
|
-
* semantics
|
|
266
|
+
* semantics, a literal through the canonical form of the column's data type when the
|
|
267
|
+
* contract-derived side carries one; a declared expected default against an unparseable actual
|
|
245
268
|
* (raw present, no resolved parse) is a mismatch; two raw-only nodes fall
|
|
246
269
|
* back to raw string equality.
|
|
247
270
|
*/
|
|
248
271
|
isEqualTo(other: DiffableNode): boolean;
|
|
272
|
+
/**
|
|
273
|
+
* The refusal of an expected literal its data type does not hold, which a contract emitted by an
|
|
274
|
+
* earlier version can carry, so the mismatch names its cause.
|
|
275
|
+
*/
|
|
276
|
+
explainMismatch(): string | undefined;
|
|
249
277
|
}
|
|
250
278
|
//#endregion
|
|
251
279
|
//#region src/ir/sql-column-ir.d.ts
|
|
@@ -319,6 +347,13 @@ interface SqlColumnIRInput {
|
|
|
319
347
|
* end)` rendering exactly.
|
|
320
348
|
*/
|
|
321
349
|
readonly codecNamedType?: boolean;
|
|
350
|
+
/**
|
|
351
|
+
* The data type the column's codec represents, from the assembled stack (ADR 254). A literal
|
|
352
|
+
* default compares through its canonical form, so two forms of one value are equal, and DDL
|
|
353
|
+
* writes the canonical form. Stamped on the contract-derived column; absent on introspected
|
|
354
|
+
* nodes.
|
|
355
|
+
*/
|
|
356
|
+
readonly dataType?: DataType;
|
|
322
357
|
}
|
|
323
358
|
/**
|
|
324
359
|
* Schema IR node for a single column on a table, as observed by
|
|
@@ -355,6 +390,8 @@ declare class SqlColumnIR extends SqlSchemaIRNode implements DiffableNode {
|
|
|
355
390
|
readonly codecBaseNativeType?: string;
|
|
356
391
|
/** See {@link SqlColumnIRInput.codecNamedType}. Non-enumerable, same reason as {@link codecRef}. */
|
|
357
392
|
readonly codecNamedType?: boolean;
|
|
393
|
+
/** See {@link SqlColumnIRInput.dataType}. Non-enumerable, same reason as {@link codecRef}. */
|
|
394
|
+
readonly dataType?: DataType;
|
|
358
395
|
constructor(input: SqlColumnIRInput);
|
|
359
396
|
get id(): string;
|
|
360
397
|
/**
|
|
@@ -718,5 +755,5 @@ interface SqlTypeMetadataRegistry {
|
|
|
718
755
|
values(): IterableIterator<SqlTypeMetadata>;
|
|
719
756
|
}
|
|
720
757
|
//#endregion
|
|
721
|
-
export {
|
|
722
|
-
//# sourceMappingURL=types-
|
|
758
|
+
export { relationalNodeEntityKind as A, SqlTypeMetadataRegistry as C, contractDefaultRefusal as D, assertNode as E, defaultInCanonicalForm as O, SqlTypeMetadata as S, SqlUniqueIRInput as T, SqlSchemaIR as _, SqlAnnotations as a, SqlTableIR as b, SqlColumnDefaultIR as c, SqlColumnIRInput as d, SqlForeignKeyIR as f, SqlReferentialAction as g, SqlIndexIRInput as h, RelationalSchemaNodeKind as i, relationalNodeGranularity as j, defineNonEnumerable as k, SqlColumnDefaultIRInput as l, SqlIndexIR as m, PrimaryKey as n, SqlCheckConstraintIR as o, SqlForeignKeyIRInput as p, PrimaryKeyInput as r, SqlCheckConstraintIRInput as s, DefaultInCanonicalForm as t, SqlColumnIR as u, SqlSchemaIRInput as v, SqlUniqueIR as w, SqlTableIRInput as x, SqlSchemaIRNode as y };
|
|
759
|
+
//# sourceMappingURL=types-DinsvYdY-Dv_n3Tac.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-Dinsv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nameOf } from "./naming-
|
|
1
|
+
import { f as normalizeIndexOptionValue, l as nameOf } from "./naming-Cc_t1q6s-CouBOmqZ.mjs";
|
|
2
|
+
import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
2
3
|
import { IRNodeBase, freezeNode } from "@prisma/orm-framework/components/ir";
|
|
3
4
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
4
5
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
5
6
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
6
7
|
import { canonicalStringify } from "@prisma/orm-framework/utils/canonical-stringify";
|
|
7
8
|
import { isArrayEqual } from "@prisma/orm-framework/utils/array-equal";
|
|
8
|
-
//#region ../../../2-sql/1-core/schema-ir/dist/types-
|
|
9
|
+
//#region ../../../2-sql/1-core/schema-ir/dist/types-yyhkYQNT.mjs
|
|
10
|
+
/**
|
|
11
|
+
* A literal default in the canonical form of the column's data type (ADR 254), element by element
|
|
12
|
+
* for a list column. A `Date` is read as its ISO text first. A value the type refuses is kept as it
|
|
13
|
+
* is, with the type's message.
|
|
14
|
+
*/
|
|
15
|
+
function defaultInCanonicalForm(value, toCanonicalForm, list) {
|
|
16
|
+
if (toCanonicalForm === void 0) return {
|
|
17
|
+
value,
|
|
18
|
+
refusal: void 0
|
|
19
|
+
};
|
|
20
|
+
if (list && Array.isArray(value)) {
|
|
21
|
+
const elements = value.map((element) => inCanonicalForm(element, toCanonicalForm));
|
|
22
|
+
return {
|
|
23
|
+
value: elements.map((element) => element.value),
|
|
24
|
+
refusal: elements.find((element) => element.refusal !== void 0)?.refusal
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const canonical = inCanonicalForm(value instanceof Date ? value.toISOString() : value, toCanonicalForm);
|
|
28
|
+
return canonical.refusal === void 0 ? canonical : {
|
|
29
|
+
value,
|
|
30
|
+
refusal: canonical.refusal
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function inCanonicalForm(value, toCanonicalForm) {
|
|
34
|
+
try {
|
|
35
|
+
return {
|
|
36
|
+
value: toCanonicalForm(value),
|
|
37
|
+
refusal: void 0
|
|
38
|
+
};
|
|
39
|
+
} catch (error) {
|
|
40
|
+
if (isStructuredError(error) && error.code === "CONTRACT.CAST_REFUSED") return {
|
|
41
|
+
value,
|
|
42
|
+
refusal: error.message
|
|
43
|
+
};
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The refusal of a contract's literal default that its column's data type does not hold, which a
|
|
49
|
+
* contract emitted by an earlier version can carry, with what to do about it.
|
|
50
|
+
*/
|
|
51
|
+
function contractDefaultRefusal(columnDefault, toCanonicalForm, list) {
|
|
52
|
+
if (columnDefault?.kind !== "literal") return void 0;
|
|
53
|
+
const { refusal } = defaultInCanonicalForm(columnDefault.value, toCanonicalForm, list);
|
|
54
|
+
return refusal === void 0 ? void 0 : `The contract holds this default in a form its data type does not store: ${refusal} Re-emit the contract, then try again.`;
|
|
55
|
+
}
|
|
9
56
|
/**
|
|
10
57
|
* The `nodeKind` discriminant for each relational schema-diff leaf node.
|
|
11
58
|
* Each node carries a unique value; the differ pairs siblings by `id`, and
|
|
@@ -222,32 +269,28 @@ var SqlCheckConstraintIR = class SqlCheckConstraintIR extends SqlSchemaIRNode {
|
|
|
222
269
|
};
|
|
223
270
|
/**
|
|
224
271
|
* Structural equality for two resolved column defaults, ported from the relational walk's
|
|
225
|
-
* `columnDefaultsEqual` normalized branch: kinds must match; literal values are normalized (
|
|
226
|
-
*
|
|
227
|
-
* 64-bit-integer native type's safe-integer number to its
|
|
228
|
-
* type's number to its decimal text, and when the type has
|
|
229
|
-
* digits without zeros that do not change the value; a list
|
|
230
|
-
* type) then compared canonically (JSON objects match their
|
|
231
|
-
* expressions compare case- and whitespace-insensitively.
|
|
272
|
+
* `columnDefaultsEqual` normalized branch: kinds must match; literal values are normalized (a
|
|
273
|
+
* value of a type with a canonical form, such as a date or time type, to that form through
|
|
274
|
+
* `toCanonicalForm`; a 64-bit-integer native type's safe-integer number to its
|
|
275
|
+
* decimal-text spelling; a numeric native type's number to its decimal text, and when the type has
|
|
276
|
+
* a modifier, its decimal text to its digits without zeros that do not change the value; a list
|
|
277
|
+
* element by element under its element type) then compared canonically (JSON objects match their
|
|
278
|
+
* canonical string form); function expressions compare case- and whitespace-insensitively.
|
|
232
279
|
*
|
|
233
280
|
* `nativeType` provides the normalization context (the actual side's resolved native type in a diff
|
|
234
|
-
* comparison).
|
|
235
|
-
*
|
|
281
|
+
* comparison). `toCanonicalForm` is the column data type's canonical-form function (ADR 254), from the
|
|
282
|
+
* assembled stack; a value it refuses compares as it is. A target that reads a raw
|
|
283
|
+
* expression as a literal does so before this comparison, through its `resolveDefault` hook.
|
|
236
284
|
*/
|
|
237
|
-
function resolvedDefaultsEqual(expected, actual, nativeType) {
|
|
285
|
+
function resolvedDefaultsEqual(expected, actual, nativeType, toCanonicalForm) {
|
|
238
286
|
if (expected.kind !== actual.kind) return false;
|
|
239
|
-
if (expected.kind === "literal" && actual.kind === "literal") return literalValuesEqual(normalizeLiteralValue(expected.value, nativeType), normalizeLiteralValue(actual.value, nativeType));
|
|
287
|
+
if (expected.kind === "literal" && actual.kind === "literal") return literalValuesEqual(normalizeLiteralValue(expected.value, nativeType, toCanonicalForm), normalizeLiteralValue(actual.value, nativeType, toCanonicalForm));
|
|
240
288
|
if (expected.kind === "function" && actual.kind === "function") return normalizeFunctionExpression(expected.expression) === normalizeFunctionExpression(actual.expression);
|
|
241
289
|
return false;
|
|
242
290
|
}
|
|
243
291
|
function normalizeFunctionExpression(expression) {
|
|
244
292
|
return expression.toLowerCase().replace(/\s+/g, "");
|
|
245
293
|
}
|
|
246
|
-
function isTemporalNativeType(nativeType) {
|
|
247
|
-
if (!nativeType) return false;
|
|
248
|
-
const normalized = nativeType.toLowerCase();
|
|
249
|
-
return normalized.includes("timestamp") || normalized === "date";
|
|
250
|
-
}
|
|
251
294
|
function isInt64NativeType(nativeType) {
|
|
252
295
|
if (!nativeType) return false;
|
|
253
296
|
const normalized = nativeType.toLowerCase();
|
|
@@ -284,31 +327,14 @@ function decimalDigits(value) {
|
|
|
284
327
|
const digits = fraction === "" ? whole : `${whole}.${fraction}`;
|
|
285
328
|
return digits === "0" ? digits : `${numeral[1] ?? ""}${digits}`;
|
|
286
329
|
}
|
|
287
|
-
|
|
288
|
-
* A timestamp as Postgres prints it, with or without an offset: `2024-01-01 00:00:00`,
|
|
289
|
-
* `0001-01-01 00:00:00+00`, `2024-01-02 03:04:05+05:30`. It is rebuilt as an ISO string before
|
|
290
|
-
* `Date` reads it, because `Date` reads this spelling without a zone as host-local time and reads a
|
|
291
|
-
* year below 100 as 19xx or 20xx. A value without a zone is a wall-clock time, and the contract
|
|
292
|
-
* spells the same wall time as an ISO instant, so it is read as UTC.
|
|
293
|
-
*/
|
|
294
|
-
const POSTGRES_TIMESTAMP = /^(\d{4}-\d{2}-\d{2})[ T](\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)(?:([+-]\d{2})(?::?(\d{2}))?)?$/;
|
|
295
|
-
function parseTemporal(value) {
|
|
296
|
-
const timestamp = POSTGRES_TIMESTAMP.exec(value);
|
|
297
|
-
if (timestamp === null) return new Date(value);
|
|
298
|
-
const [, date, time, offsetHours, offsetMinutes = "00"] = timestamp;
|
|
299
|
-
const zone = offsetHours === void 0 ? "Z" : `${offsetHours}:${offsetMinutes}`;
|
|
300
|
-
return /* @__PURE__ */ new Date(`${date}T${time}${zone}`);
|
|
301
|
-
}
|
|
302
|
-
function normalizeLiteralValue(value, nativeType) {
|
|
330
|
+
function normalizeLiteralValue(value, nativeType, toCanonicalForm) {
|
|
303
331
|
if (Array.isArray(value) && nativeType?.endsWith("[]")) {
|
|
304
332
|
const elementType = nativeType.slice(0, -2);
|
|
305
|
-
return value.map((element) => normalizeLiteralValue(element, elementType));
|
|
306
|
-
}
|
|
307
|
-
if (value instanceof Date) return value.toISOString();
|
|
308
|
-
if (typeof value === "string" && isTemporalNativeType(nativeType)) {
|
|
309
|
-
const parsed = parseTemporal(value);
|
|
310
|
-
if (!Number.isNaN(parsed.getTime())) return parsed.toISOString();
|
|
333
|
+
return value.map((element) => normalizeLiteralValue(element, elementType, toCanonicalForm));
|
|
311
334
|
}
|
|
335
|
+
const json = value instanceof Date ? value.toISOString() : value;
|
|
336
|
+
if (toCanonicalForm !== void 0) return defaultInCanonicalForm(json, toCanonicalForm, false).value;
|
|
337
|
+
if (value instanceof Date) return json;
|
|
312
338
|
if (typeof value === "number" && Number.isSafeInteger(value) && isInt64NativeType(nativeType)) return String(value);
|
|
313
339
|
const decimalType = nativeType === void 0 ? null : DECIMAL_NATIVE_TYPE.exec(nativeType);
|
|
314
340
|
if ((typeof value === "number" || typeof value === "string") && decimalType !== null) return decimalType[1] === void 0 ? decimalText(value) : decimalDigits(value);
|
|
@@ -354,6 +380,7 @@ var SqlColumnDefaultIR = class SqlColumnDefaultIR extends SqlSchemaIRNode {
|
|
|
354
380
|
defineNonEnumerable(this, "codecRef", input.codecRef);
|
|
355
381
|
defineNonEnumerable(this, "codecBaseNativeType", input.codecBaseNativeType);
|
|
356
382
|
defineNonEnumerable(this, "codecNamedType", input.codecNamedType);
|
|
383
|
+
defineNonEnumerable(this, "dataType", input.dataType);
|
|
357
384
|
freezeNode(this);
|
|
358
385
|
}
|
|
359
386
|
get id() {
|
|
@@ -368,17 +395,25 @@ var SqlColumnDefaultIR = class SqlColumnDefaultIR extends SqlSchemaIRNode {
|
|
|
368
395
|
/**
|
|
369
396
|
* Structured comparison with `this` as the expected side: both sides
|
|
370
397
|
* resolved compare per the relational walk's `columnDefaultsEqual`
|
|
371
|
-
* semantics
|
|
398
|
+
* semantics, a literal through the canonical form of the column's data type when the
|
|
399
|
+
* contract-derived side carries one; a declared expected default against an unparseable actual
|
|
372
400
|
* (raw present, no resolved parse) is a mismatch; two raw-only nodes fall
|
|
373
401
|
* back to raw string equality.
|
|
374
402
|
*/
|
|
375
403
|
isEqualTo(other) {
|
|
376
404
|
const node = blindCast(other);
|
|
377
405
|
assertNode(node, "SqlColumnDefaultIR", SqlColumnDefaultIR.is);
|
|
378
|
-
if (this.resolved !== void 0 && node.resolved !== void 0) return resolvedDefaultsEqual(this.resolved, node.resolved, node.nativeTypeContext ?? this.nativeTypeContext);
|
|
406
|
+
if (this.resolved !== void 0 && node.resolved !== void 0) return resolvedDefaultsEqual(this.resolved, node.resolved, node.nativeTypeContext ?? this.nativeTypeContext, (this.dataType ?? node.dataType)?.toCanonicalForm);
|
|
379
407
|
if (this.resolved !== void 0 || node.resolved !== void 0) return false;
|
|
380
408
|
return this.raw === node.raw;
|
|
381
409
|
}
|
|
410
|
+
/**
|
|
411
|
+
* The refusal of an expected literal its data type does not hold, which a contract emitted by an
|
|
412
|
+
* earlier version can carry, so the mismatch names its cause.
|
|
413
|
+
*/
|
|
414
|
+
explainMismatch() {
|
|
415
|
+
return contractDefaultRefusal(this.resolved, this.dataType?.toCanonicalForm, (this.many ?? this.codecRef?.many) === true);
|
|
416
|
+
}
|
|
382
417
|
};
|
|
383
418
|
/**
|
|
384
419
|
* Schema IR node for a single column on a table, as observed by
|
|
@@ -415,6 +450,7 @@ var SqlColumnIR = class SqlColumnIR extends SqlSchemaIRNode {
|
|
|
415
450
|
defineNonEnumerable(this, "codecRef", input.codecRef);
|
|
416
451
|
defineNonEnumerable(this, "codecBaseNativeType", input.codecBaseNativeType);
|
|
417
452
|
defineNonEnumerable(this, "codecNamedType", input.codecNamedType);
|
|
453
|
+
defineNonEnumerable(this, "dataType", input.dataType);
|
|
418
454
|
freezeNode(this);
|
|
419
455
|
}
|
|
420
456
|
get id() {
|
|
@@ -436,7 +472,8 @@ var SqlColumnIR = class SqlColumnIR extends SqlSchemaIRNode {
|
|
|
436
472
|
...ifDefined("many", this.many ?? this.codecRef?.many),
|
|
437
473
|
...ifDefined("codecRef", this.codecRef),
|
|
438
474
|
...ifDefined("codecBaseNativeType", this.codecBaseNativeType),
|
|
439
|
-
...ifDefined("codecNamedType", this.codecNamedType)
|
|
475
|
+
...ifDefined("codecNamedType", this.codecNamedType),
|
|
476
|
+
...ifDefined("dataType", this.dataType)
|
|
440
477
|
})];
|
|
441
478
|
}
|
|
442
479
|
static is(node) {
|
|
@@ -785,6 +822,6 @@ var SqlSchemaIR = class extends SqlSchemaIRNode {
|
|
|
785
822
|
}
|
|
786
823
|
};
|
|
787
824
|
//#endregion
|
|
788
|
-
export { SqlColumnIR as a, SqlSchemaIR as c, SqlUniqueIR as d, assertNode as f,
|
|
825
|
+
export { relationalNodeGranularity as _, SqlColumnIR as a, SqlSchemaIR as c, SqlUniqueIR as d, assertNode as f, relationalNodeEntityKind as g, defineNonEnumerable as h, SqlColumnDefaultIR as i, SqlSchemaIRNode as l, defaultInCanonicalForm as m, RelationalSchemaNodeKind as n, SqlForeignKeyIR as o, contractDefaultRefusal as p, SqlCheckConstraintIR as r, SqlIndexIR as s, PrimaryKey as t, SqlTableIR as u };
|
|
789
826
|
|
|
790
|
-
//# sourceMappingURL=types-
|
|
827
|
+
//# sourceMappingURL=types-yyhkYQNT-Dmoq-giA.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-yyhkYQNT-Dmoq-giA.mjs","names":[],"sources":["../../../../2-sql/1-core/schema-ir/dist/types-yyhkYQNT.mjs"],"sourcesContent":["import { f as normalizeIndexOptionValue, l as nameOf } from \"./naming-Cc_t1q6s.mjs\";\nimport { isStructuredError } from \"@internal/utils/structured-error\";\nimport { IRNodeBase, freezeNode } from \"@internal/framework-components/ir\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { isArrayEqual } from \"@internal/utils/array-equal\";\n//#region src/ir/default-in-canonical-form.ts\n/**\n* A literal default in the canonical form of the column's data type (ADR 254), element by element\n* for a list column. A `Date` is read as its ISO text first. A value the type refuses is kept as it\n* is, with the type's message.\n*/\nfunction defaultInCanonicalForm(value, toCanonicalForm, list) {\n\tif (toCanonicalForm === void 0) return {\n\t\tvalue,\n\t\trefusal: void 0\n\t};\n\tif (list && Array.isArray(value)) {\n\t\tconst elements = value.map((element) => inCanonicalForm(element, toCanonicalForm));\n\t\treturn {\n\t\t\tvalue: elements.map((element) => element.value),\n\t\t\trefusal: elements.find((element) => element.refusal !== void 0)?.refusal\n\t\t};\n\t}\n\tconst canonical = inCanonicalForm(value instanceof Date ? value.toISOString() : value, toCanonicalForm);\n\treturn canonical.refusal === void 0 ? canonical : {\n\t\tvalue,\n\t\trefusal: canonical.refusal\n\t};\n}\nfunction inCanonicalForm(value, toCanonicalForm) {\n\ttry {\n\t\treturn {\n\t\t\tvalue: toCanonicalForm(value),\n\t\t\trefusal: void 0\n\t\t};\n\t} catch (error) {\n\t\tif (isStructuredError(error) && error.code === \"CONTRACT.CAST_REFUSED\") return {\n\t\t\tvalue,\n\t\t\trefusal: error.message\n\t\t};\n\t\tthrow error;\n\t}\n}\n/**\n* The refusal of a contract's literal default that its column's data type does not hold, which a\n* contract emitted by an earlier version can carry, with what to do about it.\n*/\nfunction contractDefaultRefusal(columnDefault, toCanonicalForm, list) {\n\tif (columnDefault?.kind !== \"literal\") return void 0;\n\tconst { refusal } = defaultInCanonicalForm(columnDefault.value, toCanonicalForm, list);\n\treturn refusal === void 0 ? void 0 : `The contract holds this default in a form its data type does not store: ${refusal} Re-emit the contract, then try again.`;\n}\n//#endregion\n//#region src/ir/schema-node-kinds.ts\n/**\n* The `nodeKind` discriminant for each relational schema-diff leaf node.\n* Each node carries a unique value; the differ pairs siblings by `id`, and\n* these kinds distinguish the node types that appear as `PostgresTableSchemaNode`\n* children (columns, primary key, foreign keys, uniques, indexes, checks) from\n* each other and from the RLS policy/role kinds a target defines separately.\n*/\nconst RelationalSchemaNodeKind = {\n\tschema: \"sql-schema\",\n\ttable: \"sql-table\",\n\tcolumn: \"sql-column\",\n\tcolumnDefault: \"sql-column-default\",\n\tprimaryKey: \"sql-primary-key\",\n\tforeignKey: \"sql-foreign-key\",\n\tunique: \"sql-unique\",\n\tindex: \"sql-index\",\n\tcheck: \"sql-check-constraint\"\n};\n/**\n* The one real map from a relational `nodeKind` to the framework-neutral\n* {@link DiffSubjectGranularity} its diff issues carry — the SQL family's\n* post-diff filters (issue category, strict-mode gating) and the framework\n* aggregate's unclaimed-elements sweep key on the granularity, never on the\n* `nodeKind` spelling and never on anything stamped on the node. Resolution\n* is by `nodeKind` equality against this map, not a suffix string match.\n* Target-specific node kinds (Postgres namespace/table/policy/role) are\n* outside this family layer's vocabulary and map their own kinds directly.\n*/\nconst RELATIONAL_NODE_GRANULARITY = {\n\t[RelationalSchemaNodeKind.schema]: \"structural\",\n\t[RelationalSchemaNodeKind.table]: \"entity\",\n\t[RelationalSchemaNodeKind.column]: \"field\",\n\t[RelationalSchemaNodeKind.columnDefault]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.primaryKey]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.foreignKey]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.unique]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.index]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.check]: \"auxiliary\"\n};\nfunction isRelationalSchemaNodeKind(nodeKind) {\n\treturn Object.hasOwn(RELATIONAL_NODE_GRANULARITY, nodeKind);\n}\n/**\n* Looks up the subject granularity for a relational `nodeKind`. Throws for a\n* `nodeKind` outside this map (a target-specific kind, e.g. Postgres's\n* namespace/table/policy/role) — those map their own kinds directly rather\n* than through this family-level map.\n*/\nfunction relationalNodeGranularity(nodeKind) {\n\tif (!isRelationalSchemaNodeKind(nodeKind)) throw new InternalError(`relationalNodeGranularity: unrecognized relational node kind \"${nodeKind}\"`);\n\treturn RELATIONAL_NODE_GRANULARITY[nodeKind];\n}\n/**\n* The one real map from a relational `nodeKind` to its storage `entityKind`\n* — the same vocabulary the contract storage's `entries` dictionary keys use\n* (`elementCoordinates` walks it). Only the whole-table kind has an entity of\n* its own; every other relational node (a column, an index, …) is nested\n* under one and maps to nothing here.\n*/\nconst RELATIONAL_NODE_ENTITY_KIND = { [RelationalSchemaNodeKind.table]: \"table\" };\n/**\n* Looks up the storage `entityKind` for a relational `nodeKind` — sibling of\n* {@link relationalNodeGranularity}, resolved by `nodeKind` equality against\n* {@link RELATIONAL_NODE_ENTITY_KIND}. `undefined` for a target-specific kind\n* (targets map their own kinds directly) or a relational kind with no entity\n* of its own.\n*/\nfunction relationalNodeEntityKind(nodeKind) {\n\treturn isRelationalSchemaNodeKind(nodeKind) ? RELATIONAL_NODE_ENTITY_KIND[nodeKind] : void 0;\n}\n//#endregion\n//#region src/ir/sql-schema-ir-node.ts\n/**\n* SQL Schema IR node base. Carries the family-level\n* `kind = 'sql-schema-ir'` discriminator and inherits the framework's\n* `freezeNode` affordance.\n*\n* SQL Schema IR represents the actual database state as discovered by\n* introspection (the parallel to SQL Contract IR, which represents the\n* desired state).\n*\n* The discriminator is installed as a non-enumerable own property,\n* matching the SqlNode pattern. This keeps `JSON.stringify(node)`\n* canonical (no `kind` field), keeps `toEqual({...})` test assertions\n* against pre-lift flat shapes passing, and keeps `node.kind` readable\n* for dispatch.\n*\n* Both `kind` and `nodeKind` are required: every concrete leaf is a node\n* the generic differ can pair and compare, so every leaf must declare which\n* node it is. `nodeKind` has no default here — every direct subclass sets its\n* own literal value (the relational leaves via `RelationalSchemaNodeKind`,\n* target concretions via their own vocabulary, e.g. `PostgresSchemaNodeKind`).\n*/\nvar SqlSchemaIRNode = class extends IRNodeBase {\n\tconstructor() {\n\t\tsuper();\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"sql-schema-ir\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: false\n\t\t});\n\t}\n};\n/**\n* Asserts `node` matches `predicate`, narrowing its type to `T`. The one\n* shared implementation every node class's `static assert` and `isEqualTo`\n* reach for, instead of each hand-writing its own throw: the message names\n* the class the caller expected.\n*/\nfunction assertNode(node, className, predicate) {\n\tif (node === void 0 || !predicate(node)) throw new InternalError(`Expected a ${className} but got nodeKind=${node?.nodeKind ?? \"undefined\"}`);\n}\n/**\n* Defines a non-enumerable own property, the same treatment `kind` gets\n* above: a derivation-time render-support field stays out of\n* `JSON.stringify`, `toEqual({...})` structural assertions, and spreads,\n* while remaining directly readable (`node.field`) for the one consumer\n* that resolves it at plan time. A no-op when `value` is `undefined` — the\n* property is simply absent, matching every other optional field on these\n* nodes.\n*/\nfunction defineNonEnumerable(target, key, value) {\n\tif (value === void 0) return;\n\tObject.defineProperty(target, key, {\n\t\tvalue,\n\t\tenumerable: false,\n\t\twritable: false,\n\t\tconfigurable: false\n\t});\n}\n//#endregion\n//#region src/ir/primary-key.ts\n/**\n* Primary-key Schema IR node. Mirrors the Contract IR `PrimaryKey`\n* shape (same `columns` + optional `name`) so verification can compare\n* intent and actual structurally. Defined here independently to avoid\n* a sql-schema-ir -> sql-contract dependency.\n*\n* Implements `DiffableNode` so a primary key is directly a table's diff-tree\n* child. `id` is a fixed sentinel — a table has at most one primary key, so\n* there is never a sibling to disambiguate against. `isEqualTo` compares the\n* column tuple; the PK's own `name` is a database-assigned label with no\n* semantic weight, so it is not compared (mirrors the policy node's\n* name-insensitivity to non-identifying detail).\n*/\nvar PrimaryKey = class PrimaryKey extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.primaryKey;\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"primary-key\";\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof PrimaryKey ? value : new PrimaryKey(value);\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.primaryKey;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"PrimaryKey\", PrimaryKey.is);\n\t\treturn this.columns.length === node.columns.length && this.columns.every((c, i) => c === node.columns[i]);\n\t}\n};\n//#endregion\n//#region src/ir/sql-check-constraint-ir.ts\n/**\n* Schema IR node for a table-level check constraint, carried as an opaque\n* predicate. The expression is never parsed — a database reprints predicates\n* in its own normalized form, so any structured reading of it would drift.\n*\n* Implements `DiffableNode` so a check is directly a table's diff-tree child;\n* `id` is `check:<name>`. `isEqualTo` is mode-selected by the receiver's\n* `prefix` (the differ always calls `expected.isEqualTo(actual)`): a\n* wire-named receiver compares ids only — the wire name's hash already\n* commits to the predicate — while an exact-named receiver byte-compares the\n* expression, which is reliable precisely when both sides came from the same\n* reprint.\n*/\nvar SqlCheckConstraintIR = class SqlCheckConstraintIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.check;\n\tname;\n\texpression;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = nameOf(input.naming);\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tthis.expression = input.expression;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `check:${this.name}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof SqlCheckConstraintIR ? value : new SqlCheckConstraintIR(value);\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.check;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlCheckConstraintIR\", SqlCheckConstraintIR.is);\n\t\tif (this.prefix !== void 0) return this.id === node.id;\n\t\treturn this.expression === node.expression;\n\t}\n};\n//#endregion\n//#region src/ir/resolved-default-equality.ts\n/**\n* Structural equality for two resolved column defaults, ported from the relational walk's\n* `columnDefaultsEqual` normalized branch: kinds must match; literal values are normalized (a\n* value of a type with a canonical form, such as a date or time type, to that form through\n* `toCanonicalForm`; a 64-bit-integer native type's safe-integer number to its\n* decimal-text spelling; a numeric native type's number to its decimal text, and when the type has\n* a modifier, its decimal text to its digits without zeros that do not change the value; a list\n* element by element under its element type) then compared canonically (JSON objects match their\n* canonical string form); function expressions compare case- and whitespace-insensitively.\n*\n* `nativeType` provides the normalization context (the actual side's resolved native type in a diff\n* comparison). `toCanonicalForm` is the column data type's canonical-form function (ADR 254), from the\n* assembled stack; a value it refuses compares as it is. A target that reads a raw\n* expression as a literal does so before this comparison, through its `resolveDefault` hook.\n*/\nfunction resolvedDefaultsEqual(expected, actual, nativeType, toCanonicalForm) {\n\tif (expected.kind !== actual.kind) return false;\n\tif (expected.kind === \"literal\" && actual.kind === \"literal\") return literalValuesEqual(normalizeLiteralValue(expected.value, nativeType, toCanonicalForm), normalizeLiteralValue(actual.value, nativeType, toCanonicalForm));\n\tif (expected.kind === \"function\" && actual.kind === \"function\") return normalizeFunctionExpression(expected.expression) === normalizeFunctionExpression(actual.expression);\n\treturn false;\n}\nfunction normalizeFunctionExpression(expression) {\n\treturn expression.toLowerCase().replace(/\\s+/g, \"\");\n}\nfunction isInt64NativeType(nativeType) {\n\tif (!nativeType) return false;\n\tconst normalized = nativeType.toLowerCase();\n\treturn normalized === \"int8\" || normalized === \"bigint\";\n}\n/**\n* A numeric type with a modifier (`numeric(10,2)`) stores every value at its scale, so zeros that\n* do not change the value do not count. Without one, the value keeps the scale it was written with.\n*/\nconst DECIMAL_NATIVE_TYPE = /^(?:numeric|decimal)(\\(\\d+(?:,\\s*\\d+)?\\))?$/i;\nconst DECIMAL_NUMERAL = /^(-?)(\\d+)(?:\\.(\\d+))?$/;\nconst EXPONENT_NUMERAL = /^(-?)(\\d+)(?:\\.(\\d+))?[eE]([+-]?\\d+)$/;\n/**\n* The plain decimal spelling of a value, so that a number JavaScript prints as `1e-7` or `1e+21`\n* can be compared with the decimal text a numeric column stores. No digit is added or dropped;\n* only the decimal point moves.\n*/\nfunction decimalText(value) {\n\tconst text = String(value);\n\tconst numeral = EXPONENT_NUMERAL.exec(text);\n\tif (numeral === null) return text;\n\tconst [, sign = \"\", whole = \"\", fraction = \"\", exponent = \"0\"] = numeral;\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}\nfunction decimalDigits(value) {\n\tconst numeral = DECIMAL_NUMERAL.exec(decimalText(value));\n\tif (numeral === null) return value;\n\tconst whole = (numeral[2] ?? \"\").replace(/^0+(?=\\d)/, \"\");\n\tconst fraction = (numeral[3] ?? \"\").replace(/0+$/, \"\");\n\tconst digits = fraction === \"\" ? whole : `${whole}.${fraction}`;\n\treturn digits === \"0\" ? digits : `${numeral[1] ?? \"\"}${digits}`;\n}\nfunction normalizeLiteralValue(value, nativeType, toCanonicalForm) {\n\tif (Array.isArray(value) && nativeType?.endsWith(\"[]\")) {\n\t\tconst elementType = nativeType.slice(0, -2);\n\t\treturn value.map((element) => normalizeLiteralValue(element, elementType, toCanonicalForm));\n\t}\n\tconst json = value instanceof Date ? value.toISOString() : value;\n\tif (toCanonicalForm !== void 0) return defaultInCanonicalForm(json, toCanonicalForm, false).value;\n\tif (value instanceof Date) return json;\n\tif (typeof value === \"number\" && Number.isSafeInteger(value) && isInt64NativeType(nativeType)) return String(value);\n\tconst decimalType = nativeType === void 0 ? null : DECIMAL_NATIVE_TYPE.exec(nativeType);\n\tif ((typeof value === \"number\" || typeof value === \"string\") && decimalType !== null) return decimalType[1] === void 0 ? decimalText(value) : decimalDigits(value);\n\treturn value;\n}\nfunction literalValuesEqual(a, b) {\n\tif (a === b) return true;\n\tif (typeof a === \"object\" && a !== null && typeof b === \"object\" && b !== null) return canonicalStringify(a) === canonicalStringify(b);\n\tif (typeof a === \"object\" && a !== null && typeof b === \"string\") try {\n\t\treturn canonicalStringify(a) === canonicalStringify(JSON.parse(b));\n\t} catch {\n\t\treturn false;\n\t}\n\tif (typeof a === \"string\" && typeof b === \"object\" && b !== null) try {\n\t\treturn canonicalStringify(JSON.parse(a)) === canonicalStringify(b);\n\t} catch {\n\t\treturn false;\n\t}\n\treturn false;\n}\n//#endregion\n//#region src/ir/sql-column-default-ir.ts\n/**\n* Schema-diff node for a column's default value. The default is the one\n* column attribute with an extra/missing/drift lifecycle of its own, so it\n* is a child node of the column rather than a compared attribute: an\n* undeclared live default surfaces as `not-expected`, a declared default the\n* database lacks as `not-found`, and a divergent value as `not-equal` — the\n* three reasons cover the legacy `extra_default` / `default_missing` /\n* `default_mismatch` vocabulary with no attribute inspection.\n*\n* `id` is a fixed sentinel — a column has at most one default. Built\n* transiently by `SqlColumnIR.children()` from the column's own fields;\n* never constructed by derivation or introspection directly.\n*/\nvar SqlColumnDefaultIR = class SqlColumnDefaultIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.columnDefault;\n\tconstructor(input) {\n\t\tsuper();\n\t\tif (input.resolved !== void 0) this.resolved = input.resolved;\n\t\tif (input.raw !== void 0) this.raw = input.raw;\n\t\tif (input.nativeTypeContext !== void 0) this.nativeTypeContext = input.nativeTypeContext;\n\t\tdefineNonEnumerable(this, \"authored\", input.authored);\n\t\tdefineNonEnumerable(this, \"many\", input.many);\n\t\tdefineNonEnumerable(this, \"codecRef\", input.codecRef);\n\t\tdefineNonEnumerable(this, \"codecBaseNativeType\", input.codecBaseNativeType);\n\t\tdefineNonEnumerable(this, \"codecNamedType\", input.codecNamedType);\n\t\tdefineNonEnumerable(this, \"dataType\", input.dataType);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"default\";\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.columnDefault;\n\t}\n\t/**\n\t* Structured comparison with `this` as the expected side: both sides\n\t* resolved compare per the relational walk's `columnDefaultsEqual`\n\t* semantics, a literal through the canonical form of the column's data type when the\n\t* contract-derived side carries one; a declared expected default against an unparseable actual\n\t* (raw present, no resolved parse) is a mismatch; two raw-only nodes fall\n\t* back to raw string equality.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlColumnDefaultIR\", SqlColumnDefaultIR.is);\n\t\tif (this.resolved !== void 0 && node.resolved !== void 0) return resolvedDefaultsEqual(this.resolved, node.resolved, node.nativeTypeContext ?? this.nativeTypeContext, (this.dataType ?? node.dataType)?.toCanonicalForm);\n\t\tif (this.resolved !== void 0 || node.resolved !== void 0) return false;\n\t\treturn this.raw === node.raw;\n\t}\n\t/**\n\t* The refusal of an expected literal its data type does not hold, which a contract emitted by an\n\t* earlier version can carry, so the mismatch names its cause.\n\t*/\n\texplainMismatch() {\n\t\treturn contractDefaultRefusal(this.resolved, this.dataType?.toCanonicalForm, (this.many ?? this.codecRef?.many) === true);\n\t}\n};\n//#endregion\n//#region src/ir/sql-column-ir.ts\n/**\n* Schema IR node for a single column on a table, as observed by\n* introspection. Unlike the Contract IR `StorageColumn`, this carries\n* the column's `name` (Schema IR columns are returned as arrays from\n* introspection queries; the parent table re-keys them into a record\n* for downstream consumers).\n*\n* Implements `DiffableNode` so a column is directly a table's diff-tree\n* child: `id` is the column name (unique among a table's columns); `isEqualTo`\n* compares this column's own attributes only — never children, since a\n* column is a leaf. When both sides carry `resolvedNativeType` (stamped at\n* derivation/introspection), the comparison uses the resolved values —\n* resolved native type, nullability, and structured default equality per\n* the relational walk's `columnDefaultsEqual` semantics, with `this` as the\n* expected side. Otherwise it falls back to comparing raw fields.\n*/\nvar SqlColumnIR = class SqlColumnIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.column;\n\tname;\n\tnativeType;\n\tnullable;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = input.name;\n\t\tthis.nativeType = input.nativeType;\n\t\tthis.nullable = input.nullable;\n\t\tif (input.default !== void 0) this.default = input.default;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tif (input.many !== void 0) this.many = input.many;\n\t\tif (input.resolvedNativeType !== void 0) this.resolvedNativeType = input.resolvedNativeType;\n\t\tif (input.resolvedDefault !== void 0) this.resolvedDefault = input.resolvedDefault;\n\t\tdefineNonEnumerable(this, \"authoredDefault\", input.authoredDefault);\n\t\tdefineNonEnumerable(this, \"codecRef\", input.codecRef);\n\t\tdefineNonEnumerable(this, \"codecBaseNativeType\", input.codecBaseNativeType);\n\t\tdefineNonEnumerable(this, \"codecNamedType\", input.codecNamedType);\n\t\tdefineNonEnumerable(this, \"dataType\", input.dataType);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `column:${this.name}`;\n\t}\n\t/**\n\t* The column's default, when declared/present, is the column's one child\n\t* node — it has an extra/missing/drift lifecycle of its own, so the differ\n\t* recurses to it rather than `isEqualTo` comparing it. Built transiently\n\t* from this column's own fields.\n\t*/\n\tchildren() {\n\t\tif (this.resolvedDefault === void 0 && this.default === void 0) return [];\n\t\treturn [new SqlColumnDefaultIR({\n\t\t\t...ifDefined(\"resolved\", this.resolvedDefault),\n\t\t\t...ifDefined(\"raw\", this.default),\n\t\t\t...ifDefined(\"authored\", this.authoredDefault),\n\t\t\t...ifDefined(\"nativeTypeContext\", this.resolvedNativeType),\n\t\t\t...ifDefined(\"many\", this.many ?? this.codecRef?.many),\n\t\t\t...ifDefined(\"codecRef\", this.codecRef),\n\t\t\t...ifDefined(\"codecBaseNativeType\", this.codecBaseNativeType),\n\t\t\t...ifDefined(\"codecNamedType\", this.codecNamedType),\n\t\t\t...ifDefined(\"dataType\", this.dataType)\n\t\t})];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.column;\n\t}\n\t/**\n\t* Compares the column's own attributes only — the default lives on the\n\t* child node. When both sides carry `resolvedNativeType`, the resolved\n\t* value governs (array-ness rides on its `[]` suffix); otherwise raw\n\t* fields compare.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlColumnIR\", SqlColumnIR.is);\n\t\tif (this.resolvedNativeType !== void 0 && node.resolvedNativeType !== void 0) return this.resolvedNativeType === node.resolvedNativeType && this.nullable === node.nullable;\n\t\treturn this.nativeType === node.nativeType && this.nullable === node.nullable && Boolean(this.many) === Boolean(node.many);\n\t}\n};\n//#endregion\n//#region src/ir/sql-foreign-key-ir.ts\n/**\n* Schema IR node for a foreign-key constraint as observed by\n* introspection. The `referencedTable` / `referencedColumns` field\n* names match the introspection vocabulary (`pg_constraint.confkey`,\n* etc.) and intentionally differ from the Contract IR's nested\n* `references: { table, columns }` shape so that the verifier's\n* structural comparison stays explicit about which side it's reading.\n*\n* Implements `DiffableNode` so a foreign key is directly a table's diff-tree\n* child. Foreign keys are frequently unnamed (introspection may not carry a\n* constraint name, and the contract side never invents one), so `id` is\n* derived from the referencing/referenced coordinates rather than `name` —\n* the same tuple that makes two FK constraints the same constraint. This\n* also serves as the comparison key: two FKs with the same coordinates are\n* paired by the differ, and `isEqualTo` then compares the remaining\n* attribute — the referential actions.\n*/\nvar SqlForeignKeyIR = class SqlForeignKeyIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.foreignKey;\n\tcolumns;\n\treferencedTable;\n\treferencedColumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tthis.referencedTable = input.referencedTable;\n\t\tthis.referencedColumns = input.referencedColumns;\n\t\tif (input.referencedSchema !== void 0) this.referencedSchema = input.referencedSchema;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tif (input.onDelete !== void 0) this.onDelete = input.onDelete;\n\t\tif (input.onUpdate !== void 0) this.onUpdate = input.onUpdate;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tconst resolvedReferencedNamespace = input.resolvedReferencedNamespace ?? input.referencedSchema;\n\t\tif (resolvedReferencedNamespace !== void 0) this.resolvedReferencedNamespace = resolvedReferencedNamespace;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\tconst referencedNamespace = this.resolvedReferencedNamespace ?? \"\";\n\t\treturn `foreign-key:${this.columns.join(\",\")}->${referencedNamespace}.${this.referencedTable}(${this.referencedColumns.join(\",\")})`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.foreignKey;\n\t}\n\t/**\n\t* Referential-action comparison with `this` as the expected side, matching\n\t* the relational walk's `getReferentialActionMismatches`: `noAction` is the\n\t* database default and equivalent to an undeclared action, and drift is\n\t* flagged only when the expected side declares a (normalized) action.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlForeignKeyIR\", SqlForeignKeyIR.is);\n\t\treturn referentialActionMatches(this.onDelete, node.onDelete) && referentialActionMatches(this.onUpdate, node.onUpdate);\n\t}\n};\nfunction referentialActionMatches(expected, actual) {\n\tconst normalizedExpected = expected === \"noAction\" ? void 0 : expected;\n\tif (normalizedExpected === void 0) return true;\n\treturn normalizedExpected === (actual === \"noAction\" ? void 0 : actual);\n}\n//#endregion\n//#region src/ir/sql-index-ir.ts\n/**\n* Schema IR node for a secondary index as observed by introspection.\n* Unlike the Contract IR `Index`, the Schema IR carries an explicit\n* `unique` field — introspection sees the underlying index regardless\n* of whether the user expressed it as `@@index` or `@@unique`, and the\n* verifier needs to distinguish them when comparing to the Contract.\n*\n* Implements `DiffableNode` so an index is directly a table's diff-tree\n* child. Indexes are name-identified: every index — contract-derived or\n* introspected — carries its full physical name, and `id` is that name.\n* Names are catalog-unique per schema, so two indexes legitimately sharing\n* one column tuple (a unique index beside a redundant plain index) are two\n* distinct siblings, and expression indexes need no column tuple at all.\n*\n* `isEqualTo` is selected by the receiver (the differ always calls\n* `expected.isEqualTo(actual)`) and delegates to {@link contentEquals} —\n* the single node-owned content relation: both modes compare `unique`\n* strict, `type` and option values through the named normalization seams,\n* and `columns` ordered-strict when both sides carry them; an exact-named\n* receiver (`prefix === undefined`) additionally byte-compares\n* `expression`/`where` (both sides are reprints in the supported flow —\n* normalizing would only mask real drift); a wire-named receiver never\n* compares bodies (the wire-name hash already commits to them).\n*\n* `expression`, `where`, and `unique` are genuine SQL-family attributes —\n* functional and partial indexes are standard SQL that any SQL target may\n* introspect, so the family node must represent them; a target declining\n* to author them is a capability decision, not target-specificity.\n*/\nvar SqlIndexIR = class SqlIndexIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.index;\n\tname;\n\tunique;\n\tconstructor(input) {\n\t\tsuper();\n\t\tconst name = nameOf(input.naming);\n\t\tif (input.columns === void 0 === (input.expression === void 0)) throw new InternalError(`SqlIndexIR \"${name}\": exactly one of columns or expression must be set.`);\n\t\tthis.name = name;\n\t\tthis.unique = input.unique;\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tif (input.columns !== void 0) this.columns = input.columns;\n\t\tif (input.expression !== void 0) this.expression = input.expression;\n\t\tif (input.where !== void 0) this.where = input.where;\n\t\tconst normalizedType = normalizeIndexType(input.type);\n\t\tif (normalizedType !== void 0) this.type = normalizedType;\n\t\tif (input.options !== void 0) this.options = input.options;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tdefineNonEnumerable(this, \"partial\", input.partial);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `index:${this.name}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof SqlIndexIR ? value : new SqlIndexIR(value);\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.index;\n\t}\n\t/**\n\t* Mode-selected structural equality — see the class doc. Delegates to the\n\t* single node-owned relation: `columns` compare ordered-strict when both\n\t* sides carry them; an exact receiver (`prefix === undefined`)\n\t* byte-compares `expression ?? ''` and `where ?? ''`; a wire-named receiver\n\t* never compares bodies (the wire-name hash already commits to them).\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlIndexIR\", SqlIndexIR.is);\n\t\treturn this.contentEquals(node, {\n\t\t\tcolumnPresence: \"when-both-defined\",\n\t\t\tbodies: this.prefix !== void 0 ? \"ignored\" : \"verbatim\"\n\t\t});\n\t}\n\t/**\n\t* The single index content-equality relation — every comparer (the differ\n\t* via {@link isEqualTo}, the planner's rename content-pairing) calls this\n\t* with its mode-appropriate strictness rather than growing a parallel\n\t* relation:\n\t*\n\t* - `columnPresence: 'when-both-defined'` (the differ's rule) compares\n\t* the tuples ordered-strict only when both sides carry them — a paired\n\t* node's identity already agreed, so a column node meeting an\n\t* expression node skips the tuple.\n\t* - `columnPresence: 'matching'` (the rename-pairing rule) additionally\n\t* requires presence to agree: a column index never pairs an expression\n\t* index.\n\t* - `bodies: 'verbatim'` byte-compares `expression ?? ''` / `where ?? ''`\n\t* (absent ≡ empty, no normalization — both sides are reprints in the\n\t* supported flow); `bodies: 'ignored'` skips them (wire identity —\n\t* the wire-name hash commits to the content).\n\t*\n\t* `unique` compares strictly; `type` and option VALUES compare through\n\t* the named normalization seams below.\n\t*/\n\tcontentEquals(other, strictness) {\n\t\tconst columnsEqual = strictness.columnPresence === \"matching\" ? this.columns === void 0 === (other.columns === void 0) && (this.columns === void 0 || isArrayEqual(this.columns, other.columns ?? [])) : this.columns === void 0 || other.columns === void 0 || isArrayEqual(this.columns, other.columns);\n\t\tif (!(this.unique === other.unique && normalizeIndexType(this.type) === normalizeIndexType(other.type) && indexOptionsEqual(this.options, other.options) && columnsEqual)) return false;\n\t\tif (strictness.bodies === \"ignored\") return true;\n\t\treturn (this.expression ?? \"\") === (other.expression ?? \"\") && (this.where ?? \"\") === (other.where ?? \"\");\n\t}\n};\n/**\n* The btree-default normalization seam: the default access method (`btree`\n* in every supported SQL target) normalizes to absent. Applied at\n* construction — every derivation path (contract tree, introspection, flat\n* family tree) builds through the class, so both compare sides are\n* symmetric by definition — and again inside\n* {@link SqlIndexIR.contentEquals} so the relation holds for any input.\n* The contract JSON and the wire-name content hash keep the authored\n* spelling: `@@index([a], type: \"btree\")` and `@@index([a])` are distinct\n* wire names — but content-equal after normalization, so a spelling change\n* between them converges as a rename via the planner's content\n* pairing (the hashes differ, so hash pairing never pairs them).\n*/\nfunction normalizeIndexType(type) {\n\treturn type === \"btree\" ? void 0 : type;\n}\n/**\n* Option-bag equality: same key set, values compared through\n* {@link normalizeIndexOptionValue} — Postgres introspection returns\n* reloptions values as catalog-reprint strings (`'70'`, `'on'`) while\n* contract option leaves are typed (number, boolean, string).\n*/\nfunction indexOptionsEqual(a, b) {\n\tconst aKeys = a ? Object.keys(a).sort() : [];\n\tconst bKeys = b ? Object.keys(b).sort() : [];\n\tif (aKeys.length !== bKeys.length) return false;\n\tfor (let i = 0; i < aKeys.length; i += 1) if (aKeys[i] !== bKeys[i]) return false;\n\tif (aKeys.length === 0) return true;\n\tfor (const key of aKeys) if (normalizeIndexOptionValue(a?.[key]) !== normalizeIndexOptionValue(b?.[key])) return false;\n\treturn true;\n}\n//#endregion\n//#region src/ir/sql-unique-ir.ts\n/**\n* Schema IR node for a table-level unique constraint as observed by\n* introspection.\n*\n* Implements `DiffableNode` so a unique constraint is directly a table's\n* diff-tree child. Unique constraints are frequently unnamed, so `id` is\n* derived from the column tuple rather than `name` — the column tuple is\n* also what makes two unique constraints the same constraint, so it doubles\n* as the pairing key. There are no further attributes to compare once\n* columns are equal (the differ pairs on `id`), so `isEqualTo` is identity.\n*/\nvar SqlUniqueIR = class SqlUniqueIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.unique;\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = [...input.columns];\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `unique:${this.columns.join(\",\")}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.unique;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlUniqueIR\", SqlUniqueIR.is);\n\t\treturn this.id === node.id;\n\t}\n};\n//#endregion\n//#region src/ir/sql-table-ir.ts\n/**\n* Schema IR node for a single table as observed by introspection.\n*\n* Unlike the Contract IR `StorageTable`, this carries the table's\n* `name` — introspection queries return tables as arrays and the\n* verifier keys them into `SqlSchemaIR.tables` afterwards, so the name\n* stays on the table object for downstream call sites that walk\n* `Object.values(schema.tables)`.\n*\n* The constructor normalises nested IR-class fields so downstream\n* walks see a uniform AST regardless of whether the input was a\n* plain-data literal (from introspection) or already-constructed\n* class instances.\n*\n* Implements `DiffableNode` so a flat (single-schema) tree is directly\n* diffable: `id` is the table name; `isEqualTo` is identity (the table's\n* structural drift is entirely expressed by its children); `children()`\n* yields every column, the primary key (when present), every foreign key,\n* unique, index, and check constraint — the same composition and order as\n* the Postgres table node, minus policies.\n*/\nvar SqlTableIR = class extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.table;\n\tname;\n\tcolumns;\n\tforeignKeys;\n\tuniques;\n\tindexes;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = input.name;\n\t\tthis.columns = Object.freeze(Object.fromEntries(Object.entries(input.columns).map(([key, col]) => [key, col instanceof SqlColumnIR ? col : new SqlColumnIR(col)])));\n\t\tthis.foreignKeys = Object.freeze(input.foreignKeys.map((fk) => fk instanceof SqlForeignKeyIR ? fk : new SqlForeignKeyIR(fk)));\n\t\tthis.uniques = Object.freeze(input.uniques.map((u) => u instanceof SqlUniqueIR ? u : new SqlUniqueIR(u)));\n\t\tthis.indexes = Object.freeze(input.indexes.map(SqlIndexIR.from));\n\t\tif (input.primaryKey !== void 0) this.primaryKey = PrimaryKey.from(input.primaryKey);\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tif (input.checks !== void 0 && input.checks.length > 0) this.checks = Object.freeze(input.checks.map(SqlCheckConstraintIR.from));\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn this.name;\n\t}\n\tisEqualTo(other) {\n\t\treturn this.id === other.id;\n\t}\n\tchildren() {\n\t\treturn [\n\t\t\t...Object.values(this.columns),\n\t\t\t...this.primaryKey ? [this.primaryKey] : [],\n\t\t\t...this.foreignKeys,\n\t\t\t...this.uniques,\n\t\t\t...this.indexes,\n\t\t\t...this.checks ?? []\n\t\t];\n\t}\n};\n//#endregion\n//#region src/ir/sql-schema-ir.ts\n/**\n* Root Schema IR node representing the complete database schema as\n* observed by introspection. Target-agnostic; used by both verifiers\n* (compare against intended Contract storage) and migration planners\n* (derive operations needed to reconcile).\n*\n* The constructor normalises nested `SqlTableIR` instances so\n* downstream walks see a uniform AST regardless of whether the input\n* was a plain-data literal or already-constructed class instances.\n*\n* Implements `DiffableNode` as the root of a flat (single-schema) diff\n* tree: `id` is the fixed sentinel `'database'` (roots have no siblings),\n* `isEqualTo` is identity (a container has no own attributes), and\n* `children()` yields the table nodes.\n*/\nvar SqlSchemaIR = class extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.schema;\n\ttables;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.tables = Object.freeze(Object.fromEntries(Object.entries(input.tables).map(([key, t]) => [key, t instanceof SqlTableIR ? t : new SqlTableIR(t)])));\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"database\";\n\t}\n\tisEqualTo(other) {\n\t\treturn this.id === other.id;\n\t}\n\tchildren() {\n\t\treturn Object.values(this.tables);\n\t}\n};\n//#endregion\nexport { defaultInCanonicalForm as _, SqlForeignKeyIR as a, SqlCheckConstraintIR as c, assertNode as d, defineNonEnumerable as f, contractDefaultRefusal as g, relationalNodeGranularity as h, SqlIndexIR as i, PrimaryKey as l, relationalNodeEntityKind as m, SqlTableIR as n, SqlColumnIR as o, RelationalSchemaNodeKind as p, SqlUniqueIR as r, SqlColumnDefaultIR as s, SqlSchemaIR as t, SqlSchemaIRNode as u };\n\n//# sourceMappingURL=types-yyhkYQNT.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,SAAS,uBAAuB,OAAO,iBAAiB,MAAM;CAC7D,IAAI,oBAAoB,KAAK,GAAG,OAAO;EACtC;EACA,SAAS,KAAK;CACf;CACA,IAAI,QAAQ,MAAM,QAAQ,KAAK,GAAG;EACjC,MAAM,WAAW,MAAM,KAAK,YAAY,gBAAgB,SAAS,eAAe,CAAC;EACjF,OAAO;GACN,OAAO,SAAS,KAAK,YAAY,QAAQ,KAAK;GAC9C,SAAS,SAAS,MAAM,YAAY,QAAQ,YAAY,KAAK,CAAC,CAAC,EAAE;EAClE;CACD;CACA,MAAM,YAAY,gBAAgB,iBAAiB,OAAO,MAAM,YAAY,IAAI,OAAO,eAAe;CACtG,OAAO,UAAU,YAAY,KAAK,IAAI,YAAY;EACjD;EACA,SAAS,UAAU;CACpB;AACD;AACA,SAAS,gBAAgB,OAAO,iBAAiB;CAChD,IAAI;EACH,OAAO;GACN,OAAO,gBAAgB,KAAK;GAC5B,SAAS,KAAK;EACf;CACD,SAAS,OAAO;EACf,IAAI,kBAAkB,KAAK,KAAK,MAAM,SAAS,yBAAyB,OAAO;GAC9E;GACA,SAAS,MAAM;EAChB;EACA,MAAM;CACP;AACD;;;;;AAKA,SAAS,uBAAuB,eAAe,iBAAiB,MAAM;CACrE,IAAI,eAAe,SAAS,WAAW,OAAO,KAAK;CACnD,MAAM,EAAE,YAAY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,OAAO,OAAO,KAAK,OAAO;GAC7B,GAAG,KAAK,aAAa,CAAC,KAAK,UAAU,IAAI,CAAC;GAC1C,GAAG,KAAK;GACR,GAAG,KAAK;GACR,GAAG,KAAK;GACR,GAAG,KAAK,UAAU,CAAC;EACpB;CACD;AACD;;;;;;;;;;;;;;;;AAkBA,IAAI,cAAc,cAAc,gBAAgB;CAC/C,WAAW,yBAAyB;CACpC;CACA,YAAY,OAAO;EAClB,MAAM;EACN,KAAK,SAAS,OAAO,OAAO,OAAO,YAAY,OAAO,QAAQ,MAAM,MAAM,CAAC,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,KAAK,aAAa,aAAa,IAAI,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;EACtJ,IAAI,MAAM,gBAAgB,KAAK,GAAG,KAAK,cAAc,MAAM;EAC3D,WAAW,IAAI;CAChB;CACA,IAAI,KAAK;EACR,OAAO;CACR;CACA,UAAU,OAAO;EAChB,OAAO,KAAK,OAAO,MAAM;CAC1B;CACA,WAAW;EACV,OAAO,OAAO,OAAO,KAAK,MAAM;CACjC;AACD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as contractError } from "./contract-errors-BCN6RVI5-5IHBF_lg.mjs";
|
|
2
|
-
import { a as computeIndexContentHash, i as computeCheckContentHash } from "./naming-
|
|
3
|
-
import { f as composeSqlEntityKinds } from "./entity-kinds-D7vwoN_T-
|
|
2
|
+
import { a as computeIndexContentHash, i as computeCheckContentHash } from "./naming-Cc_t1q6s-CouBOmqZ.mjs";
|
|
3
|
+
import { f as composeSqlEntityKinds } from "./entity-kinds-D7vwoN_T-NmeI6TpT.mjs";
|
|
4
4
|
import { ContractValidationError } from "@prisma/orm-framework/contract/contract-validation-error";
|
|
5
5
|
import { isPlainRecord } from "@prisma/orm-framework/components/ir";
|
|
6
6
|
import { ContractExecutionSectionSchema, CrossReferenceSchema } from "@prisma/orm-framework/contract/types";
|
|
@@ -651,4 +651,4 @@ function validateRelationThroughConsistency(contract) {
|
|
|
651
651
|
//#endregion
|
|
652
652
|
export { createSqlStorageSchema as a, validateModel as c, validateSqlStorageConsistency as d, validateStorage as f, createSqlContractSchema as i, validateModelStorageReferences as l, checkSqlDefaultBody as n, reservedSqlDefaultBody as o, validateStorageSemantics as p, createNamespaceEntrySchema as r, resolveSqlToOneRelationStorage as s, ContractEnumSchema as t, validateSqlContractFully as u };
|
|
653
653
|
|
|
654
|
-
//# sourceMappingURL=validators-
|
|
654
|
+
//# sourceMappingURL=validators-BlqrBU7I.mjs.map
|