@prisma/orm-family-sql 8.0.0-rc.18-dev.30 → 8.0.0-rc.18-dev.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/dist/{ast-CBO3PEJF.mjs → ast-BJs2669T.mjs} +47 -12
  2. package/dist/ast-BJs2669T.mjs.map +1 -0
  3. package/dist/{ast-Cq7uhA86.d.mts → ast-DB7g9Mh2.d.mts} +29 -2
  4. package/dist/ast-DB7g9Mh2.d.mts.map +1 -0
  5. package/dist/builder.d.mts +1 -1
  6. package/dist/builder__runtime.d.mts +1 -1
  7. package/dist/builder__runtime.mjs +1 -1
  8. package/dist/builder__types.d.mts +1 -1
  9. package/dist/{config-types-vu5fTaRa.mjs → config-types-BkcCqeAg.mjs} +2 -2
  10. package/dist/{config-types-vu5fTaRa.mjs.map → config-types-BkcCqeAg.mjs.map} +1 -1
  11. package/dist/{contract-builder-DmX4XnJa.mjs → contract-builder-D3XaKpyw.mjs} +3 -3
  12. package/dist/{contract-builder-DmX4XnJa.mjs.map → contract-builder-D3XaKpyw.mjs.map} +1 -1
  13. package/dist/contract-prisma7__provider.mjs +6 -6
  14. package/dist/contract-psl.mjs +1 -1
  15. package/dist/contract-psl__attribute-specs.mjs +1 -1
  16. package/dist/contract-psl__diagnostics.mjs +1 -1
  17. package/dist/contract-psl__provider.mjs +2 -2
  18. package/dist/contract-ts.mjs +3 -3
  19. package/dist/contract-ts__config-types.mjs +1 -1
  20. package/dist/contract-ts__contract-builder.mjs +2 -2
  21. package/dist/contract.d.mts +3 -3
  22. package/dist/contract.mjs +6 -6
  23. package/dist/contract__data-type.d.mts +2 -2
  24. package/dist/contract__data-type.mjs +3 -3
  25. package/dist/contract__foreign-key-materialization.d.mts +1 -1
  26. package/dist/contract__foreign-key-materialization.mjs +2 -2
  27. package/dist/contract__validators.mjs +1 -1
  28. package/dist/{control-B8tb6SEt.d.mts → control-Db07JiRl.d.mts} +24 -7
  29. package/dist/control-Db07JiRl.d.mts.map +1 -0
  30. package/dist/{control-DNE-Chse.mjs → control-DbHnaxDE.mjs} +10 -9
  31. package/dist/control-DbHnaxDE.mjs.map +1 -0
  32. package/dist/{control-adapter-DhX77V61.mjs → control-adapter-BX5COBWO.mjs} +2 -2
  33. package/dist/{control-adapter-DhX77V61.mjs.map → control-adapter-BX5COBWO.mjs.map} +1 -1
  34. package/dist/{control-adapter-Bn0uhplA-rhq_JtYp.d.mts → control-adapter-Bn0uhplA-BnsQY8_q.d.mts} +4 -4
  35. package/dist/{control-adapter-Bn0uhplA-rhq_JtYp.d.mts.map → control-adapter-Bn0uhplA-BnsQY8_q.d.mts.map} +1 -1
  36. package/dist/{control-adapter-RwLtGiwa.d.mts → control-adapter-DgxEVzhZ.d.mts} +4 -4
  37. package/dist/{control-adapter-RwLtGiwa.d.mts.map → control-adapter-DgxEVzhZ.d.mts.map} +1 -1
  38. package/dist/{data-type-C84xngfv.d.mts → data-type-DMk-fLAZ.d.mts} +38 -8
  39. package/dist/data-type-DMk-fLAZ.d.mts.map +1 -0
  40. package/dist/data-type-HNhSslwG.mjs +67 -0
  41. package/dist/data-type-HNhSslwG.mjs.map +1 -0
  42. package/dist/{db-BmrN9nRS-BzK96yVh.d.mts → db-BmrN9nRS-BGnRxI7X.d.mts} +2 -2
  43. package/dist/{db-BmrN9nRS-BzK96yVh.d.mts.map → db-BmrN9nRS-BGnRxI7X.d.mts.map} +1 -1
  44. package/dist/{derived-checks-CdPHpJSv-B7Bgj3Ao.mjs → derived-checks-B1qNxwBL-DFoGexId.mjs} +17 -5
  45. package/dist/derived-checks-B1qNxwBL-DFoGexId.mjs.map +1 -0
  46. package/dist/{diagnostics-C8YevjSU.mjs → diagnostics-xqFRhSin.mjs} +2 -2
  47. package/dist/{diagnostics-C8YevjSU.mjs.map → diagnostics-xqFRhSin.mjs.map} +1 -1
  48. package/dist/{diff-B9Z47nHf.d.mts → diff-BN_3K9lv.d.mts} +5 -5
  49. package/dist/{diff-B9Z47nHf.d.mts.map → diff-BN_3K9lv.d.mts.map} +1 -1
  50. package/dist/family.d.mts +10 -10
  51. package/dist/family.mjs +8 -8
  52. package/dist/family__control-adapter.d.mts +2 -2
  53. package/dist/family__control-adapter.mjs +1 -1
  54. package/dist/family__control.d.mts +3 -3
  55. package/dist/family__control.mjs +3 -3
  56. package/dist/family__diff.d.mts +1 -1
  57. package/dist/family__diff.mjs +1 -1
  58. package/dist/family__ir.mjs +1 -1
  59. package/dist/family__migration.d.mts +1 -1
  60. package/dist/family__pack.d.mts +1 -1
  61. package/dist/family__pack.mjs +2 -2
  62. package/dist/family__pack.mjs.map +1 -1
  63. package/dist/family__psl-build.d.mts +1 -1
  64. package/dist/family__psl-build.mjs +1 -1
  65. package/dist/family__psl-infer.d.mts +1 -1
  66. package/dist/family__psl-infer.mjs +1 -1
  67. package/dist/{foreign-key-materialization-C_FPLzj3.mjs → foreign-key-materialization-BPQqd0qF.mjs} +2 -2
  68. package/dist/{foreign-key-materialization-C_FPLzj3.mjs.map → foreign-key-materialization-BPQqd0qF.mjs.map} +1 -1
  69. package/dist/{foreign-key-materialization-3vQnPT_D.d.mts → foreign-key-materialization-bL-t2oPB.d.mts} +3 -3
  70. package/dist/{foreign-key-materialization-3vQnPT_D.d.mts.map → foreign-key-materialization-bL-t2oPB.d.mts.map} +1 -1
  71. package/dist/{generator-functions-B4gRRYZB-BTtC2KQz.mjs → generator-functions-BoE7Lc9d-MgcgdnPZ.mjs} +37 -20
  72. package/dist/generator-functions-BoE7Lc9d-MgcgdnPZ.mjs.map +1 -0
  73. package/dist/{index-B0hZw3uT.d.mts → index-Bw9Y19Js.d.mts} +3 -3
  74. package/dist/{index-B0hZw3uT.d.mts.map → index-Bw9Y19Js.d.mts.map} +1 -1
  75. package/dist/{index-equivalence-DswCiq5l-C6SAs-Yz.mjs → index-equivalence-DswCiq5l-D5VK0qTy.mjs} +2 -2
  76. package/dist/{index-equivalence-DswCiq5l-C6SAs-Yz.mjs.map → index-equivalence-DswCiq5l-D5VK0qTy.mjs.map} +1 -1
  77. package/dist/{interpreter-Bk0xpelv-BifV9Yib.mjs → interpreter-Bk0xpelv-4laiO5dH.mjs} +4 -4
  78. package/dist/{interpreter-Bk0xpelv-BifV9Yib.mjs.map → interpreter-Bk0xpelv-4laiO5dH.mjs.map} +1 -1
  79. package/dist/{migration-CSv3UpiC.d.mts → migration-go6YP7-v.d.mts} +2 -2
  80. package/dist/{migration-CSv3UpiC.d.mts.map → migration-go6YP7-v.d.mts.map} +1 -1
  81. package/dist/orm-client.d.mts +3 -3
  82. package/dist/orm-client.mjs +1 -1
  83. package/dist/{pack-COEyiyfL.d.mts → pack-DXEOdHaM.d.mts} +18 -1
  84. package/dist/pack-DXEOdHaM.d.mts.map +1 -0
  85. package/dist/{psl-build-BkxAXTwj.mjs → psl-build-BYqCjsqi.mjs} +4 -4
  86. package/dist/psl-build-BYqCjsqi.mjs.map +1 -0
  87. package/dist/{psl-build-O7_tXQ1E.d.mts → psl-build-C41KHJL_.d.mts} +4 -4
  88. package/dist/{psl-build-O7_tXQ1E.d.mts.map → psl-build-C41KHJL_.d.mts.map} +1 -1
  89. package/dist/{psl-field-resolution-BET6wtHZ-CX2xL99Q.mjs → psl-field-resolution-BET6wtHZ-C_hO6YE1.mjs} +3 -3
  90. package/dist/{psl-field-resolution-BET6wtHZ-CX2xL99Q.mjs.map → psl-field-resolution-BET6wtHZ-C_hO6YE1.mjs.map} +1 -1
  91. package/dist/{psl-infer-I75woGr4.d.mts → psl-infer-CALmBIqX.d.mts} +3 -3
  92. package/dist/{psl-infer-I75woGr4.d.mts.map → psl-infer-CALmBIqX.d.mts.map} +1 -1
  93. package/dist/{psl-infer-Bz34csvN.mjs → psl-infer-CaEnF_x3.mjs} +2 -2
  94. package/dist/{psl-infer-Bz34csvN.mjs.map → psl-infer-CaEnF_x3.mjs.map} +1 -1
  95. package/dist/relational-core.d.mts +2 -2
  96. package/dist/relational-core.mjs +2 -2
  97. package/dist/relational-core__ast.d.mts +2 -2
  98. package/dist/relational-core__ast.mjs +2 -2
  99. package/dist/runtime.d.mts +3 -3
  100. package/dist/runtime__internal__prepared-query.d.mts +1 -1
  101. package/dist/{schema-differ-DmP74bB8-CIQ17HTk.d.mts → schema-differ-DmP74bB8-BfEQ_9cY.d.mts} +3 -3
  102. package/dist/{schema-differ-DmP74bB8-CIQ17HTk.d.mts.map → schema-differ-DmP74bB8-BfEQ_9cY.d.mts.map} +1 -1
  103. package/dist/schema-ir.d.mts +1 -1
  104. package/dist/schema-ir.mjs +1 -1
  105. package/dist/schema-ir__types.d.mts +2 -2
  106. package/dist/schema-ir__types.mjs +1 -1
  107. package/dist/{schema-verify-BwRdzbHb-nDeE75xa.mjs → schema-verify-BwRdzbHb-BzdgK4xv.mjs} +2 -2
  108. package/dist/{schema-verify-BwRdzbHb-nDeE75xa.mjs.map → schema-verify-BwRdzbHb-BzdgK4xv.mjs.map} +1 -1
  109. package/dist/{sql-contract-serializer-sMY3prTx-BT6HdXAE.mjs → sql-contract-serializer-sMY3prTx-D-xfnqyD.mjs} +2 -2
  110. package/dist/{sql-contract-serializer-sMY3prTx-BT6HdXAE.mjs.map → sql-contract-serializer-sMY3prTx-D-xfnqyD.mjs.map} +1 -1
  111. package/dist/{sql-data-type-BSi0X331-OXbBFXDh.mjs → sql-data-type-D5cI3M07-DIcPP8s1.mjs} +26 -9
  112. package/dist/sql-data-type-D5cI3M07-DIcPP8s1.mjs.map +1 -0
  113. package/dist/{transaction-state-DR3nKTmH-DbyhuL-z.d.mts → transaction-state-DR3nKTmH-D_pb9QgR.d.mts} +2 -2
  114. package/dist/{transaction-state-DR3nKTmH-DbyhuL-z.d.mts.map → transaction-state-DR3nKTmH-D_pb9QgR.d.mts.map} +1 -1
  115. package/dist/types-D_nlUp-1.d.mts +1 -0
  116. package/dist/{types-B3AHHPDh-BHh-89fY.d.mts → types-DiD6BqoN-ZF53hwPp.d.mts} +11 -3
  117. package/dist/types-DiD6BqoN-ZF53hwPp.d.mts.map +1 -0
  118. package/dist/{types-DlFdMaDJ-DekbNgDh.d.mts → types-DlFdMaDJ-BEDwj-Qv.d.mts} +4 -4
  119. package/dist/{types-DlFdMaDJ-DekbNgDh.d.mts.map → types-DlFdMaDJ-BEDwj-Qv.d.mts.map} +1 -1
  120. package/dist/{types-egs_vme1-DRhYFwIT.mjs → types-DoyiTsjg-DDTmYyNY.mjs} +22 -2
  121. package/dist/types-DoyiTsjg-DDTmYyNY.mjs.map +1 -0
  122. package/dist/{validators-BCRydDG7.mjs → validators-BlONfdFH.mjs} +3 -3
  123. package/dist/{validators-BCRydDG7.mjs.map → validators-BlONfdFH.mjs.map} +1 -1
  124. package/package.json +18 -18
  125. package/dist/ast-CBO3PEJF.mjs.map +0 -1
  126. package/dist/ast-Cq7uhA86.d.mts.map +0 -1
  127. package/dist/control-B8tb6SEt.d.mts.map +0 -1
  128. package/dist/control-DNE-Chse.mjs.map +0 -1
  129. package/dist/data-type-C84xngfv.d.mts.map +0 -1
  130. package/dist/data-type-DKk8Unnz.mjs +0 -20
  131. package/dist/data-type-DKk8Unnz.mjs.map +0 -1
  132. package/dist/derived-checks-CdPHpJSv-B7Bgj3Ao.mjs.map +0 -1
  133. package/dist/generator-functions-B4gRRYZB-BTtC2KQz.mjs.map +0 -1
  134. package/dist/pack-COEyiyfL.d.mts.map +0 -1
  135. package/dist/psl-build-BkxAXTwj.mjs.map +0 -1
  136. package/dist/sql-data-type-BSi0X331-OXbBFXDh.mjs.map +0 -1
  137. package/dist/types-B3AHHPDh-BHh-89fY.d.mts.map +0 -1
  138. package/dist/types-BGERR8XF.d.mts +0 -1
  139. package/dist/types-egs_vme1-DRhYFwIT.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"diff-B9Z47nHf.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/diff.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;iBAkBiB,+BAA+B,OAAO,iBAAiB,gBAAgB,qBAAqB,yBAAyB;;;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qBAAqB;;;;;;;;;iBAS/B,sBAAsB,OAAO,6BAA6B;;;;;;;;;;;;;;iBAc1D,YAAY,sBAAsB"}
package/dist/family.d.mts CHANGED
@@ -1,17 +1,17 @@
1
1
  import { n as resolveStorageTable, t as ResolvedStorageTable } from "./resolve-storage-table-8N2xelSh.mjs";
2
2
  import { h as checkSqlDefaultText } from "./validators-CTZ-hU2l.mjs";
