@prisma/orm-family-sql 8.0.0-rc.14-dev.1 → 8.0.0-rc.14-dev.2

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.
Files changed (129) hide show
  1. package/dist/{ast-DQU1yUQ5.d.mts → ast-B53rACdv.d.mts} +3 -3
  2. package/dist/{ast-DQU1yUQ5.d.mts.map → ast-B53rACdv.d.mts.map} +1 -1
  3. package/dist/{authoring-entity-types-CZ-vdwYS-GsYvzoFF.d.mts → authoring-entity-types-CZ-vdwYS-D6R9QovE.d.mts} +2 -2
  4. package/dist/{authoring-entity-types-CZ-vdwYS-GsYvzoFF.d.mts.map → authoring-entity-types-CZ-vdwYS-D6R9QovE.d.mts.map} +1 -1
  5. package/dist/{authoring-type-constructors-DQZEX4Sb-BYGQWq43.mjs → authoring-type-constructors-DQZEX4Sb-D6uFhwhG.mjs} +2 -2
  6. package/dist/{authoring-type-constructors-DQZEX4Sb-BYGQWq43.mjs.map → authoring-type-constructors-DQZEX4Sb-D6uFhwhG.mjs.map} +1 -1
  7. package/dist/builder.d.mts +2 -2
  8. package/dist/builder__runtime.d.mts +6 -6
  9. package/dist/builder__types.d.mts +2 -2
  10. package/dist/{config-types-B86lMw4s.mjs → config-types-CEXpi8FV.mjs} +2 -2
  11. package/dist/{config-types-B86lMw4s.mjs.map → config-types-CEXpi8FV.mjs.map} +1 -1
  12. package/dist/{contract-builder-j05FWfIe.d.mts → contract-builder-6ujqQuj-.d.mts} +2 -2
  13. package/dist/{contract-builder-j05FWfIe.d.mts.map → contract-builder-6ujqQuj-.d.mts.map} +1 -1
  14. package/dist/{contract-builder-Fw-SFRvK.mjs → contract-builder-vmb0E3SP.mjs} +2 -2
  15. package/dist/{contract-builder-Fw-SFRvK.mjs.map → contract-builder-vmb0E3SP.mjs.map} +1 -1
  16. package/dist/contract-emitter.mjs +1 -1
  17. package/dist/contract-prisma7__provider.mjs +4 -4
  18. package/dist/contract-prisma7__provider.mjs.map +1 -1
  19. package/dist/contract-psl.d.mts +4 -4
  20. package/dist/contract-psl.d.mts.map +1 -1
  21. package/dist/contract-psl.mjs +1 -1
  22. package/dist/contract-psl__provider.mjs +2 -2
  23. package/dist/contract-psl__provider.mjs.map +1 -1
  24. package/dist/contract-ts.d.mts +1 -1
  25. package/dist/contract-ts.mjs +3 -3
  26. package/dist/contract-ts__config-types.mjs +1 -1
  27. package/dist/contract-ts__contract-builder.d.mts +1 -1
  28. package/dist/contract-ts__contract-builder.mjs +2 -2
  29. package/dist/contract.d.mts +2 -1
  30. package/dist/contract.mjs +2 -1
  31. package/dist/contract__sql-expression.d.mts +2 -0
  32. package/dist/contract__sql-expression.mjs +2 -0
  33. package/dist/{control-DOGYQMFH.mjs → control-2-eFP31F.mjs} +9 -47
  34. package/dist/control-2-eFP31F.mjs.map +1 -0
  35. package/dist/{control-kbS8DWF0.d.mts → control-DmVQjyZd.d.mts} +15 -20
  36. package/dist/control-DmVQjyZd.d.mts.map +1 -0
  37. package/dist/{control-adapter-C99J7aEF-B571Jffd.d.mts → control-adapter-C99J7aEF-B3_IhgH6.d.mts} +4 -4
  38. package/dist/{control-adapter-C99J7aEF-B571Jffd.d.mts.map → control-adapter-C99J7aEF-B3_IhgH6.d.mts.map} +1 -1
  39. package/dist/control-adapter-kl-cOML5.d.mts +1 -0
  40. package/dist/{db-DLjWu9-f-CVAu8jgd.d.mts → db-DLjWu9-f-COdzEg7b.d.mts} +6 -6
  41. package/dist/{db-DLjWu9-f-CVAu8jgd.d.mts.map → db-DLjWu9-f-COdzEg7b.d.mts.map} +1 -1
  42. package/dist/{ddl-types-DD-i-Uj9-D99heD5Z.d.mts → ddl-types-DD-i-Uj9-BRqLNUDm.d.mts} +2 -2
  43. package/dist/{ddl-types-DD-i-Uj9-D99heD5Z.d.mts.map → ddl-types-DD-i-Uj9-BRqLNUDm.d.mts.map} +1 -1
  44. package/dist/{derived-checks-C6psACIj-DfqUVmZz.mjs → derived-checks-C6psACIj-BSBDa2_9.mjs} +3 -3
  45. package/dist/{derived-checks-C6psACIj-DfqUVmZz.mjs.map → derived-checks-C6psACIj-BSBDa2_9.mjs.map} +1 -1
  46. package/dist/{diff-BxwNI8yE.d.mts → diff-DFOiwUHg.d.mts} +3 -3
  47. package/dist/{diff-BxwNI8yE.d.mts.map → diff-DFOiwUHg.d.mts.map} +1 -1
  48. package/dist/{dist-U61NPKN3.mjs → dist-ChyuAdtP.mjs} +2 -2
  49. package/dist/{dist-U61NPKN3.mjs.map → dist-ChyuAdtP.mjs.map} +1 -1
  50. package/dist/{expression-BPoA5eEl.d.mts → expression-Dl5WvxCA.d.mts} +3 -3
  51. package/dist/{expression-BPoA5eEl.d.mts.map → expression-Dl5WvxCA.d.mts.map} +1 -1
  52. package/dist/family.d.mts +11 -11
  53. package/dist/family.mjs +3 -3
  54. package/dist/family__control-adapter.d.mts +2 -2
  55. package/dist/family__control.d.mts +3 -3
  56. package/dist/family__control.mjs +2 -2
  57. package/dist/family__diff.d.mts +2 -2
  58. package/dist/family__migration.d.mts +1 -1
  59. package/dist/family__pack.d.mts +1 -1
  60. package/dist/family__pack.mjs +1 -1
  61. package/dist/family__psl-build.d.mts +2 -2
  62. package/dist/family__psl-build.mjs +1 -1
  63. package/dist/family__psl-infer.d.mts +1 -1
  64. package/dist/{index-yNeNt2GO.d.mts → index-BNL2_qQY.d.mts} +9 -9
  65. package/dist/{index-yNeNt2GO.d.mts.map → index-BNL2_qQY.d.mts.map} +1 -1
  66. package/dist/{interpreter-IKKTyZNv-D12J5Dcx.mjs → interpreter-Bcc3MIC5-C4dZrobt.mjs} +53 -71
  67. package/dist/interpreter-Bcc3MIC5-C4dZrobt.mjs.map +1 -0
  68. package/dist/{middleware-CuGBptK0-C88HCnh5.d.mts → middleware-CuGBptK0-UwVChCr2.d.mts} +2 -2
  69. package/dist/{middleware-CuGBptK0-C88HCnh5.d.mts.map → middleware-CuGBptK0-UwVChCr2.d.mts.map} +1 -1
  70. package/dist/middleware-RUh4qBBg.d.mts +1 -0
  71. package/dist/{migration-BJCmLNwu.d.mts → migration-Csmr6bd8.d.mts} +2 -2
  72. package/dist/{migration-BJCmLNwu.d.mts.map → migration-Csmr6bd8.d.mts.map} +1 -1
  73. package/dist/orm-client.d.mts +11 -11
  74. package/dist/{pack-CUGnCaEh.d.mts → pack-BUv79Jrr.d.mts} +2 -2
  75. package/dist/{pack-CUGnCaEh.d.mts.map → pack-BUv79Jrr.d.mts.map} +1 -1
  76. package/dist/{plan-B7g2kDfQ-Bw0784x6.d.mts → plan-B7g2kDfQ-ZD3BfWYx.d.mts} +2 -2
  77. package/dist/{plan-B7g2kDfQ-Bw0784x6.d.mts.map → plan-B7g2kDfQ-ZD3BfWYx.d.mts.map} +1 -1
  78. package/dist/plan-CVje8E5I.d.mts +2 -0
  79. package/dist/{prepared-statement-BHSj2pDk-BL0wOCnq.d.mts → prepared-statement-BHSj2pDk-D9a_Vwr-.d.mts} +14 -14
  80. package/dist/{prepared-statement-BHSj2pDk-BL0wOCnq.d.mts.map → prepared-statement-BHSj2pDk-D9a_Vwr-.d.mts.map} +1 -1
  81. package/dist/{psl-build-yBrQQN3r.d.mts → psl-build-BnM1ZTyK.d.mts} +2 -2
  82. package/dist/psl-build-BnM1ZTyK.d.mts.map +1 -0
  83. package/dist/{psl-build-SOpIFu24.mjs → psl-build-ph4eUJSB.mjs} +6 -21
  84. package/dist/psl-build-ph4eUJSB.mjs.map +1 -0
  85. package/dist/{psl-infer-C8hg8mIS.d.mts → psl-infer-DT5_Lx5r.d.mts} +2 -2
  86. package/dist/{psl-infer-C8hg8mIS.d.mts.map → psl-infer-DT5_Lx5r.d.mts.map} +1 -1
  87. package/dist/query-lane-context-D54z0tof.d.mts +1 -0
  88. package/dist/{query-lane-context-D6o9YrEV-bouFPM6u.d.mts → query-lane-context-D6o9YrEV-BxW3-5e8.d.mts} +3 -3
  89. package/dist/{query-lane-context-D6o9YrEV-bouFPM6u.d.mts.map → query-lane-context-D6o9YrEV-BxW3-5e8.d.mts.map} +1 -1
  90. package/dist/relational-core.d.mts +11 -11
  91. package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
  92. package/dist/relational-core__ast.d.mts +3 -3
  93. package/dist/relational-core__codec-descriptor-registry.d.mts +2 -2
  94. package/dist/relational-core__contract-free.d.mts +2 -2
  95. package/dist/relational-core__expression.d.mts +1 -1
  96. package/dist/relational-core__middleware.d.mts +2 -2
  97. package/dist/relational-core__plan.d.mts +3 -3
  98. package/dist/relational-core__query-lane-context.d.mts +2 -2
  99. package/dist/relational-core__types.d.mts +2 -2
  100. package/dist/runtime.d.mts +4 -4
  101. package/dist/runtime.mjs +33 -33
  102. package/dist/runtime.mjs.map +1 -1
  103. package/dist/runtime__internal__prepared-query.d.mts +1 -1
  104. package/dist/{sql-execution-plan-Db0j752I-CI5WbdLi.d.mts → sql-execution-plan-Db0j752I-faODNLY9.d.mts} +2 -2
  105. package/dist/{sql-execution-plan-Db0j752I-CI5WbdLi.d.mts.map → sql-execution-plan-Db0j752I-faODNLY9.d.mts.map} +1 -1
  106. package/dist/sql-expression-BXx0Ilj-.mjs +51 -0
  107. package/dist/sql-expression-BXx0Ilj-.mjs.map +1 -0
  108. package/dist/sql-expression-D_hbJOgM.d.mts +27 -0
  109. package/dist/sql-expression-D_hbJOgM.d.mts.map +1 -0
  110. package/dist/{type-map-BwBI56i3-DDERtzxf.d.mts → type-map-DpfnXzun-DZaSuJXh.d.mts} +5 -5
  111. package/dist/{type-map-BwBI56i3-DDERtzxf.d.mts.map → type-map-DpfnXzun-DZaSuJXh.d.mts.map} +1 -1
  112. package/dist/{types-BFPRCYGW-BLH0sK1Y.d.mts → types-BFPRCYGW-CZrZyp1E.d.mts} +2 -2
  113. package/dist/{types-BFPRCYGW-BLH0sK1Y.d.mts.map → types-BFPRCYGW-CZrZyp1E.d.mts.map} +1 -1
  114. package/dist/{types-DFJNPLXY-vp6AGe5e.d.mts → types-DFJNPLXY-DyYKIhXA.d.mts} +5 -5
  115. package/dist/{types-DFJNPLXY-vp6AGe5e.d.mts.map → types-DFJNPLXY-DyYKIhXA.d.mts.map} +1 -1
  116. package/dist/types-Dul4Za_W.d.mts +1 -0
  117. package/dist/{types-Yui2yFf6-TP-oRDTX.d.mts → types-Yui2yFf6-Dnc7RNUD.d.mts} +2 -2
  118. package/dist/{types-Yui2yFf6-TP-oRDTX.d.mts.map → types-Yui2yFf6-Dnc7RNUD.d.mts.map} +1 -1
  119. package/package.json +19 -18
  120. package/dist/control-DOGYQMFH.mjs.map +0 -1
  121. package/dist/control-adapter-jmL_K-jB.d.mts +0 -1
  122. package/dist/control-kbS8DWF0.d.mts.map +0 -1
  123. package/dist/interpreter-IKKTyZNv-D12J5Dcx.mjs.map +0 -1
  124. package/dist/middleware-aoqicpDI.d.mts +0 -1
  125. package/dist/plan-DiT00Rg8.d.mts +0 -2
  126. package/dist/psl-build-SOpIFu24.mjs.map +0 -1
  127. package/dist/psl-build-yBrQQN3r.d.mts.map +0 -1
  128. package/dist/query-lane-context-BcXiJasG.d.mts +0 -1
  129. package/dist/types-BvTYXSiS.d.mts +0 -1
@@ -1,17 +1,17 @@
1
1
  import { i as SqlNamespaceBase, s as SqlNamespaceInput } from "./sql-storage-8LqxeLAY-DH4DdUXx.mjs";
2
2
  import "./types-C36_3E6_.mjs";
3
- import "./contract-builder-j05FWfIe.mjs";
4
- import { AuthoringContributions, AuthoringDataTypeEntry } from "@prisma/orm-framework/components/authoring";
3
+ import "./contract-builder-6ujqQuj-.mjs";
4
+ import { AuthoringContributions, DataTypeAuthoringEntry } from "@prisma/orm-framework/components/authoring";
5
5
  import { ColumnDefault, Contract, ExecutionMutationDefaultPhases, JsonValue, ValueSetRef } from "@prisma/orm-framework/contract/types";
6
- import { DocumentAst, PslSources } from "@prisma/orm-framework/psl-parser/syntax";
7
6
  import { CodecLookup, DataTypeLookup } from "@prisma/orm-framework/components/codec";
8
7
  import { CapabilityMatrix, ExtensionPackRef, TargetPackRef } from "@prisma/orm-framework/components/components";
8
+ import { DocumentAst, PslSources } from "@prisma/orm-framework/psl-parser/syntax";
9
9
  import { ControlMutationDefaults, ControlMutationDefaults as ControlMutationDefaults$1, DefaultFunctionLoweringContext, MutationDefaultGeneratorDescriptor } from "@prisma/orm-framework/components/control";
10
10
  import { Result } from "@prisma/orm-framework/utils/result";
11
11
  import { SymbolTable } from "@prisma/orm-framework/psl-parser";
12
12
  import "@prisma/orm-framework/components/psl-ast";
13
13
  import { ContractSourceDiagnostic, ContractSourceDiagnostics } from "@prisma/orm-framework/config/config-types";
14
- //#region ../../../2-sql/2-authoring/contract-psl/dist/interpreter-5l041qZX.d.mts
14
+ //#region ../../../2-sql/2-authoring/contract-psl/dist/interpreter-DnOqX6Mi.d.mts
15
15
  //#endregion
16
16
  //#region src/psl-column-resolution.d.ts
