@prisma/orm-family-sql 8.0.0-rc.24-dev.40 → 8.0.0-rc.24-dev.41

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 (150) hide show
  1. package/dist/{aggregate-descriptor-registry-oSsBuRHQ.mjs → aggregate-descriptor-registry-CRgsKIJY.mjs} +2 -2
  2. package/dist/{aggregate-descriptor-registry-oSsBuRHQ.mjs.map → aggregate-descriptor-registry-CRgsKIJY.mjs.map} +1 -1
  3. package/dist/{ast-BpFfUmb_.mjs → ast-B1GOjYn-.mjs} +2 -2
  4. package/dist/ast-B1GOjYn-.mjs.map +1 -0
  5. package/dist/{ast-DvD53wSW.d.mts → ast-DZnTuPWA.d.mts} +3 -3
  6. package/dist/{ast-DvD53wSW.d.mts.map → ast-DZnTuPWA.d.mts.map} +1 -1
  7. package/dist/builder.d.mts +3 -3
  8. package/dist/builder__runtime.d.mts +7 -7
  9. package/dist/builder__runtime.mjs +39 -23
  10. package/dist/builder__runtime.mjs.map +1 -1
  11. package/dist/builder__types.d.mts +5 -5
  12. package/dist/{codec-descriptor-registry-UiFDvDj4.mjs → codec-descriptor-registry-CQ9M2B3L.mjs} +4 -2
  13. package/dist/codec-descriptor-registry-CQ9M2B3L.mjs.map +1 -0
  14. package/dist/collection-methods-CO0bz9PJ.d.mts +1 -0
  15. package/dist/{collection-methods-As4pXm7B-3xgTSoyU.d.mts → collection-methods-HlRizYfF-DKdq47dN.d.mts} +3 -3
  16. package/dist/{collection-methods-As4pXm7B-3xgTSoyU.d.mts.map → collection-methods-HlRizYfF-DKdq47dN.d.mts.map} +1 -1
  17. package/dist/{config-types-CFByuvww.mjs → config-types-tSsDtIC-.mjs} +2 -2
  18. package/dist/{config-types-CFByuvww.mjs.map → config-types-tSsDtIC-.mjs.map} +1 -1
  19. package/dist/{contract-builder-DIb0oV8O.mjs → contract-builder-piV2RUop.mjs} +3 -3
  20. package/dist/{contract-builder-DIb0oV8O.mjs.map → contract-builder-piV2RUop.mjs.map} +1 -1
  21. package/dist/contract-prisma7__provider.mjs +5 -5
  22. package/dist/contract-psl.mjs +1 -1
  23. package/dist/contract-psl__attribute-specs.mjs +1 -1
  24. package/dist/contract-psl__provider.mjs +2 -2
  25. package/dist/contract-psl__provider.mjs.map +1 -1
  26. package/dist/contract-ts.mjs +3 -3
  27. package/dist/contract-ts__config-types.mjs +1 -1
  28. package/dist/contract-ts__contract-builder.mjs +2 -2
  29. package/dist/contract.mjs +1 -1
  30. package/dist/contract__validators.mjs +1 -1
  31. package/dist/{control-BdGTPj7m.mjs → control-Cxrfn6YO.mjs} +28 -16
  32. package/dist/control-Cxrfn6YO.mjs.map +1 -0
  33. package/dist/{control-BwL5tCj4.d.mts → control-DaBIvroP.d.mts} +6 -6
  34. package/dist/{control-BwL5tCj4.d.mts.map → control-DaBIvroP.d.mts.map} +1 -1
  35. package/dist/{control-adapter-0z3ce44U-BQ26ercw.d.mts → control-adapter-0z3ce44U-OE4VID0O.d.mts} +4 -4
  36. package/dist/{control-adapter-0z3ce44U-BQ26ercw.d.mts.map → control-adapter-0z3ce44U-OE4VID0O.d.mts.map} +1 -1
  37. package/dist/{control-adapter-DRLco_j0.d.mts → control-adapter-CC_Vys2q.d.mts} +2 -2
  38. package/dist/{control-adapter-DRLco_j0.d.mts.map → control-adapter-CC_Vys2q.d.mts.map} +1 -1
  39. package/dist/{db-by-MuHF2-B7uz_0VW.d.mts → db-by-MuHF2-Dz4IwRsO.d.mts} +10 -10
  40. package/dist/{db-by-MuHF2-B7uz_0VW.d.mts.map → db-by-MuHF2-Dz4IwRsO.d.mts.map} +1 -1
  41. package/dist/{ddl-types-D93zTpm9-DhSkpX0K.d.mts → ddl-types-BpNk9lrL-5rXDLalb.d.mts} +3 -3
  42. package/dist/{ddl-types-D93zTpm9-DhSkpX0K.d.mts.map → ddl-types-BpNk9lrL-5rXDLalb.d.mts.map} +1 -1
  43. package/dist/{derived-checks-9Ku2scaj-0iT0uU_6.mjs → derived-checks-9Ku2scaj-BkBpXofB.mjs} +2 -2
  44. package/dist/{derived-checks-9Ku2scaj-0iT0uU_6.mjs.map → derived-checks-9Ku2scaj-BkBpXofB.mjs.map} +1 -1
  45. package/dist/{diff-DZHlisyY.d.mts → diff-ox1r2eqR.d.mts} +2 -2
  46. package/dist/{diff-DZHlisyY.d.mts.map → diff-ox1r2eqR.d.mts.map} +1 -1
  47. package/dist/{exports-D4xgPPzV-B5oJAMdP.mjs → exports-D4xgPPzV-BWjldMmf.mjs} +4 -4
  48. package/dist/{exports-D4xgPPzV-B5oJAMdP.mjs.map → exports-D4xgPPzV-BWjldMmf.mjs.map} +1 -1
  49. package/dist/{expression-DYRYmkMl-BMKxN8Wf.d.mts → expression-CbgzZLXY-Bzqi0ZTM.d.mts} +4 -4
  50. package/dist/{expression-DYRYmkMl-BMKxN8Wf.d.mts.map → expression-CbgzZLXY-Bzqi0ZTM.d.mts.map} +1 -1
  51. package/dist/expression-DBDD1QR1.d.mts +2 -0
  52. package/dist/{expression-VJWwxbUB-BtNDaTCt.d.mts → expression-DKXV5hFJ-4ZqJOTJH.d.mts} +4 -4
  53. package/dist/expression-DKXV5hFJ-4ZqJOTJH.d.mts.map +1 -0
  54. package/dist/{expression-impl-C5Ha-fXs-CxXn8gDo.mjs → expression-impl-D9Le3c2y-MF0Fctq9.mjs} +3 -3
  55. package/dist/{expression-impl-C5Ha-fXs-CxXn8gDo.mjs.map → expression-impl-D9Le3c2y-MF0Fctq9.mjs.map} +1 -1
  56. package/dist/family.d.mts +6 -6
  57. package/dist/family.mjs +4 -4
  58. package/dist/family__control-adapter.d.mts +2 -2
  59. package/dist/family__control.d.mts +2 -2
  60. package/dist/family__control.mjs +2 -2
  61. package/dist/family__diff.d.mts +1 -1
  62. package/dist/family__ir.mjs +1 -1
  63. package/dist/family__migration.d.mts +1 -1
  64. package/dist/family__pack.mjs +2 -2
  65. package/dist/{functions-DGketpiK.mjs → functions-BV4CyVZ0.mjs} +3 -3
  66. package/dist/{functions-DGketpiK.mjs.map → functions-BV4CyVZ0.mjs.map} +1 -1
  67. package/dist/functions-CF7EOqOH.d.mts +1 -0
  68. package/dist/{generator-functions-Bze9nVHL-BK4YIqLK.mjs → generator-functions-Bze9nVHL-EURgrMFd.mjs} +3 -3
  69. package/dist/{generator-functions-Bze9nVHL-BK4YIqLK.mjs.map → generator-functions-Bze9nVHL-EURgrMFd.mjs.map} +1 -1
  70. package/dist/{index-CXtZjjgy.d.mts → index-Dlup-3Az.d.mts} +17 -17
  71. package/dist/{index-CXtZjjgy.d.mts.map → index-Dlup-3Az.d.mts.map} +1 -1
  72. package/dist/index-reference-j3KdvbVm.d.mts +1 -0
  73. package/dist/{index-reference-CjvRzUh1-CG0Ouv6i.d.mts → index-reference-kUL7aEBI-DYcs4N7J.d.mts} +3 -3
  74. package/dist/{index-reference-CjvRzUh1-CG0Ouv6i.d.mts.map → index-reference-kUL7aEBI-DYcs4N7J.d.mts.map} +1 -1
  75. package/dist/{interpreter-DoQwVOyS-jsuDJlaX.mjs → interpreter-CMHH_zlH-BOZVPx6S.mjs} +10 -10
  76. package/dist/interpreter-CMHH_zlH-BOZVPx6S.mjs.map +1 -0
  77. package/dist/{middleware-DzFPUERE-C6RrGmcp.d.mts → middleware-BZYekCO2-DeY82fwI.d.mts} +3 -3
  78. package/dist/{middleware-DzFPUERE-C6RrGmcp.d.mts.map → middleware-BZYekCO2-DeY82fwI.d.mts.map} +1 -1
  79. package/dist/middleware-Q-P3nMQA.d.mts +1 -0
  80. package/dist/{migration-BUWF9_Tx.d.mts → migration-aQa4CVb-.d.mts} +2 -2
  81. package/dist/{migration-BUWF9_Tx.d.mts.map → migration-aQa4CVb-.d.mts.map} +1 -1
  82. package/dist/orm-client.d.mts +17 -17
  83. package/dist/orm-client.mjs +21 -18
  84. package/dist/orm-client.mjs.map +1 -1
  85. package/dist/{plan-Dv6v5_y4-CGWEjfCv.d.mts → plan-Dd6M8olW-Dynb9vKp.d.mts} +3 -3
  86. package/dist/{plan-Dv6v5_y4-CGWEjfCv.d.mts.map → plan-Dd6M8olW-Dynb9vKp.d.mts.map} +1 -1
  87. package/dist/plan-G5_dBmgg.d.mts +2 -0
  88. package/dist/{psl-field-resolution-CpxUePg1-DIrhHYx0.mjs → psl-field-resolution-CpxUePg1-CTitB6W5.mjs} +3 -3
  89. package/dist/{psl-field-resolution-CpxUePg1-DIrhHYx0.mjs.map → psl-field-resolution-CpxUePg1-CTitB6W5.mjs.map} +1 -1
  90. package/dist/{query-lane-context-BetHj4j--D3S5nucp.d.mts → query-lane-context-D4U6ox8I-CGLC-1HK.d.mts} +5 -5
  91. package/dist/{query-lane-context-BetHj4j--D3S5nucp.d.mts.map → query-lane-context-D4U6ox8I-CGLC-1HK.d.mts.map} +1 -1
  92. package/dist/query-lane-context-TQxP0UjW.d.mts +1 -0
  93. package/dist/relational-core.d.mts +13 -13
  94. package/dist/relational-core.mjs +4 -4
  95. package/dist/relational-core__aggregate-descriptor-registry.d.mts +1 -1
  96. package/dist/relational-core__aggregate-descriptor-registry.mjs +1 -1
  97. package/dist/relational-core__ast.d.mts +4 -4
  98. package/dist/relational-core__ast.mjs +3 -3
  99. package/dist/relational-core__codec-descriptor-registry.d.mts +2 -2
  100. package/dist/relational-core__codec-descriptor-registry.mjs +1 -1
  101. package/dist/relational-core__collection-methods.d.mts +2 -2
  102. package/dist/relational-core__contract-free.d.mts +2 -2
  103. package/dist/relational-core__contract-free.mjs +13 -4
  104. package/dist/relational-core__contract-free.mjs.map +1 -1
  105. package/dist/relational-core__expression.d.mts +3 -3
  106. package/dist/relational-core__expression.mjs +1 -1
  107. package/dist/relational-core__functions.d.mts +2 -2
  108. package/dist/relational-core__functions.mjs +1 -1
  109. package/dist/relational-core__index-reference.d.mts +2 -2
  110. package/dist/relational-core__middleware.d.mts +2 -2
  111. package/dist/relational-core__plan.d.mts +3 -3
  112. package/dist/relational-core__query-lane-context.d.mts +2 -2
  113. package/dist/relational-core__types.d.mts +2 -2
  114. package/dist/runtime.d.mts +4 -4
  115. package/dist/runtime.mjs +1 -1
  116. package/dist/runtime__internal__prepared-query.d.mts +1 -1
  117. package/dist/{sql-contract-serializer-sMY3prTx-hb9EW6FW.mjs → sql-contract-serializer-sMY3prTx-C3OF1gr9.mjs} +2 -2
  118. package/dist/{sql-contract-serializer-sMY3prTx-hb9EW6FW.mjs.map → sql-contract-serializer-sMY3prTx-C3OF1gr9.mjs.map} +1 -1
  119. package/dist/{sql-execution-plan-4OFBeONp-CLkDqMdz.d.mts → sql-execution-plan-BKmtONvF-bBXCQ0s1.d.mts} +3 -3
  120. package/dist/sql-execution-plan-BKmtONvF-bBXCQ0s1.d.mts.map +1 -0
  121. package/dist/{transaction-state-B4FVsvO7-DpvKYHSB.d.mts → transaction-state-B4FVsvO7-C0kgrpwC.d.mts} +9 -9
  122. package/dist/{transaction-state-B4FVsvO7-DpvKYHSB.d.mts.map → transaction-state-B4FVsvO7-C0kgrpwC.d.mts.map} +1 -1
  123. package/dist/{types-DEbNJhyS-CY7Ye2vN.d.mts → types-BseDMzbO-jM1a1F4N.d.mts} +5 -3
  124. package/dist/{types-DEbNJhyS-CY7Ye2vN.d.mts.map → types-BseDMzbO-jM1a1F4N.d.mts.map} +1 -1
  125. package/dist/{types-DzQmUrUm-ColHE4Av.mjs → types-BtItVHx6-BEDme1ZL.mjs} +15 -14
  126. package/dist/types-BtItVHx6-BEDme1ZL.mjs.map +1 -0
  127. package/dist/{types-CGr02DOy-CQsUdKCe.d.mts → types-CMSRIhJK-D0oiijer.d.mts} +6 -6
  128. package/dist/{types-CGr02DOy-CQsUdKCe.d.mts.map → types-CMSRIhJK-D0oiijer.d.mts.map} +1 -1
  129. package/dist/{types-CWvmfrfd-HPIh55bi.d.mts → types-CWvmfrfd-u6aEmYg4.d.mts} +2 -2
  130. package/dist/{types-CWvmfrfd-HPIh55bi.d.mts.map → types-CWvmfrfd-u6aEmYg4.d.mts.map} +1 -1
  131. package/dist/types-ClvFL9_q.d.mts +1 -0
  132. package/dist/{validators-CcR6gGf_.mjs → validators-_FcNfyor.mjs} +8 -5
  133. package/dist/validators-_FcNfyor.mjs.map +1 -0
  134. package/package.json +18 -18
  135. package/dist/ast-BpFfUmb_.mjs.map +0 -1
  136. package/dist/codec-descriptor-registry-UiFDvDj4.mjs.map +0 -1
  137. package/dist/collection-methods-CS1e16Ij.d.mts +0 -1
  138. package/dist/control-BdGTPj7m.mjs.map +0 -1
  139. package/dist/expression-Bz8uEh8W.d.mts +0 -2
  140. package/dist/expression-VJWwxbUB-BtNDaTCt.d.mts.map +0 -1
  141. package/dist/functions-gl3PL1so.d.mts +0 -1
  142. package/dist/index-reference-X_kA2mV8.d.mts +0 -1
  143. package/dist/interpreter-DoQwVOyS-jsuDJlaX.mjs.map +0 -1
  144. package/dist/middleware-CcDThETr.d.mts +0 -1
  145. package/dist/plan-BjX90QC6.d.mts +0 -2
  146. package/dist/query-lane-context-DgxWaKr-.d.mts +0 -1
  147. package/dist/sql-execution-plan-4OFBeONp-CLkDqMdz.d.mts.map +0 -1
  148. package/dist/types-BFCrGkhG.d.mts +0 -1
  149. package/dist/types-DzQmUrUm-ColHE4Av.mjs.map +0 -1
  150. package/dist/validators-CcR6gGf_.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-Cxrfn6YO.mjs","names":["#fromContract","#contract","#namespaceRenames","#byOrigin","#byDestination","#tablesOf","#columnsOf","#renameFrom","#renameTo","#storedIn","#unused","#policy","#target","#ownership","#storageRenames","#current","#renameTable","#currentColumn","#renameColumn","#renamedTables","#originTables","#recordColumn","#planNamespace","#planModel","#planField","#renamedColumns","#renamedNamespaces","#emit","#operationCount","#sharedTableRefusal","#planTableRename","#planMove","#controlPolicyRefusal","#sharedColumnRefusal"],"sources":["../../../../2-sql-family/9-family/dist/control.mjs"],"sourcesContent":["import { a as sqlFamilyAuthoringTypes, c as sqlFamilyPslBlockDescriptors, n as sqlFamilyGeneratorDescriptors, r as sqlFamilyGeneratorFunctions, s as sqlFamilyEntityTypes } from \"./generator-functions-Bze9nVHL.mjs\";\nimport { c as extractCodecControlHooks, n as classifyDiffSubjectGranularity, o as verifySqlSchemaByDiff, s as enforceSqlDataTypeInvariants, t as classifyDiffEntityKind } from \"./schema-verify-C3wbdviw.mjs\";\nimport { t as sqlFamilyError } from \"./errors-B5g0xWro.mjs\";\nimport { t as SqlContractSerializer } from \"./sql-contract-serializer-sMY3prTx.mjs\";\nimport { t as collectSupportedCodecTypeIds } from \"./verify-BVk5bjdH.mjs\";\nimport { isSqlDataType, nameIsCatalogText, renderSqlTypeName, sameSqlColumnType, sqlCodecColumnLength, sqlDataTypeOfCodec, sqlStorageType, unquotedSqlBaseName, validateSqlTypeParams } from \"@internal/sql-contract/data-type\";\nimport { SQL_EXPRESSION_TAG, printSqlExpressionLiteral, sqlExpressionRegistration, sqlTextsReadBack } from \"@internal/sql-contract/sql-expression\";\nimport { sqlEmission } from \"@internal/sql-contract-emitter\";\nimport { describeUnsupportedSqlAttribute, sqlAttributeSpecs } from \"@internal/sql-contract-psl/attribute-specs\";\nimport { describeUnresolvedSqlType } from \"@internal/sql-contract-psl/diagnostics\";\nimport { collectScalarTypeConstructors, isAuthoringEntityTypeDescriptor, isAuthoringTypeChoiceDescriptor, isAuthoringTypeConstructorDescriptor, tsTaggedTemplateSource } from \"@internal/framework-components/authoring\";\nimport { assembleDataTypes, codecForRef, dataTypeParams, objectSchemaKeys, readContractValue } from \"@internal/framework-components/codec\";\nimport { APP_SPACE_ID, SchemaTreeNode, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_TARGET_MISMATCH, assembleAuthoringContributions, compareMarkerDatabasePolicies, databasePoliciesMovedFailure, describeMigrationStatement, enumValueStatementText, extractCodecLookup, fieldStatementText, issueOutcome, migrationRunnerFailure, modelDisplayName, modelStatementText, sameMarkerHashes, valueObjectFieldStatementText } from \"@internal/framework-components/control\";\nimport { UNBOUND_NAMESPACE_ID, isPlainRecord } from \"@internal/framework-components/ir\";\nimport { UNBOUND_PSL_NAMESPACE_NAME } from \"@internal/framework-components/psl-ast\";\nimport { assertDescriptorSelfConsistency } from \"@internal/migration-tools/spaces\";\nimport { sqlContractCanonicalizationHooks } from \"@internal/sql-contract/canonicalization-hooks\";\nimport { requiresNameUniqueAcrossNamespaces } from \"@internal/sql-contract/entity-handle-lowering-hook\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError, isInternalError } from \"@internal/utils/internal-error\";\nimport { ContractValidationError } from \"@internal/contract/contract-validation-error\";\nimport { StorageTable, isStorageTypeInstance, isStorageValueSet, nonEmptyTypeParams } from \"@internal/sql-contract/types\";\nimport { checkSqlDefaultText, valueObjectStorageTypeMissingMessage } from \"@internal/sql-contract/validators\";\nimport { isStructuredError, structuredError } from \"@internal/utils/structured-error\";\nimport { asNamespaceId, governingControlPolicy, valueObjectAt, valueObjectsWithCoordinates } from \"@internal/contract/types\";\nimport { type } from \"arktype\";\nimport { notOk, ok, okVoid } from \"@internal/utils/result\";\nimport { namingOf } from \"@internal/sql-schema-ir/naming\";\nimport { RelationalSchemaNodeKind, SqlSchemaIR, SqlTableIR } from \"@internal/sql-schema-ir/types\";\nimport { errorMarkerPoliciesCorrupt } from \"@internal/errors/execution\";\nimport { invariant } from \"@internal/utils/assertions\";\nimport { reachesAny, referenceKey } from \"@internal/sql-contract/check-expressions\";\nimport { canonicalizeJson } from \"@internal/framework-components/utils\";\nimport { jsonToTsSource } from \"@internal/ts-render\";\nimport { declaredJsonType } from \"@internal/sql-contract/codec-json-type\";\n//#region src/core/contract-stack-checks.ts\nfunction tablesOf(storage) {\n\treturn Object.entries(storage.namespaces).flatMap(([namespaceId, namespace]) => Object.entries(namespace.entries[\"table\"] ?? {}).map(([tableName, table]) => ({\n\t\tpath: `storage.namespaces.${namespaceId}.entries.table.${tableName}`,\n\t\tnamespaceId,\n\t\ttableName,\n\t\ttable: blindCast(table)\n\t})));\n}\nfunction dataTypeProblems(storage, codecLookup) {\n\treturn [...tablesOf(storage).flatMap(({ path, table }) => Object.entries(table.columns).map(([columnName, column]) => ({\n\t\tpath: `${path}.columns.${columnName}`,\n\t\tcodecId: column.codecId,\n\t\tdataType: column.dataType\n\t}))), ...Object.entries(storage.types ?? {}).flatMap(([typeName, entry]) => isStorageTypeInstance(entry) ? [{\n\t\tpath: `storage.types.${typeName}`,\n\t\tcodecId: entry.codecId,\n\t\tdataType: entry.dataType\n\t}] : [])].flatMap(({ path, codecId, dataType }) => {\n\t\tconst represented = codecLookup.descriptorFor(codecId)?.dataType;\n\t\tif (represented === void 0 || represented === dataType) return [];\n\t\treturn [`${path}: codec ${codecId} represents ${represented}, not ${dataType}`];\n\t});\n}\n/** Whether `type` refuses `params`. The check of the column's parameters reports that, so its default is not read under them. */\nfunction refusesParams(type, params) {\n\tif (!isSqlDataType(type)) return false;\n\ttry {\n\t\tvalidateSqlTypeParams(type, params);\n\t\treturn false;\n\t} catch (error) {\n\t\tif (isStructuredError(error) && error.code === \"CONTRACT.TYPE_PARAMS_INVALID\") return true;\n\t\tthrow error;\n\t}\n}\n/** Names the namespace, unless the contract has only the unbound one, as a SQLite contract does. */\nfunction columnPlace(refused) {\n\treturn refused.namespaceId === UNBOUND_NAMESPACE_ID ? `Table \"${refused.table}\", column \"${refused.column}\"` : `Namespace \"${refused.namespaceId}\", table \"${refused.table}\", column \"${refused.column}\"`;\n}\nfunction notAValue(refused) {\n\treturn {\n\t\trefused,\n\t\ttext: `${columnPlace(refused)}: the default ${JSON.stringify(refused.value)}${refused.elementIndex === void 0 ? \"\" : ` at element ${refused.elementIndex + 1}`} is not a value of ${refused.dataType}: ${refused.message}`\n\t};\n}\nfunction notAList(refused) {\n\treturn {\n\t\trefused,\n\t\ttext: `${columnPlace(refused)}: the default ${JSON.stringify(refused.value)} is not a list, and the column holds a list of ${refused.dataType}`\n\t};\n}\n/** Each literal default the column's type does not hold, under the column's parameters, element by element on a list column. A `null` is SQL NULL, which every column takes. */\nfunction refusedDefaults(storage, dataTypes) {\n\treturn tablesOf(storage).flatMap(({ namespaceId, tableName, table }) => Object.entries(table.columns).flatMap(([columnName, column]) => {\n\t\tconst columnDefault = column.default;\n\t\tif (columnDefault?.kind !== \"literal\") return [];\n\t\tconst type = dataTypes.get(column.dataType);\n\t\tif (type === void 0) return [];\n\t\tconst params = dataTypeParams(type, nonEmptyTypeParams(column.typeParams));\n\t\tif (refusesParams(type, params)) return [];\n\t\tconst place = {\n\t\t\tnamespaceId,\n\t\t\ttable: tableName,\n\t\t\tcolumn: columnName,\n\t\t\tdataType: type.id\n\t\t};\n\t\tconst isList = column.many !== void 0 && column.many !== false;\n\t\tif (isList && columnDefault.value !== null && !Array.isArray(columnDefault.value)) return [notAList({\n\t\t\t...place,\n\t\t\tvalue: columnDefault.value,\n\t\t\tmessage: \"The column holds a list, and the default is not one.\",\n\t\t\treason: \"type-refused-default\"\n\t\t})];\n\t\tconst listed = isList && Array.isArray(columnDefault.value);\n\t\tconst values = isList && Array.isArray(columnDefault.value) ? columnDefault.value : [columnDefault.value];\n\t\tfor (const [index, value] of values.entries()) {\n\t\t\tif (value === null) continue;\n\t\t\ttry {\n\t\t\t\ttype.fromContract(value, params);\n\t\t\t} catch (error) {\n\t\t\t\tif (isInternalError(error)) throw error;\n\t\t\t\treturn [notAValue({\n\t\t\t\t\t...place,\n\t\t\t\t\tvalue,\n\t\t\t\t\t...listed ? { elementIndex: index } : {},\n\t\t\t\t\tmessage: error instanceof Error ? error.message : String(error),\n\t\t\t\t\treason: \"type-refused-default\"\n\t\t\t\t})];\n\t\t\t}\n\t\t}\n\t\treturn [];\n\t}));\n}\nfunction valueObjectProblems(contract, authoring) {\n\tconst storageTypeName = authoring.valueObjectStorageType;\n\tconst expectedCodecId = storageTypeName === void 0 ? void 0 : collectScalarTypeConstructors(authoring.type).get(storageTypeName)?.codecId;\n\tconst tables = new Map(tablesOf(contract.storage).map((entry) => [`${entry.namespaceId}\\0${entry.tableName}`, entry]));\n\treturn Object.values(contract.domain.namespaces).flatMap((namespace) => Object.values(namespace.models).flatMap((model) => {\n\t\tconst storage = blindCast(model.storage);\n\t\tconst table = tables.get(`${storage.namespaceId}\\0${storage.table}`);\n\t\tif (table === void 0) return [];\n\t\treturn Object.entries(model.fields).flatMap(([fieldName, field]) => {\n\t\t\tif (field.type.kind !== \"valueObject\") return [];\n\t\t\tconst columnName = storage.fields[fieldName]?.column;\n\t\t\tconst column = columnName === void 0 ? void 0 : table.table.columns[columnName];\n\t\t\tif (columnName === void 0 || column === void 0) return [];\n\t\t\tconst path = `${table.path}.columns.${columnName}`;\n\t\t\tif (expectedCodecId === void 0) return [valueObjectStorageTypeMissingMessage(path)];\n\t\t\tif (column.codecId === expectedCodecId) return [];\n\t\t\treturn [`${path}: a value-object column uses codec ${expectedCodecId}, the codec of the stack's value-object storage type ${storageTypeName}, not ${column.codecId}`];\n\t\t});\n\t}));\n}\n/**\n* Checks a deserialized contract against the stack that loads it: each column's codec represents the data type the column names, each value-object column uses the codec of the stack's value-object storage type, and each literal default is a value of its column's type under the column's parameters.\n*/\nfunction assertContractMatchesStack(contract, stack) {\n\tconst defaults = refusedDefaults(contract.storage, stack.dataTypes.lookup);\n\tconst problems = [\n\t\t...dataTypeProblems(contract.storage, stack.codecLookup),\n\t\t...valueObjectProblems(contract, stack.authoringContributions),\n\t\t...defaults.map(({ text }) => text)\n\t];\n\tif (problems.length > 0) throw new ContractValidationError(problems.join(\"; \"), \"storage\", defaults.length > 0 ? { refusedDefaults: defaults.map(({ refused }) => refused) } : void 0);\n}\n//#endregion\n//#region src/core/migrations/operation-storage-name.ts\nfunction isStorageDetails(details) {\n\tif (typeof details !== \"object\" || details === null) return false;\n\tconst [objectType, name, schema, table] = [\n\t\t\"objectType\",\n\t\t\"name\",\n\t\t\"schema\",\n\t\t\"table\"\n\t].map((key) => Reflect.get(details, key));\n\treturn typeof objectType === \"string\" && typeof name === \"string\" && (schema === void 0 || typeof schema === \"string\") && (table === void 0 || typeof table === \"string\");\n}\nfunction storageDetailsOf(operation) {\n\tconst target = Reflect.get(operation, \"target\");\n\tif (typeof target !== \"object\" || target === null) return void 0;\n\tconst details = Reflect.get(target, \"details\");\n\treturn isStorageDetails(details) ? details : void 0;\n}\n/**\n* The name the database knows an operation's object by, read from the operation's target\n* details: `schema.table.column` for a column, `schema.name` for anything else, without the\n* schema in the unbound namespace. An operation without details is named by its id.\n*/\nfunction storageNameOfOperation(operation) {\n\tconst details = storageDetailsOf(operation);\n\tif (details === void 0) return operation.id;\n\tconst schema = details.schema === void 0 || details.schema === UNBOUND_NAMESPACE_ID ? [] : [details.schema];\n\tconst table = details.objectType === \"column\" && details.table !== void 0 ? [details.table] : [];\n\treturn [\n\t\t...schema,\n\t\t...table,\n\t\tdetails.name\n\t].join(\".\");\n}\n//#endregion\n//#region src/core/operation-preview.ts\nfunction isDdlStatement(sqlStatement) {\n\tconst trimmed = sqlStatement.trim().toLowerCase();\n\treturn trimmed.startsWith(\"create \") || trimmed.startsWith(\"alter \") || trimmed.startsWith(\"drop \");\n}\nfunction hasExecuteSteps(operation) {\n\tconst execute = Reflect.get(operation, \"execute\");\n\tif (!Array.isArray(execute)) return false;\n\treturn execute.every((step) => typeof step === \"object\" && step !== null && \"sql\" in step);\n}\n/**\n* Extracts a best-effort SQL DDL preview for CLI plan output.\n* Presentation-only: never used to decide migration correctness.\n*/\nfunction extractSqlDdl(operations) {\n\tconst statements = [];\n\tfor (const operation of operations) {\n\t\tif (!hasExecuteSteps(operation)) continue;\n\t\tfor (const step of operation.execute) if (typeof step.sql === \"string\" && isDdlStatement(step.sql)) statements.push(step.sql.trim());\n\t}\n\treturn statements;\n}\n/**\n* Wraps `extractSqlDdl` into the family-agnostic `OperationPreview` shape.\n* Each statement carries `language: 'sql'`.\n*/\nfunction sqlOperationsToPreview(operations) {\n\treturn { statements: extractSqlDdl(operations).map((text) => ({\n\t\ttext,\n\t\tlanguage: \"sql\"\n\t})) };\n}\n//#endregion\n//#region src/core/control-instance.ts\nfunction missingDescriptorOperationError(targetId, operation) {\n\treturn sqlFamilyError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `SQL target \"${targetId}\" is missing the required ${operation} descriptor operation`, {\n\t\twhy: `The target descriptor does not contribute the ${operation} operation the SQL family requires for this call.`,\n\t\tfix: `Use a target package whose control descriptor implements ${operation}.`,\n\t\tmeta: {\n\t\t\ttargetId,\n\t\t\toperation\n\t\t}\n\t});\n}\nfunction extractCodecTypeIdsFromContract(contract) {\n\tconst typeIds = /* @__PURE__ */ new Set();\n\tif (typeof contract === \"object\" && contract !== null && \"storage\" in contract && typeof contract.storage === \"object\" && contract.storage !== null && \"namespaces\" in contract.storage && typeof contract.storage.namespaces === \"object\" && contract.storage.namespaces !== null) {\n\t\tconst namespaces = blindCast(contract.storage.namespaces);\n\t\tfor (const ns of Object.values(namespaces)) {\n\t\t\tconst tbls = ns.entries[\"table\"];\n\t\t\tif (typeof tbls !== \"object\" || tbls === null) continue;\n\t\t\tfor (const table of Object.values(tbls)) if (typeof table === \"object\" && table !== null && \"columns\" in table && typeof table.columns === \"object\" && table.columns !== null) {\n\t\t\t\tconst columns = blindCast(table.columns);\n\t\t\t\tfor (const column of Object.values(columns)) if (column && typeof column === \"object\" && \"codecId\" in column && typeof column.codecId === \"string\") typeIds.add(column.codecId);\n\t\t\t}\n\t\t}\n\t}\n\treturn Array.from(typeIds).sort();\n}\nfunction createVerifyResult(options) {\n\tconst contract = { storageHash: options.contractStorageHash };\n\tif (options.contractProfileHash) contract.profileHash = options.contractProfileHash;\n\tconst target = { expected: options.expectedTargetId };\n\tif (options.actualTargetId) target.actual = options.actualTargetId;\n\tconst meta = { contractPath: options.contractPath };\n\tif (options.configPath) meta.configPath = options.configPath;\n\treturn {\n\t\tok: options.ok,\n\t\tsummary: options.summary,\n\t\tcontract,\n\t\ttarget,\n\t\tmeta,\n\t\ttimings: { total: options.totalTime },\n\t\t...ifDefined(\"code\", options.code),\n\t\t...options.marker ? { marker: {\n\t\t\tstorageHash: options.marker.storageHash,\n\t\t\tprofileHash: options.marker.profileHash\n\t\t} } : {},\n\t\t...ifDefined(\"missingCodecs\", options.missingCodecs),\n\t\t...ifDefined(\"codecCoverageSkipped\", options.codecCoverageSkipped)\n\t};\n}\n/**\n* Builds a map from each extension id to the set of extension ids it\n* transitively depends on. Uses the same declared-dependency data that\n* `buildExtensionLoadOrder` in control-stack uses.\n*/\nfunction buildTransitiveDependsOnMap(extensions) {\n\tconst directDeps = /* @__PURE__ */ new Map();\n\tfor (const ext of extensions) {\n\t\tconst packs = ext.contractSpace?.contractJson?.extensions;\n\t\tconst deps = packs !== null && typeof packs === \"object\" ? Object.keys(packs) : [];\n\t\tdirectDeps.set(ext.id, deps);\n\t}\n\tconst result = /* @__PURE__ */ new Map();\n\tconst resolve = (id, visiting) => {\n\t\tconst cached = result.get(id);\n\t\tif (cached !== void 0) return cached;\n\t\tconst set = /* @__PURE__ */ new Set();\n\t\tresult.set(id, set);\n\t\tfor (const depId of directDeps.get(id) ?? []) {\n\t\t\tset.add(depId);\n\t\t\tif (!visiting.has(depId)) {\n\t\t\t\tvisiting.add(depId);\n\t\t\t\tfor (const transitive of resolve(depId, visiting)) set.add(transitive);\n\t\t\t\tvisiting.delete(depId);\n\t\t\t}\n\t\t}\n\t\treturn set;\n\t};\n\tfor (const ext of extensions) resolve(ext.id, /* @__PURE__ */ new Set([ext.id]));\n\treturn result;\n}\n/**\n* Asserts that no cross-space FK in any extension points against the\n* dependency direction.\n*\n* A cross-space FK (target.spaceId present) from extension A pointing at\n* space B is a violation when B depends on A (directly or transitively),\n* because that means A is pointing \"upward\" against the dependency arrows\n* established by the extension load order.\n*\n* Throws with a diagnostic naming the violating extension (source), the\n* target space, and the direction violation.\n*/\nfunction isObjectRecord(v) {\n\treturn typeof v === \"object\" && v !== null;\n}\nfunction assertNoCrossSpaceFkReverseReferences(extensions) {\n\tconst dependsOnMap = buildTransitiveDependsOnMap(extensions);\n\tfor (const ext of extensions) {\n\t\tconst namespaces = ext.contractSpace?.contractJson?.storage?.namespaces;\n\t\tif (!isObjectRecord(namespaces)) continue;\n\t\tfor (const ns of Object.values(namespaces)) {\n\t\t\tif (!isObjectRecord(ns)) continue;\n\t\t\tconst entries = ns[\"entries\"];\n\t\t\tif (!isObjectRecord(entries)) continue;\n\t\t\tfor (const slot of Object.values(entries)) {\n\t\t\t\tif (!isObjectRecord(slot)) continue;\n\t\t\t\tfor (const table of Object.values(slot)) {\n\t\t\t\t\tif (!isObjectRecord(table)) continue;\n\t\t\t\t\tconst foreignKeys = table[\"foreignKeys\"];\n\t\t\t\t\tif (!Array.isArray(foreignKeys)) continue;\n\t\t\t\t\tfor (const fk of foreignKeys) {\n\t\t\t\t\t\tif (!isObjectRecord(fk)) continue;\n\t\t\t\t\t\tconst target = fk[\"target\"];\n\t\t\t\t\t\tif (!isObjectRecord(target)) continue;\n\t\t\t\t\t\tif (target[\"spaceId\"] === void 0) continue;\n\t\t\t\t\t\tconst targetSpaceId = target[\"spaceId\"];\n\t\t\t\t\t\tif (typeof targetSpaceId !== \"string\") continue;\n\t\t\t\t\t\tif (dependsOnMap.get(targetSpaceId)?.has(ext.id)) throw sqlFamilyError(\"CONTRACT.FOREIGN_KEY_INVALID\", `Cross-space FK reverse-reference detected: extension \"${ext.id}\" has a cross-space FK targeting space \"${targetSpaceId}\", but \"${targetSpaceId}\" depends on \"${ext.id}\". Cross-space FKs must follow the dependency direction (a space can only reference spaces it depends on, not spaces that depend on it).`, {\n\t\t\t\t\t\t\twhy: \"The foreign key points against the contract-space dependency direction.\",\n\t\t\t\t\t\t\tfix: \"Move the foreign key to the depending space, or restructure the extension dependencies so the referencing space depends on the referenced one.\",\n\t\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\t\textensionId: ext.id,\n\t\t\t\t\t\t\t\ttargetSpaceId\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n/** The discriminators of the composed entity types whose names are unique across namespaces. */\nfunction entityKindsNamedOnce(entityTypes) {\n\treturn Object.values(entityTypes).flatMap((value) => {\n\t\tif (!isAuthoringEntityTypeDescriptor(value)) return entityKindsNamedOnce(value);\n\t\treturn requiresNameUniqueAcrossNamespaces(value.output) ? [value.discriminator] : [];\n\t});\n}\n/**\n* Checks the packs' entities of a kind whose names are unique across namespaces, such as a Postgres extension: each must be in the unbound namespace, and no two packs may declare the same one.\n*/\nfunction assertPackEntitiesDeclaredOnce(extensions, entityTypes) {\n\tfor (const kind of entityKindsNamedOnce(entityTypes)) {\n\t\tconst declaringPack = /* @__PURE__ */ new Map();\n\t\tfor (const ext of extensions) {\n\t\t\tconst namespaces = ext.contractSpace?.contractJson?.storage?.namespaces;\n\t\t\tif (!isObjectRecord(namespaces)) continue;\n\t\t\tfor (const [namespaceId, ns] of Object.entries(namespaces)) {\n\t\t\t\tif (!isObjectRecord(ns) || !isObjectRecord(ns[\"entries\"])) continue;\n\t\t\t\tconst declared = ns[\"entries\"][kind];\n\t\t\t\tif (!isObjectRecord(declared)) continue;\n\t\t\t\tfor (const name of Object.keys(declared)) {\n\t\t\t\t\tif (namespaceId !== UNBOUND_NAMESPACE_ID) throw sqlFamilyError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Extension pack \"${ext.id}\" declares ${kind} \"${name}\" in namespace \"${namespaceId}\". A pack declares each ${kind} in namespace \"${UNBOUND_PSL_NAMESPACE_NAME}\", so the connection's search path finds it.`, { meta: {\n\t\t\t\t\t\tentityKind: kind,\n\t\t\t\t\t\tentityName: name,\n\t\t\t\t\t\tpackId: ext.id,\n\t\t\t\t\t\tnamespaceId\n\t\t\t\t\t} });\n\t\t\t\t\tconst earlier = declaringPack.get(name);\n\t\t\t\t\tif (earlier !== void 0 && earlier !== ext.id) throw sqlFamilyError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Extension packs \"${earlier}\" and \"${ext.id}\" both declare ${kind} \"${name}\". Each ${kind} can be declared by one contract space only; compose only one of these packs.`, { meta: {\n\t\t\t\t\t\tentityKind: kind,\n\t\t\t\t\t\tentityName: name,\n\t\t\t\t\t\tpackIds: [earlier, ext.id]\n\t\t\t\t\t} });\n\t\t\t\t\tdeclaringPack.set(name, ext.id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\nfunction createSqlFamilyInstance(stack) {\n\tenforceSqlDataTypeInvariants(stack.declaredDataTypes, stack.codecDescriptors);\n\tif (!stack.adapter) throw new InternalError(\"SQL family requires an adapter descriptor in ControlStack\");\n\tconst target = blindCast(stack.target);\n\tconst adapter = blindCast(stack.adapter);\n\tconst extensions = blindCast(stack.extensions);\n\tfor (const extension of extensions) if (extension.contractSpace) {\n\t\tconst { contractJson, headRef } = extension.contractSpace;\n\t\tassertDescriptorSelfConsistency({\n\t\t\textensionId: extension.id,\n\t\t\ttarget: contractJson.target,\n\t\t\ttargetFamily: contractJson.targetFamily,\n\t\t\tstorage: contractJson.storage,\n\t\t\theadRefHash: headRef.hash,\n\t\t\t...sqlContractCanonicalizationHooks\n\t\t});\n\t}\n\tassertNoCrossSpaceFkReverseReferences(extensions);\n\tassertPackEntitiesDeclaredOnce(extensions, stack.authoringContributions.entityTypes);\n\tconst { codecTypeImports, extensionIds } = stack;\n\tlet controlAdapter;\n\tconst getControlAdapter = () => controlAdapter ??= adapter.create(stack);\n\tconst targetSerializer = blindCast(target).contractSerializer;\n\tconst targetInferPslContract = blindCast(target).inferPslContract;\n\tconst pslBuildContext = {\n\t\tauthoringContributions: stack.authoringContributions,\n\t\tcodecLookup: stack.codecLookup,\n\t\tdataTypes: stack.dataTypes,\n\t\tgeneratorFunctions: stack.generatorFunctions,\n\t\tcomponentIdsByGenerator: stack.controlMutationDefaults.componentIdsByGenerator\n\t};\n\tconst targetBuildPslContract = blindCast(target).buildPslContract;\n\tconst diffSchema = blindCast(target).diffSchema;\n\tconst targetGranularityOf = blindCast(target).classifySubjectGranularity;\n\tconst targetEntityKindOf = blindCast(target).classifyEntityKind;\n\tconst targetAccessChangesOf = blindCast(target).accessChangesOf;\n\tconst describedContracts = extensions.flatMap((extension) => extension.contractSpace ? [{\n\t\tspaceId: extension.id,\n\t\tcontract: extension.contractSpace.contractJson\n\t}] : []);\n\tconst loadContract = (contractOrJson) => {\n\t\tconst serializer = targetSerializer ?? new SqlContractSerializer();\n\t\tconst json = targetSerializer !== void 0 && !isPlainRecord(contractOrJson) ? targetSerializer.serializeContract(blindCast(contractOrJson)) : contractOrJson;\n\t\tconst contract = serializer.deserializeContract(json);\n\t\tassertContractMatchesStack(contract, stack);\n\t\treturn contract;\n\t};\n\tconst contractHashesOf = (contract) => {\n\t\tconst storageHash = contract.storage.storageHash;\n\t\treturn {\n\t\t\tstorageHash,\n\t\t\tprofileHash: \"profileHash\" in contract && typeof contract.profileHash === \"string\" ? contract.profileHash : storageHash\n\t\t};\n\t};\n\tconst signSpaceMarker = async (controlAdapter, driver, { space, contract, expected }) => {\n\t\tconst { storageHash, profileHash } = contractHashesOf(contract);\n\t\tconst signed = {\n\t\t\tspace,\n\t\t\tcontract: {\n\t\t\t\tstorageHash,\n\t\t\t\tprofileHash\n\t\t\t}\n\t\t};\n\t\tconst readHashes = async () => {\n\t\t\tconst marker = await controlAdapter.readMarker(driver, space);\n\t\t\treturn marker === null ? null : {\n\t\t\t\tstorageHash: marker.storageHash,\n\t\t\t\tprofileHash: marker.profileHash\n\t\t\t};\n\t\t};\n\t\tconst existing = await readHashes();\n\t\tif (!sameMarkerHashes(existing, expected)) return {\n\t\t\t...signed,\n\t\t\tstatus: \"conflict\",\n\t\t\treason: \"storageHash\",\n\t\t\texpected,\n\t\t\tfound: existing\n\t\t};\n\t\tif (existing === null) {\n\t\t\tawait controlAdapter.insertMarker(driver, space, {\n\t\t\t\tstorageHash,\n\t\t\t\tprofileHash\n\t\t\t});\n\t\t\treturn {\n\t\t\t\t...signed,\n\t\t\t\tstatus: \"created\"\n\t\t\t};\n\t\t}\n\t\tif (existing.storageHash === storageHash && existing.profileHash === profileHash) return {\n\t\t\t...signed,\n\t\t\tstatus: \"unchanged\"\n\t\t};\n\t\tif (!await controlAdapter.updateMarker(driver, space, existing.storageHash, {\n\t\t\tstorageHash,\n\t\t\tprofileHash\n\t\t})) return {\n\t\t\t...signed,\n\t\t\tstatus: \"conflict\",\n\t\t\treason: \"storageHash\",\n\t\t\texpected,\n\t\t\tfound: await readHashes()\n\t\t};\n\t\treturn {\n\t\t\t...signed,\n\t\t\tstatus: \"updated\",\n\t\t\tprevious: existing\n\t\t};\n\t};\n\tconst databasePoliciesConflict = async (controlAdapter, driver, checked) => {\n\t\tconst comparison = compareMarkerDatabasePolicies(await controlAdapter.readMarker(driver, APP_SPACE_ID), checked);\n\t\tif (comparison.kind === \"held\") return void 0;\n\t\treturn {\n\t\t\tspace: APP_SPACE_ID,\n\t\t\tstatus: \"conflict\",\n\t\t\treason: \"databasePolicies\",\n\t\t\tchecked,\n\t\t\tcomparison\n\t\t};\n\t};\n\tconst signSpaces = async (driver, spaces, expectedDatabasePolicies) => {\n\t\tconst [first] = spaces;\n\t\tif (first === void 0) return [];\n\t\tconst controlAdapter = getControlAdapter();\n\t\tconst createMarkerTable = async () => {\n\t\t\tfor (const query of controlAdapter.bootstrapSignMarkerQueries()) {\n\t\t\t\tconst lowered = await controlAdapter.lowerToExecuteRequest(query, { contract: first.contract });\n\t\t\t\tawait driver.query(lowered.sql, lowered.params);\n\t\t\t}\n\t\t};\n\t\tconst writeMarkers = async () => {\n\t\t\tif (expectedDatabasePolicies !== void 0) {\n\t\t\t\tconst conflict = await databasePoliciesConflict(controlAdapter, driver, expectedDatabasePolicies);\n\t\t\t\tif (conflict !== void 0) return [conflict];\n\t\t\t}\n\t\t\tconst signatures = [];\n\t\t\tfor (const space of spaces) signatures.push(await signSpaceMarker(controlAdapter, driver, space));\n\t\t\treturn signatures;\n\t\t};\n\t\tif (controlAdapter.holdMarkerLock === void 0) return controlAdapter.withTransaction(driver, async () => {\n\t\t\tawait controlAdapter.lockMarker(driver);\n\t\t\tawait createMarkerTable();\n\t\t\treturn writeMarkers();\n\t\t});\n\t\treturn controlAdapter.holdMarkerLock(driver, async () => {\n\t\t\tawait createMarkerTable();\n\t\t\treturn controlAdapter.withTransaction(driver, writeMarkers);\n\t\t});\n\t};\n\treturn {\n\t\tfamilyId: \"sql\",\n\t\tcodecTypeImports,\n\t\textensionIds,\n\t\tget markerLocation() {\n\t\t\treturn getControlAdapter().markerLocation;\n\t\t},\n\t\tdeserializeContract(contractJson) {\n\t\t\treturn loadContract(contractJson);\n\t\t},\n\t\tasync verify(verifyOptions) {\n\t\t\tconst { driver, contract: rawContract, expectedTargetId, contractPath, configPath } = verifyOptions;\n\t\t\tconst startTime = Date.now();\n\t\t\tconst contract = loadContract(rawContract);\n\t\t\tconst contractStorageHash = contract.storage.storageHash;\n\t\t\tconst contractProfileHash = contract.profileHash;\n\t\t\tconst contractTarget = contract.target;\n\t\t\tconst marker = await getControlAdapter().readMarker(driver, APP_SPACE_ID);\n\t\t\tlet missingCodecs;\n\t\t\tlet codecCoverageSkipped = false;\n\t\t\tconst supportedTypeIds = collectSupportedCodecTypeIds([\n\t\t\t\tadapter,\n\t\t\t\ttarget,\n\t\t\t\t...extensions\n\t\t\t]);\n\t\t\tif (supportedTypeIds.length === 0) codecCoverageSkipped = true;\n\t\t\telse {\n\t\t\t\tconst supportedSet = new Set(supportedTypeIds);\n\t\t\t\tconst missing = extractCodecTypeIdsFromContract(contract).filter((id) => !supportedSet.has(id));\n\t\t\t\tif (missing.length > 0) missingCodecs = missing;\n\t\t\t}\n\t\t\tif (!marker) return createVerifyResult({\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_MARKER_MISSING,\n\t\t\t\tsummary: \"Marker missing\",\n\t\t\t\tcontractStorageHash,\n\t\t\t\texpectedTargetId,\n\t\t\t\tcontractPath,\n\t\t\t\ttotalTime: Date.now() - startTime,\n\t\t\t\t...contractProfileHash ? { contractProfileHash } : {},\n\t\t\t\t...missingCodecs ? { missingCodecs } : {},\n\t\t\t\t...codecCoverageSkipped ? { codecCoverageSkipped } : {},\n\t\t\t\t...configPath ? { configPath } : {}\n\t\t\t});\n\t\t\tif (contractTarget !== expectedTargetId) return createVerifyResult({\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_TARGET_MISMATCH,\n\t\t\t\tsummary: \"Target mismatch\",\n\t\t\t\tcontractStorageHash,\n\t\t\t\tmarker,\n\t\t\t\texpectedTargetId,\n\t\t\t\tactualTargetId: contractTarget,\n\t\t\t\tcontractPath,\n\t\t\t\ttotalTime: Date.now() - startTime,\n\t\t\t\t...contractProfileHash ? { contractProfileHash } : {},\n\t\t\t\t...missingCodecs ? { missingCodecs } : {},\n\t\t\t\t...codecCoverageSkipped ? { codecCoverageSkipped } : {},\n\t\t\t\t...configPath ? { configPath } : {}\n\t\t\t});\n\t\t\tif (marker.storageHash !== contractStorageHash) return createVerifyResult({\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_HASH_MISMATCH,\n\t\t\t\tsummary: \"Hash mismatch\",\n\t\t\t\tcontractStorageHash,\n\t\t\t\tmarker,\n\t\t\t\texpectedTargetId,\n\t\t\t\tcontractPath,\n\t\t\t\ttotalTime: Date.now() - startTime,\n\t\t\t\t...contractProfileHash ? { contractProfileHash } : {},\n\t\t\t\t...missingCodecs ? { missingCodecs } : {},\n\t\t\t\t...codecCoverageSkipped ? { codecCoverageSkipped } : {},\n\t\t\t\t...configPath ? { configPath } : {}\n\t\t\t});\n\t\t\tif (contractProfileHash && marker.profileHash !== contractProfileHash) return createVerifyResult({\n\t\t\t\tok: false,\n\t\t\t\tcode: VERIFY_CODE_HASH_MISMATCH,\n\t\t\t\tsummary: \"Hash mismatch\",\n\t\t\t\tcontractStorageHash,\n\t\t\t\tcontractProfileHash,\n\t\t\t\tmarker,\n\t\t\t\texpectedTargetId,\n\t\t\t\tcontractPath,\n\t\t\t\ttotalTime: Date.now() - startTime,\n\t\t\t\t...missingCodecs ? { missingCodecs } : {},\n\t\t\t\t...codecCoverageSkipped ? { codecCoverageSkipped } : {},\n\t\t\t\t...configPath ? { configPath } : {}\n\t\t\t});\n\t\t\treturn createVerifyResult({\n\t\t\t\tok: true,\n\t\t\t\tsummary: \"Database matches contract\",\n\t\t\t\tcontractStorageHash,\n\t\t\t\tmarker,\n\t\t\t\texpectedTargetId,\n\t\t\t\tcontractPath,\n\t\t\t\ttotalTime: Date.now() - startTime,\n\t\t\t\t...contractProfileHash ? { contractProfileHash } : {},\n\t\t\t\t...missingCodecs ? { missingCodecs } : {},\n\t\t\t\t...codecCoverageSkipped ? { codecCoverageSkipped } : {},\n\t\t\t\t...configPath ? { configPath } : {}\n\t\t\t});\n\t\t},\n\t\tverifySchema(options) {\n\t\t\tconst contract = loadContract(options.contract);\n\t\t\tif (!diffSchema) throw missingDescriptorOperationError(target.targetId, \"diffSchema\");\n\t\t\tif (!targetGranularityOf) throw missingDescriptorOperationError(target.targetId, \"classifySubjectGranularity\");\n\t\t\treturn verifySqlSchemaByDiff({\n\t\t\t\tcontract,\n\t\t\t\tschema: options.schema,\n\t\t\t\tstrict: options.strict,\n\t\t\t\tframeworkComponents: options.frameworkComponents,\n\t\t\t\tdiffSchema,\n\t\t\t\tgranularityOf: targetGranularityOf\n\t\t\t});\n\t\t},\n\t\t/**\n\t\t* Classifies a diff issue's subject granularity on demand, by resolving\n\t\t* its node's `nodeKind` through the target's classifier — the\n\t\t* {@link import('@internal/framework-components/control').SchemaSubjectClassifierCapable}\n\t\t* capability. Framework consumers spanning contract spaces (the\n\t\t* migration aggregate's unclaimed-elements sweep) detect and call this\n\t\t* instead of reaching into the concrete schema-IR node, which they\n\t\t* cannot read; nothing is stamped on the issue or the node.\n\t\t*/\n\t\tclassifySubjectGranularity(issue) {\n\t\t\tif (!targetGranularityOf) throw missingDescriptorOperationError(target.targetId, \"classifySubjectGranularity\");\n\t\t\treturn classifyDiffSubjectGranularity(issue, targetGranularityOf);\n\t\t},\n\t\t/**\n\t\t* Classifies a diff issue's subject storage `entityKind` on demand, by\n\t\t* resolving its node's `nodeKind` through the target's classifier —\n\t\t* the sibling of `classifySubjectGranularity` above, and part of the\n\t\t* same {@link import('@internal/framework-components/control').SchemaSubjectClassifierCapable}\n\t\t* capability.\n\t\t*/\n\t\tclassifyEntityKind(issue) {\n\t\t\tif (!targetEntityKindOf) throw missingDescriptorOperationError(target.targetId, \"classifyEntityKind\");\n\t\t\treturn classifyDiffEntityKind(issue, targetEntityKindOf);\n\t\t},\n\t\tasync signSpaces(options) {\n\t\t\treturn signSpaces(options.driver, options.spaces, options.expectedDatabasePolicies);\n\t\t},\n\t\tasync readMarker(options) {\n\t\t\treturn getControlAdapter().readMarker(options.driver, options.space);\n\t\t},\n\t\tasync readAllMarkers(options) {\n\t\t\treturn getControlAdapter().readAllMarkers(options.driver);\n\t\t},\n\t\tasync readLedger(options) {\n\t\t\treturn getControlAdapter().readLedger(options.driver, options.space);\n\t\t},\n\t\tasync initMarker(options) {\n\t\t\treturn getControlAdapter().initMarker(options.driver, options.space, options.destination);\n\t\t},\n\t\tasync updateMarker(options) {\n\t\t\treturn getControlAdapter().updateMarker(options.driver, options.space, options.expectedFrom, options.destination);\n\t\t},\n\t\tasync writeLedgerEntry(options) {\n\t\t\treturn getControlAdapter().writeLedgerEntry(options.driver, options.space, options.entry);\n\t\t},\n\t\tasync introspect(options) {\n\t\t\treturn getControlAdapter().introspect(options.driver, options.contract);\n\t\t},\n\t\tasync inferPslContract(schemaIR) {\n\t\t\tif (!targetInferPslContract) throw sqlFamilyError(\"CONTRACT.INFER_UNSUPPORTED\", `Target \"${target.targetId}\" does not support contract infer (no inferPslContract on its descriptor).`, {\n\t\t\t\twhy: \"The target descriptor does not provide the inferPslContract hook, so a PSL contract cannot be inferred from the database schema.\",\n\t\t\t\tfix: \"Use a target package that supports contract infer, or author the contract instead of inferring it.\",\n\t\t\t\tmeta: { targetId: target.targetId }\n\t\t\t});\n\t\t\treturn targetInferPslContract(schemaIR, pslBuildContext, describedContracts);\n\t\t},\n\t\tbuildPslContract(contract) {\n\t\t\tif (!targetBuildPslContract) throw sqlFamilyError(\"CONTRACT.PRINT_UNSUPPORTED\", `Target \"${target.targetId}\" does not support contract print (no buildPslContract on its descriptor).`, {\n\t\t\t\twhy: \"The target descriptor does not provide the buildPslContract hook, so the contract cannot be printed as a Prisma 8 PSL file.\",\n\t\t\t\tfix: \"Use a target whose descriptor provides buildPslContract, or write the Prisma 8 PSL file by hand.\",\n\t\t\t\tmeta: { targetId: target.targetId }\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tdocument: targetBuildPslContract(contract, pslBuildContext),\n\t\t\t\tsourceSettings: ifDefined(\"defaultControlPolicy\", contract.defaultControlPolicy)\n\t\t\t};\n\t\t},\n\t\tlowerAst(ast, context) {\n\t\t\treturn getControlAdapter().lowerToExecuteRequest(ast, context);\n\t\t},\n\t\tbootstrapControlTableQueries() {\n\t\t\treturn getControlAdapter().bootstrapControlTableQueries();\n\t\t},\n\t\ttoOperationPreview(operations) {\n\t\t\treturn sqlOperationsToPreview(operations);\n\t\t},\n\t\tstorageNameOf(operation) {\n\t\t\treturn storageNameOfOperation(operation);\n\t\t},\n\t\taccessChangesOf(operations) {\n\t\t\tif (targetAccessChangesOf === void 0) throw missingDescriptorOperationError(target.targetId, \"accessChangesOf\");\n\t\t\treturn targetAccessChangesOf(operations);\n\t\t},\n\t\ttoSchemaView(schema) {\n\t\t\tconst root = blindCast(schema);\n\t\t\tconst namespaceEntries = root.namespaces !== void 0 ? Object.entries(root.namespaces).map(([namespaceKey, namespace]) => [namespaceKey, namespace.tables]) : [[void 0, root.tables ?? {}]];\n\t\t\tconst qualify = namespaceEntries.length > 1;\n\t\t\tconst tableNodes = namespaceEntries.flatMap(([namespaceKey, tables]) => Object.entries(tables).map(([tableName, table]) => [\n\t\t\t\tqualify && namespaceKey !== void 0 ? `${namespaceKey}.${tableName}` : tableName,\n\t\t\t\ttableName,\n\t\t\t\ttable\n\t\t\t])).map(([displayName, tableName, table]) => {\n\t\t\t\tconst children = [];\n\t\t\t\tconst columnNodes = [];\n\t\t\t\tfor (const [columnName, column] of Object.entries(table.columns)) {\n\t\t\t\t\tconst typeDisplay = column.typeText;\n\t\t\t\t\tconst nullability = column.nullable ? \"nullable\" : \"not nullable\";\n\t\t\t\t\tcolumnNodes.push(new SchemaTreeNode({\n\t\t\t\t\t\tkind: \"field\",\n\t\t\t\t\t\tid: `column-${displayName}-${columnName}`,\n\t\t\t\t\t\tlabelParts: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttext: columnName,\n\t\t\t\t\t\t\t\trole: \"name\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{ text: \": \" },\n\t\t\t\t\t\t\t{ text: typeDisplay },\n\t\t\t\t\t\t\t{ text: \" \" },\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttext: `(${nullability})`,\n\t\t\t\t\t\t\t\trole: \"detail\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\ttypeText: column.typeText,\n\t\t\t\t\t\t\tnullable: column.nullable,\n\t\t\t\t\t\t\t...ifDefined(\"default\", column.default)\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t\tif (columnNodes.length > 0) children.push(new SchemaTreeNode({\n\t\t\t\t\tkind: \"collection\",\n\t\t\t\t\tid: `columns-${displayName}`,\n\t\t\t\t\tlabelParts: [{\n\t\t\t\t\t\ttext: \"columns\",\n\t\t\t\t\t\trole: \"keyword\"\n\t\t\t\t\t}],\n\t\t\t\t\tchildren: columnNodes\n\t\t\t\t}));\n\t\t\t\tif (table.primaryKey) {\n\t\t\t\t\tconst pkColumns = table.primaryKey.columns.join(\", \");\n\t\t\t\t\tchildren.push(new SchemaTreeNode({\n\t\t\t\t\t\tkind: \"index\",\n\t\t\t\t\t\tid: `primary-key-${displayName}`,\n\t\t\t\t\t\tlabelParts: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttext: \"primary key\",\n\t\t\t\t\t\t\t\trole: \"keyword\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{ text: \": \" },\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttext: pkColumns,\n\t\t\t\t\t\t\t\trole: \"name\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tcolumns: table.primaryKey.columns,\n\t\t\t\t\t\t\t...table.primaryKey.name ? { name: table.primaryKey.name } : {}\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t\tfor (const unique of table.uniques) {\n\t\t\t\t\tconst name = unique.name ?? `${tableName}_${unique.columns.join(\"_\")}_unique`;\n\t\t\t\t\tchildren.push(new SchemaTreeNode({\n\t\t\t\t\t\tkind: \"index\",\n\t\t\t\t\t\tid: `unique-${displayName}-${name}`,\n\t\t\t\t\t\tlabelParts: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttext: \"unique\",\n\t\t\t\t\t\t\t\trole: \"keyword\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{ text: \" \" },\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttext: name,\n\t\t\t\t\t\t\t\trole: \"name\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tcolumns: unique.columns,\n\t\t\t\t\t\t\tunique: true\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t\tfor (const index of table.indexes) {\n\t\t\t\t\tconst name = index.name;\n\t\t\t\t\tchildren.push(new SchemaTreeNode({\n\t\t\t\t\t\tkind: \"index\",\n\t\t\t\t\t\tid: `index-${displayName}-${name}`,\n\t\t\t\t\t\tlabelParts: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttext: index.unique ? \"unique index\" : \"index\",\n\t\t\t\t\t\t\t\trole: \"keyword\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{ text: \" \" },\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttext: name,\n\t\t\t\t\t\t\t\trole: \"name\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\tcolumns: index.columns,\n\t\t\t\t\t\t\tunique: index.unique\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t\tconst tableMeta = {};\n\t\t\t\tif (table.primaryKey) {\n\t\t\t\t\ttableMeta[\"primaryKey\"] = table.primaryKey.columns;\n\t\t\t\t\tif (table.primaryKey.name) tableMeta[\"primaryKeyName\"] = table.primaryKey.name;\n\t\t\t\t}\n\t\t\t\tif (table.foreignKeys.length > 0) tableMeta[\"foreignKeys\"] = table.foreignKeys.map((fk) => ({\n\t\t\t\t\tcolumns: fk.columns,\n\t\t\t\t\treferencedTable: fk.referencedTable,\n\t\t\t\t\treferencedColumns: fk.referencedColumns,\n\t\t\t\t\t...fk.name ? { name: fk.name } : {}\n\t\t\t\t}));\n\t\t\t\treturn new SchemaTreeNode({\n\t\t\t\t\tkind: \"entity\",\n\t\t\t\t\tid: `table-${displayName}`,\n\t\t\t\t\tlabelParts: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttext: \"table\",\n\t\t\t\t\t\t\trole: \"keyword\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ text: \" \" },\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttext: displayName,\n\t\t\t\t\t\t\trole: \"name\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t...Object.keys(tableMeta).length > 0 ? { meta: tableMeta } : {},\n\t\t\t\t\t...children.length > 0 ? { children } : {}\n\t\t\t\t});\n\t\t\t});\n\t\t\treturn { root: new SchemaTreeNode({\n\t\t\t\tkind: \"root\",\n\t\t\t\tid: \"sql-schema\",\n\t\t\t\tlabelParts: [{\n\t\t\t\t\ttext: \"database\",\n\t\t\t\t\trole: \"title\"\n\t\t\t\t}],\n\t\t\t\t...tableNodes.length > 0 ? { children: tableNodes } : {}\n\t\t\t}) };\n\t\t}\n\t};\n}\n//#endregion\n//#region src/core/control-descriptor.ts\nconst sqlFamilyDescribeUnsupportedAttribute = describeUnsupportedSqlAttribute;\nconst sqlFamilyDescribeUnresolvedType = describeUnresolvedSqlType;\nvar SqlFamilyDescriptor = class {\n\tkind = \"family\";\n\tid = \"sql\";\n\tfamilyId = \"sql\";\n\tversion = \"0.0.1\";\n\temission = sqlEmission;\n\tdataTypes = sqlExpressionRegistration.dataTypes;\n\tauthoring = {\n\t\ttype: sqlFamilyAuthoringTypes,\n\t\tentityTypes: sqlFamilyEntityTypes,\n\t\tpslBlockDescriptors: sqlFamilyPslBlockDescriptors,\n\t\tattributeSpecs: sqlAttributeSpecs,\n\t\tdataTypes: sqlExpressionRegistration.authoring.dataTypes\n\t};\n\tgeneratorFunctions = sqlFamilyGeneratorFunctions;\n\tcontrolMutationDefaults = {\n\t\tdefaultFunctionRegistry: /* @__PURE__ */ new Map(),\n\t\tgeneratorDescriptors: sqlFamilyGeneratorDescriptors\n\t};\n\tfieldLength = ({ codecId, typeParams }, dataTypes) => sqlCodecColumnLength(dataTypes, codecId, typeParams);\n\tpslDiagnostics = {\n\t\tdescribeUnsupportedAttribute: sqlFamilyDescribeUnsupportedAttribute,\n\t\tdescribeUnresolvedType: sqlFamilyDescribeUnresolvedType\n\t};\n\tcreate(stack) {\n\t\treturn createSqlFamilyInstance(stack);\n\t}\n};\n//#endregion\n//#region src/core/default-functions.ts\n/**\n* The SQL family's default functions, each a database default: `autoincrement()` and `now()`. A value the client generates is a generator function, written `@onCreate(...)`.\n*/\nfunction sqlDefaultFunctions() {\n\treturn {\n\t\tautoincrement: {\n\t\t\tsignature: { documentation: \"Generates an increasing integer value in the database.\" },\n\t\t\tusageSignatures: [\"autoincrement()\"],\n\t\t\tlower: () => databaseFunction(\"autoincrement()\")\n\t\t},\n\t\tnow: {\n\t\t\tsignature: { documentation: \"Uses the current database timestamp as the default value.\" },\n\t\t\tusageSignatures: [\"now()\"],\n\t\t\tlower: () => databaseFunction(\"now()\")\n\t\t}\n\t};\n}\nfunction databaseFunction(expression) {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\n//#region src/core/migrations/accepted-by-data-type.ts\n/** Whether the data type of `codecRef`'s codec reads `json` as `contract.json` would; a codec the stack does not know accepts nothing. */\nfunction acceptedByDataType(json, codecRef, types) {\n\tconst descriptor = types.codecLookup.descriptorFor(codecRef.codecId);\n\tconst dataType = descriptor === void 0 ? void 0 : types.dataTypeLookup.get(descriptor.dataType);\n\tif (dataType === void 0) return false;\n\ttry {\n\t\tdataType.fromContract(json, dataTypeParams(dataType, codecRef.typeParams));\n\t\treturn true;\n\t} catch (error) {\n\t\tif (isStructuredError(error)) return false;\n\t\tthrow error;\n\t}\n}\n//#endregion\n//#region src/core/migrations/contract-to-schema-ir.ts\nfunction convertColumn(name, column, types, hooks) {\n\tconst dataType = sqlDataTypeOfCodec(column.codecId, types);\n\tconst storage = sqlStorageType(dataType, types.dataTypeLookup);\n\tconst typeText = schemaTypeText(storage, column.typeParams);\n\tconst many = column.many !== void 0 && column.many !== false;\n\tconst rawColumnDefault = column.default ?? void 0;\n\tconst resolvedColumnDefault = rawColumnDefault !== void 0 && hooks.resolveDefault ? hooks.resolveDefault(rawColumnDefault, {\n\t\ttypeText,\n\t\tdataTypeId: dataType.id,\n\t\tmany\n\t}) : rawColumnDefault;\n\treturn {\n\t\tname,\n\t\ttypeText,\n\t\tnullable: column.nullable,\n\t\t...ifDefined(\"many\", many ? true : void 0),\n\t\t...ifDefined(\"resolvedDefault\", resolvedColumnDefault),\n\t\t...ifDefined(\"authoredDefault\", rawColumnDefault),\n\t\tcodecRef: buildColumnCodecRef(column, many ? true : void 0),\n\t\tstoredType: storage,\n\t\tstoredTypeParams: storage.sql.normalize(dataTypeParams(storage, column.typeParams)),\n\t\t...ifDefined(\"catalogText\", nameIsCatalogText(storage) ? typeText : void 0),\n\t\t...ifDefined(\"defaultValue\", rawColumnDefault?.kind === \"literal\" && rawColumnDefault.value instanceof Date ? dateDefaultValue(rawColumnDefault.value, codecForRef(types.codecLookup, buildColumnCodecRef(column, void 0))) : contractDefaultValue(rawColumnDefault, dataType, dataTypeParams(dataType, column.typeParams), many)),\n\t\tsqlExpressionLiteralFor\n\t};\n}\nfunction sqlExpressionLiteralFor(text) {\n\treturn sqlTextsReadBack([text]) ? printSqlExpressionLiteral(text) : void 0;\n}\n/**\n* A `Date` default, which an in-memory contract can hold, as the value of the column's type the column's codec reads it as. `undefined` when the codec refuses it or no codec is registered, and the default then compares unequal to any other.\n*/\nfunction dateDefaultValue(value, codec) {\n\tif (codec === void 0) return void 0;\n\ttry {\n\t\treturn codec.toDataTypeValue(value);\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn;\n\t}\n}\n/**\n* A literal default as a value of the column's type, read from the JSON the contract stores, element by element for a list column. A `null` is a value of a type that stores one, such as a JSON type, and SQL NULL otherwise, as DDL writes it. Loading a contract refuses a value its type does not hold, so a refusal here only means no value, and the comparison falls back to the stored JSON.\n*/\nfunction contractDefaultValue(columnDefault, type, params, many) {\n\tif (columnDefault?.kind !== \"literal\" || columnDefault.value instanceof Date) return void 0;\n\tconst stored = columnDefault.value;\n\tconst read = (json) => {\n\t\ttry {\n\t\t\treturn type.fromContract(json, params);\n\t\t} catch (error) {\n\t\t\tif (isStructuredError(error) && json === null) return null;\n\t\t\tthrow error;\n\t\t}\n\t};\n\ttry {\n\t\tif (many && Array.isArray(stored)) return stored.map(read);\n\t\treturn read(stored) ?? void 0;\n\t} catch (error) {\n\t\tif (isStructuredError(error)) return void 0;\n\t\tthrow error;\n\t}\n}\n/**\n* The column's type as the database reports it, from the type it is stored as: the written name with the parameters the catalog prints for those written (`character(1)` for a bare `character`, `timestamptz` for a bare `timestamptz`), or for a type that claims a kind (an enum), its type name as stored.\n*/\nfunction schemaTypeText(type, typeParams) {\n\tconst params = dataTypeParams(type, typeParams);\n\treturn type.sql.claimsKind === void 0 ? renderSqlTypeName(type, type.sql.catalogParams(params)) : unquotedSqlBaseName(type, params);\n}\n/**\n* Builds the column's `CodecRef` from its codec identity — the same construction the query AST and the migration DDL renderer already use (TML-2456, TML-2918).\n*/\nfunction buildColumnCodecRef(column, many) {\n\treturn {\n\t\tcodecId: column.codecId,\n\t\t...ifDefined(\"typeParams\", column.typeParams !== void 0 ? blindCast(column.typeParams) : void 0),\n\t\t...ifDefined(\"many\", many)\n\t};\n}\nfunction convertCheck(check, tableName, tableColumns) {\n\treturn {\n\t\tnaming: namingOf(check.name, check.prefix),\n\t\texpression: check.expression,\n\t\tdependsOn: flatColumnDependsOn(tableName, tableColumns)\n\t};\n}\nfunction convertUnique(unique, tableName) {\n\treturn {\n\t\tcolumns: unique.columns,\n\t\t...ifDefined(\"name\", unique.name),\n\t\tdependsOn: flatColumnDependsOn(tableName, unique.columns)\n\t};\n}\nfunction convertIndex(index, tableName, tableColumns) {\n\tconst base = {\n\t\tnaming: namingOf(index.name, index.prefix),\n\t\twhere: index.where,\n\t\tunique: index.unique,\n\t\tpartial: index.where !== void 0,\n\t\ttype: index.type,\n\t\toptions: index.options,\n\t\tannotations: void 0,\n\t\tdependsOn: flatColumnDependsOn(tableName, index.columns ?? tableColumns)\n\t};\n\treturn index.expression !== void 0 ? {\n\t\t...base,\n\t\texpression: index.expression\n\t} : {\n\t\t...base,\n\t\tcolumns: index.columns ?? []\n\t};\n}\n/**\n* The referenced table's chain in the flat (single-schema) tree\n* `contractToSchemaIR`/`contractNamespaceToSchemaIR` build: the root\n* (`SqlSchemaIR`, fixed `'database'` id) followed by the table's own id.\n* Postgres discards this when it re-derives the FK against its own\n* multi-schema tree shape (`contractToPostgresDatabaseSchemaNode`); SQLite's\n* flat tree uses it as-is.\n*/\nfunction flatSchemaDependsOn(tableName) {\n\treturn [{\n\t\tnodeKind: RelationalSchemaNodeKind.schema,\n\t\tid: \"database\"\n\t}, {\n\t\tnodeKind: RelationalSchemaNodeKind.table,\n\t\tid: tableName\n\t}];\n}\n/**\n* The chains from a table-child object (foreign key, index, unique, primary\n* key) to each of the own columns it is built on, in the flat tree. Dropping\n* a covered column auto-drops the object, so the object's drop must precede\n* the column's; the graph derives that direction from these edges.\n*/\nfunction flatColumnDependsOn(tableName, columns) {\n\treturn columns.map((column) => [\n\t\t{\n\t\t\tnodeKind: RelationalSchemaNodeKind.schema,\n\t\t\tid: \"database\"\n\t\t},\n\t\t{\n\t\t\tnodeKind: RelationalSchemaNodeKind.table,\n\t\t\tid: tableName\n\t\t},\n\t\t{\n\t\t\tnodeKind: RelationalSchemaNodeKind.column,\n\t\t\tid: `column:${column}`\n\t\t}\n\t]);\n}\n/**\n* The FK's referenced-namespace identity comes from the target's namespace\n* node, not the raw namespace-id string. An unbound target namespace stamps\n* no `referencedSchema` at all — the FK node's id renders the absence as the\n* empty segment, which is what flat (single-schema) introspection produces,\n* so both diff sides' FK ids meet by construction. A bound namespace (or a\n* cross-space target whose namespace lives in another contract's storage)\n* stamps its coordinate verbatim; namespaced targets (Postgres) resolve the\n* real DDL schema downstream.\n*\n* `dependsOn` carries the referenced table (created before the FK, dropped\n* after it) plus the FK's own columns (dropped after the FK, since dropping a\n* column auto-drops the FK built on it).\n*/\nfunction convertForeignKey(fk, storage) {\n\tconst targetIsUnbound = storage.namespaces[fk.target.namespaceId]?.isUnbound === true;\n\treturn {\n\t\tcolumns: fk.source.columns,\n\t\treferencedTable: fk.target.tableName,\n\t\t...targetIsUnbound ? {} : { referencedSchema: fk.target.namespaceId },\n\t\treferencedColumns: fk.target.columns,\n\t\t...ifDefined(\"name\", fk.name),\n\t\t...ifDefined(\"onDelete\", fk.onDelete),\n\t\t...ifDefined(\"onUpdate\", fk.onUpdate),\n\t\tdependsOn: [flatSchemaDependsOn(fk.target.tableName), ...flatColumnDependsOn(fk.source.tableName, fk.source.columns)]\n\t};\n}\nconst COLUMN_TYPE_ERROR_CODES = /* @__PURE__ */ new Set([\"CONTRACT.CODEC_DESCRIPTOR_MISSING\", \"CONTRACT.DATA_TYPE_UNREGISTERED\"]);\nfunction withColumnInErrors(table, column, build) {\n\ttry {\n\t\treturn build();\n\t} catch (cause) {\n\t\tif (!isStructuredError(cause) || !COLUMN_TYPE_ERROR_CODES.has(cause.code)) throw cause;\n\t\tthrow structuredError(cause.code, cause.message, {\n\t\t\tcause,\n\t\t\t...ifDefined(\"why\", cause.why),\n\t\t\t...ifDefined(\"fix\", cause.fix),\n\t\t\tmeta: {\n\t\t\t\t...cause.meta,\n\t\t\t\ttable,\n\t\t\t\tcolumn\n\t\t\t}\n\t\t});\n\t}\n}\nfunction convertTable(name, table, types, hooks, storage) {\n\tconst columns = Object.fromEntries(Object.entries(table.columns).map(([colName, colDef]) => [colName, withColumnInErrors(name, colName, () => convertColumn(colName, colDef, types, hooks))]));\n\tconst checks = table.checks && table.checks.length > 0 ? table.checks.map((c) => convertCheck(c, name, Object.keys(table.columns))) : void 0;\n\treturn new SqlTableIR({\n\t\tname,\n\t\tcolumns,\n\t\t...ifDefined(\"primaryKey\", table.primaryKey !== void 0 ? {\n\t\t\tcolumns: table.primaryKey.columns,\n\t\t\t...ifDefined(\"name\", table.primaryKey.name),\n\t\t\tdependsOn: flatColumnDependsOn(name, table.primaryKey.columns)\n\t\t} : void 0),\n\t\tforeignKeys: table.foreignKeys.map((fk) => convertForeignKey(fk, storage)),\n\t\tuniques: table.uniques.map((u) => convertUnique(u, name)),\n\t\tindexes: table.indexes.map((i) => convertIndex(i, name, Object.keys(table.columns))),\n\t\t...ifDefined(\"checks\", checks)\n\t});\n}\n/**\n* Detects destructive changes between two contract storages.\n*\n* The additive-only planner silently ignores removals (tables, columns).\n* This function detects those removals so callers can report them as conflicts\n* rather than silently producing an empty plan.\n*\n* Returns an empty array if no destructive changes are found.\n*/\nfunction detectDestructiveChanges(from, to) {\n\tif (!from) return [];\n\tconst hasOwn = (value, key) => Object.hasOwn(value, key);\n\tconst conflicts = [];\n\tconst namespaceIds = [.../* @__PURE__ */ new Set([...Object.keys(from.namespaces), ...Object.keys(to.namespaces)])].sort((a, b) => a < b ? -1 : a > b ? 1 : 0);\n\tfor (const namespaceId of namespaceIds) {\n\t\tconst fromNs = from.namespaces[namespaceId];\n\t\tconst toNs = to.namespaces[namespaceId];\n\t\tconst fromTables = fromNs?.entries.table;\n\t\tif (!fromTables) continue;\n\t\tfor (const tableName of Object.keys(fromTables)) {\n\t\t\tconst toTableRaw = toNs?.entries.table?.[tableName];\n\t\t\tif (!StorageTable.is(toTableRaw)) {\n\t\t\t\tconflicts.push({\n\t\t\t\t\tkind: \"tableRemoved\",\n\t\t\t\t\tsummary: `Table \"${tableName}\" was removed`\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst toTable = toTableRaw;\n\t\t\tconst fromTableRaw = fromTables[tableName];\n\t\t\tif (!StorageTable.is(fromTableRaw)) continue;\n\t\t\tconst fromTable = fromTableRaw;\n\t\t\tfor (const columnName of Object.keys(fromTable.columns)) if (!hasOwn(toTable.columns, columnName)) conflicts.push({\n\t\t\t\tkind: \"columnRemoved\",\n\t\t\t\tsummary: `Column \"${tableName}\".\"${columnName}\" was removed`\n\t\t\t});\n\t\t}\n\t}\n\treturn conflicts;\n}\n/**\n* Converts the tables of a single namespace into a `SqlSchemaIR`, keyed by\n* table name within that namespace. Unlike {@link contractToSchemaIR}, which\n* flattens every namespace's tables into one bare-keyed record (and throws on a\n* cross-namespace name collision), this scopes the table iteration to one\n* namespace so the same table name can exist in two schemas.\n*\n* The full `storage` is still passed to `convertTable`, so value-set / enum /\n* type resolution that legitimately spans namespaces is unaffected. Foreign\n* keys are built purely from the FK descriptor (`fk.target`), so cross-namespace\n* FKs survive per-namespace conversion. The `annotations` block (storage-type\n* derived) is omitted here — the per-namespace tree consumer reads only the\n* per-table fields.\n*/\nfunction contractNamespaceToSchemaIR(storage, namespaceId, options) {\n\tif (options.annotationNamespace.length === 0) throw sqlFamilyError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", \"annotationNamespace must be a non-empty string\", {\n\t\twhy: \"The calling target pack passed an empty annotationNamespace to the contract-to-schema-IR projection.\",\n\t\tfix: \"Fix the target pack to pass its non-empty annotation namespace (e.g. \\\"pg\\\").\",\n\t\tmeta: { option: \"annotationNamespace\" }\n\t});\n\tconst namespace = storage.namespaces[namespaceId];\n\tif (!namespace) return new SqlSchemaIR({ tables: {} });\n\tconst tables = {};\n\tfor (const [tableName, tableDefRaw] of Object.entries(namespace.entries.table ?? {})) {\n\t\tStorageTable.assert(tableDefRaw, `namespaces.${namespaceId}.entries.table.${tableName}`);\n\t\tObject.defineProperty(tables, tableName, {\n\t\t\tvalue: convertTable(tableName, tableDefRaw, options, options, storage),\n\t\t\tenumerable: true,\n\t\t\twritable: true,\n\t\t\tconfigurable: true\n\t\t});\n\t}\n\treturn new SqlSchemaIR({ tables });\n}\n/**\n* Converts a `Contract` to `SqlSchemaIR`.\n*\n* Reads `contract.storage` for tables.\n*\n* Drops codec metadata (`codecId`) since the schema IR only represents\n* structural information. Each column's type is written from the data type its codec\n* represents, with its parameters (e.g. `character` + `{ length: 36 }` → `character(36)`),\n* so the resulting IR compares correctly against the \"to\" contract during planning.\n*\n* Returns an empty schema IR when `contract` is `null` (new project).\n*/\nfunction contractToSchemaIR(contract, options) {\n\tif (options.annotationNamespace.length === 0) throw sqlFamilyError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", \"annotationNamespace must be a non-empty string\", {\n\t\twhy: \"The calling target pack passed an empty annotationNamespace to the contract-to-schema-IR projection.\",\n\t\tfix: \"Fix the target pack to pass its non-empty annotation namespace (e.g. \\\"pg\\\").\",\n\t\tmeta: { option: \"annotationNamespace\" }\n\t});\n\tif (!contract) return new SqlSchemaIR({ tables: {} });\n\tconst storage = contract.storage;\n\tconst tables = {};\n\tfor (const ns of Object.values(storage.namespaces)) for (const [tableName, tableDefRaw] of Object.entries(ns.entries.table ?? {})) {\n\t\tStorageTable.assert(tableDefRaw, `namespaces.${ns.id}.entries.table.${tableName}`);\n\t\tconst tableDef = tableDefRaw;\n\t\tif (Object.hasOwn(tables, tableName)) throw sqlFamilyError(\"CONTRACT.TABLE_AMBIGUOUS\", `contractToSchemaIR: duplicate SQL table name \"${tableName}\" across namespaces (ambiguous for flat SqlSchemaIR.tables).`, {\n\t\t\twhy: \"Two namespaces declare a table with the same name, which is ambiguous for the flat schema-IR table map.\",\n\t\t\tfix: \"Rename one of the tables so every table name is unique across namespaces.\",\n\t\t\tmeta: { table: tableName }\n\t\t});\n\t\tObject.defineProperty(tables, tableName, {\n\t\t\tvalue: convertTable(tableName, tableDef, options, options, storage),\n\t\t\tenumerable: true,\n\t\t\twritable: true,\n\t\t\tconfigurable: true\n\t\t});\n\t}\n\treturn new SqlSchemaIR({ tables });\n}\n//#endregion\n//#region src/core/migrations/control-policy.ts\n/**\n* Whether a call is allowed to emit under a given control policy.\n*\n* - `managed` — full lifecycle, every op allowed.\n* - `tolerated` — create-if-absent only: allowed iff the call creates a whole\n* new top-level object (and its subject was positively resolved). Anything\n* that modifies an existing object, and anything whose subject could not be\n* resolved, is suppressed.\n* - `external` / `observed` — no DDL at all.\n*/\nfunction callAllowedUnderControlPolicy(policy, subject) {\n\tswitch (policy) {\n\t\tcase \"managed\": return true;\n\t\tcase \"tolerated\": return subject?.createsNewObject === true;\n\t\tcase \"external\":\n\t\tcase \"observed\": return false;\n\t}\n}\n/**\n* Partition the calls produced for a single set of subjects into those the\n* effective control policy permits (`kept`) and a list of\n* {@link SuppressionRecord}s describing the suppressed calls.\n*\n* **Prefer {@link partitionIssuesByControlPolicy}** for the schema-issue\n* pipeline: it filters subjects out of the planner's *input* so the planner\n* never has to reason about un-modeled state on `external`/`observed`\n* subjects. This call-level helper remains for paths that bypass the issue\n* pipeline — currently the codec-emitted field-event ops, which originate\n* from declared contract fields rather than from introspected schema state\n* and therefore cannot trip the diff engine.\n*/\nfunction partitionCallsByControlPolicy(options) {\n\tconst defaultControlPolicy = options.contract.defaultControlPolicy;\n\tconst kept = [];\n\tconst suppressions = [];\n\tfor (const call of options.calls) {\n\t\tconst subject = options.resolveControlPolicySubject(call);\n\t\tconst policy = governingControlPolicy(subject, defaultControlPolicy);\n\t\tif (callAllowedUnderControlPolicy(policy, subject)) kept.push(call);\n\t\telse suppressions.push({\n\t\t\tsubject,\n\t\t\tpolicy,\n\t\t\tfactoryName: options.resolveFactoryName(call),\n\t\t\tcreatesNewObject: subject?.createsNewObject ?? false\n\t\t});\n\t}\n\treturn Object.freeze({\n\t\tkept: Object.freeze(kept),\n\t\tsuppressions: Object.freeze(suppressions)\n\t});\n}\n/**\n* Partition a list of schema-issue-shaped inputs by the effective control\n* policy of each issue's subject *before* the planner is invoked.\n*\n* `plannable` is the list of issues whose subject's effective policy permits\n* the planner to act on them (`managed`, or `tolerated` for whole-object\n* creation issues only). Issues for `external`/`observed` subjects, and\n* non-creation issues for `tolerated` subjects, are dropped from the planner's\n* input entirely — they never enter introspection-driven planning, never feed\n* the diff engine, and never produce DDL calls that would have to be\n* post-filtered. This sidesteps a class of failure where the diff engine\n* cannot reason about the live shape of a subject the user marked as\n* out-of-scope (`external`).\n*\n* `suppressions` is one {@link SuppressionRecord} per suppressed subject (not\n* per suppressed issue). Its `factoryName` is the creation factory name when any\n* of the subject's issues is whole-object creation (e.g. `createTable`), else\n* `undefined` — the family never invents a modification verb for an op that\n* produced no call; the target renders the message.\n*\n* Unresolved-subject issues (`resolveControlPolicySubject` returns\n* `undefined`) emit one record each; they cannot be deduplicated because they\n* carry no subject coordinate.\n*/\nfunction partitionIssuesByControlPolicy(options) {\n\tconst defaultControlPolicy = options.contract.defaultControlPolicy;\n\tconst plannable = [];\n\tconst suppressedSubjects = /* @__PURE__ */ new Map();\n\tconst unresolvedSuppressions = [];\n\tfor (const issue of options.issues) {\n\t\tconst subject = options.resolveControlPolicySubject(issue);\n\t\tconst policy = governingControlPolicy(subject, defaultControlPolicy);\n\t\tconst creationFactoryName = options.resolveCreationFactoryName(issue);\n\t\tif (policy === \"managed\") {\n\t\t\tplannable.push(issue);\n\t\t\tcontinue;\n\t\t}\n\t\tif (policy === \"tolerated\" && subject !== void 0 && creationFactoryName !== void 0 && subject.createsNewObject) {\n\t\t\tplannable.push(issue);\n\t\t\tcontinue;\n\t\t}\n\t\tif (subject === void 0) {\n\t\t\tunresolvedSuppressions.push({\n\t\t\t\tsubject: void 0,\n\t\t\t\tpolicy,\n\t\t\t\tfactoryName: creationFactoryName,\n\t\t\t\tcreatesNewObject: false\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst key = subjectKey(subject);\n\t\tconst existing = suppressedSubjects.get(key);\n\t\tif (existing) {\n\t\t\tif (existing.creationFactoryName === void 0 && creationFactoryName !== void 0) existing.creationFactoryName = creationFactoryName;\n\t\t} else suppressedSubjects.set(key, {\n\t\t\tsubject,\n\t\t\tpolicy,\n\t\t\t...ifDefined(\"creationFactoryName\", creationFactoryName)\n\t\t});\n\t}\n\tconst suppressions = [...unresolvedSuppressions];\n\tfor (const entry of suppressedSubjects.values()) suppressions.push({\n\t\tsubject: entry.subject,\n\t\tpolicy: entry.policy,\n\t\tfactoryName: entry.creationFactoryName,\n\t\tcreatesNewObject: entry.subject.createsNewObject\n\t});\n\treturn Object.freeze({\n\t\tplannable: Object.freeze(plannable),\n\t\tsuppressions: Object.freeze(suppressions)\n\t});\n}\nfunction subjectKey(subject) {\n\treturn `${subject.namespaceId}\\u0000${subject.entityKind ?? \"\"}\\u0000${subject.entityName ?? \"\"}\\u0000${subject.rlsPolicy ?? \"\"}`;\n}\n//#endregion\n//#region src/core/migrations/database-policies-check.ts\n/**\n* Compares the policies a caller checked with the application space's marker. A runner calls it before\n* its first space, under its lock or inside its transaction: a change fails the run as\n* `MIGRATION.MARKER_CAS_FAILURE`, and policies that cannot be read throw `CONTRACT.MARKER_ROW_CORRUPT`.\n*/\nasync function checkDatabasePoliciesHeld(family, driver, checked) {\n\tconst comparison = compareMarkerDatabasePolicies(await family.readMarker({\n\t\tdriver,\n\t\tspace: APP_SPACE_ID\n\t}), checked);\n\tswitch (comparison.kind) {\n\t\tcase \"held\": return okVoid();\n\t\tcase \"moved\": return notOk(databasePoliciesMovedFailure(checked, comparison.found));\n\t\tcase \"unreadable\": throw errorMarkerPoliciesCorrupt({\n\t\t\twhy: comparison.why,\n\t\t\tspace: APP_SPACE_ID,\n\t\t\tmarkerLocation: family.markerLocation\n\t\t});\n\t}\n}\n//#endregion\n//#region src/core/migrations/json-path.ts\nconst BLANK = /* @__PURE__ */ new Set([\n\t\" \",\n\t\"\t\",\n\t\"\\n\",\n\t\"\\r\"\n]);\nconst ESCAPES = {\n\tb: \"\\b\",\n\tf: \"\\f\",\n\tn: \"\\n\",\n\tr: \"\\r\",\n\tt: \"\t\",\n\t\"/\": \"/\",\n\t\"\\\\\": \"\\\\\"\n};\nfunction isNameFirst(char) {\n\treturn /^[A-Za-z_]$/.test(char) || (char.codePointAt(0) ?? 0) >= 128;\n}\nfunction isNameChar(char) {\n\treturn isNameFirst(char) || /^[0-9]$/.test(char);\n}\nvar Reader = class {\n\ttext;\n\tposition = 0;\n\tconstructor(text) {\n\t\tthis.text = text;\n\t}\n\tget done() {\n\t\treturn this.position >= this.text.length;\n\t}\n\tpeek(offset = 0) {\n\t\treturn this.text[this.position + offset] ?? \"\";\n\t}\n\tnext() {\n\t\tconst char = this.peek();\n\t\tthis.position += 1;\n\t\treturn char;\n\t}\n\tskipBlank() {\n\t\twhile (BLANK.has(this.peek())) this.position += 1;\n\t}\n};\nfunction readShorthandName(reader) {\n\tif (!isNameFirst(reader.peek())) return void 0;\n\tlet name = \"\";\n\twhile (!reader.done && isNameChar(reader.peek())) name += reader.next();\n\treturn name;\n}\nfunction readStringLiteral(reader) {\n\tconst quote = reader.next();\n\tlet value = \"\";\n\twhile (!reader.done) {\n\t\tconst char = reader.next();\n\t\tif (char === quote) return value;\n\t\tif (char !== \"\\\\\") {\n\t\t\tif ((char.codePointAt(0) ?? 0) < 32) return void 0;\n\t\t\tvalue += char;\n\t\t\tcontinue;\n\t\t}\n\t\tconst escaped = reader.next();\n\t\tif (escaped === quote) value += quote;\n\t\telse if (escaped === \"u\") {\n\t\t\tconst hex = reader.text.slice(reader.position, reader.position + 4);\n\t\t\tif (!/^[0-9A-Fa-f]{4}$/.test(hex)) return void 0;\n\t\t\treader.position += 4;\n\t\t\tvalue += String.fromCharCode(Number.parseInt(hex, 16));\n\t\t} else {\n\t\t\tconst replacement = ESCAPES[escaped];\n\t\t\tif (replacement === void 0) return void 0;\n\t\t\tvalue += replacement;\n\t\t}\n\t}\n}\nfunction readBracket(reader) {\n\treader.next();\n\treader.skipBlank();\n\tlet step;\n\tconst first = reader.peek();\n\tif (first === \"*\") {\n\t\treader.next();\n\t\tstep = { kind: \"wildcard\" };\n\t} else if (first === \"'\" || first === \"\\\"\") {\n\t\tconst name = readStringLiteral(reader);\n\t\tstep = name === void 0 ? void 0 : {\n\t\t\tkind: \"member\",\n\t\t\tname\n\t\t};\n\t}\n\treader.skipBlank();\n\treturn step !== void 0 && reader.next() === \"]\" ? step : void 0;\n}\n/**\n* Parses an RFC 9535 JSONPath that uses only member name selectors (`.lat`, `['lat']`) and the\n* wildcard selector (`[*]`, `.*`), which selects the elements of a list and the member values of an\n* object. Any other JSONPath feature is refused with the reason.\n*/\nfunction parseJsonPath(text) {\n\tconst unsupported = notOk(`path ${JSON.stringify(text)} is not a JSONPath of member names (.name or ['name']) and wildcards ([*] or .*) from $`);\n\tconst reader = new Reader(text);\n\tif (reader.next() !== \"$\") return unsupported;\n\tconst steps = [];\n\twhile (!reader.done) {\n\t\treader.skipBlank();\n\t\tconst char = reader.peek();\n\t\tlet step;\n\t\tif (char === \".\" && reader.peek(1) === \"*\") {\n\t\t\treader.position += 2;\n\t\t\tstep = { kind: \"wildcard\" };\n\t\t} else if (char === \".\") {\n\t\t\treader.next();\n\t\t\tconst name = readShorthandName(reader);\n\t\t\tstep = name === void 0 ? void 0 : {\n\t\t\t\tkind: \"member\",\n\t\t\t\tname\n\t\t\t};\n\t\t} else if (char === \"[\") step = readBracket(reader);\n\t\tif (step === void 0) return unsupported;\n\t\tsteps.push(step);\n\t}\n\treturn ok({\n\t\ttext,\n\t\tsteps\n\t});\n}\n/** The longest start of `path`'s text that is a path of `steps` selectors, without trailing blanks. */\nfunction writtenPrefix(path, steps) {\n\tfor (let end = path.text.length - 1; end > 0; end -= 1) {\n\t\tconst prefix = path.text.slice(0, end).trimEnd();\n\t\tconst parsed = parseJsonPath(prefix);\n\t\tif (parsed.ok && parsed.value.steps.length === steps) return prefix;\n\t}\n\treturn jsonPathText(path.steps.slice(0, steps));\n}\n/** The path split at its last selector, when that selector is a member name. */\nfunction keyPathOf(path) {\n\tconst last = path.steps.at(-1);\n\tif (last?.kind !== \"member\") return void 0;\n\tconst objects = path.steps.slice(0, -1);\n\treturn {\n\t\tpath,\n\t\tobjects,\n\t\tobjectsText: writtenPrefix(path, objects.length),\n\t\tkey: last.name\n\t};\n}\n/** The steps as a JSONPath: a member name in shorthand when it is an identifier, else in brackets. */\nfunction jsonPathText(steps) {\n\treturn `$${steps.map((step) => {\n\t\tif (step.kind === \"wildcard\") return \"[*]\";\n\t\treturn /^[A-Za-z_][A-Za-z0-9_]*$/.test(step.name) ? `.${step.name}` : `[${JSON.stringify(step.name)}]`;\n\t}).join(\"\")}`;\n}\n//#endregion\n//#region src/core/migrations/model-storage.ts\n/** Whether a model's storage names a table, as a model a SQL contract stores in a table does. */\nfunction isSqlModelStorage(storage) {\n\treturn typeof storage[\"table\"] === \"string\" && typeof storage[\"namespaceId\"] === \"string\" && typeof storage[\"fields\"] === \"object\" && storage[\"fields\"] !== null;\n}\n/** The storage of a model the contract stores in a table, or `undefined` for any other model. */\nfunction sqlModelStorage(contract, coordinate) {\n\tconst storage = contract.domain.namespaces[coordinate.namespaceId]?.models[coordinate.model]?.storage;\n\treturn storage !== void 0 && isSqlModelStorage(storage) ? storage : void 0;\n}\nfunction modelTable(contract, coordinate) {\n\tconst storage = sqlModelStorage(contract, coordinate);\n\treturn storage === void 0 ? void 0 : {\n\t\tnamespaceId: storage.namespaceId,\n\t\ttable: storage.table\n\t};\n}\nfunction fieldColumn(contract, coordinate) {\n\tconst fields = sqlModelStorage(contract, coordinate)?.fields;\n\treturn fields !== void 0 && Object.hasOwn(fields, coordinate.field) ? fields[coordinate.field]?.column : void 0;\n}\nfunction sameTable(left, right) {\n\treturn left.namespaceId === right.namespaceId && left.table === right.table;\n}\nconst exactName = (left, right) => left === right;\n/**\n* The models of `contract` stored in `table`, or in a table of its namespace that `sameName` takes\n* for it: a model and its single-table variants share one.\n*/\nfunction modelsStoring(contract, table, sameName) {\n\treturn Object.entries(contract.domain.namespaces).flatMap(([namespaceId, namespace]) => Object.entries(namespace.models).flatMap(([model, definition]) => {\n\t\tconst { storage } = definition;\n\t\treturn isSqlModelStorage(storage) && storage.namespaceId === table.namespaceId && sameName(storage.table, table.table) ? [{\n\t\t\tcoordinate: {\n\t\t\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\t\t\tmodel\n\t\t\t},\n\t\t\tisRoot: definition.base === void 0,\n\t\t\tfields: storage.fields\n\t\t}] : [];\n\t}));\n}\n/**\n* The fields of `contract` stored in `column` of `table`, or in a column `sameName` takes for it:\n* variant fields may share one.\n*/\nfunction fieldsStoring(contract, table, column, sameName) {\n\treturn modelsStoring(contract, table, sameName).flatMap(({ coordinate, fields }) => Object.entries(fields).filter(([, stored]) => sameName(stored.column, column)).map(([field]) => ({\n\t\t...coordinate,\n\t\tfield\n\t})));\n}\nfunction tableControlPolicy(contract, table) {\n\tconst node = contract.storage.namespaces[table.namespaceId]?.entries.table?.[table.table];\n\treturn governingControlPolicy({ explicitNodeControlPolicy: StorageTable.is(node) ? node.control : void 0 }, contract.defaultControlPolicy);\n}\n//#endregion\n//#region src/core/migrations/plan-text.ts\n/** Joins items into text: \"a\", \"a and b\", \"a, b and c\". */\nfunction joinedList(items) {\n\treturn items.length === 1 ? items[0] ?? \"\" : `${items.slice(0, -1).join(\", \")} and ${items.at(-1)}`;\n}\nfunction fieldDisplayName(field) {\n\treturn `${modelDisplayName(field)}.${field.field}`;\n}\nfunction namedList(noun, names) {\n\treturn `${noun}${names.length === 1 ? \"\" : \"s\"} ${joinedList(names.map((name) => `\"${name}\"`))}`;\n}\nfunction modelsText(models) {\n\treturn namedList(\"model\", models.map(modelDisplayName));\n}\nfunction fieldsText(fields) {\n\treturn namedList(\"field\", fields.map(fieldDisplayName));\n}\nfunction capitalized(text) {\n\treturn `${text.charAt(0).toUpperCase()}${text.slice(1)}`;\n}\n//#endregion\n//#region src/core/migrations/hand-written-migration.ts\n/** The steps of a migration the user writes by hand, which rewrites `what` with the other operations of the change. */\nfunction handWrittenMigrationSteps(what) {\n\treturn `run prisma migration new, and in the operations of the migration.ts it writes, rewrite ${what} yourself, with the other operations of the change. Then run that migration.ts to emit its ops.json.`;\n}\n/**\n* The way out of a refusal that no statement or second plan can lift: a migration the user writes\n* by hand, which rewrites `what` with the other operations of the change.\n*/\nfunction handWrittenMigrationAdvice(what) {\n\treturn `Write this change as a hand-written migration instead: ${handWrittenMigrationSteps(what)}`;\n}\n//#endregion\n//#region src/core/migrations/value-object-field-planning.ts\nconst WILDCARD = { kind: \"wildcard\" };\nfunction isMany$2(many) {\n\treturn many !== void 0 && many !== false;\n}\nfunction requiredValueObject(storage, reference) {\n\tconst valueObject = valueObjectAt(storage, reference);\n\tinvariant(valueObject !== void 0, `value object \"${reference.entityName}\" in namespace \"${reference.namespaceId}\" is not in storage; the contract validators refuse a reference to a missing value object`);\n\treturn valueObject;\n}\nfunction nestedReferences(valueObject) {\n\treturn Object.values(valueObject.fields).flatMap(({ type }) => type.kind === \"valueObject\" ? [type] : []);\n}\nfunction containsItself(storage, from) {\n\tconst own = /* @__PURE__ */ new Set([referenceKey(from)]);\n\treturn nestedReferences(requiredValueObject(storage, from)).some((nested) => reachesAny(storage, nested, own));\n}\n/** The paths from `steps` to each object of `target` inside an object of `from`. */\nfunction pathsWithin(storage, from, steps, target) {\n\tconst targets = /* @__PURE__ */ new Set([referenceKey(target)]);\n\tif (containsItself(storage, from)) return reachesAny(storage, from, targets) ? {\n\t\tkind: \"containsItself\",\n\t\tvalueObject: from.entityName\n\t} : {\n\t\tkind: \"paths\",\n\t\tpaths: []\n\t};\n\tconst paths = referenceKey(from) === referenceKey(target) ? [steps] : [];\n\tfor (const [name, field] of Object.entries(requiredValueObject(storage, from).fields)) {\n\t\tif (field.type.kind !== \"valueObject\") continue;\n\t\tconst nested = pathsWithin(storage, field.type, [\n\t\t\t...steps,\n\t\t\t{\n\t\t\t\tkind: \"member\",\n\t\t\t\tname\n\t\t\t},\n\t\t\t...isMany$2(field.many) ? [WILDCARD] : []\n\t\t], target);\n\t\tif (nested.kind !== \"paths\") return nested;\n\t\tpaths.push(...nested.paths);\n\t}\n\treturn {\n\t\tkind: \"paths\",\n\t\tpaths\n\t};\n}\nfunction reachOf(storage, field, target) {\n\tconst targets = /* @__PURE__ */ new Set([referenceKey(target)]);\n\tconst { type } = field;\n\tif (type.kind === \"union\") return type.members.some((member) => member.kind === \"valueObject\" && reachesAny(storage, member, targets)) ? { kind: \"union\" } : {\n\t\tkind: \"paths\",\n\t\tpaths: []\n\t};\n\tif (type.kind !== \"valueObject\") return {\n\t\tkind: \"paths\",\n\t\tpaths: []\n\t};\n\tif (field.dict === true) return reachesAny(storage, type, targets) ? { kind: \"dictionary\" } : {\n\t\tkind: \"paths\",\n\t\tpaths: []\n\t};\n\treturn pathsWithin(storage, type, isMany$2(field.many) ? [WILDCARD] : [], target);\n}\n/** The columns of the destination, in managed tables the working schema has, that hold a model field. */\nfunction storedColumns(contract, tables) {\n\tconst found = /* @__PURE__ */ new Map();\n\tfor (const namespace of Object.values(contract.domain.namespaces)) for (const model of Object.values(namespace.models)) {\n\t\tconst { storage } = model;\n\t\tif (!isSqlModelStorage(storage)) continue;\n\t\tconst location = {\n\t\t\tnamespaceId: storage.namespaceId,\n\t\t\ttable: storage.table\n\t\t};\n\t\tif (tableControlPolicy(contract, location) !== \"managed\") continue;\n\t\tfor (const [fieldName, field] of Object.entries(model.fields)) {\n\t\t\tconst column = storage.fields[fieldName]?.column;\n\t\t\tif (column === void 0) continue;\n\t\t\tif (!tables.hasColumn(storage.namespaceId, storage.table, column)) continue;\n\t\t\tfound.set(JSON.stringify([\n\t\t\t\tstorage.namespaceId,\n\t\t\t\tstorage.table,\n\t\t\t\tcolumn\n\t\t\t]), {\n\t\t\t\t...location,\n\t\t\t\tcolumn,\n\t\t\t\tfield\n\t\t\t});\n\t\t}\n\t}\n\treturn [...found.values()];\n}\n/**\n* Finds every place the destination stores a value object: each column of the working schema, in a\n* managed table, whose field holds it, at every path to its objects, nested or in lists. The paths\n* are written with the destination's names. A column whose paths cannot be listed, because it holds\n* the value object through a value object that contains itself, a union or a dictionary, is the\n* failure.\n*/\nfunction valueObjectPlaces(contract, tables) {\n\tconst columns = storedColumns(contract, tables);\n\treturn (target) => {\n\t\tconst places = [];\n\t\tfor (const column of columns) {\n\t\t\tconst reach = reachOf(contract.storage, column.field, target);\n\t\t\tif (reach.kind !== \"paths\") return notOk({\n\t\t\t\tcolumn,\n\t\t\t\treach\n\t\t\t});\n\t\t\tfor (const steps of reach.paths) places.push({\n\t\t\t\tnamespaceId: column.namespaceId,\n\t\t\t\ttable: column.table,\n\t\t\t\tcolumn: column.column,\n\t\t\t\tsteps\n\t\t\t});\n\t\t}\n\t\treturn ok(places);\n\t};\n}\nfunction fieldChanges(fromContract, contract, statements) {\n\tconst renamedNamespaces = /* @__PURE__ */ new Map();\n\tconst renames = [];\n\tfor (const statement of statements) {\n\t\tif (statement.kind !== \"rename\") continue;\n\t\tif (statement.entity === \"namespace\") renamedNamespaces.set(statement.from, statement.to);\n\t\tif (statement.entity === \"valueObjectField\") renames.push(statement);\n\t}\n\tconst changes = [];\n\tfor (const { coordinate, valueObject } of valueObjectsWithCoordinates(fromContract.storage)) {\n\t\tconst target = {\n\t\t\t...coordinate,\n\t\t\tnamespaceId: renamedNamespaces.get(coordinate.namespaceId) ?? coordinate.namespaceId\n\t\t};\n\t\tconst destination = valueObjectAt(contract.storage, target);\n\t\tif (destination === void 0) continue;\n\t\tfor (const from of Object.keys(valueObject.fields)) {\n\t\t\tconst valueObjectField = {\n\t\t\t\tnamespaceId: asNamespaceId(coordinate.namespaceId),\n\t\t\t\tvalueObject: coordinate.entityName,\n\t\t\t\tfield: from\n\t\t\t};\n\t\t\tconst statement = renames.find((rename) => rename.from.namespaceId === valueObjectField.namespaceId && rename.from.valueObject === valueObjectField.valueObject && rename.from.field === from);\n\t\t\tif (statement !== void 0) changes.push({\n\t\t\t\tvalueObjectField,\n\t\t\t\ttarget,\n\t\t\t\tfrom,\n\t\t\t\tto: statement.to.field,\n\t\t\t\tstatement\n\t\t\t});\n\t\t\telse if (!Object.hasOwn(destination.fields, from)) changes.push({\n\t\t\t\tvalueObjectField,\n\t\t\t\ttarget,\n\t\t\t\tfrom,\n\t\t\t\tto: void 0,\n\t\t\t\tstatement: void 0\n\t\t\t});\n\t\t}\n\t}\n\treturn changes;\n}\nfunction columnText(column) {\n\treturn `column \"${column.column}\" of \"${column.table}\"`;\n}\nfunction refused(change, fromContract, contract, column, reason, why) {\n\tconst from = valueObjectFieldStatementText(fromContract, change.valueObjectField);\n\tif (change.statement === void 0) return {\n\t\tkind: \"unsupportedOperation\",\n\t\tsummary: `Cannot remove value object field \"${from}\": ${reason}`,\n\t\twhy: `${why} ${handWrittenMigrationAdvice(`the JSON of ${columnText(column)}`)}`\n\t};\n\treturn {\n\t\tkind: \"statementRefused\",\n\t\tsummary: `Cannot rename value object field \"${from}\" to \"${valueObjectFieldStatementText(contract, change.statement.to)}\": ${reason}`,\n\t\twhy: `${why} ${handWrittenMigrationAdvice(`the JSON of ${columnText(column)}`)}`,\n\t\trefusedStatement: change.statement\n\t};\n}\nfunction reachRefusal(reach, column, change, contracts) {\n\tif (reach.kind === \"containsItself\") return refused(change, contracts.fromContract, contracts.contract, column, `${columnText(column)} holds it inside value object \"${reach.valueObject}\", which contains itself, so the JSON can hold it at any depth`, \"The plan rewrites a key at every path from a column to its value object, and a value object that contains itself has no last path.\");\n\treturn refused(change, contracts.fromContract, contracts.contract, column, `${columnText(column)} holds a ${reach.kind} of value objects`, \"The plan rewrites a key only in a column that holds a value object or a list of them.\");\n}\n/**\n* The key rewrites of value object fields a plan makes. A value object of the origin is compared,\n* field by field, with the value object of the same name in the destination: a rename statement\n* renames a field's key, and a field the destination lacks that no statement renames is removed,\n* which the plan asks about. Each rewrite acts on every column of the working schema whose field\n* holds the value object, at every path to its objects, nested or in lists. The paths are written\n* with the destination's names, so an outer rename runs before an inner one: the rewrites come out\n* ordered by the depth of their paths. A path through a value object that contains itself, or a\n* column that holds a union or a dictionary of value objects, is refused. With no origin contract,\n* nothing is known to have changed.\n*/\nfunction planValueObjectFieldRewrites(input) {\n\tconst { fromContract, contract } = input;\n\tif (fromContract === null) return ok([]);\n\tconst changes = fieldChanges(fromContract, contract, input.statements);\n\tif (changes.length === 0) return ok([]);\n\tconst placesOf = valueObjectPlaces(contract, input.tables);\n\tconst rewrites = [];\n\tfor (const change of changes) {\n\t\tconst places = placesOf(change.target);\n\t\tif (!places.ok) {\n\t\t\tconst { reach, column } = places.failure;\n\t\t\treturn notOk(reachRefusal(reach, column, change, {\n\t\t\t\tfromContract,\n\t\t\t\tcontract\n\t\t\t}));\n\t\t}\n\t\tfor (const { steps, ...place } of places.value) rewrites.push({\n\t\t\tdepth: steps.length,\n\t\t\trewrite: {\n\t\t\t\tvalueObjectField: change.valueObjectField,\n\t\t\t\t...place,\n\t\t\t\tpath: jsonPathText([...steps, {\n\t\t\t\t\tkind: \"member\",\n\t\t\t\t\tname: change.from\n\t\t\t\t}]),\n\t\t\t\tto: change.to,\n\t\t\t\tstatement: change.statement\n\t\t\t}\n\t\t});\n\t}\n\treturn ok([...rewrites].sort((left, right) => left.depth - right.depth).map(({ rewrite }) => rewrite));\n}\n//#endregion\n//#region src/core/migrations/enum-value-planning.ts\nfunction sameValue(left, right) {\n\treturn JSON.stringify(left) === JSON.stringify(right);\n}\nfunction enumOf(contract, namespaceId, name) {\n\treturn contract.domain.namespaces[namespaceId]?.enum?.[name];\n}\n/** The columns of the destination whose fields the enum types, in managed tables. */\nfunction columnsTypedBy(contract, namespaceId, enumName) {\n\tconst found = /* @__PURE__ */ new Map();\n\tfor (const namespace of Object.values(contract.domain.namespaces)) for (const model of Object.values(namespace.models)) {\n\t\tconst { storage } = model;\n\t\tif (!isSqlModelStorage(storage)) continue;\n\t\tfor (const [fieldName, field] of Object.entries(model.fields)) {\n\t\t\tconst ref = field.valueSet;\n\t\t\tif (ref === void 0 || ref.plane !== \"domain\" || ref.entityKind !== \"enum\" || ref.spaceId !== void 0 || ref.namespaceId !== namespaceId || ref.entityName !== enumName) continue;\n\t\t\tconst column = storage.fields[fieldName]?.column;\n\t\t\tif (column === void 0) continue;\n\t\t\tconst stored = contract.storage.namespaces[storage.namespaceId]?.entries.table?.[storage.table]?.columns[column];\n\t\t\tif (stored === void 0) continue;\n\t\t\tconst location = {\n\t\t\t\tnamespaceId: storage.namespaceId,\n\t\t\t\ttable: storage.table\n\t\t\t};\n\t\t\tif (tableControlPolicy(contract, location) !== \"managed\") continue;\n\t\t\tfound.set(JSON.stringify([\n\t\t\t\tstorage.namespaceId,\n\t\t\t\tstorage.table,\n\t\t\t\tcolumn\n\t\t\t]), {\n\t\t\t\t...location,\n\t\t\t\tcolumn,\n\t\t\t\tcodecRef: buildColumnCodecRef(stored, void 0),\n\t\t\t\tmany: stored.many !== false && stored.many !== void 0,\n\t\t\t\tmember: void 0\n\t\t\t});\n\t\t}\n\t}\n\treturn [...found.values()];\n}\nfunction isMany$1(many) {\n\treturn many !== void 0 && many !== false;\n}\n/**\n* The members of value objects, in the destination's columns, that the enum's storage value set\n* types: each column and path where the destination stores the value object.\n*/\nfunction membersTypedBy(contract, placesOf, namespaceId, enumName) {\n\tconst found = [];\n\tfor (const { coordinate, valueObject } of valueObjectsWithCoordinates(contract.storage)) {\n\t\tconst typed = Object.entries(valueObject.fields).filter(([, field]) => field.valueSet !== void 0 && field.valueSet.spaceId === void 0 && field.valueSet.namespaceId === namespaceId && field.valueSet.entityName === enumName);\n\t\tif (typed.length === 0) continue;\n\t\tconst places = placesOf(coordinate);\n\t\tif (!places.ok) return places;\n\t\tfor (const [name, field] of typed) for (const { steps, ...place } of places.value) found.push({\n\t\t\t...place,\n\t\t\tcodecRef: void 0,\n\t\t\tmany: false,\n\t\t\tmember: {\n\t\t\t\tpath: jsonPathText([\n\t\t\t\t\t...steps,\n\t\t\t\t\t{\n\t\t\t\t\t\tkind: \"member\",\n\t\t\t\t\t\tname\n\t\t\t\t\t},\n\t\t\t\t\t...isMany$1(field.many) ? [{ kind: \"wildcard\" }] : []\n\t\t\t\t]),\n\t\t\t\tnullable: field.nullable\n\t\t\t}\n\t\t});\n\t}\n\treturn ok(found);\n}\nfunction enumText(enums, value) {\n\treturn modelStatementText(enums.fromContract, {\n\t\tnamespaceId: value.namespaceId,\n\t\tmodel: value.enum\n\t});\n}\n/** How a refusal names a change that no statement asks for: the removal of a value, or a member's new stored value. */\nfunction changeText(enums, change) {\n\tconst member = enumValueStatementText(enums.fromContract, change.enumValue);\n\treturn change.to === void 0 ? `Cannot remove enum value \"${member}\"` : `Cannot change the stored value of enum value \"${member}\" from ${enums.text(change.from)} to ${enums.text(change.to)}`;\n}\nfunction unlistedRefusal(contract, enums, changes, { column, reach }) {\n\tconst where = `column \"${column.column}\" of \"${column.table}\"`;\n\tconst reason = reach.kind === \"containsItself\" ? `${where} holds it inside value object \"${reach.valueObject}\", which contains itself, so the JSON can hold it at any depth` : `${where} holds a ${reach.kind} of value objects`;\n\tconst why = reach.kind === \"containsItself\" ? \"The plan rewrites an enum value inside JSON at every path from a column to its member, and a value object that contains itself has no last path.\" : \"The plan rewrites an enum value inside JSON only in a column that holds a value object or a list of them.\";\n\tconst [first] = changes;\n\tinvariant(first !== void 0, \"an enum with no changed value plans no rewrite to refuse\");\n\tconst advice = `This change cannot be planned yet. Until it can, keep the members and stored values of enum \"${enumText(enums, first.enumValue)}\" as the origin contract has them, and plan again.`;\n\tconst statement = changes.find((change) => change.statement !== void 0)?.statement;\n\tif (statement === void 0) return {\n\t\tkind: \"unsupportedOperation\",\n\t\tsummary: `${changeText(enums, first)}: ${reason}`,\n\t\twhy: `${why} ${advice}`\n\t};\n\treturn {\n\t\tkind: \"statementRefused\",\n\t\tsummary: `Cannot rename enum value \"${enumValueStatementText(enums.fromContract, statement.from)}\" to \"${enumValueStatementText(contract, statement.to)}\": ${reason}`,\n\t\twhy: `${why} ${advice}`,\n\t\trefusedStatement: statement\n\t};\n}\nfunction isStoredEnumValue(value) {\n\treturn typeof value === \"string\" || typeof value === \"number\";\n}\n/** A stored value as messages write it: a number without quotes, as the enum's codec reads it. */\nfunction valueText(value, codec) {\n\tconst built = codecForRef(codec.codecs, codec.codecRef);\n\tif (built === void 0) return JSON.stringify(value);\n\ttry {\n\t\tconst read = readContractValue(built, value, codec.codecRef.typeParams);\n\t\treturn typeof read === \"number\" || typeof read === \"bigint\" ? String(read) : JSON.stringify(value);\n\t} catch {\n\t\treturn JSON.stringify(value);\n\t}\n}\nfunction unsupportedValue(contract, value, stored) {\n\tconst text = enumValueStatementText(contract, value);\n\treturn {\n\t\tkind: \"unsupportedOperation\",\n\t\tsummary: `Cannot rewrite enum value \"${text}\": its stored value ${JSON.stringify(stored)} is not a string or a number`,\n\t\twhy: `The plan rewrites the rows that hold a removed, renamed or changed enum value, and it compares only string and number values. Rewrite the rows that hold enum value \"${text}\" yourself, then plan again.`\n\t};\n}\nfunction stillStoredRefusal(statement, enums, stored, holder) {\n\tconst holderText = enumValueStatementText(enums.contract, {\n\t\t...statement.to,\n\t\tmember: holder\n\t});\n\tconst value = enums.text(stored);\n\treturn {\n\t\tkind: \"statementRefused\",\n\t\tsummary: `Cannot rename enum value \"${enumValueStatementText(enums.fromContract, statement.from)}\" to \"${enumValueStatementText(enums.contract, statement.to)}\": the destination enum still stores ${value}, as enum value \"${holderText}\"`,\n\t\twhy: `A rename changes the stored value in every row that holds it, so the rows that hold ${value} for \"${holderText}\" would change too. Leave out this statement.`,\n\t\trefusedStatement: statement\n\t};\n}\nfunction mergingRefusal(statement, enums, from, to, holder) {\n\tconst holderText = enumValueStatementText(enums.fromContract, {\n\t\t...statement.from,\n\t\tmember: holder\n\t});\n\treturn {\n\t\tkind: \"statementRefused\",\n\t\tsummary: `Cannot rename enum value \"${enumValueStatementText(enums.fromContract, statement.from)}\" to \"${enumValueStatementText(enums.contract, statement.to)}\": the origin enum already stores ${enums.text(to)}, as enum value \"${holderText}\"`,\n\t\twhy: `A rename changes ${enums.text(from)} to ${enums.text(to)} in every row that holds it, which merges its data with the data of \"${holderText}\". Leave out this statement. To merge them on purpose, plan the change with migration plan and write this.replaceStoredValue(...) in the migration.ts it writes.`,\n\t\trefusedStatement: statement\n\t};\n}\nfunction cycleMoves(cycle) {\n\tconst [first, ...rest] = cycle.map((change) => {\n\t\tconst { to } = change;\n\t\tinvariant(to !== void 0, \"a cycle of stored values moves each value to another\");\n\t\treturn {\n\t\t\t...change,\n\t\t\tto\n\t\t};\n\t});\n\tinvariant(first !== void 0, \"a cycle has a change\");\n\treturn [first, ...rest];\n}\n/** The enum value a change gives its new stored value, as the destination contract names it. */\nfunction destinationMemberText(enums, change) {\n\treturn change.statement === void 0 ? enumValueStatementText(enums.fromContract, change.enumValue) : enumValueStatementText(enums.contract, change.statement.to);\n}\nconst CYCLE_WHY = \"The plan rewrites a changed stored value in every row that holds it, one value after another, and no order of the rewrites moves values in a cycle.\";\n/**\n* The route through a stored value no member stores, which works on both commands: a plan that\n* gives the first enum value of the cycle that value and the others their new ones, so their\n* rewrites form a chain, then a plan that gives the first its new value.\n*/\nfunction cycleTwoPlans(moves, enums, swap) {\n\tconst [first, ...rest] = moves;\n\tconst withStatements = moves.some(({ statement }) => statement !== void 0);\n\tconst others = joinedList(rest.map((move) => `\"${destinationMemberText(enums, move)}\" the stored value ${enums.text(move.to)}`));\n\tconst member = `\"${destinationMemberText(enums, first)}\"`;\n\treturn `Make the change in two plans: first give ${member} a stored value no member stores, such as ${enums.text(swap)}, and give ${others}, and plan and apply that${withStatements ? \" with the same statements\" : \"\"}; then give ${member} the stored value ${enums.text(first.to)}, and plan again${withStatements ? \" without them\" : \"\"}.`;\n}\nfunction cycleRefusal(statement, cycle, enums, taken) {\n\tconst moves = cycleMoves(cycle);\n\tconst swap = temporaryValue(moves[0].from, taken);\n\tconst listed = joinedList(moves.map(({ from, to }) => `${enums.text(from)} to ${enums.text(to)}`));\n\treturn {\n\t\tkind: \"statementRefused\",\n\t\tsummary: `Cannot rename enum value \"${enumValueStatementText(enums.fromContract, statement.from)}\" to \"${enumValueStatementText(enums.contract, statement.to)}\": the renames move stored values in a cycle, ${listed}, and a rewrite of one would overwrite the other before it is read`,\n\t\twhy: `${CYCLE_WHY} ${cycleTwoPlans(moves, enums, swap)}`,\n\t\trefusedStatement: statement\n\t};\n}\n/** A member that keeps its name and takes the stored value `to`, which `holder` keeps in the origin enum, so their data would merge. */\nfunction changeMergingRefusal(change, to, holder, enums) {\n\tconst member = enumValueStatementText(enums.fromContract, change.enumValue);\n\tconst holderText = enumValueStatementText(enums.fromContract, {\n\t\t...change.enumValue,\n\t\tmember: holder\n\t});\n\tconst fromText = enums.text(change.from);\n\tconst toText = enums.text(to);\n\treturn {\n\t\tkind: \"unsupportedOperation\",\n\t\tsummary: `${changeText(enums, change)}: the origin enum stores ${toText} as enum value \"${holderText}\"`,\n\t\twhy: `A changed stored value is rewritten in every row that holds it, so the rows of \"${member}\" would hold ${toText} as the rows of \"${holderText}\" do, and their data would merge. Make the change in two plans: first remove enum value \"${holderText}\", and plan and apply that; then give \"${member}\" the stored value ${toText}, and plan again. The first plan asks about the rows that hold ${toText}. If you answer it with --delete ${holderText}, a column that takes no NULL cannot keep those rows: before that plan applies, delete them in the database, or set them to ${fromText} there to merge their data with the data of \"${member}\" on purpose.`\n\t};\n}\n/** Members that keep their names and move stored values in a cycle. */\nfunction changeCycleRefusal(cycle, enums, taken) {\n\tconst moves = cycleMoves(cycle);\n\tconst [first] = moves;\n\tconst swap = temporaryValue(first.from, taken);\n\tconst members = moves.map(({ enumValue }) => `\"${enumValueStatementText(enums.fromContract, enumValue)}\"`);\n\treturn {\n\t\tkind: \"unsupportedOperation\",\n\t\tsummary: `Cannot change the stored values of enum \"${enumText(enums, first.enumValue)}\": enum values ${joinedList(members)} move stored values in a cycle, ${joinedList(moves.map(({ from, to }) => `${enums.text(from)} to ${enums.text(to)}`))}, and a rewrite of one would overwrite the other before it is read`,\n\t\twhy: `${CYCLE_WHY} ${cycleTwoPlans(moves, enums, swap)}`\n\t};\n}\n/**\n* What changes for each member of the origin enum. A rename statement gives a member the stored\n* value of the member it names. A member the destination has under the same name takes that\n* member's stored value, even when another member had it before. A member the destination lacks is\n* kept when the destination still stores its value, under another name; otherwise its value is\n* removed.\n*/\nfunction valueChanges(enums, enumValueOf, statementOf) {\n\tconst changes = [];\n\tfor (const member of enums.originEnum.members) {\n\t\tconst enumValue = enumValueOf(member.name);\n\t\tconst statement = statementOf(member.name);\n\t\tconst named = statement?.to.member ?? member.name;\n\t\tconst target = enums.destinationEnum.members.find(({ name }) => name === named);\n\t\tif (target !== void 0) {\n\t\t\tif (!sameValue(target.value, member.value)) changes.push({\n\t\t\t\tenumValue,\n\t\t\t\tfrom: member.value,\n\t\t\t\tto: target.value,\n\t\t\t\tstatement\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (statement !== void 0) continue;\n\t\tif (enums.destinationEnum.members.some(({ value }) => sameValue(value, member.value))) continue;\n\t\tchanges.push({\n\t\t\tenumValue,\n\t\t\tfrom: member.value,\n\t\t\tto: void 0,\n\t\t\tstatement: void 0\n\t\t});\n\t}\n\treturn changes;\n}\n/**\n* Orders the changes so each runs before the change that writes its old value: in a chain, the\n* last value moves first. A cycle has no such order; it comes out as the changes in it, from the\n* first change of the origin enum's order around.\n*/\nfunction orderChanges(changes) {\n\tconst bySource = new Map(changes.map((change) => [JSON.stringify(change.from), change]));\n\tconst placed = /* @__PURE__ */ new Set();\n\tconst groups = [];\n\tfor (const start of changes) {\n\t\tif (placed.has(start)) continue;\n\t\tconst path = [];\n\t\tlet cycle = false;\n\t\tfor (let change = start; change !== void 0 && !placed.has(change); change = change.to === void 0 ? void 0 : bySource.get(JSON.stringify(change.to))) {\n\t\t\tif (path.includes(change)) {\n\t\t\t\tcycle = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tpath.push(change);\n\t\t}\n\t\tfor (const change of path) placed.add(change);\n\t\tgroups.push(cycle ? {\n\t\t\tchanges: path,\n\t\t\tcycle\n\t\t} : {\n\t\t\tchanges: [...path].reverse(),\n\t\t\tcycle\n\t\t});\n\t}\n\treturn groups;\n}\n/** A value no member of either enum stores, of the kind of `value`: the next whole number, or a marked string. */\nfunction temporaryValue(value, taken) {\n\tconst numbers = taken.flatMap((stored) => {\n\t\tconst number = typeof stored === \"string\" ? Number(stored) : stored;\n\t\treturn typeof number === \"number\" && Number.isFinite(number) ? [number] : [];\n\t});\n\tconst nextWholeNumber = numbers.length === 0 ? 0 : Math.floor(Math.max(...numbers)) + 1;\n\tif (typeof value === \"number\") return nextWholeNumber;\n\tif (/^-?\\d+$/.test(value)) return String(nextWholeNumber);\n\tlet candidate = \"prisma_swap\";\n\twhile (taken.some((stored) => sameValue(stored, candidate))) candidate = `${candidate}_`;\n\treturn candidate;\n}\n/**\n* The rewrites of stored enum values a plan makes. Enums are compared by the stored value of each\n* member (see `valueChanges`). A changed value is rewritten in every column, in the working schema,\n* whose field the destination enum types: a rename statement, or a member that keeps its name,\n* replaces it, and a removed member's value is removed, which the plan asks about. Changes that\n* shift values along are ordered so none overwrites a value another still has to read. Changes that\n* move values in a cycle, or into a value another member of the origin enum keeps, are refused.\n* With no origin contract, nothing is known to have changed.\n*/\nfunction planEnumValueRewrites(input) {\n\tconst { fromContract, contract } = input;\n\tif (fromContract === null) return ok([]);\n\tconst renamedNamespaces = /* @__PURE__ */ new Map();\n\tconst valueRenames = [];\n\tfor (const statement of input.statements) {\n\t\tif (statement.kind !== \"rename\") continue;\n\t\tif (statement.entity === \"namespace\") renamedNamespaces.set(statement.from, statement.to);\n\t\tif (statement.entity === \"enumValue\") valueRenames.push(statement);\n\t}\n\tconst placesOf = valueObjectPlaces(contract, input.tables);\n\tconst rewrites = [];\n\tfor (const [originNamespace, namespace] of Object.entries(fromContract.domain.namespaces)) for (const [enumName, originEnum] of Object.entries(namespace.enum ?? {})) {\n\t\tconst namespaceId = renamedNamespaces.get(originNamespace) ?? originNamespace;\n\t\tconst destinationEnum = enumOf(contract, namespaceId, enumName);\n\t\tif (destinationEnum === void 0) continue;\n\t\tconst codec = {\n\t\t\tcodecRef: { codecId: destinationEnum.codecId },\n\t\t\tcodecs: input.codecs\n\t\t};\n\t\tconst enums = {\n\t\t\tfromContract,\n\t\t\tcontract,\n\t\t\toriginEnum,\n\t\t\tdestinationEnum,\n\t\t\ttext: (value) => valueText(value, codec)\n\t\t};\n\t\tconst changes = valueChanges(enums, (member) => ({\n\t\t\tnamespaceId: asNamespaceId(originNamespace),\n\t\t\tenum: enumName,\n\t\t\tmember\n\t\t}), (member) => valueRenames.find((rename) => rename.from.namespaceId === originNamespace && rename.from.enum === enumName && rename.from.member === member));\n\t\tconst checked = [];\n\t\tfor (const change of changes) {\n\t\t\tconst { from, to } = change;\n\t\t\tif (!isStoredEnumValue(from)) return notOk(unsupportedValue(fromContract, change.enumValue, from));\n\t\t\tif (to !== void 0 && !isStoredEnumValue(to)) return notOk(unsupportedValue(fromContract, change.enumValue, to));\n\t\t\tchecked.push({\n\t\t\t\t...change,\n\t\t\t\tfrom,\n\t\t\t\tto\n\t\t\t});\n\t\t}\n\t\tconst changedFrom = (value) => checked.some(({ from }) => sameValue(from, value));\n\t\tconst changedTo = (value) => checked.some(({ to }) => to !== void 0 && sameValue(to, value));\n\t\tconst merging = (to) => originEnum.members.find(({ value }) => sameValue(value, to) && !changedFrom(value));\n\t\tfor (const { statement, from, to } of checked) {\n\t\t\tif (statement === void 0 || to === void 0) continue;\n\t\t\tconst holder = destinationEnum.members.find(({ value }) => sameValue(value, from));\n\t\t\tif (holder !== void 0 && !changedTo(from)) return notOk(stillStoredRefusal(statement, enums, from, holder.name));\n\t\t\tconst merged = merging(to);\n\t\t\tif (merged !== void 0) return notOk(mergingRefusal(statement, enums, from, to, merged.name));\n\t\t}\n\t\tif (checked.length === 0) continue;\n\t\tconst members = membersTypedBy(contract, placesOf, namespaceId, enumName);\n\t\tif (!members.ok) return notOk(unlistedRefusal(contract, enums, checked, members.failure));\n\t\tconst columns = [...columnsTypedBy(contract, namespaceId, enumName).filter((column) => input.tables.hasColumn(column.namespaceId, column.table, column.column)), ...members.value];\n\t\tif (columns.length === 0) continue;\n\t\tconst taken = [...originEnum.members.map(({ value }) => value), ...destinationEnum.members.map(({ value }) => value)];\n\t\tfor (const change of checked) {\n\t\t\tif (change.statement !== void 0 || change.to === void 0) continue;\n\t\t\tconst merged = merging(change.to);\n\t\t\tif (merged !== void 0) return notOk(changeMergingRefusal(change, change.to, merged.name, enums));\n\t\t}\n\t\tfor (const group of orderChanges(checked)) {\n\t\t\tif (group.cycle) {\n\t\t\t\tconst refused = group.changes.find(({ statement }) => statement !== void 0)?.statement;\n\t\t\t\treturn notOk(refused === void 0 ? changeCycleRefusal(group.changes, enums, taken) : cycleRefusal(refused, group.changes, enums, taken));\n\t\t\t}\n\t\t\tfor (const change of group.changes) for (const column of columns) rewrites.push({\n\t\t\t\tenumValue: change.enumValue,\n\t\t\t\t...column,\n\t\t\t\tfrom: change.from,\n\t\t\t\tto: change.to,\n\t\t\t\tstatement: change.statement\n\t\t\t});\n\t\t}\n\t}\n\treturn ok(rewrites);\n}\n/**\n* The value the database stores for `value`, a stored value as the contract writes it: the column's\n* codec reads it as a value of its data type and writes it with `toWire`, as a literal default is\n* written. With no codec, or one the stack does not have, the value is used as written.\n*/\nasync function encodeStoredValue(value, codec) {\n\tif (codec === void 0) return value;\n\tconst built = codecForRef(codec.codecs, codec.codecRef);\n\tif (built === void 0) return value;\n\tconst wire = await built.toWire(readContractValue(built, value, codec.codecRef.typeParams), {});\n\tif (typeof wire === \"string\" || typeof wire === \"number\") return wire;\n\tif (typeof wire === \"bigint\") return wire.toString();\n\tthrow structuredError(\"CONTRACT.ARGUMENT_INVALID\", `Codec ${codec.codecRef.codecId} writes the stored value ${JSON.stringify(value)} as neither a string nor a number, which a migration cannot compare`, { meta: {\n\t\twhat: \"stored value\",\n\t\tcodecId: codec.codecRef.codecId\n\t} });\n}\n//#endregion\n//#region src/core/migrations/field-event-planner.ts\nfunction planFieldEventOperations(options) {\n\treturn planFieldEventCalls(options).map(({ call }) => call);\n}\n/** The calls the codec hooks return, each with the field event's column. */\nfunction planFieldEventCalls(options) {\n\tconst priorContract = options.priorContract;\n\tconst newContract = options.newContract;\n\tconst renamedTo = new Map(options.tableRenames.map((rename) => [renameKey(rename.namespaceId, rename.from), rename.to]));\n\tconst newNameOf = (namespaceId, tableName) => renamedTo.get(renameKey(namespaceId, tableName));\n\tconst columnRenamedTo = new Map(options.columnRenames.map((rename) => [renameKey(rename.namespaceId, rename.table, rename.from), rename.to]));\n\tconst added = [];\n\tconst dropped = [];\n\tconst altered = [];\n\tconst namespaceIds = unionSorted(priorContract ? Object.keys(priorContract.storage.namespaces) : [], Object.keys(newContract.storage.namespaces));\n\tfor (const namespaceId of namespaceIds) {\n\t\tconst priorNs = ownEntry(priorContract?.storage.namespaces, namespaceId);\n\t\tconst newNs = ownEntry(newContract.storage.namespaces, namespaceId);\n\t\tconst priorTables = underNewNames(priorNs?.entries.table, (tableName) => newNameOf(namespaceId, tableName));\n\t\tconst newTables = newNs?.entries.table;\n\t\tconst tableNames = unionSorted(priorTables ? Object.keys(priorTables) : [], newTables ? Object.keys(newTables) : []);\n\t\tfor (const tableName of tableNames) {\n\t\t\tconst priorTableRaw = ownEntry(priorTables, tableName);\n\t\t\tconst newTableRaw = ownEntry(newTables, tableName);\n\t\t\tconst priorTable = StorageTable.is(priorTableRaw) ? priorTableRaw : void 0;\n\t\t\tconst newTable = StorageTable.is(newTableRaw) ? newTableRaw : void 0;\n\t\t\tconst priorColumns = underNewNames(priorTable?.columns, (columnName) => columnRenamedTo.get(renameKey(namespaceId, tableName, columnName)));\n\t\t\tconst fieldNames = unionSorted(priorColumns ? Object.keys(priorColumns) : [], newTable ? Object.keys(newTable.columns) : []);\n\t\t\tfor (const fieldName of fieldNames) {\n\t\t\t\tconst priorField = ownEntry(priorColumns, fieldName);\n\t\t\t\tconst newField = ownEntry(newTable?.columns, fieldName);\n\t\t\t\tconst entry = {\n\t\t\t\t\tnamespaceId,\n\t\t\t\t\ttableName,\n\t\t\t\t\tfieldName,\n\t\t\t\t\tpriorTable,\n\t\t\t\t\tnewTable,\n\t\t\t\t\tpriorField,\n\t\t\t\t\tnewField\n\t\t\t\t};\n\t\t\t\tif (priorField === void 0 && newField !== void 0) added.push(entry);\n\t\t\t\telse if (priorField !== void 0 && newField === void 0) dropped.push(entry);\n\t\t\t\telse if (priorField !== void 0 && newField !== void 0) {\n\t\t\t\t\tif (isAlteration(priorField, newField, options.dataTypes)) altered.push(entry);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tconst calls = [];\n\tappendCalls(\"added\", added, options.codecHooks, calls, (e) => e.newField?.codecId);\n\tappendCalls(\"dropped\", dropped, options.codecHooks, calls, (e) => e.priorField?.codecId);\n\tappendCalls(\"altered\", altered, options.codecHooks, calls, (e) => e.newField?.codecId);\n\treturn calls;\n}\nfunction renameKey(...parts) {\n\treturn JSON.stringify(parts);\n}\nfunction underNewNames(tables, newNameOf) {\n\tif (tables === void 0) return void 0;\n\treturn Object.fromEntries(Object.entries(tables).map(([tableName, table]) => [newNameOf(tableName) ?? tableName, table]));\n}\nfunction appendCalls(event, entries, codecHooks, calls, pickCodecId) {\n\tfor (const entry of entries) {\n\t\tconst codecId = pickCodecId(entry);\n\t\tif (codecId === void 0) continue;\n\t\tconst hook = codecHooks.get(codecId);\n\t\tif (!hook?.onFieldEvent) continue;\n\t\tconst ctx = buildContext(event, entry);\n\t\tconst emitted = hook.onFieldEvent(event, ctx);\n\t\tfor (const call of emitted) calls.push({\n\t\t\tcall,\n\t\t\tnamespaceId: entry.namespaceId,\n\t\t\ttableName: entry.tableName,\n\t\t\tcolumnName: entry.fieldName\n\t\t});\n\t}\n}\n/**\n* The context's prior/new sides are scoped to the event:\n*\n* - `'added'` — only `newTable` / `newField` populated.\n* - `'dropped'` — only `priorTable` / `priorField` populated.\n* - `'altered'` — both sides populated.\n*/\nfunction buildContext(event, entry) {\n\tconst base = {\n\t\tnamespaceId: entry.namespaceId,\n\t\ttableName: entry.tableName,\n\t\tfieldName: entry.fieldName\n\t};\n\tif (event === \"added\") return {\n\t\t...base,\n\t\t...entry.newTable !== void 0 ? { newTable: entry.newTable } : {},\n\t\t...entry.newField !== void 0 ? { newField: entry.newField } : {}\n\t};\n\tif (event === \"dropped\") return {\n\t\t...base,\n\t\t...entry.priorTable !== void 0 ? { priorTable: entry.priorTable } : {},\n\t\t...entry.priorField !== void 0 ? { priorField: entry.priorField } : {}\n\t};\n\treturn {\n\t\t...base,\n\t\t...entry.priorTable !== void 0 ? { priorTable: entry.priorTable } : {},\n\t\t...entry.newTable !== void 0 ? { newTable: entry.newTable } : {},\n\t\t...entry.priorField !== void 0 ? { priorField: entry.priorField } : {},\n\t\t...entry.newField !== void 0 ? { newField: entry.newField } : {}\n\t};\n}\n/**\n* `'altered'` predicate. Returns `false` whenever `codecId` differs —\n* any codec change suppresses the `altered` event entirely, including\n* cases where another property also differs in the same diff. Codec\n* rotation is a v1 non-goal; avoiding the mixed event keeps the\n* migration semantics for codec changes explicit rather than smuggling\n* them through as `altered`.\n*\n* For non-`codecId` diffs, returns `true` iff any other column property\n* differs.\n*/\nfunction isAlteration(prior, current, dataTypes) {\n\tif (prior.codecId !== current.codecId) return false;\n\treturn !sameStorageColumn(prior, current, dataTypes);\n}\nfunction sameStorageColumn(a, b, dataTypes) {\n\tif (a === b) return true;\n\tif (!sameSqlColumnType(a, b, dataTypes)) return false;\n\tif (a.nullable !== b.nullable) return false;\n\tif (canonicalizeJson(codecOwnParams(a, dataTypes)) !== canonicalizeJson(codecOwnParams(b, dataTypes))) return false;\n\tif (!sameJson(a.default, b.default)) return false;\n\treturn true;\n}\n/** The parameters a column's codec keeps for itself: every key its data type does not declare. */\nfunction codecOwnParams(column, dataTypes) {\n\tconst declared = new Set(objectSchemaKeys(dataTypes.get(column.dataType)?.params) ?? []);\n\treturn Object.fromEntries(Object.entries(column.typeParams ?? {}).filter(([key]) => !declared.has(key)));\n}\nfunction sameJson(a, b) {\n\tif (a === b) return true;\n\tif (a === void 0 || b === void 0) return false;\n\treturn JSON.stringify(a) === JSON.stringify(b);\n}\nfunction unionSorted(a, b) {\n\tconst set = /* @__PURE__ */ new Set();\n\tfor (const name of a) set.add(name);\n\tfor (const name of b) set.add(name);\n\treturn [...set].sort((x, y) => x < y ? -1 : x > y ? 1 : 0);\n}\nfunction ownEntry(entries, name) {\n\treturn entries !== void 0 && Object.hasOwn(entries, name) ? entries[name] : void 0;\n}\n//#endregion\n//#region src/core/migrations/field-of-column.ts\n/**\n* The field of `contract` that stores `column` of `table`, or undefined when no field stores it or\n* tables of two storage namespaces share the table's name.\n*/\nfunction fieldOfColumn(contract, table, column) {\n\tconst fields = Object.entries(contract.domain.namespaces).flatMap(([namespaceId, namespace]) => Object.entries(namespace.models).flatMap(([model, definition]) => {\n\t\tconst { storage } = definition;\n\t\tif (!isSqlModelStorage(storage) || storage.table !== table) return [];\n\t\tconst field = Object.entries(storage.fields).find(([, stored]) => stored.column === column);\n\t\tif (field === void 0) return [];\n\t\treturn [{\n\t\t\tstorageNamespace: storage.namespaceId,\n\t\t\tisRoot: definition.base === void 0,\n\t\t\tsubject: {\n\t\t\t\tkind: \"field\",\n\t\t\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\t\t\tmodel,\n\t\t\t\tfield: field[0]\n\t\t\t}\n\t\t}];\n\t}));\n\tif (new Set(fields.map(({ storageNamespace }) => storageNamespace)).size !== 1) return void 0;\n\treturn (fields.find(({ isRoot }) => isRoot) ?? fields[0])?.subject;\n}\n//#endregion\n//#region src/core/migrations/fill-value-check.ts\n/** The name a schema writes for each codec of `namespace`: a convenience type whose defaults make it, else the first explicit type, never a deprecated one. */\nfunction scalarTypeNamesOf(namespace) {\n\tconst isTypeChoice = (name) => {\n\t\tconst member = namespace[name];\n\t\treturn member !== void 0 && isAuthoringTypeChoiceDescriptor(member);\n\t};\n\tconst isDeprecated = (name) => {\n\t\tconst member = namespace[name];\n\t\treturn member !== void 0 && isAuthoringTypeConstructorDescriptor(member) && member.deprecated !== void 0;\n\t};\n\tconst current = [...collectScalarTypeConstructors(namespace)].filter(([name]) => !isDeprecated(name));\n\tconst constructors = [...current.filter(([name]) => isTypeChoice(name)), ...current.filter(([name]) => !isTypeChoice(name))];\n\treturn (codecRef) => constructors.find(([, output]) => output.codecId === codecRef.codecId && JSON.stringify(output.typeParams ?? {}) === JSON.stringify(codecRef.typeParams ?? {}))?.[0];\n}\nfunction fieldNamed(contract, text) {\n\tfor (const { coordinate, valueObject } of valueObjectsWithCoordinates(contract.storage)) for (const [name, field] of Object.entries(valueObject.fields)) if (valueObjectFieldStatementText(contract, {\n\t\tnamespaceId: asNamespaceId(coordinate.namespaceId),\n\t\tvalueObject: coordinate.entityName,\n\t\tfield: name\n\t}) === text) return {\n\t\ttext,\n\t\tfield\n\t};\n}\nfunction isMany(field) {\n\treturn field.many !== void 0 && field.many !== false;\n}\nfunction valueSetValues(contract, field) {\n\tconst reference = field.valueSet;\n\tif (reference === void 0) return void 0;\n\tconst valueSet = Object.hasOwn(contract.storage.namespaces, reference.namespaceId) ? contract.storage.namespaces[reference.namespaceId]?.entries?.[\"valueSet\"]?.[reference.entityName] : void 0;\n\treturn isStorageValueSet(valueSet) ? valueSet.values : void 0;\n}\nfunction isJsonObject(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction json(value) {\n\treturn JSON.stringify(value);\n}\nvar FieldValueCheck = class {\n\tcheck;\n\tconstructor(check) {\n\t\tthis.check = check;\n\t}\n\t/** The type of one value of `field`, as its schema writes it. */\n\ttypeText(field) {\n\t\tconst { type } = field;\n\t\tif (type.kind === \"valueObject\") return type.entityName;\n\t\tif (type.kind === \"union\") return \"value of its union\";\n\t\tif (field.valueSet !== void 0) return `value of ${field.valueSet.entityName}`;\n\t\tconst codecRef = buildColumnCodecRef(type, void 0);\n\t\treturn this.check.types.scalarTypeName(codecRef) ?? `value of codec ${json(type.codecId)}`;\n\t}\n\tfieldProblem(value, named) {\n\t\tconst { field, text } = named;\n\t\tif (value === null && field.nullable) return void 0;\n\t\tif (!isMany(field)) return this.oneValueProblem(value, named);\n\t\tif (!Array.isArray(value)) return `value ${json(value)} for field ${json(text)} is not a list of ${this.typeText(field)}`;\n\t\tconst elementNullable = field.many !== false && field.many?.elementNullable === true;\n\t\tfor (const element of value) {\n\t\t\tif (element === null && elementNullable) continue;\n\t\t\tconst problem = this.oneValueProblem(element, named);\n\t\t\tif (problem !== void 0) return problem;\n\t\t}\n\t}\n\toneValueProblem(value, named) {\n\t\tconst { field, text } = named;\n\t\tconst { type } = field;\n\t\tconst notA = `value ${json(value)} for field ${json(text)} is not a ${this.typeText(field)}`;\n\t\tif (type.kind === \"union\") return void 0;\n\t\tif (type.kind === \"valueObject\") return isJsonObject(value) ? this.objectProblem(value, type, text) : notA;\n\t\tconst values = valueSetValues(this.check.contract, field);\n\t\tif (values !== void 0) return values.includes(value) ? void 0 : `${notA}; it takes ${values.map(json).join(\", \")}`;\n\t\tconst codecRef = buildColumnCodecRef(type, void 0);\n\t\tif (this.check.types.codecLookup.descriptorFor(codecRef.codecId) === void 0) return `field ${json(text)} has codec ${json(codecRef.codecId)}, which the stack does not have, so no value can be checked against it`;\n\t\treturn acceptedByDataType(value, codecRef, this.check.types) ? void 0 : notA;\n\t}\n\tobjectProblem(value, reference, text) {\n\t\tconst valueObject = valueObjectAt(this.check.contract.storage, reference);\n\t\tif (valueObject === void 0) return void 0;\n\t\tconst name = reference.entityName;\n\t\tfor (const key of Object.keys(value)) if (!Object.hasOwn(valueObject.fields, key)) return `value ${json(value)} for field ${json(text)} has key ${json(key)}, and ${name} has no field ${json(key)}`;\n\t\tfor (const [key, field] of Object.entries(valueObject.fields)) {\n\t\t\tconst fieldText = valueObjectFieldStatementText(this.check.contract, {\n\t\t\t\tnamespaceId: asNamespaceId(reference.namespaceId),\n\t\t\t\tvalueObject: name,\n\t\t\t\tfield: key\n\t\t\t});\n\t\t\tconst member = Object.hasOwn(value, key) ? value[key] : void 0;\n\t\t\tif (member === void 0) {\n\t\t\t\tif (field.nullable) continue;\n\t\t\t\treturn `value ${json(value)} for field ${json(text)} lacks field ${json(fieldText)}, which is required`;\n\t\t\t}\n\t\t\tconst problem = this.fieldProblem(member, {\n\t\t\t\ttext: fieldText,\n\t\t\t\tfield\n\t\t\t});\n\t\t\tif (problem !== void 0) return problem;\n\t\t}\n\t}\n};\n/** Why `field` cannot be the field a `fillStoredKey` call fills at `keyPath`: its last name must be the key the path ends at. */\nfunction fillKeyProblem(keyPath, field) {\n\tif (field === void 0) return void 0;\n\treturn field.text.slice(field.text.lastIndexOf(\".\") + 1) === keyPath.key ? void 0 : `field ${json(field.text)} does not name key ${json(keyPath.key)}, the key path ${json(keyPath.path)} ends at`;\n}\n/**\n* Why `value` cannot fill the field, or `undefined` when the field has no check or takes the value:\n* an enum value must be one of its value set's values, a list must hold values of its element's\n* type, a value object must hold its required fields and no other key, each checked the same way,\n* and a scalar must be one its codec's data type accepts.\n*/\nfunction fillValueProblem(value, field) {\n\tconst check = field?.check;\n\tif (field === void 0 || check === void 0) return void 0;\n\tconst named = fieldNamed(check.contract, field.text);\n\tif (named === void 0) return `field ${json(field.text)} is not a value object field of the end contract`;\n\treturn new FieldValueCheck(check).fieldProblem(value, named);\n}\n//#endregion\n//#region src/core/migrations/operation-subjects.ts\n/** What a codec hook's call is about: the column of the field event it was returned for. */\nfunction fieldEventStorage(field) {\n\treturn {\n\t\tstorageName: [\n\t\t\t...field.namespaceId === UNBOUND_NAMESPACE_ID ? [] : [field.namespaceId],\n\t\t\tfield.tableName,\n\t\t\tfield.columnName\n\t\t].join(\".\"),\n\t\ttable: {\n\t\t\tnamespaceId: field.namespaceId,\n\t\t\ttable: field.tableName,\n\t\t\tcolumn: field.columnName\n\t\t}\n\t};\n}\n/**\n* Names for destructive calls a target cannot map to storage: each call's factory name, with a\n* `#n` ordinal when several calls of the plan share it, so each name picks out one call.\n*/\nfunction unknownCallNames(calls) {\n\tconst counts = /* @__PURE__ */ new Map();\n\tfor (const call of calls) counts.set(call.factoryName, (counts.get(call.factoryName) ?? 0) + 1);\n\tconst seen = /* @__PURE__ */ new Map();\n\treturn new Map(calls.map((call) => {\n\t\tconst ordinal = (seen.get(call.factoryName) ?? 0) + 1;\n\t\tseen.set(call.factoryName, ordinal);\n\t\treturn [call, (counts.get(call.factoryName) ?? 0) > 1 ? `${call.factoryName}#${ordinal}` : call.factoryName];\n\t}));\n}\nfunction isRemovedVariant(model, context) {\n\treturn context.removedVariants.some((variant) => variant.namespaceId === model.namespaceId && variant.model === model.model);\n}\nfunction subjectOf(target, context) {\n\tif (target.enumValue !== void 0) return {\n\t\tkind: \"enumValue\",\n\t\t...target.enumValue\n\t};\n\tif (target.valueObjectField !== void 0) return {\n\t\tkind: \"valueObjectField\",\n\t\t...target.valueObjectField\n\t};\n\tif (target.model !== void 0) return {\n\t\tkind: \"model\",\n\t\t...target.model\n\t};\n\tconst storage = {\n\t\tkind: \"storage\",\n\t\tname: target.storageName\n\t};\n\tconst { fromContract } = context;\n\tif (target.table === void 0 || fromContract === null) return storage;\n\tconst origin = context.origins.originTable({\n\t\tnamespaceId: target.table.namespaceId,\n\t\ttable: target.table.table\n\t});\n\tconst models = modelsStoring(fromContract, origin, exactName);\n\tif (target.table.column === void 0) {\n\t\tconst model = models.find(({ isRoot }) => isRoot) ?? models[0];\n\t\treturn model === void 0 ? storage : {\n\t\t\tkind: \"model\",\n\t\t\t...model.coordinate\n\t\t};\n\t}\n\tconst column = context.origins.originColumn(origin, target.table.column);\n\tfor (const model of [...models].sort((a, b) => Number(b.isRoot) - Number(a.isRoot))) {\n\t\tconst field = Object.entries(model.fields).find(([, stored]) => stored.column === column)?.[0];\n\t\tif (field === void 0) continue;\n\t\treturn isRemovedVariant(model.coordinate, context) ? {\n\t\t\tkind: \"model\",\n\t\t\t...model.coordinate\n\t\t} : {\n\t\t\tkind: \"field\",\n\t\t\t...model.coordinate,\n\t\t\tfield\n\t\t};\n\t}\n\treturn storage;\n}\n/**\n* How to keep the rows of a dropped table whose model the destination keeps under the same name in\n* another table of the same namespace, when the plan does not rename it: the user renames it by\n* hand. None when the origin contract already stores a model in that table.\n*/\nfunction keepTableAdvice(target, subject, context) {\n\tconst { storageRenames } = context;\n\tif (subject.kind !== \"model\" || target.table === void 0 || storageRenames === void 0) return;\n\tconst storage = context.contract.domain.namespaces[subject.namespaceId]?.models[subject.model]?.storage;\n\tif (storage === void 0 || !isSqlModelStorage(storage)) return void 0;\n\tconst { namespaceId, table: from } = target.table;\n\tif (storage.namespaceId !== namespaceId || storage.table === from) return void 0;\n\tif (storageRenames.originModelsIn({\n\t\tnamespaceId,\n\t\ttable: storage.table\n\t}).length > 0) return void 0;\n\tconst sharing = sharedStorageAdvice(storageRenames, {\n\t\torigin: {\n\t\t\tnamespaceId,\n\t\t\ttable: from\n\t\t},\n\t\tdestination: {\n\t\t\tnamespaceId,\n\t\t\ttable: storage.table\n\t\t}\n\t});\n\tif (sharing !== void 0) return sharing;\n\tconst rename = {\n\t\tnamespaceId,\n\t\tfrom,\n\t\tto: storage.table\n\t};\n\treturn `To keep its rows, rename table \"${from}\" to \"${storage.table}\" instead. The plan does not rename it: a plan renames the table of a model that keeps its name only on a target that plans table renames, when the control policy of the table is \"managed\" in both contracts, every model stored in it moves to the new table, and no model moves there from another table. With db update, rename the table in the database yourself with ${context.byHand.tableRenameByHand(rename).join(\"; \")}, then run prisma db update. With migration plan, write the rename as a migration of its own instead. That migration leads to the contract as it is when you write it, so first undo every other change to the contract, keep only the new table name, and run prisma contract emit. Then run prisma migration new --name <name> --from <hash of the migration the database is at>, add ${context.byHand.renderTableRename(rename)} to the operations of its migration.ts, run node on that migration.ts so it writes ops.json, and run prisma db migrate. Then make the rest of the change again and plan it with prisma migration plan.`;\n}\nfunction byName(left, right) {\n\treturn `${left.namespaceId}.${left.model}`.localeCompare(`${right.namespaceId}.${right.model}`);\n}\n/**\n* Why the rows of table `origin` cannot be kept by renaming it to `destination`, as the planner\n* decides it: their storage is being split or merged. Keeping their rows is then a data migration.\n*/\nfunction sharedStorageAdvice(storageRenames, tables) {\n\tconst shared = storageRenames.sharedTable(tables);\n\tif (shared === void 0) return void 0;\n\tconst split = shared.kind === \"split\";\n\tconst models = [...split ? storageRenames.originModelsIn(tables.origin) : storageRenames.destinationModelsIn(tables.destination).filter((model) => storageRenames.originTableOf(model) !== void 0)].sort(byName);\n\tconst into = /* @__PURE__ */ new Map();\n\tfor (const model of models) {\n\t\tconst moved = split ? storageRenames.destinationTableOf(model) : tables.destination;\n\t\tif (moved !== void 0) into.set(moved.table, [...into.get(moved.table) ?? [], model]);\n\t}\n\tconst moves = [...into].map(([table, moved]) => `the rows of ${modelsText(moved)} into table \"${table}\"`).join(\" and \");\n\treturn `${split ? `The origin stores ${modelsText(models)} in table \"${tables.origin.table}\", and the destination stores them in different tables, so their storage is being split.` : `The destination stores ${modelsText(models)} in table \"${tables.destination.table}\", and the origin stores them in different tables, so their storage is being merged.`} Keeping their rows is a data migration, which a plan does not write. With migration plan, write this change as a hand-written migration instead: ${handWrittenMigrationSteps(moves)}`;\n}\n/**\n* The subject of each operation that loses data and each that changes access, at its position in\n* the plan. A subject is a model or a field of the origin contract when one stores it, found under\n* its origin name when a rename statement renamed its table or column earlier in the plan.\n*/\nfunction subjectsOfCalls(calls, context) {\n\tconst dataLoss = [];\n\tconst accessChanges = [];\n\tconst temporaryValues = [];\n\tlet operationIndex = 0;\n\tfor (const call of calls) {\n\t\tfor (const { table, column, value, valueObjectField } of call.temporaryValues) temporaryValues.push({\n\t\t\toperationIndex,\n\t\t\tsubject: valueObjectField !== void 0 ? {\n\t\t\t\tkind: \"valueObjectField\",\n\t\t\t\t...valueObjectField\n\t\t\t} : fieldOfColumn(context.contract, table, column) ?? {\n\t\t\t\tkind: \"storage\",\n\t\t\t\tname: `${table}.${column}`\n\t\t\t},\n\t\t\tvalue\n\t\t});\n\t\tfor (const target of call.dataLoss) {\n\t\t\tconst subject = subjectOf(target, context);\n\t\t\tdataLoss.push({\n\t\t\t\toperationIndex,\n\t\t\t\tsubject,\n\t\t\t\tloss: target.loss,\n\t\t\t\tlabel: call.label,\n\t\t\t\t...ifDefined(\"keepDataAdvice\", target.keepDataAdvice ?? keepTableAdvice(target, subject, context))\n\t\t\t});\n\t\t}\n\t\tfor (const target of call.accessChanges) accessChanges.push({\n\t\t\toperationIndex,\n\t\t\tsubject: subjectOf(target, context),\n\t\t\twidens: target.widens\n\t\t});\n\t\toperationIndex += call.operationCount;\n\t}\n\treturn {\n\t\tdataLoss,\n\t\taccessChanges,\n\t\ttemporaryValues\n\t};\n}\n//#endregion\n//#region src/core/migrations/plan-helpers.ts\nconst readOnlyEmptyObject = Object.freeze({});\nfunction cloneRecord(value) {\n\tif (value === readOnlyEmptyObject) return value;\n\treturn blindCast(Object.freeze({ ...value }));\n}\nfunction freezeSteps(steps) {\n\tif (steps.length === 0) return Object.freeze([]);\n\treturn Object.freeze(steps.map((step) => Object.freeze({\n\t\tdescription: step.description,\n\t\tsql: step.sql,\n\t\t...step.params ? { params: Object.freeze([...step.params]) } : {},\n\t\t...step.meta ? { meta: cloneRecord(step.meta) } : {},\n\t\t...step.expectation ? { expectation: Object.freeze({ ...step.expectation }) } : {}\n\t})));\n}\nfunction freezeDetailsValue(value) {\n\tif (value === null || value === void 0) return value;\n\tif (typeof value !== \"object\") return value;\n\tif (Array.isArray(value)) return blindCast(Object.freeze([...value]));\n\treturn blindCast(Object.freeze({ ...value }));\n}\nfunction freezeTargetDetails(target) {\n\treturn Object.freeze({\n\t\tid: target.id,\n\t\t...target.details !== void 0 ? { details: freezeDetailsValue(target.details) } : {}\n\t});\n}\nfunction freezeOperation(operation) {\n\treturn Object.freeze({\n\t\tid: operation.id,\n\t\tlabel: operation.label,\n\t\t...operation.summary ? { summary: operation.summary } : {},\n\t\toperationClass: operation.operationClass,\n\t\t...operation.invariantId ? { invariantId: operation.invariantId } : {},\n\t\ttarget: freezeTargetDetails(operation.target),\n\t\tprecheck: freezeSteps(operation.precheck),\n\t\texecute: freezeSteps(operation.execute),\n\t\tpostcheck: freezeSteps(operation.postcheck),\n\t\t...operation.meta ? { meta: cloneRecord(operation.meta) } : {}\n\t});\n}\nfunction freezeOperations(operations) {\n\tif (operations.length === 0) return Object.freeze([]);\n\treturn Object.freeze(operations.map((operation) => freezeOperation(operation)));\n}\nfunction createMigrationPlan(options) {\n\treturn Object.freeze({\n\t\ttargetId: options.targetId,\n\t\tspaceId: options.spaceId,\n\t\t...options.origin !== void 0 ? { origin: options.origin ? Object.freeze({ ...options.origin }) : null } : {},\n\t\tdestination: Object.freeze({ ...options.destination }),\n\t\toperations: freezeOperations(options.operations),\n\t\tprovidedInvariants: Object.freeze([...options.providedInvariants]),\n\t\t...options.meta ? { meta: cloneRecord(options.meta) } : {}\n\t});\n}\nfunction plannerSuccess(plan, appliedStatements, subjects, warnings) {\n\treturn Object.freeze({\n\t\tkind: \"success\",\n\t\tplan,\n\t\tappliedStatements: Object.freeze([...appliedStatements]),\n\t\tdataLoss: Object.freeze([...subjects.dataLoss]),\n\t\taccessChanges: Object.freeze([...subjects.accessChanges]),\n\t\ttemporaryValues: Object.freeze([...subjects.temporaryValues]),\n\t\t...warnings && warnings.length > 0 ? { warnings: Object.freeze(warnings.map((conflict) => Object.freeze({\n\t\t\tkind: conflict.kind,\n\t\t\tsummary: conflict.summary,\n\t\t\t...conflict.why ? { why: conflict.why } : {},\n\t\t\t...conflict.location ? { location: Object.freeze({ ...conflict.location }) } : {},\n\t\t\t...conflict.refusedStatement ? { refusedStatement: conflict.refusedStatement } : {},\n\t\t\t...conflict.refusedOperationClass ? { refusedOperationClass: conflict.refusedOperationClass } : {},\n\t\t\t...conflict.meta ? { meta: cloneRecord(conflict.meta) } : {}\n\t\t}))) } : {}\n\t});\n}\nfunction plannerFailure(conflicts) {\n\treturn Object.freeze({\n\t\tkind: \"failure\",\n\t\tconflicts: Object.freeze(conflicts.map((conflict) => Object.freeze({\n\t\t\tkind: conflict.kind,\n\t\t\tsummary: conflict.summary,\n\t\t\t...conflict.why ? { why: conflict.why } : {},\n\t\t\t...conflict.location ? { location: Object.freeze({ ...conflict.location }) } : {},\n\t\t\t...conflict.refusedStatement ? { refusedStatement: conflict.refusedStatement } : {},\n\t\t\t...conflict.leaveOut ? { leaveOut: Object.freeze([...conflict.leaveOut]) } : {},\n\t\t\t...conflict.refusedOperationClass ? { refusedOperationClass: conflict.refusedOperationClass } : {},\n\t\t\t...conflict.meta ? { meta: cloneRecord(conflict.meta) } : {}\n\t\t})))\n\t});\n}\n/**\n* Creates a successful migration runner result.\n*/\nfunction runnerSuccess(value) {\n\treturn ok(Object.freeze({\n\t\toperationsPlanned: value.operationsPlanned,\n\t\toperationsExecuted: value.operationsExecuted\n\t}));\n}\n/**\n* Creates a failed migration runner result.\n*/\nfunction runnerFailure(code, summary, options) {\n\treturn notOk(migrationRunnerFailure(code, summary, options));\n}\n//#endregion\n//#region src/core/migrations/policies.ts\n/**\n* Policy used by `db init`: additive-only operations, no widening/destructive steps.\n*/\nconst INIT_ADDITIVE_POLICY = Object.freeze({ allowedOperationClasses: Object.freeze([\"additive\"]) });\n//#endregion\n//#region src/core/migrations/required-column.ts\nconst RequiredColumnMeta = type({ requiredColumn: {\n\ttable: \"string\",\n\tcolumn: \"string\",\n\treason: \"'nullValues' | 'newField' | 'backfillMissedRows'\"\n} });\n/**\n* The meta of a step that fails when rows have no value for a column that is to become required:\n* rows hold NULL in it, or, for a new column that can be added to an empty table only, the table\n* has rows. When the step fails, the runner counts those rows.\n*/\nfunction requiredColumnMeta(table, column, reason) {\n\treturn { requiredColumn: {\n\t\ttable,\n\t\tcolumn,\n\t\treason\n\t} };\n}\n/** The column a step checks before it becomes required, as {@link requiredColumnMeta} marks it. */\nfunction requiredColumnOf(step) {\n\tconst meta = RequiredColumnMeta(step.meta ?? {});\n\treturn meta instanceof type.errors ? void 0 : meta.requiredColumn;\n}\n/** What a runner failure says of the rows a column that is to become required has no value in. */\nfunction rowsWithoutValueSummary(required, rows) {\n\tconst { table, column } = required;\n\tif (required.reason === \"newField\") return `\"${table}\" has ${rows} ${rows === 1 ? \"row\" : \"rows\"}, so the new required column \"${column}\" cannot be added: it can be added to an empty table only.`;\n\tconst counted = `${rows} ${rows === 1 ? \"row\" : \"rows\"} of \"${table}\"`;\n\tif (required.reason === \"backfillMissedRows\") return `${counted} still ${rows === 1 ? \"holds\" : \"hold\"} NULL in \"${column}\" after its backfill step, so it cannot become required.`;\n\treturn `${counted} ${rows === 1 ? \"holds\" : \"hold\"} NULL in \"${column}\", so it cannot become required.`;\n}\nfunction migrationRange(edges, operationIndex, operationCount) {\n\tlet start = 0;\n\tfor (const edge of edges) {\n\t\tconst end = start + edge.operationCount;\n\t\tif (operationIndex < end) return {\n\t\t\tstart,\n\t\t\tend\n\t\t};\n\t\tstart = end;\n\t}\n\treturn {\n\t\tstart: 0,\n\t\tend: operationCount\n\t};\n}\n/**\n* The steps of `operations` that belong to the same migration as the operation at `operationIndex`\n* and carry a mark `markOf` reads, in plan order: `edges` say how many operations each migration of\n* the plan has.\n*/\nfunction marksOfMigration(operations, edges, operationIndex, markOf) {\n\tconst { start, end } = migrationRange(edges, operationIndex, operations.length);\n\treturn operations.slice(start, end).flatMap((operation, offset) => [\n\t\t...operation.precheck,\n\t\t...operation.execute,\n\t\t...operation.postcheck\n\t].flatMap((step) => {\n\t\tconst mark = markOf(step);\n\t\treturn mark === void 0 ? [] : [{\n\t\t\toperation,\n\t\t\toperationIndex: start + offset,\n\t\t\tstep,\n\t\t\tmark\n\t\t}];\n\t}));\n}\n/** The marks of the steps that mark a column as becoming required, as {@link marksOfMigration} finds them. */\nfunction requiredColumnsOfMigration(operations, edges, operationIndex) {\n\treturn marksOfMigration(operations, edges, operationIndex, requiredColumnOf).map(({ operation, operationIndex: index, mark }) => ({\n\t\toperation,\n\t\toperationIndex: index,\n\t\trequired: mark\n\t}));\n}\n/**\n* A runner failure's summary and reports for the rows that columns becoming required have no value\n* in. The failed operation's marks are counted first, and the first of them with such rows is the\n* one the summary names; undefined when none has any. The other marks of the same migration are\n* counted after it, until a count fails, such as for a column an earlier operation adds, so that\n* the advice can name every field that needs a value.\n*/\nasync function rowsWithoutValueFailure(input) {\n\tconst report = (mark, rows) => ({\n\t\tfield: fieldOfColumn(input.contract, mark.required.table, mark.required.column),\n\t\treason: mark.required.reason,\n\t\trows,\n\t\toperationIndex: mark.operationIndex\n\t});\n\tfor (const mark of input.failed) {\n\t\tconst rows = await input.count(mark);\n\t\tif (rows === 0) continue;\n\t\tconst reports = [report(mark, rows)];\n\t\tfor (const other of input.others) {\n\t\t\tif (other.required.table === mark.required.table && other.required.column === mark.required.column) continue;\n\t\t\tlet otherRows;\n\t\t\ttry {\n\t\t\t\totherRows = await input.count(other);\n\t\t\t} catch {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (otherRows > 0) reports.push(report(other, otherRows));\n\t\t}\n\t\treturn {\n\t\t\tsummary: rowsWithoutValueSummary(mark.required, rows),\n\t\t\treports\n\t\t};\n\t}\n}\n//#endregion\n//#region src/core/migrations/resolve-column-rename.ts\nconst COLUMN_RENAME_UNMATCHED_CODE = \"MIGRATION.COLUMN_RENAME_UNMATCHED\";\nfunction tableLabel$1(namespaceId, table) {\n\treturn namespaceId === void 0 || namespaceId === UNBOUND_NAMESPACE_ID ? table : `${namespaceId}.${table}`;\n}\nfunction columnLabel(namespaceId, table, column) {\n\treturn `\"${tableLabel$1(namespaceId, table)}\".\"${column}\"`;\n}\nfunction declaresColumn(contract, namespaceId, table, column) {\n\tconst columns = contract.storage.namespaces[namespaceId]?.entries.table?.[table]?.columns;\n\treturn columns !== void 0 && Object.hasOwn(columns, column);\n}\n/**\n* Refuses a `renameColumn` call that does not match the migration's contracts, with\n* `MIGRATION.COLUMN_RENAME_UNMATCHED`.\n*/\nfunction unmatchedColumnRename(rename, reason) {\n\treturn sqlFamilyError(COLUMN_RENAME_UNMATCHED_CODE, `renameColumn ${columnLabel(rename.namespaceId, rename.table, rename.from)} to \"${rename.to}\" does not match the migration's contracts: ${reason}.`, {\n\t\twhy: \"renameColumn must name a table and a column as the migration's earlier rename operations leave them, and a new column name that the end contract has on that table and that the table does not have yet. Order the rename calls in the sequence the renames happen, and check the names of the table, the column and the namespace.\",\n\t\tmeta: {\n\t\t\ttable: rename.table,\n\t\t\tfrom: rename.from,\n\t\t\tto: rename.to\n\t\t}\n\t});\n}\n/**\n* Checks a column rename: the table must exist in `previous` (in exactly one namespace when the\n* namespace is not given) with the old column and without the new one, and the end contract must\n* have the new column on that table.\n*/\nfunction checkColumnRename(previous, endContract, rename) {\n\tconst namespaceIds = rename.namespaceId === void 0 ? previous.namespacesWithTable(rename.table) : previous.hasTable(rename.namespaceId, rename.table) ? [rename.namespaceId] : [];\n\tconst [namespaceId, ...others] = namespaceIds;\n\tif (namespaceId === void 0) return notOk({ kind: \"tableMissing\" });\n\tif (others.length > 0) return notOk({\n\t\tkind: \"tableInManyNamespaces\",\n\t\tnamespaceIds\n\t});\n\tif (!previous.hasColumn(namespaceId, rename.table, rename.from)) return notOk({\n\t\tkind: \"columnMissing\",\n\t\tnamespaceId\n\t});\n\tconst [taken] = previous.columnsNamed(namespaceId, rename.table, rename.to).filter((column) => column !== rename.from);\n\tif (taken !== void 0) return notOk({\n\t\tkind: \"nameTaken\",\n\t\tnamespaceId,\n\t\ttaken\n\t});\n\tif (!declaresColumn(endContract, namespaceId, rename.table, rename.to)) return notOk({\n\t\tkind: \"notInEndContract\",\n\t\tnamespaceId\n\t});\n\treturn ok({\n\t\tnamespaceId,\n\t\ttable: rename.table,\n\t\tfrom: rename.from,\n\t\tto: rename.to\n\t});\n}\n/** The reason `MIGRATION.COLUMN_RENAME_UNMATCHED` gives for a mismatch. */\nfunction columnRenameMismatchReason(rename, mismatch) {\n\tswitch (mismatch.kind) {\n\t\tcase \"tableMissing\": return `table \"${tableLabel$1(rename.namespaceId, rename.table)}\" does not exist at this point of the migration`;\n\t\tcase \"tableInManyNamespaces\": return `table \"${rename.table}\" is declared in more than one namespace (${mismatch.namespaceIds.join(\", \")}); name its namespace`;\n\t\tcase \"columnMissing\": return `column ${columnLabel(mismatch.namespaceId, rename.table, rename.from)} does not exist at this point of the migration`;\n\t\tcase \"nameTaken\": return `column ${columnLabel(mismatch.namespaceId, rename.table, rename.to)} already exists at this point of the migration${mismatch.taken === rename.to ? \"\" : ` as \"${mismatch.taken}\"`}`;\n\t\tcase \"notInEndContract\": return `column ${columnLabel(mismatch.namespaceId, rename.table, rename.to)} does not exist in the end contract`;\n\t}\n}\n/**\n* Resolves a column a migration renames with {@link checkColumnRename}, refusing a mismatch with\n* `MIGRATION.COLUMN_RENAME_UNMATCHED`.\n*/\nfunction resolveColumnRenameAgainst(previous, endContract, rename) {\n\tconst checked = checkColumnRename(previous, endContract, rename);\n\tif (!checked.ok) return notOk(unmatchedColumnRename(rename, columnRenameMismatchReason(rename, checked.failure)));\n\treturn ok(checked.value);\n}\n//#endregion\n//#region src/core/migrations/resolve-table-rename.ts\nconst TABLE_RENAME_UNMATCHED_CODE = \"MIGRATION.TABLE_RENAME_UNMATCHED\";\nfunction tableLabel(namespaceId, tableName) {\n\treturn namespaceId === void 0 || namespaceId === UNBOUND_NAMESPACE_ID ? tableName : `${namespaceId}.${tableName}`;\n}\nfunction declares(contract, namespaceId, tableName) {\n\treturn Object.hasOwn(contract.storage.namespaces[namespaceId]?.entries.table ?? {}, tableName);\n}\n/**\n* Refuses a `renameTable` call that does not match the migration's contracts, with\n* `MIGRATION.TABLE_RENAME_UNMATCHED`.\n*/\nfunction unmatchedTableRename(rename, reason) {\n\treturn sqlFamilyError(TABLE_RENAME_UNMATCHED_CODE, `renameTable \"${tableLabel(rename.namespaceId, rename.from)}\" to \"${rename.to}\" does not match the migration's contracts: ${reason}.`, {\n\t\twhy: \"renameTable must name a table as the migration's earlier rename operations leave it, and a new name that the end contract has and that no earlier rename operation has already produced. Order the renameTable calls in the sequence the renames happen, make the rename its own schema change, and check the spelling, the table and the namespace.\",\n\t\tmeta: {\n\t\t\tfrom: rename.from,\n\t\t\tto: rename.to\n\t\t}\n\t});\n}\n/**\n* Checks a table rename: the table must exist in `previous` (in exactly one namespace when the\n* namespace is not given), and the new name must exist in the end contract and not in `previous`.\n*/\nfunction checkTableRename(previous, endContract, rename) {\n\tconst namespaceIds = rename.namespaceId === void 0 ? previous.namespacesWithTable(rename.from) : previous.hasTable(rename.namespaceId, rename.from) ? [rename.namespaceId] : [];\n\tconst [namespaceId, ...others] = namespaceIds;\n\tif (namespaceId === void 0) return notOk({ kind: \"tableMissing\" });\n\tif (others.length > 0) return notOk({\n\t\tkind: \"tableInManyNamespaces\",\n\t\tnamespaceIds\n\t});\n\tconst [taken] = previous.tablesNamed(namespaceId, rename.to).filter((table) => table !== rename.from);\n\tif (taken !== void 0) return notOk({\n\t\tkind: \"nameTaken\",\n\t\tnamespaceId,\n\t\ttaken\n\t});\n\tif (!declares(endContract, namespaceId, rename.to)) return notOk({\n\t\tkind: \"notInEndContract\",\n\t\tnamespaceId\n\t});\n\treturn ok({\n\t\tnamespaceId,\n\t\tfrom: rename.from,\n\t\tto: rename.to\n\t});\n}\n/** The reason `MIGRATION.TABLE_RENAME_UNMATCHED` gives for a mismatch. */\nfunction tableRenameMismatchReason(rename, mismatch) {\n\tswitch (mismatch.kind) {\n\t\tcase \"tableMissing\": return `table \"${tableLabel(rename.namespaceId, rename.from)}\" does not exist at this point of the migration`;\n\t\tcase \"tableInManyNamespaces\": return `table \"${rename.from}\" is declared in more than one namespace (${mismatch.namespaceIds.join(\", \")}); name its namespace`;\n\t\tcase \"nameTaken\": return `table \"${tableLabel(mismatch.namespaceId, rename.to)}\" already exists at this point of the migration${mismatch.taken === rename.to ? \"\" : ` as \"${mismatch.taken}\"`}`;\n\t\tcase \"notInEndContract\": return `table \"${tableLabel(mismatch.namespaceId, rename.to)}\" does not exist in the end contract`;\n\t}\n}\n/**\n* Resolves a table a migration renames with {@link checkTableRename}, refusing a mismatch with\n* `MIGRATION.TABLE_RENAME_UNMATCHED`.\n*/\nfunction resolveTableRenameAgainst(previous, endContract, rename) {\n\tconst checked = checkTableRename(previous, endContract, rename);\n\tif (!checked.ok) return notOk(unmatchedTableRename(rename, tableRenameMismatchReason(rename, checked.failure)));\n\treturn ok(checked.value);\n}\n//#endregion\n//#region src/core/migrations/rows-holding-value.ts\nconst RowsHoldingValueMeta = type({ rowsHoldingValue: {\n\tenumValue: {\n\t\t\"namespaceId?\": \"string\",\n\t\tenum: \"string\",\n\t\tmember: \"string\"\n\t},\n\tvalue: \"string | number\",\n\t\"codecRef?\": {\n\t\tcodecId: \"string\",\n\t\t\"typeParams?\": \"unknown\"\n\t},\n\ttable: \"string\",\n\tcolumn: \"string\",\n\tstoredValue: \"string | number\",\n\t\"path?\": \"string\"\n} });\n/**\n* The meta of the check before a stored enum value is removed from a column: it fails while rows\n* hold the value in a column that takes no NULL, and the runner then counts those rows.\n*/\nfunction rowsHoldingValueMeta(mark) {\n\treturn { rowsHoldingValue: mark };\n}\n/** The enum value a check guards, as {@link rowsHoldingValueMeta} marks it. */\nfunction rowsHoldingValueOf(step) {\n\tconst meta = RowsHoldingValueMeta(step.meta ?? {});\n\tif (meta instanceof type.errors) return void 0;\n\tconst { enumValue, value, codecRef, table, column, storedValue, path } = meta.rowsHoldingValue;\n\treturn {\n\t\tenumValue: {\n\t\t\t...enumValue.namespaceId === void 0 ? {} : { namespaceId: asNamespaceId(enumValue.namespaceId) },\n\t\t\tenum: enumValue.enum,\n\t\t\tmember: enumValue.member\n\t\t},\n\t\tvalue,\n\t\t...codecRef === void 0 ? {} : { codecRef: codecRefOf(codecRef) },\n\t\ttable,\n\t\tcolumn,\n\t\tstoredValue,\n\t\t...ifDefined(\"path\", path)\n\t};\n}\nfunction codecRefOf(codecRef) {\n\treturn codecRef.typeParams === void 0 ? { codecId: codecRef.codecId } : {\n\t\tcodecId: codecRef.codecId,\n\t\ttypeParams: blindCast(codecRef.typeParams)\n\t};\n}\nfunction holdingText(place, rows) {\n\tconst holds = `${`${rows} ${rows === 1 ? \"row\" : \"rows\"} of \"${place.table}\"`} ${rows === 1 ? \"holds\" : \"hold\"} ${JSON.stringify(place.storedValue)}`;\n\treturn place.path === void 0 ? `${holds} in column \"${place.column}\"` : `${holds} at path ${JSON.stringify(place.path)} in column \"${place.column}\"`;\n}\n/** What a runner failure says of the rows that hold a stored value a column, or a member at a path inside it, cannot lose: the value as the database stores it. */\nfunction rowsHoldingValueSummary(place, rows) {\n\tconst holds = holdingText(place, rows);\n\treturn place.path === void 0 ? `${holds}, which takes no NULL, so the value cannot be removed.` : `${holds}, a member that takes no null, so the value cannot be removed.`;\n}\n/** The marked removal checks of the migration of the operation at `operationIndex`, in plan order. */\nfunction removalsOfMigration(operations, edges, operationIndex) {\n\treturn marksOfMigration(operations, edges, operationIndex, rowsHoldingValueOf).map(({ operation, operationIndex: index, step, mark }) => ({\n\t\toperation,\n\t\toperationIndex: index,\n\t\tcheck: step,\n\t\tmark\n\t}));\n}\n/**\n* A runner failure's summary and reports for the rows that hold stored values removals cannot take\n* out of required columns. The failed removal is counted first, and the summary names it; undefined\n* when that count fails. Then each other removal of `others` whose check `checkFails` says fails is\n* counted, until a count fails, such as for a column an earlier operation adds, so that the advice\n* can name every column that still holds a removed value.\n*/\nasync function rowsHoldingValueFailure(input) {\n\tconst { failed } = input;\n\tconst report = (removal, rows) => ({\n\t\tenumValue: removal.mark.enumValue,\n\t\tvalue: removal.mark.storedValue,\n\t\trows,\n\t\toperationIndex: removal.operationIndex,\n\t\t...ifDefined(\"keepDataEdit\", input.keepDataEdit(removal))\n\t});\n\tlet rows;\n\ttry {\n\t\trows = await input.count(failed);\n\t} catch {\n\t\treturn;\n\t}\n\tconst counted = [{\n\t\tremoval: failed,\n\t\trows\n\t}];\n\tfor (const other of input.others) {\n\t\tif (other.operationIndex === failed.operationIndex) continue;\n\t\tlet otherRows;\n\t\ttry {\n\t\t\totherRows = await input.checkFails(other) ? await input.count(other) : 0;\n\t\t} catch {\n\t\t\tbreak;\n\t\t}\n\t\tif (otherRows > 0) counted.push({\n\t\t\tremoval: other,\n\t\t\trows: otherRows\n\t\t});\n\t}\n\treturn {\n\t\tsummary: counted.length === 1 ? rowsHoldingValueSummary(failed.mark, rows) : [\"Rows hold values that the migration removes where no null is allowed, so the values cannot be removed:\", ...counted.map((each) => `- ${holdingText(each.removal.mark, each.rows)}`)].join(\"\\n\"),\n\t\treports: counted.map((each) => report(each.removal, each.rows))\n\t};\n}\n//#endregion\n//#region src/core/migrations/sql-expression-text.ts\n/** Keywords that end an expression and continue the statement around it. */\nconst STATEMENT_KEYWORDS = /* @__PURE__ */ new Set([\n\t\"FROM\",\n\t\"WHERE\",\n\t\"UNION\",\n\t\"INTERSECT\",\n\t\"EXCEPT\",\n\t\"GROUP\",\n\t\"ORDER\",\n\t\"HAVING\",\n\t\"LIMIT\",\n\t\"RETURNING\",\n\t\"WINDOW\"\n]);\nconst WORD = /[A-Za-z_][A-Za-z0-9_$]*/y;\nconst DOLLAR_QUOTE = /\\$[A-Za-z_]*\\$/y;\nfunction quoteAt(text, index, quoting) {\n\treturn quoting.find((quote) => text.slice(index, index + quote.open.length).toUpperCase() === quote.open.toUpperCase());\n}\nfunction endOfQuote(text, start, quote) {\n\tlet index = start + quote.open.length;\n\twhile (index < text.length) {\n\t\tif (quote.backslashEscapes && text[index] === \"\\\\\") {\n\t\t\tindex += 2;\n\t\t\tcontinue;\n\t\t}\n\t\tif (text.startsWith(quote.close, index)) {\n\t\t\tconst after = index + quote.close.length;\n\t\t\tif (!quote.doubledCloseEscapes || !text.startsWith(quote.close, after)) return after;\n\t\t\tindex = after + quote.close.length;\n\t\t\tcontinue;\n\t\t}\n\t\tindex += 1;\n\t}\n}\n/**\n* Returns what in `text` could end or extend the statement a migration writes it into, such as the\n* conversion of an `ALTER COLUMN … USING` clause or a column of an `INSERT … SELECT` list, or\n* undefined when it finds nothing. Text inside the quotes of `quoting` may hold anything; outside\n* them the text may not hold a semicolon, a SQL comment, dollar quoting, or, outside parentheses\n* and brackets, a comma or a keyword that would end the expression. `FROM` directly after\n* `DISTINCT`, as in `IS DISTINCT FROM`, belongs to the expression. It checks for these mistakes\n* only; it does not parse the SQL.\n*/\nfunction checkSqlExpressionText(text, quoting) {\n\tlet depth = 0;\n\tlet index = 0;\n\tlet previousWord;\n\twhile (index < text.length) {\n\t\tconst character = text[index] ?? \"\";\n\t\tconst quote = quoteAt(text, index, quoting);\n\t\tif (quote !== void 0) {\n\t\t\tconst end = endOfQuote(text, index, quote);\n\t\t\tif (end === void 0) return \"a quote that is not closed\";\n\t\t\tindex = end;\n\t\t\tpreviousWord = void 0;\n\t\t\tcontinue;\n\t\t}\n\t\tif (character === \";\") return \"a semicolon outside a quoted literal\";\n\t\tif (text.startsWith(\"--\", index) || text.startsWith(\"/*\", index)) return \"a SQL comment\";\n\t\tDOLLAR_QUOTE.lastIndex = index;\n\t\tif (character === \"$\" && DOLLAR_QUOTE.test(text)) return \"dollar quoting\";\n\t\tif (character === \",\" && depth === 0) return \"a comma outside parentheses\";\n\t\tif (character === \"(\" || character === \"[\") depth += 1;\n\t\tif (character === \")\" || character === \"]\") {\n\t\t\tdepth -= 1;\n\t\t\tif (depth < 0) return \"parentheses that do not match\";\n\t\t}\n\t\tWORD.lastIndex = index;\n\t\tconst word = /[A-Za-z_]/.test(character) ? WORD.exec(text)?.[0].toUpperCase() : void 0;\n\t\tif (word !== void 0) {\n\t\t\tif (depth === 0 && STATEMENT_KEYWORDS.has(word) && !(word === \"FROM\" && previousWord === \"DISTINCT\")) return `the keyword ${word} outside parentheses`;\n\t\t\tpreviousWord = word;\n\t\t\tindex += word.length;\n\t\t\tcontinue;\n\t\t}\n\t\tif (!/\\s/.test(character)) previousWord = void 0;\n\t\tindex += 1;\n\t}\n\treturn depth === 0 ? void 0 : \"parentheses that do not match\";\n}\n//#endregion\n//#region src/core/migrations/sql-slot.ts\n/** Whether `slot` is a placeholder the user has not filled yet. */\nfunction isUnfilledSlot(slot) {\n\treturn slot?.kind === \"placeholder\";\n}\n/** The SQL of a written slot; undefined for an unfilled one or none. */\nfunction sqlOfSlot(slot) {\n\treturn slot?.kind === \"sql\" ? slot.sql : void 0;\n}\n/** The slot as `migration.ts` writes it: SQL text written through `sql`, or a `placeholder(...)` call. */\nfunction slotSource(slot, sql) {\n\treturn slot.kind === \"placeholder\" ? `placeholder(${jsonToTsSource(slot.slot)})` : sql.source(slot.sql);\n}\n//#endregion\n//#region src/core/migrations/sql-text-sources.ts\n/** `moduleSpecifier` is the module the generated file imports `sql` from. */\nfunction createSqlTextSources(moduleSpecifier) {\n\tlet usesTag = false;\n\treturn {\n\t\tsource(text) {\n\t\t\tconst written = tsTaggedTemplateSource(SQL_EXPRESSION_TAG, text);\n\t\t\tusesTag ||= written.usesTag;\n\t\t\treturn written.source;\n\t\t},\n\t\timports() {\n\t\t\treturn usesTag ? [{\n\t\t\t\tmoduleSpecifier,\n\t\t\t\tsymbol: SQL_EXPRESSION_TAG\n\t\t\t}] : [];\n\t\t}\n\t};\n}\n//#endregion\n//#region src/core/migrations/sql-type-lookups.ts\n/** The codecs and data types a set of composed components registers. */\nfunction sqlTypeLookupsOf(frameworkComponents) {\n\treturn {\n\t\tcodecLookup: extractCodecLookup(frameworkComponents),\n\t\tdataTypeLookup: assembleDataTypes(frameworkComponents).lookup\n\t};\n}\n//#endregion\n//#region src/core/migrations/storage-renames.ts\nfunction coordinateKey(coordinate) {\n\treturn JSON.stringify([\n\t\tcoordinate.namespaceId,\n\t\tcoordinate.model,\n\t\t\"field\" in coordinate ? coordinate.field : null\n\t]);\n}\n/** The name each namespace has after the namespace rename statements, keyed by its origin name. */\nfunction namespaceRenamesOf(statements) {\n\treturn new Map(statements.flatMap((statement) => statement.entity === \"namespace\" ? [[statement.from, statement.to]] : []));\n}\nfunction modelRenamesOf(statements, namespaceRenames, fromContract, contract) {\n\tconst stated = statements.flatMap((statement) => statement.entity === \"model\" ? [{\n\t\tfrom: statement.from,\n\t\tto: statement.to,\n\t\tstatement\n\t}] : []);\n\tconst named = new Set(stated.flatMap((rename) => [rename.from, rename.to]).map(coordinateKey));\n\tconst kept = Object.entries(fromContract.domain.namespaces).flatMap(([namespaceId, namespace]) => Object.keys(namespace.models).flatMap((model) => {\n\t\tconst from = {\n\t\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\t\tmodel\n\t\t};\n\t\tconst to = {\n\t\t\tnamespaceId: asNamespaceId(namespaceRenames.get(namespaceId) ?? namespaceId),\n\t\t\tmodel\n\t\t};\n\t\treturn Object.hasOwn(contract.domain.namespaces[to.namespaceId]?.models ?? {}, model) && !named.has(coordinateKey(from)) && !named.has(coordinateKey(to)) ? [{\n\t\t\tfrom,\n\t\t\tto,\n\t\t\tstatement: void 0\n\t\t}] : [];\n\t}));\n\treturn [...stated, ...kept];\n}\nfunction fieldRenamesOf(statements, models, fromContract, contract) {\n\tconst stated = statements.flatMap((statement) => statement.entity === \"field\" ? [{\n\t\tfrom: statement.from,\n\t\tto: statement.to,\n\t\tstatement\n\t}] : []);\n\tconst named = new Set(stated.flatMap((rename) => [rename.from, rename.to]).map(coordinateKey));\n\tconst kept = models.flatMap((model) => {\n\t\tconst originFields = Object.keys(sqlModelStorage(fromContract, model.from)?.fields ?? {});\n\t\tconst destinationFields = sqlModelStorage(contract, model.to)?.fields ?? {};\n\t\treturn originFields.flatMap((field) => {\n\t\t\tconst from = {\n\t\t\t\t...model.from,\n\t\t\t\tfield\n\t\t\t};\n\t\t\tconst to = {\n\t\t\t\t...model.to,\n\t\t\t\tfield\n\t\t\t};\n\t\t\treturn Object.hasOwn(destinationFields, field) && !named.has(coordinateKey(from)) && !named.has(coordinateKey(to)) ? [{\n\t\t\t\tfrom,\n\t\t\t\tto,\n\t\t\t\tstatement: void 0\n\t\t\t}] : [];\n\t\t});\n\t});\n\treturn [...stated, ...kept];\n}\nfunction grouped(items, keyOf, textOf) {\n\tconst groups = /* @__PURE__ */ new Map();\n\tfor (const item of items) {\n\t\tconst key = keyOf(item);\n\t\tif (key === void 0) continue;\n\t\tconst text = textOf(key);\n\t\tconst group = groups.get(text);\n\t\tif (group === void 0) groups.set(text, {\n\t\t\tkey,\n\t\t\titems: [item]\n\t\t});\n\t\telse group.items.push(item);\n\t}\n\treturn [...groups.values()];\n}\nfunction tablesText(key) {\n\treturn JSON.stringify([\n\t\tkey.origin.namespaceId,\n\t\tkey.origin.table,\n\t\tkey.destination.namespaceId,\n\t\tkey.destination.table\n\t]);\n}\nfunction columnsText(key) {\n\treturn JSON.stringify([\n\t\ttablesText(key),\n\t\tkey.from,\n\t\tkey.to\n\t]);\n}\n/**\n* The renames a plan makes, from its statements and from the names both contracts keep, and the\n* tables and columns they move.\n*/\nvar StorageRenames = class {\n\tmodels;\n\tfields;\n\ttableChanges;\n\tcolumnChanges;\n\t#fromContract;\n\t#contract;\n\t#namespaceRenames;\n\t#byOrigin;\n\t#byDestination;\n\t/** Whether the target takes two table or column names for one. */\n\tsameName;\n\tconstructor(statements, fromContract, contract, sameName) {\n\t\tthis.#fromContract = fromContract;\n\t\tthis.#contract = contract;\n\t\tthis.sameName = sameName;\n\t\tthis.#namespaceRenames = namespaceRenamesOf(statements);\n\t\tthis.models = modelRenamesOf(statements, this.#namespaceRenames, fromContract, contract);\n\t\tthis.fields = fieldRenamesOf(statements, this.models, fromContract, contract);\n\t\tconst renames = [...this.models, ...this.fields];\n\t\tthis.#byOrigin = new Map(renames.map((rename) => [coordinateKey(rename.from), rename]));\n\t\tthis.#byDestination = new Map(renames.map((rename) => [coordinateKey(rename.to), rename]));\n\t\tthis.tableChanges = grouped(this.models, (rename) => {\n\t\t\tconst tables = this.#tablesOf(rename);\n\t\t\treturn tables === void 0 || this.inPlace(tables.origin, tables.destination) ? void 0 : tables;\n\t\t}, tablesText).map(({ key, items }) => ({\n\t\t\t...key,\n\t\t\trenames: items\n\t\t}));\n\t\tthis.columnChanges = grouped(this.fields, (rename) => {\n\t\t\tconst columns = this.#columnsOf(rename);\n\t\t\treturn columns === void 0 || columns.from === columns.to ? void 0 : columns;\n\t\t}, columnsText).map(({ key, items }) => ({\n\t\t\t...key,\n\t\t\trenames: items\n\t\t}));\n\t}\n\t#tablesOf(rename) {\n\t\tconst origin = modelTable(this.#fromContract, rename.from);\n\t\tconst destination = modelTable(this.#contract, rename.to);\n\t\treturn origin === void 0 || destination === void 0 ? void 0 : {\n\t\t\torigin,\n\t\t\tdestination\n\t\t};\n\t}\n\t#columnsOf(rename) {\n\t\tconst tables = this.#tablesOf(rename);\n\t\tconst from = fieldColumn(this.#fromContract, rename.from);\n\t\tconst to = fieldColumn(this.#contract, rename.to);\n\t\treturn tables === void 0 || from === void 0 || to === void 0 ? void 0 : {\n\t\t\t...tables,\n\t\t\tfrom,\n\t\t\tto\n\t\t};\n\t}\n\t/** The namespace an origin namespace has after the namespace rename statements. */\n\tnamespaceAfterRenames(namespaceId) {\n\t\treturn this.#namespaceRenames.get(namespaceId) ?? namespaceId;\n\t}\n\t/** Whether the origin table is the destination table once the namespace renames are made. */\n\tinPlace(origin, destination) {\n\t\treturn sameTable({\n\t\t\tnamespaceId: this.namespaceAfterRenames(origin.namespaceId),\n\t\t\ttable: origin.table\n\t\t}, destination);\n\t}\n\t/** The table change that moves the table of `rename`'s origin model, if its table changes. */\n\ttableChangeOf(rename) {\n\t\treturn this.tableChanges.find((change) => change.renames.includes(rename));\n\t}\n\t/** The column change that moves the column of `rename`'s origin field, if its column changes. */\n\tcolumnChangeOf(rename) {\n\t\treturn this.columnChanges.find((change) => change.renames.includes(rename));\n\t}\n\t/** Whether the control policy is `managed` for the origin table and the destination table. */\n\tmanagedOnBothSides(change) {\n\t\treturn tableControlPolicy(this.#fromContract, change.origin) === \"managed\" && tableControlPolicy(this.#contract, change.destination) === \"managed\";\n\t}\n\t#renameFrom(origin) {\n\t\treturn this.#byOrigin.get(coordinateKey(origin));\n\t}\n\t#renameTo(destination) {\n\t\treturn this.#byDestination.get(coordinateKey(destination));\n\t}\n\t#storedIn(contract, coordinate) {\n\t\tconst table = modelTable(contract, coordinate);\n\t\tif (table === void 0) return void 0;\n\t\treturn \"field\" in coordinate ? {\n\t\t\ttable,\n\t\t\tcolumn: fieldColumn(contract, coordinate)\n\t\t} : {\n\t\t\ttable,\n\t\t\tcolumn: void 0\n\t\t};\n\t}\n\t/** The destination table of an origin model, through the renames: `undefined` when the destination removes the model. */\n\tdestinationTableOf(model) {\n\t\tconst rename = this.#renameFrom(model);\n\t\treturn rename === void 0 ? void 0 : modelTable(this.#contract, rename.to);\n\t}\n\t/** The origin table of a destination model, through the renames: `undefined` for a new model. */\n\toriginTableOf(model) {\n\t\tconst rename = this.#renameTo(model);\n\t\treturn rename === void 0 ? void 0 : modelTable(this.#fromContract, rename.from);\n\t}\n\t/**\n\t* Why the rows of table `origin` cannot move whole to table `destination`: an origin model stored\n\t* in it that the destination keeps in another table, or a destination model stored in the new\n\t* table, as the target compares names, whose origin model is stored elsewhere. Models pair through\n\t* the renames. `undefined` when the whole table moves, and nothing else moves there. A model the\n\t* destination removes, or a new model, blocks nothing.\n\t*/\n\tsharedTable(change) {\n\t\tconst split = this.originModelsIn(change.origin).filter((model) => {\n\t\t\tconst destination = this.destinationTableOf(model);\n\t\t\treturn destination !== void 0 && !sameTable(destination, change.destination);\n\t\t});\n\t\tif (split.length > 0) return {\n\t\t\tkind: \"split\",\n\t\t\tobjects: split\n\t\t};\n\t\tconst merged = this.destinationModelsIn(change.destination).flatMap((model) => {\n\t\t\tconst rename = this.#renameTo(model);\n\t\t\tconst origin = rename === void 0 ? void 0 : modelTable(this.#fromContract, rename.from);\n\t\t\treturn origin !== void 0 && rename !== void 0 && !sameTable(origin, change.origin) ? [rename.from] : [];\n\t\t});\n\t\treturn merged.length > 0 ? {\n\t\t\tkind: \"merged\",\n\t\t\tobjects: merged\n\t\t} : void 0;\n\t}\n\t/**\n\t* Why the change cannot rename its column: an origin field stored in it that the destination\n\t* keeps in another column, or a destination field stored in the new column, as the target\n\t* compares names, whose origin field is stored elsewhere. `undefined` when the whole column\n\t* moves, and nothing else moves there.\n\t*/\n\tsharedColumn(change) {\n\t\tconst split = fieldsStoring(this.#fromContract, change.origin, change.from, this.sameName).filter((field) => {\n\t\t\tconst rename = this.#renameFrom(field);\n\t\t\tconst destination = rename === void 0 ? void 0 : this.#storedIn(this.#contract, rename.to);\n\t\t\treturn destination?.column !== void 0 && (!sameTable(destination.table, change.destination) || destination.column !== change.to);\n\t\t});\n\t\tif (split.length > 0) return {\n\t\t\tkind: \"split\",\n\t\t\tobjects: split\n\t\t};\n\t\tconst merged = fieldsStoring(this.#contract, change.destination, change.to, this.sameName).flatMap((field) => {\n\t\t\tconst rename = this.#renameTo(field);\n\t\t\tconst origin = rename === void 0 ? void 0 : this.#storedIn(this.#fromContract, rename.from);\n\t\t\treturn rename !== void 0 && \"field\" in rename.from && origin?.column !== void 0 && (!sameTable(origin.table, change.origin) || origin.column !== change.from) ? [rename.from] : [];\n\t\t});\n\t\treturn merged.length > 0 ? {\n\t\t\tkind: \"merged\",\n\t\t\tobjects: merged\n\t\t} : void 0;\n\t}\n\t/**\n\t* A name for `name` to move through that no table of the namespace has in either contract, and\n\t* that is not one of `reserved`, as the target compares names.\n\t*/\n\tunusedTableName(namespaceId, name, reserved = []) {\n\t\tconst used = [this.#fromContract, this.#contract].flatMap((contract) => Object.keys(contract.storage.namespaces[namespaceId]?.entries.table ?? {}));\n\t\treturn this.#unused([...used, ...reserved], name);\n\t}\n\t/**\n\t* A name for `name` to move through that no column of the change's table has in either\n\t* contract, and that is not one of `reserved`, as the target compares names.\n\t*/\n\tunusedColumnName(change, name, reserved = []) {\n\t\tconst columnsOf = (contract, table) => Object.keys(contract.storage.namespaces[table.namespaceId]?.entries.table?.[table.table]?.columns ?? {});\n\t\treturn this.#unused([\n\t\t\t...columnsOf(this.#fromContract, change.origin),\n\t\t\t...columnsOf(this.#contract, change.destination),\n\t\t\t...reserved\n\t\t], name);\n\t}\n\t#unused(used, name) {\n\t\tlet candidate = `prisma_swap_${name}`;\n\t\twhile (used.some((existing) => this.sameName(existing, candidate))) candidate = `${candidate}_`;\n\t\treturn candidate;\n\t}\n\t/** Whether the origin contract has `table`, as the target compares names. */\n\toriginHasTable(table) {\n\t\tconst tables = this.#fromContract.storage.namespaces[table.namespaceId]?.entries.table ?? {};\n\t\treturn Object.keys(tables).some((name) => this.sameName(name, table.table));\n\t}\n\t/** Whether the origin contract has `column` on `table`, as the target compares names. */\n\toriginHasColumn(table, column) {\n\t\tconst stored = this.#fromContract.storage.namespaces[table.namespaceId]?.entries.table?.[table.table];\n\t\treturn Object.keys(stored?.columns ?? {}).some((name) => this.sameName(name, column));\n\t}\n\t/** The models of the origin contract stored in `table`, as the target compares names. */\n\toriginModelsIn(table) {\n\t\treturn modelsStoring(this.#fromContract, table, this.sameName).map(({ coordinate }) => coordinate);\n\t}\n\t/** The models of the destination contract stored in `table`, as the target compares names. */\n\tdestinationModelsIn(table) {\n\t\treturn modelsStoring(this.#contract, table, this.sameName).map(({ coordinate }) => coordinate);\n\t}\n\t/** The fields of the origin contract stored in `column` of `table`, as the target compares names. */\n\toriginFieldsIn(table, column) {\n\t\treturn fieldsStoring(this.#fromContract, table, column, this.sameName);\n\t}\n};\n/** What a table or column change does, in words: the contract change, or the statement that asks for it. */\nfunction tableChangeText(change) {\n\tconst stated = change.renames.find((rename) => rename.statement !== void 0);\n\tif (stated !== void 0) return `model \"${modelDisplayName(stated.from)}\" is renamed to \"${modelDisplayName(stated.to)}\", which renames table \"${change.origin.table}\" to \"${change.destination.table}\"`;\n\treturn `the table of ${modelsText(change.renames.map((rename) => rename.from))} changes from \"${change.origin.table}\" to \"${change.destination.table}\"`;\n}\nfunction columnChangeText(change) {\n\tconst stated = change.renames.find((rename) => rename.statement !== void 0);\n\tif (stated !== void 0) return `field \"${fieldDisplayName(stated.from)}\" is renamed to \"${fieldDisplayName(stated.to)}\", which renames column \"${change.from}\" to \"${change.to}\"`;\n\treturn `the column of ${fieldsText(change.renames.map((rename) => rename.from))} changes from \"${change.from}\" to \"${change.to}\"`;\n}\n/**\n* The route that works on both commands for a chain or swap of names: a plan that moves each\n* object to a name nothing uses, then a plan that moves it to its final name.\n*/\nfunction temporaryNamesRoute(noun, moves, withStatements) {\n\tconst give = (name) => joinedList(moves.map((move) => `${move.objects} the ${noun} \"${name(move)}\"`));\n\treturn `Make the change in two plans: first give ${give(({ through }) => through)}, ${noun}s nothing uses, and plan and apply that${withStatements ? \" with the same statements\" : \"\"}; then give ${give(({ to }) => to)}, and plan again${withStatements ? \" without them\" : \"\"}.`;\n}\n/**\n* The changes of `pair` and every change of `changes` linked to them by a name one frees and\n* another takes, in either direction. All of them must move through names nothing uses before any\n* takes its final name. The order is `pair`, then the changes after it in the chain, then those\n* before it.\n*/\nfunction linkedChanges(pair, changes, takesFrom) {\n\tconst linked = [...pair];\n\tfor (const current of linked) for (const other of changes) {\n\t\tif (linked.includes(other)) continue;\n\t\tif (takesFrom(current, other) || takesFrom(other, current)) linked.push(other);\n\t}\n\tconst ordered = [...pair];\n\tconst follow = (from, step) => {\n\t\tfor (let next = step(from); next !== void 0 && !ordered.includes(next); next = step(next)) ordered.push(next);\n\t};\n\tfollow(pair[1], (change) => linked.find((other) => takesFrom(change, other)));\n\tfollow(pair[0], (change) => linked.find((other) => takesFrom(other, change)));\n\treturn [...ordered, ...linked.filter((change) => !ordered.includes(change))];\n}\nfunction tableRoute(pair, changes, renames) {\n\tconst linked = linkedChanges(pair, changes, (taker, freer) => taker.destination.namespaceId === freer.origin.namespaceId && renames.sameName(taker.destination.table, freer.origin.table));\n\tconst reserved = [];\n\treturn temporaryNamesRoute(\"table\", linked.map((moving) => {\n\t\tconst { namespaceId, table } = moving.destination;\n\t\tconst through = renames.unusedTableName(namespaceId, table, reserved.filter((name) => name.namespaceId === namespaceId).map(({ name }) => name));\n\t\treserved.push({\n\t\t\tnamespaceId,\n\t\t\tname: through\n\t\t});\n\t\treturn {\n\t\t\tobjects: modelsText(moving.renames.map((rename) => rename.to)),\n\t\t\tthrough,\n\t\t\tto: table\n\t\t};\n\t}), linked.some(hasStatement));\n}\nfunction columnRoute(pair, changes, renames) {\n\tconst linked = linkedChanges(pair, changes, (taker, freer) => renames.sameName(taker.to, freer.from));\n\tconst reserved = [];\n\treturn temporaryNamesRoute(\"column\", linked.map((moving) => {\n\t\tconst through = renames.unusedColumnName(moving, moving.to, reserved);\n\t\treserved.push(through);\n\t\treturn {\n\t\t\tobjects: fieldsText(moving.renames.map((rename) => rename.to)),\n\t\t\tthrough,\n\t\t\tto: moving.to\n\t\t};\n\t}), linked.some(hasStatement));\n}\nconst ORDER = \"A rename onto a name another rename frees, or takes, needs an order or a temporary name that the plan does not work out\";\n/**\n* Refuses a rename. With the statement that asks for it, the conflict carries the statement; a\n* rename no statement asks for is refused as a contract change the plan cannot make, and its text\n* names that change.\n*/\nfunction renameRefused(statement, summary, why, location, refusedOperationClass) {\n\treturn {\n\t\t...statement === void 0 ? { kind: \"unsupportedOperation\" } : {\n\t\t\tkind: \"statementRefused\",\n\t\t\trefusedStatement: statement\n\t\t},\n\t\tsummary,\n\t\twhy,\n\t\t...refusedOperationClass === void 0 ? {} : { refusedOperationClass },\n\t\t...location === void 0 ? {} : { location: {\n\t\t\tnamespaceId: location.namespaceId,\n\t\t\tentityKind: \"table\",\n\t\t\tentityName: location.table,\n\t\t\t...location.column === void 0 ? {} : { column: location.column }\n\t\t} }\n\t};\n}\nfunction contractChangeRefused(summary, why, location) {\n\treturn renameRefused(void 0, summary, why, location);\n}\nfunction hasStatement(change) {\n\treturn change.renames.some((rename) => rename.statement !== void 0);\n}\n/** How the first of two plans frees a name: it removes what the origin stores there, or the table or column itself when nothing is. */\nfunction freeName(kind, held, holders, unused) {\n\tif (holders.count === 0) return `remove ${kind} \"${held}\" or give it a name nothing uses, such as \"${unused}\"`;\n\tconst [them, their] = holders.count === 1 ? [\"it\", \"its\"] : [\"them\", \"their\"];\n\treturn `remove ${holders.text}, or keep ${them} and change ${their} ${kind} to a name nothing uses, such as \"${unused}\"`;\n}\n/**\n* Refuses a table rename that no statement asks for when it swaps, chains or merges with another\n* rename, or moves onto a name the schema being planned from already has. Names compare the way\n* the target compares them, through `tables`.\n*/\nfunction tableRenameConflict(change, current, changes, tables, renames) {\n\tconst { namespaceId } = change.origin;\n\tconst from = change.origin.table;\n\tconst to = change.destination.table;\n\tconst label = `Cannot rename table \"${from}\" to \"${to}\"`;\n\tconst location = change.origin;\n\tconst changeText = capitalized(tableChangeText(change));\n\tconst movingModels = modelsText(change.renames.map((rename) => rename.from));\n\tconst misread = (table) => `rows of table \"${table}\" as rows of ${movingModels}`;\n\tconst others = changes.filter((other) => other !== change);\n\tconst { sameName } = renames;\n\tconst [held] = tables.tablesNamed(namespaceId, to).filter((table) => !sameName(table, from) && table !== current);\n\tif (held !== void 0) {\n\t\tconst heldTable = {\n\t\t\tnamespaceId,\n\t\t\ttable: held\n\t\t};\n\t\tconst moved = others.find((other) => other.origin.namespaceId === namespaceId && sameName(other.origin.table, held));\n\t\tif (moved !== void 0) return contractChangeRefused(`${label}: table \"${held}\" is renamed in the same plan`, `${changeText}, and ${tableChangeText(moved)}. ${ORDER}, and without the renames the plan would read the ${misread(held)}. ${tableRoute([change, moved], others, renames)}`, location);\n\t\tif (!renames.originHasTable(heldTable)) return contractChangeRefused(`${label}: the database has both tables`, `${changeText}, and the database has both table \"${from}\" and table \"${held}\". One of two things happened, and each has its own fix. If the rename was half done by hand, or something created table \"${held}\" before db update ran, table \"${from}\" holds the rows of ${movingModels}: move into table \"${from}\" the rows of table \"${held}\" that it does not already hold, and where both tables hold a row with the same key, keep the version you want in table \"${from}\"; then drop table \"${held}\", and run again. If table \"${from}\" was renamed to \"${held}\" by hand and the name \"${from}\" then used for another table, table \"${held}\" holds the rows of ${movingModels}: drop table \"${from}\", and run again; to keep the rows of that other table, first move them into a table the contract has, since db update drops every table the contract does not have.`, location);\n\t\tconst holders = renames.originModelsIn(heldTable);\n\t\treturn contractChangeRefused(`${label}: the schema being planned from already has a table \"${to}\"${held === to ? \"\" : `, as \"${held}\"`}`, `${changeText}, and the schema being planned from already has table \"${held}\"${holders.length === 0 ? \"\" : `, the table of ${modelsText(holders)}`}. Without the rename the plan would read the ${misread(held)}. Make the change in two plans: first ${freeName(\"table\", held, {\n\t\t\ttext: modelsText(holders),\n\t\t\tcount: holders.length\n\t\t}, renames.unusedTableName(namespaceId, held))}, and plan and apply that; then make this change and plan again.`, location);\n\t}\n\tconst takes = others.find((other) => hasStatement(other) && other.destination.namespaceId === change.destination.namespaceId && sameName(other.destination.table, from));\n\tif (takes !== void 0) return contractChangeRefused(`${label}: another rename in the same plan takes table name \"${takes.destination.table}\"`, `${changeText}, and ${tableChangeText(takes)}. ${ORDER}. ${tableRoute([change, takes], others, renames)}`, location);\n}\nfunction columnRenameConflict(change, table, current, changes, tables, renames) {\n\tconst { namespaceId } = change.origin;\n\tconst label = `Cannot rename column \"${table}\".\"${change.from}\" to \"${change.to}\"`;\n\tconst location = {\n\t\tnamespaceId,\n\t\ttable,\n\t\tcolumn: change.from\n\t};\n\tconst changeText = capitalized(columnChangeText(change));\n\tconst movingFields = fieldsText(change.renames.map((rename) => rename.from));\n\tconst misread = (column) => `values of column \"${column}\" as values of ${movingFields}`;\n\tconst others = changes.filter((other) => other !== change && sameTable(other.origin, change.origin));\n\tconst { sameName } = renames;\n\tconst [held] = tables.columnsNamed(namespaceId, table, change.to).filter((column) => !sameName(column, change.from) && column !== current);\n\tif (held !== void 0) {\n\t\tconst moved = others.find((other) => sameName(other.from, held));\n\t\tif (moved !== void 0) return contractChangeRefused(`${label}: column \"${held}\" is renamed in the same plan`, `${changeText}, and ${columnChangeText(moved)}. ${ORDER}, and without the renames the plan would read the ${misread(held)}. ${columnRoute([change, moved], others, renames)}`, location);\n\t\tif (!renames.originHasColumn(change.origin, held)) return contractChangeRefused(`${label}: the database has both columns`, `${changeText}, and table \"${table}\" in the database has both column \"${change.from}\" and column \"${held}\". One of two things happened, and each has its own fix. If the rename was half done by hand, or something created column \"${held}\" before db update ran, column \"${change.from}\" holds the values of ${movingFields}: copy into column \"${change.from}\" the value of column \"${held}\" in each row where column \"${held}\" holds one and column \"${change.from}\" holds none, and where both hold a value, keep the one you want in column \"${change.from}\"; then drop column \"${held}\", and run again. If column \"${change.from}\" was renamed to \"${held}\" by hand and the name \"${change.from}\" then used for another column, column \"${held}\" holds the values of ${movingFields}: drop column \"${change.from}\", and run again; to keep the values of that other column, first move them into a column the contract has, since db update drops every column the contract does not have.`, location);\n\t\tconst holders = renames.originFieldsIn(change.origin, held);\n\t\treturn contractChangeRefused(`${label}: the schema being planned from already has a column \"${change.to}\" on table \"${table}\"${held === change.to ? \"\" : `, as \"${held}\"`}`, `${changeText}, and the schema being planned from already has column \"${held}\" on table \"${table}\"${holders.length === 0 ? \"\" : `, the column of ${fieldsText(holders)}`}. Without the rename the plan would read the ${misread(held)}. Make the change in two plans: first ${freeName(\"column\", held, {\n\t\t\ttext: fieldsText(holders),\n\t\t\tcount: holders.length\n\t\t}, renames.unusedColumnName(change, held))}, and plan and apply that; then make this change and plan again.`, location);\n\t}\n\tconst takes = others.find((other) => hasStatement(other) && sameName(other.to, change.from));\n\tif (takes !== void 0) return contractChangeRefused(`${label}: another rename in the same plan takes column name \"${takes.to}\"`, `${changeText}, and ${columnChangeText(takes)}. ${ORDER}. ${columnRoute([change, takes], others, renames)}`, location);\n}\nfunction foundName(found, matches) {\n\treturn found.find(({ change }) => matches(change))?.name;\n}\n/**\n* The name the table of a column change has in the schema being planned from: its origin name\n* when the table stays or is renamed from it, the name the schema has it under when that differs,\n* and `undefined` when the plan does not move the table.\n*/\nfunction columnTableInSchema(change, tables, foundTables, renames) {\n\tif (renames.inPlace(change.origin, change.destination)) return change.origin.table;\n\tconst matches = (table) => sameTable(table.origin, change.origin) && sameTable(table.destination, change.destination);\n\tconst found = foundName(foundTables, matches);\n\tif (found !== void 0) return found;\n\treturn tables.some(matches) ? change.origin.table : void 0;\n}\n/**\n* Checks every rename that no statement asks for against all the renames of the plan, before any\n* is applied, and returns the first that cannot be planned.\n*/\nfunction storageRenameConflict(planned, tables, renames) {\n\tfor (const change of planned.tables) {\n\t\tif (hasStatement(change)) continue;\n\t\tconst conflict = tableRenameConflict(change, foundName(planned.foundTables, (found) => found === change), planned.tables, tables, renames);\n\t\tif (conflict !== void 0) return conflict;\n\t}\n\tfor (const change of planned.columns) {\n\t\tif (hasStatement(change)) continue;\n\t\tconst table = columnTableInSchema(change, planned.tables, planned.foundTables, renames);\n\t\tif (table === void 0) continue;\n\t\tconst conflict = columnRenameConflict(change, table, foundName(planned.foundColumns, (found) => found === change), planned.columns, tables, renames);\n\t\tif (conflict !== void 0) return conflict;\n\t}\n}\n/**\n* What the plan does for a change no statement asks for, from what the schema being planned from\n* has, as the target compares names: `current`, the name it has for the old one, and `held`, a\n* name it has for the new one that is not the old one. With the old name, the plan renames it from\n* `current`, unless `current` is the new name already. With only the new name, the rename is already\n* done, and a rename gives it the contract's case; when the origin contract has that name too, it is a\n* rename, which the conflict check refuses. With neither, nothing is planned.\n*/\nfunction disposition(to, current, held, originHasHeld) {\n\tif (current !== void 0) return current === to ? {\n\t\tkind: \"alreadyDone\",\n\t\tfound: current\n\t} : {\n\t\tkind: \"rename\",\n\t\tfound: current\n\t};\n\tif (held === void 0) return { kind: \"none\" };\n\tif (originHasHeld(held)) return {\n\t\tkind: \"rename\",\n\t\tfound: void 0\n\t};\n\treturn held === to ? {\n\t\tkind: \"alreadyDone\",\n\t\tfound: held\n\t} : {\n\t\tkind: \"rename\",\n\t\tfound: held\n\t};\n}\n/**\n* The renames the plan makes: every change a statement asks for, and each change no statement\n* asks for whose whole table or column moves, whose control policy is `managed` in both\n* contracts, and whose old table or column the schema being planned from has, under the old name\n* or one the target takes for it. A change whose new name the schema has in place of the old one is\n* already done. A column change on a table that changes needs the table change planned or already\n* done.\n*/\nfunction plannedStorageRenames(renames, tables) {\n\tconst { sameName } = renames;\n\tconst plannedTables = [];\n\tconst foundTables = [];\n\tconst record = (change, from, outcome, planned, found) => {\n\t\tif (outcome.kind === \"none\") return;\n\t\tif (outcome.kind === \"rename\") planned.push(change);\n\t\tif (outcome.found !== void 0 && outcome.found !== from) found.push({\n\t\t\tchange,\n\t\t\tname: outcome.found\n\t\t});\n\t};\n\tfor (const change of renames.tableChanges) {\n\t\tif (hasStatement(change)) {\n\t\t\tplannedTables.push(change);\n\t\t\tcontinue;\n\t\t}\n\t\tif (renames.namespaceAfterRenames(change.origin.namespaceId) !== change.destination.namespaceId || !renames.managedOnBothSides(change) || renames.sharedTable(change) !== void 0) continue;\n\t\tconst { namespaceId, table: from } = change.origin;\n\t\tconst to = change.destination.table;\n\t\tconst [current] = tables.tablesNamed(namespaceId, from);\n\t\tconst [held] = tables.tablesNamed(namespaceId, to).filter((table) => !sameName(table, from));\n\t\trecord(change, from, disposition(to, current, held, (name) => renames.originHasTable({\n\t\t\tnamespaceId,\n\t\t\ttable: name\n\t\t})), plannedTables, foundTables);\n\t}\n\tconst plannedColumns = [];\n\tconst foundColumns = [];\n\tfor (const change of renames.columnChanges) {\n\t\tif (hasStatement(change)) {\n\t\t\tplannedColumns.push(change);\n\t\t\tcontinue;\n\t\t}\n\t\tconst table = columnTableInSchema(change, plannedTables, foundTables, renames);\n\t\tif (table === void 0 || !renames.managedOnBothSides(change) || renames.sharedColumn(change) !== void 0) continue;\n\t\tconst { namespaceId } = change.origin;\n\t\tconst [current] = tables.columnsNamed(namespaceId, table, change.from);\n\t\tconst [held] = tables.columnsNamed(namespaceId, table, change.to).filter((column) => !sameName(column, change.from));\n\t\tconst outcome = disposition(change.to, current, held, (name) => renames.originHasColumn(change.origin, name));\n\t\trecord(change, change.from, outcome, plannedColumns, foundColumns);\n\t}\n\treturn {\n\t\ttables: plannedTables,\n\t\tcolumns: plannedColumns,\n\t\tfoundTables,\n\t\tfoundColumns\n\t};\n}\n//#endregion\n//#region src/core/migrations/statement-planning.ts\n/**\n* The storage effect of a model rename: the origin model's table compared with the destination\n* model's. Equal tables mean the rename needs no storage change.\n*/\nfunction modelRenameStorageEffect(statement, fromContract, contract) {\n\tconst from = modelTable(fromContract, statement.from);\n\tif (from === void 0) return notOk({\n\t\tkind: \"noTable\",\n\t\tmodel: statement.from\n\t});\n\tconst to = modelTable(contract, statement.to);\n\tif (to === void 0) return notOk({\n\t\tkind: \"noTable\",\n\t\tmodel: statement.to\n\t});\n\tif (from.namespaceId !== to.namespaceId) return ok({\n\t\tkind: \"moveNamespace\",\n\t\tfrom,\n\t\tto\n\t});\n\tif (from.table === to.table) return ok({ kind: \"unchanged\" });\n\treturn ok({\n\t\tkind: \"renameTable\",\n\t\trename: {\n\t\t\tnamespaceId: from.namespaceId,\n\t\t\tfrom: from.table,\n\t\t\tto: to.table\n\t\t}\n\t});\n}\n/**\n* The storage effect of a field rename: the origin field's column compared with the destination\n* field's. A relation field has no column on either side, and equal columns need no change.\n*/\nfunction fieldRenameStorageEffect(statement, fromContract, contract) {\n\tconst table = modelTable(fromContract, statement.from);\n\tif (table === void 0) return notOk({\n\t\tkind: \"noTable\",\n\t\tmodel: statement.from\n\t});\n\tconst from = fieldColumn(fromContract, statement.from);\n\tconst to = fieldColumn(contract, statement.to);\n\tif (from === void 0 && to === void 0) return ok({ kind: \"unchanged\" });\n\tif (from === void 0 || to === void 0) return notOk({ kind: \"columnOnOneSide\" });\n\tif (from === to) return ok({ kind: \"unchanged\" });\n\treturn ok({\n\t\tkind: \"renameColumn\",\n\t\ttable,\n\t\tfrom,\n\t\tto\n\t});\n}\nfunction operationsOf(call) {\n\treturn [call, ...call.companions];\n}\n/** The origins of a plan whose statements renamed and moved nothing. */\nconst NO_RENAMED_ORIGINS = {\n\toriginTable: (current) => current,\n\toriginColumn: (_origin, column) => column\n};\nconst PLANNED_WITH_DIFF = { kind: \"plannedWithDiff\" };\nfunction plannedAt(operationIndexes) {\n\treturn {\n\t\tkind: \"planned\",\n\t\toperationIndexes\n\t};\n}\nconst DRIFTED = \"so the database has drifted from that contract. Inspect it with prisma db schema, or leave out this statement.\";\nconst UNMATCHED = \"A statement plans the rename a hand-written rename call makes, and that call does not match the contracts. Leave out this statement.\";\nfunction leaveOutShared(moving) {\n\treturn `Leave out this statement to plan the change without moving them: the plan then asks about the data it drops. A question about ${moving} offers this same rename again, which is refused again for the same reason. Answer it with --delete, which it also offers: that plans the change and deletes the data.`;\n}\nconst HAND_WRITTEN_WITH_MIGRATION_PLAN = \"To keep the data with migration plan, write this change as a hand-written migration instead: \";\nfunction tableKey(table) {\n\treturn JSON.stringify([table.namespaceId, table.table]);\n}\n/** A contract space other than the one planned that declares the namespace, if any. */\nfunction otherSpaceDeclaring(ownership, namespaceId) {\n\treturn (ownership.oracle?.namespaceDeclaringSpaces(namespaceId) ?? []).find((spaceId) => spaceId !== ownership.spaceId);\n}\nfunction withoutNamespacesRefused(statement, label) {\n\treturn renameRefused(statement, `${label}: the database target keeps every table in one namespace`, \"This database target has no namespaces, so a statement cannot rename a namespace or move a model to another one. Leave out this statement.\", void 0);\n}\nfunction namespaceText(namespaceId) {\n\treturn namespaceId === UNBOUND_NAMESPACE_ID ? \"the unbound namespace\" : `namespace \"${namespaceId}\"`;\n}\nfunction qualifiedTable(table) {\n\treturn table.namespaceId === UNBOUND_NAMESPACE_ID ? table.table : `${table.namespaceId}.${table.table}`;\n}\nfunction tableRenameRefused(statement, label, rename, mismatch) {\n\tswitch (mismatch.kind) {\n\t\tcase \"tableMissing\": return renameRefused(statement, `${label}: the schema being planned from has no table \"${rename.from}\"`, `The database has no table \"${rename.from}\", although the contract it was last updated to names it, ${DRIFTED}`, {\n\t\t\tnamespaceId: rename.namespaceId,\n\t\t\ttable: rename.from\n\t\t});\n\t\tcase \"nameTaken\": return renameRefused(statement, `${label}: the schema being planned from already has a table \"${rename.to}\"${mismatch.taken === rename.to ? \"\" : `, as \"${mismatch.taken}\"`}`, `A rename cannot replace a table that already exists. Rename or drop table \"${mismatch.taken}\" first, or leave out this statement.`, {\n\t\t\tnamespaceId: rename.namespaceId,\n\t\t\ttable: rename.to\n\t\t});\n\t\tcase \"tableInManyNamespaces\":\n\t\tcase \"notInEndContract\": return renameRefused(statement, `${label}: ${tableRenameMismatchReason(rename, mismatch)}`, UNMATCHED, {\n\t\t\tnamespaceId: rename.namespaceId,\n\t\t\ttable: rename.from\n\t\t});\n\t}\n}\nfunction columnRenameRefused(statement, label, rename, mismatch) {\n\tconst table = {\n\t\tnamespaceId: rename.namespaceId,\n\t\ttable: rename.table\n\t};\n\tswitch (mismatch.kind) {\n\t\tcase \"tableMissing\": return renameRefused(statement, `${label}: the schema being planned from has no table \"${rename.table}\"`, `The database has no table \"${rename.table}\", although the contract it was last updated to names it, ${DRIFTED}`, table);\n\t\tcase \"columnMissing\": return renameRefused(statement, `${label}: the schema being planned from has no column \"${rename.from}\" on table \"${rename.table}\"`, `The database has no column \"${rename.from}\" on table \"${rename.table}\", although the contract it was last updated to names it, ${DRIFTED}`, {\n\t\t\t...table,\n\t\t\tcolumn: rename.from\n\t\t});\n\t\tcase \"nameTaken\": return renameRefused(statement, `${label}: the schema being planned from already has a column \"${mismatch.taken}\" on table \"${rename.table}\"`, `A rename cannot replace a column that already exists. Rename or drop column \"${mismatch.taken}\" of table \"${rename.table}\" first, or leave out this statement.`, {\n\t\t\t...table,\n\t\t\tcolumn: rename.to\n\t\t});\n\t\tcase \"tableInManyNamespaces\":\n\t\tcase \"notInEndContract\": return renameRefused(statement, `${label}: ${columnRenameMismatchReason(rename, mismatch)}`, UNMATCHED, {\n\t\t\t...table,\n\t\t\tcolumn: rename.from\n\t\t});\n\t}\n}\nfunction planned(operationIndexes) {\n\treturn operationIndexes.ok ? ok(plannedAt(operationIndexes.value)) : operationIndexes;\n}\nvar StatementPlanner = class {\n\t#fromContract;\n\t#contract;\n\t#policy;\n\t#target;\n\t/** Where each table renamed or moved so far is in the working schema, keyed by its origin place. */\n\t#renamedTables = /* @__PURE__ */ new Map();\n\t/** The origin place of each table renamed or moved so far, keyed as `#renamedTables`. */\n\t#originTables = /* @__PURE__ */ new Map();\n\t/** Each column renamed so far, keyed by its origin table and origin name: its name now. */\n\t#renamedColumns = /* @__PURE__ */ new Map();\n\t/** The name each namespace renamed so far has in the working schema, keyed by its origin name. */\n\t#renamedNamespaces = /* @__PURE__ */ new Map();\n\t#ownership;\n\t#storageRenames;\n\tcalls = [];\n\t/** How many operations the calls planned so far lower to. */\n\t#operationCount = 0;\n\ttableRenames = [];\n\tcolumnRenames = [];\n\tconstructor(input) {\n\t\tthis.#fromContract = input.fromContract;\n\t\tthis.#contract = input.contract;\n\t\tthis.#policy = input.policy;\n\t\tthis.#target = input.target;\n\t\tthis.#ownership = input.ownership;\n\t\tthis.#storageRenames = input.storageRenames;\n\t}\n\t/** Renames a table no statement asks for, where it is in the working schema now. */\n\tplanTableChange(change) {\n\t\tconst current = this.#current(change.origin);\n\t\treturn this.#renameTable({\n\t\t\tstatement: void 0,\n\t\t\tchange: tableChangeText(change)\n\t\t}, `Cannot rename table \"${current.table}\" to \"${change.destination.table}\"`, change.origin, {\n\t\t\tnamespaceId: current.namespaceId,\n\t\t\tfrom: current.table,\n\t\t\tto: change.destination.table\n\t\t});\n\t}\n\t/** Renames a column no statement asks for, as the working schema has it and its table now. */\n\tplanColumnChange(change) {\n\t\tconst current = this.#current(change.origin);\n\t\tconst from = this.#currentColumn(change.origin, change.from);\n\t\treturn this.#renameColumn({\n\t\t\tstatement: void 0,\n\t\t\tchange: columnChangeText(change)\n\t\t}, `Cannot rename column \"${current.table}\".\"${from}\" to \"${change.to}\"`, change.origin, change.from, {\n\t\t\tnamespaceId: current.namespaceId,\n\t\t\ttable: current.table,\n\t\t\tfrom,\n\t\t\tto: change.to\n\t\t});\n\t}\n\t/**\n\t* Records that the working schema has the table of a change no statement asks for as `table`:\n\t* later renames and questions find it there, as after a planned rename.\n\t*/\n\trecordTableFound(change, table) {\n\t\tconst current = this.#current(change.origin);\n\t\tthis.#renamedTables.set(tableKey(change.origin), {\n\t\t\tnamespaceId: current.namespaceId,\n\t\t\ttable\n\t\t});\n\t\tthis.#originTables.set(tableKey(change.origin), change.origin);\n\t\treturn ok([]);\n\t}\n\t/** Records that the working schema has the column of a change no statement asks for as `column`. */\n\trecordColumnFound(change, column) {\n\t\tthis.#recordColumn(change.origin, change.from, column);\n\t\treturn ok([]);\n\t}\n\t/** Plans one statement; the result is the operations it accounts for. */\n\tplan(statement) {\n\t\tswitch (statement.entity) {\n\t\t\tcase \"namespace\": return planned(this.#planNamespace(statement));\n\t\t\tcase \"model\": return planned(this.#planModel(statement));\n\t\t\tcase \"field\": return planned(this.#planField(statement));\n\t\t\tcase \"enumValue\":\n\t\t\tcase \"valueObjectField\": return ok(PLANNED_WITH_DIFF);\n\t\t}\n\t}\n\t#recordColumn(origin, from, to) {\n\t\tthis.#renamedColumns.set(JSON.stringify([tableKey(origin), from]), {\n\t\t\torigin,\n\t\t\tfrom,\n\t\t\tto\n\t\t});\n\t}\n\t/** The name a column of an origin table has in the working schema, after the renames planned so far. */\n\t#currentColumn(origin, column) {\n\t\treturn this.#renamedColumns.get(JSON.stringify([tableKey(origin), column]))?.to ?? column;\n\t}\n\t/** Where a table of the origin is in the working schema, after the renames planned so far. */\n\t#current(origin) {\n\t\tconst table = this.#renamedTables.get(tableKey(origin)) ?? origin;\n\t\treturn {\n\t\t\tnamespaceId: this.#renamedNamespaces.get(table.namespaceId) ?? table.namespaceId,\n\t\t\ttable: table.table\n\t\t};\n\t}\n\t#planNamespace(statement) {\n\t\tconst rename = {\n\t\t\tfrom: statement.from,\n\t\t\tto: statement.to\n\t\t};\n\t\tconst label = `Cannot rename namespace \"${rename.from}\" to \"${rename.to}\"`;\n\t\tconst namespaces = this.#target.namespaces;\n\t\tif (namespaces === void 0) return notOk(withoutNamespacesRefused(statement, label));\n\t\tconst movePerModel = `--rename ${rename.from}.<Model>:${rename.to}.<Model>`;\n\t\tconst refusal = namespaces.namespaceRenameRefusal(rename);\n\t\tif (refusal !== void 0) return notOk(renameRefused(statement, `${label}: ${refusal.reason}`, refusal.fix, void 0));\n\t\tconst otherSpace = this.#ownership === void 0 ? void 0 : otherSpaceDeclaring(this.#ownership, rename.from);\n\t\tif (otherSpace !== void 0) return notOk(renameRefused(statement, `${label}: contract space \"${otherSpace}\" also declares it`, `Renaming the namespace would rename it under contract space \"${otherSpace}\" too, whose contract still names it \"${rename.from}\". Leave out this statement, or move each model with ${movePerModel} instead.`, void 0));\n\t\tconst tables = Object.keys(this.#contract.storage.namespaces[rename.to]?.entries.table ?? {});\n\t\tfor (const table of tables) {\n\t\t\tconst controlPolicy = tableControlPolicy(this.#contract, {\n\t\t\t\tnamespaceId: rename.to,\n\t\t\t\ttable\n\t\t\t});\n\t\t\tif (controlPolicy === \"managed\") continue;\n\t\t\treturn notOk(renameRefused(statement, `${label}: table \"${table}\" has control policy \"${controlPolicy}\"`, `Statements rename only namespaces whose tables all have control policy \"managed\"; table \"${table}\" is \"${controlPolicy}\". Make the change in the database yourself and leave out this statement.`, {\n\t\t\t\tnamespaceId: rename.to,\n\t\t\t\ttable\n\t\t\t}));\n\t\t}\n\t\tconst schemaTables = this.#target.tables();\n\t\tif (!schemaTables.hasNamespace(rename.from)) return notOk(renameRefused(statement, `${label}: the schema being planned from has no namespace \"${rename.from}\"`, `The database has no namespace \"${rename.from}\", although the contract it was last updated to names it, ${DRIFTED}`, void 0));\n\t\tif (schemaTables.hasNamespace(rename.to)) return notOk(renameRefused(statement, `${label}: the database already has a namespace \"${rename.to}\"`, `The database already has a namespace \"${rename.to}\", which the contract it was last updated to does not declare. If it holds nothing, drop or rename it in the database yourself; otherwise move each model with ${movePerModel} instead of this statement.`, void 0));\n\t\tconst planned = this.#emit({ statement }, label, void 0, namespaces.renameNamespaceCall(rename));\n\t\tif (planned.ok) this.#renamedNamespaces.set(rename.from, rename.to);\n\t\treturn planned;\n\t}\n\t#controlPolicyRefusal(statement, label, destinationTable) {\n\t\tconst controlPolicy = tableControlPolicy(this.#contract, destinationTable);\n\t\tif (controlPolicy === \"managed\") return void 0;\n\t\treturn renameRefused(statement, `${label}: the table's control policy is \"${controlPolicy}\"`, `Statements rename only tables, and columns of tables, whose control policy is \"managed\"; table \"${destinationTable.table}\" is \"${controlPolicy}\". Make the change in the database yourself and leave out this statement.`, destinationTable);\n\t}\n\t#emit(source, label, location, call) {\n\t\tconst refused = operationsOf(call).map((operation) => operation.operationClass).find((operationClass) => !this.#policy.allowedOperationClasses.includes(operationClass));\n\t\tif (refused !== void 0) {\n\t\t\tconst allowed = this.#policy.allowedOperationClasses.map((c) => `\"${c}\"`).join(\", \");\n\t\t\treturn notOk(renameRefused(source.statement, `${label}: the plan does not allow \"${refused}\" operations`, source.statement === void 0 ? `${capitalized(source.change)}, and the rename produces a \"${refused}\" operation, which this command does not plan: it plans only ${allowed} operations. Make the change with a command that allows \"${refused}\" operations, such as db update or migration plan.` : `The rename produces a \"${refused}\" operation, and this command plans only ${allowed} operations. Leave out this statement, or make the change with a command that allows \"${refused}\" operations, such as migration plan.`, location, refused));\n\t\t}\n\t\tthis.#target.apply(call);\n\t\tthis.calls.push(call);\n\t\tconst first = this.#operationCount;\n\t\tthis.#operationCount += operationsOf(call).length;\n\t\treturn ok(operationsOf(call).map((_, offset) => first + offset));\n\t}\n\t#planModel(statement) {\n\t\tconst worked = modelRenameStorageEffect(statement, this.#fromContract, this.#contract);\n\t\tif (!worked.ok) return notOk(renameRefused(statement, `Model \"${modelDisplayName(worked.failure.model)}\" has no table in its contract`, `A model rename renames the model's table, and model \"${modelDisplayName(worked.failure.model)}\" has none in its contract. Leave out this statement.`, void 0));\n\t\tconst effect = worked.value;\n\t\tif (effect.kind === \"unchanged\") return ok([]);\n\t\tconst shared = this.#sharedTableRefusal(statement);\n\t\tif (shared !== void 0) return notOk(shared);\n\t\tconst [origin, destination] = effect.kind === \"moveNamespace\" ? [effect.from, effect.to] : [{\n\t\t\tnamespaceId: effect.rename.namespaceId,\n\t\t\ttable: effect.rename.from\n\t\t}, {\n\t\t\tnamespaceId: effect.rename.namespaceId,\n\t\t\ttable: effect.rename.to\n\t\t}];\n\t\tconst current = this.#current(origin);\n\t\tif (current.namespaceId === destination.namespaceId) {\n\t\t\tif (current.table === destination.table) return ok([]);\n\t\t\treturn this.#planTableRename(statement, origin, {\n\t\t\t\tnamespaceId: destination.namespaceId,\n\t\t\t\tfrom: current.table,\n\t\t\t\tto: destination.table\n\t\t\t});\n\t\t}\n\t\treturn this.#planMove(statement, origin, current, destination);\n\t}\n\t#planTableRename(statement, origin, rename) {\n\t\tconst destinationTable = {\n\t\t\tnamespaceId: rename.namespaceId,\n\t\t\ttable: rename.to\n\t\t};\n\t\tconst label = `Cannot rename table \"${rename.from}\" to \"${rename.to}\"`;\n\t\tconst policyRefusal = this.#controlPolicyRefusal(statement, label, destinationTable);\n\t\tif (policyRefusal !== void 0) return notOk(policyRefusal);\n\t\tconst checked = checkTableRename(this.#target.tables(), this.#contract, rename);\n\t\tif (!checked.ok) return notOk(tableRenameRefused(statement, label, rename, checked.failure));\n\t\treturn this.#renameTable({ statement }, label, origin, rename);\n\t}\n\t#renameTable(source, label, origin, rename) {\n\t\tconst destinationTable = {\n\t\t\tnamespaceId: rename.namespaceId,\n\t\t\ttable: rename.to\n\t\t};\n\t\tconst planned = this.#emit(source, label, destinationTable, this.#target.renameTableCall(rename));\n\t\tif (planned.ok) {\n\t\t\tthis.tableRenames.push(rename);\n\t\t\tthis.#renamedTables.set(tableKey(origin), destinationTable);\n\t\t\tthis.#originTables.set(tableKey(origin), origin);\n\t\t}\n\t\treturn planned;\n\t}\n\t#sharedTableRefusal(statement) {\n\t\tconst rename = this.#storageRenames.models.find((model) => model.statement === statement);\n\t\tconst change = rename === void 0 ? void 0 : this.#storageRenames.tableChangeOf(rename);\n\t\tconst shared = change === void 0 ? void 0 : this.#storageRenames.sharedTable(change);\n\t\tif (change === void 0 || shared === void 0) return void 0;\n\t\tconst from = change.origin.table;\n\t\tconst to = change.destination.table;\n\t\tconst label = `Cannot rename table \"${from}\" to \"${to}\"`;\n\t\tconst moving = change.renames.map((renamed) => renamed.from);\n\t\tconst others = modelsText(shared.objects);\n\t\treturn renameRefused(statement, shared.kind === \"split\" ? `${label}: table \"${from}\" also stores ${others}` : `${label}: table \"${to}\" also stores ${others}, whose rows are not in table \"${from}\"`, shared.kind === \"split\" ? `A table rename moves every row of the table, and the rows of ${others} do not move to table \"${to}\". Moving the rows of one model out of a table it shares with others is a data migration, which a plan does not write. ${leaveOutShared(modelsText(moving))} ${HAND_WRITTEN_WITH_MIGRATION_PLAN}${handWrittenMigrationSteps(`the rows of ${modelsText(moving)} into table \"${to}\"`)}` : `A table rename moves the rows of one table, and table \"${to}\" would also store the rows of ${others}. Moving the rows of two tables into one is a data migration, which a plan does not write. ${leaveOutShared(modelsText(moving))} ${HAND_WRITTEN_WITH_MIGRATION_PLAN}${handWrittenMigrationSteps(`the rows of ${modelsText(moving)}, and those of ${others} that table \"${to}\" does not already hold, into table \"${to}\"`)}`, change.origin);\n\t}\n\t#sharedColumnRefusal(statement) {\n\t\tconst rename = this.#storageRenames.fields.find((field) => field.statement === statement);\n\t\tconst change = rename === void 0 ? void 0 : this.#storageRenames.columnChangeOf(rename);\n\t\tconst shared = change === void 0 ? void 0 : this.#storageRenames.sharedColumn(change);\n\t\tif (change === void 0 || shared === void 0) return void 0;\n\t\tconst { from, to } = change;\n\t\tconst label = `Cannot rename column \"${change.origin.table}\".\"${from}\" to \"${to}\"`;\n\t\tconst moving = change.renames.map((renamed) => renamed.from);\n\t\tconst others = fieldsText(shared.objects);\n\t\treturn renameRefused(statement, shared.kind === \"split\" ? `${label}: column \"${from}\" also stores ${others}` : `${label}: column \"${to}\" also stores ${others}, whose values are not in column \"${from}\"`, shared.kind === \"split\" ? `A column rename moves the values of every row, and the values of ${others} do not move to column \"${to}\". Moving the values of one field out of a column it shares with others is a data migration, which a plan does not write. ${leaveOutShared(fieldsText(moving))} ${HAND_WRITTEN_WITH_MIGRATION_PLAN}${handWrittenMigrationSteps(`the values of ${fieldsText(moving)} into column \"${to}\"`)}` : `A column rename moves the values of one column, and column \"${to}\" would also store the values of ${others}. Moving the values of two columns into one is a data migration, which a plan does not write. ${leaveOutShared(fieldsText(moving))} ${HAND_WRITTEN_WITH_MIGRATION_PLAN}${handWrittenMigrationSteps(`the values of ${fieldsText(moving)}, and those of ${others} that column \"${to}\" does not already hold, into column \"${to}\"`)}`, {\n\t\t\t...change.origin,\n\t\t\tcolumn: from\n\t\t});\n\t}\n\t/**\n\t* Moves the table to the destination namespace under its own name, creating the namespace first\n\t* when the working schema lacks it, then renames it there when the destination names it\n\t* differently. The statement accounts for the move and the rename, not the namespace's creation.\n\t*/\n\t#planMove(statement, origin, from, to) {\n\t\tconst label = `Cannot move table \"${from.table}\" from ${namespaceText(from.namespaceId)} to ${namespaceText(to.namespaceId)}`;\n\t\tconst namespaces = this.#target.namespaces;\n\t\tif (namespaces === void 0) return notOk(withoutNamespacesRefused(statement, label));\n\t\tif (to.namespaceId === UNBOUND_NAMESPACE_ID) return notOk(renameRefused(statement, `Cannot move table \"${from.table}\" from ${namespaceText(from.namespaceId)} to the unbound namespace: the unbound namespace has no fixed place in the database`, `A table of the unbound namespace lives wherever the connection that uses it looks, so a migration cannot move a table there. Move the table yourself and leave out this statement, or keep the model in ${namespaceText(from.namespaceId)}.`, from));\n\t\tconst moved = {\n\t\t\tnamespaceId: to.namespaceId,\n\t\t\ttable: from.table\n\t\t};\n\t\tconst policyRefusal = this.#controlPolicyRefusal(statement, label, to);\n\t\tif (policyRefusal !== void 0) return notOk(policyRefusal);\n\t\tconst tables = this.#target.tables();\n\t\tif (!tables.hasTable(from.namespaceId, from.table)) return notOk(renameRefused(statement, `${label}: the schema being planned from has no table \"${qualifiedTable(from)}\"`, `The database has no table \"${qualifiedTable(from)}\", although the contract it was last updated to names it, ${DRIFTED}`, from));\n\t\tconst [taken] = [...tables.tablesNamed(to.namespaceId, from.table), ...tables.tablesNamed(to.namespaceId, to.table)];\n\t\tif (taken !== void 0) {\n\t\t\tconst takenTable = qualifiedTable({\n\t\t\t\tnamespaceId: to.namespaceId,\n\t\t\t\ttable: taken\n\t\t\t});\n\t\t\treturn notOk(renameRefused(statement, `${label}: the schema being planned from already has a table \"${takenTable}\"`, `A move cannot replace a table that already exists. Rename, move or drop table \"${takenTable}\" first, or leave out this statement.`, {\n\t\t\t\tnamespaceId: to.namespaceId,\n\t\t\t\ttable: taken\n\t\t\t}));\n\t\t}\n\t\tfor (const call of namespaces.createNamespaceCalls(to.namespaceId)) {\n\t\t\tconst created = this.#emit({ statement }, label, moved, call);\n\t\t\tif (!created.ok) return created;\n\t\t}\n\t\tconst planned = this.#emit({ statement }, label, moved, namespaces.moveTableCall({\n\t\t\ttable: from.table,\n\t\t\tfrom: from.namespaceId,\n\t\t\tto: to.namespaceId\n\t\t}));\n\t\tif (!planned.ok) return planned;\n\t\tthis.#renamedTables.set(tableKey(origin), moved);\n\t\tthis.#originTables.set(tableKey(origin), origin);\n\t\tif (to.table === from.table) return planned;\n\t\tconst renamed = this.#planTableRename(statement, origin, {\n\t\t\tnamespaceId: to.namespaceId,\n\t\t\tfrom: from.table,\n\t\t\tto: to.table\n\t\t});\n\t\tif (!renamed.ok) return renamed;\n\t\treturn ok([...planned.value, ...renamed.value]);\n\t}\n\t#planField(statement) {\n\t\tconst worked = fieldRenameStorageEffect(statement, this.#fromContract, this.#contract);\n\t\tif (!worked.ok && worked.failure.kind === \"noTable\") return notOk(renameRefused(statement, `Model \"${modelDisplayName(worked.failure.model)}\" has no table in its contract`, `A field rename renames the field's column, and model \"${modelDisplayName(worked.failure.model)}\" has no table in its contract. Leave out this statement.`, void 0));\n\t\tif (!worked.ok) return notOk(renameRefused(statement, `Field \"${modelDisplayName(statement.from)}.${statement.from.field}\" has a column on one side only of ${describeMigrationStatement(statement, this.#fromContract, this.#contract)}`, \"A field rename renames a column or changes nothing in storage, and this field gains or loses its column. Leave out this statement and plan the change without it.\", void 0));\n\t\tconst effect = worked.value;\n\t\tif (effect.kind === \"unchanged\") return ok([]);\n\t\tconst current = this.#current(effect.table);\n\t\tconst table = current.table;\n\t\tconst destinationTable = modelTable(this.#contract, statement.to);\n\t\tif (destinationTable !== void 0 && !sameTable(destinationTable, current)) return notOk(renameRefused(statement, `Cannot rename column \"${table}\".\"${effect.from}\": the model's table changes from \"${table}\" to \"${destinationTable.table}\", and the plan does not rename it`, `The plan renames a table only when every model stored in it moves to the same new table and its control policy is \"managed\" in both contracts, so the column would be renamed on a table the destination does not store the model in. Leave out this statement.`, {\n\t\t\tnamespaceId: current.namespaceId,\n\t\t\ttable,\n\t\t\tcolumn: effect.from\n\t\t}));\n\t\tconst rename = {\n\t\t\tnamespaceId: current.namespaceId,\n\t\t\ttable,\n\t\t\tfrom: this.#currentColumn(effect.table, effect.from),\n\t\t\tto: effect.to\n\t\t};\n\t\tconst tableLocation = {\n\t\t\tnamespaceId: rename.namespaceId,\n\t\t\ttable\n\t\t};\n\t\tconst label = `Cannot rename column \"${table}\".\"${rename.from}\" to \"${rename.to}\"`;\n\t\tconst policyRefusal = this.#controlPolicyRefusal(statement, label, tableLocation);\n\t\tif (policyRefusal !== void 0) return notOk(policyRefusal);\n\t\tconst renamedAlready = rename.from === rename.to;\n\t\tif (!renamedAlready) {\n\t\t\tconst checked = checkColumnRename(this.#target.tables(), this.#contract, rename);\n\t\t\tif (!checked.ok) return notOk(columnRenameRefused(statement, label, rename, checked.failure));\n\t\t}\n\t\tconst shared = this.#sharedColumnRefusal(statement);\n\t\tif (shared !== void 0) return notOk(shared);\n\t\tif (renamedAlready) return ok([]);\n\t\treturn this.#renameColumn({ statement }, label, effect.table, effect.from, rename);\n\t}\n\t#renameColumn(source, label, origin, originColumn, rename) {\n\t\tconst planned = this.#emit(source, label, {\n\t\t\tnamespaceId: rename.namespaceId,\n\t\t\ttable: rename.table,\n\t\t\tcolumn: rename.from\n\t\t}, this.#target.renameColumnCall(rename));\n\t\tif (planned.ok) {\n\t\t\tthis.columnRenames.push(rename);\n\t\t\tthis.#recordColumn(origin, originColumn, rename.to);\n\t\t}\n\t\treturn planned;\n\t}\n\t/** The origins of the working schema's tables and columns, as the statements left them. */\n\torigins() {\n\t\treturn {\n\t\t\toriginTable: (current) => {\n\t\t\t\tfor (const origin of this.#originTables.values()) if (sameTable(this.#current(origin), current)) return origin;\n\t\t\t\tfor (const [origin, renamed] of this.#renamedNamespaces) if (renamed === current.namespaceId) return {\n\t\t\t\t\tnamespaceId: origin,\n\t\t\t\t\ttable: current.table\n\t\t\t\t};\n\t\t\t\treturn current;\n\t\t\t},\n\t\t\toriginColumn: (origin, column) => [...this.#renamedColumns.values()].find((renamed) => sameTable(renamed.origin, origin) && renamed.to === column)?.from ?? column\n\t\t};\n\t}\n};\n/**\n* Plans the renames of a plan against a target's working schema: those its statements ask for, and\n* those of the tables and columns whose models and fields both contracts name alike. Every rename\n* no statement asks for is checked against all the others first. Then, in order: namespace\n* renames, the table renames no statement asks for, the other statements in the order given, and\n* the column renames no statement asks for. Each model rename becomes a table rename and each field\n* rename a column rename, computed against the schema earlier renames left, then applied to it.\n* The first rename that cannot be planned fails the whole plan; its conflict carries the statement\n* that asks for it, if one does.\n*/\nfunction planStatements(input) {\n\tconst { fromContract } = input;\n\tconst [first] = input.statements;\n\tif (fromContract === null) {\n\t\tif (first === void 0) return ok({\n\t\t\tcalls: [],\n\t\t\ttableRenames: [],\n\t\t\tcolumnRenames: [],\n\t\t\talreadyRenamedTables: [],\n\t\t\tplannedStatements: [],\n\t\t\torigins: NO_RENAMED_ORIGINS,\n\t\t\tstorageRenames: void 0\n\t\t});\n\t\treturn notOk(renameRefused(first, \"Statements need an origin contract, and this plan has none\", \"A statement names models and fields of the origin contract, and this plan has none. Plan from a contract that has the old names, or leave out the statement.\", void 0));\n\t}\n\tconst tables = input.target.tables();\n\tconst storageRenames = new StorageRenames(input.statements, fromContract, input.contract, tables.sameName);\n\tconst planned = plannedStorageRenames(storageRenames, tables);\n\tconst conflict = storageRenameConflict(planned, tables, storageRenames);\n\tif (conflict !== void 0) return notOk(conflict);\n\tconst planner = new StatementPlanner({\n\t\t...input,\n\t\tfromContract,\n\t\townership: input.ownership,\n\t\tstorageRenames\n\t});\n\tconst unstated = (change) => change.renames.every((rename) => rename.statement === void 0);\n\tconst plannedStatements = [];\n\tconst planStatement = (statement) => {\n\t\tconst operations = planner.plan(statement);\n\t\tif (operations.ok) plannedStatements.push({\n\t\t\tstatement,\n\t\t\toperations: operations.value\n\t\t});\n\t\treturn operations;\n\t};\n\tconst steps = [\n\t\t...input.statements.filter((statement) => statement.entity === \"namespace\").map((statement) => () => planStatement(statement)),\n\t\t...planned.foundTables.map(({ change, name }) => () => planner.recordTableFound(change, name)),\n\t\t...planned.tables.filter(unstated).map((change) => () => planner.planTableChange(change)),\n\t\t...input.statements.filter((statement) => statement.entity !== \"namespace\").map((statement) => () => planStatement(statement)),\n\t\t...planned.foundColumns.map(({ change, name }) => () => planner.recordColumnFound(change, name)),\n\t\t...planned.columns.filter(unstated).map((change) => () => planner.planColumnChange(change))\n\t];\n\tfor (const step of steps) {\n\t\tconst result = step();\n\t\tif (!result.ok) return result;\n\t}\n\treturn ok({\n\t\tcalls: planner.calls,\n\t\ttableRenames: planner.tableRenames,\n\t\tcolumnRenames: planner.columnRenames,\n\t\talreadyRenamedTables: planned.foundTables.filter(({ change }) => !planned.tables.includes(change)).map(({ change, name }) => ({\n\t\t\tnamespaceId: change.destination.namespaceId,\n\t\t\ttable: name\n\t\t})),\n\t\tplannedStatements,\n\t\torigins: planner.origins(),\n\t\tstorageRenames\n\t});\n}\n/**\n* The column of each field a convert or backfill statement names, as the destination contract\n* stores it. These statements rename nothing, so the strategies that plan a field's change read\n* them instead of the working schema. A field with no column has none to list.\n*/\nfunction fieldStatementColumns(statements, contract) {\n\tconst columnsOf = (kind) => statements.flatMap((statement) => {\n\t\tif (statement.kind !== kind || statement.entity !== \"field\") return [];\n\t\tconst table = modelTable(contract, statement.field);\n\t\tconst column = fieldColumn(contract, statement.field);\n\t\treturn table === void 0 || column === void 0 ? [] : [{\n\t\t\t...table,\n\t\t\tcolumn,\n\t\t\tfield: statement.field,\n\t\t\ttext: fieldStatementText(contract, statement.field)\n\t\t}];\n\t});\n\treturn {\n\t\tconvert: columnsOf(\"convert\"),\n\t\tbackfill: columnsOf(\"backfill\")\n\t};\n}\n/**\n* A conflict for the first backfill statement that names a field the origin model does not have and\n* whose column has a default: the default fills the existing rows when the column is added, so the\n* statement has nothing to fill. A field already in the origin keeps its backfill, since a default\n* does not fill the rows that hold NULL when the column becomes required.\n*/\nfunction backfillOfDefaultedField(statements, fromContract, contract) {\n\tfor (const statement of statements) {\n\t\tif (statement.kind !== \"backfill\" || statement.entity !== \"field\" || fromContract === null) continue;\n\t\tconst originModel = sqlModelStorage(fromContract, statement.field);\n\t\tif (originModel === void 0 || Object.hasOwn(originModel.fields, statement.field.field)) continue;\n\t\tconst table = modelTable(contract, statement.field);\n\t\tconst column = fieldColumn(contract, statement.field);\n\t\tif (table === void 0 || column === void 0) continue;\n\t\tif ((contract.storage.namespaces[table.namespaceId]?.entries.table?.[table.table]?.columns[column])?.default === void 0) continue;\n\t\treturn renameRefused(statement, `${describeMigrationStatement(statement, fromContract, contract)}: the field is new and has a default`, \"The default fills the existing rows when the column is added, so there is nothing to backfill. Leave out the --backfill statement.\", {\n\t\t\tnamespaceId: table.namespaceId,\n\t\t\ttable: table.table,\n\t\t\tcolumn\n\t\t});\n\t}\n}\n/**\n* The operations of a statement the statement planner does not take: a value object field backfill\n* and a variant convert are planned with the diff; a field convert or backfill accounts for none.\n*/\nfunction operationsOutsideStatementPlanner(statement) {\n\tif (statement.kind === \"rename\") return plannedAt([]);\n\tswitch (statement.entity) {\n\t\tcase \"field\": return plannedAt([]);\n\t\tcase \"valueObjectField\":\n\t\tcase \"model\": return PLANNED_WITH_DIFF;\n\t}\n}\n/**\n* Every statement of a plan in the order given, with the operations it accounts for: a planned\n* statement's from `planned`, and a statement planned with the diff's from\n* `operationIndexesPlannedWithDiff`, which finds them among the target's whole plan. A model rename\n* takes both, since renaming a variant whose discriminator value changed also rewrites the value.\n*/\nfunction appliedStatementsInOrder(statements, planned, operationIndexesPlannedWithDiff) {\n\treturn statements.map((statement) => {\n\t\tconst operations = planned.find((entry) => entry.statement === statement)?.operations ?? operationsOutsideStatementPlanner(statement);\n\t\tif (operations.kind === \"plannedWithDiff\") return {\n\t\t\tstatement,\n\t\t\toperationIndexes: operationIndexesPlannedWithDiff(statement)\n\t\t};\n\t\treturn {\n\t\t\tstatement,\n\t\t\toperationIndexes: statement.kind === \"rename\" && statement.entity === \"model\" ? [...operations.operationIndexes, ...operationIndexesPlannedWithDiff(statement)].sort((left, right) => left - right) : operations.operationIndexes\n\t\t};\n\t});\n}\n//#endregion\n//#region src/core/migrations/stored-value-calls.ts\n/** The enum value each removal is about. */\nfunction storedValueSubjects(calls, classes) {\n\treturn new Map([...calls].filter(([call]) => classes.isRemoval(call)).map(([call, rewrite]) => [call, { enumValue: rewrite.enumValue }]));\n}\n/**\n* The edit that keeps the data a failed removal check found: `removal`, the call the check's mark\n* and its column describe, replaced by a replacement whose new value is the placeholder\n* `\"<stored value>\"`.\n*/\nfunction keepRowsEdit(removal, mark, classes) {\n\treturn {\n\t\tremove: removal.renderTypeScript(),\n\t\treplaceWith: classes.replacementOf(removal, {\n\t\t\tfrom: mark.value,\n\t\t\tto: \"<stored value>\"\n\t\t}).renderTypeScript()\n\t};\n}\nfunction operationCount(call) {\n\treturn \"companions\" in call && Array.isArray(call.companions) ? 1 + call.companions.length : 1;\n}\n/** The positions, among the plan's operations, of the operations that carry out `statement`. */\nfunction storedValueOperationIndexes(planCalls, calls, statement) {\n\tconst indexes = [];\n\tlet position = 0;\n\tfor (const call of planCalls) {\n\t\tif (calls.get(call)?.statement === statement) indexes.push(position);\n\t\tposition += operationCount(call);\n\t}\n\treturn indexes;\n}\n//#endregion\n//#region src/core/migrations/unfilled-value.ts\n/** A value a planner-written operation takes from the user: its `migration.ts` writes `placeholder(slot)` where the value goes. */\nvar UnfilledValue = class {\n\tslot;\n\tconstructor(slot) {\n\t\tthis.slot = slot;\n\t\tObject.freeze(this);\n\t}\n};\n//#endregion\n//#region src/core/migrations/value-object-field-fills.ts\n/**\n* A policy that allows `data` operations plans a migration whose `migration.ts` the user can fill,\n* so it refuses; any other, as `db update` runs, fills a temporary value, as it does for a new\n* required column. It assumes that a policy that allows `data` operations means a `migration.ts` is\n* written, which holds while `migration plan` is the only command whose planner policy allows them.\n*/\nfunction unnamedFieldFillOf(policy) {\n\treturn policy.allowedOperationClasses.includes(\"data\") ? \"refuse\" : \"temporaryValue\";\n}\nconst TEMPORARY_JSON_VALUES = {\n\tstring: \"\",\n\tnumber: 0,\n\tboolean: false,\n\tobject: {},\n\tarray: []\n};\n/**\n* The temporary value of a field, as JSON: an empty list for any list, and for a scalar the empty\n* value of the JSON type its codec declares, when the codec's data type takes it. A field that\n* holds one value object or one enum value has none, since no one value stands for every object or\n* member; nor does a scalar whose data type refuses the empty value, as a date refuses `\"\"`. Without\n* one, the result says why.\n*/\nfunction temporaryValueOf(field, types) {\n\tif (field.many !== void 0 && field.many !== false) return ok([]);\n\tif (field.type.kind !== \"scalar\") return notOk(\"it holds a value object, and no one value stands for every object\");\n\tif (field.valueSet !== void 0) return notOk(\"it holds an enum value, and no one member stands for every object\");\n\tconst codecRef = buildColumnCodecRef(field.type, void 0);\n\tconst descriptor = types.codecLookup.descriptorFor(codecRef.codecId);\n\tconst jsonType = descriptor === void 0 ? void 0 : declaredJsonType(descriptor);\n\tconst empty = jsonType === void 0 ? void 0 : TEMPORARY_JSON_VALUES[jsonType];\n\tif (empty === void 0) return notOk(`its codec ${JSON.stringify(codecRef.codecId)} declares no JSON type, so it has no empty value`);\n\treturn acceptedByDataType(empty, codecRef, types) ? ok(empty) : notOk(`the data type of its codec ${JSON.stringify(codecRef.codecId)} does not take the empty value ${JSON.stringify(empty)}`);\n}\nfunction sameField(left, right) {\n\treturn left.namespaceId === right.namespaceId && left.valueObject === right.valueObject && left.field === right.field;\n}\n/** The fields each value object of both contracts makes required: new to the destination, or optional in the origin. */\nfunction requiredFields(fromContract, contract, statements) {\n\tconst originNamespaces = /* @__PURE__ */ new Map();\n\tconst renamedFrom = /* @__PURE__ */ new Map();\n\tconst backfills = [];\n\tfor (const statement of statements) {\n\t\tif (statement.kind === \"backfill\" && statement.entity === \"valueObjectField\") backfills.push(statement);\n\t\tif (statement.kind !== \"rename\") continue;\n\t\tif (statement.entity === \"namespace\") originNamespaces.set(statement.to, statement.from);\n\t\tif (statement.entity === \"valueObjectField\") renamedFrom.set(JSON.stringify(statement.to), statement.from);\n\t}\n\tconst fields = [];\n\tfor (const { coordinate, valueObject } of valueObjectsWithCoordinates(contract.storage)) {\n\t\tconst origin = valueObjectAt(fromContract.storage, {\n\t\t\t...coordinate,\n\t\t\tnamespaceId: originNamespaces.get(coordinate.namespaceId) ?? coordinate.namespaceId\n\t\t});\n\t\tif (origin === void 0) continue;\n\t\tconst renamedFields = new Set([...renamedFrom.values()].filter((from) => from.valueObject === coordinate.entityName).map((from) => from.field));\n\t\tconst removedFields = Object.keys(origin.fields).filter((name) => !Object.hasOwn(valueObject.fields, name) && !renamedFields.has(name));\n\t\tfor (const [name, field] of Object.entries(valueObject.fields)) {\n\t\t\tif (field.nullable) continue;\n\t\t\tconst valueObjectField = {\n\t\t\t\tnamespaceId: asNamespaceId(coordinate.namespaceId),\n\t\t\t\tvalueObject: coordinate.entityName,\n\t\t\t\tfield: name\n\t\t\t};\n\t\t\tconst originName = renamedFrom.get(JSON.stringify(valueObjectField))?.field ?? name;\n\t\t\tconst originField = Object.hasOwn(origin.fields, originName) ? origin.fields[originName] : void 0;\n\t\t\tif (originField !== void 0 && !originField.nullable) continue;\n\t\t\tfields.push({\n\t\t\t\tvalueObjectField,\n\t\t\t\ttarget: coordinate,\n\t\t\t\tfield,\n\t\t\t\tstatement: backfills.find((backfill) => sameField(backfill.field, valueObjectField)),\n\t\t\t\tremovedFields: originField === void 0 ? removedFields : []\n\t\t\t});\n\t\t}\n\t}\n\treturn fields;\n}\nfunction backfillAdvice(contract, required, text) {\n\tconst backfill = `--backfill ${text} to write the value the plan fills them with.`;\n\tif (required.removedFields.length === 0) return `Add ${backfill}`;\n\tconst removed = required.removedFields.map((field) => valueObjectFieldStatementText(contract, {\n\t\t...required.valueObjectField,\n\t\tfield\n\t}));\n\treturn `If it is a field renamed, add ${removed.map((from) => `--rename ${from}:${text}`).join(\" or \")}. Otherwise add ${backfill} With ${removed.map((from) => `--delete ${from}`).join(\" or \")}, the new field still needs --backfill ${text}.`;\n}\nfunction placeText(place) {\n\treturn `path ${JSON.stringify(jsonPathText(place.steps))} in column \"${place.column}\" of \"${place.table}\"`;\n}\nfunction needsValue(required, places, text, why) {\n\tconst [place] = places;\n\treturn {\n\t\tkind: \"nullabilityConflict\",\n\t\tsummary: `Value object field \"${text}\" is required, and existing objects may have no value for it, at:\\n${places.map((each) => `- ${placeText(each)}`).join(\"\\n\")}`,\n\t\twhy,\n\t\tlocation: {\n\t\t\tnamespaceId: place.namespaceId,\n\t\t\tentityKind: \"table\",\n\t\t\tentityName: place.table,\n\t\t\tcolumn: place.column\n\t\t},\n\t\tmeta: { valueObjectField: required.valueObjectField }\n\t};\n}\nfunction unlisted(text, column, table, reason) {\n\treturn {\n\t\tkind: \"unsupportedOperation\",\n\t\tsummary: `Cannot fill value object field \"${text}\": column \"${column}\" of \"${table}\" holds ${reason}`,\n\t\twhy: `The plan fills a key at every path from a column to its value object, and it cannot list the paths in such a column. ${handWrittenMigrationAdvice(`the JSON of column \"${column}\" of \"${table}\"`)}`\n\t};\n}\nconst REACH_REASONS = {\n\tcontainsItself: \"it inside a value object that contains itself\",\n\tunion: \"a union of value objects\",\n\tdictionary: \"a dictionary of value objects\"\n};\nfunction fillAt(required, place, text, value) {\n\treturn {\n\t\tvalueObjectField: required.valueObjectField,\n\t\tnamespaceId: place.namespaceId,\n\t\ttable: place.table,\n\t\tcolumn: place.column,\n\t\tpath: jsonPathText([...place.steps, {\n\t\t\tkind: \"member\",\n\t\t\tname: required.valueObjectField.field\n\t\t}]),\n\t\tvalue,\n\t\tfield: text,\n\t\tstatement: required.statement\n\t};\n}\n/**\n* The fills of value object fields a plan makes. A field of a value object that both contracts have\n* is filled when the destination makes it required and the origin lacks it or makes it optional. A\n* backfill statement fills it with a value the user writes in `migration.ts`. Without one,\n* `unnamed` decides: `refuse` names the statement, and `temporaryValue` fills a scalar field whose\n* codec has a temporary value its data type takes, and refuses any other. Under `refuse`, when the\n* value object also lost a field no statement renames, the refusal offers that rename first. Each\n* fill acts on every column of the working schema whose field holds the value object, at every path to its objects, nested or in lists, as\n* the destination names them. A column that holds the value object where its paths cannot be listed\n* is refused. With no origin contract, nothing is known to have changed.\n*/\nfunction planValueObjectFieldFills(input) {\n\tconst { fromContract, contract } = input;\n\tif (fromContract === null) return ok([]);\n\tconst newlyRequired = requiredFields(fromContract, contract, input.statements);\n\tif (newlyRequired.length === 0) return ok([]);\n\tconst placesOf = valueObjectPlaces(contract, input.tables);\n\tconst fills = [];\n\tfor (const required of newlyRequired) {\n\t\tconst text = valueObjectFieldStatementText(contract, required.valueObjectField);\n\t\tconst places = placesOf(required.target);\n\t\tif (!places.ok) {\n\t\t\tconst { column, reach } = places.failure;\n\t\t\treturn notOk(unlisted(text, column.column, column.table, REACH_REASONS[reach.kind]));\n\t\t}\n\t\tconst [first, ...rest] = places.value;\n\t\tif (first === void 0) continue;\n\t\tconst temporary = required.statement === void 0 && input.unnamed === \"temporaryValue\" ? temporaryValueOf(required.field, input.types) : void 0;\n\t\tif (temporary !== void 0 && !temporary.ok) return notOk(needsValue(required, [first, ...rest], text, `db update cannot choose a value for field \"${text}\": ${temporary.failure}. Plan a migration with prisma migration plan --backfill ${text} instead, and write the value in its migration.ts.`));\n\t\tconst value = temporary !== void 0 ? temporary.value : required.statement !== void 0 ? new UnfilledValue(`${text}:value`) : void 0;\n\t\tif (value === void 0) return notOk(needsValue(required, [first, ...rest], text, backfillAdvice(contract, required, text)));\n\t\tfills.push(...places.value.map((place) => fillAt(required, place, text, value)));\n\t}\n\treturn ok(fills);\n}\n//#endregion\n//#region src/core/migrations/variant-planning.ts\nfunction modelAt(contract, coordinate) {\n\tconst namespaces = contract.domain.namespaces;\n\tconst namespace = Object.hasOwn(namespaces, coordinate.namespaceId) ? namespaces[coordinate.namespaceId] : void 0;\n\treturn namespace !== void 0 && Object.hasOwn(namespace.models, coordinate.model) ? namespace.models[coordinate.model] : void 0;\n}\nfunction baseOf(contract, variant) {\n\tconst base = modelAt(contract, variant)?.base;\n\treturn base === void 0 ? void 0 : {\n\t\tnamespaceId: asNamespaceId(base.namespace),\n\t\tmodel: base.model\n\t};\n}\nfunction variantValue(contract, variant) {\n\tconst base = baseOf(contract, variant);\n\tif (base === void 0) return void 0;\n\treturn Object.entries(modelAt(contract, base)?.variants ?? {}).find(([, reference]) => reference.namespace === variant.namespaceId && reference.model === variant.model)?.[0];\n}\n/** The discriminator column of `base` in the destination, when a managed table of the working schema has it. */\nfunction discriminatorColumn(contract, base, tables) {\n\tconst model = modelAt(contract, base);\n\tconst discriminator = model?.discriminator;\n\tif (model === void 0 || discriminator === void 0 || !isSqlModelStorage(model.storage)) return;\n\tconst { namespaceId, table } = model.storage;\n\tconst column = model.storage.fields[discriminator.field]?.column;\n\tif (column === void 0 || !tables.hasColumn(namespaceId, table, column)) return void 0;\n\tif (tableControlPolicy(contract, {\n\t\tnamespaceId,\n\t\ttable\n\t}) !== \"managed\") return void 0;\n\tconst stored = contract.storage.namespaces[namespaceId]?.entries.table?.[table]?.columns[column];\n\tif (stored === void 0) return void 0;\n\treturn {\n\t\tnamespaceId,\n\t\ttable,\n\t\tcolumn,\n\t\tcodecRef: buildColumnCodecRef(stored, void 0)\n\t};\n}\n/** The destination variant's own table, when it has one whose foreign key to the base table cascades. */\nfunction cascadingTableOf(contract, variant, base) {\n\tconst model = modelAt(contract, variant);\n\tif (model === void 0 || !isSqlModelStorage(model.storage)) return void 0;\n\tconst { namespaceId, table } = model.storage;\n\tif (namespaceId === base.namespaceId && table === base.table) return void 0;\n\tconst foreignKey = contract.storage.namespaces[namespaceId]?.entries.table?.[table]?.foreignKeys.find(({ target, onDelete }) => onDelete === \"cascade\" && target.namespaceId === base.namespaceId && target.tableName === base.table);\n\treturn foreignKey === void 0 ? void 0 : {\n\t\tnamespaceId,\n\t\ttable,\n\t\tcolumns: foreignKey.source.columns,\n\t\treferences: foreignKey.target.columns\n\t};\n}\nfunction sameModel(left, right) {\n\treturn left.namespaceId === right.namespaceId && left.model === right.model;\n}\nfunction originVariants(contract) {\n\treturn Object.entries(contract.domain.namespaces).flatMap(([namespaceId, namespace]) => Object.entries(namespace.models).flatMap(([model, definition]) => definition.base === void 0 ? [] : [{\n\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\tmodel\n\t}]));\n}\n/** Where a model of the origin is in the destination, after the plan's namespace and model renames. */\nfunction destinationOf(model, statements) {\n\tconst rename = statements.find((statement) => statement.kind === \"rename\" && statement.entity === \"model\" && sameModel(statement.from, model));\n\tif (rename !== void 0) return {\n\t\tcoordinate: rename.to,\n\t\trename\n\t};\n\tconst namespace = statements.find((statement) => statement.kind === \"rename\" && statement.entity === \"namespace\" && statement.from === model.namespaceId);\n\treturn {\n\t\tcoordinate: namespace?.kind === \"rename\" && namespace.entity === \"namespace\" ? {\n\t\t\t...model,\n\t\t\tnamespaceId: namespace.to\n\t\t} : model,\n\t\trename: void 0\n\t};\n}\nfunction rewriteOf(model, input) {\n\tconst from = variantValue(input.fromContract, model);\n\tconst originBase = baseOf(input.fromContract, model);\n\tif (from === void 0 || originBase === void 0) return void 0;\n\tconst destination = destinationOf(model, input.statements);\n\tconst to = variantValue(input.contract, destination.coordinate);\n\tconst removed = modelAt(input.contract, destination.coordinate) === void 0;\n\tif (to === from || to === void 0 && !removed) return void 0;\n\tconst base = baseOf(input.contract, destination.coordinate) ?? destinationOf(originBase, input.statements).coordinate;\n\tconst column = discriminatorColumn(input.contract, base, input.tables);\n\tif (column === void 0) return void 0;\n\tconst convert = input.statements.find((statement) => statement.kind === \"convert\" && statement.entity === \"model\" && sameModel(statement.model, destination.coordinate));\n\tconst statement = to === void 0 ? void 0 : destination.rename ?? convert;\n\treturn {\n\t\tmodel,\n\t\t...column,\n\t\tfrom,\n\t\tto: statement === void 0 ? void 0 : to,\n\t\tremoved,\n\t\tcascadingTable: cascadingTableOf(input.contract, destination.coordinate, column),\n\t\tstatement\n\t};\n}\nfunction chainRefusal(rewrite, other, contract) {\n\treturn {\n\t\tkind: \"unsupportedOperation\",\n\t\tsummary: `Cannot rewrite discriminator value \"${rewrite.from}\" of variant \"${modelStatementText(contract, rewrite.model)}\" to \"${rewrite.to}\": variant \"${modelStatementText(contract, other.model)}\" moves from that value in the same column`,\n\t\twhy: `Column \"${rewrite.column}\" of \"${rewrite.table}\" would hold one value for rows of two variants while the plan rewrites them. Change one discriminator value in this migration and the other in a later one.`\n\t};\n}\n/**\n* The row rewrites a plan makes for the variants of the origin whose discriminator value the\n* destination changes or drops. A rename or convert statement rewrites a changed value in the base\n* table's discriminator column; a changed value with no statement, and a variant the destination no\n* longer has, delete the rows that hold the old value, which the plan asks about. Deletions come\n* first, so a value freed by a deleted variant can be taken by another. A rewrite whose new value\n* another variant still moves from is refused. With no origin contract, nothing is known to have\n* changed.\n*/\nfunction planVariantRowRewrites(input) {\n\tconst { fromContract } = input;\n\tif (fromContract === null) return ok([]);\n\tconst rewrites = originVariants(fromContract).flatMap((model) => {\n\t\tconst rewrite = rewriteOf(model, {\n\t\t\t...input,\n\t\t\tfromContract\n\t\t});\n\t\treturn rewrite === void 0 ? [] : [rewrite];\n\t});\n\tconst sameColumn = (left, right) => left.namespaceId === right.namespaceId && left.table === right.table && left.column === right.column;\n\tfor (const rewrite of rewrites) {\n\t\tif (rewrite.to === void 0) continue;\n\t\tconst other = rewrites.find((candidate) => candidate !== rewrite && candidate.to !== void 0 && sameColumn(candidate, rewrite) && candidate.from === rewrite.to);\n\t\tif (other !== void 0) return notOk(chainRefusal(rewrite, other, fromContract));\n\t}\n\treturn ok([...rewrites.filter(({ to }) => to === void 0), ...rewrites.filter(({ to }) => to !== void 0)]);\n}\n//#endregion\n//#region src/core/migrations/stored-rewrites.ts\n/**\n* The stored rewrites of a plan, as the target's calls: the key rewrites and fills of value object\n* fields, the stored value rewrites of enum values, and the row rewrites of variants. The first\n* kind a plan refuses is the plan's failure.\n*/\nfunction planStoredRewrites(input) {\n\tconst { statements, fromContract, contract, tables, types } = input;\n\tconst keyRewrites = planValueObjectFieldRewrites({\n\t\tstatements,\n\t\tfromContract,\n\t\tcontract,\n\t\ttables\n\t});\n\tif (!keyRewrites.ok) return notOk(keyRewrites.failure);\n\tconst fills = planValueObjectFieldFills({\n\t\tstatements,\n\t\tfromContract,\n\t\tcontract,\n\t\ttables,\n\t\ttypes,\n\t\tunnamed: unnamedFieldFillOf(input.policy)\n\t});\n\tif (!fills.ok) return notOk(fills.failure);\n\tconst valueRewrites = planEnumValueRewrites({\n\t\tstatements,\n\t\tfromContract,\n\t\tcontract,\n\t\ttables,\n\t\tcodecs: types.codecLookup\n\t});\n\tif (!valueRewrites.ok) return notOk(valueRewrites.failure);\n\tconst variantRewrites = planVariantRowRewrites({\n\t\tstatements,\n\t\tfromContract,\n\t\tcontract,\n\t\ttables\n\t});\n\tif (!variantRewrites.ok) return notOk(variantRewrites.failure);\n\tconst storedKeyCalls = input.calls.storedKeyCalls(keyRewrites.value);\n\tconst storedKeyFillCalls = input.calls.storedKeyFillCalls(fills.value);\n\tconst storedValueCalls = input.calls.storedValueCalls(valueRewrites.value);\n\tconst variantRowCalls = input.calls.variantRowCalls(variantRewrites.value);\n\tconst rewrites = new Map([\n\t\t...storedKeyCalls,\n\t\t...storedKeyFillCalls,\n\t\t...storedValueCalls,\n\t\t...variantRowCalls\n\t]);\n\treturn ok({\n\t\tcalls: [\n\t\t\t...storedKeyCalls.keys(),\n\t\t\t...storedKeyFillCalls.keys(),\n\t\t\t...storedValueCalls.keys(),\n\t\t\t...variantRowCalls.keys()\n\t\t],\n\t\toperationIndexes: (planCalls, statement) => storedValueOperationIndexes(planCalls, rewrites, statement),\n\t\tstoredValues: storedValueSubjects(storedValueCalls, input.calls.storedValueClasses),\n\t\tstoredKeys: new Map([...storedKeyCalls, ...storedKeyFillCalls].map(([call, change]) => [call, change.valueObjectField])),\n\t\tvariantRows: new Map([...variantRowCalls].map(([call, rewrite]) => [call, rewrite.model])),\n\t\tremovedVariants: variantRewrites.value.flatMap(({ model, removed }) => removed ? [model] : [])\n\t});\n}\n//#endregion\n//#region src/core/migrations/table-name-case-guard.ts\nconst TABLE_NAME_CASE_CHANGED_CODE = \"MIGRATION.TABLE_NAME_CASE_CHANGED\";\nfunction lowerFirst(value) {\n\treturn value.charAt(0).toLowerCase() + value.slice(1);\n}\nfunction plannedTable(node, namespaceId) {\n\treturn {\n\t\tnamespaceId,\n\t\ttableName: node.name\n\t};\n}\nfunction renameNeedsNamespace(drop, dropped, contract, defaultNamespaceId) {\n\tif (drop.namespaceId !== UNBOUND_NAMESPACE_ID && drop.namespaceId !== defaultNamespaceId) return true;\n\tconst declaredElsewhere = (namespaceId, tableName) => namespaceId !== drop.namespaceId && tableName === drop.tableName;\n\treturn dropped.some((other) => declaredElsewhere(other.namespaceId, other.tableName)) || Object.values(contract.storage.namespaces).some((namespace) => Object.keys(namespace.entries.table ?? {}).some((tableName) => declaredElsewhere(namespace.id, tableName)));\n}\n/**\n* Finds every (drop `X`, create `Y`) pair in the same namespace where `X` is\n* `Y` with its first letter lowered. That shape is the signature of a schema\n* upgraded across the release in which a model with no `@@map` stopped\n* lowering the first letter of its table name: planning it would drop the\n* user's table and recreate it empty. Columns are deliberately not compared,\n* so a user who also changed a field in the same upgrade is still protected.\n*\n* Returns one conflict per pair, carrying `MIGRATION.TABLE_NAME_CASE_CHANGED`\n* in `meta.code`, or an empty array when the plan has no such pair.\n*/\nfunction detectTableNameCaseChanges(input) {\n\tconst dropped = [];\n\tconst created = [];\n\tfor (const issue of input.issues) {\n\t\tconst outcome = issueOutcome(issue);\n\t\tif (outcome === \"not-equal\") continue;\n\t\tconst table = input.tableOf(issue);\n\t\tif (table === void 0) continue;\n\t\t(outcome === \"not-expected\" ? dropped : created).push(plannedTable(table, input.namespaceIdOf(issue)));\n\t}\n\tconst conflicts = [];\n\tfor (const create of created) {\n\t\tconst drop = dropped.find((candidate) => candidate.namespaceId === create.namespaceId && candidate.tableName === lowerFirst(create.tableName));\n\t\tif (drop === void 0) continue;\n\t\tconst renameCall = input.renameTableCall({\n\t\t\tnamespaceId: renameNeedsNamespace(drop, dropped, input.contract, input.defaultNamespaceId) ? drop.namespaceId : void 0,\n\t\t\tfrom: drop.tableName,\n\t\t\tto: create.tableName\n\t\t});\n\t\tconflicts.push({\n\t\t\tkind: \"tableNameCaseChanged\",\n\t\t\tsummary: `${TABLE_NAME_CASE_CHANGED_CODE}: table \"${create.tableName}\" would be created and table \"${drop.tableName}\" dropped. Prisma 8 changed the default table name: a model with no @@map now names its table verbatim, so model ${create.tableName} points at \"${create.tableName}\" instead of \"${drop.tableName}\".`,\n\t\t\twhy: `To keep table \"${drop.tableName}\" and its rows, add @@map(\"${drop.tableName}\") to model ${create.tableName} (or run the add-model-map codemod over the schema) and plan again. To rename the table and keep its rows instead: in a project with migration history, make the rename its own schema change, create its migration with prisma migration new --from <hash of the migration the database is at>, and add ${renameCall} to the migration's operations, which renames the table and the objects named after it; in a project that uses db update, rename it by hand with ${input.renameByHandStatements({\n\t\t\t\tnamespaceId: create.namespaceId,\n\t\t\t\tfrom: drop.tableName,\n\t\t\t\tto: create.tableName\n\t\t\t}).join(\"; \")}, then run db update again.`,\n\t\t\tlocation: {\n\t\t\t\tnamespaceId: create.namespaceId,\n\t\t\t\tentityKind: \"table\",\n\t\t\t\tentityName: create.tableName\n\t\t\t},\n\t\t\tmeta: {\n\t\t\t\tcode: TABLE_NAME_CASE_CHANGED_CODE,\n\t\t\t\tdroppedTable: drop.tableName,\n\t\t\t\tcreatedTable: create.tableName\n\t\t\t}\n\t\t});\n\t}\n\treturn conflicts;\n}\n//#endregion\n//#region src/core/migrations/temporary-value.ts\n/**\n* Whether a required column the plan adds to a table with rows may take one temporary value in\n* every row. Not when it is in the primary key, a unique constraint or a foreign key, which one\n* value in every row would break, and not when its values come from a value set, since no one value\n* stands for every member. Such a column is added for an empty table only.\n*/\nfunction columnTakesTemporaryValue(table, column) {\n\treturn table.columns[column]?.valueSet === void 0 && !(table.primaryKey?.columns.includes(column) ?? false) && !table.uniques.some(({ columns }) => columns.includes(column)) && !table.foreignKeys.some(({ source }) => source.columns.includes(column));\n}\n//#endregion\n//#region src/core/migrations/unconverted-field.ts\nconst ConvertedColumnMeta = type({ convertedColumn: {\n\ttable: \"string\",\n\tcolumn: \"string\",\n\tby: \"'cast' | 'conversion'\"\n} });\n/**\n* The meta of a step that converts the values of `column` in `table` to the column's new type, or\n* checks that it did. When the step fails, the runner names the field that stores the column.\n*/\nfunction convertedColumnMeta(table, column, by) {\n\treturn { convertedColumn: {\n\t\ttable,\n\t\tcolumn,\n\t\tby\n\t} };\n}\n/** The column a step converts to its new type, as {@link convertedColumnMeta} marks it. */\nfunction convertedColumnOf(step) {\n\tconst meta = ConvertedColumnMeta(step.meta ?? {});\n\treturn meta instanceof type.errors ? void 0 : meta.convertedColumn;\n}\n/**\n* The field of `contract` whose column a failed step converts, or undefined when the step\n* converts no column, no field stores the column, or tables of two storage namespaces share its name.\n*/\nfunction unconvertedFieldOf(step, contract) {\n\tconst converted = convertedColumnOf(step);\n\treturn converted === void 0 ? void 0 : fieldOfColumn(contract, converted.table, converted.column);\n}\n//#endregion\n//#region src/core/reported-defaults.ts\n/** Reads a reported literal default with the column's codec. `raw` is the reported text, which a refusal quotes. */\nasync function readReportedDefault(codec, literal, raw) {\n\tconst unreadable = (error, element) => {\n\t\tif (isInternalError(error)) throw error;\n\t\tconst reason = error instanceof Error ? error.message : String(error);\n\t\treturn { defaultUnreadable: `The column codec ${codec.id} cannot read ${element}the default the database reports, ${raw}: ${reason}` };\n\t};\n\tif (literal.kind === \"value\") try {\n\t\tconst value = await readBody(codec, literal.body);\n\t\treturn {\n\t\t\tresolvedDefault: {\n\t\t\t\tkind: \"literal\",\n\t\t\t\tvalue: codec.dataType.toContract(value)\n\t\t\t},\n\t\t\tdefaultValue: value\n\t\t};\n\t} catch (error) {\n\t\treturn unreadable(error, \"\");\n\t}\n\tconst values = [];\n\tfor (const [index, body] of literal.elements.entries()) try {\n\t\tvalues.push(body === null ? null : await readBody(codec, body));\n\t} catch (error) {\n\t\treturn unreadable(error, `element ${index + 1} of `);\n\t}\n\treturn {\n\t\tresolvedDefault: {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: values.map((value) => value === null ? null : codec.dataType.toContract(value))\n\t\t},\n\t\tdefaultValue: values\n\t};\n}\n/**\n* Reads a reported literal default with the column's codec, and, when the contract's default is an expression that writes a literal, that literal too, so the diff compares the two as values.\n*/\nasync function readColumnDefault(codec, reported, written) {\n\tconst read = await readReportedDefault(codec, reported.literal, reported.raw);\n\tif (written === void 0 || !(\"defaultValue\" in read)) return read;\n\tconst writtenRead = await readReportedDefault(codec, written.literal, written.expression);\n\treturn \"defaultValue\" in writtenRead ? {\n\t\t...read,\n\t\tdefaultExpressionValue: writtenRead.defaultValue\n\t} : read;\n}\nasync function readBody(codec, body) {\n\treturn codec.toDataTypeValue(await codec.fromWire(body, {}));\n}\nfunction isLoose(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\nfunction child(value, key) {\n\tif (!isLoose(value)) return void 0;\n\tconst found = value[key];\n\treturn isLoose(found) ? found : void 0;\n}\n/**\n* The columns `contract` declares. `contract` is a contract, or the namespaces of several contract spaces merged with each space's contract under `contracts`, as multi-space introspection receives them.\n*/\nfunction contractColumns(contract) {\n\tconst contracts = isLoose(contract) && Array.isArray(contract[\"contracts\"]) ? contract[\"contracts\"] : [contract];\n\treturn { columnOf(namespaceIds, table, column) {\n\t\tfor (const space of contracts) {\n\t\t\tconst namespaces = child(child(space, \"storage\"), \"namespaces\");\n\t\t\tif (namespaces === void 0) continue;\n\t\t\tfor (const id of namespaceIds ?? Object.keys(namespaces)) {\n\t\t\t\tconst found = child(child(child(child(child(child(namespaces, id), \"entries\"), \"table\"), table), \"columns\"), column);\n\t\t\t\tconst codecId = found?.[\"codecId\"];\n\t\t\t\tif (found === void 0 || typeof codecId !== \"string\") continue;\n\t\t\t\tconst columnDefault = child(found, \"default\");\n\t\t\t\tconst expression = columnDefault?.[\"expression\"];\n\t\t\t\treturn {\n\t\t\t\t\tcodecRef: columnCodecRef(codecId, found),\n\t\t\t\t\tdefaultExpression: columnDefault?.[\"kind\"] === \"function\" && typeof expression === \"string\" ? expression : void 0\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t} };\n}\nfunction columnCodecRef(codecId, column) {\n\tconst params = nonEmptyTypeParams(child(column, \"typeParams\"));\n\tconst many = column[\"many\"];\n\treturn {\n\t\tcodecId,\n\t\t...ifDefined(\"typeParams\", params === void 0 ? void 0 : blindCast(params)),\n\t\t...ifDefined(\"many\", many !== void 0 && many !== false ? true : void 0)\n\t};\n}\n//#endregion\n//#region src/exports/control.ts\nvar control_default = new SqlFamilyDescriptor();\n//#endregion\nexport { COLUMN_RENAME_UNMATCHED_CODE, INIT_ADDITIVE_POLICY, NO_RENAMED_ORIGINS, StorageRenames, TABLE_NAME_CASE_CHANGED_CODE, UnfilledValue, acceptedByDataType, appliedStatementsInOrder, assembleAuthoringContributions, backfillOfDefaultedField, checkDatabasePoliciesHeld, checkSqlDefaultText, checkSqlExpressionText, columnTakesTemporaryValue, contractColumns, contractNamespaceToSchemaIR, contractToSchemaIR, convertedColumnMeta, convertedColumnOf, createMigrationPlan, createSqlTextSources, control_default as default, detectDestructiveChanges, detectTableNameCaseChanges, encodeStoredValue, exactName, extractCodecControlHooks, fieldEventStorage, fieldOfColumn, fieldRenameStorageEffect, fieldStatementColumns, fillKeyProblem, fillValueProblem, isUnfilledSlot, jsonPathText, keepRowsEdit, keyPathOf, modelRenameStorageEffect, otherSpaceDeclaring, parseJsonPath, partitionCallsByControlPolicy, partitionIssuesByControlPolicy, planEnumValueRewrites, planFieldEventCalls, planFieldEventOperations, planStatements, planStoredRewrites, planValueObjectFieldFills, planValueObjectFieldRewrites, planVariantRowRewrites, plannerFailure, plannerSuccess, readColumnDefault, readReportedDefault, removalsOfMigration, requiredColumnMeta, requiredColumnOf, requiredColumnsOfMigration, resolveColumnRenameAgainst, resolveTableRenameAgainst, rowsHoldingValueFailure, rowsHoldingValueMeta, rowsHoldingValueOf, rowsWithoutValueFailure, rowsWithoutValueSummary, runnerFailure, runnerSuccess, scalarTypeNamesOf, slotSource, sqlDefaultFunctions, sqlOfSlot, sqlTypeLookupsOf, storageNameOfOperation, storedValueOperationIndexes, storedValueSubjects, subjectsOfCalls, unconvertedFieldOf, unknownCallNames, unmatchedColumnRename, unmatchedTableRename, unnamedFieldFillOf };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,SAAS,SA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