3
- import { n as Lowerer, r as SqlControlAdapter, t as ExecuteRequestLowerer } from "./control-adapter-Bn0uhplA-rhq_JtYp.mjs";
4
- import { A as StorageTypePlanResult, C as SqlPlanTargetDetails, D as SqlPlannerFailureResult, E as SqlPlannerConflictLocation, O as SqlPlannerResult, S as SqlMigrationRunnerSuccessValue, T as SqlPlannerConflictKind, _ as SqlMigrationRunnerErrorCode, a as FieldEventContext, b as SqlMigrationRunnerFailure, c as SqlControlExtensionDescriptor, d as SqlMigrationPlanOperation, f as SqlMigrationPlanOperationStep, g as SqlMigrationRunner, h as SqlMigrationPlannerPlanOptions, i as FieldEvent, k as SqlPlannerSuccessResult, l as SqlMigrationPlan, m as SqlMigrationPlanner, n as CodecControlHooks, o as ResolveIdentityValueInput, p as SqlMigrationPlanOperationTarget, r as CreateSqlMigrationPlanOptions, s as SqlControlAdapterDescriptor, u as SqlMigrationPlanContractInfo, v as SqlMigrationRunnerExecuteCallbacks, w as SqlPlannerConflict, x as SqlMigrationRunnerResult, y as SqlMigrationRunnerExecuteOptions } from "./types-DlFdMaDJ-DekbNgDh.mjs";
5
- import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DmP74bB8-CIQ17HTk.mjs";
6
- import { $ as TableRenameByHand, A as ReadColumnDefault, At as plannerSuccess, B as SqlDescribedContractSpace, Bt as runnerFailure, C as MigrationPlannerConflict, Ct as modelRenameStorageEffect, D as NoTable, Dt as planFieldEventOperations, E as ModelTable, Et as planFieldEventCalls, F as RequiredColumnMark, Ft as requiredColumnsOfMigration, G as SqlTextSources, Gt as storageNameOfOperation, H as SqlQuote, Ht as slotSource, I as SchemaTables, It as resolveColumnRenameAgainst, J as SubjectStorage, Jt as temporalStringAuthoringPresets, K as StatementColumn, Kt as subjectsOfCalls, L as SingleOperationCall, Lt as resolveTableRenameAgainst, M as ReportedBody, Mt as readReportedDefault, N as ReportedLiteralDefault, Nt as requiredColumnMeta, O as PlanFieldEventOperationsOptions, Ot as planStatements, P as RequiredColumn, Pt as requiredColumnOf, Q as TableRename, Qt as unmatchedTableRename, R as SqlControlFamilyInstance, Rt as rowsWithoutValueFailure, S as MigrationPlanner, St as isUnfilledSlot, T as ModelStorageEffect, Tt as partitionIssuesByControlPolicy, U as SqlQuotingRules, Ut as sqlOfSlot, V as SqlPslBuildContext, Vt as runnerSuccess, W as SqlSlot, Wt as sqlTypeLookupsOf, X as TABLE_NAME_CASE_CHANGED_CODE, Xt as unknownCallNames, Y as SuppressionRecord, Yt as unconvertedFieldOf, Z as TableNameCaseGuardTable, Zt as unmatchedColumnRename, _ as INIT_ADDITIVE_POLICY, _t as extractCodecControlHooks, a as ColumnRename, at as backfillOfDefaultedField, b as MigrationPlan, bt as fieldRenameStorageEffect, c as ContractColumns, ct as contractColumns, d as ConvertedColumn, dt as convertedColumnMeta, et as TableRenameRequest, f as DefaultResolver, ft as convertedColumnOf, g as FieldStorageEffect, gt as detectTableNameCaseChanges, h as FieldStatementColumns, ht as detectDestructiveChanges, i as ColumnOnOneSide, it as assembleAuthoringContributions, j as ReadReportedDefault, jt as readColumnDefault, k as PlannedStatements, kt as plannerFailure, l as ContractToSchemaIROptions, lt as contractNamespaceToSchemaIR, m as FieldEventCall, mt as createSqlTextSources, n as CallSubjects, o as ColumnRenameRequest, ot as checkSqlExpressionText, p as DefaultResolverColumn, pt as createMigrationPlan, q as StatementPlanningTarget, qt as temporalCodecPresetWithPrecision, r as CallWithCompanions, rt as appliedStatementsInOrder, s as ContractColumn, st as columnTakesTemporaryValue, t as COLUMN_RENAME_UNMATCHED_CODE, tt as TargetMigrationsCapability, u as ControlPolicySubject, ut as contractToSchemaIR, v as MigrationOperationClass, vt as fieldEventStorage, w as MigrationPlannerResult, wt as partitionCallsByControlPolicy, x as MigrationPlanOperation, xt as fieldStatementColumns, y as MigrationOperationPolicy, yt as fieldOfColumn, z as SqlControlTargetDescriptor, zt as rowsWithoutValueSummary } from "./control-B8tb6SEt.mjs";
7
- import { t as resolveIntrospectedColumnType } from "./control-adapter-RwLtGiwa.mjs";
8
- import { a as VerifySqlSchemaByDiffInput, c as classifySqlDiffIssue, d as verifySqlSchemaByDiff, i as StorageTypeVerdictInput, l as computeSqlDiffVerdict, n as SqlDiffVerdictInput, o as arraysEqual, r as StorageTypeVerdict, s as classifyDiffSubjectGranularity, t as SqlDiffVerdict, u as computeStorageTypeVerdict } from "./diff-B9Z47nHf.mjs";
3
+ import { n as Lowerer, r as SqlControlAdapter, t as ExecuteRequestLowerer } from "./control-adapter-Bn0uhplA-BnsQY8_q.mjs";
4
+ import { A as StorageTypePlanResult, C as SqlPlanTargetDetails, D as SqlPlannerFailureResult, E as SqlPlannerConflictLocation, O as SqlPlannerResult, S as SqlMigrationRunnerSuccessValue, T as SqlPlannerConflictKind, _ as SqlMigrationRunnerErrorCode, a as FieldEventContext, b as SqlMigrationRunnerFailure, c as SqlControlExtensionDescriptor, d as SqlMigrationPlanOperation, f as SqlMigrationPlanOperationStep, g as SqlMigrationRunner, h as SqlMigrationPlannerPlanOptions, i as FieldEvent, k as SqlPlannerSuccessResult, l as SqlMigrationPlan, m as SqlMigrationPlanner, n as CodecControlHooks, o as ResolveIdentityValueInput, p as SqlMigrationPlanOperationTarget, r as CreateSqlMigrationPlanOptions, s as SqlControlAdapterDescriptor, u as SqlMigrationPlanContractInfo, v as SqlMigrationRunnerExecuteCallbacks, w as SqlPlannerConflict, x as SqlMigrationRunnerResult, y as SqlMigrationRunnerExecuteOptions } from "./types-DlFdMaDJ-BEDwj-Qv.mjs";
5
+ import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DmP74bB8-BfEQ_9cY.mjs";
6
+ import { $ as TableRenameByHand, A as ReadColumnDefault, At as plannerSuccess, B as SqlDescribedContractSpace, Bt as runnerFailure, C as MigrationPlannerConflict, Ct as modelRenameStorageEffect, D as NoTable, Dt as planFieldEventOperations, E as ModelTable, Et as planFieldEventCalls, F as RequiredColumnMark, Ft as requiredColumnsOfMigration, G as SqlTextSources, Gt as storageNameOfOperation, H as SqlQuote, Ht as slotSource, I as SchemaTables, It as resolveColumnRenameAgainst, J as SubjectStorage, Jt as temporalStringAuthoringPresets, K as StatementColumn, Kt as subjectsOfCalls, L as SingleOperationCall, Lt as resolveTableRenameAgainst, M as ReportedBody, Mt as readReportedDefault, N as ReportedLiteralDefault, Nt as requiredColumnMeta, O as PlanFieldEventOperationsOptions, Ot as planStatements, P as RequiredColumn, Pt as requiredColumnOf, Q as TableRename, Qt as unmatchedTableRename, R as SqlControlFamilyInstance, Rt as rowsWithoutValueFailure, S as MigrationPlanner, St as isUnfilledSlot, T as ModelStorageEffect, Tt as partitionIssuesByControlPolicy, U as SqlQuotingRules, Ut as sqlOfSlot, V as SqlPslBuildContext, Vt as runnerSuccess, W as SqlSlot, Wt as sqlTypeLookupsOf, X as TABLE_NAME_CASE_CHANGED_CODE, Xt as unknownCallNames, Y as SuppressionRecord, Yt as unconvertedFieldOf, Z as TableNameCaseGuardTable, Zt as unmatchedColumnRename, _ as INIT_ADDITIVE_POLICY, _t as extractCodecControlHooks, a as ColumnRename, at as backfillOfDefaultedField, b as MigrationPlan, bt as fieldRenameStorageEffect, c as ContractColumns, ct as contractColumns, d as ConvertedColumn, dt as convertedColumnMeta, et as TableRenameRequest, f as DefaultResolver, ft as convertedColumnOf, g as FieldStorageEffect, gt as detectTableNameCaseChanges, h as FieldStatementColumns, ht as detectDestructiveChanges, i as ColumnOnOneSide, it as assembleAuthoringContributions, j as ReadReportedDefault, jt as readColumnDefault, k as PlannedStatements, kt as plannerFailure, l as ContractToSchemaIROptions, lt as contractNamespaceToSchemaIR, m as FieldEventCall, mt as createSqlTextSources, n as CallSubjects, o as ColumnRenameRequest, ot as checkSqlExpressionText, p as DefaultResolverColumn, pt as createMigrationPlan, q as StatementPlanningTarget, qt as temporalCodecPresetWithPrecision, r as CallWithCompanions, rt as appliedStatementsInOrder, s as ContractColumn, st as columnTakesTemporaryValue, t as COLUMN_RENAME_UNMATCHED_CODE, tt as TargetMigrationsCapability, u as ControlPolicySubject, ut as contractToSchemaIR, v as MigrationOperationClass, vt as fieldEventStorage, w as MigrationPlannerResult, wt as partitionCallsByControlPolicy, x as MigrationPlanOperation, xt as fieldStatementColumns, y as MigrationOperationPolicy, yt as fieldOfColumn, z as SqlControlTargetDescriptor, zt as rowsWithoutValueSummary } from "./control-Db07JiRl.mjs";
7
+ import { t as resolveIntrospectedColumnType } from "./control-adapter-DgxEVzhZ.mjs";
8
+ import { a as VerifySqlSchemaByDiffInput, c as classifySqlDiffIssue, d as verifySqlSchemaByDiff, i as StorageTypeVerdictInput, l as computeSqlDiffVerdict, n as SqlDiffVerdictInput, o as arraysEqual, r as StorageTypeVerdict, s as classifyDiffSubjectGranularity, t as SqlDiffVerdict, u as computeStorageTypeVerdict } from "./diff-BN_3K9lv.mjs";
9
9
  import { i as SqlSchemaVerifierBase, n as SqlContractSerializerBase, r as SqlEntityHydrationFactory, t as SqlContractSerializer } from "./ir-qK4wX3D3.mjs";
10
- import { t as SqlMigration } from "./migration-CSv3UpiC.mjs";
11
- import { t as idGeneratorFunctionBindings } from "./pack-COEyiyfL.mjs";
10
+ import { t as SqlMigration } from "./migration-go6YP7-v.mjs";
11
+ import { t as idGeneratorFunctionBindings } from "./pack-DXEOdHaM.mjs";
12
12
  import { n as DefaultMappingResult, r as mapDefault, t as DefaultMappingOptions } from "./default-mapping-CEISdj2g-DF1LzGBR.mjs";
13
- import { a as InferredTypeConstructors, c as PslTypeCall, d as inferColumnTypes, f as inferredTypeConstructors, i as InferredTypeConstructor, l as fewestArgumentsCall, m as toEnumMemberName, n as GeneratorCallRefusal, o as IntrospectedTable, p as pslTypeArgumentText, r as GeneratorCallsResult, s as PhaseCallText, t as ColumnTypeOf, u as generatorCallsFor } from "./psl-build-O7_tXQ1E.mjs";
14
- import { a as buildChildRelationField, c as inferRelations, d as toFieldName, f as toModelName, i as RelationField, l as pluralize, n as InferredRelations, o as deriveBackRelationFieldName, r as PslPrinterOptions, s as deriveRelationFieldName, t as EnumInfo, u as toEnumName } from "./psl-infer-I75woGr4.mjs";
13
+ import { a as InferredTypeConstructors, c as PslTypeCall, d as inferColumnTypes, f as inferredTypeConstructors, i as InferredTypeConstructor, l as fewestArgumentsCall, m as toEnumMemberName, n as GeneratorCallRefusal, o as IntrospectedTable, p as pslTypeArgumentText, r as GeneratorCallsResult, s as PhaseCallText, t as ColumnTypeOf, u as generatorCallsFor } from "./psl-build-C41KHJL_.mjs";
14
+ import { a as buildChildRelationField, c as inferRelations, d as toFieldName, f as toModelName, i as RelationField, l as pluralize, n as InferredRelations, o as deriveBackRelationFieldName, r as PslPrinterOptions, s as deriveRelationFieldName, t as EnumInfo, u as toEnumName } from "./psl-infer-CALmBIqX.mjs";
15
15
  import { a as timestampNowRuntimeGenerator, n as UNBOUND_DOMAIN_NAMESPACE_ID, r as resolveDomainModel, t as ResolvedDomainModel } from "./runtime-BlUQqGCH.mjs";
16
16
  import { n as parseContractMarkerRow, t as ContractMarkerRow } from "./verify-zDRnw0Rn.mjs";
17
17
  export { COLUMN_RENAME_UNMATCHED_CODE, type CallSubjects, type CallWithCompanions, type CodecControlHooks, type ColumnOnOneSide, type ColumnRename, type ColumnRenameRequest, type ColumnTypeOf, type ContractColumn, type ContractColumns, type ContractMarkerRow, type ContractToSchemaIROptions, type ControlPolicySubject, type ConvertedColumn, type CreateSqlMigrationPlanOptions, type DefaultMappingOptions, type DefaultMappingResult, type DefaultResolver, type DefaultResolverColumn, type EnumInfo, type ExecuteRequestLowerer, type FieldEvent, type FieldEventCall, type FieldEventContext, type FieldStatementColumns, type FieldStorageEffect, type GeneratorCallRefusal, type GeneratorCallsResult, INIT_ADDITIVE_POLICY, type InferredRelations, type InferredTypeConstructor, type InferredTypeConstructors, type IntrospectedTable, type Lowerer, SqlMigration as Migration, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type ModelStorageEffect, type ModelTable, type NoTable, type PhaseCallText, type PlanFieldEventOperationsOptions, type PlannedStatements, type PslPrinterOptions, type PslTypeCall, type ReadColumnDefault, type ReadReportedDefault, type RelationField, type ReportedBody, type ReportedLiteralDefault, type RequiredColumn, type RequiredColumnMark, type ResolveIdentityValueInput, type ResolvedDomainModel, type ResolvedStorageTable, type SchemaTables, type SingleOperationCall, SqlContractSerializer, SqlContractSerializerBase, type SqlControlAdapter, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlDescribedContractSpace, type SqlDiffVerdict, type SqlDiffVerdictInput, type SqlEntityHydrationFactory, type SqlMigrationPlan, type SqlMigrationPlanContractInfo, type SqlMigrationPlanOperation, type SqlMigrationPlanOperationStep, type SqlMigrationPlanOperationTarget, type SqlMigrationPlanner, type SqlMigrationPlannerPlanOptions, type SqlMigrationRunner, type SqlMigrationRunnerErrorCode, type SqlMigrationRunnerExecuteCallbacks, type SqlMigrationRunnerExecuteOptions, type SqlMigrationRunnerFailure, type SqlMigrationRunnerResult, type SqlMigrationRunnerSuccessValue, type SqlPlanTargetDetails, type SqlPlannerConflict, type SqlPlannerConflictKind, type SqlPlannerConflictLocation, type SqlPlannerFailureResult, type SqlPlannerResult, type SqlPlannerSuccessResult, type SqlPslBuildContext, type SqlQuote, type SqlQuotingRules, type SqlSchemaDiffFn, type SqlSchemaDiffInput, type SqlSchemaDiffResult, SqlSchemaVerifierBase, type SqlSlot, type SqlTextSources, type StatementColumn, type StatementPlanningTarget, type StorageTypePlanResult, type StorageTypeVerdict, type StorageTypeVerdictInput, type SubjectStorage, type SuppressionRecord, TABLE_NAME_CASE_CHANGED_CODE, type TableNameCaseGuardTable, type TableRename, type TableRenameByHand, type TableRenameRequest, type TargetMigrationsCapability, UNBOUND_DOMAIN_NAMESPACE_ID, type VerifySqlSchemaByDiffInput, appliedStatementsInOrder, arraysEqual, assembleAuthoringContributions, backfillOfDefaultedField, buildChildRelationField, checkSqlDefaultText, checkSqlExpressionText, classifyDiffSubjectGranularity, classifySqlDiffIssue, columnTakesTemporaryValue, computeSqlDiffVerdict, computeStorageTypeVerdict, contractColumns, contractNamespaceToSchemaIR, contractToSchemaIR, convertedColumnMeta, convertedColumnOf, createMigrationPlan, createSqlTextSources, deriveBackRelationFieldName, deriveRelationFieldName, detectDestructiveChanges, detectTableNameCaseChanges, extractCodecControlHooks, fewestArgumentsCall, fieldEventStorage, fieldOfColumn, fieldRenameStorageEffect, fieldStatementColumns, generatorCallsFor, idGeneratorFunctionBindings, inferColumnTypes, inferRelations, inferredTypeConstructors, isUnfilledSlot, mapDefault, modelRenameStorageEffect, parseContractMarkerRow, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventCalls, planFieldEventOperations, planStatements, plannerFailure, plannerSuccess, pluralize, pslTypeArgumentText, readColumnDefault, readReportedDefault, requiredColumnMeta, requiredColumnOf, requiredColumnsOfMigration, resolveColumnRenameAgainst, resolveDomainModel, resolveIntrospectedColumnType, resolveStorageTable, resolveTableRenameAgainst, rowsWithoutValueFailure, rowsWithoutValueSummary, runnerFailure, runnerSuccess, slotSource, sqlOfSlot, sqlTypeLookupsOf, storageNameOfOperation, subjectsOfCalls, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets, timestampNowRuntimeGenerator, toEnumMemberName, toEnumName, toFieldName, toModelName, unconvertedFieldOf, unknownCallNames, unmatchedColumnRename, unmatchedTableRename, verifySqlSchemaByDiff };
package/dist/family.mjs CHANGED
@@ -1,16 +1,16 @@
1
1
  import { t as resolveStorageTable } from "./resolve-storage-table-DZsfnzeW.mjs";
2
- import { n as checkSqlDefaultText } from "./validators-BCRydDG7.mjs";
3
- import { t as idGeneratorFunctionBindings } from "./generator-functions-B4gRRYZB-BTtC2KQz.mjs";
4
- import { a as computeStorageTypeVerdict, c as verifySqlSchemaByDiff, i as computeSqlDiffVerdict, n as classifyDiffSubjectGranularity, r as classifySqlDiffIssue, s as extractCodecControlHooks } from "./schema-verify-BwRdzbHb-nDeE75xa.mjs";
5
- import { n as SqlContractSerializerBase, t as SqlContractSerializer } from "./sql-contract-serializer-sMY3prTx-BT6HdXAE.mjs";
2
+ import { n as checkSqlDefaultText } from "./validators-BlONfdFH.mjs";
3
+ import { t as idGeneratorFunctionBindings } from "./generator-functions-BoE7Lc9d-MgcgdnPZ.mjs";
4
+ import { a as computeStorageTypeVerdict, c as verifySqlSchemaByDiff, i as computeSqlDiffVerdict, n as classifyDiffSubjectGranularity, r as classifySqlDiffIssue, s as extractCodecControlHooks } from "./schema-verify-BwRdzbHb-BzdgK4xv.mjs";
5
+ import { n as SqlContractSerializerBase, t as SqlContractSerializer } from "./sql-contract-serializer-sMY3prTx-D-xfnqyD.mjs";
6
6
  import { n as parseContractMarkerRow } from "./verify-BVk5bjdH-dq5M4iIh.mjs";