17
17
  type ColumnDescriptor = {
@@ -1 +1 @@
1
- {"version":3,"file":"contract-psl.d.mts","names":[],"sources":["../../../../2-sql/2-authoring/contract-psl/dist/interpreter-5l041qZX.d.mts"],"mappings":";;;;;;;;;;;;;;;;KAmGK;WACM;WACA;WACA;WACA,aAAa;;;;;;;;;WASb,WAAW;;;;UAyDZ;WACC,oBAAoB;WACpB,aAAa;WACb,SAAS;WACT,QAAQ;WACR,yBAAyB,oBAAoB;WAC7C;WACA,qCAAqC;WACrC,0BAA0B;;WAE1B,gBAAgB;WAChB,yBAAyB;;;;;;;;;;WAUzB,4BAA4B,oBAAoB;;WAEhD,kBAAkB,OAAO,sBAAsB;WAC/C,cAAc;WACd,2BAA2B;;WAE3B;aACE;aACA;;WAEF,cAAc;;iBASR,kCAAkC,OAAO,yCAAyC,OAAO,UAAU"}
1
+ {"version":3,"file":"contract-psl.d.mts","names":[],"sources":["../../../../2-sql/2-authoring/contract-psl/dist/interpreter-DnOqX6Mi.d.mts"],"mappings":";;;;;;;;;;;;;;;;KAkGK;WACM;WACA;WACA;WACA,aAAa;;;;;;;;;WASb,WAAW;;;;UAyDZ;WACC,oBAAoB;WACpB,aAAa;WACb,SAAS;WACT,QAAQ;WACR,yBAAyB,oBAAoB;WAC7C;WACA,qCAAqC;WACrC,0BAA0B;;WAE1B,gBAAgB;WAChB,yBAAyB;;;;;;;;;;WAUzB,4BAA4B,oBAAoB;;WAEhD,kBAAkB,OAAO,sBAAsB;WAC/C,cAAc;WACd,2BAA2B;;WAE3B;aACE;aACA;;WAEF,cAAc;;iBASR,kCAAkC,OAAO,yCAAyC,OAAO,UAAU"}
@@ -1,2 +1,2 @@
1
- import { a as interpretPslDocumentToSqlContract } from "./interpreter-IKKTyZNv-D12J5Dcx.mjs";
1
+ import { a as interpretPslDocumentToSqlContract } from "./interpreter-Bcc3MIC5-C4dZrobt.mjs";
2
2
  export { interpretPslDocumentToSqlContract };
@@ -1,5 +1,5 @@
1
- import { t as applySqlSpecifierControlPolicy } from "./derived-checks-C6psACIj-DfqUVmZz.mjs";
2
- import { a as interpretPslDocumentToSqlContract } from "./interpreter-IKKTyZNv-D12J5Dcx.mjs";
1
+ import { t as applySqlSpecifierControlPolicy } from "./derived-checks-C6psACIj-BSBDa2_9.mjs";
2
+ import { a as interpretPslDocumentToSqlContract } from "./interpreter-Bcc3MIC5-C4dZrobt.mjs";
3
3
  import { collectScalarTypeConstructors } from "@prisma/orm-framework/components/authoring";
4
4
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
5
5
  import { readFile } from "node:fs/promises";
@@ -1 +1 @@
1
- {"version":3,"file":"contract-psl__provider.mjs","names":[],"sources":["../../../../2-sql/2-authoring/contract-psl/dist/provider.mjs"],"sourcesContent":["import { n as interpretPslDocumentToSqlContract } from \"./interpreter-IKKTyZNv.mjs\";\nimport { collectScalarTypeConstructors } from \"@internal/framework-components/authoring\";\nimport { buildSymbolTable, isPrismaNextSchema, mapPslDiagnostics } from \"@internal/psl-parser\";\nimport { parse } from \"@internal/psl-parser/syntax\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { withSeedDiagnostics } from \"@internal/psl-parser/interpret\";\nimport { applySqlSpecifierControlPolicy } from \"@internal/sql-contract-ts/contract-builder\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { readFile } from \"node:fs/promises\";\nimport { basename, extname } from \"pathe\";\nimport { isDynamicPattern } from \"tinyglobby\";\n//#region src/provider.ts\n/**\n* The directory portion of `pattern` before its first glob-magic segment,\n* joined back with `/` (e.g. a `prisma` directory holding a recursive\n* `.prisma` glob derives `./prisma`). A rootless pattern with no static\n* segments yields `''`.\n*/\nfunction staticPrefixDirectory(pattern) {\n\tconst staticSegments = [];\n\tfor (const segment of pattern.replaceAll(\"\\\\\", \"/\").split(\"/\")) {\n\t\tif (isDynamicPattern(segment)) break;\n\t\tstaticSegments.push(segment);\n\t}\n\treturn staticSegments.join(\"/\");\n}\n/**\n* Derives the emit output path from the schema input path so artefacts land\n* colocated with the source (e.g. `src/contract/schema.prisma` →\n* `src/contract/contract.json`). A glob-shaped path derives from its static\n* prefix directory instead (a recursive glob under `prisma` derives\n* `./prisma/contract.json`). The provider owns this because it is the only\n* layer that knows the input path; the upstream `normalizeContractConfig`\n* default is a last-resort fallback for providers that don't carry one.\n*/\nfunction defaultOutputFromSchemaPath(schemaPath) {\n\tif (isDynamicPattern(schemaPath)) {\n\t\tconst prefix = staticPrefixDirectory(schemaPath);\n\t\treturn prefix.length === 0 ? \"contract.json\" : `${prefix}/contract.json`;\n\t}\n\tconst ext = extname(schemaPath);\n\tif (ext.length === 0) return `${schemaPath}.json`;\n\tconst base = schemaPath.slice(0, -ext.length);\n\tif (basename(base) === \"schema\") return `${base.slice(0, -6)}contract.json`;\n\treturn `${base}.json`;\n}\nfunction prismaContract(schemaPath, options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"psl\",\n\t\t\tinputs: [schemaPath],\n\t\t\tinterpret(input, context) {\n\t\t\t\tconst scalarColumnDescriptors = collectScalarTypeConstructors(context.authoringContributions.type);\n\t\t\t\treturn interpretPslDocumentToSqlContract({\n\t\t\t\t\tdocuments: input.documents,\n\t\t\t\t\tsymbolTable: input.symbolTable,\n\t\t\t\t\tsources: input.sources,\n\t\t\t\t\tseedDiagnostics: [],\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\tauthoringContributions: context.authoringContributions,\n\t\t\t\t\tscalarColumnDescriptors,\n\t\t\t\t\t...ifDefined(\"composedExtensions\", context.composedExtensions.length > 0 ? [...context.composedExtensions] : void 0),\n\t\t\t\t\tcomposedExtensionContracts: context.composedExtensionContracts,\n\t\t\t\t\t...ifDefined(\"composedExtensionPackRefs\", options.composedExtensionPackRefs?.length ? options.composedExtensionPackRefs : void 0),\n\t\t\t\t\tcontrolMutationDefaults: context.controlMutationDefaults,\n\t\t\t\t\tcreateNamespace: options.createNamespace,\n\t\t\t\t\tcapabilities: context.capabilities,\n\t\t\t\t\tcodecLookup: context.codecLookup,\n\t\t\t\t\tdataTypeLookup: context.dataTypeLookup,\n\t\t\t\t\t...ifDefined(\"enumInferenceCodecs\", options.enumInferenceCodecs)\n\t\t\t\t});\n\t\t\t},\n\t\t\tasync load(context) {\n\t\t\t\tconst candidates = [...new Set(context.resolvedInputs)].sort();\n\t\t\t\tif (candidates.length === 0) return notOk({\n\t\t\t\t\tsummary: \"No schema files matched the configured contract source\",\n\t\t\t\t\tdiagnostics: [{\n\t\t\t\t\t\tcode: \"PSL_NO_SCHEMA_FILES_MATCHED\",\n\t\t\t\t\t\tmessage: `No files matched the configured pattern \"${schemaPath}\"`,\n\t\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t\tconst readDiagnostics = [];\n\t\t\t\tconst members = [];\n\t\t\t\tconst undirected = [];\n\t\t\t\tfor (const path of candidates) {\n\t\t\t\t\tlet text;\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttext = await readFile(path, \"utf-8\");\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconst message = String(error);\n\t\t\t\t\t\treadDiagnostics.push({\n\t\t\t\t\t\t\tcode: \"PSL_SCHEMA_READ_FAILED\",\n\t\t\t\t\t\t\tmessage,\n\t\t\t\t\t\t\tsourceId: path\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (isPrismaNextSchema(text)) members.push({\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\ttext\n\t\t\t\t\t});\n\t\t\t\t\telse undirected.push(path);\n\t\t\t\t}\n\t\t\t\tif (members.length === 0) {\n\t\t\t\t\tif (undirected.length === 0) return notOk({\n\t\t\t\t\t\tsummary: \"Failed to read Prisma schema files\",\n\t\t\t\t\t\tdiagnostics: readDiagnostics\n\t\t\t\t\t});\n\t\t\t\t\treturn notOk({\n\t\t\t\t\t\tsummary: \"No schema file carries the \\\"// use prisma-8\\\" directive\",\n\t\t\t\t\t\tdiagnostics: [...readDiagnostics, {\n\t\t\t\t\t\t\tcode: \"PSL_NO_OPTED_IN_SCHEMA_FILES\",\n\t\t\t\t\t\t\tmessage: `None of the matched files carry the \"// use prisma-8\" directive: ${undirected.join(\", \")}`,\n\t\t\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconst parsed = members.map(({ path, text }) => parse(text, path));\n\t\t\t\tconst documents = parsed.map(({ document }) => document);\n\t\t\t\tconst [firstSources, ...restSources] = parsed.map(({ sources }) => sources);\n\t\t\t\tassertDefined(firstSources, \"prismaContract requires at least one parsed schema file\");\n\t\t\t\tconst sources = firstSources.merge(...restSources);\n\t\t\t\tconst { symbolTable, diagnostics: symbolTableDiagnostics } = buildSymbolTable({\n\t\t\t\t\tdocuments,\n\t\t\t\t\tsources\n\t\t\t\t});\n\t\t\t\tconst seedDiagnostics = [...readDiagnostics, ...mapPslDiagnostics([...parsed.flatMap(({ diagnostics }) => diagnostics), ...symbolTableDiagnostics], sources)];\n\t\t\t\tconst interpreted = withSeedDiagnostics(this.interpret({\n\t\t\t\t\tdocuments,\n\t\t\t\t\tsources,\n\t\t\t\t\tsymbolTable\n\t\t\t\t}, context), seedDiagnostics);\n\t\t\t\tif (!interpreted.ok) return interpreted;\n\t\t\t\treturn ok(applySqlSpecifierControlPolicy(interpreted.value, options.defaultControlPolicy, options.createNamespace));\n\t\t\t}\n\t\t},\n\t\toutput: options.output ?? defaultOutputFromSchemaPath(schemaPath)\n\t};\n}\n//#endregion\nexport { prismaContract };\n\n//# sourceMappingURL=provider.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,SAAS,sBAAsB,SAAS;CACvC,MAAM,iBAAiB,CAAC;CACxB,KAAK,MAAM,WAAW,QAAQ,WAAW,MAAM,GAAG,CAAC,CAAC,MAAM,GAAG,GAAG;EAC/D,IAAI,iBAAiB,OAAO,GAAG;EAC/B,eAAe,KAAK,OAAO;CAC5B;CACA,OAAO,eAAe,KAAK,GAAG;AAC/B;;;;;;;;;;AAUA,SAAS,4BAA4B,YAAY;CAChD,IAAI,iBAAiB,UAAU,GAAG;EACjC,MAAM,SAAS,sBAAsB,UAAU;EAC/C,OAAO,OAAO,WAAW,IAAI,kBAAkB,GAAG,OAAO;CAC1D;CACA,MAAM,MAAM,QAAQ,UAAU;CAC9B,IAAI,IAAI,WAAW,GAAG,OAAO,GAAG,WAAW;CAC3C,MAAM,OAAO,WAAW,MAAM,GAAG,CAAC,IAAI,MAAM;CAC5C,IAAI,SAAS,IAAI,MAAM,UAAU,OAAO,GAAG,KAAK,MAAM,GAAG,EAAE,EAAE;CAC7D,OAAO,GAAG,KAAK;AAChB;AACA,SAAS,eAAe,YAAY,SAAS;CAC5C,OAAO;EACN,QAAQ;GACP,QAAQ;GACR,QAAQ,CAAC,UAAU;GACnB,UAAU,OAAO,SAAS;IACzB,MAAM,0BAA0B,8BAA8B,QAAQ,uBAAuB,IAAI;IACjG,OAAO,kCAAkC;KACxC,WAAW,MAAM;KACjB,aAAa,MAAM;KACnB,SAAS,MAAM;KACf,iBAAiB,CAAC;KAClB,QAAQ,QAAQ;KAChB,wBAAwB,Q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KACF,CAAC;IACF;IACA,MAAM,SAAS,QAAQ,KAAK,EAAE,MAAM,WAAW,MAAM,MAAM,IAAI,CAAC;IAChE,MAAM,YAAY,OAAO,KAAK,EAAE,eAAe,QAAQ;IACvD,MAAM,CAAC,cAAc,GAAG,eAAe,OAAO,KAAK,EAAE,cAAc,OAAO;IAC1E,cAAc,cAAc,yDAAyD;IACrF,MAAM,UAAU,aAAa,MAAM,GAAG,WAAW;IACjD,MAAM,EAAE,aAAa,aAAa,2BAA2B,iBAAiB;KAC7E;KACA;IACD,CAAC;IACD,MAAM,kBAAkB,CAAC,GAAG,iBAAiB,GAAG,kBAAkB,CAAC,GAAG,OAAO,SAAS,EAAE,kBAAkB,WAAW,GAAG,GAAG,sBAAsB,GAAG,OAAO,CAAC;IAC5J,MAAM,cAAc,oBAAoB,KAAK,UAAU;KACtD;KACA;KACA;IACD,GAAG,OAAO,GAAG,eAAe;IAC5B,IAAI,CAAC,YAAY,IAAI,OAAO;IAC5B,OAAO,GAAG,+BAA+B,YAAY,OAAO,QAAQ,sBAAsB,QAAQ,eAAe,CAAC;GACnH;EACD;EACA,QAAQ,QAAQ,UAAU,4BAA4B,UAAU;CACjE;AACD"}
1
+ {"version":3,"file":"contract-psl__provider.mjs","names":[],"sources":["../../../../2-sql/2-authoring/contract-psl/dist/provider.mjs"],"sourcesContent":["import { n as interpretPslDocumentToSqlContract } from \"./interpreter-Bcc3MIC5.mjs\";\nimport { collectScalarTypeConstructors } from \"@internal/framework-components/authoring\";\nimport { buildSymbolTable, isPrismaNextSchema, mapPslDiagnostics } from \"@internal/psl-parser\";\nimport { parse } from \"@internal/psl-parser/syntax\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { withSeedDiagnostics } from \"@internal/psl-parser/interpret\";\nimport { applySqlSpecifierControlPolicy } from \"@internal/sql-contract-ts/contract-builder\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { readFile } from \"node:fs/promises\";\nimport { basename, extname } from \"pathe\";\nimport { isDynamicPattern } from \"tinyglobby\";\n//#region src/provider.ts\n/**\n* The directory portion of `pattern` before its first glob-magic segment,\n* joined back with `/` (e.g. a `prisma` directory holding a recursive\n* `.prisma` glob derives `./prisma`). A rootless pattern with no static\n* segments yields `''`.\n*/\nfunction staticPrefixDirectory(pattern) {\n\tconst staticSegments = [];\n\tfor (const segment of pattern.replaceAll(\"\\\\\", \"/\").split(\"/\")) {\n\t\tif (isDynamicPattern(segment)) break;\n\t\tstaticSegments.push(segment);\n\t}\n\treturn staticSegments.join(\"/\");\n}\n/**\n* Derives the emit output path from the schema input path so artefacts land\n* colocated with the source (e.g. `src/contract/schema.prisma` →\n* `src/contract/contract.json`). A glob-shaped path derives from its static\n* prefix directory instead (a recursive glob under `prisma` derives\n* `./prisma/contract.json`). The provider owns this because it is the only\n* layer that knows the input path; the upstream `normalizeContractConfig`\n* default is a last-resort fallback for providers that don't carry one.\n*/\nfunction defaultOutputFromSchemaPath(schemaPath) {\n\tif (isDynamicPattern(schemaPath)) {\n\t\tconst prefix = staticPrefixDirectory(schemaPath);\n\t\treturn prefix.length === 0 ? \"contract.json\" : `${prefix}/contract.json`;\n\t}\n\tconst ext = extname(schemaPath);\n\tif (ext.length === 0) return `${schemaPath}.json`;\n\tconst base = schemaPath.slice(0, -ext.length);\n\tif (basename(base) === \"schema\") return `${base.slice(0, -6)}contract.json`;\n\treturn `${base}.json`;\n}\nfunction prismaContract(schemaPath, options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"psl\",\n\t\t\tinputs: [schemaPath],\n\t\t\tinterpret(input, context) {\n\t\t\t\tconst scalarColumnDescriptors = collectScalarTypeConstructors(context.authoringContributions.type);\n\t\t\t\treturn interpretPslDocumentToSqlContract({\n\t\t\t\t\tdocuments: input.documents,\n\t\t\t\t\tsymbolTable: input.symbolTable,\n\t\t\t\t\tsources: input.sources,\n\t\t\t\t\tseedDiagnostics: [],\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\tauthoringContributions: context.authoringContributions,\n\t\t\t\t\tscalarColumnDescriptors,\n\t\t\t\t\t...ifDefined(\"composedExtensions\", context.composedExtensions.length > 0 ? [...context.composedExtensions] : void 0),\n\t\t\t\t\tcomposedExtensionContracts: context.composedExtensionContracts,\n\t\t\t\t\t...ifDefined(\"composedExtensionPackRefs\", options.composedExtensionPackRefs?.length ? options.composedExtensionPackRefs : void 0),\n\t\t\t\t\tcontrolMutationDefaults: context.controlMutationDefaults,\n\t\t\t\t\tcreateNamespace: options.createNamespace,\n\t\t\t\t\tcapabilities: context.capabilities,\n\t\t\t\t\tcodecLookup: context.codecLookup,\n\t\t\t\t\tdataTypeLookup: context.dataTypeLookup,\n\t\t\t\t\t...ifDefined(\"enumInferenceCodecs\", options.enumInferenceCodecs)\n\t\t\t\t});\n\t\t\t},\n\t\t\tasync load(context) {\n\t\t\t\tconst candidates = [...new Set(context.resolvedInputs)].sort();\n\t\t\t\tif (candidates.length === 0) return notOk({\n\t\t\t\t\tsummary: \"No schema files matched the configured contract source\",\n\t\t\t\t\tdiagnostics: [{\n\t\t\t\t\t\tcode: \"PSL_NO_SCHEMA_FILES_MATCHED\",\n\t\t\t\t\t\tmessage: `No files matched the configured pattern \"${schemaPath}\"`,\n\t\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t\tconst readDiagnostics = [];\n\t\t\t\tconst members = [];\n\t\t\t\tconst undirected = [];\n\t\t\t\tfor (const path of candidates) {\n\t\t\t\t\tlet text;\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttext = await readFile(path, \"utf-8\");\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconst message = String(error);\n\t\t\t\t\t\treadDiagnostics.push({\n\t\t\t\t\t\t\tcode: \"PSL_SCHEMA_READ_FAILED\",\n\t\t\t\t\t\t\tmessage,\n\t\t\t\t\t\t\tsourceId: path\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (isPrismaNextSchema(text)) members.push({\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\ttext\n\t\t\t\t\t});\n\t\t\t\t\telse undirected.push(path);\n\t\t\t\t}\n\t\t\t\tif (members.length === 0) {\n\t\t\t\t\tif (undirected.length === 0) return notOk({\n\t\t\t\t\t\tsummary: \"Failed to read Prisma schema files\",\n\t\t\t\t\t\tdiagnostics: readDiagnostics\n\t\t\t\t\t});\n\t\t\t\t\treturn notOk({\n\t\t\t\t\t\tsummary: \"No schema file carries the \\\"// use prisma-8\\\" directive\",\n\t\t\t\t\t\tdiagnostics: [...readDiagnostics, {\n\t\t\t\t\t\t\tcode: \"PSL_NO_OPTED_IN_SCHEMA_FILES\",\n\t\t\t\t\t\t\tmessage: `None of the matched files carry the \"// use prisma-8\" directive: ${undirected.join(\", \")}`,\n\t\t\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconst parsed = members.map(({ path, text }) => parse(text, path));\n\t\t\t\tconst documents = parsed.map(({ document }) => document);\n\t\t\t\tconst [firstSources, ...restSources] = parsed.map(({ sources }) => sources);\n\t\t\t\tassertDefined(firstSources, \"prismaContract requires at least one parsed schema file\");\n\t\t\t\tconst sources = firstSources.merge(...restSources);\n\t\t\t\tconst { symbolTable, diagnostics: symbolTableDiagnostics } = buildSymbolTable({\n\t\t\t\t\tdocuments,\n\t\t\t\t\tsources\n\t\t\t\t});\n\t\t\t\tconst seedDiagnostics = [...readDiagnostics, ...mapPslDiagnostics([...parsed.flatMap(({ diagnostics }) => diagnostics), ...symbolTableDiagnostics], sources)];\n\t\t\t\tconst interpreted = withSeedDiagnostics(this.interpret({\n\t\t\t\t\tdocuments,\n\t\t\t\t\tsources,\n\t\t\t\t\tsymbolTable\n\t\t\t\t}, context), seedDiagnostics);\n\t\t\t\tif (!interpreted.ok) return interpreted;\n\t\t\t\treturn ok(applySqlSpecifierControlPolicy(interpreted.value, options.defaultControlPolicy, options.createNamespace));\n\t\t\t}\n\t\t},\n\t\toutput: options.output ?? defaultOutputFromSchemaPath(schemaPath)\n\t};\n}\n//#endregion\nexport { prismaContract };\n\n//# sourceMappingURL=provider.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,SAAS,sBAAsB,SAAS;CACvC,MAAM,iBAAiB,CAAC;CACxB,KAAK,MAAM,WAAW,QAAQ,WAAW,MAAM,GAAG,CAAC,CAAC,MAAM,GAAG,GAAG;EAC/D,IAAI,iBAAiB,OAAO,GAAG;EAC/B,eAAe,KAAK,OAAO;CAC5B;CACA,OAAO,eAAe,KAAK,GAAG;AAC/B;;;;;;;;;;AAUA,SAAS,4BAA4B,YAAY;CAChD,IAAI,iBAAiB,UAAU,GAAG;EACjC,MAAM,SAAS,sBAAsB,UAAU;EAC/C,OAAO,OAAO,WAAW,IAAI,kBAAkB,GAAG,OAAO;CAC1D;CACA,MAAM,MAAM,QAAQ,UAAU;CAC9B,IAAI,IAAI,WAAW,GAAG,OAAO,GAAG,WAAW;CAC3C,MAAM,OAAO,WAAW,MAAM,GAAG,CAAC,IAAI,MAAM;CAC5C,IAAI,SAAS,IAAI,MAAM,UAAU,OAAO,GAAG,KAAK,MAAM,GAAG,EAAE,EAAE;CAC7D,OAAO,GAAG,KAAK;AAChB;AACA,SAAS,eAAe,YAAY,SAAS;CAC5C,OAAO;EACN,QAAQ;GACP,QAAQ;GACR,QAAQ,CAAC,UAAU;GACnB,UAAU,OAAO,SAAS;IACzB,MAAM,0BAA0B,8BAA8B,QAAQ,uBAAuB,IAAI;IACjG,OAAO,kCAAkC;KACxC,WAAW,MAAM;KACjB,aAAa,MAAM;KACnB,SAAS,MAAM;KACf,iBAAiB,CAAC;KAClB,QAAQ,QAAQ;KAChB,wBAAwB,QAAQ;KAChC;KACA,GAAG,UAAU,sBAAsB,QAAQ,mBAAmB,SAAS,IAAI,CAAC,GAAG,QAAQ,kBAAkB,IAAI,KAAK,CAAC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O,KAAK,EAAE,eAAe,QAAQ;IACvD,MAAM,CAAC,cAAc,GAAG,eAAe,OAAO,KAAK,EAAE,cAAc,OAAO;IAC1E,cAAc,cAAc,yDAAyD;IACrF,MAAM,UAAU,aAAa,MAAM,GAAG,WAAW;IACjD,MAAM,EAAE,aAAa,aAAa,2BAA2B,iBAAiB;KAC7E;KACA;IACD,CAAC;IACD,MAAM,kBAAkB,CAAC,GAAG,iBAAiB,GAAG,kBAAkB,CAAC,GAAG,OAAO,SAAS,EAAE,kBAAkB,WAAW,GAAG,GAAG,sBAAsB,GAAG,OAAO,CAAC;IAC5J,MAAM,cAAc,oBAAoB,KAAK,UAAU;KACtD;KACA;KACA;IACD,GAAG,OAAO,GAAG,eAAe;IAC5B,IAAI,CAAC,YAAY,IAAI,OAAO;IAC5B,OAAO,GAAG,+BAA+B,YAAY,OAAO,QAAQ,sBAAsB,QAAQ,eAAe,CAAC;GACnH;EACD;EACA,QAAQ,QAAQ,UAAU,4BAA4B,UAAU;CACjE;AACD"}
@@ -1,5 +1,5 @@
1
1
  import { t as CheckKind } from "./naming-CV9j2pXl-KARaDReS.mjs";
2
2
  import { n as applySqlSpecifierControlPolicy, t as SqlNamespaceFactory } from "./derived-checks-DPdD01O0-DNBs1ZDA.mjs";
3
- import { A as UniqueConstraintNode, B as field, C as MergeEnums, D as RelationNode, E as PrimaryKeyNode, F as buildSqlContractFromDefinition, G as sql, H as model, I as check, L as defineContract, M as bindEnumType, N as buildBoundContract, O as ScalarFieldBuilder, P as buildContractDefinition, R as enumType, S as IndexNode, T as ModelNode, U as now, V as member, W as rel, _ as ExtractCodecTypesFromPack, a as CheckNode, b as IndexConstraint, c as ColumnRef, d as ContractInput, f as ContractModelBuilder, g as EnumTypeHandle, h as EnumMember, i as BoundEnumType, j as autoincrement, k as TargetFieldRef, l as ComposedAuthoringHelpers, m as DeferredIndexExpression, n as AuthoredColumnDefault, o as CodecInput, p as DeferredIndexColumn, r as AuthoredColumnDefaultLiteralValue, s as CodecTypeMap, t as AttachedEntities, u as ContractDefinition, v as FieldNode, w as ModelLike, x as IndexExpressionInput, y as ForeignKeyNode, z as extensionModel } from "./contract-builder-j05FWfIe.mjs";
3
+ import { A as UniqueConstraintNode, B as field, C as MergeEnums, D as RelationNode, E as PrimaryKeyNode, F as buildSqlContractFromDefinition, G as sql, H as model, I as check, L as defineContract, M as bindEnumType, N as buildBoundContract, O as ScalarFieldBuilder, P as buildContractDefinition, R as enumType, S as IndexNode, T as ModelNode, U as now, V as member, W as rel, _ as ExtractCodecTypesFromPack, a as CheckNode, b as IndexConstraint, c as ColumnRef, d as ContractInput, f as ContractModelBuilder, g as EnumTypeHandle, h as EnumMember, i as BoundEnumType, j as autoincrement, k as TargetFieldRef, l as ComposedAuthoringHelpers, m as DeferredIndexExpression, n as AuthoredColumnDefault, o as CodecInput, p as DeferredIndexColumn, r as AuthoredColumnDefaultLiteralValue, s as CodecTypeMap, t as AttachedEntities, u as ContractDefinition, v as FieldNode, w as ModelLike, x as IndexExpressionInput, y as ForeignKeyNode, z as extensionModel } from "./contract-builder-6ujqQuj-.mjs";
4
4
  import { i as typescriptContractFromPath, n as emptyContract, r as typescriptContract, t as ContractConfig } from "./config-types-Bd3ud-mX.mjs";
5
5
  export { type AttachedEntities, type AuthoredColumnDefault, type AuthoredColumnDefaultLiteralValue, type BoundEnumType, type CheckKind, type CheckNode, type CodecInput, type CodecTypeMap, type ColumnRef, type ComposedAuthoringHelpers, type ContractConfig, type ContractDefinition, type ContractInput, type ContractModelBuilder, type DeferredIndexColumn, type DeferredIndexExpression, type EnumMember, type EnumTypeHandle, type ExtractCodecTypesFromPack, type FieldNode, type ForeignKeyNode, type IndexConstraint, type IndexExpressionInput, type IndexNode, type MergeEnums, type ModelLike, type ModelNode, type PrimaryKeyNode, type RelationNode, type ScalarFieldBuilder, type SqlNamespaceFactory, type TargetFieldRef, type UniqueConstraintNode, applySqlSpecifierControlPolicy, autoincrement, bindEnumType, buildBoundContract, buildContractDefinition, buildSqlContractFromDefinition, check, defineContract, emptyContract, enumType, extensionModel, field, member, model, now, rel, sql, typescriptContract, typescriptContractFromPath };
@@ -1,4 +1,4 @@
1
- import { n as buildSqlContractFromDefinition, t as applySqlSpecifierControlPolicy } from "./derived-checks-C6psACIj-DfqUVmZz.mjs";
2
- import { a as check, c as extensionModel, d as model, f as now, i as buildContractDefinition, l as field, m as sql, n as bindEnumType, o as defineContract, p as rel, r as buildBoundContract, s as enumType, t as autoincrement, u as member } from "./contract-builder-Fw-SFRvK.mjs";
3
- import { n as typescriptContract, r as typescriptContractFromPath, t as emptyContract } from "./config-types-B86lMw4s.mjs";
1
+ import { n as buildSqlContractFromDefinition, t as applySqlSpecifierControlPolicy } from "./derived-checks-C6psACIj-BSBDa2_9.mjs";
2
+ import { a as check, c as extensionModel, d as model, f as now, i as buildContractDefinition, l as field, m as sql, n as bindEnumType, o as defineContract, p as rel, r as buildBoundContract, s as enumType, t as autoincrement, u as member } from "./contract-builder-vmb0E3SP.mjs";
3
+ import { n as typescriptContract, r as typescriptContractFromPath, t as emptyContract } from "./config-types-CEXpi8FV.mjs";
4
4
  export { applySqlSpecifierControlPolicy, autoincrement, bindEnumType, buildBoundContract, buildContractDefinition, buildSqlContractFromDefinition, check, defineContract, emptyContract, enumType, extensionModel, field, member, model, now, rel, sql, typescriptContract, typescriptContractFromPath };
@@ -1,2 +1,2 @@
1
- import { n as typescriptContract, r as typescriptContractFromPath, t as emptyContract } from "./config-types-B86lMw4s.mjs";
1
+ import { n as typescriptContract, r as typescriptContractFromPath, t as emptyContract } from "./config-types-CEXpi8FV.mjs";
2
2
  export { emptyContract, typescriptContract, typescriptContractFromPath };
@@ -1,4 +1,4 @@
1
1
  import { t as CheckKind } from "./naming-CV9j2pXl-KARaDReS.mjs";
2
2
  import { n as applySqlSpecifierControlPolicy, t as SqlNamespaceFactory } from "./derived-checks-DPdD01O0-DNBs1ZDA.mjs";
3
- import { A as UniqueConstraintNode, B as field, C as MergeEnums, D as RelationNode, E as PrimaryKeyNode, F as buildSqlContractFromDefinition, G as sql, H as model, I as check, L as defineContract, M as bindEnumType, N as buildBoundContract, O as ScalarFieldBuilder, P as buildContractDefinition, R as enumType, S as IndexNode, T as ModelNode, U as now, V as member, W as rel, _ as ExtractCodecTypesFromPack, a as CheckNode, b as IndexConstraint, c as ColumnRef, d as ContractInput, f as ContractModelBuilder, g as EnumTypeHandle, h as EnumMember, i as BoundEnumType, j as autoincrement, k as TargetFieldRef, l as ComposedAuthoringHelpers, m as DeferredIndexExpression, n as AuthoredColumnDefault, o as CodecInput, p as DeferredIndexColumn, r as AuthoredColumnDefaultLiteralValue, s as CodecTypeMap, t as AttachedEntities, u as ContractDefinition, v as FieldNode, w as ModelLike, x as IndexExpressionInput, y as ForeignKeyNode, z as extensionModel } from "./contract-builder-j05FWfIe.mjs";
3
+ import { A as UniqueConstraintNode, B as field, C as MergeEnums, D as RelationNode, E as PrimaryKeyNode, F as buildSqlContractFromDefinition, G as sql, H as model, I as check, L as defineContract, M as bindEnumType, N as buildBoundContract, O as ScalarFieldBuilder, P as buildContractDefinition, R as enumType, S as IndexNode, T as ModelNode, U as now, V as member, W as rel, _ as ExtractCodecTypesFromPack, a as CheckNode, b as IndexConstraint, c as ColumnRef, d as ContractInput, f as ContractModelBuilder, g as EnumTypeHandle, h as EnumMember, i as BoundEnumType, j as autoincrement, k as TargetFieldRef, l as ComposedAuthoringHelpers, m as DeferredIndexExpression, n as AuthoredColumnDefault, o as CodecInput, p as DeferredIndexColumn, r as AuthoredColumnDefaultLiteralValue, s as CodecTypeMap, t as AttachedEntities, u as ContractDefinition, v as FieldNode, w as ModelLike, x as IndexExpressionInput, y as ForeignKeyNode, z as extensionModel } from "./contract-builder-6ujqQuj-.mjs";
4
4
  export { type AttachedEntities, type AuthoredColumnDefault, type AuthoredColumnDefaultLiteralValue, type BoundEnumType, type CheckKind, type CheckNode, type CodecInput, type CodecTypeMap, type ColumnRef, type ComposedAuthoringHelpers, type ContractDefinition, type ContractInput, type ContractModelBuilder, type DeferredIndexColumn, type DeferredIndexExpression, type EnumMember, type EnumTypeHandle, type ExtractCodecTypesFromPack, type FieldNode, type ForeignKeyNode, type IndexConstraint, type IndexExpressionInput, type IndexNode, type MergeEnums, type ModelLike, type ModelNode, type PrimaryKeyNode, type RelationNode, type ScalarFieldBuilder, type SqlNamespaceFactory, type TargetFieldRef, type UniqueConstraintNode, applySqlSpecifierControlPolicy, autoincrement, bindEnumType, buildBoundContract, buildContractDefinition, buildSqlContractFromDefinition, check, defineContract, enumType, extensionModel, field, member, model, now, rel, sql };
@@ -1,3 +1,3 @@
1
- import { n as buildSqlContractFromDefinition, t as applySqlSpecifierControlPolicy } from "./derived-checks-C6psACIj-DfqUVmZz.mjs";
2
- import { a as check, c as extensionModel, d as model, f as now, i as buildContractDefinition, l as field, m as sql, n as bindEnumType, o as defineContract, p as rel, r as buildBoundContract, s as enumType, t as autoincrement, u as member } from "./contract-builder-Fw-SFRvK.mjs";
1
+ import { n as buildSqlContractFromDefinition, t as applySqlSpecifierControlPolicy } from "./derived-checks-C6psACIj-BSBDa2_9.mjs";
2
+ import { a as check, c as extensionModel, d as model, f as now, i as buildContractDefinition, l as field, m as sql, n as bindEnumType, o as defineContract, p as rel, r as buildBoundContract, s as enumType, t as autoincrement, u as member } from "./contract-builder-vmb0E3SP.mjs";
3
3
  export { applySqlSpecifierControlPolicy, autoincrement, bindEnumType, buildBoundContract, buildContractDefinition, buildSqlContractFromDefinition, check, defineContract, enumType, extensionModel, field, member, model, now, rel, sql };
@@ -23,6 +23,7 @@ import { t as validateIndexTypes } from "./index-type-validation-CZ5L2lli.mjs";
23
23
  import { t as StorageTypeMetadata } from "./pack-types-BcLTpwbv.mjs";
24
24
  import { t as REFERENTIAL_ACTION_SQL } from "./referential-action-sql-DJ9ps6-S.mjs";
25
25
  import { n as resolveStorageTable, t as ResolvedStorageTable } from "./resolve-storage-table-Nyrgk4h8.mjs";
26
+ import { a as sqlExpressionAuthoringEntry, i as printSqlExpressionLiteral, n as SQL_EXPRESSION_TAG, o as sqlExpressionDataType, r as assertNothingCastsFromSqlExpression, s as sqlTextFromCanonical, t as SQL_EXPRESSION_DATA_TYPE_ID } from "./sql-expression-D_hbJOgM.mjs";
26
27
  import { C as validateSqlContractFully, E as validateStorageSemantics, S as validateModelStorageReferences, T as validateStorage, _ as createSqlContractSchema, a as ContractEnumSchema, b as resolveSqlToOneRelationStorage, c as ForeignKeySourceSchema, d as SqlToOneRelationStorage, f as StorageTableSchema, g as createNamespaceEntrySchema, h as checkSqlDefaultBody, i as ColumnDefaultSchema, l as IndexSchema, m as ValidateSqlContractFullyOptions, n as ColumnDefaultFunctionSchema, o as ForeignKeyReferenceSchema, p as StorageValueSetSchema, r as ColumnDefaultLiteralSchema, s as ForeignKeySchema, t as CheckConstraintSchema, u as ReferentialActionSchema, v as createSqlStorageSchema, w as validateSqlStorageConsistency, x as validateModel, y as reservedSqlDefaultBody } from "./validators-CJSyNFS4.mjs";
27
28
  import { n as deriveValueSetFromEntity, r as providesValueSetDerivation, t as SqlValueSetDerivingEntityTypeOutput } from "./value-set-derivation-hook-BhgGVtw0.mjs";
28
- export { type AggregateOperationTypes, type AggregateResultType, type AggregateTypesBase, type AggregateTypesOf, type AuthoredCheckInput, type AuthoredIndexInput, type AuthoredIndexMethod, type BackingIndexCandidates, CODEC_INSTANCE_KIND, CheckConstraint, type CheckConstraintInput, CheckConstraintSchema, type CodecTypesOf, ColumnDefaultFunctionSchema, ColumnDefaultLiteralSchema, ColumnDefaultSchema, ContractEnumSchema, type ContractWithTypeMaps, DEFAULT_FK_CONSTRAINT, DEFAULT_FK_INDEX, type EntityHandleLoweringInput, type ExtractAggregateTypes, type ExtractCodecTypes, type ExtractFieldInputTypes, type ExtractFieldOutputTypes, type ExtractQueryOperationTypes, type ExtractStorageColumnInputTypes, type ExtractStorageColumnTypes, type ExtractTypeMapsFromContract, type FieldInputTypesOf, type FieldOutputTypesOf, ForeignKey, type ForeignKeyAuthoringInput, type ForeignKeyInput, type ForeignKeyOptions, ForeignKeyReference, type ForeignKeyReferenceInput, ForeignKeyReferenceSchema, ForeignKeySchema, ForeignKeySourceSchema, Index, type IndexInput, IndexSchema, type IndexTypeBuilder, type IndexTypeEntry, type IndexTypeMap, type IndexTypeRegistration, type IndexTypeRegistry, type LoweredPackEntity, type MaterializedTableConstraints, type NamespacedFieldTypeMap, type NamespacedStorageColumnTypeMap, type PackEntityHandle, PrimaryKey, type PrimaryKeyInput, type QueryOperationReturn, type QueryOperationSelfSpec, type QueryOperationTypeEntry, type QueryOperationTypesBase, type QueryOperationTypesOf, REFERENTIAL_ACTION_SQL, type ReferentialAction, ReferentialActionSchema, RelationKeys, type RelationNamesOf, type ResolveCodecTypes, type ResolvedEntityHandleRef, type ResolvedPackEntityHandle, type ResolvedPslModelRefs, type ResolvedStorageTable, SQL_BUILTIN_KINDS, type Scalars, type SerializedCheckConstraint, type SerializedIndex, type Shape, type ShapeSpec, type SqlAuthoringContributions, type SqlBuiltinKind, type SqlControlDriverInstance, type SqlEntityHandleLoweringContribution, type SqlModelFieldStorage, type SqlModelStorage, type SqlNamespace, SqlNamespaceBase, type SqlNamespaceEntries, type SqlNamespaceFactory, type SqlNamespaceInput, SqlNode, type SqlPslEntityPlacementOutput, type SqlQueryOperationTypes, type SqlSchemaQualifiedView, type SqlSingleNamespaceAccessors, type SqlSingleNamespaceView, SqlStorage, type SqlStorageInput, type SqlStorageTypeEntry, type SqlToOneRelationStorage, type SqlValueSetDerivingEntityTypeOutput, StorageColumn, type StorageColumnInput, type StorageColumnInputTypesOf, type StorageColumnMapAt, type StorageColumnTypeAcrossNamespaces, type StorageColumnTypesOf, StorageTable, type StorageTableInput, StorageTableSchema, type StorageTypeInstance, type StorageTypeInstanceInput, type StorageTypeMetadata, StorageValueSet, type StorageValueSetInput, StorageValueSetSchema, type TypeMaps, type TypeMapsPhantomKey, UniqueConstraint, type UniqueConstraintInput, ValidateSqlContractFullyOptions, applyFkDefaults, backingIndexColumnKeys, buildSqlSchemaQualifiedView, buildSqlSingleNamespaceView, checkConstraintInputFromSerialized, checkSqlDefaultBody, col, composeSqlEntityKinds, createIndexTypeRegistry, createNamespaceEntrySchema, createSqlContractSchema, createSqlStorageSchema, defineIndexTypes, deriveValueSetFromEntity, exactNameBodyWarning, fk, index, indexInputFromSerialized, isAuthoredIndexInput, isBackedByColumnKeys, isMaterializedSqlNamespace, isSqlAuthoringContributions, isStorageTypeInstance, isStorageValueSet, lowerAuthoredCheck, lowerAuthoredIndex, materializeForeignKeysAndIndexes, model, pk, providesEntityHandleLowering, providesPslEntityPlacement, providesValueSetDerivation, reservedSqlDefaultBody, resolveSqlToOneRelationStorage, resolveStorageTable, sqlContractCanonicalizationHooks, table, tableEntityKind, toStorageTypeInstance, unique, validateIndexTypes, validateModel, validateModelStorageReferences, validateSqlContractFully, validateSqlStorageConsistency, validateStorage, validateStorageSemantics, valueSetEntityKind };
29
+ export { type AggregateOperationTypes, type AggregateResultType, type AggregateTypesBase, type AggregateTypesOf, type AuthoredCheckInput, type AuthoredIndexInput, type AuthoredIndexMethod, type BackingIndexCandidates, CODEC_INSTANCE_KIND, CheckConstraint, type CheckConstraintInput, CheckConstraintSchema, type CodecTypesOf, ColumnDefaultFunctionSchema, ColumnDefaultLiteralSchema, ColumnDefaultSchema, ContractEnumSchema, type ContractWithTypeMaps, DEFAULT_FK_CONSTRAINT, DEFAULT_FK_INDEX, type EntityHandleLoweringInput, type ExtractAggregateTypes, type ExtractCodecTypes, type ExtractFieldInputTypes, type ExtractFieldOutputTypes, type ExtractQueryOperationTypes, type ExtractStorageColumnInputTypes, type ExtractStorageColumnTypes, type ExtractTypeMapsFromContract, type FieldInputTypesOf, type FieldOutputTypesOf, ForeignKey, type ForeignKeyAuthoringInput, type ForeignKeyInput, type ForeignKeyOptions, ForeignKeyReference, type ForeignKeyReferenceInput, ForeignKeyReferenceSchema, ForeignKeySchema, ForeignKeySourceSchema, Index, type IndexInput, IndexSchema, type IndexTypeBuilder, type IndexTypeEntry, type IndexTypeMap, type IndexTypeRegistration, type IndexTypeRegistry, type LoweredPackEntity, type MaterializedTableConstraints, type NamespacedFieldTypeMap, type NamespacedStorageColumnTypeMap, type PackEntityHandle, PrimaryKey, type PrimaryKeyInput, type QueryOperationReturn, type QueryOperationSelfSpec, type QueryOperationTypeEntry, type QueryOperationTypesBase, type QueryOperationTypesOf, REFERENTIAL_ACTION_SQL, type ReferentialAction, ReferentialActionSchema, RelationKeys, type RelationNamesOf, type ResolveCodecTypes, type ResolvedEntityHandleRef, type ResolvedPackEntityHandle, type ResolvedPslModelRefs, type ResolvedStorageTable, SQL_BUILTIN_KINDS, SQL_EXPRESSION_DATA_TYPE_ID, SQL_EXPRESSION_TAG, type Scalars, type SerializedCheckConstraint, type SerializedIndex, type Shape, type ShapeSpec, type SqlAuthoringContributions, type SqlBuiltinKind, type SqlControlDriverInstance, type SqlEntityHandleLoweringContribution, type SqlModelFieldStorage, type SqlModelStorage, type SqlNamespace, SqlNamespaceBase, type SqlNamespaceEntries, type SqlNamespaceFactory, type SqlNamespaceInput, SqlNode, type SqlPslEntityPlacementOutput, type SqlQueryOperationTypes, type SqlSchemaQualifiedView, type SqlSingleNamespaceAccessors, type SqlSingleNamespaceView, SqlStorage, type SqlStorageInput, type SqlStorageTypeEntry, type SqlToOneRelationStorage, type SqlValueSetDerivingEntityTypeOutput, StorageColumn, type StorageColumnInput, type StorageColumnInputTypesOf, type StorageColumnMapAt, type StorageColumnTypeAcrossNamespaces, type StorageColumnTypesOf, StorageTable, type StorageTableInput, StorageTableSchema, type StorageTypeInstance, type StorageTypeInstanceInput, type StorageTypeMetadata, StorageValueSet, type StorageValueSetInput, StorageValueSetSchema, type TypeMaps, type TypeMapsPhantomKey, UniqueConstraint, type UniqueConstraintInput, ValidateSqlContractFullyOptions, applyFkDefaults, assertNothingCastsFromSqlExpression, backingIndexColumnKeys, buildSqlSchemaQualifiedView, buildSqlSingleNamespaceView, checkConstraintInputFromSerialized, checkSqlDefaultBody, col, composeSqlEntityKinds, createIndexTypeRegistry, createNamespaceEntrySchema, createSqlContractSchema, createSqlStorageSchema, defineIndexTypes, deriveValueSetFromEntity, exactNameBodyWarning, fk, index, indexInputFromSerialized, isAuthoredIndexInput, isBackedByColumnKeys, isMaterializedSqlNamespace, isSqlAuthoringContributions, isStorageTypeInstance, isStorageValueSet, lowerAuthoredCheck, lowerAuthoredIndex, materializeForeignKeysAndIndexes, model, pk, printSqlExpressionLiteral, providesEntityHandleLowering, providesPslEntityPlacement, providesValueSetDerivation, reservedSqlDefaultBody, resolveSqlToOneRelationStorage, resolveStorageTable, sqlContractCanonicalizationHooks, sqlExpressionAuthoringEntry, sqlExpressionDataType, sqlTextFromCanonical, table, tableEntityKind, toStorageTypeInstance, unique, validateIndexTypes, validateModel, validateModelStorageReferences, validateSqlContractFully, validateSqlStorageConsistency, validateStorage, validateStorageSemantics, valueSetEntityKind };
package/dist/contract.mjs CHANGED
@@ -12,7 +12,8 @@ import { t as validateIndexTypes } from "./index-type-validation-COH4d78M.mjs";
12
12
  import { n as defineIndexTypes, t as createIndexTypeRegistry } from "./index-types-DJQ_xwaE.mjs";
13
13
  import { t as REFERENTIAL_ACTION_SQL } from "./referential-action-sql-DSqkrySN.mjs";
14
14
  import { t as resolveStorageTable } from "./resolve-storage-table-DZsfnzeW.mjs";
15
+ import { a as sqlExpressionAuthoringEntry, i as printSqlExpressionLiteral, n as SQL_EXPRESSION_TAG, o as sqlExpressionDataType, r as assertNothingCastsFromSqlExpression, s as sqlTextFromCanonical, t as SQL_EXPRESSION_DATA_TYPE_ID } from "./sql-expression-BXx0Ilj-.mjs";
15
16
  import { a as SqlNamespaceBase, c as isMaterializedSqlNamespace, d as toStorageTypeInstance, i as RelationKeys, l as isSqlAuthoringContributions, n as DEFAULT_FK_CONSTRAINT, o as SqlStorage, r as DEFAULT_FK_INDEX, s as applyFkDefaults, t as CODEC_INSTANCE_KIND, u as isStorageTypeInstance } from "./types-D8Se4rnB.mjs";
16
17
  import { a as createSqlStorageSchema, c as validateModel, d as validateSqlStorageConsistency, f as validateStorage, i as createSqlContractSchema, l as validateModelStorageReferences, n as checkSqlDefaultBody, o as reservedSqlDefaultBody, p as validateStorageSemantics, r as createNamespaceEntrySchema, s as resolveSqlToOneRelationStorage, t as ContractEnumSchema, u as validateSqlContractFully } from "./validators-BlqrBU7I.mjs";
17
18
  import { n as providesValueSetDerivation, t as deriveValueSetFromEntity } from "./value-set-derivation-hook-Di9JZ0X7.mjs";
18
- export { CODEC_INSTANCE_KIND, CheckConstraint, CheckConstraintSchema, ColumnDefaultFunctionSchema, ColumnDefaultLiteralSchema, ColumnDefaultSchema, ContractEnumSchema, DEFAULT_FK_CONSTRAINT, DEFAULT_FK_INDEX, ForeignKey, ForeignKeyReference, ForeignKeyReferenceSchema, ForeignKeySchema, ForeignKeySourceSchema, Index, IndexSchema, PrimaryKey, REFERENTIAL_ACTION_SQL, ReferentialActionSchema, RelationKeys, SQL_BUILTIN_KINDS, SqlNamespaceBase, SqlNode, SqlStorage, StorageColumn, StorageTable, StorageTableSchema, StorageValueSet, StorageValueSetSchema, UniqueConstraint, applyFkDefaults, backingIndexColumnKeys, buildSqlSchemaQualifiedView, buildSqlSingleNamespaceView, checkConstraintInputFromSerialized, checkSqlDefaultBody, col, composeSqlEntityKinds, createIndexTypeRegistry, createNamespaceEntrySchema, createSqlContractSchema, createSqlStorageSchema, defineIndexTypes, deriveValueSetFromEntity, exactNameBodyWarning, fk, index, indexInputFromSerialized, isAuthoredIndexInput, isBackedByColumnKeys, isMaterializedSqlNamespace, isSqlAuthoringContributions, isStorageTypeInstance, isStorageValueSet, lowerAuthoredCheck, lowerAuthoredIndex, materializeForeignKeysAndIndexes, model, pk, providesEntityHandleLowering, providesPslEntityPlacement, providesValueSetDerivation, reservedSqlDefaultBody, resolveSqlToOneRelationStorage, resolveStorageTable, sqlContractCanonicalizationHooks, table, tableEntityKind, toStorageTypeInstance, unique, validateIndexTypes, validateModel, validateModelStorageReferences, validateSqlContractFully, validateSqlStorageConsistency, validateStorage, validateStorageSemantics, valueSetEntityKind };
19
+ export { CODEC_INSTANCE_KIND, CheckConstraint, CheckConstraintSchema, ColumnDefaultFunctionSchema, ColumnDefaultLiteralSchema, ColumnDefaultSchema, ContractEnumSchema, DEFAULT_FK_CONSTRAINT, DEFAULT_FK_INDEX, ForeignKey, ForeignKeyReference, ForeignKeyReferenceSchema, ForeignKeySchema, ForeignKeySourceSchema, Index, IndexSchema, PrimaryKey, REFERENTIAL_ACTION_SQL, ReferentialActionSchema, RelationKeys, SQL_BUILTIN_KINDS, SQL_EXPRESSION_DATA_TYPE_ID, SQL_EXPRESSION_TAG, SqlNamespaceBase, SqlNode, SqlStorage, StorageColumn, StorageTable, StorageTableSchema, StorageValueSet, StorageValueSetSchema, UniqueConstraint, applyFkDefaults, assertNothingCastsFromSqlExpression, backingIndexColumnKeys, buildSqlSchemaQualifiedView, buildSqlSingleNamespaceView, checkConstraintInputFromSerialized, checkSqlDefaultBody, col, composeSqlEntityKinds, createIndexTypeRegistry, createNamespaceEntrySchema, createSqlContractSchema, createSqlStorageSchema, defineIndexTypes, deriveValueSetFromEntity, exactNameBodyWarning, fk, index, indexInputFromSerialized, isAuthoredIndexInput, isBackedByColumnKeys, isMaterializedSqlNamespace, isSqlAuthoringContributions, isStorageTypeInstance, isStorageValueSet, lowerAuthoredCheck, lowerAuthoredIndex, materializeForeignKeysAndIndexes, model, pk, printSqlExpressionLiteral, providesEntityHandleLowering, providesPslEntityPlacement, providesValueSetDerivation, reservedSqlDefaultBody, resolveSqlToOneRelationStorage, resolveStorageTable, sqlContractCanonicalizationHooks, sqlExpressionAuthoringEntry, sqlExpressionDataType, sqlTextFromCanonical, table, tableEntityKind, toStorageTypeInstance, unique, validateIndexTypes, validateModel, validateModelStorageReferences, validateSqlContractFully, validateSqlStorageConsistency, validateStorage, validateStorageSemantics, valueSetEntityKind };
@@ -0,0 +1,2 @@
1
+ import { a as sqlExpressionAuthoringEntry, i as printSqlExpressionLiteral, n as SQL_EXPRESSION_TAG, o as sqlExpressionDataType, r as assertNothingCastsFromSqlExpression, s as sqlTextFromCanonical, t as SQL_EXPRESSION_DATA_TYPE_ID } from "./sql-expression-D_hbJOgM.mjs";
2
+ export { SQL_EXPRESSION_DATA_TYPE_ID, SQL_EXPRESSION_TAG, assertNothingCastsFromSqlExpression, printSqlExpressionLiteral, sqlExpressionAuthoringEntry, sqlExpressionDataType, sqlTextFromCanonical };
@@ -0,0 +1,2 @@
1
+ import { a as sqlExpressionAuthoringEntry, i as printSqlExpressionLiteral, n as SQL_EXPRESSION_TAG, o as sqlExpressionDataType, r as assertNothingCastsFromSqlExpression, s as sqlTextFromCanonical, t as SQL_EXPRESSION_DATA_TYPE_ID } from "./sql-expression-BXx0Ilj-.mjs";
2
+ export { SQL_EXPRESSION_DATA_TYPE_ID, SQL_EXPRESSION_TAG, assertNothingCastsFromSqlExpression, printSqlExpressionLiteral, sqlExpressionAuthoringEntry, sqlExpressionDataType, sqlTextFromCanonical };
@@ -1,12 +1,12 @@
1
1
  import { u as namingOf } from "./naming-Cc_t1q6s-CouBOmqZ.mjs";
2
2
  import { t as sqlContractCanonicalizationHooks } from "./canonicalization-hooks-dmXkOR4a.mjs";
3
3
  import { c as StorageTable } from "./storage-table-ZzbR-xzQ-C8gXT45E.mjs";
4
+ import { a as sqlExpressionAuthoringEntry, o as sqlExpressionDataType, r as assertNothingCastsFromSqlExpression, t as SQL_EXPRESSION_DATA_TYPE_ID } from "./sql-expression-BXx0Ilj-.mjs";
4
5
  import { u as isStorageTypeInstance } from "./types-D8Se4rnB.mjs";
5
- import { n as checkSqlDefaultBody, o as reservedSqlDefaultBody } from "./validators-BlqrBU7I.mjs";
6
6
  import { c as SqlSchemaIR, n as RelationalSchemaNodeKind, u as SqlTableIR } from "./types-yyhkYQNT-Dmoq-giA.mjs";
7
7
  import { f as sqlAttributeSpecs } from "./sql-attribute-specs-Bs9QDuS7-DmIRJUz9.mjs";
8
- import { t as sqlEmission } from "./dist-U61NPKN3.mjs";
9
- import { i as sqlFamilyPslBlockDescriptors, n as sqlFamilyAuthoringTypes, r as sqlFamilyEntityTypes, t as sqlFamilyAuthoringFieldPresets } from "./authoring-type-constructors-DQZEX4Sb-BYGQWq43.mjs";
8
+ import { t as sqlEmission } from "./dist-ChyuAdtP.mjs";
9
+ import { i as sqlFamilyPslBlockDescriptors, n as sqlFamilyAuthoringTypes, r as sqlFamilyEntityTypes, t as sqlFamilyAuthoringFieldPresets } from "./authoring-type-constructors-DQZEX4Sb-D6uFhwhG.mjs";
10
10
  import { n as classifyDiffSubjectGranularity, o as extractCodecControlHooks, s as verifySqlSchemaByDiff, t as classifyDiffEntityKind } from "./schema-verify-DI0aJQ9d-Bgbmen10.mjs";
11
11
  import { t as sqlFamilyError } from "./errors-B5g0xWro-mWH2C07F.mjs";
12
12
  import { t as SqlContractSerializer } from "./sql-contract-serializer-C90xg7_q-DERDzTD5.mjs";
@@ -205,6 +205,7 @@ function assertNoCrossSpaceFkReverseReferences(extensions) {
205
205
  }
206
206
  function createSqlFamilyInstance(stack) {
207
207
  if (!stack.adapter) throw new InternalError("SQL family requires an adapter descriptor in ControlStack");
208
+ assertNothingCastsFromSqlExpression(stack.declaredDataTypes);
208
209
  const target = blindCast(stack.target);
209
210
  const adapter = blindCast(stack.adapter);
210
211
  const extensions = blindCast(stack.extensions);
@@ -604,12 +605,14 @@ var SqlFamilyDescriptor = class {
604
605
  familyId = "sql";
605
606
  version = "0.0.1";
606
607
  emission = sqlEmission;
608
+ dataTypes = [sqlExpressionDataType];
607
609
  authoring = {
608
610
  field: sqlFamilyAuthoringFieldPresets,
609
611
  type: sqlFamilyAuthoringTypes,
610
612
  entityTypes: sqlFamilyEntityTypes,
611
613
  pslBlockDescriptors: sqlFamilyPslBlockDescriptors,
612
- attributeSpecs: sqlAttributeSpecs
614
+ attributeSpecs: sqlAttributeSpecs,
615
+ dataTypes: { [SQL_EXPRESSION_DATA_TYPE_ID]: sqlExpressionAuthoringEntry }
613
616
  };
614
617
  create(stack) {
615
618
  return createSqlFamilyInstance(stack);
@@ -1350,47 +1353,6 @@ function detectTableNameCaseChanges(input) {
1350
1353
  }
1351
1354
  return conflicts;
1352
1355
  }
1353
- /** A `` @default(sql`...`) `` body the SQL family refuses to lower. */
1354
- const PSL_INVALID_DEFAULT_SQL = "PSL_INVALID_DEFAULT_SQL";
1355
- /**
1356
- * The `` sql`...` `` lowering entry every SQL target registers: the canonical body becomes the
1357
- * expression verbatim. A body that is exactly `now()` or `autoincrement()` is refused so the named
1358
- * form is written instead. ADR 254.
1359
- */
1360
- function sqlDefaultLiteralTagEntry(tag) {
1361
- return {
1362
- written: {
1363
- kind: "tag",
1364
- tag
1365
- },
1366
- documentation: "Uses the SQL in the string, verbatim, as the column's default expression.",
1367
- lower: ({ literal, context }) => {
1368
- const reject = (message) => ({
1369
- ok: false,
1370
- diagnostic: {
1371
- code: PSL_INVALID_DEFAULT_SQL,
1372
- message,
1373
- sourceId: context.sourceId,
1374
- span: literal.span
1375
- }
1376
- });
1377
- const reserved = reservedSqlDefaultBody(literal.body);
1378
- if (reserved !== void 0) return reject(`Write @default(${reserved}()) instead of ${literal.tag}\`${reserved}()\`; ${reserved}() is a Prisma default function, not raw SQL.`);
1379
- const reason = checkSqlDefaultBody(literal.body);
1380
- if (reason !== void 0) return reject(reason);
1381
- return {
1382
- ok: true,
1383
- value: {
1384
- kind: "storage",
1385
- defaultValue: {
1386
- kind: "function",
1387
- expression: literal.body
1388
- }
1389
- }
1390
- };
1391
- }
1392
- };
1393
- }
1394
1356
  function temporalStringAuthoringPresets(input) {
1395
1357
  const presets = temporalAuthoringPresets(input);
1396
1358
  return {
@@ -1440,6 +1402,6 @@ function temporalCodecPresetWithPrecision(input) {
1440
1402
  }
1441
1403
  var control_default = new SqlFamilyDescriptor();
1442
1404
  //#endregion
1443
- export { temporalStringAuthoringPresets as C, temporalCodecPresetWithPrecision as S, plannerFailure as _, buildDataTypeResolver as a, runnerSuccess as b, contractToSchemaIR as c, createMigrationPlan as d, detectDestructiveChanges as f, planFieldEventOperations as g, partitionIssuesByControlPolicy as h, assembleAuthoringContributions as i, controlPolicyForCall as l, partitionCallsByControlPolicy as m, PSL_INVALID_DEFAULT_SQL as n, buildNativeTypeExpander as o, detectTableNameCaseChanges as p, TABLE_NAME_CASE_CHANGED_CODE as r, contractNamespaceToSchemaIR as s, INIT_ADDITIVE_POLICY as t, control_default as u, plannerSuccess as v, sqlDefaultLiteralTagEntry as x, runnerFailure as y };
1405
+ export { plannerSuccess as _, buildNativeTypeExpander as a, temporalCodecPresetWithPrecision as b, controlPolicyForCall as c, detectDestructiveChanges as d, detectTableNameCaseChanges as f, plannerFailure as g, planFieldEventOperations as h, buildDataTypeResolver as i, control_default as l, partitionIssuesByControlPolicy as m, TABLE_NAME_CASE_CHANGED_CODE as n, contractNamespaceToSchemaIR as o, partitionCallsByControlPolicy as p, assembleAuthoringContributions as r, contractToSchemaIR as s, INIT_ADDITIVE_POLICY as t, createMigrationPlan as u, runnerFailure as v, temporalStringAuthoringPresets as x, runnerSuccess as y };
1444
1406
 
1445
- //# sourceMappingURL=control-DOGYQMFH.mjs.map
1407
+ //# sourceMappingURL=control-2-eFP31F.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-2-eFP31F.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/control.mjs"],"sourcesContent":["import { i as sqlFamilyPslBlockDescriptors, n as sqlFamilyAuthoringFieldPresets, r as sqlFamilyEntityTypes, t as sqlFamilyAuthoringTypes } from \"./authoring-type-constructors-DQZEX4Sb.mjs\";\nimport { n as classifyDiffSubjectGranularity, o as verifySqlSchemaByDiff, s as extractCodecControlHooks, t as classifyDiffEntityKind } from \"./schema-verify-DI0aJQ9d.mjs\";\nimport { t as sqlFamilyError } from \"./errors-B5g0xWro.mjs\";\nimport { t as SqlContractSerializer } from \"./sql-contract-serializer-C90xg7_q.mjs\";\nimport { t as collectSupportedCodecTypeIds } from \"./verify-BVk5bjdH.mjs\";\nimport { SQL_EXPRESSION_DATA_TYPE_ID, assertNothingCastsFromSqlExpression, sqlExpressionAuthoringEntry, sqlExpressionDataType } from \"@internal/sql-contract/sql-expression\";\nimport { sqlEmission } from \"@internal/sql-contract-emitter\";\nimport { sqlAttributeSpecs } from \"@internal/sql-contract-psl/attribute-specs\";\nimport { TEMPORAL_ON_CREATE_ARG, TEMPORAL_ON_UPDATE_ARG, TIMESTAMP_NOW_GENERATOR_ID, temporalAuthoringPresets, temporalPhaseTemplate } from \"@internal/framework-components/authoring\";\nimport { APP_SPACE_ID, SchemaTreeNode, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_TARGET_MISMATCH, assembleAuthoringContributions, assembleDataTypes, extractCodecLookup, issueOutcome } from \"@internal/framework-components/control\";\nimport { isPlainRecord } from \"@internal/framework-components/ir\";\nimport { assertDescriptorSelfConsistency } from \"@internal/migration-tools/spaces\";\nimport { sqlContractCanonicalizationHooks } from \"@internal/sql-contract/canonicalization-hooks\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { effectiveControlPolicy } from \"@internal/contract/types\";\nimport { StorageTable, isStorageTypeInstance } from \"@internal/sql-contract/types\";\nimport { checkSqlDefaultBody } from \"@internal/sql-contract/validators\";\nimport { namingOf } from \"@internal/sql-schema-ir/naming\";\nimport { RelationalSchemaNodeKind, SqlSchemaIR, SqlTableIR } from \"@internal/sql-schema-ir/types\";\nimport { notOk, ok } from \"@internal/utils/result\";\n//#region src/core/operation-preview.ts\nfunction isDdlStatement(sqlStatement) {\n\tconst trimmed = sqlStatement.trim().toLowerCase();\n\treturn trimmed.startsWith(\"create \") || trimmed.startsWith(\"alter \") || trimmed.startsWith(\"drop \");\n}\nfunction hasExecuteSteps(operation) {\n\tconst execute = Reflect.get(operation, \"execute\");\n\tif (!Array.isArray(execute)) return false;\n\treturn execute.every((step) => typeof step === \"object\" && step !== null && \"sql\" in step);\n}\n/**\n* Extracts a best-effort SQL DDL preview for CLI plan output.\n* Presentation-only: never used to decide migration correctness.\n*/\nfunction extractSqlDdl(operations) {\n\tconst statements = [];\n\tfor (const operation of operations) {\n\t\tif (!hasExecuteSteps(operation)) continue;\n\t\tfor (const step of operation.execute) if (typeof step.sql === \"string\" && isDdlStatement(step.sql)) statements.push(step.sql.trim());\n\t}\n\treturn statements;\n}\n/**\n* Wraps `extractSqlDdl` into the family-agnostic `OperationPreview` shape.\n* Each statement carries `language: 'sql'`.\n*/\nfunction sqlOperationsToPreview(operations) {\n\treturn { statements: extractSqlDdl(operations).map((text) => ({\n\t\ttext,\n\t\tlanguage: \"sql\"\n\t})) };\n}\n//#endregion\n//#region src/core/control-instance.ts\nfunction missingDescriptorOperationError(targetId, operation) {\n\treturn sqlFamilyError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `SQL target \"${targetId}\" is missing the required ${operation} descriptor operation`, {\n\t\twhy: `The target descriptor does not contribute the ${operation} operation the SQL family requires for this call.`,\n\t\tfix: `Use a target package whose control descriptor implements ${operation}.`,\n\t\tmeta: {\n\t\t\ttargetId,\n\t\t\toperation\n\t\t}\n\t});\n}\nfunction extractCodecTypeIdsFromContract(contract) {\n\tconst typeIds = /* @__PURE__ */ new Set();\n\tif (typeof contract === \"object\" && contract !== null && \"storage\" in contract && typeof contract.storage === \"object\" && contract.storage !== null && \"namespaces\" in contract.storage && typeof contract.storage.namespaces === \"object\" && contract.storage.namespaces !== null) {\n\t\tconst namespaces = blindCast(contract.storage.namespaces);\n\t\tfor (const ns of Object.values(namespaces)) {\n\t\t\tconst tbls = ns.entries[\"table\"];\n\t\t\tif (typeof tbls !== \"object\" || tbls === null) continue;\n\t\t\tfor (const table of Object.values(tbls)) if (typeof table === \"object\" && table !== null && \"columns\" in table && typeof table.columns === \"object\" && table.columns !== null) {\n\t\t\t\tconst columns = blindCast(table.columns);\n\t\t\t\tfor (const column of Object.values(columns)) if (column && typeof column === \"object\" && \"codecId\" in column && typeof column.codecId === \"string\") typeIds.add(column.codecId);\n\t\t\t}\n\t\t}\n\t}\n\treturn Array.from(typeIds).sort();\n}\nfunction createVerifyResult(options) {\n\tconst contract = { storageHash: options.contractStorageHash };\n\tif (options.contractProfileHash) contract.profileHash = options.contractProfileHash;\n\tconst target = { expected: options.expectedTargetId };\n\tif (options.actualTargetId) target.actual = options.actualTargetId;\n\tconst meta = { contractPath: options.contractPath };\n\tif (options.configPath) meta.configPath = options.configPath;\n\treturn {\n\t\tok: options.ok,\n\t\tsummary: options.summary,\n\t\tcontract,\n\t\ttarget,\n\t\tmeta,\n\t\ttimings: { total: options.totalTime },\n\t\t...ifDefined(\"code\", options.code),\n\t\t...options.marker ? { marker: {\n\t\t\tstorageHash: options.marker.storageHash,\n\t\t\tprofileHash: options.marker.profileHash\n\t\t} } : {},\n\t\t...ifDefined(\"missingCodecs\", options.missingCodecs),\n\t\t...ifDefined(\"codecCoverageSkipped\", options.codecCoverageSkipped)\n\t};\n}\nfunction buildSqlTypeMetadataRegistry(options) {\n\tconst { target, adapter, extensions } = options;\n\tconst registry = /* @__PURE__ */ new Map();\n\tconst targetId = adapter.targetId;\n\tconst descriptors = [\n\t\ttarget,\n\t\tadapter,\n\t\t...extensions\n\t];\n\tfor (const descriptor of descriptors) {\n\t\tconst storageTypes = descriptor.types?.storage;\n\t\tif (!storageTypes) continue;\n\t\tfor (const storageType of storageTypes) if (storageType.familyId === \"sql\" && storageType.targetId === targetId) registry.set(storageType.typeId, {\n\t\t\ttypeId: storageType.typeId,\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: storageType.targetId,\n\t\t\t...storageType.nativeType !== void 0 ? { nativeType: storageType.nativeType } : {}\n\t\t});\n\t}\n\treturn registry;\n}\n/**\n* Builds a map from each extension id to the set of extension ids it\n* transitively depends on. Uses the same declared-dependency data that\n* `buildExtensionLoadOrder` in control-stack uses.\n*/\nfunction buildTransitiveDependsOnMap(extensions) {\n\tconst directDeps = /* @__PURE__ */ new Map();\n\tfor (const ext of extensions) {\n\t\tconst packs = ext.contractSpace?.contractJson?.extensions;\n\t\tconst deps = packs !== null && typeof packs === \"object\" ? Object.keys(packs) : [];\n\t\tdirectDeps.set(ext.id, deps);\n\t}\n\tconst result = /* @__PURE__ */ new Map();\n\tconst resolve = (id, visiting) => {\n\t\tconst cached = result.get(id);\n\t\tif (cached !== void 0) return cached;\n\t\tconst set = /* @__PURE__ */ new Set();\n\t\tresult.set(id, set);\n\t\tfor (const depId of directDeps.get(id) ?? []) {\n\t\t\tset.add(depId);\n\t\t\tif (!visiting.has(depId)) {\n\t\t\t\tvisiting.add(depId);\n\t\t\t\tfor (const transitive of resolve(depId, visiting)) set.add(transitive);\n\t\t\t\tvisiting.delete(depId);\n\t\t\t}\n\t\t}\n\t\treturn set;\n\t};\n\tfor (const ext of extensions) resolve(ext.id, /* @__PURE__ */ new Set([ext.id]));\n\treturn result;\n}\n/**\n* Asserts that no cross-space FK in any extension points against the\n* dependency direction.\n*\n* A cross-space FK (target.spaceId present) from extension A pointing at\n* space B is a violation when B depends on A (directly or transitively),\n* because that means A is pointing \"upward\" against the dependency arrows\n* established by the extension load order.\n*\n* Throws with a diagnostic naming the violating extension (source), the\n* target space, and the direction violation.\n*/\nfunction isObjectRecord(v) {\n\treturn typeof v === \"object\" && v !== null;\n}\nfunction assertNoCrossSpaceFkReverseReferences(extensions) {\n\tconst dependsOnMap = buildTransitiveDependsOnMap(extensions);\n\tfor (const ext of extensions) {\n\t\tconst namespaces = ext.contractSpace?.contractJson?.storage?.namespaces;\n\t\tif (!isObjectRecord(namespaces)) continue;\n\t\tfor (const ns of Object.values(namespaces)) {\n\t\t\tif (!isObjectRecord(ns)) continue;\n\t\t\tconst entries = ns[\"entries\"];\n\t\t\tif (!isObjectRecord(entries)) continue;\n\t\t\tfor (const slot of Object.values(entries)) {\n\t\t\t\tif (!isObjectRecord(slot)) continue;\n\t\t\t\tfor (const table of Object.values(slot)) {\n\t\t\t\t\tif (!isObjectRecord(table)) continue;\n\t\t\t\t\tconst foreignKeys = table[\"foreignKeys\"];\n\t\t\t\t\tif (!Array.isArray(foreignKeys)) continue;\n\t\t\t\t\tfor (const fk of foreignKeys) {\n\t\t\t\t\t\tif (!isObjectRecord(fk)) continue;\n\t\t\t\t\t\tconst target = fk[\"target\"];\n\t\t\t\t\t\tif (!isObjectRecord(target)) continue;\n\t\t\t\t\t\tif (target[\"spaceId\"] === void 0) continue;\n\t\t\t\t\t\tconst targetSpaceId = target[\"spaceId\"];\n\t\t\t\t\t\tif (typeof targetSpaceId !== \"string\") continue;\n\t\t\t\t\t\tif (dependsOnMap.get(targetSpaceId)?.has(ext.id)) throw sqlFamilyError(\"CONTRACT.FOREIGN_KEY_INVALID\", `Cross-space FK reverse-reference detected: extension \"${ext.id}\" has a cross-space FK targeting space \"${targetSpaceId}\", but \"${targetSpaceId}\" depends on \"${ext.id}\". Cross-space FKs must follow the dependency direction (a space can only reference spaces it depends on, not spaces that depend on it).`, {\n\t\t\t\t\t\t\twhy: \"The foreign key points against the contract-space dependency direction.\",\n\t\t\t\t\t\t\tfix: \"Move the foreign key to the depending space, or restructure the extension dependencies so the referencing space depends on the referenced one.\",\n\t\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\t\textensionId: ext.id,\n\t\t\t\t\t\t\t\ttargetSpaceId\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\nfunction createSqlFamilyInstance(stack) {\n\tif (!stack.adapter) throw new InternalError(\"SQL family requires an adapter descriptor in ControlStack\");\n\tassertNothingCastsFromSqlExpression(stack.declaredDataTypes);\n\tconst target = blindCast(stack.target);\n\tconst adapter = blindCast(stack.adapter);\n\tconst extensions = blindCast(stack.extensions);\n\tfor (const extension of extensions) if (extension.contractSpace) {\n\t\tconst { contractJson, headRef } = extension.contractSpace;\n\t\tassertDescriptorSelfConsistency({\n\t\t\textensionId: extension.id,\n\t\t\ttarget: contractJson.target,\n\t\t\ttargetFamily: contractJson.targetFamily,\n\t\t\tstorage: contractJson.storage,\n\t\t\theadRefHash: headRef.hash,\n\t\t\t...sqlContractCanonicalizationHooks\n\t\t});\n\t}\n\tassertNoCrossSpaceFkReverseReferences(extensions);\n\tconst { codecTypeImports, extensionIds } = stack;\n\tconst typeMetadataRegistry = buildSqlTypeMetadataRegistry({\n\t\ttarget,\n\t\tadapter,\n\t\textensions\n\t});\n\tlet controlAdapter;\n\tconst getControlAdapter = () => controlAdapter ??= adapter.create(stack);\n\tconst targetSerializer = blindCast(target).contractSerializer;\n\tconst targetInferPslContract = blindCast(target).inferPslContract;\n\tconst targetBuildPslContract = blindCast(target).buildPslContract;\n\tconst diffSchema = blindCast(target).diffSchema;\n\tconst targetGranularityOf = blindCast(target).classifySubjectGranularity;\n\tconst targetEntityKindOf = blindCast(target).classifyEntityKind;\n\tconst describedContracts = extensions.flatMap((extension) => extension.contractSpace ? [{\n\t\tspaceId: extension.id,\n\t\tcontract: extension.contractSpace.contractJson\n\t}] : []);\n\tconst deserializeWithTargetSerializer = (contractOrJson) => {\n\t\tconst serializer = targetSerializer ?? new SqlContractSerializer();\n\t\tconst json = targetSerializer !== void 0 && !isPlainRecord(contractOrJson) ? targetSerializer.serializeContract(blindCast(contractOrJson)) : contractOrJson;\n\t\treturn serializer.deserializeContract(json);\n\t};\n\treturn {\n\t\tfamilyId: \"sql\",\n\t\tcodecTypeImports,\n\t\textensionIds,\n\t\ttypeMetadataRegistry,\n\t\tdeserializeContract(contractJson) {\n\t\t\treturn deserializeWithTargetSerializer(contractJson);\n\t\t},\n\t\tasync verify(verifyOptions) {\n\t\t\tconst { driver, contract: rawContract, expectedTargetId, contractPath, configPath } = verifyOptions;\n\t\t\tconst startTime = Date.now();\n\t\t\tconst contract = deserializeWithTargetSerializer(rawContract);\n\t\t\tconst contractStorageHash = contract.storage.storageHash;\n\t\t\tconst contractProfileHash = contract.profileHash;\n\t\t\tconst contractTarget = contract.target;\n\t\t\tconst marker = await getControlAdapter().readMarker(driver, APP_SPACE_ID);\n\t\t\tlet missingCodecs;\n\t\t\tlet codecCoverageSkipped = false;\n\t\t\tconst supportedTypeIds = collectSupportedCodecTypeIds([\n\t\t\t\tadapter,\n\t\t\t\ttarget,\n\t\t\t\t...extensions\n\t\t\t]);\n\t\t\tif (supportedTypeIds.length === 0) codecCoverageSkipped = true;\n\t\t\telse {\n\t\t\t\tconst supportedSet = new Set(supportedTypeIds);\n\t\t\t\tconst missing = extractCodecTypeIdsFromContract(contract).filter((id) => !supportedSet.has(id));\n\t\t\t\tif (missing.length > 0) missingCodecs = missing;\n\t\t\t}\n\t\t\tif (!marker) return createVerifyResult({\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_MARKER_MISSING,\n\t\t\t\tsummary: \"Marker missing\",\n\t\t\t\tcontractStorageHash,\n\t\t\t\texpectedTargetId,\n\t\t\t\tcontractPath,\n\t\t\t\ttotalTime: Date.now() - startTime,\n\t\t\t\t...contractProfileHash ? { contractProfileHash } : {},\n\t\t\t\t...missingCodecs ? { missingCodecs } : {},\n\t\t\t\t...codecCoverageSkipped ? { codecCoverageSkipped } : {},\n\t\t\t\t...configPath ? { configPath } : {}\n\t\t\t});\n\t\t\tif (contractTarget !== expectedTargetId) return createVerifyResult({\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_TARGET_MISMATCH,\n\t\t\t\tsummary: \"Target mismatch\",\n\t\t\t\tcontractStorageHash,\n\t\t\t\tmarker,\n\t\t\t\texpectedTargetId,\n\t\t\t\tactualTargetId: contractTarget,\n\t\t\t\tcontractPath,\n\t\t\t\ttotalTime: Date.now() - startTime,\n\t\t\t\t...contractProfileHash ? { contractProfileHash } : {},\n\t\t\t\t...missingCodecs ? { missingCodecs } : {},\n\t\t\t\t...codecCoverageSkipped ? { codecCoverageSkipped } : {},\n\t\t\t\t...configPath ? { configPath } : {}\n\t\t\t});\n\t\t\tif (marker.storageHash !== contractStorageHash) return createVerifyResult({\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_HASH_MISMATCH,\n\t\t\t\tsummary: \"Hash mismatch\",\n\t\t\t\tcontractStorageHash,\n\t\t\t\tmarker,\n\t\t\t\texpectedTargetId,\n\t\t\t\tcontractPath,\n\t\t\t\ttotalTime: Date.now() - startTime,\n\t\t\t\t...contractProfileHash ? { contractProfileHash } : {},\n\t\t\t\t...missingCodecs ? { missingCodecs } : {},\n\t\t\t\t...codecCoverageSkipped ? { codecCoverageSkipped } : {},\n\t\t\t\t...configPath ? { configPath } : {}\n\t\t\t});\n\t\t\tif (contractProfileHash && marker.profileHash !== contractProfileHash) return createVerifyResult({\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_HASH_MISMATCH,\n\t\t\t\tsummary: \"Hash mismatch\",\n\t\t\t\tcontractStorageHash,\n\t\t\t\tcontractProfileHash,\n\t\t\t\tmarker,\n\t\t\t\texpectedTargetId,\n\t\t\t\tcontractPath,\n\t\t\t\ttotalTime: Date.now() - startTime,\n\t\t\t\t...missingCodecs ? { missingCodecs } : {},\n\t\t\t\t...codecCoverageSkipped ? { codecCoverageSkipped } : {},\n\t\t\t\t...configPath ? { configPath } : {}\n\t\t\t});\n\t\t\treturn createVerifyResult({\n\t\t\t\tok: true,\n\t\t\t\tsummary: \"Database matches contract\",\n\t\t\t\tcontractStorageHash,\n\t\t\t\tmarker,\n\t\t\t\texpectedTargetId,\n\t\t\t\tcontractPath,\n\t\t\t\ttotalTime: Date.now() - startTime,\n\t\t\t\t...contractProfileHash ? { contractProfileHash } : {},\n\t\t\t\t...missingCodecs ? { missingCodecs } : {},\n\t\t\t\t...codecCoverageSkipped ? { codecCoverageSkipped } : {},\n\t\t\t\t...configPath ? { configPath } : {}\n\t\t\t});\n\t\t},\n\t\tverifySchema(options) {\n\t\t\tconst contract = deserializeWithTargetSerializer(options.contract);\n\t\t\tif (!diffSchema) throw missingDescriptorOperationError(target.targetId, \"diffSchema\");\n\t\t\tif (!targetGranularityOf) throw missingDescriptorOperationError(target.targetId, \"classifySubjectGranularity\");\n\t\t\treturn verifySqlSchemaByDiff({\n\t\t\t\tcontract,\n\t\t\t\tschema: options.schema,\n\t\t\t\tstrict: options.strict,\n\t\t\t\tframeworkComponents: options.frameworkComponents,\n\t\t\t\tdiffSchema,\n\t\t\t\tgranularityOf: targetGranularityOf\n\t\t\t});\n\t\t},\n\t\t/**\n\t\t* Classifies a diff issue's subject granularity on demand, by resolving\n\t\t* its node's `nodeKind` through the target's classifier — the\n\t\t* {@link import('@internal/framework-components/control').SchemaSubjectClassifierCapable}\n\t\t* capability. Framework consumers spanning contract spaces (the\n\t\t* migration aggregate's unclaimed-elements sweep) detect and call this\n\t\t* instead of reaching into the concrete schema-IR node, which they\n\t\t* cannot read; nothing is stamped on the issue or the node.\n\t\t*/\n\t\tclassifySubjectGranularity(issue) {\n\t\t\tif (!targetGranularityOf) throw missingDescriptorOperationError(target.targetId, \"classifySubjectGranularity\");\n\t\t\treturn classifyDiffSubjectGranularity(issue, targetGranularityOf);\n\t\t},\n\t\t/**\n\t\t* Classifies a diff issue's subject storage `entityKind` on demand, by\n\t\t* resolving its node's `nodeKind` through the target's classifier —\n\t\t* the sibling of `classifySubjectGranularity` above, and part of the\n\t\t* same {@link import('@internal/framework-components/control').SchemaSubjectClassifierCapable}\n\t\t* capability.\n\t\t*/\n\t\tclassifyEntityKind(issue) {\n\t\t\tif (!targetEntityKindOf) throw missingDescriptorOperationError(target.targetId, \"classifyEntityKind\");\n\t\t\treturn classifyDiffEntityKind(issue, targetEntityKindOf);\n\t\t},\n\t\tasync sign(options) {\n\t\t\tconst { driver, contract: contractInput, contractPath, configPath } = options;\n\t\t\tconst startTime = Date.now();\n\t\t\tconst contract = deserializeWithTargetSerializer(contractInput);\n\t\t\tconst contractStorageHash = contract.storage.storageHash;\n\t\t\tconst contractProfileHash = \"profileHash\" in contract && typeof contract.profileHash === \"string\" ? contract.profileHash : contractStorageHash;\n\t\t\tconst contractTarget = contract.target;\n\t\t\tconst controlAdapter = getControlAdapter();\n\t\t\tconst lowererContext = { contract };\n\t\t\tfor (const query of controlAdapter.bootstrapSignMarkerQueries()) {\n\t\t\t\tconst lowered = await controlAdapter.lowerToExecuteRequest(query, lowererContext);\n\t\t\t\tawait driver.query(lowered.sql, lowered.params);\n\t\t\t}\n\t\t\tconst existingMarker = await controlAdapter.readMarker(driver, APP_SPACE_ID);\n\t\t\tlet markerCreated = false;\n\t\t\tlet markerUpdated = false;\n\t\t\tlet previousHashes;\n\t\t\tif (!existingMarker) {\n\t\t\t\tawait controlAdapter.insertMarker(driver, APP_SPACE_ID, {\n\t\t\t\t\tstorageHash: contractStorageHash,\n\t\t\t\t\tprofileHash: contractProfileHash\n\t\t\t\t});\n\t\t\t\tmarkerCreated = true;\n\t\t\t} else {\n\t\t\t\tconst existingStorageHash = existingMarker.storageHash;\n\t\t\t\tconst existingProfileHash = existingMarker.profileHash;\n\t\t\t\tif (!(existingStorageHash === contractStorageHash) || !(existingProfileHash === contractProfileHash)) {\n\t\t\t\t\tpreviousHashes = {\n\t\t\t\t\t\tstorageHash: existingStorageHash,\n\t\t\t\t\t\tprofileHash: existingProfileHash\n\t\t\t\t\t};\n\t\t\t\t\tif (!await controlAdapter.updateMarker(driver, APP_SPACE_ID, existingStorageHash, {\n\t\t\t\t\t\tstorageHash: contractStorageHash,\n\t\t\t\t\t\tprofileHash: contractProfileHash\n\t\t\t\t\t})) throw sqlFamilyError(\"MIGRATION.MARKER_CAS_FAILURE\", \"CAS conflict: marker was modified by another process during sign\", {\n\t\t\t\t\t\twhy: \"Another process updated the contract marker between the read and the compare-and-swap write.\",\n\t\t\t\t\t\tfix: \"Re-run the sign command; if it keeps failing, make sure only one migration process runs at a time.\",\n\t\t\t\t\t\tmeta: { space: APP_SPACE_ID }\n\t\t\t\t\t});\n\t\t\t\t\tmarkerUpdated = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet summary;\n\t\t\tif (markerCreated) summary = \"Database signed (marker created)\";\n\t\t\telse if (markerUpdated) summary = `Database signed (marker updated from ${previousHashes?.storageHash ?? \"unknown\"})`;\n\t\t\telse summary = \"Database already signed with this contract\";\n\t\t\tconst totalTime = Date.now() - startTime;\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tsummary,\n\t\t\t\tcontract: {\n\t\t\t\t\tstorageHash: contractStorageHash,\n\t\t\t\t\tprofileHash: contractProfileHash\n\t\t\t\t},\n\t\t\t\ttarget: {\n\t\t\t\t\texpected: contractTarget,\n\t\t\t\t\tactual: contractTarget\n\t\t\t\t},\n\t\t\t\tmarker: {\n\t\t\t\t\tcreated: markerCreated,\n\t\t\t\t\tupdated: markerUpdated,\n\t\t\t\t\t...previousHashes ? { previous: previousHashes } : {}\n\t\t\t\t},\n\t\t\t\tmeta: {\n\t\t\t\t\tcontractPath,\n\t\t\t\t\t...configPath ? { configPath } : {}\n\t\t\t\t},\n\t\t\t\ttimings: { total: totalTime }\n\t\t\t};\n\t\t},\n\t\tasync readMarker(options) {\n\t\t\treturn getControlAdapter().readMarker(options.driver, options.space);\n\t\t},\n\t\tasync readAllMarkers(options) {\n\t\t\treturn getControlAdapter().readAllMarkers(options.driver);\n\t\t},\n\t\tasync readLedger(options) {\n\t\t\treturn getControlAdapter().readLedger(options.driver, options.space);\n\t\t},\n\t\tasync initMarker(options) {\n\t\t\treturn getControlAdapter().initMarker(options.driver, options.space, options.destination);\n\t\t},\n\t\tasync updateMarker(options) {\n\t\t\treturn getControlAdapter().updateMarker(options.driver, options.space, options.expectedFrom, options.destination);\n\t\t},\n\t\tasync writeLedgerEntry(options) {\n\t\t\treturn getControlAdapter().writeLedgerEntry(options.driver, options.space, options.entry);\n\t\t},\n\t\tasync introspect(options) {\n\t\t\treturn getControlAdapter().introspect(options.driver, options.contract);\n\t\t},\n\t\tinferPslContract(schemaIR) {\n\t\t\tif (!targetInferPslContract) throw sqlFamilyError(\"CONTRACT.INFER_UNSUPPORTED\", `Target \"${target.targetId}\" does not support contract infer (no inferPslContract on its descriptor).`, {\n\t\t\t\twhy: \"The target descriptor does not provide the inferPslContract hook, so a PSL contract cannot be inferred from the database schema.\",\n\t\t\t\tfix: \"Use a target package that supports contract infer, or author the contract instead of inferring it.\",\n\t\t\t\tmeta: { targetId: target.targetId }\n\t\t\t});\n\t\t\treturn targetInferPslContract(schemaIR, describedContracts);\n\t\t},\n\t\tbuildPslContract(contract) {\n\t\t\tif (!targetBuildPslContract) throw sqlFamilyError(\"CONTRACT.PRINT_UNSUPPORTED\", `Target \"${target.targetId}\" does not support contract print (no buildPslContract on its descriptor).`, {\n\t\t\t\twhy: \"The target descriptor does not provide the buildPslContract hook, so the contract cannot be printed as a Prisma 8 PSL file.\",\n\t\t\t\tfix: \"Use a target whose descriptor provides buildPslContract, or write the Prisma 8 PSL file by hand.\",\n\t\t\t\tmeta: { targetId: target.targetId }\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tdocument: targetBuildPslContract(contract, {\n\t\t\t\t\tauthoringContributions: stack.authoringContributions,\n\t\t\t\t\tcodecLookup: stack.codecLookup,\n\t\t\t\t\tdataTypeLookup: stack.dataTypeLookup\n\t\t\t\t}),\n\t\t\t\tsourceSettings: ifDefined(\"defaultControlPolicy\", contract.defaultControlPolicy)\n\t\t\t};\n\t\t},\n\t\tlowerAst(ast, context) {\n\t\t\treturn getControlAdapter().lowerToExecuteRequest(ast, context);\n\t\t},\n\t\tbootstrapControlTableQueries() {\n\t\t\treturn getControlAdapter().bootstrapControlTableQueries();\n\t\t},\n\t\ttoOperationPreview(operations) {\n\t\t\treturn sqlOperationsToPreview(operations);\n\t\t},\n\t\ttoSchemaView(schema) {\n\t\t\tconst root = blindCast(schema);\n\t\t\tconst namespaceEntries = root.namespaces !== void 0 ? Object.entries(root.namespaces).map(([namespaceKey, namespace]) => [namespaceKey, namespace.tables]) : [[void 0, root.tables ?? {}]];\n\t\t\tconst qualify = namespaceEntries.length > 1;\n\t\t\tconst tableNodes = namespaceEntries.flatMap(([namespaceKey, tables]) => Object.entries(tables).map(([tableName, table]) => [\n\t\t\t\tqualify && namespaceKey !== void 0 ? `${namespaceKey}.${tableName}` : tableName,\n\t\t\t\ttableName,\n\t\t\t\ttable\n\t\t\t])).map(([displayName, tableName, table]) => {\n\t\t\t\tconst children = [];\n\t\t\t\tconst columnNodes = [];\n\t\t\t\tfor (const [columnName, column] of Object.entries(table.columns)) {\n\t\t\t\t\tconst label = `${columnName}: ${column.nativeType} (${column.nullable ? \"nullable\" : \"not nullable\"})`;\n\t\t\t\t\tcolumnNodes.push(new SchemaTreeNode({\n\t\t\t\t\t\tkind: \"field\",\n\t\t\t\t\t\tid: `column-${displayName}-${columnName}`,\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tnativeType: column.nativeType,\n\t\t\t\t\t\t\tnullable: column.nullable,\n\t\t\t\t\t\t\t...ifDefined(\"default\", column.default)\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t\tif (columnNodes.length > 0) children.push(new SchemaTreeNode({\n\t\t\t\t\tkind: \"collection\",\n\t\t\t\t\tid: `columns-${displayName}`,\n\t\t\t\t\tlabel: \"columns\",\n\t\t\t\t\tchildren: columnNodes\n\t\t\t\t}));\n\t\t\t\tif (table.primaryKey) {\n\t\t\t\t\tconst pkColumns = table.primaryKey.columns.join(\", \");\n\t\t\t\t\tchildren.push(new SchemaTreeNode({\n\t\t\t\t\t\tkind: \"index\",\n\t\t\t\t\t\tid: `primary-key-${displayName}`,\n\t\t\t\t\t\tlabel: `primary key: ${pkColumns}`,\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tcolumns: table.primaryKey.columns,\n\t\t\t\t\t\t\t...table.primaryKey.name ? { name: table.primaryKey.name } : {}\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t\tfor (const unique of table.uniques) {\n\t\t\t\t\tconst name = unique.name ?? `${tableName}_${unique.columns.join(\"_\")}_unique`;\n\t\t\t\t\tconst label = `unique ${name}`;\n\t\t\t\t\tchildren.push(new SchemaTreeNode({\n\t\t\t\t\t\tkind: \"index\",\n\t\t\t\t\t\tid: `unique-${displayName}-${name}`,\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tcolumns: unique.columns,\n\t\t\t\t\t\t\tunique: true\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t\tfor (const index of table.indexes) {\n\t\t\t\t\tconst name = index.name;\n\t\t\t\t\tconst label = index.unique ? `unique index ${name}` : `index ${name}`;\n\t\t\t\t\tchildren.push(new SchemaTreeNode({\n\t\t\t\t\t\tkind: \"index\",\n\t\t\t\t\t\tid: `index-${displayName}-${name}`,\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tcolumns: index.columns,\n\t\t\t\t\t\t\tunique: index.unique\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t\tconst tableMeta = {};\n\t\t\t\tif (table.primaryKey) {\n\t\t\t\t\ttableMeta[\"primaryKey\"] = table.primaryKey.columns;\n\t\t\t\t\tif (table.primaryKey.name) tableMeta[\"primaryKeyName\"] = table.primaryKey.name;\n\t\t\t\t}\n\t\t\t\tif (table.foreignKeys.length > 0) tableMeta[\"foreignKeys\"] = table.foreignKeys.map((fk) => ({\n\t\t\t\t\tcolumns: fk.columns,\n\t\t\t\t\treferencedTable: fk.referencedTable,\n\t\t\t\t\treferencedColumns: fk.referencedColumns,\n\t\t\t\t\t...fk.name ? { name: fk.name } : {}\n\t\t\t\t}));\n\t\t\t\treturn new SchemaTreeNode({\n\t\t\t\t\tkind: \"entity\",\n\t\t\t\t\tid: `table-${displayName}`,\n\t\t\t\t\tlabel: `table ${displayName}`,\n\t\t\t\t\t...Object.keys(tableMeta).length > 0 ? { meta: tableMeta } : {},\n\t\t\t\t\t...children.length > 0 ? { children } : {}\n\t\t\t\t});\n\t\t\t});\n\t\t\treturn { root: new SchemaTreeNode({\n\t\t\t\tkind: \"root\",\n\t\t\t\tid: \"sql-schema\",\n\t\t\t\tlabel: \"database\",\n\t\t\t\t...tableNodes.length > 0 ? { children: tableNodes } : {}\n\t\t\t}) };\n\t\t}\n\t};\n}\n//#endregion\n//#region src/core/control-descriptor.ts\nvar SqlFamilyDescriptor = class {\n\tkind = \"family\";\n\tid = \"sql\";\n\tfamilyId = \"sql\";\n\tversion = \"0.0.1\";\n\temission = sqlEmission;\n\tdataTypes = [sqlExpressionDataType];\n\tauthoring = {\n\t\tfield: sqlFamilyAuthoringFieldPresets,\n\t\ttype: sqlFamilyAuthoringTypes,\n\t\tentityTypes: sqlFamilyEntityTypes,\n\t\tpslBlockDescriptors: sqlFamilyPslBlockDescriptors,\n\t\tattributeSpecs: sqlAttributeSpecs,\n\t\tdataTypes: { [SQL_EXPRESSION_DATA_TYPE_ID]: sqlExpressionAuthoringEntry }\n\t};\n\tcreate(stack) {\n\t\treturn createSqlFamilyInstance(stack);\n\t}\n};\n//#endregion\n//#region src/core/migrations/contract-to-schema-ir.ts\nfunction convertColumn(name, column, storageTypes, expandNativeType, renderDefault, resolveDefault, dataTypeOf) {\n\tconst resolved = resolveColumnTypeMetadata(column, storageTypes);\n\tconst baseNativeType = expandNativeType ? expandNativeType({\n\t\tnativeType: resolved.nativeType,\n\t\tcodecId: resolved.codecId,\n\t\t...ifDefined(\"typeParams\", resolved.typeParams)\n\t}) : resolved.nativeType;\n\tconst nativeType = baseNativeType;\n\tconst resolvedNativeType = column.many ? `${baseNativeType}[]` : baseNativeType;\n\tconst rawColumnDefault = column.default ?? void 0;\n\tconst resolvedColumnDefault = rawColumnDefault !== void 0 && resolveDefault ? resolveDefault(rawColumnDefault, resolvedNativeType) : rawColumnDefault;\n\treturn {\n\t\tname,\n\t\tnativeType,\n\t\tnullable: column.nullable,\n\t\t...ifDefined(\"many\", column.many),\n\t\t...ifDefined(\"default\", column.default != null && renderDefault ? renderDefault(column.default, column) : void 0),\n\t\tresolvedNativeType,\n\t\t...ifDefined(\"resolvedDefault\", resolvedColumnDefault),\n\t\t...ifDefined(\"authoredDefault\", rawColumnDefault),\n\t\tcodecRef: buildColumnCodecRef(resolved, column.many),\n\t\tcodecBaseNativeType: resolved.nativeType,\n\t\t...column.typeRef !== void 0 ? { codecNamedType: true } : {},\n\t\t...ifDefined(\"dataType\", dataTypeOf?.(resolved.codecId))\n\t};\n}\n/**\n* Builds the column's `CodecRef` from its resolved (post-`typeRef`) codec\n* identity — the same construction the query AST and the migration DDL\n* renderer already use (TML-2456, TML-2918).\n*/\nfunction buildColumnCodecRef(resolved, many) {\n\treturn {\n\t\tcodecId: resolved.codecId,\n\t\t...ifDefined(\"typeParams\", resolved.typeParams !== void 0 ? blindCast(resolved.typeParams) : void 0),\n\t\t...ifDefined(\"many\", many)\n\t};\n}\nfunction resolveColumnTypeMetadata(column, storageTypes) {\n\tif (!column.typeRef) return column;\n\tconst referenced = storageTypes[column.typeRef];\n\tif (!referenced) throw sqlFamilyError(\"CONTRACT.TYPE_UNKNOWN\", `Column references storage type \"${column.typeRef}\" but it is not defined in storage.types.`, {\n\t\twhy: \"The column typeRef does not resolve to any entry in the contract storage.types map.\",\n\t\tfix: \"Regenerate the contract from its authoring source; do not hand-edit contract JSON.\",\n\t\tmeta: { typeRef: column.typeRef }\n\t});\n\tif (isStorageTypeInstance(referenced)) return {\n\t\tcodecId: referenced.codecId,\n\t\tnativeType: referenced.nativeType,\n\t\ttypeParams: referenced.typeParams\n\t};\n\tthrow new InternalError(`Storage type \"${column.typeRef}\" has an unknown polymorphic kind; expected a codec-typed StorageTypeInstance.`);\n}\nfunction convertCheck(check, tableName, tableColumns) {\n\treturn {\n\t\tnaming: namingOf(check.name, check.prefix),\n\t\texpression: check.expression,\n\t\tdependsOn: flatColumnDependsOn(tableName, tableColumns)\n\t};\n}\nfunction convertUnique(unique, tableName) {\n\treturn {\n\t\tcolumns: unique.columns,\n\t\t...ifDefined(\"name\", unique.name),\n\t\tdependsOn: flatColumnDependsOn(tableName, unique.columns)\n\t};\n}\nfunction convertIndex(index, tableName, tableColumns) {\n\tconst base = {\n\t\tnaming: namingOf(index.name, index.prefix),\n\t\twhere: index.where,\n\t\tunique: index.unique,\n\t\tpartial: index.where !== void 0,\n\t\ttype: index.type,\n\t\toptions: index.options,\n\t\tannotations: void 0,\n\t\tdependsOn: flatColumnDependsOn(tableName, index.columns ?? tableColumns)\n\t};\n\treturn index.expression !== void 0 ? {\n\t\t...base,\n\t\texpression: index.expression\n\t} : {\n\t\t...base,\n\t\tcolumns: index.columns ?? []\n\t};\n}\n/**\n* The referenced table's chain in the flat (single-schema) tree\n* `contractToSchemaIR`/`contractNamespaceToSchemaIR` build: the root\n* (`SqlSchemaIR`, fixed `'database'` id) followed by the table's own id.\n* Postgres discards this when it re-derives the FK against its own\n* multi-schema tree shape (`contractToPostgresDatabaseSchemaNode`); SQLite's\n* flat tree uses it as-is.\n*/\nfunction flatSchemaDependsOn(tableName) {\n\treturn [{\n\t\tnodeKind: RelationalSchemaNodeKind.schema,\n\t\tid: \"database\"\n\t}, {\n\t\tnodeKind: RelationalSchemaNodeKind.table,\n\t\tid: tableName\n\t}];\n}\n/**\n* The chains from a table-child object (foreign key, index, unique, primary\n* key) to each of the own columns it is built on, in the flat tree. Dropping\n* a covered column auto-drops the object, so the object's drop must precede\n* the column's; the graph derives that direction from these edges.\n*/\nfunction flatColumnDependsOn(tableName, columns) {\n\treturn columns.map((column) => [\n\t\t{\n\t\t\tnodeKind: RelationalSchemaNodeKind.schema,\n\t\t\tid: \"database\"\n\t\t},\n\t\t{\n\t\t\tnodeKind: RelationalSchemaNodeKind.table,\n\t\t\tid: tableName\n\t\t},\n\t\t{\n\t\t\tnodeKind: RelationalSchemaNodeKind.column,\n\t\t\tid: `column:${column}`\n\t\t}\n\t]);\n}\n/**\n* The FK's referenced-namespace identity comes from the target's namespace\n* node, not the raw namespace-id string. An unbound target namespace stamps\n* no `referencedSchema` at all — the FK node's id renders the absence as the\n* empty segment, which is what flat (single-schema) introspection produces,\n* so both diff sides' FK ids meet by construction. A bound namespace (or a\n* cross-space target whose namespace lives in another contract's storage)\n* stamps its coordinate verbatim; namespaced targets (Postgres) resolve the\n* real DDL schema downstream.\n*\n* `dependsOn` carries the referenced table (created before the FK, dropped\n* after it) plus the FK's own columns (dropped after the FK, since dropping a\n* column auto-drops the FK built on it).\n*/\nfunction convertForeignKey(fk, storage) {\n\tconst targetIsUnbound = storage.namespaces[fk.target.namespaceId]?.isUnbound === true;\n\treturn {\n\t\tcolumns: fk.source.columns,\n\t\treferencedTable: fk.target.tableName,\n\t\t...targetIsUnbound ? {} : { referencedSchema: fk.target.namespaceId },\n\t\treferencedColumns: fk.target.columns,\n\t\t...ifDefined(\"name\", fk.name),\n\t\t...ifDefined(\"onDelete\", fk.onDelete),\n\t\t...ifDefined(\"onUpdate\", fk.onUpdate),\n\t\tdependsOn: [flatSchemaDependsOn(fk.target.tableName), ...flatColumnDependsOn(fk.source.tableName, fk.source.columns)]\n\t};\n}\nfunction convertTable(name, table, storageTypes, expandNativeType, renderDefault, resolveDefault, dataTypeOf, storage) {\n\tconst columns = {};\n\tfor (const [colName, colDef] of Object.entries(table.columns)) columns[colName] = convertColumn(colName, colDef, storageTypes, expandNativeType, renderDefault, resolveDefault, dataTypeOf);\n\tconst checks = table.checks && table.checks.length > 0 ? table.checks.map((c) => convertCheck(c, name, Object.keys(table.columns))) : void 0;\n\treturn new SqlTableIR({\n\t\tname,\n\t\tcolumns,\n\t\t...ifDefined(\"primaryKey\", table.primaryKey !== void 0 ? {\n\t\t\tcolumns: table.primaryKey.columns,\n\t\t\t...ifDefined(\"name\", table.primaryKey.name),\n\t\t\tdependsOn: flatColumnDependsOn(name, table.primaryKey.columns)\n\t\t} : void 0),\n\t\tforeignKeys: table.foreignKeys.map((fk) => convertForeignKey(fk, storage)),\n\t\tuniques: table.uniques.map((u) => convertUnique(u, name)),\n\t\tindexes: table.indexes.map((i) => convertIndex(i, name, Object.keys(table.columns))),\n\t\t...ifDefined(\"checks\", checks)\n\t});\n}\n/**\n* Detects destructive changes between two contract storages.\n*\n* The additive-only planner silently ignores removals (tables, columns).\n* This function detects those removals so callers can report them as conflicts\n* rather than silently producing an empty plan.\n*\n* Returns an empty array if no destructive changes are found.\n*/\nfunction detectDestructiveChanges(from, to) {\n\tif (!from) return [];\n\tconst hasOwn = (value, key) => Object.hasOwn(value, key);\n\tconst conflicts = [];\n\tconst namespaceIds = [.../* @__PURE__ */ new Set([...Object.keys(from.namespaces), ...Object.keys(to.namespaces)])].sort((a, b) => a < b ? -1 : a > b ? 1 : 0);\n\tfor (const namespaceId of namespaceIds) {\n\t\tconst fromNs = from.namespaces[namespaceId];\n\t\tconst toNs = to.namespaces[namespaceId];\n\t\tconst fromTables = fromNs?.entries.table;\n\t\tif (!fromTables) continue;\n\t\tfor (const tableName of Object.keys(fromTables)) {\n\t\t\tconst toTableRaw = toNs?.entries.table?.[tableName];\n\t\t\tif (!StorageTable.is(toTableRaw)) {\n\t\t\t\tconflicts.push({\n\t\t\t\t\tkind: \"tableRemoved\",\n\t\t\t\t\tsummary: `Table \"${tableName}\" was removed`\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst toTable = toTableRaw;\n\t\t\tconst fromTableRaw = fromTables[tableName];\n\t\t\tif (!StorageTable.is(fromTableRaw)) continue;\n\t\t\tconst fromTable = fromTableRaw;\n\t\t\tfor (const columnName of Object.keys(fromTable.columns)) if (!hasOwn(toTable.columns, columnName)) conflicts.push({\n\t\t\t\tkind: \"columnRemoved\",\n\t\t\t\tsummary: `Column \"${tableName}\".\"${columnName}\" was removed`\n\t\t\t});\n\t\t}\n\t}\n\treturn conflicts;\n}\n/**\n* Converts a `Contract` to `SqlSchemaIR`.\n*\n* Reads `contract.storage` for tables and `contract.storage.types` for type\n* annotations. Storage-type annotations are written under\n* `options.annotationNamespace`.\n*\n* Drops codec metadata (`codecId`, `typeRef`) since the schema IR only represents\n* structural information. When `expandNativeType` is provided, parameterized types\n* are expanded (e.g. `character` + `{ length: 36 }` → `character(36)`) so the\n* resulting IR compares correctly against the \"to\" contract during planning.\n*\n* Returns an empty schema IR when `contract` is `null` (new project).\n*/\n/**\n* Converts the tables of a single namespace into a `SqlSchemaIR`, keyed by\n* table name within that namespace. Unlike {@link contractToSchemaIR}, which\n* flattens every namespace's tables into one bare-keyed record (and throws on a\n* cross-namespace name collision), this scopes the table iteration to one\n* namespace so the same table name can exist in two schemas.\n*\n* The full `storage` is still passed to `convertTable`, so value-set / enum /\n* type resolution that legitimately spans namespaces is unaffected. Foreign\n* keys are built purely from the FK descriptor (`fk.target`), so cross-namespace\n* FKs survive per-namespace conversion. The `annotations` block (storage-type\n* derived) is omitted here — the per-namespace tree consumer reads only the\n* per-table fields.\n*/\nfunction contractNamespaceToSchemaIR(storage, namespaceId, options) {\n\tif (options.annotationNamespace.length === 0) throw sqlFamilyError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", \"annotationNamespace must be a non-empty string\", {\n\t\twhy: \"The calling target pack passed an empty annotationNamespace to the contract-to-schema-IR projection.\",\n\t\tfix: \"Fix the target pack to pass its non-empty annotation namespace (e.g. \\\"pg\\\").\",\n\t\tmeta: { option: \"annotationNamespace\" }\n\t});\n\tconst namespace = storage.namespaces[namespaceId];\n\tif (!namespace) return new SqlSchemaIR({ tables: {} });\n\tconst storageTypes = { ...storage.types ?? {} };\n\tconst tables = {};\n\tfor (const [tableName, tableDefRaw] of Object.entries(namespace.entries.table ?? {})) {\n\t\tStorageTable.assert(tableDefRaw, `namespaces.${namespaceId}.entries.table.${tableName}`);\n\t\ttables[tableName] = convertTable(tableName, tableDefRaw, storageTypes, options.expandNativeType, options.renderDefault, options.resolveDefault, options.dataTypeOf, storage);\n\t}\n\treturn new SqlSchemaIR({ tables });\n}\nfunction contractToSchemaIR(contract, options) {\n\tif (options.annotationNamespace.length === 0) throw sqlFamilyError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", \"annotationNamespace must be a non-empty string\", {\n\t\twhy: \"The calling target pack passed an empty annotationNamespace to the contract-to-schema-IR projection.\",\n\t\tfix: \"Fix the target pack to pass its non-empty annotation namespace (e.g. \\\"pg\\\").\",\n\t\tmeta: { option: \"annotationNamespace\" }\n\t});\n\tif (!contract) return new SqlSchemaIR({ tables: {} });\n\tconst storage = contract.storage;\n\tconst storageTypes = { ...storage.types ?? {} };\n\tconst tables = {};\n\tfor (const ns of Object.values(storage.namespaces)) for (const [tableName, tableDefRaw] of Object.entries(ns.entries.table ?? {})) {\n\t\tStorageTable.assert(tableDefRaw, `namespaces.${ns.id}.entries.table.${tableName}`);\n\t\tconst tableDef = tableDefRaw;\n\t\tif (tables[tableName] !== void 0) throw sqlFamilyError(\"CONTRACT.TABLE_AMBIGUOUS\", `contractToSchemaIR: duplicate SQL table name \"${tableName}\" across namespaces (ambiguous for flat SqlSchemaIR.tables).`, {\n\t\t\twhy: \"Two namespaces declare a table with the same name, which is ambiguous for the flat schema-IR table map.\",\n\t\t\tfix: \"Rename one of the tables so every table name is unique across namespaces.\",\n\t\t\tmeta: { table: tableName }\n\t\t});\n\t\ttables[tableName] = convertTable(tableName, tableDef, storageTypes, options.expandNativeType, options.renderDefault, options.resolveDefault, options.dataTypeOf, storage);\n\t}\n\treturn new SqlSchemaIR({\n\t\ttables,\n\t\t...ifDefined(\"annotations\", deriveAnnotations(storage, options.annotationNamespace, options.resolveEnumNamespaceSchema))\n\t});\n}\nfunction deriveAnnotations(storage, annotationNamespace, _resolveEnumNamespaceSchema) {\n\tconst storageTypes = {};\n\tfor (const typeInstance of Object.values(storage.types ?? {})) if (isStorageTypeInstance(typeInstance)) storageTypes[typeInstance.nativeType] = typeInstance;\n\tconst envelope = { ...Object.keys(storageTypes).length > 0 ? { storageTypes } : {} };\n\tif (Object.keys(envelope).length === 0) return void 0;\n\treturn { [annotationNamespace]: envelope };\n}\n//#endregion\n//#region src/core/migrations/control-policy.ts\n/**\n* The control policy that governs a single call. The `external` default is an\n* un-overridable namespace floor: when the contract default is `external`, no\n* per-object `managed` override can escalate DDL above the floor, so the\n* policy is forced to `external` regardless of the node's own declaration.\n* Every other default defers to the node's effective control policy.\n*/\nfunction controlPolicyForCall(subject, defaultControlPolicy) {\n\tif (defaultControlPolicy === \"external\") return \"external\";\n\treturn effectiveControlPolicy(subject?.explicitNodeControlPolicy, defaultControlPolicy);\n}\n/**\n* Whether a call is allowed to emit under a given control policy.\n*\n* - `managed` — full lifecycle, every op allowed.\n* - `tolerated` — create-if-absent only: allowed iff the call creates a whole\n* new top-level object (and its subject was positively resolved). Anything\n* that modifies an existing object, and anything whose subject could not be\n* resolved, is suppressed.\n* - `external` / `observed` — no DDL at all.\n*/\nfunction callAllowedUnderControlPolicy(policy, subject) {\n\tswitch (policy) {\n\t\tcase \"managed\": return true;\n\t\tcase \"tolerated\": return subject?.createsNewObject === true;\n\t\tcase \"external\":\n\t\tcase \"observed\": return false;\n\t}\n}\n/**\n* Partition the calls produced for a single set of subjects into those the\n* effective control policy permits (`kept`) and a list of\n* {@link SuppressionRecord}s describing the suppressed calls.\n*\n* **Prefer {@link partitionIssuesByControlPolicy}** for the schema-issue\n* pipeline: it filters subjects out of the planner's *input* so the planner\n* never has to reason about un-modeled state on `external`/`observed`\n* subjects. This call-level helper remains for paths that bypass the issue\n* pipeline — currently the codec-emitted field-event ops, which originate\n* from declared contract fields rather than from introspected schema state\n* and therefore cannot trip the diff engine.\n*/\nfunction partitionCallsByControlPolicy(options) {\n\tconst defaultControlPolicy = options.contract.defaultControlPolicy;\n\tconst kept = [];\n\tconst suppressions = [];\n\tfor (const call of options.calls) {\n\t\tconst subject = options.resolveControlPolicySubject(call);\n\t\tconst policy = controlPolicyForCall(subject, defaultControlPolicy);\n\t\tif (callAllowedUnderControlPolicy(policy, subject)) kept.push(call);\n\t\telse suppressions.push({\n\t\t\tsubject,\n\t\t\tpolicy,\n\t\t\tfactoryName: options.resolveFactoryName(call),\n\t\t\tcreatesNewObject: subject?.createsNewObject ?? false\n\t\t});\n\t}\n\treturn Object.freeze({\n\t\tkept: Object.freeze(kept),\n\t\tsuppressions: Object.freeze(suppressions)\n\t});\n}\n/**\n* Partition a list of schema-issue-shaped inputs by the effective control\n* policy of each issue's subject *before* the planner is invoked.\n*\n* `plannable` is the list of issues whose subject's effective policy permits\n* the planner to act on them (`managed`, or `tolerated` for whole-object\n* creation issues only). Issues for `external`/`observed` subjects, and\n* non-creation issues for `tolerated` subjects, are dropped from the planner's\n* input entirely — they never enter introspection-driven planning, never feed\n* the diff engine, and never produce DDL calls that would have to be\n* post-filtered. This sidesteps a class of failure where the diff engine\n* cannot reason about the live shape of a subject the user marked as\n* out-of-scope (`external`).\n*\n* `suppressions` is one {@link SuppressionRecord} per suppressed subject (not\n* per suppressed issue). Its `factoryName` is the creation factory name when any\n* of the subject's issues is whole-object creation (e.g. `createTable`), else\n* `undefined` — the family never invents a modification verb for an op that\n* produced no call; the target renders the message.\n*\n* Unresolved-subject issues (`resolveControlPolicySubject` returns\n* `undefined`) emit one record each; they cannot be deduplicated because they\n* carry no subject coordinate.\n*/\nfunction partitionIssuesByControlPolicy(options) {\n\tconst defaultControlPolicy = options.contract.defaultControlPolicy;\n\tconst plannable = [];\n\tconst suppressedSubjects = /* @__PURE__ */ new Map();\n\tconst unresolvedSuppressions = [];\n\tfor (const issue of options.issues) {\n\t\tconst subject = options.resolveControlPolicySubject(issue);\n\t\tconst policy = controlPolicyForCall(subject, defaultControlPolicy);\n\t\tconst creationFactoryName = options.resolveCreationFactoryName(issue);\n\t\tif (policy === \"managed\") {\n\t\t\tplannable.push(issue);\n\t\t\tcontinue;\n\t\t}\n\t\tif (policy === \"tolerated\" && subject !== void 0 && creationFactoryName !== void 0 && subject.createsNewObject) {\n\t\t\tplannable.push(issue);\n\t\t\tcontinue;\n\t\t}\n\t\tif (subject === void 0) {\n\t\t\tunresolvedSuppressions.push({\n\t\t\t\tsubject: void 0,\n\t\t\t\tpolicy,\n\t\t\t\tfactoryName: creationFactoryName,\n\t\t\t\tcreatesNewObject: false\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst key = subjectKey(subject);\n\t\tconst existing = suppressedSubjects.get(key);\n\t\tif (existing) {\n\t\t\tif (existing.creationFactoryName === void 0 && creationFactoryName !== void 0) existing.creationFactoryName = creationFactoryName;\n\t\t} else suppressedSubjects.set(key, {\n\t\t\tsubject,\n\t\t\tpolicy,\n\t\t\t...ifDefined(\"creationFactoryName\", creationFactoryName)\n\t\t});\n\t}\n\tconst suppressions = [...unresolvedSuppressions];\n\tfor (const entry of suppressedSubjects.values()) suppressions.push({\n\t\tsubject: entry.subject,\n\t\tpolicy: entry.policy,\n\t\tfactoryName: entry.creationFactoryName,\n\t\tcreatesNewObject: entry.subject.createsNewObject\n\t});\n\treturn Object.freeze({\n\t\tplannable: Object.freeze(plannable),\n\t\tsuppressions: Object.freeze(suppressions)\n\t});\n}\nfunction subjectKey(subject) {\n\treturn `${subject.namespaceId}\\u0000${subject.entityKind ?? \"\"}\\u0000${subject.entityName ?? \"\"}\\u0000${subject.rlsPolicy ?? \"\"}`;\n}\n//#endregion\n//#region src/core/migrations/data-type-resolver.ts\n/**\n* Builds the resolver the contract→IR derivation uses to give each column its data type (ADR 254):\n* the codec's descriptor names the type, and the composed components register it. Codecs and\n* data types from extension packs are found the same way as the target's own, and a codec id two\n* components contribute is refused, as everywhere else in the stack. Returns `undefined` when no\n* framework components are supplied, so callers can omit the option.\n*/\nfunction buildDataTypeResolver(frameworkComponents) {\n\tif (!frameworkComponents) return;\n\tconst dataTypes = assembleDataTypes(frameworkComponents).lookup;\n\tconst codecs = extractCodecLookup(frameworkComponents);\n\treturn (codecId) => {\n\t\tconst dataTypeId = codecs.descriptorFor?.(codecId)?.dataType;\n\t\treturn dataTypeId === void 0 ? void 0 : dataTypes.get(dataTypeId);\n\t};\n}\n//#endregion\n//#region src/core/migrations/field-event-planner.ts\nfunction planFieldEventOperations(options) {\n\tconst priorContract = options.priorContract;\n\tconst newContract = options.newContract;\n\tconst added = [];\n\tconst dropped = [];\n\tconst altered = [];\n\tconst namespaceIds = unionSorted(priorContract ? Object.keys(priorContract.storage.namespaces) : [], Object.keys(newContract.storage.namespaces));\n\tfor (const namespaceId of namespaceIds) {\n\t\tconst priorNs = priorContract?.storage.namespaces[namespaceId];\n\t\tconst newNs = newContract.storage.namespaces[namespaceId];\n\t\tconst priorTables = priorNs?.entries.table;\n\t\tconst newTables = newNs?.entries.table;\n\t\tconst tableNames = unionSorted(priorTables ? Object.keys(priorTables) : [], newTables ? Object.keys(newTables) : []);\n\t\tfor (const tableName of tableNames) {\n\t\t\tconst priorTableRaw = priorTables?.[tableName];\n\t\t\tconst newTableRaw = newTables?.[tableName];\n\t\t\tconst priorTable = StorageTable.is(priorTableRaw) ? priorTableRaw : void 0;\n\t\t\tconst newTable = StorageTable.is(newTableRaw) ? newTableRaw : void 0;\n\t\t\tconst fieldNames = unionSorted(priorTable ? Object.keys(priorTable.columns) : [], newTable ? Object.keys(newTable.columns) : []);\n\t\t\tfor (const fieldName of fieldNames) {\n\t\t\t\tconst priorField = priorTable?.columns[fieldName];\n\t\t\t\tconst newField = newTable?.columns[fieldName];\n\t\t\t\tconst entry = {\n\t\t\t\t\tnamespaceId,\n\t\t\t\t\ttableName,\n\t\t\t\t\tfieldName,\n\t\t\t\t\tpriorTable,\n\t\t\t\t\tnewTable,\n\t\t\t\t\tpriorField,\n\t\t\t\t\tnewField\n\t\t\t\t};\n\t\t\t\tif (priorField === void 0 && newField !== void 0) added.push(entry);\n\t\t\t\telse if (priorField !== void 0 && newField === void 0) dropped.push(entry);\n\t\t\t\telse if (priorField !== void 0 && newField !== void 0) {\n\t\t\t\t\tif (isAlteration(priorField, newField)) altered.push(entry);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tconst calls = [];\n\tappendCalls(\"added\", added, options.codecHooks, calls, (e) => e.newField?.codecId);\n\tappendCalls(\"dropped\", dropped, options.codecHooks, calls, (e) => e.priorField?.codecId);\n\tappendCalls(\"altered\", altered, options.codecHooks, calls, (e) => e.newField?.codecId);\n\treturn calls;\n}\nfunction appendCalls(event, entries, codecHooks, calls, pickCodecId) {\n\tfor (const entry of entries) {\n\t\tconst codecId = pickCodecId(entry);\n\t\tif (codecId === void 0) continue;\n\t\tconst hook = codecHooks.get(codecId);\n\t\tif (!hook?.onFieldEvent) continue;\n\t\tconst ctx = buildContext(event, entry);\n\t\tconst emitted = hook.onFieldEvent(event, ctx);\n\t\tfor (const call of emitted) calls.push(call);\n\t}\n}\n/**\n* The context's prior/new sides are scoped to the event:\n*\n* - `'added'` — only `newTable` / `newField` populated.\n* - `'dropped'` — only `priorTable` / `priorField` populated.\n* - `'altered'` — both sides populated.\n*/\nfunction buildContext(event, entry) {\n\tconst base = {\n\t\tnamespaceId: entry.namespaceId,\n\t\ttableName: entry.tableName,\n\t\tfieldName: entry.fieldName\n\t};\n\tif (event === \"added\") return {\n\t\t...base,\n\t\t...entry.newTable !== void 0 ? { newTable: entry.newTable } : {},\n\t\t...entry.newField !== void 0 ? { newField: entry.newField } : {}\n\t};\n\tif (event === \"dropped\") return {\n\t\t...base,\n\t\t...entry.priorTable !== void 0 ? { priorTable: entry.priorTable } : {},\n\t\t...entry.priorField !== void 0 ? { priorField: entry.priorField } : {}\n\t};\n\treturn {\n\t\t...base,\n\t\t...entry.priorTable !== void 0 ? { priorTable: entry.priorTable } : {},\n\t\t...entry.newTable !== void 0 ? { newTable: entry.newTable } : {},\n\t\t...entry.priorField !== void 0 ? { priorField: entry.priorField } : {},\n\t\t...entry.newField !== void 0 ? { newField: entry.newField } : {}\n\t};\n}\n/**\n* `'altered'` predicate. Returns `false` whenever `codecId` differs —\n* any codec change suppresses the `altered` event entirely, including\n* cases where another property also differs in the same diff. Codec\n* rotation is a v1 non-goal; avoiding the mixed event keeps the\n* migration semantics for codec changes explicit rather than smuggling\n* them through as `altered`.\n*\n* For non-`codecId` diffs, returns `true` iff any other column property\n* differs.\n*/\nfunction isAlteration(prior, current) {\n\tif (prior.codecId !== current.codecId) return false;\n\treturn !sameStorageColumn(prior, current);\n}\nfunction sameStorageColumn(a, b) {\n\tif (a === b) return true;\n\tif (a.nativeType !== b.nativeType) return false;\n\tif (a.nullable !== b.nullable) return false;\n\tif (a.typeRef !== b.typeRef) return false;\n\tif (!sameJson(a.typeParams, b.typeParams)) return false;\n\tif (!sameJson(a.default, b.default)) return false;\n\treturn true;\n}\nfunction sameJson(a, b) {\n\tif (a === b) return true;\n\tif (a === void 0 || b === void 0) return false;\n\treturn JSON.stringify(a) === JSON.stringify(b);\n}\nfunction unionSorted(a, b) {\n\tconst set = /* @__PURE__ */ new Set();\n\tfor (const name of a) set.add(name);\n\tfor (const name of b) set.add(name);\n\treturn [...set].sort((x, y) => x < y ? -1 : x > y ? 1 : 0);\n}\n//#endregion\n//#region src/core/migrations/native-type-expander.ts\n/**\n* Builds the codec-hook-composed `expandNativeType` callback the contract→IR\n* derivation uses to expand parameterized native types (e.g. `character` +\n* `{ length: 36 }` → `character(36)`). Returns `undefined` when no framework\n* components are supplied, so callers can omit the option entirely.\n*/\nfunction buildNativeTypeExpander(frameworkComponents) {\n\tif (!frameworkComponents) return;\n\tconst codecHooks = extractCodecControlHooks(frameworkComponents);\n\treturn (input) => {\n\t\tif (!input.typeParams) return input.nativeType;\n\t\tif (!input.codecId) return input.nativeType;\n\t\tconst hooks = codecHooks.get(input.codecId);\n\t\tif (!hooks?.expandNativeType) return input.nativeType;\n\t\treturn hooks.expandNativeType(input);\n\t};\n}\n//#endregion\n//#region src/core/migrations/plan-helpers.ts\nconst readOnlyEmptyObject = Object.freeze({});\nfunction cloneRecord(value) {\n\tif (value === readOnlyEmptyObject) return value;\n\treturn blindCast(Object.freeze({ ...value }));\n}\nfunction freezeSteps(steps) {\n\tif (steps.length === 0) return Object.freeze([]);\n\treturn Object.freeze(steps.map((step) => Object.freeze({\n\t\tdescription: step.description,\n\t\tsql: step.sql,\n\t\t...step.params ? { params: Object.freeze([...step.params]) } : {},\n\t\t...step.meta ? { meta: cloneRecord(step.meta) } : {}\n\t})));\n}\nfunction freezeDetailsValue(value) {\n\tif (value === null || value === void 0) return value;\n\tif (typeof value !== \"object\") return value;\n\tif (Array.isArray(value)) return blindCast(Object.freeze([...value]));\n\treturn blindCast(Object.freeze({ ...value }));\n}\nfunction freezeTargetDetails(target) {\n\treturn Object.freeze({\n\t\tid: target.id,\n\t\t...target.details !== void 0 ? { details: freezeDetailsValue(target.details) } : {}\n\t});\n}\nfunction freezeOperation(operation) {\n\treturn Object.freeze({\n\t\tid: operation.id,\n\t\tlabel: operation.label,\n\t\t...operation.summary ? { summary: operation.summary } : {},\n\t\toperationClass: operation.operationClass,\n\t\t...operation.invariantId ? { invariantId: operation.invariantId } : {},\n\t\ttarget: freezeTargetDetails(operation.target),\n\t\tprecheck: freezeSteps(operation.precheck),\n\t\texecute: freezeSteps(operation.execute),\n\t\tpostcheck: freezeSteps(operation.postcheck),\n\t\t...operation.meta ? { meta: cloneRecord(operation.meta) } : {}\n\t});\n}\nfunction freezeOperations(operations) {\n\tif (operations.length === 0) return Object.freeze([]);\n\treturn Object.freeze(operations.map((operation) => freezeOperation(operation)));\n}\nfunction createMigrationPlan(options) {\n\treturn Object.freeze({\n\t\ttargetId: options.targetId,\n\t\tspaceId: options.spaceId,\n\t\t...options.origin !== void 0 ? { origin: options.origin ? Object.freeze({ ...options.origin }) : null } : {},\n\t\tdestination: Object.freeze({ ...options.destination }),\n\t\toperations: freezeOperations(options.operations),\n\t\tprovidedInvariants: Object.freeze([...options.providedInvariants]),\n\t\t...options.meta ? { meta: cloneRecord(options.meta) } : {}\n\t});\n}\nfunction plannerSuccess(plan, warnings) {\n\treturn Object.freeze({\n\t\tkind: \"success\",\n\t\tplan,\n\t\t...warnings && warnings.length > 0 ? { warnings: Object.freeze(warnings.map((conflict) => Object.freeze({\n\t\t\tkind: conflict.kind,\n\t\t\tsummary: conflict.summary,\n\t\t\t...conflict.why ? { why: conflict.why } : {},\n\t\t\t...conflict.location ? { location: Object.freeze({ ...conflict.location }) } : {},\n\t\t\t...conflict.meta ? { meta: cloneRecord(conflict.meta) } : {}\n\t\t}))) } : {}\n\t});\n}\nfunction plannerFailure(conflicts) {\n\treturn Object.freeze({\n\t\tkind: \"failure\",\n\t\tconflicts: Object.freeze(conflicts.map((conflict) => Object.freeze({\n\t\t\tkind: conflict.kind,\n\t\t\tsummary: conflict.summary,\n\t\t\t...conflict.why ? { why: conflict.why } : {},\n\t\t\t...conflict.location ? { location: Object.freeze({ ...conflict.location }) } : {},\n\t\t\t...conflict.meta ? { meta: cloneRecord(conflict.meta) } : {}\n\t\t})))\n\t});\n}\n/**\n* Creates a successful migration runner result.\n*/\nfunction runnerSuccess(value) {\n\treturn ok(Object.freeze({\n\t\toperationsPlanned: value.operationsPlanned,\n\t\toperationsExecuted: value.operationsExecuted\n\t}));\n}\n/**\n* Creates a failed migration runner result.\n*/\nfunction runnerFailure(code, summary, options) {\n\treturn notOk(Object.freeze({\n\t\tcode,\n\t\tsummary,\n\t\t...options?.why ? { why: options.why } : {},\n\t\t...options?.meta ? { meta: cloneRecord(options.meta) } : {}\n\t}));\n}\n//#endregion\n//#region src/core/migrations/policies.ts\n/**\n* Policy used by `db init`: additive-only operations, no widening/destructive steps.\n*/\nconst INIT_ADDITIVE_POLICY = Object.freeze({ allowedOperationClasses: Object.freeze([\"additive\"]) });\n//#endregion\n//#region src/core/migrations/table-name-case-guard.ts\nconst TABLE_NAME_CASE_CHANGED_CODE = \"MIGRATION.TABLE_NAME_CASE_CHANGED\";\nfunction lowerFirst(value) {\n\treturn value.charAt(0).toLowerCase() + value.slice(1);\n}\nfunction plannedTable(node, namespaceId) {\n\treturn {\n\t\tnamespaceId,\n\t\ttableName: node.name\n\t};\n}\n/**\n* Finds every (drop `X`, create `Y`) pair in the same namespace where `X` is\n* `Y` with its first letter lowered. That shape is the signature of a schema\n* upgraded across the release in which a model with no `@@map` stopped\n* lowering the first letter of its table name: planning it would drop the\n* user's table and recreate it empty. Columns are deliberately not compared,\n* so a user who also changed a field in the same upgrade is still protected.\n*\n* Returns one conflict per pair, carrying `MIGRATION.TABLE_NAME_CASE_CHANGED`\n* in `meta.code`, or an empty array when the plan has no such pair.\n*/\nfunction detectTableNameCaseChanges(input) {\n\tconst dropped = [];\n\tconst created = [];\n\tfor (const issue of input.issues) {\n\t\tconst outcome = issueOutcome(issue);\n\t\tif (outcome === \"not-equal\") continue;\n\t\tconst table = input.tableOf(issue);\n\t\tif (table === void 0) continue;\n\t\t(outcome === \"not-expected\" ? dropped : created).push(plannedTable(table, input.namespaceIdOf(issue)));\n\t}\n\tconst conflicts = [];\n\tfor (const create of created) {\n\t\tconst drop = dropped.find((candidate) => candidate.namespaceId === create.namespaceId && candidate.tableName === lowerFirst(create.tableName));\n\t\tif (drop === void 0) continue;\n\t\tconflicts.push({\n\t\t\tkind: \"tableNameCaseChanged\",\n\t\t\tsummary: `${TABLE_NAME_CASE_CHANGED_CODE}: table \"${create.tableName}\" would be created and table \"${drop.tableName}\" dropped. Prisma 8 changed the default table name: a model with no @@map now names its table verbatim, so model ${create.tableName} points at \"${create.tableName}\" instead of \"${drop.tableName}\".`,\n\t\t\twhy: `To keep table \"${drop.tableName}\" and its rows, add @@map(\"${drop.tableName}\") to model ${create.tableName} (or run the add-model-map codemod over the schema) and plan again. Prisma 8 has no rename-table operation, so a deliberate rename is done by hand: run ALTER TABLE \"${drop.tableName}\" RENAME TO \"${create.tableName}\" (schema-qualified where applicable), after which the plan is empty.`,\n\t\t\tlocation: {\n\t\t\t\tnamespaceId: create.namespaceId,\n\t\t\t\tentityKind: \"table\",\n\t\t\t\tentityName: create.tableName\n\t\t\t},\n\t\t\tmeta: {\n\t\t\t\tcode: TABLE_NAME_CASE_CHANGED_CODE,\n\t\t\t\tdroppedTable: drop.tableName,\n\t\t\t\tcreatedTable: create.tableName\n\t\t\t}\n\t\t});\n\t}\n\treturn conflicts;\n}\n//#endregion\n//#region src/core/timestamp-now-generator.ts\nfunction temporalStringAuthoringPresets(input) {\n\tconst presets = temporalAuthoringPresets(input);\n\treturn {\n\t\tcreatedAtString: presets.createdAt,\n\t\tupdatedAtString: presets.updatedAt\n\t};\n}\nconst TEMPORAL_PRECISION_ARG = {\n\tname: \"precision\",\n\tkind: \"number\",\n\toptional: true,\n\tinteger: true,\n\tminimum: 0\n};\n/**\n* Builds a `temporal.<codec>` field preset for a codec that takes a precision\n* parameter (`pg/timestamp-temporal@1`, `pg/timestamptz-temporal@1`). Arguments change field\n* properties only — never the codec, which the caller fixes here.\n*\n* All three arguments are optional: omitting `precision` omits `typeParams`\n* entirely, and omitting a phase omits that phase (both omitted omits\n* `executionDefaults`).\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction temporalCodecPresetWithPrecision(input) {\n\tconst generatorId = input.generatorId ?? TIMESTAMP_NOW_GENERATOR_ID;\n\treturn {\n\t\tkind: \"fieldPreset\",\n\t\targs: [\n\t\t\tTEMPORAL_PRECISION_ARG,\n\t\t\tTEMPORAL_ON_CREATE_ARG,\n\t\t\tTEMPORAL_ON_UPDATE_ARG\n\t\t],\n\t\toutput: {\n\t\t\tcodecId: input.codecId,\n\t\t\tnativeType: input.nativeType,\n\t\t\ttypeParams: { precision: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} },\n\t\t\texecutionDefaults: {\n\t\t\t\tonCreate: temporalPhaseTemplate(1, generatorId),\n\t\t\t\tonUpdate: temporalPhaseTemplate(2, generatorId)\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\n//#region src/exports/control.ts\nvar control_default = new SqlFamilyDescriptor();\n//#endregion\nexport { INIT_ADDITIVE_POLICY, TABLE_NAME_CASE_CHANGED_CODE, assembleAuthoringContributions, buildDataTypeResolver, buildNativeTypeExpander, checkSqlDefaultBody, contractNamespaceToSchemaIR, contractToSchemaIR, controlPolicyForCall, createMigrationPlan, control_default as default, detectDestructiveChanges, detectTableNameCaseChanges, extractCodecControlHooks, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventOperations, plannerFailure, plannerSuccess, runnerFailure, runnerSuccess, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAS,eAAe,cAAc;CACrC,MAAM,UAAU,aAAa,KAAK,CAAC,CAAC,YAAY;CAChD,OAAO,QAAQ,WAAW,SAAS,KAAK,QAAQ,WAAW,QAAQ,KAAK,QAAQ,WAAW,OAAO;AACnG;AACA,SAAS,gBAAgB,WAAW;CACnC,MAAM,UAAU,QAAQ,IAAI,WAAW,SAAS;CAChD,IAAI,CAAC,MAAM,QAAQ,OAAO,GAAG,OAAO;CACpC,OAAO,QAAQ,OAAO,SAAS,OAAO,SAAS,YAAY,SAAS,QAAQ,SAAS,IAAI;AAC1F;;;;;AAKA,SAAS,cAAc,YAAY;CAClC,MAAM,aAAa,CAAC;CACpB,KAAK,MAAM,aAAa,YAAY;EACnC,IAAI,CAAC,gBAAgB,SAAS,GAAG;EACjC,KAAK,MAAM,QAAQ,UAAU,SAAS,IAAI,OAAO,KAAK,QAAQ,YAAY,eAAe,KAAK,GAAG,GAAG,WAAW,KAAK,KAAK,IAAI,KAAK,CAAC;CACpI;CACA,OAAO;AACR;;;;;AAKA,SAAS,uBAAuB,YAAY;CAC3C,OAAO,EAAE,YAAY,cAAc,UAAU,CAAC,CAAC,KAAK,UAAU;EAC7D;EACA,UAAU;CACX,EAAE,EAAE;AACL;AAGA,SAAS,gCAAgC,UAAU,WAAW;CAC7D,OAAO,eAAe,sCAAsC,eAAe,SAAS,4BAA4B,UAAU,wBAAwB;EACjJ,KAAK,iDAAiD,UAAU;EAChE,KAAK,4DAA4D,UAAU;EAC3E,MAAM;GACL;GACA;EACD;CACD,CAAC;AACF;AACA,SAAS,gCAAgC,UAAU;CAClD,MAAM,0BAA0B,IAAI,I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