7
- import { $ as unmatchedTableRename, A as plannerFailure, B as rowsWithoutValueSummary, C as isUnfilledSlot, D as planFieldEventCalls, E as partitionIssuesByControlPolicy, F as requiredColumnOf, G as sqlTypeLookupsOf, H as runnerSuccess, I as requiredColumnsOfMigration, J as temporalCodecPresetWithPrecision, K as storageNameOfOperation, L as resolveColumnRenameAgainst, M as readColumnDefault, N as readReportedDefault, O as planFieldEventOperations, P as requiredColumnMeta, Q as unmatchedColumnRename, R as resolveTableRenameAgainst, S as fieldStatementColumns, T as partitionCallsByControlPolicy, U as slotSource, V as runnerFailure, W as sqlOfSlot, X as unconvertedFieldOf, Y as temporalStringAuthoringPresets, Z as unknownCallNames, _ as detectDestructiveChanges, a as assembleAuthoringContributions, b as fieldOfColumn, c as columnTakesTemporaryValue, d as contractToSchemaIR, g as createSqlTextSources, h as createMigrationPlan, i as appliedStatementsInOrder, j as plannerSuccess, k as planStatements, l as contractColumns, m as convertedColumnOf, n as INIT_ADDITIVE_POLICY, o as backfillOfDefaultedField, p as convertedColumnMeta, q as subjectsOfCalls, r as TABLE_NAME_CASE_CHANGED_CODE, s as checkSqlExpressionText, t as COLUMN_RENAME_UNMATCHED_CODE, u as contractNamespaceToSchemaIR, v as detectTableNameCaseChanges, w as modelRenameStorageEffect, x as fieldRenameStorageEffect, y as fieldEventStorage, z as rowsWithoutValueFailure } from "./control-DNE-Chse.mjs";
8
- import { t as resolveIntrospectedColumnType } from "./control-adapter-DhX77V61.mjs";
7
+ import { $ as unmatchedTableRename, A as plannerFailure, B as rowsWithoutValueSummary, C as isUnfilledSlot, D as planFieldEventCalls, E as partitionIssuesByControlPolicy, F as requiredColumnOf, G as sqlTypeLookupsOf, H as runnerSuccess, I as requiredColumnsOfMigration, J as temporalCodecPresetWithPrecision, K as storageNameOfOperation, L as resolveColumnRenameAgainst, M as readColumnDefault, N as readReportedDefault, O as planFieldEventOperations, P as requiredColumnMeta, Q as unmatchedColumnRename, R as resolveTableRenameAgainst, S as fieldStatementColumns, T as partitionCallsByControlPolicy, U as slotSource, V as runnerFailure, W as sqlOfSlot, X as unconvertedFieldOf, Y as temporalStringAuthoringPresets, Z as unknownCallNames, _ as detectDestructiveChanges, a as assembleAuthoringContributions, b as fieldOfColumn, c as columnTakesTemporaryValue, d as contractToSchemaIR, g as createSqlTextSources, h as createMigrationPlan, i as appliedStatementsInOrder, j as plannerSuccess, k as planStatements, l as contractColumns, m as convertedColumnOf, n as INIT_ADDITIVE_POLICY, o as backfillOfDefaultedField, p as convertedColumnMeta, q as subjectsOfCalls, r as TABLE_NAME_CASE_CHANGED_CODE, s as checkSqlExpressionText, t as COLUMN_RENAME_UNMATCHED_CODE, u as contractNamespaceToSchemaIR, v as detectTableNameCaseChanges, w as modelRenameStorageEffect, x as fieldRenameStorageEffect, y as fieldEventStorage, z as rowsWithoutValueFailure } from "./control-DbHnaxDE.mjs";
8
+ import { t as resolveIntrospectedColumnType } from "./control-adapter-BX5COBWO.mjs";
9
9
  import { t as arraysEqual } from "./diff-DZ82XaGR.mjs";
10
10
  import { t as SqlSchemaVerifierBase } from "./ir-I-xciGUH.mjs";
11
11
  import { t as SqlMigration } from "./migration-Dy_4Wmiy.mjs";
12
12
  import { s as toEnumMemberName } from "./psl-names-C3cwe0rg-CsuHOV7E.mjs";
13
- import { a as mapDefault, i as inferredTypeConstructors, n as generatorCallsFor, o as pslTypeArgumentText, r as inferColumnTypes, t as fewestArgumentsCall } from "./psl-build-BkxAXTwj.mjs";
14
- import { a as pluralize, c as toModelName, i as inferRelations, n as deriveBackRelationFieldName, o as toEnumName, r as deriveRelationFieldName, s as toFieldName, t as buildChildRelationField } from "./psl-infer-Bz34csvN.mjs";
13
+ import { a as mapDefault, i as inferredTypeConstructors, n as generatorCallsFor, o as pslTypeArgumentText, r as inferColumnTypes, t as fewestArgumentsCall } from "./psl-build-BYqCjsqi.mjs";
14
+ import { a as pluralize, c as toModelName, i as inferRelations, n as deriveBackRelationFieldName, o as toEnumName, r as deriveRelationFieldName, s as toFieldName, t as buildChildRelationField } from "./psl-infer-CaEnF_x3.mjs";
15
15
  import { i as timestampNowRuntimeGenerator, n as resolveDomainModel, t as UNBOUND_DOMAIN_NAMESPACE_ID } from "./runtime-Z3nD7ix1.mjs";
16
16
  export { COLUMN_RENAME_UNMATCHED_CODE, INIT_ADDITIVE_POLICY, SqlMigration as Migration, SqlContractSerializer, SqlContractSerializerBase, SqlSchemaVerifierBase, TABLE_NAME_CASE_CHANGED_CODE, UNBOUND_DOMAIN_NAMESPACE_ID, appliedStatementsInOrder, arraysEqual, assembleAuthoringContributions, backfillOfDefaultedField, buildChildRelationField, checkSqlDefaultText, checkSqlExpressionText, classifyDiffSubjectGranularity, classifySqlDiffIssue, columnTakesTemporaryValue, computeSqlDiffVerdict, computeStorageTypeVerdict, contractColumns, contractNamespaceToSchemaIR, contractToSchemaIR, convertedColumnMeta, convertedColumnOf, createMigrationPlan, createSqlTextSources, deriveBackRelationFieldName, deriveRelationFieldName, detectDestructiveChanges, detectTableNameCaseChanges, extractCodecControlHooks, fewestArgumentsCall, fieldEventStorage, fieldOfColumn, fieldRenameStorageEffect, fieldStatementColumns, generatorCallsFor, idGeneratorFunctionBindings, inferColumnTypes, inferRelations, inferredTypeConstructors, isUnfilledSlot, mapDefault, modelRenameStorageEffect, parseContractMarkerRow, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventCalls, planFieldEventOperations, planStatements, plannerFailure, plannerSuccess, pluralize, pslTypeArgumentText, readColumnDefault, readReportedDefault, requiredColumnMeta, requiredColumnOf, requiredColumnsOfMigration, resolveColumnRenameAgainst, resolveDomainModel, resolveIntrospectedColumnType, resolveStorageTable, resolveTableRenameAgainst, rowsWithoutValueFailure, rowsWithoutValueSummary, runnerFailure, runnerSuccess, slotSource, sqlOfSlot, sqlTypeLookupsOf, storageNameOfOperation, subjectsOfCalls, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets, timestampNowRuntimeGenerator, toEnumMemberName, toEnumName, toFieldName, toModelName, unconvertedFieldOf, unknownCallNames, unmatchedColumnRename, unmatchedTableRename, verifySqlSchemaByDiff };
@@ -1,3 +1,3 @@
1
- import { i as SqlControlAdapterDescriptor, n as Lowerer, r as SqlControlAdapter, t as ExecuteRequestLowerer } from "./control-adapter-Bn0uhplA-rhq_JtYp.mjs";
2
- import { t as resolveIntrospectedColumnType } from "./control-adapter-RwLtGiwa.mjs";
1
+ import { i as SqlControlAdapterDescriptor, n as Lowerer, r as SqlControlAdapter, t as ExecuteRequestLowerer } from "./control-adapter-Bn0uhplA-BnsQY8_q.mjs";
2
+ import { t as resolveIntrospectedColumnType } from "./control-adapter-DgxEVzhZ.mjs";
3
3
  export { type ExecuteRequestLowerer, type Lowerer, type SqlControlAdapter, type SqlControlAdapterDescriptor, resolveIntrospectedColumnType };
@@ -1,2 +1,2 @@
1
- import { t as resolveIntrospectedColumnType } from "./control-adapter-DhX77V61.mjs";
1
+ import { t as resolveIntrospectedColumnType } from "./control-adapter-BX5COBWO.mjs";
2
2
  export { resolveIntrospectedColumnType };
@@ -1,5 +1,5 @@
1
1
  import { h as checkSqlDefaultText } from "./validators-CTZ-hU2l.mjs";
2
- import { A as StorageTypePlanResult, C as SqlPlanTargetDetails, D as SqlPlannerFailureResult, E as SqlPlannerConflictLocation, O as SqlPlannerResult, S as SqlMigrationRunnerSuccessValue, T as SqlPlannerConflictKind, _ as SqlMigrationRunnerErrorCode, a as FieldEventContext, b as SqlMigrationRunnerFailure, c as SqlControlExtensionDescriptor, d as SqlMigrationPlanOperation, f as SqlMigrationPlanOperationStep, g as SqlMigrationRunner, h as SqlMigrationPlannerPlanOptions, i as FieldEvent, k as SqlPlannerSuccessResult, l as SqlMigrationPlan, m as SqlMigrationPlanner, n as CodecControlHooks, o as ResolveIdentityValueInput, p as SqlMigrationPlanOperationTarget, r as CreateSqlMigrationPlanOptions, s as SqlControlAdapterDescriptor, u as SqlMigrationPlanContractInfo, v as SqlMigrationRunnerExecuteCallbacks, w as SqlPlannerConflict, x as SqlMigrationRunnerResult, y as SqlMigrationRunnerExecuteOptions } from "./types-DlFdMaDJ-DekbNgDh.mjs";
3
- import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DmP74bB8-CIQ17HTk.mjs";
4
- import { $ as TableRenameByHand, A as ReadColumnDefault, At as plannerSuccess, B as SqlDescribedContractSpace, Bt as runnerFailure, C as MigrationPlannerConflict, Ct as modelRenameStorageEffect, D as NoTable, Dt as planFieldEventOperations, E as ModelTable, Et as planFieldEventCalls, F as RequiredColumnMark, Ft as requiredColumnsOfMigration, G as SqlTextSources, Gt as storageNameOfOperation, H as SqlQuote, Ht as slotSource, I as SchemaTables, It as resolveColumnRenameAgainst, J as SubjectStorage, Jt as temporalStringAuthoringPresets, K as StatementColumn, Kt as subjectsOfCalls, L as SingleOperationCall, Lt as resolveTableRenameAgainst, M as ReportedBody, Mt as readReportedDefault, N as ReportedLiteralDefault, Nt as requiredColumnMeta, O as PlanFieldEventOperationsOptions, Ot as planStatements, P as RequiredColumn, Pt as requiredColumnOf, Q as TableRename, Qt as unmatchedTableRename, R as SqlControlFamilyInstance, Rt as rowsWithoutValueFailure, S as MigrationPlanner, St as isUnfilledSlot, T as ModelStorageEffect, Tt as partitionIssuesByControlPolicy, U as SqlQuotingRules, Ut as sqlOfSlot, V as SqlPslBuildContext, Vt as runnerSuccess, W as SqlSlot, Wt as sqlTypeLookupsOf, X as TABLE_NAME_CASE_CHANGED_CODE, Xt as unknownCallNames, Y as SuppressionRecord, Yt as unconvertedFieldOf, Z as TableNameCaseGuardTable, Zt as unmatchedColumnRename, _ as INIT_ADDITIVE_POLICY, _t as extractCodecControlHooks, a as ColumnRename, at as backfillOfDefaultedField, b as MigrationPlan, bt as fieldRenameStorageEffect, c as ContractColumns, ct as contractColumns, d as ConvertedColumn, dt as convertedColumnMeta, et as TableRenameRequest, f as DefaultResolver, ft as convertedColumnOf, g as FieldStorageEffect, gt as detectTableNameCaseChanges, h as FieldStatementColumns, ht as detectDestructiveChanges, i as ColumnOnOneSide, it as assembleAuthoringContributions, j as ReadReportedDefault, jt as readColumnDefault, k as PlannedStatements, kt as plannerFailure, l as ContractToSchemaIROptions, lt as contractNamespaceToSchemaIR, m as FieldEventCall, mt as createSqlTextSources, n as CallSubjects, nt as _default, o as ColumnRenameRequest, ot as checkSqlExpressionText, p as DefaultResolverColumn, pt as createMigrationPlan, q as StatementPlanningTarget, qt as temporalCodecPresetWithPrecision, r as CallWithCompanions, rt as appliedStatementsInOrder, s as ContractColumn, st as columnTakesTemporaryValue, t as COLUMN_RENAME_UNMATCHED_CODE, tt as TargetMigrationsCapability, u as ControlPolicySubject, ut as contractToSchemaIR, v as MigrationOperationClass, vt as fieldEventStorage, w as MigrationPlannerResult, wt as partitionCallsByControlPolicy, x as MigrationPlanOperation, xt as fieldStatementColumns, y as MigrationOperationPolicy, yt as fieldOfColumn, z as SqlControlTargetDescriptor, zt as rowsWithoutValueSummary } from "./control-B8tb6SEt.mjs";
2
+ import { A as StorageTypePlanResult, C as SqlPlanTargetDetails, D as SqlPlannerFailureResult, E as SqlPlannerConflictLocation, O as SqlPlannerResult, S as SqlMigrationRunnerSuccessValue, T as SqlPlannerConflictKind, _ as SqlMigrationRunnerErrorCode, a as FieldEventContext, b as SqlMigrationRunnerFailure, c as SqlControlExtensionDescriptor, d as SqlMigrationPlanOperation, f as SqlMigrationPlanOperationStep, g as SqlMigrationRunner, h as SqlMigrationPlannerPlanOptions, i as FieldEvent, k as SqlPlannerSuccessResult, l as SqlMigrationPlan, m as SqlMigrationPlanner, n as CodecControlHooks, o as ResolveIdentityValueInput, p as SqlMigrationPlanOperationTarget, r as CreateSqlMigrationPlanOptions, s as SqlControlAdapterDescriptor, u as SqlMigrationPlanContractInfo, v as SqlMigrationRunnerExecuteCallbacks, w as SqlPlannerConflict, x as SqlMigrationRunnerResult, y as SqlMigrationRunnerExecuteOptions } from "./types-DlFdMaDJ-BEDwj-Qv.mjs";
3
+ import { n as SqlSchemaDiffInput, r as SqlSchemaDiffResult, t as SqlSchemaDiffFn } from "./schema-differ-DmP74bB8-BfEQ_9cY.mjs";
4
+ import { $ as TableRenameByHand, A as ReadColumnDefault, At as plannerSuccess, B as SqlDescribedContractSpace, Bt as runnerFailure, C as MigrationPlannerConflict, Ct as modelRenameStorageEffect, D as NoTable, Dt as planFieldEventOperations, E as ModelTable, Et as planFieldEventCalls, F as RequiredColumnMark, Ft as requiredColumnsOfMigration, G as SqlTextSources, Gt as storageNameOfOperation, H as SqlQuote, Ht as slotSource, I as SchemaTables, It as resolveColumnRenameAgainst, J as SubjectStorage, Jt as temporalStringAuthoringPresets, K as StatementColumn, Kt as subjectsOfCalls, L as SingleOperationCall, Lt as resolveTableRenameAgainst, M as ReportedBody, Mt as readReportedDefault, N as ReportedLiteralDefault, Nt as requiredColumnMeta, O as PlanFieldEventOperationsOptions, Ot as planStatements, P as RequiredColumn, Pt as requiredColumnOf, Q as TableRename, Qt as unmatchedTableRename, R as SqlControlFamilyInstance, Rt as rowsWithoutValueFailure, S as MigrationPlanner, St as isUnfilledSlot, T as ModelStorageEffect, Tt as partitionIssuesByControlPolicy, U as SqlQuotingRules, Ut as sqlOfSlot, V as SqlPslBuildContext, Vt as runnerSuccess, W as SqlSlot, Wt as sqlTypeLookupsOf, X as TABLE_NAME_CASE_CHANGED_CODE, Xt as unknownCallNames, Y as SuppressionRecord, Yt as unconvertedFieldOf, Z as TableNameCaseGuardTable, Zt as unmatchedColumnRename, _ as INIT_ADDITIVE_POLICY, _t as extractCodecControlHooks, a as ColumnRename, at as backfillOfDefaultedField, b as MigrationPlan, bt as fieldRenameStorageEffect, c as ContractColumns, ct as contractColumns, d as ConvertedColumn, dt as convertedColumnMeta, et as TableRenameRequest, f as DefaultResolver, ft as convertedColumnOf, g as FieldStorageEffect, gt as detectTableNameCaseChanges, h as FieldStatementColumns, ht as detectDestructiveChanges, i as ColumnOnOneSide, it as assembleAuthoringContributions, j as ReadReportedDefault, jt as readColumnDefault, k as PlannedStatements, kt as plannerFailure, l as ContractToSchemaIROptions, lt as contractNamespaceToSchemaIR, m as FieldEventCall, mt as createSqlTextSources, n as CallSubjects, nt as _default, o as ColumnRenameRequest, ot as checkSqlExpressionText, p as DefaultResolverColumn, pt as createMigrationPlan, q as StatementPlanningTarget, qt as temporalCodecPresetWithPrecision, r as CallWithCompanions, rt as appliedStatementsInOrder, s as ContractColumn, st as columnTakesTemporaryValue, t as COLUMN_RENAME_UNMATCHED_CODE, tt as TargetMigrationsCapability, u as ControlPolicySubject, ut as contractToSchemaIR, v as MigrationOperationClass, vt as fieldEventStorage, w as MigrationPlannerResult, wt as partitionCallsByControlPolicy, x as MigrationPlanOperation, xt as fieldStatementColumns, y as MigrationOperationPolicy, yt as fieldOfColumn, z as SqlControlTargetDescriptor, zt as rowsWithoutValueSummary } from "./control-Db07JiRl.mjs";
5
5
  export { COLUMN_RENAME_UNMATCHED_CODE, type CallSubjects, type CallWithCompanions, type CodecControlHooks, type ColumnOnOneSide, type ColumnRename, type ColumnRenameRequest, type ContractColumn, type ContractColumns, type ContractToSchemaIROptions, type ControlPolicySubject, type ConvertedColumn, type CreateSqlMigrationPlanOptions, type DefaultResolver, type DefaultResolverColumn, type FieldEvent, type FieldEventCall, type FieldEventContext, type FieldStatementColumns, type FieldStorageEffect, INIT_ADDITIVE_POLICY, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type ModelStorageEffect, type ModelTable, type NoTable, type PlanFieldEventOperationsOptions, type PlannedStatements, type ReadColumnDefault, type ReadReportedDefault, type ReportedBody, type ReportedLiteralDefault, type RequiredColumn, type RequiredColumnMark, type ResolveIdentityValueInput, type SchemaTables, type SingleOperationCall, type SqlControlAdapterDescriptor, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlDescribedContractSpace, type SqlMigrationPlan, type SqlMigrationPlanContractInfo, type SqlMigrationPlanOperation, type SqlMigrationPlanOperationStep, type SqlMigrationPlanOperationTarget, type SqlMigrationPlanner, type SqlMigrationPlannerPlanOptions, type SqlMigrationRunner, type SqlMigrationRunnerErrorCode, type SqlMigrationRunnerExecuteCallbacks, type SqlMigrationRunnerExecuteOptions, type SqlMigrationRunnerFailure, type SqlMigrationRunnerResult, type SqlMigrationRunnerSuccessValue, type SqlPlanTargetDetails, type SqlPlannerConflict, type SqlPlannerConflictKind, type SqlPlannerConflictLocation, type SqlPlannerFailureResult, type SqlPlannerResult, type SqlPlannerSuccessResult, type SqlPslBuildContext, type SqlQuote, type SqlQuotingRules, type SqlSchemaDiffFn, type SqlSchemaDiffInput, type SqlSchemaDiffResult, type SqlSlot, type SqlTextSources, type StatementColumn, type StatementPlanningTarget, type StorageTypePlanResult, type SubjectStorage, type SuppressionRecord, TABLE_NAME_CASE_CHANGED_CODE, type TableNameCaseGuardTable, type TableRename, type TableRenameByHand, type TableRenameRequest, type TargetMigrationsCapability, appliedStatementsInOrder, assembleAuthoringContributions, backfillOfDefaultedField, checkSqlDefaultText, checkSqlExpressionText, columnTakesTemporaryValue, contractColumns, contractNamespaceToSchemaIR, contractToSchemaIR, convertedColumnMeta, convertedColumnOf, createMigrationPlan, createSqlTextSources, _default as default, detectDestructiveChanges, detectTableNameCaseChanges, extractCodecControlHooks, fieldEventStorage, fieldOfColumn, fieldRenameStorageEffect, fieldStatementColumns, isUnfilledSlot, modelRenameStorageEffect, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventCalls, planFieldEventOperations, planStatements, plannerFailure, plannerSuccess, readColumnDefault, readReportedDefault, requiredColumnMeta, requiredColumnOf, requiredColumnsOfMigration, resolveColumnRenameAgainst, resolveTableRenameAgainst, rowsWithoutValueFailure, rowsWithoutValueSummary, runnerFailure, runnerSuccess, slotSource, sqlOfSlot, sqlTypeLookupsOf, storageNameOfOperation, subjectsOfCalls, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets, unconvertedFieldOf, unknownCallNames, unmatchedColumnRename, unmatchedTableRename };
@@ -1,4 +1,4 @@
1
- import { n as checkSqlDefaultText } from "./validators-BCRydDG7.mjs";
2
- import { s as extractCodecControlHooks } from "./schema-verify-BwRdzbHb-nDeE75xa.mjs";
3
- import { $ as unmatchedTableRename, A as plannerFailure, B as rowsWithoutValueSummary, C as isUnfilledSlot, D as planFieldEventCalls, E as partitionIssuesByControlPolicy, F as requiredColumnOf, G as sqlTypeLookupsOf, H as runnerSuccess, I as requiredColumnsOfMigration, J as temporalCodecPresetWithPrecision, K as storageNameOfOperation, L as resolveColumnRenameAgainst, M as readColumnDefault, N as readReportedDefault, O as planFieldEventOperations, P as requiredColumnMeta, Q as unmatchedColumnRename, R as resolveTableRenameAgainst, S as fieldStatementColumns, T as partitionCallsByControlPolicy, U as slotSource, V as runnerFailure, W as sqlOfSlot, X as unconvertedFieldOf, Y as temporalStringAuthoringPresets, Z as unknownCallNames, _ as detectDestructiveChanges, a as assembleAuthoringContributions, b as fieldOfColumn, c as columnTakesTemporaryValue, d as contractToSchemaIR, f as control_default, g as createSqlTextSources, h as createMigrationPlan, i as appliedStatementsInOrder, j as plannerSuccess, k as planStatements, l as contractColumns, m as convertedColumnOf, n as INIT_ADDITIVE_POLICY, o as backfillOfDefaultedField, p as convertedColumnMeta, q as subjectsOfCalls, r as TABLE_NAME_CASE_CHANGED_CODE, s as checkSqlExpressionText, t as COLUMN_RENAME_UNMATCHED_CODE, u as contractNamespaceToSchemaIR, v as detectTableNameCaseChanges, w as modelRenameStorageEffect, x as fieldRenameStorageEffect, y as fieldEventStorage, z as rowsWithoutValueFailure } from "./control-DNE-Chse.mjs";
1
+ import { n as checkSqlDefaultText } from "./validators-BlONfdFH.mjs";
2
+ import { s as extractCodecControlHooks } from "./schema-verify-BwRdzbHb-BzdgK4xv.mjs";
3
+ import { $ as unmatchedTableRename, A as plannerFailure, B as rowsWithoutValueSummary, C as isUnfilledSlot, D as planFieldEventCalls, E as partitionIssuesByControlPolicy, F as requiredColumnOf, G as sqlTypeLookupsOf, H as runnerSuccess, I as requiredColumnsOfMigration, J as temporalCodecPresetWithPrecision, K as storageNameOfOperation, L as resolveColumnRenameAgainst, M as readColumnDefault, N as readReportedDefault, O as planFieldEventOperations, P as requiredColumnMeta, Q as unmatchedColumnRename, R as resolveTableRenameAgainst, S as fieldStatementColumns, T as partitionCallsByControlPolicy, U as slotSource, V as runnerFailure, W as sqlOfSlot, X as unconvertedFieldOf, Y as temporalStringAuthoringPresets, Z as unknownCallNames, _ as detectDestructiveChanges, a as assembleAuthoringContributions, b as fieldOfColumn, c as columnTakesTemporaryValue, d as contractToSchemaIR, f as control_default, g as createSqlTextSources, h as createMigrationPlan, i as appliedStatementsInOrder, j as plannerSuccess, k as planStatements, l as contractColumns, m as convertedColumnOf, n as INIT_ADDITIVE_POLICY, o as backfillOfDefaultedField, p as convertedColumnMeta, q as subjectsOfCalls, r as TABLE_NAME_CASE_CHANGED_CODE, s as checkSqlExpressionText, t as COLUMN_RENAME_UNMATCHED_CODE, u as contractNamespaceToSchemaIR, v as detectTableNameCaseChanges, w as modelRenameStorageEffect, x as fieldRenameStorageEffect, y as fieldEventStorage, z as rowsWithoutValueFailure } from "./control-DbHnaxDE.mjs";
4
4
  export { COLUMN_RENAME_UNMATCHED_CODE, INIT_ADDITIVE_POLICY, TABLE_NAME_CASE_CHANGED_CODE, appliedStatementsInOrder, assembleAuthoringContributions, backfillOfDefaultedField, checkSqlDefaultText, checkSqlExpressionText, columnTakesTemporaryValue, contractColumns, contractNamespaceToSchemaIR, contractToSchemaIR, convertedColumnMeta, convertedColumnOf, createMigrationPlan, createSqlTextSources, control_default as default, detectDestructiveChanges, detectTableNameCaseChanges, extractCodecControlHooks, fieldEventStorage, fieldOfColumn, fieldRenameStorageEffect, fieldStatementColumns, isUnfilledSlot, modelRenameStorageEffect, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planFieldEventCalls, planFieldEventOperations, planStatements, plannerFailure, plannerSuccess, readColumnDefault, readReportedDefault, requiredColumnMeta, requiredColumnOf, requiredColumnsOfMigration, resolveColumnRenameAgainst, resolveTableRenameAgainst, rowsWithoutValueFailure, rowsWithoutValueSummary, runnerFailure, runnerSuccess, slotSource, sqlOfSlot, sqlTypeLookupsOf, storageNameOfOperation, subjectsOfCalls, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets, unconvertedFieldOf, unknownCallNames, unmatchedColumnRename, unmatchedTableRename };
@@ -1,2 +1,2 @@
1
- import { a as VerifySqlSchemaByDiffInput, c as classifySqlDiffIssue, d as verifySqlSchemaByDiff, i as StorageTypeVerdictInput, l as computeSqlDiffVerdict, n as SqlDiffVerdictInput, o as arraysEqual, r as StorageTypeVerdict, s as classifyDiffSubjectGranularity, t as SqlDiffVerdict, u as computeStorageTypeVerdict } from "./diff-B9Z47nHf.mjs";
1
+ import { a as VerifySqlSchemaByDiffInput, c as classifySqlDiffIssue, d as verifySqlSchemaByDiff, i as StorageTypeVerdictInput, l as computeSqlDiffVerdict, n as SqlDiffVerdictInput, o as arraysEqual, r as StorageTypeVerdict, s as classifyDiffSubjectGranularity, t as SqlDiffVerdict, u as computeStorageTypeVerdict } from "./diff-BN_3K9lv.mjs";
2
2
  export { type SqlDiffVerdict, type SqlDiffVerdictInput, type StorageTypeVerdict, type StorageTypeVerdictInput, type VerifySqlSchemaByDiffInput, arraysEqual, classifyDiffSubjectGranularity, classifySqlDiffIssue, computeSqlDiffVerdict, computeStorageTypeVerdict, verifySqlSchemaByDiff };
@@ -1,3 +1,3 @@
1
- import { a as computeStorageTypeVerdict, c as verifySqlSchemaByDiff, i as computeSqlDiffVerdict, n as classifyDiffSubjectGranularity, r as classifySqlDiffIssue } from "./schema-verify-BwRdzbHb-nDeE75xa.mjs";
1
+ import { a as computeStorageTypeVerdict, c as verifySqlSchemaByDiff, i as computeSqlDiffVerdict, n as classifyDiffSubjectGranularity, r as classifySqlDiffIssue } from "./schema-verify-BwRdzbHb-BzdgK4xv.mjs";
2
2
  import { t as arraysEqual } from "./diff-DZ82XaGR.mjs";
3
3
  export { arraysEqual, classifyDiffSubjectGranularity, classifySqlDiffIssue, computeSqlDiffVerdict, computeStorageTypeVerdict, verifySqlSchemaByDiff };
@@ -1,3 +1,3 @@
1
- import { n as SqlContractSerializerBase, t as SqlContractSerializer } from "./sql-contract-serializer-sMY3prTx-BT6HdXAE.mjs";
1
+ import { n as SqlContractSerializerBase, t as SqlContractSerializer } from "./sql-contract-serializer-sMY3prTx-D-xfnqyD.mjs";
2
2
  import { t as SqlSchemaVerifierBase } from "./ir-I-xciGUH.mjs";
3
3
  export { SqlContractSerializer, SqlContractSerializerBase, SqlSchemaVerifierBase };
@@ -1,2 +1,2 @@
1
- import { t as SqlMigration } from "./migration-CSv3UpiC.mjs";
1
+ import { t as SqlMigration } from "./migration-go6YP7-v.mjs";
2
2
  export { SqlMigration as Migration };
@@ -1,2 +1,2 @@
1
- import { n as sqlFamilyPack, t as idGeneratorFunctionBindings } from "./pack-COEyiyfL.mjs";
1
+ import { n as sqlFamilyPack, t as idGeneratorFunctionBindings } from "./pack-DXEOdHaM.mjs";
2
2
  export { sqlFamilyPack as default, idGeneratorFunctionBindings };
@@ -1,5 +1,5 @@
1
- import { v as sqlAttributeSpecs } from "./psl-field-resolution-BET6wtHZ-CX2xL99Q.mjs";
2
- import { a as sqlFamilyGeneratorDescriptors, i as sqlFamilyEntityTypes, n as sqlFamilyAuthoringFieldPresets, o as sqlFamilyGeneratorFunctions, r as sqlFamilyAuthoringTypes, s as sqlFamilyPslBlockDescriptors, t as idGeneratorFunctionBindings } from "./generator-functions-B4gRRYZB-BTtC2KQz.mjs";
1
+ import { v as sqlAttributeSpecs } from "./psl-field-resolution-BET6wtHZ-C_hO6YE1.mjs";
2
+ import { a as sqlFamilyGeneratorDescriptors, i as sqlFamilyEntityTypes, n as sqlFamilyAuthoringFieldPresets, o as sqlFamilyGeneratorFunctions, r as sqlFamilyAuthoringTypes, s as sqlFamilyPslBlockDescriptors, t as idGeneratorFunctionBindings } from "./generator-functions-BoE7Lc9d-MgcgdnPZ.mjs";
3
3
  //#region ../../../2-sql/9-family/dist/pack.mjs
4
4
  const sqlFamilyPack = {
5
5
  kind: "family",
@@ -1 +1 @@
1
- {"version":3,"file":"family__pack.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/pack.mjs"],"sourcesContent":["import { a as sqlFamilyAuthoringFieldPresets, i as sqlFamilyAuthoringTypes, n as sqlFamilyGeneratorDescriptors, o as sqlFamilyEntityTypes, r as sqlFamilyGeneratorFunctions, s as sqlFamilyPslBlockDescriptors, t as idGeneratorFunctionBindings } from \"./generator-functions-B4gRRYZB.mjs\";\nimport { sqlAttributeSpecs } from \"@internal/sql-contract-psl/attribute-specs\";\n//#region src/exports/pack.ts\nconst sqlFamilyPack = {\n\tkind: \"family\",\n\tid: \"sql\",\n\tfamilyId: \"sql\",\n\tversion: \"0.0.1\",\n\tauthoring: {\n\t\tfield: sqlFamilyAuthoringFieldPresets,\n\t\ttype: sqlFamilyAuthoringTypes,\n\t\tentityTypes: sqlFamilyEntityTypes,\n\t\tpslBlockDescriptors: sqlFamilyPslBlockDescriptors,\n\t\tattributeSpecs: sqlAttributeSpecs\n\t},\n\tgeneratorFunctions: sqlFamilyGeneratorFunctions,\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: /* @__PURE__ */ new Map(),\n\t\tgeneratorDescriptors: sqlFamilyGeneratorDescriptors\n\t}\n};\n//#endregion\nexport { sqlFamilyPack as default, idGeneratorFunctionBindings };\n\n//# sourceMappingURL=pack.mjs.map"],"mappings":";;;AAGA,MAAM,gBAAgB;CACrB,MAAM;CACN,IAAI;CACJ,UAAU;CACV,SAAS;CACT,WAAW;EACV,OAAO;EACP,MAAM;EACN,aAAa;EACb,qBAAqB;EACrB,gBAAgB;CACjB;CACA,oBAAoB;CACpB,yBAAyB;EACxB,yCAAyC,IAAI,IAAI;EACjD,sBAAsB;CACvB;AACD"}
1
+ {"version":3,"file":"family__pack.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/pack.mjs"],"sourcesContent":["import { a as sqlFamilyAuthoringFieldPresets, i as sqlFamilyAuthoringTypes, n as sqlFamilyGeneratorDescriptors, o as sqlFamilyEntityTypes, r as sqlFamilyGeneratorFunctions, s as sqlFamilyPslBlockDescriptors, t as idGeneratorFunctionBindings } from \"./generator-functions-BoE7Lc9d.mjs\";\nimport { sqlAttributeSpecs } from \"@internal/sql-contract-psl/attribute-specs\";\n//#region src/exports/pack.ts\nconst sqlFamilyPack = {\n\tkind: \"family\",\n\tid: \"sql\",\n\tfamilyId: \"sql\",\n\tversion: \"0.0.1\",\n\tauthoring: {\n\t\tfield: sqlFamilyAuthoringFieldPresets,\n\t\ttype: sqlFamilyAuthoringTypes,\n\t\tentityTypes: sqlFamilyEntityTypes,\n\t\tpslBlockDescriptors: sqlFamilyPslBlockDescriptors,\n\t\tattributeSpecs: sqlAttributeSpecs\n\t},\n\tgeneratorFunctions: sqlFamilyGeneratorFunctions,\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: /* @__PURE__ */ new Map(),\n\t\tgeneratorDescriptors: sqlFamilyGeneratorDescriptors\n\t}\n};\n//#endregion\nexport { sqlFamilyPack as default, idGeneratorFunctionBindings };\n\n//# sourceMappingURL=pack.mjs.map"],"mappings":";;;AAGA,MAAM,gBAAgB;CACrB,MAAM;CACN,IAAI;CACJ,UAAU;CACV,SAAS;CACT,WAAW;EACV,OAAO;EACP,MAAM;EACN,aAAa;EACb,qBAAqB;EACrB,gBAAgB;CACjB;CACA,oBAAoB;CACpB,yBAAyB;EACxB,yCAAyC,IAAI,IAAI;EACjD,sBAAsB;CACvB;AACD"}
@@ -1,3 +1,3 @@
1
1
  import { n as DefaultMappingResult, r as mapDefault, t as DefaultMappingOptions } from "./default-mapping-CEISdj2g-DF1LzGBR.mjs";
2
- import { a as InferredTypeConstructors, c as PslTypeCall, d as inferColumnTypes, f as inferredTypeConstructors, i as InferredTypeConstructor, l as fewestArgumentsCall, m as toEnumMemberName, n as GeneratorCallRefusal, o as IntrospectedTable, p as pslTypeArgumentText, r as GeneratorCallsResult, s as PhaseCallText, t as ColumnTypeOf, u as generatorCallsFor } from "./psl-build-O7_tXQ1E.mjs";
2
+ import { a as InferredTypeConstructors, c as PslTypeCall, d as inferColumnTypes, f as inferredTypeConstructors, i as InferredTypeConstructor, l as fewestArgumentsCall, m as toEnumMemberName, n as GeneratorCallRefusal, o as IntrospectedTable, p as pslTypeArgumentText, r as GeneratorCallsResult, s as PhaseCallText, t as ColumnTypeOf, u as generatorCallsFor } from "./psl-build-C41KHJL_.mjs";
3
3
  export { type ColumnTypeOf, type DefaultMappingOptions, type DefaultMappingResult, type GeneratorCallRefusal, type GeneratorCallsResult, type InferredTypeConstructor, type InferredTypeConstructors, type IntrospectedTable, type PhaseCallText, type PslTypeCall, fewestArgumentsCall, generatorCallsFor, inferColumnTypes, inferredTypeConstructors, mapDefault, pslTypeArgumentText, toEnumMemberName };
@@ -1,3 +1,3 @@
1
1
  import { s as toEnumMemberName } from "./psl-names-C3cwe0rg-CsuHOV7E.mjs";
2
- import { a as mapDefault, i as inferredTypeConstructors, n as generatorCallsFor, o as pslTypeArgumentText, r as inferColumnTypes, t as fewestArgumentsCall } from "./psl-build-BkxAXTwj.mjs";
2
+ import { a as mapDefault, i as inferredTypeConstructors, n as generatorCallsFor, o as pslTypeArgumentText, r as inferColumnTypes, t as fewestArgumentsCall } from "./psl-build-BYqCjsqi.mjs";
3
3
  export { fewestArgumentsCall, generatorCallsFor, inferColumnTypes, inferredTypeConstructors, mapDefault, pslTypeArgumentText, toEnumMemberName };
@@ -1,2 +1,2 @@
1
- import { a as buildChildRelationField, c as inferRelations, d as toFieldName, f as toModelName, i as RelationField, l as pluralize, n as InferredRelations, o as deriveBackRelationFieldName, r as PslPrinterOptions, s as deriveRelationFieldName, t as EnumInfo, u as toEnumName } from "./psl-infer-I75woGr4.mjs";
1
+ import { a as buildChildRelationField, c as inferRelations, d as toFieldName, f as toModelName, i as RelationField, l as pluralize, n as InferredRelations, o as deriveBackRelationFieldName, r as PslPrinterOptions, s as deriveRelationFieldName, t as EnumInfo, u as toEnumName } from "./psl-infer-CALmBIqX.mjs";
2
2
  export { type EnumInfo, type InferredRelations, type PslPrinterOptions, type RelationField, buildChildRelationField, deriveBackRelationFieldName, deriveRelationFieldName, inferRelations, pluralize, toEnumName, toFieldName, toModelName };
@@ -1,2 +1,2 @@
1
- import { a as pluralize, c as toModelName, i as inferRelations, n as deriveBackRelationFieldName, o as toEnumName, r as deriveRelationFieldName, s as toFieldName, t as buildChildRelationField } from "./psl-infer-Bz34csvN.mjs";
1
+ import { a as pluralize, c as toModelName, i as inferRelations, n as deriveBackRelationFieldName, o as toEnumName, r as deriveRelationFieldName, s as toFieldName, t as buildChildRelationField } from "./psl-infer-CaEnF_x3.mjs";
2
2
  export { buildChildRelationField, deriveBackRelationFieldName, deriveRelationFieldName, inferRelations, pluralize, toEnumName, toFieldName, toModelName };
@@ -2,7 +2,7 @@ import { t as contractError } from "./contract-errors-BCN6RVI5-5IHBF_lg.mjs";
2
2
  import { a as rendersIndexBody, t as accessMethodOf } from "./index-types-pC_5vADQ-TTUXAfmL.mjs";
3
3
  import { g as truncateToWireNamePrefixBytes, l as nameOf, o as defaultIndexName } from "./naming-bM5qm5PY-DdginUhA.mjs";
4
4
  import { r as lowerAuthoredIndex } from "./index-naming-BOcJT1B3-18gQUduD.mjs";
5
- import { i as leadingBackingObjectName, n as identicalIndexes, o as servingKey, r as indexNodeOf, s as startsWithColumns, t as derivedBackingIndexIsRedundant } from "./index-equivalence-DswCiq5l-C6SAs-Yz.mjs";
5
+ import { i as leadingBackingObjectName, n as identicalIndexes, o as servingKey, r as indexNodeOf, s as startsWithColumns, t as derivedBackingIndexIsRedundant } from "./index-equivalence-DswCiq5l-D5VK0qTy.mjs";
6
6
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
7
7
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
8
8
  import { asNamespaceId } from "@prisma/orm-framework/contract/types";
@@ -284,4 +284,4 @@ function foreignKeyIndexOf(backing) {
284
284
  //#endregion
285
285
  export { materializeForeignKeysAndIndexes as a, defaultForeignKeyIndex as i, declaredBackingObjectName as n, declaredIndexesServeForeignKey as r, FOREIGN_KEY_INDEX_UNRESOLVED as t };
286
286
 
287
- //# sourceMappingURL=foreign-key-materialization-C_FPLzj3.mjs.map
287
+ //# sourceMappingURL=foreign-key-materialization-BPQqd0qF.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"foreign-key-materialization-C_FPLzj3.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/foreign-key-materialization.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { a as rendersIndexBody, t as accessMethodOf } from \"./index-types-pC_5vADQ.mjs\";\nimport { r as lowerAuthoredIndex } from \"./index-naming-BOcJT1B3.mjs\";\nimport { i as leadingBackingObjectName, n as identicalIndexes, o as servingKey, r as indexNodeOf, s as startsWithColumns, t as derivedBackingIndexIsRedundant } from \"./index-equivalence-DswCiq5l.mjs\";\nimport { defaultIndexName, nameOf, truncateToWireNamePrefixBytes } from \"@internal/sql-schema-ir/naming\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { asNamespaceId } from \"@internal/contract/types\";\n//#region src/index-deduplication.ts\nconst IDENTICAL_DESCRIPTION = \"the planner sees them as the same index. The contract keeps both because each is named.\";\nconst REDUNDANT_DESCRIPTION = \"which already serves the same lookups.\";\n/**\n* Removes the indexes of one table that duplicate another. Two indexes are identical when the planner sees them as the same index apart from their names (see {@link identicalIndexes}); of an identical group the pass keeps the indexes named by the user, or the first one when none is. A plain non-unique index whose columns are those of the primary key, a unique constraint or a unique index without a predicate is redundant (see {@link servingKey}), and the pass removes it unless it is named by the user. Every index named by the user survives; the pass warns about each one that duplicates another, and refuses two identical indexes both named with `name:`, whose wire names the planner could not tell apart.\n*/\nfunction deduplicateIndexes(input) {\n\tconst { tableName, warnings } = input;\n\tconst replacements = /* @__PURE__ */ new Map();\n\tconst nodes = new Map(input.indexes.map((candidate) => [candidate, indexNodeOf(candidate.index)]));\n\tconst nodeOf = (candidate) => {\n\t\tconst node = nodes.get(candidate);\n\t\tif (node === void 0) throw new InternalError(\"every candidate has a node\");\n\t\treturn node;\n\t};\n\tconst groups = [];\n\tfor (const candidate of input.indexes) {\n\t\tconst position = groups.findIndex(([first]) => identicalIndexes(nodeOf(first), nodeOf(candidate)));\n\t\tconst group = groups[position];\n\t\tif (group === void 0) groups.push([candidate]);\n\t\telse groups[position] = [...group, candidate];\n\t}\n\tfor (const group of groups) {\n\t\tconst named = group.filter((candidate) => candidate.namedByUser);\n\t\tconst wireNamed = named.filter((candidate) => candidate.index.naming.kind === \"wire\");\n\t\tif (wireNamed.length > 1) throw identicalWireNamedIndexesError(tableName, wireNamed);\n\t\tconst kept = named[0] ?? group[0];\n\t\tfor (const candidate of group) if (candidate !== kept && !candidate.namedByUser) replacements.set(candidate, {\n\t\t\tkind: \"index\",\n\t\t\tindex: kept\n\t\t});\n\t\tif (named.length > 1) warnings.push(identicalIndexesWarning(tableName, named));\n\t}\n\tconst survivors = input.indexes.filter((candidate) => !replacements.has(candidate));\n\tfor (const candidate of survivors) {\n\t\tconst servedBy = servingKey(nodeOf(candidate), {\n\t\t\tindexes: survivors,\n\t\t\tnodeOf,\n\t\t\tuniques: input.uniques,\n\t\t\tprimaryKey: input.primaryKey\n\t\t});\n\t\tif (servedBy === void 0) continue;\n\t\tif (candidate.namedByUser) warnings.push(redundantIndexWarning(tableName, candidate, servedBy));\n\t\telse replacements.set(candidate, servedBy);\n\t}\n\treturn {\n\t\tindexes: input.indexes.filter((candidate) => !replacements.has(candidate)),\n\t\treplacements\n\t};\n}\nfunction identicalWireNamedIndexesError(tableName, wireNamed) {\n\treturn contractError(\"CONTRACT.ARGUMENT_INVALID\", `Indexes ${quotedList(wireNamed.map((candidate) => writtenName(candidate.index)))} on table \"${tableName}\" are identical and both named with name:; the planner pairs wire-named indexes by their content, so it could not tell them apart.`, {\n\t\tfix: \"Remove one of them, or name one with map: to keep both under exact names.\",\n\t\tmeta: {\n\t\t\ttableName,\n\t\t\tindexes: wireNamed.map((candidate) => writtenName(candidate.index))\n\t\t}\n\t});\n}\n/** The name the source wrote: the prefix of a wire-named index, the whole name of an exact one. */\nfunction writtenName(index) {\n\treturn index.naming.kind === \"wire\" ? index.naming.prefix : index.naming.name;\n}\nfunction quotedList(names) {\n\tconst quoted = names.map((name) => `\"${name}\"`);\n\treturn quoted.length <= 2 ? quoted.join(\" and \") : `${quoted.slice(0, -1).join(\", \")} and ${quoted.at(-1)}`;\n}\nfunction identicalIndexesWarning(tableName, named) {\n\tconst names = quotedList(named.map((candidate) => writtenName(candidate.index)));\n\treturn {\n\t\tcode: \"PN_INDEX_DUPLICATE\",\n\t\tmessage: `Indexes ${names} on table \"${tableName}\" are identical: ${IDENTICAL_DESCRIPTION} Remove one of them.`,\n\t\titem: `table \"${tableName}\": indexes ${names}`,\n\t\tsummary: `tables have named indexes that are identical: ${IDENTICAL_DESCRIPTION} Remove one of each.`\n\t};\n}\nfunction describeReplacement(replacement) {\n\tswitch (replacement.kind) {\n\t\tcase \"primaryKey\": return \"the primary key\";\n\t\tcase \"uniqueConstraint\": return replacement.unique.name === void 0 ? `the unique constraint on (${replacement.unique.columns.join(\", \")})` : `the unique constraint \"${replacement.unique.name}\"`;\n\t\tcase \"index\": return `the unique index \"${writtenName(replacement.index.index)}\"`;\n\t}\n}\nfunction redundantIndexWarning(tableName, candidate, servedBy) {\n\tconst name = writtenName(candidate.index);\n\treturn {\n\t\tcode: \"PN_INDEX_REDUNDANT\",\n\t\tmessage: `Index \"${name}\" on table \"${tableName}\" has the same columns as ${describeReplacement(servedBy)}, ${REDUNDANT_DESCRIPTION} The contract keeps the index because it is named. Remove it.`,\n\t\titem: `table \"${tableName}\": index \"${name}\"`,\n\t\tsummary: `tables have a named index with the same columns as a unique constraint, unique index or primary key, ${REDUNDANT_DESCRIPTION} The contract keeps each index because it is named. Remove them.`\n\t};\n}\n//#endregion\n//#region src/foreign-key-materialization.ts\n/** The `meta.reason` of the refusal of a relation's `index: \"<name>\"`, which a source can report at the relation. */\nconst FOREIGN_KEY_INDEX_UNRESOLVED = \"foreign-key-index-unresolved\";\n/**\n* Lowers a table's authored foreign keys and indexes into the entities `contract.json` persists. A `constraint: false` foreign key contributes no `foreignKeys[]` entry. A foreign key with `index: true` gets a derived backing index; one with `index: \"<name>\"` uses what the table declares under that name. The table's indexes then pass through {@link deduplicateIndexes}, and each foreign key states what backs it in the result: an index by name, or the primary key or a unique constraint by kind.\n*/\nfunction materializeForeignKeysAndIndexes(input) {\n\tconst { tableName, declaredIndexes, uniques, primaryKey, indexTypes } = input;\n\tconst derivedIndexes = [];\n\tconst intents = input.foreignKeys.map((foreignKey) => {\n\t\tconst { constraint, index, ...reference } = foreignKey;\n\t\tif (index !== true) return {\n\t\t\tconstraint,\n\t\t\treference,\n\t\t\tindex\n\t\t};\n\t\tconst derived = derivedBackingIndex(tableName, reference.source.columns);\n\t\tderivedIndexes.push(derived);\n\t\treturn {\n\t\t\tconstraint,\n\t\t\treference,\n\t\t\tindex: derived\n\t\t};\n\t});\n\tconst deduplicated = deduplicateIndexes({\n\t\ttableName,\n\t\tindexes: [...declaredIndexes, ...derivedIndexes],\n\t\tuniques,\n\t\tprimaryKey,\n\t\twarnings: input.warnings\n\t});\n\tconst resolve = (backing) => foreignKeyIndexOf(resolveReplacement(backing, deduplicated.replacements));\n\treturn {\n\t\tforeignKeys: intents.flatMap(({ constraint, reference, index }) => {\n\t\t\tconst backing = index === false ? void 0 : typeof index === \"string\" ? namedBackingObject(reference.source, index, {\n\t\t\t\tdeclaredIndexes,\n\t\t\t\tuniques,\n\t\t\t\tprimaryKey,\n\t\t\t\tindexTypes,\n\t\t\t\tresolve\n\t\t\t}) : resolve({\n\t\t\t\tkind: \"index\",\n\t\t\t\tindex\n\t\t\t});\n\t\t\tif (!constraint) return [];\n\t\t\treturn [backing === void 0 ? reference : {\n\t\t\t\t...reference,\n\t\t\t\tindex: backing\n\t\t\t}];\n\t\t}),\n\t\tindexes: deduplicated.indexes.map((candidate) => candidate.index)\n\t};\n}\n/**\n* Whether a table's declared indexes, unique constraints or primary key already serve a foreign key on `columns`, so the build would drop a derived backing index again. A source that writes no backing index of its own, such as a Prisma 7 schema, leaves the foreign key's `index` to the build where this holds, so the stored foreign key states what backs it.\n*/\nfunction declaredIndexesServeForeignKey(columns, table) {\n\treturn derivedBackingIndexIsRedundant(columns, {\n\t\tindexes: table.indexes,\n\t\tnodeOf: indexNodeOf,\n\t\tuniques: table.uniques,\n\t\tprimaryKey: table.primaryKey\n\t});\n}\n/**\n* The name to give a relation's `index` argument when the table's declared indexes and keys serve a foreign key on `columns` although the build would keep a derived backing index beside them (see {@link leadingBackingObjectName}).\n*/\nfunction declaredBackingObjectName(columns, table) {\n\treturn leadingBackingObjectName(columns, {\n\t\tindexes: table.indexes,\n\t\tnodeOf: indexNodeOf,\n\t\tnameOf: (index) => nameOf(index.naming),\n\t\tuniques: table.uniques,\n\t\tprimaryKey: table.primaryKey\n\t});\n}\n/**\n* What a foreign key on `columns` states it is backed by when its relation says nothing, beside a table whose indexes all carry the `name` or `map` the source gave them, as a printed contract's do. A printer writes a relation's `index` argument only where the stored foreign key differs from this.\n*/\nfunction defaultForeignKeyIndex(tableName, columns, table) {\n\tconst reference = {\n\t\tnamespaceId: asNamespaceId(UNBOUND_NAMESPACE_ID),\n\t\ttableName,\n\t\tcolumns\n\t};\n\tconst [foreignKey] = materializeForeignKeysAndIndexes({\n\t\ttableName,\n\t\tforeignKeys: [{\n\t\t\tsource: reference,\n\t\t\ttarget: reference,\n\t\t\tconstraint: true,\n\t\t\tindex: true\n\t\t}],\n\t\tdeclaredIndexes: table.indexes.map((index) => ({\n\t\t\tindex,\n\t\t\tnamedByUser: true\n\t\t})),\n\t\tuniques: table.uniques,\n\t\tprimaryKey: table.primaryKey,\n\t\twarnings: [],\n\t\tindexTypes: void 0\n\t}).foreignKeys;\n\treturn typeof foreignKey?.index === \"object\" ? foreignKey.index : void 0;\n}\nfunction derivedBackingIndex(tableName, columns) {\n\treturn {\n\t\tindex: lowerAuthoredIndex(tableName, {\n\t\t\tcolumns,\n\t\t\twhere: void 0,\n\t\t\tunique: void 0,\n\t\t\tmap: void 0,\n\t\t\tname: truncateToWireNamePrefixBytes(defaultIndexName(tableName, columns)),\n\t\t\ttype: void 0,\n\t\t\toptions: void 0\n\t\t}),\n\t\tnamedByUser: false\n\t};\n}\n/**\n* What a relation's `index: \"<name>\"` points at. The name is the `name` or `map` the source gave an index, unique constraint or primary key, or an index's stored name; an unnamed index's default name does not count. Identical indexes count as one, so the name is resolved after they merge. The object must start with the foreign key's columns, in order, or it would not serve the foreign key's lookups. An index of a type whose body is rendered from its options (see {@link rendersIndexBody}) is refused too: its columns are not its key.\n*/\nfunction namedBackingObject(source, name, table) {\n\tconst { namespaceId, tableName, columns } = source;\n\tconst subject = `The foreign key on table \"${tableName}\" columns (${columns.join(\", \")}) names \"${name}\" as its index`;\n\tconst meta = {\n\t\treason: FOREIGN_KEY_INDEX_UNRESOLVED,\n\t\tnamespaceId,\n\t\ttableName,\n\t\tcolumns,\n\t\tindex: name\n\t};\n\tconst indexes = table.declaredIndexes.filter((candidate) => candidate.namedByUser && writtenName(candidate.index) === name || nameOf(candidate.index.naming) === name);\n\tconst keys = [...table.uniques.filter((unique) => unique.name === name), ...table.primaryKey?.name === name ? [table.primaryKey] : []];\n\tconst resolvedIndexes = [...new Map(indexes.map((index) => {\n\t\tconst resolved = table.resolve({\n\t\t\tkind: \"index\",\n\t\t\tindex\n\t\t});\n\t\treturn [JSON.stringify(resolved), {\n\t\t\tindex,\n\t\t\tresolved\n\t\t}];\n\t})).values()];\n\tconst matches = resolvedIndexes.length + keys.length;\n\tif (matches === 0) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `${subject}, but table \"${tableName}\" has no index, unique constraint or primary key with that name.`, {\n\t\tfix: `Declare an index, unique constraint or primary key named \"${name}\" on table \"${tableName}\", or drop the index argument so the foreign key gets its own backing index.`,\n\t\tmeta\n\t});\n\tif (matches > 1) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `${subject}, but table \"${tableName}\" has more than one index, unique constraint or primary key with that name.`, {\n\t\tfix: `Give the object the foreign key should use a name no other index, unique constraint or primary key of table \"${tableName}\" has, and name that on the relation.`,\n\t\tmeta\n\t});\n\tconst [match] = resolvedIndexes;\n\tconst key = keys[0];\n\tconst matchType = match?.index.index.type;\n\tconst typeEntry = matchType === void 0 ? void 0 : table.indexTypes?.get(matchType);\n\tif (typeEntry !== void 0 && rendersIndexBody(typeEntry)) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `${subject}, but it is a \"${typeEntry.type}\" index, a \"${accessMethodOf(typeEntry)}\" index whose key is rendered from its options rather than its columns, so it does not serve the foreign key's lookups.`, {\n\t\tfix: `Name an index, unique constraint or primary key whose first columns are (${columns.join(\", \")}), or drop the index argument so the foreign key gets its own backing index beside the \"${typeEntry.type}\" index.`,\n\t\tmeta\n\t});\n\tconst objectColumns = match !== void 0 ? match.index.index.columns : key?.columns;\n\tif (objectColumns === void 0 || !startsWithColumns(objectColumns, columns)) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `${subject}, but ${objectColumns === void 0 ? \"it indexes an expression, not the foreign key's columns\" : `its columns (${objectColumns.join(\", \")}) do not start with the foreign key's columns`}, so it does not serve the foreign key's lookups.`, {\n\t\tfix: `Name an index, unique constraint or primary key whose first columns are (${columns.join(\", \")}), or drop the index argument so the foreign key gets its own backing index.`,\n\t\tmeta\n\t});\n\tif (match !== void 0) return match.resolved;\n\treturn key === table.primaryKey ? { primaryKey: true } : { unique: objectColumns };\n}\nfunction resolveReplacement(backing, replacements) {\n\tlet current = backing;\n\twhile (current.kind === \"index\") {\n\t\tconst replacement = replacements.get(current.index);\n\t\tif (replacement === void 0) break;\n\t\tcurrent = replacement;\n\t}\n\treturn current;\n}\nfunction foreignKeyIndexOf(backing) {\n\tswitch (backing.kind) {\n\t\tcase \"index\": return { name: nameOf(backing.index.index.naming) };\n\t\tcase \"uniqueConstraint\": return { unique: backing.unique.columns };\n\t\tcase \"primaryKey\": return { primaryKey: true };\n\t}\n}\n//#endregion\nexport { FOREIGN_KEY_INDEX_UNRESOLVED, declaredBackingObjectName, declaredIndexesServeForeignKey, defaultForeignKeyIndex, derivedBackingIndexIsRedundant, leadingBackingObjectName, materializeForeignKeysAndIndexes };\n\n//# sourceMappingURL=foreign-key-materialization.mjs.map"],"mappings":";;;;;;;;;AASA,MAAM,wBAAwB;AAC9B,MAAM,wBAAwB;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AA4E,QAAQ,KAAK,IAAI,EAAE,0FAA0F,UAAU,KAAK;EAC7M;CACD,CAAC;CACD,MAAM,gBAAgB,UAAU,KAAK,IAAI,MAAM,MAAM,MAAM,UAAU,KAAK;CAC1E,IAAI,kBAAkB,KAAK,KAAK,CAAC,kBAAkB,eAAe,OAAO,GAAG,MAAM,cAAc,6BAA6B,GAAG,QAAQ,QAAQ,kBAAkB,KAAK,IAAI,4DAA4D,gBAAgB,cAAc,KAAK,IAAI,EAAE,+CAA+C,oDAAoD;EAClX,KAAK,4EAA4E,QAAQ,KAAK,IAAI,EAAE;EACpG;CACD,CAAC;CACD,IAAI,UAAU,KAAK,GAAG,OAAO,MAAM;CACnC,OAAO,QAAQ,MAAM,aAAa,EAAE,YAAY,KAAK,IAAI,EAAE,QAAQ,cAAc;AAClF;AACA,SAAS,mBAAmB,SAAS,cAAc;CAClD,IAAI,UAAU;CACd,OAAO,QAAQ,SAAS,SAAS;EAChC,MAAM,cAAc,aAAa,IAAI,QAAQ,KAAK;EAClD,IAAI,gBAAgB,KAAK,GAAG;EAC5B,UAAU;CACX;CACA,OAAO;AACR;AACA,SAAS,kBAAkB,SAAS;CACnC,QAAQ,QAAQ,MAAhB;EACC,KAAK,SAAS,OAAO,EAAE,MAAM,OAAO,QAAQ,MAAM,MAAM,MAAM,EAAE;EAChE,KAAK,oBAAoB,OAAO,EAAE,QAAQ,QAAQ,OAAO,QAAQ;EACjE,KAAK,cAAc,OAAO,EAAE,YAAY,KAAK;CAC9C;AACD"}
1
+ {"version":3,"file":"foreign-key-materialization-BPQqd0qF.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/foreign-key-materialization.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { a as rendersIndexBody, t as accessMethodOf } from \"./index-types-pC_5vADQ.mjs\";\nimport { r as lowerAuthoredIndex } from \"./index-naming-BOcJT1B3.mjs\";\nimport { i as leadingBackingObjectName, n as identicalIndexes, o as servingKey, r as indexNodeOf, s as startsWithColumns, t as derivedBackingIndexIsRedundant } from \"./index-equivalence-DswCiq5l.mjs\";\nimport { defaultIndexName, nameOf, truncateToWireNamePrefixBytes } from \"@internal/sql-schema-ir/naming\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { asNamespaceId } from \"@internal/contract/types\";\n//#region src/index-deduplication.ts\nconst IDENTICAL_DESCRIPTION = \"the planner sees them as the same index. The contract keeps both because each is named.\";\nconst REDUNDANT_DESCRIPTION = \"which already serves the same lookups.\";\n/**\n* Removes the indexes of one table that duplicate another. Two indexes are identical when the planner sees them as the same index apart from their names (see {@link identicalIndexes}); of an identical group the pass keeps the indexes named by the user, or the first one when none is. A plain non-unique index whose columns are those of the primary key, a unique constraint or a unique index without a predicate is redundant (see {@link servingKey}), and the pass removes it unless it is named by the user. Every index named by the user survives; the pass warns about each one that duplicates another, and refuses two identical indexes both named with `name:`, whose wire names the planner could not tell apart.\n*/\nfunction deduplicateIndexes(input) {\n\tconst { tableName, warnings } = input;\n\tconst replacements = /* @__PURE__ */ new Map();\n\tconst nodes = new Map(input.indexes.map((candidate) => [candidate, indexNodeOf(candidate.index)]));\n\tconst nodeOf = (candidate) => {\n\t\tconst node = nodes.get(candidate);\n\t\tif (node === void 0) throw new InternalError(\"every candidate has a node\");\n\t\treturn node;\n\t};\n\tconst groups = [];\n\tfor (const candidate of input.indexes) {\n\t\tconst position = groups.findIndex(([first]) => identicalIndexes(nodeOf(first), nodeOf(candidate)));\n\t\tconst group = groups[position];\n\t\tif (group === void 0) groups.push([candidate]);\n\t\telse groups[position] = [...group, candidate];\n\t}\n\tfor (const group of groups) {\n\t\tconst named = group.filter((candidate) => candidate.namedByUser);\n\t\tconst wireNamed = named.filter((candidate) => candidate.index.naming.kind === \"wire\");\n\t\tif (wireNamed.length > 1) throw identicalWireNamedIndexesError(tableName, wireNamed);\n\t\tconst kept = named[0] ?? group[0];\n\t\tfor (const candidate of group) if (candidate !== kept && !candidate.namedByUser) replacements.set(candidate, {\n\t\t\tkind: \"index\",\n\t\t\tindex: kept\n\t\t});\n\t\tif (named.length > 1) warnings.push(identicalIndexesWarning(tableName, named));\n\t}\n\tconst survivors = input.indexes.filter((candidate) => !replacements.has(candidate));\n\tfor (const candidate of survivors) {\n\t\tconst servedBy = servingKey(nodeOf(candidate), {\n\t\t\tindexes: survivors,\n\t\t\tnodeOf,\n\t\t\tuniques: input.uniques,\n\t\t\tprimaryKey: input.primaryKey\n\t\t});\n\t\tif (servedBy === void 0) continue;\n\t\tif (candidate.namedByUser) warnings.push(redundantIndexWarning(tableName, candidate, servedBy));\n\t\telse replacements.set(candidate, servedBy);\n\t}\n\treturn {\n\t\tindexes: input.indexes.filter((candidate) => !replacements.has(candidate)),\n\t\treplacements\n\t};\n}\nfunction identicalWireNamedIndexesError(tableName, wireNamed) {\n\treturn contractError(\"CONTRACT.ARGUMENT_INVALID\", `Indexes ${quotedList(wireNamed.map((candidate) => writtenName(candidate.index)))} on table \"${tableName}\" are identical and both named with name:; the planner pairs wire-named indexes by their content, so it could not tell them apart.`, {\n\t\tfix: \"Remove one of them, or name one with map: to keep both under exact names.\",\n\t\tmeta: {\n\t\t\ttableName,\n\t\t\tindexes: wireNamed.map((candidate) => writtenName(candidate.index))\n\t\t}\n\t});\n}\n/** The name the source wrote: the prefix of a wire-named index, the whole name of an exact one. */\nfunction writtenName(index) {\n\treturn index.naming.kind === \"wire\" ? index.naming.prefix : index.naming.name;\n}\nfunction quotedList(names) {\n\tconst quoted = names.map((name) => `\"${name}\"`);\n\treturn quoted.length <= 2 ? quoted.join(\" and \") : `${quoted.slice(0, -1).join(\", \")} and ${quoted.at(-1)}`;\n}\nfunction identicalIndexesWarning(tableName, named) {\n\tconst names = quotedList(named.map((candidate) => writtenName(candidate.index)));\n\treturn {\n\t\tcode: \"PN_INDEX_DUPLICATE\",\n\t\tmessage: `Indexes ${names} on table \"${tableName}\" are identical: ${IDENTICAL_DESCRIPTION} Remove one of them.`,\n\t\titem: `table \"${tableName}\": indexes ${names}`,\n\t\tsummary: `tables have named indexes that are identical: ${IDENTICAL_DESCRIPTION} Remove one of each.`\n\t};\n}\nfunction describeReplacement(replacement) {\n\tswitch (replacement.kind) {\n\t\tcase \"primaryKey\": return \"the primary key\";\n\t\tcase \"uniqueConstraint\": return replacement.unique.name === void 0 ? `the unique constraint on (${replacement.unique.columns.join(\", \")})` : `the unique constraint \"${replacement.unique.name}\"`;\n\t\tcase \"index\": return `the unique index \"${writtenName(replacement.index.index)}\"`;\n\t}\n}\nfunction redundantIndexWarning(tableName, candidate, servedBy) {\n\tconst name = writtenName(candidate.index);\n\treturn {\n\t\tcode: \"PN_INDEX_REDUNDANT\",\n\t\tmessage: `Index \"${name}\" on table \"${tableName}\" has the same columns as ${describeReplacement(servedBy)}, ${REDUNDANT_DESCRIPTION} The contract keeps the index because it is named. Remove it.`,\n\t\titem: `table \"${tableName}\": index \"${name}\"`,\n\t\tsummary: `tables have a named index with the same columns as a unique constraint, unique index or primary key, ${REDUNDANT_DESCRIPTION} The contract keeps each index because it is named. Remove them.`\n\t};\n}\n//#endregion\n//#region src/foreign-key-materialization.ts\n/** The `meta.reason` of the refusal of a relation's `index: \"<name>\"`, which a source can report at the relation. */\nconst FOREIGN_KEY_INDEX_UNRESOLVED = \"foreign-key-index-unresolved\";\n/**\n* Lowers a table's authored foreign keys and indexes into the entities `contract.json` persists. A `constraint: false` foreign key contributes no `foreignKeys[]` entry. A foreign key with `index: true` gets a derived backing index; one with `index: \"<name>\"` uses what the table declares under that name. The table's indexes then pass through {@link deduplicateIndexes}, and each foreign key states what backs it in the result: an index by name, or the primary key or a unique constraint by kind.\n*/\nfunction materializeForeignKeysAndIndexes(input) {\n\tconst { tableName, declaredIndexes, uniques, primaryKey, indexTypes } = input;\n\tconst derivedIndexes = [];\n\tconst intents = input.foreignKeys.map((foreignKey) => {\n\t\tconst { constraint, index, ...reference } = foreignKey;\n\t\tif (index !== true) return {\n\t\t\tconstraint,\n\t\t\treference,\n\t\t\tindex\n\t\t};\n\t\tconst derived = derivedBackingIndex(tableName, reference.source.columns);\n\t\tderivedIndexes.push(derived);\n\t\treturn {\n\t\t\tconstraint,\n\t\t\treference,\n\t\t\tindex: derived\n\t\t};\n\t});\n\tconst deduplicated = deduplicateIndexes({\n\t\ttableName,\n\t\tindexes: [...declaredIndexes, ...derivedIndexes],\n\t\tuniques,\n\t\tprimaryKey,\n\t\twarnings: input.warnings\n\t});\n\tconst resolve = (backing) => foreignKeyIndexOf(resolveReplacement(backing, deduplicated.replacements));\n\treturn {\n\t\tforeignKeys: intents.flatMap(({ constraint, reference, index }) => {\n\t\t\tconst backing = index === false ? void 0 : typeof index === \"string\" ? namedBackingObject(reference.source, index, {\n\t\t\t\tdeclaredIndexes,\n\t\t\t\tuniques,\n\t\t\t\tprimaryKey,\n\t\t\t\tindexTypes,\n\t\t\t\tresolve\n\t\t\t}) : resolve({\n\t\t\t\tkind: \"index\",\n\t\t\t\tindex\n\t\t\t});\n\t\t\tif (!constraint) return [];\n\t\t\treturn [backing === void 0 ? reference : {\n\t\t\t\t...reference,\n\t\t\t\tindex: backing\n\t\t\t}];\n\t\t}),\n\t\tindexes: deduplicated.indexes.map((candidate) => candidate.index)\n\t};\n}\n/**\n* Whether a table's declared indexes, unique constraints or primary key already serve a foreign key on `columns`, so the build would drop a derived backing index again. A source that writes no backing index of its own, such as a Prisma 7 schema, leaves the foreign key's `index` to the build where this holds, so the stored foreign key states what backs it.\n*/\nfunction declaredIndexesServeForeignKey(columns, table) {\n\treturn derivedBackingIndexIsRedundant(columns, {\n\t\tindexes: table.indexes,\n\t\tnodeOf: indexNodeOf,\n\t\tuniques: table.uniques,\n\t\tprimaryKey: table.primaryKey\n\t});\n}\n/**\n* The name to give a relation's `index` argument when the table's declared indexes and keys serve a foreign key on `columns` although the build would keep a derived backing index beside them (see {@link leadingBackingObjectName}).\n*/\nfunction declaredBackingObjectName(columns, table) {\n\treturn leadingBackingObjectName(columns, {\n\t\tindexes: table.indexes,\n\t\tnodeOf: indexNodeOf,\n\t\tnameOf: (index) => nameOf(index.naming),\n\t\tuniques: table.uniques,\n\t\tprimaryKey: table.primaryKey\n\t});\n}\n/**\n* What a foreign key on `columns` states it is backed by when its relation says nothing, beside a table whose indexes all carry the `name` or `map` the source gave them, as a printed contract's do. A printer writes a relation's `index` argument only where the stored foreign key differs from this.\n*/\nfunction defaultForeignKeyIndex(tableName, columns, table) {\n\tconst reference = {\n\t\tnamespaceId: asNamespaceId(UNBOUND_NAMESPACE_ID),\n\t\ttableName,\n\t\tcolumns\n\t};\n\tconst [foreignKey] = materializeForeignKeysAndIndexes({\n\t\ttableName,\n\t\tforeignKeys: [{\n\t\t\tsource: reference,\n\t\t\ttarget: reference,\n\t\t\tconstraint: true,\n\t\t\tindex: true\n\t\t}],\n\t\tdeclaredIndexes: table.indexes.map((index) => ({\n\t\t\tindex,\n\t\t\tnamedByUser: true\n\t\t})),\n\t\tuniques: table.uniques,\n\t\tprimaryKey: table.primaryKey,\n\t\twarnings: [],\n\t\tindexTypes: void 0\n\t}).foreignKeys;\n\treturn typeof foreignKey?.index === \"object\" ? foreignKey.index : void 0;\n}\nfunction derivedBackingIndex(tableName, columns) {\n\treturn {\n\t\tindex: lowerAuthoredIndex(tableName, {\n\t\t\tcolumns,\n\t\t\twhere: void 0,\n\t\t\tunique: void 0,\n\t\t\tmap: void 0,\n\t\t\tname: truncateToWireNamePrefixBytes(defaultIndexName(tableName, columns)),\n\t\t\ttype: void 0,\n\t\t\toptions: void 0\n\t\t}),\n\t\tnamedByUser: false\n\t};\n}\n/**\n* What a relation's `index: \"<name>\"` points at. The name is the `name` or `map` the source gave an index, unique constraint or primary key, or an index's stored name; an unnamed index's default name does not count. Identical indexes count as one, so the name is resolved after they merge. The object must start with the foreign key's columns, in order, or it would not serve the foreign key's lookups. An index of a type whose body is rendered from its options (see {@link rendersIndexBody}) is refused too: its columns are not its key.\n*/\nfunction namedBackingObject(source, name, table) {\n\tconst { namespaceId, tableName, columns } = source;\n\tconst subject = `The foreign key on table \"${tableName}\" columns (${columns.join(\", \")}) names \"${name}\" as its index`;\n\tconst meta = {\n\t\treason: FOREIGN_KEY_INDEX_UNRESOLVED,\n\t\tnamespaceId,\n\t\ttableName,\n\t\tcolumns,\n\t\tindex: name\n\t};\n\tconst indexes = table.declaredIndexes.filter((candidate) => candidate.namedByUser && writtenName(candidate.index) === name || nameOf(candidate.index.naming) === name);\n\tconst keys = [...table.uniques.filter((unique) => unique.name === name), ...table.primaryKey?.name === name ? [table.primaryKey] : []];\n\tconst resolvedIndexes = [...new Map(indexes.map((index) => {\n\t\tconst resolved = table.resolve({\n\t\t\tkind: \"index\",\n\t\t\tindex\n\t\t});\n\t\treturn [JSON.stringify(resolved), {\n\t\t\tindex,\n\t\t\tresolved\n\t\t}];\n\t})).values()];\n\tconst matches = resolvedIndexes.length + keys.length;\n\tif (matches === 0) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `${subject}, but table \"${tableName}\" has no index, unique constraint or primary key with that name.`, {\n\t\tfix: `Declare an index, unique constraint or primary key named \"${name}\" on table \"${tableName}\", or drop the index argument so the foreign key gets its own backing index.`,\n\t\tmeta\n\t});\n\tif (matches > 1) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `${subject}, but table \"${tableName}\" has more than one index, unique constraint or primary key with that name.`, {\n\t\tfix: `Give the object the foreign key should use a name no other index, unique constraint or primary key of table \"${tableName}\" has, and name that on the relation.`,\n\t\tmeta\n\t});\n\tconst [match] = resolvedIndexes;\n\tconst key = keys[0];\n\tconst matchType = match?.index.index.type;\n\tconst typeEntry = matchType === void 0 ? void 0 : table.indexTypes?.get(matchType);\n\tif (typeEntry !== void 0 && rendersIndexBody(typeEntry)) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `${subject}, but it is a \"${typeEntry.type}\" index, a \"${accessMethodOf(typeEntry)}\" index whose key is rendered from its options rather than its columns, so it does not serve the foreign key's lookups.`, {\n\t\tfix: `Name an index, unique constraint or primary key whose first columns are (${columns.join(\", \")}), or drop the index argument so the foreign key gets its own backing index beside the \"${typeEntry.type}\" index.`,\n\t\tmeta\n\t});\n\tconst objectColumns = match !== void 0 ? match.index.index.columns : key?.columns;\n\tif (objectColumns === void 0 || !startsWithColumns(objectColumns, columns)) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `${subject}, but ${objectColumns === void 0 ? \"it indexes an expression, not the foreign key's columns\" : `its columns (${objectColumns.join(\", \")}) do not start with the foreign key's columns`}, so it does not serve the foreign key's lookups.`, {\n\t\tfix: `Name an index, unique constraint or primary key whose first columns are (${columns.join(\", \")}), or drop the index argument so the foreign key gets its own backing index.`,\n\t\tmeta\n\t});\n\tif (match !== void 0) return match.resolved;\n\treturn key === table.primaryKey ? { primaryKey: true } : { unique: objectColumns };\n}\nfunction resolveReplacement(backing, replacements) {\n\tlet current = backing;\n\twhile (current.kind === \"index\") {\n\t\tconst replacement = replacements.get(current.index);\n\t\tif (replacement === void 0) break;\n\t\tcurrent = replacement;\n\t}\n\treturn current;\n}\nfunction foreignKeyIndexOf(backing) {\n\tswitch (backing.kind) {\n\t\tcase \"index\": return { name: nameOf(backing.index.index.naming) };\n\t\tcase \"uniqueConstraint\": return { unique: backing.unique.columns };\n\t\tcase \"primaryKey\": return { primaryKey: true };\n\t}\n}\n//#endregion\nexport { FOREIGN_KEY_INDEX_UNRESOLVED, declaredBackingObjectName, declaredIndexesServeForeignKey, defaultForeignKeyIndex, derivedBackingIndexIsRedundant, leadingBackingObjectName, materializeForeignKeysAndIndexes };\n\n//# sourceMappingURL=foreign-key-materialization.mjs.map"],"mappings":";;;;;;;;;AASA,MAAM,wBAAwB;AAC9B,MAAM,wBAAwB;;;;AAI9B,SAAS,mBAAmB,OAAO;CAClC,MAAM,EAAE,WAAW,aAAa;CAChC,MAAM,+BAA+B,IAAI,IAAI;CAC7C,MAAM,QAAQ,IAAI,IAAI,MAAM,QAAQ,KAAK,cAAc,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BAAkB,KAAK,KAAK,CAAC,kBAAkB,eAAe,OAAO,GAAG,MAAM,cAAc,6BAA6B,GAAG,QAAQ,QAAQ,kBAAkB,KAAK,IAAI,4DAA4D,gBAAgB,cAAc,KAAK,IAAI,EAAE,+CAA+C,oDAAoD;EAClX,KAAK,4EAA4E,QAAQ,KAAK,IAAI,EAAE;EACpG;CACD,CAAC;CACD,IAAI,UAAU,KAAK,GAAG,OAAO,MAAM;CACnC,OAAO,QAAQ,MAAM,aAAa,EAAE,YAAY,KAAK,IAAI,EAAE,QAAQ,cAAc;AAClF;AACA,SAAS,mBAAmB,SAAS,cAAc;CAClD,IAAI,UAAU;CACd,OAAO,QAAQ,SAAS,SAAS;EAChC,MAAM,cAAc,aAAa,IAAI,QAAQ,KAAK;EAClD,IAAI,gBAAgB,KAAK,GAAG;EAC5B,UAAU;CACX;CACA,OAAO;AACR;AACA,SAAS,kBAAkB,SAAS;CACnC,QAAQ,QAAQ,MAAhB;EACC,KAAK,SAAS,OAAO,EAAE,MAAM,OAAO,QAAQ,MAAM,MAAM,MAAM,EAAE;EAChE,KAAK,oBAAoB,OAAO,EAAE,QAAQ,QAAQ,OAAO,QAAQ;EACjE,KAAK,cAAc,OAAO,EAAE,YAAY,KAAK;CAC9C;AACD"}
@@ -2,8 +2,8 @@ import { a as ForeignKeyReferenceInput, n as ForeignKeyIndex, o as ReferentialAc
2
2
  import { i as UniqueConstraintInput, n as PrimaryKeyInput } from "./unique-constraint-M5TlQnJQ-BiIHJ85k.mjs";
3
3
  import { r as IndexInput } from "./sql-index-ByAAE7K8-BpbPBWPD.mjs";
4
4
  import { a as IndexTypeRegistry } from "./index-types-H1O43iYT-ONvDbszL.mjs";
5
- import { _ as SqlIndexIR } from "./types-B3AHHPDh-BHh-89fY.mjs";
6
- import "./types-BGERR8XF.mjs";
5
+ import { _ as SqlIndexIR } from "./types-DiD6BqoN-ZF53hwPp.mjs";
6
+ import "./types-D_nlUp-1.mjs";
7
7
  import { AuthoringWarningSink } from "@prisma/orm-framework/components/authoring";
8
8
  //#region ../../../2-sql/1-core/contract/dist/foreign-key-materialization.d.mts
9
9
  //#region src/index-equivalence.d.ts
@@ -95,4 +95,4 @@ declare function defaultForeignKeyIndex(tableName: string, columns: readonly str
95
95
  }): ForeignKeyIndex | undefined;
96
96
  //#endregion
97
97
  export { declaredBackingObjectName as a, derivedBackingIndexIsRedundant as c, MaterializedTableConstraints as i, leadingBackingObjectName as l, ForeignKeyAuthoringInput as n, declaredIndexesServeForeignKey as o, IndexCandidate as r, defaultForeignKeyIndex as s, FOREIGN_KEY_INDEX_UNRESOLVED as t, materializeForeignKeysAndIndexes as u };
98
- //# sourceMappingURL=foreign-key-materialization-3vQnPT_D.d.mts.map
98
+ //# sourceMappingURL=foreign-key-materialization-bL-t2oPB.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"foreign-key-materialization-3vQnPT_D.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/foreign-key-materialization.d.mts"],"mappings":";;;;;;;;;KAOK;WACM;;UAED,WAAW,QAAQ,gBAAgB,OAAO,oBAAoB;WAC7D,kBAAkB;WAClB,SAAS,OAAO,WAAW;WAC3B,kBAAkB;WAClB,YAAY;;;;;iBAKN,+BAA+B,QAAQ,gBAAgB,OAAO,oBAAoB,OAAO,4BAA4B,OAAO,WAAW,QAAQ,SAAS;KACpK,WAAW;WACL;;;;;iBAKM,yBAAyB,QAAQ,gBAAgB,UAAU,oBAAoB,UAAU,4BAA4B,OAAO,WAAW,QAAQ,SAAS;WAC9J,SAAS,OAAO;;;;;UAKjB;WACC,OAAO;;WAEP;;;;;cAKG;;;;UAIJ;WACC,QAAQ;WACR,QAAQ;WACR;WACA,WAAW;WACX,WAAW;WACX;WACA;;UAED;WACC,sBAAsB;WACtB,kBAAkB;;;;;iBAKZ,iCAAiC;WACvC;WACA,sBAAsB;WACtB,0BAA0B;WAC1B,kBAAkB;WAClB,YAAY;WACZ,UAAU;WACV,YAAY,KAAK;IACxB;;;;iBAIa,+BAA+B,4BAA4B;WACjE,kBAAkB;WAClB,kBAAkB;WAClB,YAAY;;;;;iBAKN,0BAA0B,4BAA4B;WAC5D,kBAAkB;WAClB,kBAAkB;WAClB,YAAY;;;;;iBAKN,uBAAuB,mBAAmB,4BAA4B;WAC5E,kBAAkB;WAClB,kBAAkB;WAClB,YAAY;IACnB"}
1
+ {"version":3,"file":"foreign-key-materialization-bL-t2oPB.d.mts","names":[],"sources":["../../../../2-sql/1-core/contract/dist/foreign-key-materialization.d.mts"],"mappings":";;;;;;;;;KAOK;WACM;;UAED,WAAW,QAAQ,gBAAgB,OAAO,oBAAoB;WAC7D,kBAAkB;WAClB,SAAS,OAAO,WAAW;WAC3B,kBAAkB;WAClB,YAAY;;;;;iBAKN,+BAA+B,QAAQ,gBAAgB,OAAO,oBAAoB,OAAO,4BAA4B,OAAO,WAAW,QAAQ,SAAS;KACpK,WAAW;WACL;;;;;iBAKM,yBAAyB,QAAQ,gBAAgB,UAAU,oBAAoB,UAAU,4BAA4B,OAAO,WAAW,QAAQ,SAAS;WAC9J,SAAS,OAAO;;;;;UAKjB;WACC,OAAO;;WAEP;;;;;cAKG;;;;UAIJ;WACC,QAAQ;WACR,QAAQ;WACR;WACA,WAAW;WACX,WAAW;WACX;WACA;;UAED;WACC,sBAAsB;WACtB,kBAAkB;;;;;iBAKZ,iCAAiC;WACvC;WACA,sBAAsB;WACtB,0BAA0B;WAC1B,kBAAkB;WAClB,YAAY;WACZ,UAAU;WACV,YAAY,KAAK;IACxB;;;;iBAIa,+BAA+B,4BAA4B;WACjE,kBAAkB;WAClB,kBAAkB;WAClB,YAAY;;;;;iBAKN,0BAA0B,4BAA4B;WAC5D,kBAAkB;WAClB,kBAAkB;WAClB,YAAY;;;;;iBAKN,uBAAuB,mBAAmB,4BAA4B;WAC5E,kBAAkB;WAClB,kBAAkB;WAClB,YAAY;IACnB"}
@@ -1,10 +1,10 @@
1
- import { c as enumType } from "./contract-builder-DmX4XnJa.mjs";
2
- import { c as SQL_VARCHAR_CODEC_ID, i as SQL_CHAR_CODEC_ID, s as SQL_TEXT_CODEC_ID } from "./ast-CBO3PEJF.mjs";
1
+ import { c as enumType } from "./contract-builder-D3XaKpyw.mjs";
2
+ import { c as SQL_TEXT_CODEC_ID, i as SQL_CHAR_CODEC_ID, l as SQL_VARCHAR_CODEC_ID } from "./ast-BJs2669T.mjs";
3
3
  import { readEnumBlockMembers, resolveEnumCodecId } from "@prisma/orm-framework/components/authoring";
4
4
  import { enumRefusalOf, requiredParamKeys } from "@prisma/orm-framework/components/codec";
5
5
  import { singleGeneratorBinding } from "@prisma/orm-framework/components/components";
6
6
  import { blockAttribute, int, jsonValue, mapBlock, num, oneOf, optional, str } from "@prisma/orm-framework/psl-parser";
7
- //#region ../../../2-sql/9-family/dist/generator-functions-B4gRRYZB.mjs
7
+ //#region ../../../2-sql/9-family/dist/generator-functions-BoE7Lc9d.mjs
8
8
  function sqlFamilyEnumSpec() {
9
9
  return mapBlock({
10
10
  value: {
@@ -246,22 +246,39 @@ const sqlFamilyAuthoringFieldPresets = {
246
246
  }
247
247
  }
248
248
  };
249
- const sqlFamilyAuthoringTypes = { sql: { String: {
250
- kind: "typeConstructor",
251
- documentation: "Variable-length text with a required maximum character length.",
252
- args: [{
253
- kind: "number",
254
- name: "length",
255
- integer: true
256
- }],
257
- output: {
258
- codecId: "sql/varchar@1",
259
- typeParams: { length: {
260
- kind: "arg",
261
- index: 0
262
- } }
263
- }
264
- } } };
249
+ const sqlFamilyAuthoringTypes = {
250
+ Raw: {
251
+ kind: "typeConstructor",
252
+ documentation: "A column of a type no other column type covers, written exactly as the database catalog prints it, such as Raw(\"tsvector\"). Its values are typed unknown, and its default is a sql expression.",
253
+ args: [{
254
+ kind: "string",
255
+ name: "sql"
256
+ }],
257
+ output: {
258
+ codecId: "sql/raw@1",
259
+ typeParams: { sql: {
260
+ kind: "arg",
261
+ index: 0
262
+ } }
263
+ }
264
+ },
265
+ sql: { String: {
266
+ kind: "typeConstructor",
267
+ documentation: "Variable-length text with a required maximum character length.",
268
+ args: [{
269
+ kind: "number",
270
+ name: "length",
271
+ integer: true
272
+ }],
273
+ output: {
274
+ codecId: "sql/varchar@1",
275
+ typeParams: { length: {
276
+ kind: "arg",
277
+ index: 0
278
+ } }
279
+ }
280
+ } }
281
+ };
265
282
  const NANOID_DEFAULT_SIZE = 21;
266
283
  const NANOID_MIN_SIZE = 2;
267
284
  const NANOID_MAX_SIZE = 255;
@@ -463,4 +480,4 @@ const sqlFamilyGeneratorDescriptors = [...new Set(sqlFamilyGeneratorFunctions.fl
463
480
  //#endregion
464
481
  export { sqlFamilyGeneratorDescriptors as a, sqlFamilyEntityTypes as i, sqlFamilyAuthoringFieldPresets as n, sqlFamilyGeneratorFunctions as o, sqlFamilyAuthoringTypes as r, sqlFamilyPslBlockDescriptors as s, idGeneratorFunctionBindings as t };
465
482
 
466
- //# sourceMappingURL=generator-functions-B4gRRYZB-BTtC2KQz.mjs.map
483
+ //# sourceMappingURL=generator-functions-BoE7Lc9d-MgcgdnPZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator-functions-BoE7Lc9d-MgcgdnPZ.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/generator-functions-BoE7Lc9d.mjs"],"sourcesContent":["import { readEnumBlockMembers, resolveEnumCodecId } from \"@internal/framework-components/authoring\";\nimport { enumRefusalOf, requiredParamKeys } from \"@internal/framework-components/codec\";\nimport { blockAttribute, int, jsonValue, mapBlock, num, oneOf, optional, str } from \"@internal/psl-parser\";\nimport { enumType } from \"@internal/sql-contract-ts/contract-builder\";\nimport { singleGeneratorBinding } from \"@internal/framework-components/components\";\nimport { SQL_CHAR_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID } from \"@internal/sql-relational-core/ast\";\n//#region src/core/authoring-entity-types.ts\nfunction sqlFamilyEnumSpec() {\n\treturn mapBlock({\n\t\tvalue: {\n\t\t\ttype: jsonValue(),\n\t\t\tdocumentation: \"The stored member value; a bare member stores its own name.\"\n\t\t},\n\t\tallowBare: true\n\t});\n}\nconst sqlFamilyEntityTypes = { enum: {\n\tkind: \"entity\",\n\tdiscriminator: \"enum\",\n\toutput: { factory: (block, ctx) => {\n\t\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\t\tconst diagnostics = ctx.diagnostics;\n\t\tconst resolved = resolveEnumCodecId(block, ctx);\n\t\tif (resolved === void 0) return;\n\t\tconst { codecId, codecSpan } = resolved;\n\t\tconst descriptor = ctx.codecLookup.descriptorFor(codecId);\n\t\tconst codec = ctx.codecLookup.get(codecId);\n\t\tif (descriptor === void 0 || codec === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type references unknown codec \"${codecId}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst enumRefusal = enumRefusalOf(descriptor);\n\t\tif (enumRefusal !== void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" cannot use the codec \"${codecId}\". ${enumRefusal}`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst dataType = ctx.dataTypeLookup.get(descriptor.dataType);\n\t\tif (dataType === void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_EXTENSION_INVALID_VALUE\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type codec \"${codecId}\" represents data type \"${descriptor.dataType}\", which no component registers`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst [requiredParam] = requiredParamKeys(dataType);\n\t\tif (requiredParam !== void 0) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: \"PSL_ENUM_TYPE_NEEDS_PARAMETERS\",\n\t\t\t\tmessage: `enum \"${block.name}\" @@type codec \"${codecId}\" represents data type \"${dataType.id}\", which requires the parameter \"${requiredParam}\"; an enum block gives it none`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: codecSpan\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst members = readEnumBlockMembers(block, codecId, codec, ctx);\n\t\tif (members === void 0) return void 0;\n\t\treturn enumType(block.name, { codecId }, ...members);\n\t} }\n} };\nconst enumTypeBlockAttribute = blockAttribute(\"type\", {\n\tdocumentation: \"Selects the storage codec for this enum.\",\n\tpositional: [{\n\t\tkey: \"codecId\",\n\t\ttype: str(),\n\t\tdocumentation: \"The fully qualified codec identifier used to store enum values.\"\n\t}]\n});\nconst sqlFamilyPslBlockDescriptors = { enum: {\n\tkind: \"pslBlock\",\n\tkeyword: \"enum\",\n\tdocumentation: \"Defines an enum with named values and an inferred or explicitly selected storage codec.\",\n\tdiscriminator: \"enum\",\n\tname: { required: true },\n\tspec: sqlFamilyEnumSpec,\n\tattributes: { type: () => enumTypeBlockAttribute }\n} };\n//#endregion\n//#region src/core/authoring-field-presets.ts\n/**\n* Family-level SQL authoring field presets.\n*\n* Only presets whose codec IDs align with the ID generator metadata live here\n* (see `@internal/ids`). These presets are target-agnostic because the\n* generator metadata fixes their codec/native-type to `sql/char@1`\n* (`character`) regardless of target, and the PSL interpreter lets the\n* generator override the scalar descriptor.\n*\n* The `uuidString` / `id.uuidv4String` / `id.uuidv7String` presets store UUID\n* values as `character(36)` — portable across all SQL targets. For a native\n* Postgres `uuid` column use `uuidNative` / `id.uuidv4Native` /\n* `id.uuidv7Native` from `@internal/target-postgres`.\n*\n* Scalar presets that map to target-specific codecs (e.g. `text`, `int`,\n* `boolean`, `dateTime`) are contributed by the target pack (see\n* `postgresAuthoringFieldPresets` in `@internal/target-postgres`) so the\n* TS callback surface and the PSL scalar surface lower to byte-identical\n* contracts for the active target.\n*/\nconst CHARACTER_CODEC_ID = \"sql/char@1\";\nconst nanoidOptionsArgument = {\n\tkind: \"object\",\n\toptional: true,\n\tproperties: { size: {\n\t\tkind: \"number\",\n\t\toptional: true,\n\t\tinteger: true,\n\t\tminimum: 2,\n\t\tmaximum: 255\n\t} }\n};\nconst sqlFamilyAuthoringFieldPresets = {\n\tuuidString: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\ttypeParams: { length: 36 }\n\t\t}\n\t},\n\tulid: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\ttypeParams: { length: 26 }\n\t\t}\n\t},\n\tnanoid: {\n\t\tkind: \"fieldPreset\",\n\t\targs: [nanoidOptionsArgument],\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0,\n\t\t\t\tpath: [\"size\"],\n\t\t\t\tdefault: 21\n\t\t\t} }\n\t\t}\n\t},\n\tcuid2: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\ttypeParams: { length: 24 }\n\t\t}\n\t},\n\tksuid: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\ttypeParams: { length: 27 }\n\t\t}\n\t},\n\tid: {\n\t\tuuidv4String: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\ttypeParams: { length: 36 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv4\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tuuidv7String: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\ttypeParams: { length: 36 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv7\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tulid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\ttypeParams: { length: 26 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"ulid\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tnanoid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\targs: [nanoidOptionsArgument],\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\ttypeParams: { length: {\n\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\tindex: 0,\n\t\t\t\t\tpath: [\"size\"],\n\t\t\t\t\tdefault: 21\n\t\t\t\t} },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"nanoid\",\n\t\t\t\t\tparams: { size: {\n\t\t\t\t\t\tkind: \"arg\",\n\t\t\t\t\t\tindex: 0,\n\t\t\t\t\t\tpath: [\"size\"]\n\t\t\t\t\t} }\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tcuid2: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\ttypeParams: { length: 24 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"cuid2\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tksuid: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: CHARACTER_CODEC_ID,\n\t\t\t\ttypeParams: { length: 27 },\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"ksuid\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t}\n\t}\n};\n//#endregion\n//#region src/core/authoring-type-constructors.ts\nconst sqlFamilyAuthoringTypes = {\n\tRaw: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A column of a type no other column type covers, written exactly as the database catalog prints it, such as Raw(\\\"tsvector\\\"). Its values are typed unknown, and its default is a sql expression.\",\n\t\targs: [{\n\t\t\tkind: \"string\",\n\t\t\tname: \"sql\"\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"sql/raw@1\",\n\t\t\ttypeParams: { sql: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t},\n\tsql: { String: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Variable-length text with a required maximum character length.\",\n\t\targs: [{\n\t\t\tkind: \"number\",\n\t\t\tname: \"length\",\n\t\t\tinteger: true\n\t\t}],\n\t\toutput: {\n\t\t\tcodecId: \"sql/varchar@1\",\n\t\t\ttypeParams: { length: {\n\t\t\t\tkind: \"arg\",\n\t\t\t\tindex: 0\n\t\t\t} }\n\t\t}\n\t} }\n};\n//#endregion\n//#region src/core/generator-functions.ts\nconst NANOID_DEFAULT_SIZE = 21;\nconst NANOID_MIN_SIZE = 2;\nconst NANOID_MAX_SIZE = 255;\nconst nowSignature = { documentation: \"Writes the current time, as the column's codec represents it.\" };\nconst uuidSignature = {\n\tdocumentation: \"Generates a UUID when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"version\",\n\t\ttype: optional(oneOf(num(4), num(7))),\n\t\tdocumentation: \"The UUID version: `4` or `7`. Defaults to `4`.\"\n\t}]\n};\nconst cuidSignature = {\n\tdocumentation: \"Generates a CUID2 identifier when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"version\",\n\t\ttype: num(2),\n\t\tdocumentation: \"The CUID version. Only `2` is supported.\"\n\t}]\n};\nconst ulidSignature = { documentation: \"Generates a ULID when a value is not supplied.\" };\nconst nanoidSignature = {\n\tdocumentation: \"Generates a Nano ID when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"size\",\n\t\ttype: optional(int({\n\t\t\tmin: NANOID_MIN_SIZE,\n\t\t\tmax: NANOID_MAX_SIZE\n\t\t})),\n\t\tdocumentation: \"The identifier length, from `2` through `255`. Defaults to 21.\"\n\t}]\n};\nconst ksuidSignature = { documentation: \"Generates a KSUID when a value is not supplied.\" };\nfunction refused(message) {\n\treturn {\n\t\tok: false,\n\t\tmessage\n\t};\n}\nfunction generated(id, params) {\n\treturn {\n\t\tok: true,\n\t\tgenerator: params === void 0 ? {\n\t\t\tkind: \"generator\",\n\t\t\tid\n\t\t} : {\n\t\t\tkind: \"generator\",\n\t\t\tid,\n\t\t\tparams\n\t\t}\n\t};\n}\nfunction uuidBinding(codecIds) {\n\treturn {\n\t\tcodecIds,\n\t\tgeneratorIds: [\"uuidv4\", \"uuidv7\"],\n\t\tresolve: ({ args }) => {\n\t\t\tconst version = args[\"version\"];\n\t\t\tif (version === void 0 || version === 4) return generated(\"uuidv4\");\n\t\t\tif (version === 7) return generated(\"uuidv7\");\n\t\t\treturn refused(`uuid takes version 4 or 7, not ${String(version)}.`);\n\t\t},\n\t\tprintArguments: (generator) => {\n\t\t\tif (generator.id === \"uuidv4\") return {\n\t\t\t\targs: {},\n\t\t\t\ttext: \"\"\n\t\t\t};\n\t\t\tif (generator.id === \"uuidv7\") return {\n\t\t\t\targs: { version: 7 },\n\t\t\t\ttext: \"7\"\n\t\t\t};\n\t\t}\n\t};\n}\nfunction cuidBinding(codecIds) {\n\treturn {\n\t\tcodecIds,\n\t\tgeneratorIds: [\"cuid2\"],\n\t\tresolve: ({ args }) => {\n\t\t\tconst version = args[\"version\"];\n\t\t\treturn version === 2 ? generated(\"cuid2\") : refused(`cuid takes version 2, not ${String(version)}.`);\n\t\t},\n\t\tprintArguments: (generator) => generator.id === \"cuid2\" ? {\n\t\t\targs: { version: 2 },\n\t\t\ttext: \"2\"\n\t\t} : void 0\n\t};\n}\nfunction columnLength(field) {\n\tconst length = field.typeParams?.[\"length\"];\n\treturn typeof length === \"number\" ? length : void 0;\n}\nfunction isNanoidSize(size) {\n\treturn typeof size === \"number\" && Number.isInteger(size) && size >= NANOID_MIN_SIZE && size <= NANOID_MAX_SIZE;\n}\n/**\n* A Nano ID has the size the call gives, or 21; the column's length never sets it. A size larger than the column's length is refused, since the identifier would not fit. A shorter identifier in a fixed-length column is padded by the database, as Prisma 7 does.\n*/\nfunction nanoidBinding(codecIds) {\n\treturn {\n\t\tcodecIds,\n\t\tgeneratorIds: [\"nanoid\"],\n\t\tresolve: ({ args, field }) => {\n\t\t\tconst explicit = args[\"size\"];\n\t\t\tif (explicit !== void 0 && !isNanoidSize(explicit)) return refused(`nanoid takes a size from ${NANOID_MIN_SIZE} through ${NANOID_MAX_SIZE}, not ${String(explicit)}.`);\n\t\t\tconst size = explicit ?? NANOID_DEFAULT_SIZE;\n\t\t\tconst length = columnLength(field);\n\t\t\tif (length !== void 0 && size > length) return refused(`${explicit === void 0 ? \"nanoid()\" : `nanoid(${size})`} writes ${size} characters, which does not fit a column of ${length} characters.`);\n\t\t\treturn explicit === void 0 ? generated(\"nanoid\") : generated(\"nanoid\", { size });\n\t\t},\n\t\tprintArguments: (generator) => {\n\t\t\tif (generator.id !== \"nanoid\") return void 0;\n\t\t\tconst size = generator.params?.[\"size\"];\n\t\t\treturn typeof size === \"number\" ? {\n\t\t\t\targs: { size },\n\t\t\t\ttext: String(size)\n\t\t\t} : {\n\t\t\t\targs: {},\n\t\t\t\ttext: \"\"\n\t\t\t};\n\t\t}\n\t};\n}\n/** The identifier generator functions bound to a target's text codecs, and `uuid` to its uuid codecs. */\nfunction idGeneratorFunctionBindings(codecs) {\n\tconst { text } = codecs;\n\treturn [\n\t\t{\n\t\t\tname: \"uuid\",\n\t\t\tbindings: [uuidBinding([...text, ...codecs.uuid ?? []])]\n\t\t},\n\t\t{\n\t\t\tname: \"cuid\",\n\t\t\tbindings: [cuidBinding(text)]\n\t\t},\n\t\t{\n\t\t\tname: \"ulid\",\n\t\t\tbindings: [singleGeneratorBinding({\n\t\t\t\tcodecIds: text,\n\t\t\t\tgeneratorId: \"ulid\"\n\t\t\t})]\n\t\t},\n\t\t{\n\t\t\tname: \"ksuid\",\n\t\t\tbindings: [singleGeneratorBinding({\n\t\t\t\tcodecIds: text,\n\t\t\t\tgeneratorId: \"ksuid\"\n\t\t\t})]\n\t\t},\n\t\t{\n\t\t\tname: \"nanoid\",\n\t\t\tbindings: [nanoidBinding(text)]\n\t\t}\n\t];\n}\nconst familyIdBindings = idGeneratorFunctionBindings({ text: [\n\tSQL_CHAR_CODEC_ID,\n\tSQL_VARCHAR_CODEC_ID,\n\tSQL_TEXT_CODEC_ID\n] });\nfunction familyBindingsOf(name) {\n\treturn familyIdBindings.find((contribution) => contribution.name === name)?.bindings ?? [];\n}\n/** The generator functions the SQL family declares, with their bindings to the family's codecs. Targets bind `now` and their own codecs. */\nconst sqlFamilyGeneratorFunctions = [\n\t{\n\t\tname: \"now\",\n\t\tsignature: nowSignature,\n\t\tbindings: []\n\t},\n\t{\n\t\tname: \"uuid\",\n\t\tsignature: uuidSignature,\n\t\tbindings: familyBindingsOf(\"uuid\")\n\t},\n\t{\n\t\tname: \"cuid\",\n\t\tsignature: cuidSignature,\n\t\tbindings: familyBindingsOf(\"cuid\")\n\t},\n\t{\n\t\tname: \"ulid\",\n\t\tsignature: ulidSignature,\n\t\tbindings: familyBindingsOf(\"ulid\")\n\t},\n\t{\n\t\tname: \"nanoid\",\n\t\tsignature: nanoidSignature,\n\t\tbindings: familyBindingsOf(\"nanoid\")\n\t},\n\t{\n\t\tname: \"ksuid\",\n\t\tsignature: ksuidSignature,\n\t\tbindings: familyBindingsOf(\"ksuid\")\n\t}\n];\n/** The identifier generators the family's bindings produce, which the family registers so that a target binding them through `idGeneratorFunctionBindings` registers none. */\nconst sqlFamilyGeneratorDescriptors = [...new Set(sqlFamilyGeneratorFunctions.flatMap(({ bindings }) => bindings.flatMap(({ generatorIds }) => generatorIds)))].map((id) => ({ id }));\n//#endregion\nexport { sqlFamilyAuthoringFieldPresets as a, sqlFamilyAuthoringTypes as i, sqlFamilyGeneratorDescriptors as n, sqlFamilyEntityTypes as o, sqlFamilyGeneratorFunctions as r, sqlFamilyPslBlockDescriptors as s, idGeneratorFunctionBindings as t };\n\n//# sourceMappingURL=generator-functions-BoE7Lc9d.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,oBAAoB;CAC5B,OAAO,SAAS;EACf,OAAO;GACN,MAAM,UAAU;GAChB,eAAe;EAChB;EACA,WAAW;CACZ,CAAC;AACF;AACA,MAAM,uBAAuB,EAAE,MAAM;CACpC,MAAM;CACN,eAAe;CACf,QAAQ,EAAE,UAAU,OAAO,QAAQ;EAClC,MAAM,WAAW,IAAI,YAAY;EACjC,MAAM,cAAc,IAAI;EACxB,MAAM,WAAW,mBAAmB,OAAO,GAAG;EAC9C,IAAI,aAAa,KAAK,GAAG;EACzB,MAAM,EAAE,SAAS,cAAc;EAC/B,MAAM,aAAa,IAAI,YAAY,cAAc,OAAO;EACxD,MAAM,QAAQ,IAAI,YAAY,IAAI,OAAO;EACzC,IAAI,eAAe,KAAK,KAAK,UAAU,KAAK,GAAG;GAC9C,aAAa,KAAK;IACjB,MAAM;IACN,SAAS,SAAS,MAAM,KAAK,qCAAqC,QAAQ;IAC1E;IACA,MAAM;GACP,CAAC;GACD;EACD;EACA,MAAM,cAAc,cAAc,UAAU;EAC5C,IAAI,gBAAgB,KAAK,GAAG;GAC3B,aAAa,KAAK;IACjB,MAAM;IACN,SAAS,SAAS,MAAM,KAAK,0BAA0B,QAAQ,KAAK;IACpE;IACA,MAAM;GAC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C,cAAc,IAAI,CAAC;EAC/B;CACD;AACD;AACA,MAAM,mBAAmB,4BAA4B,EAAE,MAAM;CAC5D;CACA;CACA;AACD,EAAE,CAAC;AACH,SAAS,iBAAiB,MAAM;CAC/B,OAAO,iBAAiB,MAAM,iBAAiB,aAAa,SAAS,IAAI,CAAC,EAAE,YAAY,CAAC;AAC1F;;AAEA,MAAM,8BAA8B;CACnC;EACC,MAAM;EACN,WAAW;EACX,UAAU,CAAC;CACZ;CACA;EACC,MAAM;EACN,WAAW;EACX,UAAU,iBAAiB,MAAM;CAClC;CACA;EACC,MAAM;EACN,WAAW;EACX,UAAU,iBAAiB,MAAM;CAClC;CACA;EACC,MAAM;EACN,WAAW;EACX,UAAU,iBAAiB,MAAM;CAClC;CACA;EACC,MAAM;EACN,WAAW;EACX,UAAU,iBAAiB,QAAQ;CACpC;CACA;EACC,MAAM;EACN,WAAW;EACX,UAAU,iBAAiB,OAAO;CACnC;AACD;;AAEA,MAAM,gCAAgC,CAAC,GAAG,IAAI,IAAI,4BAA4B,SAAS,EAAE,eAAe,SAAS,SAAS,EAAE,mBAAmB,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,GAAG,EAAE"}
@@ -6,7 +6,7 @@ import { c as SqlQueryable, i as SqlDriver, l as SqlStatementStats, r as SqlConn
6
6
  import { n as SqlQueryPlan } from "./plan-Cbed2eDu-3c5s1Aq5.mjs";
7
7
  import { i as CodecTypesBase, l as RawCodecInferer } from "./expression-BzrfOiPC-CXjjRKqc.mjs";
8
8
  import "./expression-CIBqCwC1.mjs";
9
- import { m as MarkerReadResult, t as Adapter } from "./ast-Cq7uhA86.mjs";
9
+ import { m as MarkerReadResult, t as Adapter } from "./ast-DB7g9Mh2.mjs";
10
10
  import { t as SqlExecutionPlan } from "./sql-execution-plan-Dam5yMZg-bDl_0qHQ.mjs";
11
11
  import "./plan-BOyVvttx.mjs";
12
12
  import { n as CollectionMethodContribution } from "./collection-methods-B-tM7OPZ-DzXedZdV.mjs";
@@ -14,7 +14,7 @@ import { n as ExecutionContext, t as CodecDescriptorRegistry } from "./query-lan
14
14
  import "./query-lane-context-BPJrXopg.mjs";
15
15
  import { _ as SqlOrmPlan, h as RuntimeScope } from "./types-Cv5t6_Ly-BaGc023t.mjs";
16
16
  import "./types-VUCzaDbp.mjs";
17
- import { c as PreparedExecution, g as TransactionStartTarget, l as PreparedFor, n as Declaration, o as ParamsFromDeclaration, s as PrepareCallback, u as PreparedStatement, v as preparedStatementExecute, y as preparedStatementQuery } from "./transaction-state-DR3nKTmH-DbyhuL-z.mjs";
17
+ import { c as PreparedExecution, g as TransactionStartTarget, l as PreparedFor, n as Declaration, o as ParamsFromDeclaration, s as PrepareCallback, u as PreparedStatement, v as preparedStatementExecute, y as preparedStatementQuery } from "./transaction-state-DR3nKTmH-D_pb9QgR.mjs";
18
18
  import { i as SqlParamRefMutator } from "./middleware-oCT0RWkt-DGav7C8b.mjs";
19
19
  import "./middleware-MgGkjEXt.mjs";
20
20
  import "./collection-methods-BNAu8vHk.mjs";
@@ -578,4 +578,4 @@ interface LintsOptions {
578
578
  declare function lints(options?: LintsOptions): SqlMiddleware;
579
579
  //#endregion
580
580
  export { SqlRuntimeAdapterDescriptor as $, ActivityRoute as A, PreparedStatementInternals as B, extractCodecIds as C, validateContractCodecMappings as D, validateCodecRegistryCompleteness as E, ConnectionProvider as F, RuntimeParameterizedCodecDescriptor as G, RuntimeConnection as H, HashablePlan as I, RuntimeTransaction as J, RuntimeQueryable as K, MarkerReader as L, ActivitySourceTarget as M, BoundPreparedStatement as N, ActivityExecuteOptions as O, CloseRefusal as P, SqlMiddlewareContext as Q, PreparedExecutionImpl as R, createAstCodecRegistry as S, lowerSqlPlan as T, RuntimeFamilyAdapter as U, Runtime as V, RuntimeOptions as W, SqlExecutionStackWithDriver as X, SqlExecutionStack as Y, SqlMiddleware as Z, StatementActivity as _, planContentHashOn as _t, ActivityParent$1 as a, SqlRuntimeTargetDescriptor as at, TransactionEnded as b, ClientActivityEnd$1 as c, TransactionContext as ct, ClientActivityResult$1 as d, createExecutionContext as dt, SqlRuntimeAdapterInstance as et, ExecuteInterceptResult$1 as f, createSqlExecutionStack as ft, StartActivity$1 as g, findActivitySource as gt, QueryInterceptResult$1 as h, encodeParamsWithMetadata as ht, ActivityInterceptResult$1 as i, SqlRuntimeExtensionInstance as it, ActivitySource as j, ActivityHandle as k, ClientActivityEnded as l, VerifyMarkerOption as lt, Log as m, deriveParamMetadata as mt, ActivityEndedResult$1 as n, SqlRuntimeDriverInstance as nt, BudgetsOptions as o, SqlStaticContributions as ot, LintsOptions as p, delegatingActivitySource as pt, RuntimeTelemetryEvent as q, ActivityFinalizedResult$1 as r, SqlRuntimeExtensionDescriptor as rt, ClientActivity$1 as s, TelemetryOutcome as st, Activity$1 as t, SqlRuntimeBase as tt, ClientActivityKind$1 as u, activitySource as ut, StatementEnded as v, startActivityOn as vt, lints as w, budgets as x, TransactionActivity as y, withTransaction as yt, PreparedStatementImpl as z };
581
- //# sourceMappingURL=index-B0hZw3uT.d.mts.map
581
+ //# sourceMappingURL=index-Bw9Y19Js.d.mts.map