@prisma/orm-family-sql 8.0.0-rc.18-dev.18 → 8.0.0-rc.18-dev.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{authoring-type-constructors-0Iv2zdwS-MFIpJ4fA.mjs → authoring-type-constructors-0Iv2zdwS-BJjO5EnA.mjs} +2 -2
- package/dist/{authoring-type-constructors-0Iv2zdwS-MFIpJ4fA.mjs.map → authoring-type-constructors-0Iv2zdwS-BJjO5EnA.mjs.map} +1 -1
- package/dist/{config-types-ComQZUlA.mjs → config-types-DopEiXtk.mjs} +2 -2
- package/dist/{config-types-ComQZUlA.mjs.map → config-types-DopEiXtk.mjs.map} +1 -1
- package/dist/{contract-builder-fQ3gkIR5.mjs → contract-builder-C1X8KoEM.mjs} +3 -3
- package/dist/{contract-builder-fQ3gkIR5.mjs.map → contract-builder-C1X8KoEM.mjs.map} +1 -1
- package/dist/contract-prisma7__provider.d.mts +3 -3
- package/dist/contract-prisma7__provider.d.mts.map +1 -1
- package/dist/contract-prisma7__provider.mjs +19 -47
- package/dist/contract-prisma7__provider.mjs.map +1 -1
- package/dist/contract-psl.mjs +1 -1
- package/dist/contract-psl__attribute-specs.mjs +1 -1
- package/dist/contract-psl__provider.mjs +2 -2
- package/dist/contract-psl__provider.mjs.map +1 -1
- package/dist/contract-ts.mjs +3 -3
- package/dist/contract-ts__config-types.mjs +1 -1
- package/dist/contract-ts__contract-builder.mjs +2 -2
- package/dist/contract.d.mts +2 -2
- package/dist/contract.mjs +3 -3
- package/dist/contract__data-type.d.mts +1 -1
- package/dist/contract__foreign-key-materialization.d.mts +1 -1
- package/dist/contract__foreign-key-materialization.mjs +2 -2
- package/dist/contract__validators.mjs +1 -1
- package/dist/{control-mpACqp72.d.mts → control-BqS5MMDh.d.mts} +21 -12
- package/dist/control-BqS5MMDh.d.mts.map +1 -0
- package/dist/{control-ClahTAD-.mjs → control-C7MNvu5Q.mjs} +27 -13
- package/dist/control-C7MNvu5Q.mjs.map +1 -0
- package/dist/{control-adapter-BCopdpsT-DIHCWbq_.d.mts → control-adapter-BCopdpsT-Bou0wWLF.d.mts} +3 -3
- package/dist/{control-adapter-BCopdpsT-DIHCWbq_.d.mts.map → control-adapter-BCopdpsT-Bou0wWLF.d.mts.map} +1 -1
- package/dist/control-adapter-CUwBiImd.d.mts +1 -0
- package/dist/{data-type-B8N33s-_.d.mts → data-type-DuzmTpzK.d.mts} +3 -3
- package/dist/{data-type-B8N33s-_.d.mts.map → data-type-DuzmTpzK.d.mts.map} +1 -1
- package/dist/{derived-checks-CrvMQTJF-DlxFFtNM.mjs → derived-checks-sRZp_gTF-UGwFWkVX.mjs} +7 -20
- package/dist/derived-checks-sRZp_gTF-UGwFWkVX.mjs.map +1 -0
- package/dist/{diff-Bd9ILpZL.d.mts → diff-D6PbCUWL.d.mts} +5 -5
- package/dist/{diff-Bd9ILpZL.d.mts.map → diff-D6PbCUWL.d.mts.map} +1 -1
- package/dist/family.d.mts +10 -10
- package/dist/family.mjs +6 -6
- package/dist/family__control-adapter.d.mts +2 -2
- package/dist/family__control.d.mts +3 -3
- package/dist/family__control.mjs +2 -2
- package/dist/family__diff.d.mts +1 -1
- package/dist/family__ir.mjs +1 -1
- package/dist/family__migration.d.mts +1 -1
- package/dist/family__pack.mjs +2 -2
- package/dist/family__psl-build.d.mts +2 -2
- package/dist/family__psl-build.mjs +2 -2
- package/dist/family__psl-infer.d.mts +1 -1
- package/dist/family__psl-infer.mjs +1 -1
- package/dist/{foreign-key-materialization-DfNPQL9G.mjs → foreign-key-materialization-BIvQTfz8.mjs} +2 -2
- package/dist/{foreign-key-materialization-DfNPQL9G.mjs.map → foreign-key-materialization-BIvQTfz8.mjs.map} +1 -1
- package/dist/{foreign-key-materialization-DCaDnUs-.d.mts → foreign-key-materialization-BiWTp2vi.d.mts} +3 -3
- package/dist/{foreign-key-materialization-DCaDnUs-.d.mts.map → foreign-key-materialization-BiWTp2vi.d.mts.map} +1 -1
- package/dist/{index-equivalence-DswCiq5l-BsphajRC.mjs → index-equivalence-DswCiq5l-Cp2V5nhL.mjs} +2 -2
- package/dist/{index-equivalence-DswCiq5l-BsphajRC.mjs.map → index-equivalence-DswCiq5l-Cp2V5nhL.mjs.map} +1 -1
- package/dist/{interpreter-CFj2aTEP-BHL3TOqk.mjs → interpreter-B9wNACvu-CjrIm-Jo.mjs} +5 -5
- package/dist/{interpreter-CFj2aTEP-BHL3TOqk.mjs.map → interpreter-B9wNACvu-CjrIm-Jo.mjs.map} +1 -1
- package/dist/{migration-lg_VgP_F.d.mts → migration-CJ0xK_7n.d.mts} +2 -2
- package/dist/{migration-lg_VgP_F.d.mts.map → migration-CJ0xK_7n.d.mts.map} +1 -1
- package/dist/psl-build-ClY62mZM.d.mts +157 -0
- package/dist/psl-build-ClY62mZM.d.mts.map +1 -0
- package/dist/{psl-build-BsJ6eChh.mjs → psl-build-pU0gKdVI.mjs} +146 -7
- package/dist/psl-build-pU0gKdVI.mjs.map +1 -0
- package/dist/{psl-field-resolution-o9sXqIlE-BJnlxQ4z.mjs → psl-field-resolution-BOJPyV5I-0zJJ0fOo.mjs} +20 -14
- package/dist/{psl-field-resolution-o9sXqIlE-BJnlxQ4z.mjs.map → psl-field-resolution-BOJPyV5I-0zJJ0fOo.mjs.map} +1 -1
- package/dist/{psl-infer-B6iemK9i.d.mts → psl-infer-1C9FqGO2.d.mts} +3 -3
- package/dist/{psl-infer-B6iemK9i.d.mts.map → psl-infer-1C9FqGO2.d.mts.map} +1 -1
- package/dist/{psl-infer-HPi_YMeE.mjs → psl-infer-CvUWefHM.mjs} +2 -2
- package/dist/{psl-infer-HPi_YMeE.mjs.map → psl-infer-CvUWefHM.mjs.map} +1 -1
- package/dist/{schema-differ-DmP74bB8-BGA6fzOv.d.mts → schema-differ-DmP74bB8-GfOUaGGy.d.mts} +3 -3
- package/dist/{schema-differ-DmP74bB8-BGA6fzOv.d.mts.map → schema-differ-DmP74bB8-GfOUaGGy.d.mts.map} +1 -1
- package/dist/schema-ir.d.mts +2 -2
- package/dist/schema-ir.mjs +1 -1
- package/dist/schema-ir__types.d.mts +3 -3
- package/dist/schema-ir__types.mjs +1 -1
- package/dist/{sql-contract-serializer-sMY3prTx-C8IEwSsf.mjs → sql-contract-serializer-sMY3prTx-BKQ4Yh-n.mjs} +2 -2
- package/dist/{sql-contract-serializer-sMY3prTx-C8IEwSsf.mjs.map → sql-contract-serializer-sMY3prTx-BKQ4Yh-n.mjs.map} +1 -1
- package/dist/{types-c1iIhJep-DdMj6TNl.d.mts → types-Bqe0AXuw-xqQnkIj4.d.mts} +25 -6
- package/dist/types-Bqe0AXuw-xqQnkIj4.d.mts.map +1 -0
- package/dist/types-CTdsm45r.d.mts +1 -0
- package/dist/{types-CaVn_xxe-D9WdU3Iy.mjs → types-CfPB-Kz_-ByWDfwMj.mjs} +31 -6
- package/dist/types-CfPB-Kz_-ByWDfwMj.mjs.map +1 -0
- package/dist/{types-DaYtBAYT-B22gkh5z.d.mts → types-DaYtBAYT-DbsbDMTk.d.mts} +4 -4
- package/dist/{types-DaYtBAYT-B22gkh5z.d.mts.map → types-DaYtBAYT-DbsbDMTk.d.mts.map} +1 -1
- package/dist/{validators-Bvfk0aN7.mjs → validators-V8vN9R85.mjs} +2 -2
- package/dist/{validators-Bvfk0aN7.mjs.map → validators-V8vN9R85.mjs.map} +1 -1
- package/package.json +18 -18
- package/dist/control-ClahTAD-.mjs.map +0 -1
- package/dist/control-adapter-BsSf5pqM.d.mts +0 -1
- package/dist/control-mpACqp72.d.mts.map +0 -1
- package/dist/derived-checks-CrvMQTJF-DlxFFtNM.mjs.map +0 -1
- package/dist/psl-build-BHQfP1_C.d.mts +0 -73
- package/dist/psl-build-BHQfP1_C.d.mts.map +0 -1
- package/dist/psl-build-BsJ6eChh.mjs.map +0 -1
- package/dist/types-BLyhYk6B.d.mts +0 -1
- package/dist/types-CaVn_xxe-D9WdU3Iy.mjs.map +0 -1
- package/dist/types-c1iIhJep-DdMj6TNl.d.mts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"derived-checks-CrvMQTJF-DlxFFtNM.mjs","names":[],"sources":["../../../../2-sql/2-authoring/contract-ts/dist/derived-checks-CrvMQTJF.mjs"],"sourcesContent":["import { encodeEnumTypeMembers, resolveToOneRelationNullable } from \"@internal/contract-authoring\";\nimport { flushAuthoringWarnings, isAuthoringEntityTypeDescriptor } from \"@internal/framework-components/authoring\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { CheckConstraint, Index, SqlStorage, StorageTable, applyFkDefaults, checkConstraintInputFromSerialized, isMaterializedSqlNamespace, resolvedTypeParams, toStorageTypeInstance } from \"@internal/sql-contract/types\";\nimport { isStructuredError, structuredError } from \"@internal/utils/structured-error\";\nimport { asNamespaceId, coreHash, crossRef, effectiveControlPolicy } from \"@internal/contract/types\";\nimport { validateStorageSemantics } from \"@internal/sql-contract/validators\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { buildExecutionSection, computeProfileHash, computeStorageHash } from \"@internal/contract/hashing\";\nimport { mergeCapabilityMatrices } from \"@internal/framework-components/components\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { sqlContractCanonicalizationHooks } from \"@internal/sql-contract/canonicalization-hooks\";\nimport { sqlDataTypeOfCodec, validateSqlTypeParams } from \"@internal/sql-contract/data-type\";\nimport { validateIndexTypes } from \"@internal/sql-contract/index-type-validation\";\nimport { indexTypeRegistryOf } from \"@internal/sql-contract/index-types\";\nimport { invariant } from \"@internal/utils/assertions\";\nimport { compareCodeUnits } from \"@internal/contract/hashing-utils\";\nimport { lowerAuthoredCheck } from \"@internal/sql-contract/authored-check-naming\";\nimport { materializeForeignKeysAndIndexes } from \"@internal/sql-contract/foreign-key-materialization\";\nimport { lowerAuthoredIndex } from \"@internal/sql-contract/index-naming\";\nimport { composeCheckWirePrefix, computeCheckContentHash, derivedCheckPrefixes } from \"@internal/sql-schema-ir/naming\";\nimport { codecForRef, dataTypeParams } from \"@internal/framework-components/codec\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { tableEntityKind, valueSetEntityKind } from \"@internal/sql-contract/entity-kinds\";\nimport { deriveValueSetFromEntity } from \"@internal/sql-contract/value-set-derivation-hook\";\nimport { applySpecifierDefaultControlPolicy } from \"@internal/contract/apply-specifier-default-control-policy\";\n//#region src/contract-errors.ts\nfunction contractError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/contract-definition.ts\n/**\n* Whether a field is stored in a list column. A list of scalars is; a list of value objects is not, because it is stored in one column whose value is the whole list, as one JSON array.\n*/\nfunction storedAsListColumn(field) {\n\treturn field.list && !field.typedByValueObject;\n}\n/** Whether a field or member is typed by a value object. */\nfunction isValueObjectMember(field) {\n\treturn \"valueObjectName\" in field;\n}\n//#endregion\n//#region src/describe-column.ts\n/** Describes one column, declared by a model's field or by a table node. */\nfunction describeColumn(column, site) {\n\treturn {\n\t\tcolumnName: column.columnName,\n\t\tdescriptor: column.descriptor,\n\t\tnullable: column.nullable,\n\t\tmany: column.many === true ? { elementNullable: column.elementNullable === true } : false,\n\t\tdefault: column.default,\n\t\tenumTypeHandle: column.enumTypeHandle,\n\t\tsite\n\t};\n}\n//#endregion\n//#region src/enum-members.ts\n/**\n* The member values a membership check must enforce, encoded exactly as the\n* column stores them. Membership predicates support strings and finite numbers.\n*/\nfunction checkMemberValues(handle, codecLookup) {\n\tconst encoded = encodeEnumTypeMembers(handle, codecLookup, \"the column\").map((member) => member.value);\n\tconst values = [];\n\tfor (const value of encoded) {\n\t\tif (typeof value !== \"string\" && !(typeof value === \"number\" && Number.isFinite(value))) throw contractError(\"CONTRACT.ENUM_INVALID\", `enumType(\"${handle.enumName}\"): CHECK constraint members must encode to strings or finite numbers.`, { meta: {\n\t\t\tenumName: handle.enumName,\n\t\t\treason: \"unsupported-member-value\"\n\t\t} });\n\t\tvalues.push(value);\n\t}\n\treturn values;\n}\n/**\n* The refs of a field typed by an authored enum: the domain enum and its storage value set. Authored enums are registered in the default namespace, whatever namespace the field's model is in.\n*/\nfunction enumValueSetRefs(enumHandle, defaultNamespaceId) {\n\tif (enumHandle === void 0) return void 0;\n\tconst common = {\n\t\tnamespaceId: defaultNamespaceId,\n\t\tentityName: enumHandle.enumName\n\t};\n\treturn {\n\t\tdomain: {\n\t\t\tplane: \"domain\",\n\t\t\tentityKind: \"enum\",\n\t\t\t...common\n\t\t},\n\t\tstorage: {\n\t\t\tplane: \"storage\",\n\t\t\tentityKind: \"valueSet\",\n\t\t\t...common\n\t\t}\n\t};\n}\n//#endregion\n//#region src/domain-fields.ts\nfunction buildDomainField(field, defaultNamespaceId, storageTypes) {\n\tif (isValueObjectMember(field)) return {\n\t\ttype: {\n\t\t\tkind: \"valueObject\",\n\t\t\tname: field.valueObjectName\n\t\t},\n\t\tnullable: field.nullable,\n\t\tmany: field.many ? { elementNullable: field.elementNullable === true } : false\n\t};\n\treturn {\n\t\ttype: {\n\t\t\tkind: \"scalar\",\n\t\t\tcodecId: field.descriptor.codecId,\n\t\t\t...ifDefined(\"typeParams\", resolvedTypeParams(field.descriptor, storageTypes))\n\t\t},\n\t\tnullable: field.nullable,\n\t\tmany: field.many ? { elementNullable: field.elementNullable === true } : false,\n\t\t...ifDefined(\"valueSet\", enumValueSetRefs(field.enumTypeHandle, defaultNamespaceId)?.domain)\n\t};\n}\n//#endregion\n//#region src/declaration-sites.ts\n/** How an error message names the column: `Field \"Model.field\"` or `Column \"table.column\"`. */\nfunction columnSiteSubject(site) {\n\treturn site.kind === \"field\" ? `Field \"${site.modelName}.${site.fieldName}\"` : `Column \"${site.tableName}.${site.columnName}\"`;\n}\n/** The error metadata that locates the column. */\nfunction columnSiteMeta(site) {\n\treturn site.kind === \"field\" ? {\n\t\tmodelName: site.modelName,\n\t\tfieldName: site.fieldName\n\t} : {\n\t\tnamespaceId: site.namespaceId,\n\t\ttableName: site.tableName,\n\t\tcolumnName: site.columnName\n\t};\n}\n/** How an error message names the owner: `model \"User\"` or `table \"audit_rows\" in namespace \"public\"`. */\nfunction referenceOwnerSubject(owner) {\n\treturn owner.kind === \"model\" ? `model \"${owner.modelName}\"` : `table \"${owner.tableName}\" in namespace \"${owner.namespaceId}\"`;\n}\n/** The error metadata that locates the owner. */\nfunction referenceOwnerMeta(owner) {\n\treturn owner.kind === \"model\" ? { sourceModel: owner.modelName } : {\n\t\tsourceTable: owner.tableName,\n\t\tsourceNamespaceId: owner.namespaceId\n\t};\n}\n//#endregion\n//#region src/namespace-id.ts\n/** A declared namespace coordinate, where an omitted or empty one means the target's default namespace. */\nfunction namespaceIdOrDefault(namespaceId, defaultNamespaceId) {\n\treturn namespaceId !== void 0 && namespaceId.length > 0 ? namespaceId : defaultNamespaceId;\n}\n//#endregion\n//#region src/model-references.ts\nfunction assertKnownTargetModel(modelsByName, modelsByCoordinate, owner, targetModelName, targetNamespaceId, context) {\n\tconst targetModel = targetNamespaceId !== void 0 && targetNamespaceId.length > 0 ? modelsByCoordinate.get(`${targetNamespaceId}:${targetModelName}`) : modelsByName.get(targetModelName);\n\tif (!targetModel) {\n\t\tconst qualified = targetNamespaceId !== void 0 && targetNamespaceId.length > 0 ? `${targetNamespaceId}.${targetModelName}` : targetModelName;\n\t\tthrow contractError(\"CONTRACT.MODEL_UNKNOWN\", `${context} on ${referenceOwnerSubject(owner)} references unknown model \"${qualified}\"`, { meta: {\n\t\t\t...referenceOwnerMeta(owner),\n\t\t\ttargetModel: qualified,\n\t\t\tcontext\n\t\t} });\n\t}\n\treturn targetModel;\n}\nfunction assertTargetTableMatches(owner, targetModel, referencedTableName, context) {\n\tif (targetModel.tableName !== referencedTableName) throw contractError(\"CONTRACT.TABLE_MISMATCH\", `${context} on ${referenceOwnerSubject(owner)} references table \"${referencedTableName}\" but model \"${targetModel.modelName}\" maps to \"${targetModel.tableName}\"`, { meta: {\n\t\t...referenceOwnerMeta(owner),\n\t\treferencedTable: referencedTableName,\n\t\tmappedTable: targetModel.tableName,\n\t\tcontext\n\t} });\n}\nfunction modelNamespaceId(model, defaultNamespaceId) {\n\treturn namespaceIdOrDefault(model.namespaceId, defaultNamespaceId);\n}\nfunction modelLookupsOf(definition) {\n\tconst defaultNamespaceId = definition.target.defaultNamespaceId;\n\tconst { models } = definition;\n\treturn {\n\t\tdefaultNamespaceId,\n\t\tmodelsByName: new Map(models.map((m) => [m.modelName, m])),\n\t\tmodelsByCoordinate: new Map(models.map((m) => [`${modelNamespaceId(m, defaultNamespaceId)}:${m.modelName}`, m])),\n\t\ttableNamespaceByName: new Map(models.map((m) => [m.tableName, modelNamespaceId(m, defaultNamespaceId)]))\n\t};\n}\n//#endregion\n//#region src/to-one-nullability-message.ts\nfunction toOneNullabilityContradictionMessage(location, contradiction) {\n\treturn contradiction === \"declared-optional\" ? `${location} is optional but every local field it joins on is required` : `${location} is required but a local field it joins on is nullable`;\n}\n//#endregion\n//#region src/model-relations.ts\nfunction toOneRelationNullable(semanticModel, relation) {\n\tconst location = `Relation \"${semanticModel.modelName}.${relation.fieldName}\"`;\n\tif (relation.nullable === void 0) throw contractError(\"CONTRACT.RELATION_INVALID\", `${location} with cardinality \"${relation.cardinality}\" must state whether it is nullable`, { meta: {\n\t\tmodelName: semanticModel.modelName,\n\t\trelationName: relation.fieldName,\n\t\treason: \"to-one-nullability-missing\"\n\t} });\n\tconst localColumns = relation.on.parentColumns;\n\tconst { contradiction } = resolveToOneRelationNullable({\n\t\tdeclaredNullable: relation.nullable,\n\t\tlocalFieldNullability: semanticModel.fields.filter((field) => localColumns.includes(field.columnName)).map((field) => field.nullable),\n\t\townsReference: relation.cardinality === \"N:1\"\n\t});\n\tif (contradiction !== void 0) throw contractError(\"CONTRACT.RELATION_INVALID\", relation.cardinality === \"N:1\" ? toOneNullabilityContradictionMessage(location, contradiction) : `${location} is required but does not own the foreign key, so nothing in storage guarantees the related row exists`, { meta: {\n\t\tmodelName: semanticModel.modelName,\n\t\trelationName: relation.fieldName,\n\t\treason: \"to-one-nullability-mismatch\"\n\t} });\n\treturn relation.nullable;\n}\nfunction buildThroughDescriptor(through, tableNamespaceByName, targetModel, modelName, fieldName, defaultNamespaceId) {\n\tif (!tableNamespaceByName.has(through.table)) throw contractError(\"CONTRACT.MODEL_UNKNOWN\", `buildSqlContractFromDefinition: junction table \"${through.table}\" for relation \"${modelName}.${fieldName}\" is not a declared model.`, { meta: {\n\t\tsourceModel: modelName,\n\t\trelationName: fieldName,\n\t\tjunctionTable: through.table\n\t} });\n\tconst namespaceId = through.namespaceId ?? defaultNamespaceId;\n\treturn {\n\t\ttable: through.table,\n\t\tnamespaceId,\n\t\tparentColumns: through.parentColumns,\n\t\tchildColumns: through.childColumns,\n\t\ttargetColumns: targetColumnsForJunction(targetModel, fieldName)\n\t};\n}\nfunction targetColumnsForJunction(targetModel, fieldName) {\n\tconst primaryKeyColumns = targetModel.id?.columns;\n\tif (primaryKeyColumns && primaryKeyColumns.length > 0) return primaryKeyColumns;\n\tconst firstUnique = targetModel.uniques?.find((u) => u.columns.length > 0);\n\tif (firstUnique) return firstUnique.columns;\n\tthrow contractError(\"CONTRACT.IDENTITY_INVALID\", `M:N target model \"${targetModel.modelName}\" (relation field \"${fieldName}\") has no primary id or unique key to derive junction targetColumns.`, { meta: {\n\t\tmodelName: targetModel.modelName,\n\t\treason: \"no-key-for-junction-target-columns\"\n\t} });\n}\n/** The field of `model` that maps a relation's join column. A relation joins on fields, so a column no field maps is refused. */\nfunction joinFieldOf(owner, relation, model, columnToField, column) {\n\tconst field = columnToField.get(column);\n\tif (field !== void 0) return field;\n\tthrow contractError(\"CONTRACT.RELATION_INVALID\", `Relation \"${owner.modelName}.${relation.fieldName}\" joins on column \"${column}\" of table \"${model.tableName}\", which no field of model \"${model.modelName}\" maps. A relation joins on fields; declare a field for the column.`, { meta: {\n\t\tmodelName: owner.modelName,\n\t\trelationName: relation.fieldName,\n\t\tcolumn,\n\t\treason: \"join-column-not-a-field\"\n\t} });\n}\n/** Lowers a model's relations. `columnToField` maps the model's columns to the fields that hold them. */\nfunction lowerRelations(semanticModel, columnToField, lookups) {\n\tconst { defaultNamespaceId } = lookups;\n\tconst modelRelations = {};\n\tfor (const relation of semanticModel.relations ?? []) {\n\t\tif (relation.spaceId !== void 0) {\n\t\t\tconst targetNamespaceId = relation.namespaceId ?? defaultNamespaceId;\n\t\t\tconst localFields = relation.on.parentColumns.map((col) => joinFieldOf(semanticModel, relation, semanticModel, columnToField, col));\n\t\t\tmodelRelations[relation.fieldName] = {\n\t\t\t\tto: crossRef(relation.toModel, targetNamespaceId, relation.spaceId),\n\t\t\t\tcardinality: \"N:1\",\n\t\t\t\tnullable: toOneRelationNullable(semanticModel, relation),\n\t\t\t\ton: {\n\t\t\t\t\tlocalFields,\n\t\t\t\t\ttargetFields: relation.on.childColumns\n\t\t\t\t}\n\t\t\t};\n\t\t\tcontinue;\n\t\t}\n\t\tconst owner = {\n\t\t\tkind: \"model\",\n\t\t\tmodelName: semanticModel.modelName\n\t\t};\n\t\tconst targetModel = assertKnownTargetModel(lookups.modelsByName, lookups.modelsByCoordinate, owner, relation.toModel, relation.toNamespaceId, \"Relation\");\n\t\tinvariant(relation.toTable !== void 0, `Relation \"${semanticModel.modelName}.${relation.fieldName}\" is local but carries no target table; only cross-space relations may leave it unset.`);\n\t\tassertTargetTableMatches(owner, targetModel, relation.toTable, \"Relation\");\n\t\tconst targetColumnToField = new Map(targetModel.fields.map((f) => [f.columnName, f.fieldName]));\n\t\tconst to = crossRef(relation.toModel, relation.toNamespaceId !== void 0 && relation.toNamespaceId.length > 0 ? relation.toNamespaceId : modelNamespaceId(targetModel, defaultNamespaceId));\n\t\tconst joinField = (model, fields, column) => joinFieldOf(semanticModel, relation, model, fields, column);\n\t\tconst on = {\n\t\t\tlocalFields: relation.on.parentColumns.map((col) => joinField(semanticModel, columnToField, col)),\n\t\t\ttargetFields: relation.through !== void 0 ? [...relation.on.childColumns] : relation.on.childColumns.map((col) => joinField(targetModel, targetColumnToField, col))\n\t\t};\n\t\tif (relation.cardinality === \"N:M\") {\n\t\t\tif (!relation.through) throw contractError(\"CONTRACT.RELATION_INVALID\", `Relation \"${semanticModel.modelName}.${relation.fieldName}\" with cardinality \"N:M\" requires through metadata`, { meta: {\n\t\t\t\tmodelName: semanticModel.modelName,\n\t\t\t\trelationName: relation.fieldName,\n\t\t\t\treason: \"many-to-many-missing-through\"\n\t\t\t} });\n\t\t\tmodelRelations[relation.fieldName] = {\n\t\t\t\tto,\n\t\t\t\tcardinality: \"N:M\",\n\t\t\t\ton,\n\t\t\t\tthrough: buildThroughDescriptor(relation.through, lookups.tableNamespaceByName, targetModel, semanticModel.modelName, relation.fieldName, defaultNamespaceId)\n\t\t\t};\n\t\t} else if (relation.cardinality === \"1:N\") modelRelations[relation.fieldName] = {\n\t\t\tto,\n\t\t\tcardinality: \"1:N\",\n\t\t\ton\n\t\t};\n\t\telse modelRelations[relation.fieldName] = {\n\t\t\tto,\n\t\t\tcardinality: relation.cardinality,\n\t\t\tnullable: toOneRelationNullable(semanticModel, relation),\n\t\t\ton\n\t\t};\n\t}\n\treturn modelRelations;\n}\n//#endregion\n//#region src/storage-description.ts\n/** The key of a table among all tables of a contract: its namespace and its name. */\nfunction tableKey(namespaceId, tableName) {\n\treturn JSON.stringify([namespaceId, tableName]);\n}\n//#endregion\n//#region src/resolve-foreign-key.ts\n/** Resolves a foreign key's target. A cross-space key keeps its foreign space; a local key names either a model of this definition and that model's table, or a table a model or table node declares. */\nfunction resolveForeignKey(fk, sourceTable, context) {\n\tconst source = {\n\t\tnamespaceId: asNamespaceId(sourceTable.namespaceId),\n\t\ttableName: sourceTable.tableName,\n\t\tcolumns: fk.columns\n\t};\n\tconst options = {\n\t\t...applyFkDefaults({\n\t\t\t...ifDefined(\"constraint\", fk.constraint),\n\t\t\t...ifDefined(\"index\", fk.index)\n\t\t}, context.foreignKeyDefaults),\n\t\t...ifDefined(\"name\", fk.name),\n\t\t...ifDefined(\"onDelete\", fk.onDelete),\n\t\t...ifDefined(\"onUpdate\", fk.onUpdate)\n\t};\n\tif (fk.references.spaceId !== void 0) return {\n\t\tsource,\n\t\ttarget: {\n\t\t\tnamespaceId: asNamespaceId(fk.references.namespaceId ?? context.defaultNamespaceId),\n\t\t\ttableName: fk.references.table,\n\t\t\tcolumns: fk.references.columns,\n\t\t\tspaceId: fk.references.spaceId\n\t\t},\n\t\t...options\n\t};\n\tconst { references } = fk;\n\tif (references.model === void 0) {\n\t\tconst namespaceId = namespaceIdOrDefault(references.namespaceId, context.defaultNamespaceId);\n\t\tif (!context.declaredTables.has(tableKey(namespaceId, references.table))) throw contractError(\"CONTRACT.TABLE_UNKNOWN\", `Foreign key on ${referenceOwnerSubject(sourceTable.owner)} references table \"${references.table}\" in namespace \"${namespaceId}\", which no model or table node declares. Declare the table with a model or a table node, or correct the name.`, { meta: {\n\t\t\t...referenceOwnerMeta(sourceTable.owner),\n\t\t\treferencedTable: references.table,\n\t\t\tnamespaceId\n\t\t} });\n\t\treturn {\n\t\t\tsource,\n\t\t\ttarget: {\n\t\t\t\tnamespaceId: asNamespaceId(namespaceId),\n\t\t\t\ttableName: references.table,\n\t\t\t\tcolumns: references.columns\n\t\t\t},\n\t\t\t...options\n\t\t};\n\t}\n\tconst targetModel = assertKnownTargetModel(context.modelsByName, context.modelsByCoordinate, sourceTable.owner, references.model, fk.references.namespaceId, \"Foreign key\");\n\tassertTargetTableMatches(sourceTable.owner, targetModel, fk.references.table, \"Foreign key\");\n\treturn {\n\t\tsource,\n\t\ttarget: {\n\t\t\tnamespaceId: asNamespaceId(namespaceIdOrDefault(fk.references.namespaceId, modelNamespaceId(targetModel, context.defaultNamespaceId))),\n\t\t\ttableName: fk.references.table,\n\t\t\tcolumns: fk.references.columns\n\t\t},\n\t\t...options\n\t};\n}\n//#endregion\n//#region src/target-authoring-hooks.ts\n/**\n* Resolves a deferred entity-ref column descriptor (e.g. a `pg.enum(handle)`\n* column) against the field's now-known owning namespace: attaches the\n* storage `valueSet` ref the collected entity's derived value-set is stored\n* under. `typeParams.typeName` stays bare here — schema\n* qualification (e.g. `auth.aal_level`) is a target concern applied in the\n* next step, `qualifyColumnDescriptor`. A descriptor with no `entityRef` (the\n* ordinary case) passes through unchanged.\n*/\nfunction resolveEntityRefDescriptor(descriptor, namespaceId) {\n\tconst entityRef = descriptor.entityRef;\n\tif (entityRef === void 0) return descriptor;\n\treturn {\n\t\t...descriptor,\n\t\tvalueSet: {\n\t\t\tplane: \"storage\",\n\t\t\tentityKind: \"valueSet\",\n\t\t\tnamespaceId,\n\t\t\tentityName: entityRef.entityName\n\t\t}\n\t};\n}\n/**\n* Structural check for a target that contributes a `qualifyColumnType` hook\n* on its authoring contributions. Duck-typed (mirroring\n* `contract-psl`'s `hasColumnFromEntityHook`) so the SQL family stays blind\n* to the target's qualification logic and no framework/family interface has\n* to name the hook.\n*/\nfunction hasColumnTypeQualifier(authoring) {\n\treturn \"qualifyColumnType\" in authoring && typeof authoring.qualifyColumnType === \"function\";\n}\n/**\n* Structural check for a target that contributes a `renderCheckExpressions`\n* hook, duck-typed for the same reason {@link hasColumnTypeQualifier} is: the\n* SQL family stays blind to the target's predicate syntax.\n*/\nfunction hasCheckExpressionRenderer(authoring) {\n\treturn \"renderCheckExpressions\" in authoring && typeof authoring.renderCheckExpressions === \"function\";\n}\nfunction resolveCheckExpressionRenderer(target) {\n\tconst authoring = target.authoring;\n\tif (authoring === void 0) return void 0;\n\treturn hasCheckExpressionRenderer(authoring) ? authoring.renderCheckExpressions : void 0;\n}\nfunction resolveColumnTypeQualifier(target) {\n\tconst authoring = target.authoring;\n\tif (authoring === void 0) return void 0;\n\treturn hasColumnTypeQualifier(authoring) ? authoring.qualifyColumnType : void 0;\n}\n/**\n* Applies the target's `qualifyColumnType` hook to a scalar column descriptor.\n* A descriptor whose codec the target leaves unchanged passes through untouched.\n*/\nfunction qualifyColumnDescriptor(descriptor, namespaceId, qualify) {\n\tif (qualify === void 0) return descriptor;\n\tconst qualified = qualify({\n\t\tcodecId: descriptor.codecId,\n\t\t...ifDefined(\"typeParams\", descriptor.typeParams)\n\t}, namespaceId);\n\tif (qualified.typeParams === descriptor.typeParams) return descriptor;\n\treturn {\n\t\t...descriptor,\n\t\t...ifDefined(\"typeParams\", qualified.typeParams)\n\t};\n}\n/**\n* A column's descriptor as its namespace makes it: a deferred entity ref gets its storage value set, and the target's `qualifyColumnType` hook qualifies the type for the namespace.\n*/\nfunction resolveColumnDescriptor(descriptor, namespaceId, qualify) {\n\tconst resolved = resolveEntityRefDescriptor(descriptor, namespaceId);\n\treturn qualifyColumnDescriptor(resolved, resolved.valueSet?.namespaceId ?? namespaceId, qualify);\n}\n//#endregion\n//#region src/describe-model.ts\n/**\n* Converts one model into the storage it implies and its domain model. Other models are read only to resolve the references this one makes to them.\n*/\nfunction describeModel(model, context) {\n\tconst namespaceId = modelNamespaceId(model, context.defaultNamespaceId);\n\tconst { tableName } = model;\n\tconst fieldToColumn = {};\n\tconst domainFields = {};\n\tconst executionDefaults = [];\n\tfor (const field of model.fields) {\n\t\tconst executionDefault = executionDefaultOf(model.modelName, field);\n\t\tfieldToColumn[field.fieldName] = field.columnName;\n\t\tdomainFields[field.fieldName] = buildDomainField(isValueObjectMember(field) ? field : {\n\t\t\t...field,\n\t\t\tdescriptor: resolveColumnDescriptor(field.descriptor, namespaceId, context.qualifyColumnType)\n\t\t}, context.defaultNamespaceId, context.storageTypes);\n\t\tif (executionDefault) executionDefaults.push({\n\t\t\tref: {\n\t\t\t\tnamespace: namespaceId,\n\t\t\t\tentry: tableName,\n\t\t\t\tfield: field.columnName\n\t\t\t},\n\t\t\t...ifDefined(\"onCreate\", executionDefault.onCreate),\n\t\t\t...ifDefined(\"onUpdate\", executionDefault.onUpdate)\n\t\t});\n\t}\n\tconst storage = describeModelStorage(model, namespaceId, (model.foreignKeys ?? []).map((fk) => resolveForeignKey(fk, {\n\t\tnamespaceId,\n\t\ttableName: model.tableName,\n\t\towner: {\n\t\t\tkind: \"model\",\n\t\t\tmodelName: model.modelName\n\t\t}\n\t}, context)));\n\tconst storageFields = {};\n\tfor (const [fieldName, columnName] of Object.entries(fieldToColumn)) storageFields[fieldName] = { column: columnName };\n\tconst columnToField = new Map(Object.entries(fieldToColumn).map(([field, col]) => [col, field]));\n\treturn {\n\t\tstorage,\n\t\tdomain: {\n\t\t\tnamespaceId,\n\t\t\tmodelName: model.modelName,\n\t\t\tmodel: {\n\t\t\t\tstorage: {\n\t\t\t\t\ttable: tableName,\n\t\t\t\t\tnamespaceId,\n\t\t\t\t\tfields: storageFields\n\t\t\t\t},\n\t\t\t\tfields: domainFields,\n\t\t\t\trelations: lowerRelations(model, columnToField, context)\n\t\t\t},\n\t\t\texecutionDefaults\n\t\t}\n\t};\n}\n/**\n* Single-table-inheritance variants share their base model's table: the variant's columns must already be on that table, and it has no table of its own. That leaves an authored check nowhere to attach, so it is refused here as a backstop; the PSL surface refuses it earlier, at interpretation, with a diagnostic that names the base model.\n*/\nfunction describeModelStorage(model, namespaceId, foreignKeys) {\n\tconst { tableName } = model;\n\tconst columns = model.fields.map((field) => describeFieldColumn(model.modelName, field));\n\tif (model.sharesBaseTable) {\n\t\tif (model.checks && model.checks.length > 0) throw contractError(\"CONTRACT.CHECK_ON_STI_VARIANT\", `Model \"${model.modelName}\" declares a check constraint but shares its base model's storage table (single-table inheritance) and has no table of its own to declare it on. Declare the check on the base model instead.`, { meta: {\n\t\t\ttableName,\n\t\t\tmodelName: model.modelName\n\t\t} });\n\t\treturn {\n\t\t\tkind: \"baseTable\",\n\t\t\tmodelName: model.modelName,\n\t\t\tnamespaceId,\n\t\t\ttableName,\n\t\t\tcolumns\n\t\t};\n\t}\n\treturn {\n\t\tkind: \"ownTable\",\n\t\tmodelName: model.modelName,\n\t\ttable: {\n\t\t\tnamespaceId,\n\t\t\ttableName,\n\t\t\tcolumns,\n\t\t\tcontrol: model.control,\n\t\t\tid: model.id,\n\t\t\tuniques: model.uniques ?? [],\n\t\t\tindexes: model.indexes ?? [],\n\t\t\tchecks: model.checks ?? [],\n\t\t\tforeignKeys\n\t\t}\n\t};\n}\nfunction describeFieldColumn(modelName, field) {\n\tconst site = {\n\t\tkind: \"field\",\n\t\tmodelName,\n\t\tfieldName: field.fieldName\n\t};\n\tif (isValueObjectMember(field)) return describeColumn({\n\t\tcolumnName: field.columnName,\n\t\tdescriptor: field.descriptor,\n\t\tnullable: field.nullable,\n\t\t...ifDefined(\"default\", field.default)\n\t}, site);\n\treturn describeColumn(field, site);\n}\n/** The phases a generated default fills the field on, refused alongside a default or on an optional field. */\nfunction executionDefaultOf(modelName, field) {\n\tconst phases = field.executionDefaults?.onCreate || field.executionDefaults?.onUpdate ? field.executionDefaults : void 0;\n\tif (phases === void 0) return void 0;\n\tif (field.default !== void 0) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${modelName}.${field.fieldName}\" cannot define both default and executionDefaults.`, { meta: {\n\t\tmodelName,\n\t\tfieldName: field.fieldName,\n\t\treason: \"default-and-executionDefaults\"\n\t} });\n\tif (field.nullable) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${modelName}.${field.fieldName}\" is filled on write by a generated default (a preset such as temporal.createdAt() or an id generator), so it cannot be optional; remove .optional().`, { meta: {\n\t\tmodelName,\n\t\tfieldName: field.fieldName,\n\t\treason: \"nullable-with-executionDefaults\"\n\t} });\n\treturn phases;\n}\n//#endregion\n//#region src/describe-table-node.ts\n/** Describes a table node: its columns, and its foreign keys resolved against the definition's models and tables. */\nfunction describeTableNode(table, context) {\n\tconst namespaceId = namespaceIdOrDefault(table.namespaceId, context.defaultNamespaceId);\n\tconst { tableName } = table;\n\tconst owner = {\n\t\tkind: \"tableNode\",\n\t\tnamespaceId,\n\t\ttableName\n\t};\n\treturn {\n\t\tnamespaceId,\n\t\ttableName,\n\t\tcolumns: table.columns.map((column) => describeColumn(column, {\n\t\t\tkind: \"tableNode\",\n\t\t\tnamespaceId,\n\t\t\ttableName,\n\t\t\tcolumnName: column.columnName\n\t\t})),\n\t\tid: table.id,\n\t\tuniques: table.uniques ?? [],\n\t\tindexes: table.indexes ?? [],\n\t\tchecks: table.checks ?? [],\n\t\tforeignKeys: (table.foreignKeys ?? []).map((fk) => resolveForeignKey(fk, {\n\t\t\tnamespaceId,\n\t\t\ttableName,\n\t\t\towner\n\t\t}, context)),\n\t\tcontrol: table.control\n\t};\n}\n//#endregion\n//#region src/column-defaults.ts\n/**\n* The codec that encodes one column's default, built with the column's own `typeParams`, because a parameterized codec checks its params when it encodes and reads a default. Only a column has params; every other encode site takes the representative instance.\n*/\nfunction columnCodec(codecId, typeParams, codecLookup) {\n\treturn codecForRef(codecLookup, {\n\t\tcodecId,\n\t\t...ifDefined(\"typeParams\", typeParams === void 0 ? void 0 : blindCast(typeParams))\n\t});\n}\n/** The JSON the contract stores for a value: the codec gives the value of its data type under the column's parameters, which the type refuses when they exclude it, and the codec reads it back, refusing a value its application value cannot hold. */\nfunction encodeViaCodec(value, codec) {\n\tif (codec) {\n\t\tconst stored = codec.toDataTypeValue(value);\n\t\tcodec.fromDataTypeValue(stored);\n\t\treturn codec.dataType.toContract(stored);\n\t}\n\treturn blindCast(value);\n}\nfunction defaultRefusal(site, cause, elementPosition) {\n\tconst subject = elementPosition === void 0 ? \"default\" : `default (element ${elementPosition})`;\n\tconst reason = cause instanceof Error ? cause.message : String(cause);\n\treturn contractError(\"CONTRACT.DEFAULT_INVALID\", `${columnSiteSubject(site)} has a ${subject} that its codec refuses: ${reason}`, {\n\t\tcause,\n\t\tmeta: {\n\t\t\t...columnSiteMeta(site),\n\t\t\tcodecId: site.codecId,\n\t\t\treason: \"codec-refused-default\",\n\t\t\t...ifDefined(\"elementPosition\", elementPosition)\n\t\t}\n\t});\n}\nfunction encodeDefaultValue(value, codec, site, elementPosition) {\n\ttry {\n\t\treturn encodeViaCodec(value, codec);\n\t} catch (cause) {\n\t\tif (cause instanceof InternalError) throw cause;\n\t\tthrow defaultRefusal(site, cause, elementPosition);\n\t}\n}\nfunction codecForDefault(codecLookup, resolveCodec, site) {\n\tconst codec = buildCodecForDefault(codecLookup, resolveCodec, site);\n\tif (codec === void 0) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `${columnSiteSubject(site)} has a default, but no pack in the contract declares its codec \"${site.codecId}\", so the default cannot be checked. List the pack that owns the codec in \\`extensions\\`.`, { meta: {\n\t\t...columnSiteMeta(site),\n\t\tcodecId: site.codecId,\n\t\treason: \"codec-not-found\"\n\t} });\n\treturn codec;\n}\nfunction buildCodecForDefault(codecLookup, resolveCodec, site) {\n\ttry {\n\t\treturn resolveCodec(codecLookup);\n\t} catch (cause) {\n\t\tif (!isStructuredError(cause) || cause.code !== \"RUNTIME.TYPE_PARAMS_INVALID\") throw cause;\n\t\tthrow contractError(\"CONTRACT.ARGUMENT_INVALID\", `${columnSiteSubject(site)} has type parameters that its codec does not accept: ${cause.message}`, {\n\t\t\tcause,\n\t\t\tmeta: {\n\t\t\t\t...columnSiteMeta(site),\n\t\t\t\tcodecId: site.codecId,\n\t\t\t\treason: \"type-params-invalid\"\n\t\t\t}\n\t\t});\n\t}\n}\nfunction encodeColumnDefault(defaultInput, codecLookup, resolveCodec, site, many = false, elementNullable = false) {\n\tif (defaultInput.kind === \"function\") return {\n\t\tkind: \"function\",\n\t\texpression: defaultInput.expression\n\t};\n\tif (\"inStoredForm\" in defaultInput && defaultInput.inStoredForm === true) return {\n\t\tkind: \"literal\",\n\t\tvalue: blindCast(defaultInput.value)\n\t};\n\tif (many) {\n\t\tif (!Array.isArray(defaultInput.value)) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `${columnSiteSubject(site)} is a list field, so its default is an array; received ${typeof defaultInput.value}. Call .many() before .default().`, { meta: {\n\t\t\t...columnSiteMeta(site),\n\t\t\tcodecId: site.codecId,\n\t\t\treason: \"list-default-not-array\"\n\t\t} });\n\t\tconst codec = codecForDefault(codecLookup, resolveCodec, site);\n\t\treturn {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: defaultInput.value.map((element, index) => {\n\t\t\t\tif (element !== null) return encodeDefaultValue(element, codec, site, index + 1);\n\t\t\t\tif (elementNullable) return null;\n\t\t\t\tthrow new InternalError(\"Literal default on a strict list column cannot contain null elements.\");\n\t\t\t})\n\t\t};\n\t}\n\treturn {\n\t\tkind: \"literal\",\n\t\tvalue: encodeDefaultValue(defaultInput.value, codecForDefault(codecLookup, resolveCodec, site), site)\n\t};\n}\n//#endregion\n//#region src/pack-entities.ts\n/**\n* Records a deferred column's entity-ref into the namespace-scoped collection\n* accumulator (`namespaceId → entityKind → entityName`) — folded into the same\n* namespace assembly `deriveEntityValueSets`/`entries.<kind>` step as the\n* entities-channel attachments, so a column-collected entity gets its\n* value-set the same way an entities-channel one does.\n*\n* The same handle reused by many columns in one namespace is normal (a native\n* enum type backs any number of columns) and records the identical entity once.\n* Two *different* entity instances sharing a name+kind in one namespace is a\n* name collision — the emitted `entries.valueSet.<name>` could only reflect one\n* of them, silently mismatching the other column's type/cast. PSL hard-errors\n* on the equivalent (`PSL_DUPLICATE_DECLARATION`); the TS path rejects it too.\n*/\nfunction collectEntityFromColumn(collected, namespaceId, entityRef) {\n\tconst forNs = collected[namespaceId] ?? {};\n\tconst forKind = forNs[entityRef.entityKind] ?? {};\n\tconst existing = forKind[entityRef.entityName];\n\tif (existing !== void 0 && existing !== entityRef.entity) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `buildSqlContractFromDefinition: two different \"${entityRef.entityKind}\" entities named \"${entityRef.entityName}\" in namespace \"${namespaceId}\" — pack-entity names must be unique per namespace.`, { meta: {\n\t\tkind: entityRef.entityKind,\n\t\tname: entityRef.entityName,\n\t\tnamespaceId\n\t} });\n\tforKind[entityRef.entityName] = entityRef.entity;\n\tforNs[entityRef.entityKind] = forKind;\n\tcollected[namespaceId] = forNs;\n}\n/**\n* Merges a namespace's entities-channel attachments (lowered from the\n* `entities` handle list, carried on `ContractDefinition.attachedEntities`)\n* with the entities collected from that namespace's deferred entity-ref\n* columns. A column-collected entity that shadows a *different* attached\n* entity of the same kind+name (or vice-versa) is the same name-collision bug\n* `collectEntityFromColumn` guards against across columns, so it is rejected\n* the same way — by entity identity, so the same handle attached and used by\n* a column does not throw.\n*/\nfunction mergeColumnAndAttachedEntities(namespaceId, attached, columnCollected) {\n\tif (attached === void 0) return columnCollected;\n\tif (columnCollected === void 0) return attached;\n\tconst kinds = /* @__PURE__ */ new Set([...Object.keys(attached), ...Object.keys(columnCollected)]);\n\tconst result = {};\n\tfor (const kind of kinds) {\n\t\tconst attachedForKind = attached[kind];\n\t\tconst columnForKind = columnCollected[kind];\n\t\tfor (const [name, entity] of Object.entries(columnForKind ?? {})) {\n\t\t\tconst existing = attachedForKind?.[name];\n\t\t\tif (existing !== void 0 && existing !== entity) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `buildSqlContractFromDefinition: two different \"${kind}\" entities named \"${name}\" in namespace \"${namespaceId}\" — a column-referenced entity conflicts with an attached one; pack-entity names must be unique per namespace.`, { meta: {\n\t\t\t\tkind,\n\t\t\t\tname,\n\t\t\t\tnamespaceId\n\t\t\t} });\n\t\t}\n\t\tresult[kind] = {\n\t\t\t...attachedForKind,\n\t\t\t...columnForKind\n\t\t};\n\t}\n\treturn result;\n}\n/**\n* Entry kinds the framework assembler itself manages (`table` from models,\n* `valueSet` from `enums` and attached-entity value-set derivation). A\n* pack-attached entity claiming one of these would silently clobber or be\n* clobbered by the managed slot, so it is rejected outright.\n*/\nconst MANAGED_ENTRY_KINDS = /* @__PURE__ */ new Set([tableEntityKind.kind, valueSetEntityKind.kind]);\nfunction assertNoManagedEntityKinds(namespaceId, entitiesForNs) {\n\tif (entitiesForNs === void 0) return;\n\tfor (const kind of Object.keys(entitiesForNs)) if (MANAGED_ENTRY_KINDS.has(kind)) throw contractError(\"CONTRACT.ENTITY_KIND_INVALID\", `buildSqlContractFromDefinition: attached entity in namespace \"${namespaceId}\" declares entry kind \"${kind}\", which is managed by the framework (table/valueSet) and cannot be attached.`, { meta: {\n\t\tentityKind: kind,\n\t\tnamespaceId\n\t} });\n}\n/**\n* Walks the flat `entityTypes` namespace tree contributed by the target pack\n* and every extension pack, indexing descriptors by their `discriminator` —\n* the same string a pack entity's entries-map key (`entries.<kind>`) uses.\n* Mirrors `contract-psl`'s `buildEntityTypesByDiscriminator`, recomposed here\n* from the packs `ContractDefinition` already carries (`target` +\n* `extensions`) since the TS assembler has no single pre-merged\n* `AuthoringContributions` input to read the way the PSL interpreter does.\n*/\nfunction collectEntityTypeDescriptorsByDiscriminator(definition) {\n\tconst result = /* @__PURE__ */ new Map();\n\tconst walk = (namespace) => {\n\t\tfor (const value of Object.values(namespace)) if (isAuthoringEntityTypeDescriptor(value)) result.set(value.discriminator, value);\n\t\telse walk(value);\n\t};\n\tconst components = [definition.target, ...Object.values(definition.extensions ?? {})];\n\tfor (const component of components) {\n\t\tconst entityTypes = component.authoring?.entityTypes;\n\t\tif (entityTypes !== void 0) walk(entityTypes);\n\t}\n\treturn result;\n}\n/**\n* Derives value-sets for every pack entity declared in one namespace,\n* reusing the same `SqlValueSetDerivingEntityTypeOutput.deriveValueSet` hook\n* `contract-psl`'s `lowerExtensionBlocksForNamespace` folds into\n* `entries.valueSet` on the PSL path — so a TS-attached entity (e.g. a\n* native enum) gets its value-set the same way. Entity kinds with no\n* registered descriptor, or whose descriptor output doesn't derive a\n* value-set, contribute nothing.\n*/\nfunction deriveEntityValueSets(entitiesForNs, entityTypesByDiscriminator) {\n\tif (entitiesForNs === void 0) return void 0;\n\tlet result;\n\tfor (const [kind, entitiesByName] of Object.entries(entitiesForNs)) {\n\t\tconst descriptor = entityTypesByDiscriminator.get(kind);\n\t\tif (descriptor === void 0) continue;\n\t\tfor (const [name, entity] of Object.entries(entitiesByName)) {\n\t\t\tconst derivedValueSet = deriveValueSetFromEntity(descriptor.output, entity);\n\t\t\tif (derivedValueSet === void 0) continue;\n\t\t\tresult ??= {};\n\t\t\tresult[name] = derivedValueSet;\n\t\t}\n\t}\n\treturn result;\n}\n/**\n* Merges a namespace's `enumType()`-derived value-sets with its pack-entity-\n* derived value-sets. Both land in the same `entries.valueSet[name]` slot —\n* which drives value-set → codec typing and the domain-enum CHECK — so a\n* same-named entry in both would let one silently overwrite the other and\n* corrupt whichever column resolves against it. The same collision class the\n* `mergeColumnAndAttachedEntities` guard rejects; the PSL path already hard-errors\n* on the equivalent (`interpretPslDocumentToSqlContract`). Reject it here too.\n*/\nfunction mergeNamespaceValueSets(namespaceId, enumValueSets, packValueSets) {\n\tif (enumValueSets !== void 0 && packValueSets !== void 0) {\n\t\tfor (const name of Object.keys(packValueSets)) if (Object.hasOwn(enumValueSets, name)) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `buildSqlContractFromDefinition: value-set \"${name}\" in namespace \"${namespaceId}\" is derived from both an enum and a pack entity — names must be unique per namespace.`, { meta: {\n\t\t\tkind: \"valueSet\",\n\t\t\tname,\n\t\t\tnamespaceId\n\t\t} });\n\t}\n\treturn {\n\t\t...enumValueSets,\n\t\t...packValueSets\n\t};\n}\n//#endregion\n//#region src/lower-column.ts\n/**\n* Names the target's rendered checks and lowers them into contract entities.\n*\n* Naming is composed family-side ({@link composeCheckWirePrefix}) rather than\n* by the target, and suffixed with the predicate's content hash. Composing\n* family-side is what makes the truncation safe — two prefixes that truncate\n* alike still differ in their hashes, and the family can see that the\n* (table, column, kind) triple they were built from is unique per table,\n* rather than having to assume something about SQL text it declares itself\n* unable to read.\n*/\nfunction lowerRenderedChecks(tableName, candidates) {\n\treturn candidates.map((candidate) => new CheckConstraint({\n\t\tnaming: {\n\t\t\tkind: \"wire\",\n\t\t\tprefix: composeCheckWirePrefix(tableName, candidate.columnName, candidate.kind),\n\t\t\thash: computeCheckContentHash(candidate.expression)\n\t\t},\n\t\texpression: candidate.expression\n\t}));\n}\nfunction validateColumnTypeParams(dataType, typeParams, site) {\n\ttry {\n\t\tvalidateSqlTypeParams(dataType, dataTypeParams(dataType, typeParams));\n\t} catch (cause) {\n\t\tif (!isStructuredError(cause) || cause.code !== \"CONTRACT.TYPE_PARAMS_INVALID\") throw cause;\n\t\tthrow contractError(\"CONTRACT.TYPE_PARAMS_INVALID\", `${columnSiteSubject(site)} has type parameters that its data type does not accept: ${cause.message}`, {\n\t\t\tcause,\n\t\t\tmeta: {\n\t\t\t\t...cause.meta,\n\t\t\t\t...columnSiteMeta(site)\n\t\t\t}\n\t\t});\n\t}\n}\n/**\n* Lowers one column into its storage column and the enforcement checks its shape derives.\n*\n* A column whose type constructor refers to a pack entity (e.g. `pg.enum(handle)`) records that entity, and its descriptor is resolved against the column's namespace and handed to the target's `qualifyColumnType` hook. An opt-out from derived checks on a table that derives none is dropped, never persisted: the policy may also be stamped after the build by a specifier.\n*\n* Member values reach the check renderer only for a column typed by an `enumType()` handle: that column is a plain scalar with no native type of its own to enforce membership. A value set resolved by a type constructor binds the column to a native type that already enforces it.\n*/\nfunction lowerColumn(description, placement, context) {\n\tconst { site, many } = description;\n\tconst { codecLookup } = context.lookups;\n\tconst entityRef = description.descriptor.entityRef;\n\tif (entityRef !== void 0) collectEntityFromColumn(context.collectedColumnEntities, placement.namespaceId, entityRef);\n\tconst descriptor = resolveColumnDescriptor(description.descriptor, placement.namespaceId, context.qualifyColumnType);\n\tconst elementNullable = many !== false && many.elementNullable;\n\tconst codecId = descriptor.codecId;\n\tconst typeParams = resolvedTypeParams(descriptor, context.storageTypes);\n\tconst dataType = sqlDataTypeOfCodec(codecId, context.lookups);\n\tvalidateColumnTypeParams(dataType, typeParams, site);\n\tconst encodedDefault = description.default !== void 0 ? encodeColumnDefault(description.default, codecLookup, (lookup) => columnCodec(codecId, typeParams, lookup), {\n\t\t...site,\n\t\tcodecId\n\t}, many !== false, elementNullable) : void 0;\n\tconst enumRefs = enumValueSetRefs(description.enumTypeHandle, context.defaultNamespaceId);\n\tinvariant(enumRefs === void 0 || descriptor.valueSet === void 0, `${columnSiteSubject(site)} is typed by a domain enum and also carries a storage value set from its type constructor.`);\n\tconst valueSet = enumRefs?.storage ?? descriptor.valueSet;\n\tconst column = {\n\t\tdataType: dataType.id,\n\t\tcodecId,\n\t\tnullable: description.nullable,\n\t\tmany,\n\t\t...ifDefined(\"typeParams\", descriptor.typeParams),\n\t\t...ifDefined(\"default\", encodedDefault),\n\t\t...ifDefined(\"typeRef\", descriptor.typeRef),\n\t\t...ifDefined(\"valueSet\", valueSet)\n\t};\n\tconst render = context.renderCheckExpressions;\n\tif (render === void 0 || !placement.derivesChecks) return {\n\t\tcolumn,\n\t\tderivedChecks: []\n\t};\n\tconst { enumTypeHandle } = description;\n\tconst candidates = render({\n\t\ttableName: placement.tableName,\n\t\tcolumnName: description.columnName,\n\t\tmany: many !== false,\n\t\telementNullable,\n\t\tmemberValues: enumTypeHandle !== void 0 ? checkMemberValues(enumTypeHandle, codecLookup) : void 0\n\t});\n\treturn {\n\t\tcolumn,\n\t\tderivedChecks: lowerRenderedChecks(placement.tableName, candidates)\n\t};\n}\n//#endregion\n//#region src/lower-table.ts\nconst DERIVABLE_CHECK_KINDS = [\"membership\", \"elementNotNull\"];\n/**\n* Which of `columnNames` could have produced `prefix` for some\n* {@link CheckKind} — the reverse of {@link derivedCheckPrefixes}, used only\n* to name the collision in `CONTRACT.CHECK_NAME_RESERVED`'s message. Callers\n* already know `prefix` is a member of `derivedCheckPrefixes(tableName,\n* columnNames)`, so the result is never empty.\n*/\nfunction columnsProducingCheckPrefix(tableName, columnNames, prefix) {\n\treturn columnNames.filter((columnName) => DERIVABLE_CHECK_KINDS.some((kind) => composeCheckWirePrefix(tableName, columnName, kind) === prefix));\n}\n/**\n* Lowers one table: each of its columns, then its indexes, checks, primary key, uniques and foreign keys, with the backing indexes its foreign keys need.\n*\n* Checks are derived only for tables Prisma 8 owns: the contract describes an external schema, it does not prescribe enforcement for it. This reads the policy the source declares; a policy applied by a contract specifier lands after the build and is handled by `stripDerivedChecksFromNonManagedTables`. Authored checks are kept whatever the policy: they are the author's statement about a constraint they know exists.\n*/\nfunction lowerTable(table, context) {\n\tconst { tableName } = table;\n\tconst derivesChecks = effectiveControlPolicy(table.control, context.defaultControlPolicy) === \"managed\";\n\tconst placement = {\n\t\tnamespaceId: table.namespaceId,\n\t\ttableName,\n\t\tderivesChecks\n\t};\n\tconst columns = {};\n\tconst checks = [];\n\tfor (const description of table.columns) {\n\t\tconst lowered = lowerColumn(description, placement, context);\n\t\tcolumns[description.columnName] = lowered.column;\n\t\tchecks.push(...lowered.derivedChecks);\n\t}\n\tconst uniques = table.uniques.map((u) => ({\n\t\tcolumns: u.columns,\n\t\t...ifDefined(\"name\", u.name)\n\t}));\n\tconst declaredIndexes = table.indexes.map((index) => ({\n\t\tnamedByUser: index.name !== void 0 || index.map !== void 0,\n\t\tindex: lowerAuthoredIndex(tableName, authoredIndexInput(index), context.warnings, context.indexTypeRegistry)\n\t}));\n\tchecks.push(...lowerAuthoredChecks(tableName, Object.keys(columns), table.checks, context));\n\tconst primaryKey = table.id ? {\n\t\tcolumns: table.id.columns,\n\t\t...ifDefined(\"name\", table.id.name)\n\t} : void 0;\n\tconst { foreignKeys, indexes } = materializeForeignKeysAndIndexes({\n\t\ttableName,\n\t\tforeignKeys: table.foreignKeys,\n\t\tdeclaredIndexes,\n\t\tuniques,\n\t\tprimaryKey,\n\t\twarnings: context.warnings,\n\t\tindexTypes: context.indexTypeRegistry\n\t});\n\treturn {\n\t\tcolumns,\n\t\t...ifDefined(\"control\", table.control),\n\t\tuniques,\n\t\tindexes: indexes.map((i) => new Index(i)),\n\t\tforeignKeys,\n\t\t...primaryKey ? { primaryKey } : {},\n\t\t...checks.length > 0 ? { checks: inCanonicalOrder(checks) } : {}\n\t};\n}\n/**\n* The checks sorted by name in UTF-16 code-unit order, the order contract canonicalization gives them. The table's storage is then the same whichever declaration each column came from and in whatever order the columns were listed.\n*/\nfunction inCanonicalOrder(checks) {\n\treturn [...checks].sort((a, b) => compareCodeUnits(a.name, b.name));\n}\nfunction authoredIndexInput(index) {\n\treturn blindCast({\n\t\t...ifDefined(\"columns\", index.columns),\n\t\t...ifDefined(\"expression\", index.expression),\n\t\twhere: index.where,\n\t\tunique: index.unique,\n\t\tmap: index.map,\n\t\tname: index.name,\n\t\ttype: index.type,\n\t\toptions: index.options\n\t});\n}\n/** Names the authored checks, and refuses one whose name could be taken for a derived check of a column of this table. */\nfunction lowerAuthoredChecks(tableName, tableColumnNames, authoredChecks, context) {\n\tif (authoredChecks.length === 0) return [];\n\tconst reservedCheckPrefixes = derivedCheckPrefixes(tableName, tableColumnNames);\n\treturn authoredChecks.map((authoredCheck) => {\n\t\tconst lowered = lowerAuthoredCheck(tableName, authoredCheck, context.warnings);\n\t\tif (lowered.naming.kind === \"wire\" && reservedCheckPrefixes.has(lowered.naming.prefix)) {\n\t\t\tconst collidingColumns = columnsProducingCheckPrefix(tableName, tableColumnNames, lowered.naming.prefix);\n\t\t\tconst columnList = collidingColumns.map((name) => `\"${name}\"`).join(\", \");\n\t\t\tthrow contractError(\"CONTRACT.CHECK_NAME_RESERVED\", `Check \"${lowered.naming.prefix}\" on table \"${tableName}\": this name's prefix matches the shape a derived enforcement check would use for column${collidingColumns.length === 1 ? \"\" : \"s\"} ${columnList} of this table, so it can't be told apart from one. Choose a different name.`, { meta: {\n\t\t\t\ttableName,\n\t\t\t\tprefix: lowered.naming.prefix,\n\t\t\t\tcollidingColumns\n\t\t\t} });\n\t\t}\n\t\treturn new CheckConstraint(lowered);\n\t});\n}\n//#endregion\n//#region src/merge-tables.ts\n/** How a refusal names each table-level property. Typed by every key of {@link TableProperties}, so a new property cannot be left out of the check. */\nconst tablePropertyLabels = {\n\tid: \"a primary key\",\n\tuniques: \"unique constraints\",\n\tindexes: \"indexes\",\n\tchecks: \"check constraints\",\n\tforeignKeys: \"foreign keys\",\n\tcontrol: \"a control policy\"\n};\nfunction isTableProperty(key) {\n\treturn Object.hasOwn(tablePropertyLabels, key);\n}\n/**\n* Collects the tables the models and table nodes describe, one per namespace and table name: the models' tables in model order, then the tables only table nodes declare.\n*\n* A table node for a table a model maps adds its columns to that table and nothing else, because the model owns the table's table-level properties. A table node for any other table is the whole table. A single-table variant adds nothing: each of its columns must already be on its base's table, which the base owns, and no table node may declare a column a variant's field maps. A variant whose table no model owns is not checked.\n*\n* Every table comes out with its foreign keys from exactly one declaration, a model or a table node, in the order that declaration lists them.\n*/\nfunction mergeTables(storages, tableNodes) {\n\tconst tables = /* @__PURE__ */ new Map();\n\tconst modelOfTable = /* @__PURE__ */ new Map();\n\tfor (const storage of storages) {\n\t\tif (storage.kind !== \"ownTable\") continue;\n\t\tconst { table } = storage;\n\t\tconst key = tableKey(table.namespaceId, table.tableName);\n\t\tif (tables.has(key)) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `buildSqlContractFromDefinition: duplicate table \"${table.tableName}\" in namespace \"${table.namespaceId}\".`, { meta: {\n\t\t\tkind: \"table\",\n\t\t\tname: table.tableName,\n\t\t\tnamespaceId: table.namespaceId\n\t\t} });\n\t\ttables.set(key, table);\n\t\tmodelOfTable.set(key, storage.modelName);\n\t}\n\tconst variants = storages.filter((storage) => storage.kind === \"baseTable\");\n\tconst variantColumnSites = variantColumnSitesByTable(variants);\n\tconst tableNodeKeys = /* @__PURE__ */ new Set();\n\tfor (const tableNode of tableNodes) {\n\t\tconst key = tableKey(tableNode.namespaceId, tableNode.tableName);\n\t\tif (tableNodeKeys.has(key)) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `Table \"${tableNode.tableName}\" in namespace \"${tableNode.namespaceId}\" is declared by two table nodes.`, { meta: {\n\t\t\tkind: \"table\",\n\t\t\tname: tableNode.tableName,\n\t\t\tnamespaceId: tableNode.namespaceId\n\t\t} });\n\t\ttableNodeKeys.add(key);\n\t\tconst columnSites = variantColumnSites.get(key) ?? /* @__PURE__ */ new Map();\n\t\tconst modelName = modelOfTable.get(key);\n\t\tconst modelled = tables.get(key);\n\t\tif (modelName === void 0 || modelled === void 0) {\n\t\t\ttables.set(key, {\n\t\t\t\t...tableNode,\n\t\t\t\tcolumns: withColumns([], tableNode, columnSites)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tassertOnlyColumns(tableNode, modelName);\n\t\ttables.set(key, {\n\t\t\t...modelled,\n\t\t\tcolumns: withColumns(modelled.columns, tableNode, columnSites)\n\t\t});\n\t}\n\tfor (const variant of variants) {\n\t\tconst table = tables.get(tableKey(variant.namespaceId, variant.tableName));\n\t\tif (table !== void 0) assertVariantColumnsOnBaseTable(variant, table);\n\t}\n\treturn [...tables.values()];\n}\n/** For each table, the variant field that maps each variant column; the first variant to map a column names it. */\nfunction variantColumnSitesByTable(variants) {\n\tconst sites = /* @__PURE__ */ new Map();\n\tfor (const variant of variants) {\n\t\tconst key = tableKey(variant.namespaceId, variant.tableName);\n\t\tconst byColumn = sites.get(key) ?? /* @__PURE__ */ new Map();\n\t\tfor (const column of variant.columns) if (!byColumn.has(column.columnName)) byColumn.set(column.columnName, column.site);\n\t\tsites.set(key, byColumn);\n\t}\n\treturn sites;\n}\n/**\n* The table's columns with the table node's columns added. A column some field already declares is refused, and the error names the field the author wrote: a single-table variant's field when a variant maps the column, even though the base table carries a copy of it.\n*/\nfunction withColumns(columns, tableNode, variantColumnSites) {\n\tconst sites = new Map(columns.map((column) => [column.columnName, column.site]));\n\tfor (const column of tableNode.columns) {\n\t\tconst earlier = variantColumnSites.get(column.columnName) ?? sites.get(column.columnName);\n\t\tif (earlier !== void 0) {\n\t\t\tconst problem = earlier.kind === \"field\" ? `is declared by field \"${earlier.modelName}.${earlier.fieldName}\" and again by a table node` : \"is listed twice by its table node\";\n\t\t\tthrow contractError(\"CONTRACT.NAME_DUPLICATE\", `Column \"${column.columnName}\" of table \"${tableNode.tableName}\" ${problem}.`, { meta: {\n\t\t\t\tkind: \"column\",\n\t\t\t\tname: column.columnName,\n\t\t\t\ttableName: tableNode.tableName,\n\t\t\t\tnamespaceId: tableNode.namespaceId\n\t\t\t} });\n\t\t}\n\t\tsites.set(column.columnName, column.site);\n\t}\n\treturn [...columns, ...tableNode.columns];\n}\nfunction isStated(value) {\n\treturn Array.isArray(value) ? value.length > 0 : value !== void 0;\n}\nfunction assertOnlyColumns(tableNode, modelName) {\n\tconst property = Object.keys(tablePropertyLabels).filter(isTableProperty).find((name) => isStated(tableNode[name]));\n\tif (property === void 0) return;\n\tthrow contractError(\"CONTRACT.TABLE_OWNED_BY_MODEL\", `A table node for table \"${tableNode.tableName}\" states ${tablePropertyLabels[property]}, but model \"${modelName}\" maps that table and owns its table-level properties. A table node for a modelled table may only add columns.`, { meta: {\n\t\tnamespaceId: tableNode.namespaceId,\n\t\ttableName: tableNode.tableName,\n\t\tmodelName,\n\t\tproperty\n\t} });\n}\nfunction assertVariantColumnsOnBaseTable(variant, table) {\n\tconst present = new Set(table.columns.map((column) => column.columnName));\n\tconst missing = variant.columns.find((column) => !present.has(column.columnName));\n\tif (missing === void 0) return;\n\tthrow contractError(\"CONTRACT.VARIANT_COLUMN_NOT_ON_BASE_TABLE\", `Model \"${variant.modelName}\" shares table \"${variant.tableName}\" with its base model (single-table inheritance), but its column \"${missing.columnName}\" is not on that table. The base model owns the table; declare the column there.`, { meta: {\n\t\tmodelName: variant.modelName,\n\t\tnamespaceId: variant.namespaceId,\n\t\ttableName: variant.tableName,\n\t\tcolumnName: missing.columnName\n\t} });\n}\n//#endregion\n//#region src/unmapped-column-warnings.ts\n/**\n* A warning for each column a table node adds to a table some model maps, when the column is required and has no default. The ORM writes only the columns fields map, so every insert it makes into that table fails. Prisma 7 accepts such a schema, so this warns rather than refuses.\n*/\nfunction requiredUnmappedColumnWarnings(storages, tables) {\n\tconst modelOfTable = /* @__PURE__ */ new Map();\n\tfor (const storage of storages) if (storage.kind === \"ownTable\") modelOfTable.set(tableKey(storage.table.namespaceId, storage.table.tableName), storage.modelName);\n\tconst warnings = [];\n\tfor (const table of tables) {\n\t\tconst modelName = modelOfTable.get(tableKey(table.namespaceId, table.tableName));\n\t\tif (modelName === void 0) continue;\n\t\tfor (const column of table.columns) {\n\t\t\tif (column.site.kind !== \"tableNode\" || column.nullable || column.default !== void 0) continue;\n\t\t\twarnings.push({\n\t\t\t\tcode: \"PN_COLUMN_REQUIRED_UNMAPPED\",\n\t\t\t\tmessage: `Column \"${column.columnName}\" of table \"${table.tableName}\" is required and has no default, and no field of model \"${modelName}\" maps it, so every insert the ORM makes into the table fails. Make the column nullable, give it a database default, or map it with a field.`,\n\t\t\t\titem: `table \"${table.tableName}\": column \"${column.columnName}\"`,\n\t\t\t\tsummary: \"columns are required, have no default, and no field maps them, so every insert the ORM makes into their tables fails. Make each column nullable, give it a database default, or map it with a field.\"\n\t\t\t});\n\t\t}\n\t}\n\treturn warnings;\n}\n//#endregion\n//#region src/build-contract.ts\nfunction assertStorageSemantics(contract, indexTypeRegistry, codecLookup) {\n\tconst semanticErrors = validateStorageSemantics(contract.storage);\n\tif (semanticErrors.length > 0) throw contractError(\"CONTRACT.VALIDATION_FAILED\", `Contract semantic validation failed: ${semanticErrors.join(\"; \")}`, { meta: { errors: semanticErrors } });\n\tvalidateIndexTypes(contract, indexTypeRegistry, (codecId) => codecLookup.descriptorFor(codecId)?.traits);\n}\nfunction collectStorageNamespaceCoordinateIds(definition) {\n\tconst defaultNamespaceId = definition.target.defaultNamespaceId;\n\tconst declared = [\n\t\t...definition.namespaces ?? [],\n\t\t...definition.models.map((model) => model.namespaceId),\n\t\t...(definition.tables ?? []).map((table) => table.namespaceId),\n\t\t...Object.keys(definition.attachedEntities ?? {})\n\t];\n\treturn /* @__PURE__ */ new Set([defaultNamespaceId, ...declared.map((id) => namespaceIdOrDefault(id, defaultNamespaceId))]);\n}\nfunction ensureUnboundNamespaceSlot(namespaces, createNamespace) {\n\tif (Object.hasOwn(namespaces, UNBOUND_NAMESPACE_ID)) return namespaces;\n\tconst unbound = createNamespace({\n\t\tid: UNBOUND_NAMESPACE_ID,\n\t\tentries: { table: {} }\n\t});\n\treturn {\n\t\t[UNBOUND_NAMESPACE_ID]: unbound,\n\t\t...namespaces\n\t};\n}\nfunction declaredTableKeys(definition) {\n\tconst defaultNamespaceId = definition.target.defaultNamespaceId;\n\treturn /* @__PURE__ */ new Set([...definition.models.map((model) => tableKey(modelNamespaceId(model, defaultNamespaceId), model.tableName)), ...(definition.tables ?? []).map((table) => tableKey(namespaceIdOrDefault(table.namespaceId, defaultNamespaceId), table.tableName))]);\n}\n/**\n* Builds the contract in two stages. First each model is converted on its own into the table it describes and its domain model, and each table node into the table it describes. Then the tables are merged, each is lowered, and the contract is assembled.\n*/\nfunction enabledCapabilities(matrix) {\n\tconst enabled = {};\n\tfor (const [namespace, flags] of Object.entries(matrix)) {\n\t\tconst enabledFlags = Object.fromEntries(Object.entries(flags).filter(([, flag]) => flag).map(([name]) => [name, true]));\n\t\tif (Object.keys(enabledFlags).length > 0) enabled[namespace] = enabledFlags;\n\t}\n\treturn enabled;\n}\nfunction buildSqlContractFromDefinition(definition, codecLookup, dataTypeLookup) {\n\tconst lookups = {\n\t\tcodecLookup,\n\t\tdataTypeLookup\n\t};\n\tconst target = definition.target.targetId;\n\tconst defaultNamespaceId = definition.target.defaultNamespaceId;\n\tconst indexTypeRegistry = indexTypeRegistryOf(definition.target, Object.values(definition.extensions ?? {}));\n\tconst qualifyColumnType = resolveColumnTypeQualifier(definition.target);\n\tconst storageTypes = definition.storageTypes ?? {};\n\tconst targetFamily = \"sql\";\n\tconst modelDescriptionContext = {\n\t\t...modelLookupsOf(definition),\n\t\tdeclaredTables: declaredTableKeys(definition),\n\t\tforeignKeyDefaults: definition.foreignKeyDefaults,\n\t\tstorageTypes,\n\t\tqualifyColumnType\n\t};\n\tconst components = definition.models.map((model) => describeModel(model, modelDescriptionContext));\n\tconst tableNodes = (definition.tables ?? []).map((table) => describeTableNode(table, modelDescriptionContext));\n\tconst authoringWarnings = [...definition.warnings ?? []];\n\tconst collectedColumnEntities = {};\n\tconst tableLoweringContext = {\n\t\tlookups,\n\t\tstorageTypes,\n\t\tdefaultNamespaceId,\n\t\tqualifyColumnType,\n\t\trenderCheckExpressions: resolveCheckExpressionRenderer(definition.target),\n\t\tcollectedColumnEntities,\n\t\tdefaultControlPolicy: definition.defaultControlPolicy,\n\t\tindexTypeRegistry,\n\t\twarnings: authoringWarnings\n\t};\n\tconst tablesByNamespace = {};\n\tconst modelStorages = components.map((c) => c.storage);\n\tconst tables = mergeTables(modelStorages, tableNodes);\n\tauthoringWarnings.push(...requiredUnmappedColumnWarnings(modelStorages, tables));\n\tfor (const table of tables) {\n\t\tconst namespaceTables = tablesByNamespace[table.namespaceId] ?? {};\n\t\tnamespaceTables[table.tableName] = lowerTable(table, tableLoweringContext);\n\t\ttablesByNamespace[table.namespaceId] = namespaceTables;\n\t}\n\tconst executionDefaults = components.flatMap((c) => c.domain.executionDefaults);\n\tconst modelsByNamespace = {};\n\tfor (const { domain } of components) {\n\t\tconst namespaceModels = modelsByNamespace[domain.namespaceId] ?? {};\n\t\tnamespaceModels[domain.modelName] = domain.model;\n\t\tmodelsByNamespace[domain.namespaceId] = namespaceModels;\n\t}\n\tconst roots = buildRoots(components);\n\tconst documentTypes = Object.fromEntries(Object.entries(storageTypes).map(([name, entry]) => [name, toStorageTypeInstance({\n\t\tcodecId: entry.codecId,\n\t\tdataType: sqlDataTypeOfCodec(entry.codecId, lookups).id,\n\t\ttypeParams: entry.typeParams\n\t})]));\n\tconst namespaceCoordinateIds = collectStorageNamespaceCoordinateIds(definition);\n\tconst domainEnumsByNs = {};\n\tconst storageValueSetsByNs = {};\n\tfor (const [enumName, handle] of Object.entries(definition.enums ?? {})) {\n\t\tif (enumName !== handle.enumName) throw contractError(\"CONTRACT.ENUM_INVALID\", `enum declaration key \"${enumName}\" must match enumType name \"${handle.enumName}\". Aliases are not supported.`, { meta: {\n\t\t\tenumName: handle.enumName,\n\t\t\tdeclarationKey: enumName,\n\t\t\treason: \"key-name-mismatch\"\n\t\t} });\n\t\tconst nsId = defaultNamespaceId;\n\t\tlet domainSlot = domainEnumsByNs[nsId];\n\t\tif (domainSlot === void 0) {\n\t\t\tdomainSlot = {};\n\t\t\tdomainEnumsByNs[nsId] = domainSlot;\n\t\t}\n\t\tconst storedMembers = encodeEnumTypeMembers(handle, codecLookup, \"the column\");\n\t\tdomainSlot[enumName] = {\n\t\t\tcodecId: handle.codecId,\n\t\t\tmembers: storedMembers\n\t\t};\n\t\tlet storageSlot = storageValueSetsByNs[nsId];\n\t\tif (storageSlot === void 0) {\n\t\t\tstorageSlot = {};\n\t\t\tstorageValueSetsByNs[nsId] = storageSlot;\n\t\t}\n\t\tstorageSlot[enumName] = {\n\t\t\tkind: \"valueSet\",\n\t\t\tvalues: storedMembers.map((member) => member.value)\n\t\t};\n\t}\n\tconst { createNamespace } = definition;\n\tconst entityTypesByDiscriminator = collectEntityTypeDescriptorsByDiscriminator(definition);\n\tconst namespaces = Object.fromEntries([...namespaceCoordinateIds].sort().map((id) => {\n\t\tconst entitiesForNs = mergeColumnAndAttachedEntities(id, definition.attachedEntities?.[id], collectedColumnEntities[id]);\n\t\tassertNoManagedEntityKinds(id, entitiesForNs);\n\t\tconst enumValueSetEntries = storageValueSetsByNs[id];\n\t\tconst packValueSetEntries = deriveEntityValueSets(entitiesForNs, entityTypesByDiscriminator);\n\t\tconst valueSetEntries = enumValueSetEntries !== void 0 || packValueSetEntries !== void 0 ? mergeNamespaceValueSets(id, enumValueSetEntries, packValueSetEntries) : void 0;\n\t\tconst nsInput = {\n\t\t\tid,\n\t\t\tentries: {\n\t\t\t\ttable: tablesByNamespace[id] ?? {},\n\t\t\t\t...entitiesForNs,\n\t\t\t\t...valueSetEntries !== void 0 && Object.keys(valueSetEntries).length > 0 ? { valueSet: valueSetEntries } : {}\n\t\t\t}\n\t\t};\n\t\treturn [id, createNamespace(nsInput)];\n\t}));\n\tconst storageWithoutHash = {\n\t\t...Object.keys(documentTypes).length > 0 ? { types: documentTypes } : {},\n\t\tnamespaces: defaultNamespaceId === UNBOUND_NAMESPACE_ID ? ensureUnboundNamespaceSlot(namespaces, createNamespace) : namespaces\n\t};\n\tconst storageHash = definition.storageHash ? coreHash(definition.storageHash) : computeStorageHash({\n\t\ttarget,\n\t\ttargetFamily,\n\t\tstorage: blindCast(storageWithoutHash),\n\t\t...sqlContractCanonicalizationHooks\n\t});\n\tconst storage = new SqlStorage({\n\t\t...storageWithoutHash,\n\t\tstorageHash\n\t});\n\tconst extensionNamespaces = definition.extensions ? Object.values(definition.extensions).map((pack) => pack.id) : void 0;\n\tconst extensions = { ...definition.extensions || {} };\n\tif (extensionNamespaces) {\n\t\tfor (const namespace of extensionNamespaces) if (!Object.hasOwn(extensions, namespace)) extensions[namespace] = {};\n\t}\n\tconst capabilities = enabledCapabilities(mergeCapabilityMatrices({}, [\n\t\tdefinition.target,\n\t\t...definition.capabilities ? [{ capabilities: definition.capabilities }] : [],\n\t\t...Object.values(definition.extensions ?? {})\n\t]));\n\tconst profileHash = computeProfileHash({\n\t\ttarget,\n\t\ttargetFamily,\n\t\tcapabilities: {}\n\t});\n\tconst executionWithHash = buildExecutionSection({\n\t\ttarget,\n\t\ttargetFamily,\n\t\tdefaults: executionDefaults\n\t});\n\tconst valueObjects = definition.valueObjects && definition.valueObjects.length > 0 ? Object.fromEntries(definition.valueObjects.map((vo) => [vo.name, { fields: Object.fromEntries(vo.fields.map((f) => [f.fieldName, buildDomainField(f, defaultNamespaceId, storageTypes)])) }])) : void 0;\n\tconst domainNamespaceIds = new Set(Object.keys(modelsByNamespace));\n\tif (domainNamespaceIds.size === 0) domainNamespaceIds.add(defaultNamespaceId);\n\tif (valueObjects !== void 0) domainNamespaceIds.add(defaultNamespaceId);\n\tfor (const nsId of Object.keys(domainEnumsByNs)) domainNamespaceIds.add(nsId);\n\tconst domainNamespaces = Object.fromEntries([...domainNamespaceIds].sort().map((namespaceId) => {\n\t\tconst modelsInNs = modelsByNamespace[namespaceId] ?? {};\n\t\tconst enumsInNs = domainEnumsByNs[namespaceId];\n\t\treturn [namespaceId, {\n\t\t\tmodels: modelsInNs,\n\t\t\t...namespaceId === defaultNamespaceId && valueObjects !== void 0 ? { valueObjects } : {},\n\t\t\t...enumsInNs !== void 0 && Object.keys(enumsInNs).length > 0 ? { enum: enumsInNs } : {}\n\t\t}];\n\t}));\n\tconst contract = {\n\t\ttarget,\n\t\ttargetFamily,\n\t\t...ifDefined(\"defaultControlPolicy\", definition.defaultControlPolicy),\n\t\tdomain: { namespaces: domainNamespaces },\n\t\troots,\n\t\tstorage,\n\t\t...executionWithHash ? { execution: executionWithHash } : {},\n\t\textensions,\n\t\tcapabilities,\n\t\tprofileHash,\n\t\tmeta: {}\n\t};\n\tassertStorageSemantics(contract, indexTypeRegistry, codecLookup);\n\tflushAuthoringWarnings(authoringWarnings);\n\treturn contract;\n}\n/**\n* Aggregate roots, one per model that owns a table, keyed by bare storage table name. When two models in different namespaces map to the same bare table name, the bare key would collide, so those entries fall back to a namespace-qualified key. Single-namespace contracts never collide and keep their bare keys.\n*/\nfunction buildRoots(components) {\n\tconst rootEntries = components.flatMap(({ storage, domain }) => storage.kind === \"ownTable\" ? [{\n\t\ttableName: storage.table.tableName,\n\t\tnamespaceId: domain.namespaceId,\n\t\tref: crossRef(domain.modelName, domain.namespaceId)\n\t}] : []);\n\tconst rootTableNameCounts = /* @__PURE__ */ new Map();\n\tfor (const entry of rootEntries) rootTableNameCounts.set(entry.tableName, (rootTableNameCounts.get(entry.tableName) ?? 0) + 1);\n\tconst roots = {};\n\tfor (const entry of rootEntries) {\n\t\tconst key = (rootTableNameCounts.get(entry.tableName) ?? 0) > 1 ? `${entry.namespaceId}.${entry.tableName}` : entry.tableName;\n\t\troots[key] = entry.ref;\n\t}\n\treturn roots;\n}\n//#endregion\n//#region src/derived-checks.ts\n/**\n* The one step every SQL contract specifier funnels its loaded contract\n* through: stamp the specifier's default control policy, then strip derived\n* checks from every table the stamped policy leaves non-managed. Composing the\n* two here is what keeps the managed-only consequence from being skipped on\n* any specifier route.\n*/\nfunction applySqlSpecifierControlPolicy(contract, defaultControlPolicy, createNamespace) {\n\treturn stripDerivedChecksFromNonManagedTables(applySpecifierDefaultControlPolicy(contract, defaultControlPolicy), createNamespace);\n}\n/**\n* Removes generated enforcement checks from every table whose effective\n* control policy is not `managed`.\n*\n* A check is derived iff its wire prefix is one derivation would produce for\n* some column of its table — {@link derivedCheckPrefixes} enumerates that\n* set. Wire-naming alone no longer identifies derivation: an authored\n* `name:` check (`@@check` / `check()`) is wire-named too, so a bare\n* `check.prefix === undefined` test would delete an author's own constraint\n* from every non-`managed` table. The prefix-shape rule tests against the\n* table's own columns instead of the naming mode, so an authored check with\n* an unrelated prefix survives.\n*\n* The rule is weaker than recomputing the content hash `contract infer`\n* uses: that needs `postgresRenderCheckExpressions` to know what a kind\n* renders, and this funnel has no target descriptor to reach it through. It\n* can only ask whether some column could have produced a prefix of this\n* shape, not whether this exact column produced this exact check. The gap\n* that opens — an authored name that collides with a derived-prefix shape —\n* is closed at authoring time instead: such a name is rejected\n* (`CONTRACT.CHECK_NAME_RESERVED`) before it ever reaches storage.\n*\n* Why derivation stops at the namespace boundary: the contract *describes* an\n* external schema, it does not *prescribe* enforcement for it. Deriving a check\n* for a table Prisma 8 never creates declares a constraint the live database\n* has no reason to carry, and `external` fails verify on a declared shape the\n* database lacks — an unfixable failure, since no plan may emit DDL there\n* either.\n*\n* This is the post-build half of the rule. Authoring skips derivation for a\n* table whose policy is known in the source; this pass catches the policy a\n* contract *specifier* applies after the contract is already built, which is\n* the only signal a pack like the Supabase extension gives. Specifiers reach\n* it through `applySqlSpecifierControlPolicy` above.\n*\n* Returns the contract unchanged (same reference) when nothing is stripped.\n* When something is, the storage hash is recomputed — the stripped contract\n* describes different storage.\n*/\nfunction stripDerivedChecksFromNonManagedTables(contract, createNamespace) {\n\tconst storage = contract.storage;\n\tif (!isSqlStorageShaped(storage)) return contract;\n\tlet anyStripped = false;\n\tconst namespaces = {};\n\tfor (const [namespaceId, namespace] of Object.entries(storage.namespaces)) {\n\t\tif (!isMaterializedSqlNamespace(namespace)) return contract;\n\t\tconst tables = namespace.entries[\"table\"];\n\t\tif (tables === void 0) {\n\t\t\tnamespaces[namespaceId] = namespace;\n\t\t\tcontinue;\n\t\t}\n\t\tlet namespaceStripped = false;\n\t\tconst nextTables = {};\n\t\tfor (const [tableName, table] of Object.entries(tables)) {\n\t\t\tconst stripped = StorageTable.is(table) ? withoutDerivedChecks(tableName, table, contract.defaultControlPolicy) : table;\n\t\t\tif (stripped !== table) namespaceStripped = true;\n\t\t\tnextTables[tableName] = stripped;\n\t\t}\n\t\tif (!namespaceStripped) {\n\t\t\tnamespaces[namespaceId] = namespace;\n\t\t\tcontinue;\n\t\t}\n\t\tanyStripped = true;\n\t\tnamespaces[namespaceId] = createNamespace({\n\t\t\tid: namespace.id,\n\t\t\tentries: {\n\t\t\t\t...namespace.entries,\n\t\t\t\ttable: nextTables\n\t\t\t}\n\t\t});\n\t}\n\tif (!anyStripped) return contract;\n\tconst storageWithoutHash = {\n\t\tnamespaces,\n\t\t...ifDefined(\"types\", storage.types)\n\t};\n\treturn {\n\t\t...contract,\n\t\tstorage: new SqlStorage({\n\t\t\t...storageWithoutHash,\n\t\t\tstorageHash: computeStorageHash({\n\t\t\t\ttarget: contract.target,\n\t\t\t\ttargetFamily: contract.targetFamily,\n\t\t\t\tstorage: storageWithoutHash,\n\t\t\t\t...sqlContractCanonicalizationHooks\n\t\t\t})\n\t\t})\n\t};\n}\n/**\n* Structural stand-in for `instanceof SqlStorage`: like the checks it wraps, a\n* storage instance can arrive from a realm whose IR classes are a separate\n* copy (the dist e2e shape), where an `instanceof` test would miss.\n*/\nfunction isSqlStorageShaped(x) {\n\tif (typeof x !== \"object\" || x === null || !(\"namespaces\" in x)) return false;\n\treturn typeof x.namespaces === \"object\" && x.namespaces !== null;\n}\n/** The table itself when it keeps every check, a rebuilt one when it does not. */\nfunction withoutDerivedChecks(tableName, table, contractDefault) {\n\tconst checks = table.checks;\n\tif (checks === void 0 || checks.length === 0) return table;\n\tif (effectiveControlPolicy(table.control, contractDefault) === \"managed\") return table;\n\tconst columnNames = Object.keys(table.columns);\n\tinvariant(columnNames.length > 0, `withoutDerivedChecks: table \"${tableName}\" carries checks but its column map is empty. The caller must pass the table's real, complete column set — an empty or partial map makes every check misclassify as non-derived and survive the strip.`);\n\tconst derivedPrefixes = derivedCheckPrefixes(tableName, columnNames);\n\tconst kept = checks.filter((check) => check.prefix === void 0 || !derivedPrefixes.has(check.prefix));\n\tif (kept.length === checks.length) return table;\n\treturn new StorageTable({\n\t\tcolumns: table.columns,\n\t\tuniques: table.uniques,\n\t\tindexes: table.indexes,\n\t\tforeignKeys: table.foreignKeys,\n\t\t...ifDefined(\"primaryKey\", table.primaryKey),\n\t\t...ifDefined(\"control\", table.control),\n\t\t...kept.length > 0 ? { checks: kept.map((check) => checkConstraintInputFromSerialized({\n\t\t\tname: check.name,\n\t\t\t...ifDefined(\"prefix\", check.prefix),\n\t\t\texpression: check.expression\n\t\t})) } : {}\n\t});\n}\n//#endregion\nexport { storedAsListColumn as a, isValueObjectMember as i, buildSqlContractFromDefinition as n, contractError as o, toOneNullabilityContradictionMessage as r, applySqlSpecifierControlPolicy as t };\n\n//# sourceMappingURL=derived-checks-CrvMQTJF.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAS,cAAc,MAAM,SAAS,SAAS;CAC9C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;;;;AAMA,SAAS,mBAAmB,OAAO;CAClC,OAAO,MAAM,QAAQ,CAAC,MAAM;AAC7B;;AAEA,SAAS,oBAAoB,OAAO;CACnC,OAAO,qBAAqB;AAC7B;;AAIA,SAAS,eAAe,QAAQ,MAAM;CACrC,OAAO;EACN,YAAY,OAAO;EACnB,YAAY,OAAO;EACnB,UAAU,OAAO;EACjB,MAAM,OAAO,SAAS,OAAO,EAAE,iBAAiB,OAAO,oBAAoB,KAAK,IAAI;EACpF,SAAS,OAAO;EAChB,gBAAgB,OAAO;EACvB;CACD;AACD;;;;;AAOA,SAAS,kBAAkB,QAAQ,aAAa;CAC/C,MAAM,UAAU,sBAAsB,QAAQ,aAAa,YAAY,CAAC,CAAC,KAAK,WAAW,OAAO,KAAK;CACrG,MAAM,SAAS,CAAC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R } from "./types-c1iIhJep-DdMj6TNl.mjs";
|
|
2
|
-
import "./types-BLyhYk6B.mjs";
|
|
3
|
-
import { n as SqlDataType, s as SqlTypeParams } from "./data-type-B8N33s-_.mjs";
|
|
4
|
-
import "./default-mapping-CEISdj2g-DF1LzGBR.mjs";
|
|
5
|
-
import { AuthoringTypeConstructorCall, AuthoringTypeConstructorDescriptor, AuthoringTypeNamespace } from "@prisma/orm-framework/components/authoring";
|
|
6
|
-
import { CodecLookupWithDescriptors, DataTypeLookup } from "@prisma/orm-framework/components/codec";
|
|
7
|
-
//#region ../../../2-sql/9-family/dist/psl-build.d.mts
|
|
8
|
-
//#region src/core/psl-build/inferred-type-constructors.d.ts
|
|
9
|
-
/** The type constructor `contract infer` writes for a data type, with the data type it produces. */
|
|
10
|
-
interface InferredTypeConstructor {
|
|
11
|
-
readonly path: readonly string[];
|
|
12
|
-
readonly descriptor: AuthoringTypeConstructorDescriptor;
|
|
13
|
-
readonly dataType: SqlDataType;
|
|
14
|
-
}
|
|
15
|
-
/** The constructors marked `inferred` in a stack, keyed by the id of the data type each produces. */
|
|
16
|
-
type InferredTypeConstructors = ReadonlyMap<string, InferredTypeConstructor>;
|
|
17
|
-
/** Every constructor of `authoringTypes` marked `inferred`, by the data type its codec represents. */
|
|
18
|
-
declare function inferredTypeConstructors(input: {
|
|
19
|
-
readonly authoringTypes: AuthoringTypeNamespace;
|
|
20
|
-
readonly codecLookup: Pick<CodecLookupWithDescriptors, 'descriptorFor'>;
|
|
21
|
-
readonly dataTypeLookup: DataTypeLookup;
|
|
22
|
-
}): InferredTypeConstructors;
|
|
23
|
-
/**
|
|
24
|
-
* The call to `marked` with the fewest arguments that produces `params`, the normal form of a
|
|
25
|
-
* column's data type parameters: arguments are dropped from the end while the normal form of what
|
|
26
|
-
* the call produces stays `params`. Undefined when the constructor cannot produce them, such as one
|
|
27
|
-
* whose argument names another entity.
|
|
28
|
-
*/
|
|
29
|
-
declare function fewestArgumentsCall(marked: InferredTypeConstructor, params: SqlTypeParams): AuthoringTypeConstructorCall | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* A type constructor argument as PSL writes it: a number as written, a string between quotes.
|
|
32
|
-
* Undefined for a string PSL cannot carry, because a quote, backslash or line break in it would read
|
|
33
|
-
* back differently.
|
|
34
|
-
*/
|
|
35
|
-
declare function pslTypeArgumentText(value: unknown): string | undefined;
|
|
36
|
-
//#endregion
|
|
37
|
-
//#region src/core/psl-build/column-types.d.ts
|
|
38
|
-
/** A call to a type constructor as PSL writes it: the constructor's path and its arguments' text. */
|
|
39
|
-
interface PslTypeCall {
|
|
40
|
-
readonly path: readonly string[];
|
|
41
|
-
readonly args: readonly string[];
|
|
42
|
-
}
|
|
43
|
-
/** The PSL type `contract infer` writes for a column that is not an enum, by table and column name. */
|
|
44
|
-
type ColumnTypeOf = (tableName: string, columnName: string) => PslTypeCall;
|
|
45
|
-
/** One introspected table, with the schema it was read from. */
|
|
46
|
-
interface IntrospectedTable {
|
|
47
|
-
readonly schemaName: string;
|
|
48
|
-
readonly tableName: string;
|
|
49
|
-
readonly columns: readonly SqlColumnIR[];
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* The type of every column of `tables` that `isEnumColumn` does not claim: the call, with the
|
|
53
|
-
* fewest arguments, to the constructor marked `inferred` for the data type that claims the
|
|
54
|
-
* column's reported type. When any column has no such call, throws
|
|
55
|
-
* `CONTRACT.INFER_COLUMN_TYPE_UNCLAIMED` listing every one of them.
|
|
56
|
-
*/
|
|
57
|
-
declare function inferColumnTypes(input: {
|
|
58
|
-
readonly tables: readonly IntrospectedTable[];
|
|
59
|
-
readonly constructors: InferredTypeConstructors;
|
|
60
|
-
readonly isEnumColumn: (column: SqlColumnIR) => boolean;
|
|
61
|
-
}): ColumnTypeOf;
|
|
62
|
-
//#endregion
|
|
63
|
-
//#region src/core/psl-build/psl-names.d.ts
|
|
64
|
-
/**
|
|
65
|
-
* PSL member name for a native-enum value. The value itself always prints
|
|
66
|
-
* explicitly (`member = "value"`), so the returned name never needs a map:
|
|
67
|
-
* a value that already is a valid, non-reserved identifier is kept verbatim
|
|
68
|
-
* (case included); anything else is camelCased/escaped like a field name.
|
|
69
|
-
*/
|
|
70
|
-
declare function toEnumMemberName(value: string): string;
|
|
71
|
-
//#endregion
|
|
72
|
-
export { PslTypeCall as a, inferredTypeConstructors as c, IntrospectedTable as i, pslTypeArgumentText as l, InferredTypeConstructor as n, fewestArgumentsCall as o, InferredTypeConstructors as r, inferColumnTypes as s, ColumnTypeOf as t, toEnumMemberName as u };
|
|
73
|
-
//# sourceMappingURL=psl-build-BHQfP1_C.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"psl-build-BHQfP1_C.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/psl-build.d.mts"],"mappings":";;;;;;;;;UAOU;WACC;WACA,YAAY;WACZ,UAAU;;;KAGhB,2BAA2B,oBAAoB;;iBAEnC,yBAAyB;WAC/B,gBAAgB;WAChB,aAAa,KAAK;WAClB,gBAAgB;IACvB;;;;;;;iBAOa,oBAAoB,QAAQ,yBAAyB,QAAQ,gBAAgB;;;;;;iBAM7E,oBAAoB;;;;UAI3B;WACC;WACA;;;KAGN,gBAAgB,mBAAmB,uBAAuB;;UAErD;WACC;WACA;WACA,kBAAkB;;;;;;;;iBAQZ,iBAAiB;WACvB,iBAAiB;WACjB,cAAc;WACd,eAAe,QAAQ;IAC9B;;;;;;;;;iBASa,iBAAiB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"psl-build-BsJ6eChh.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/psl-build.mjs"],"sourcesContent":["import { t as sqlFamilyError } from \"./errors-B5g0xWro.mjs\";\nimport { s as toEnumMemberName } from \"./psl-names-C3cwe0rg.mjs\";\nimport { SQL_EXPRESSION_TAG } from \"@internal/sql-contract/sql-expression\";\nimport { authoringTypeConstructorArguments, authoringTypeConstructors, castTypedValue, instantiateAuthoringTypeConstructor, printTaggedLiteral, readWrittenValue } from \"@internal/framework-components/authoring\";\nimport { dataTypeId, dataTypeParams } from \"@internal/framework-components/codec\";\nimport { InternalError, isInternalError } from \"@internal/utils/internal-error\";\nimport { isSqlDataType, numeralText, resolveReportedSqlType } from \"@internal/sql-contract/data-type\";\nimport { canonicalizeJson } from \"@internal/framework-components/utils\";\nimport { escapePslString } from \"@internal/sql-contract/data-type-support\";\n//#region src/core/psl-build/inferred-type-constructors.ts\n/** Every constructor of `authoringTypes` marked `inferred`, by the data type its codec represents. */\nfunction inferredTypeConstructors(input) {\n\tconst found = /* @__PURE__ */ new Map();\n\tfor (const { path, descriptor } of authoringTypeConstructors(input.authoringTypes)) {\n\t\tif (descriptor.inferred !== true) continue;\n\t\tconst dataTypeId = input.codecLookup.descriptorFor(descriptor.output.codecId)?.dataType;\n\t\tconst dataType = dataTypeId === void 0 ? void 0 : input.dataTypeLookup.get(dataTypeId);\n\t\tif (dataType === void 0 || !isSqlDataType(dataType)) continue;\n\t\tfound.set(dataType.id, {\n\t\t\tpath,\n\t\t\tdescriptor,\n\t\t\tdataType\n\t\t});\n\t}\n\treturn found;\n}\nfunction normalParams(marked, args) {\n\ttry {\n\t\tconst { typeParams } = instantiateAuthoringTypeConstructor(marked.descriptor, args);\n\t\tconst params = dataTypeParams(marked.dataType, typeParams);\n\t\treturn canonicalizeJson(marked.dataType.sql.normalize(params));\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn;\n\t}\n}\n/**\n* The call to `marked` with the fewest arguments that produces `params`, the normal form of a\n* column's data type parameters: arguments are dropped from the end while the normal form of what\n* the call produces stays `params`. Undefined when the constructor cannot produce them, such as one\n* whose argument names another entity.\n*/\nfunction fewestArgumentsCall(marked, params) {\n\tconst all = authoringTypeConstructorArguments(marked.descriptor, {\n\t\tcodecId: marked.descriptor.output.codecId,\n\t\ttypeParams: params\n\t});\n\tif (all === void 0) return void 0;\n\tconst wanted = canonicalizeJson(params);\n\tconst args = [...all];\n\twhile (args.length > 0 && normalParams(marked, args.slice(0, -1)) === wanted) args.pop();\n\treturn {\n\t\tpath: marked.path,\n\t\targs\n\t};\n}\n/**\n* A type constructor argument as PSL writes it: a number as written, a string between quotes.\n* Undefined for a string PSL cannot carry, because a quote, backslash or line break in it would read\n* back differently.\n*/\nfunction pslTypeArgumentText(value) {\n\tif (typeof value !== \"string\") return String(value);\n\treturn escapePslString(value) === value ? `\"${value}\"` : void 0;\n}\n//#endregion\n//#region src/core/psl-build/column-types.ts\n/** The type the database reported for `column`, which introspection always records. */\nfunction reportedTypeOf(column, tableName) {\n\tif (column.reportedType === void 0) throw new InternalError(`contract infer read column \"${tableName}\".\"${column.name}\" without the type the database reported for it.`);\n\treturn column.reportedType;\n}\nfunction writtenCall(constructors, dataTypes, reported) {\n\tconst resolved = resolveReportedSqlType(reported, dataTypes);\n\tconst marked = resolved && constructors.get(resolved.dataType);\n\tconst call = resolved && marked && fewestArgumentsCall(marked, resolved.typeParams);\n\tif (call === void 0) return void 0;\n\tconst args = call.args.map(pslTypeArgumentText);\n\treturn args.every((arg) => arg !== void 0) ? {\n\t\tpath: call.path,\n\t\targs\n\t} : void 0;\n}\n/**\n* The type of every column of `tables` that `isEnumColumn` does not claim: the call, with the\n* fewest arguments, to the constructor marked `inferred` for the data type that claims the\n* column's reported type. When any column has no such call, throws\n* `CONTRACT.INFER_COLUMN_TYPE_UNCLAIMED` listing every one of them.\n*/\nfunction inferColumnTypes(input) {\n\tconst dataTypes = [...input.constructors.values()].map((marked) => marked.dataType);\n\tconst types = /* @__PURE__ */ new Map();\n\tconst unclaimed = [];\n\tfor (const { schemaName, tableName, columns } of input.tables) for (const column of columns) {\n\t\tif (input.isEnumColumn(column)) continue;\n\t\tconst reported = reportedTypeOf(column, tableName);\n\t\tconst call = writtenCall(input.constructors, dataTypes, reported);\n\t\tif (call === void 0) {\n\t\t\tunclaimed.push(`${schemaName}.${tableName}.${column.name}: ${reported.text}${column.many === true ? \"[]\" : \"\"}`);\n\t\t\tcontinue;\n\t\t}\n\t\ttypes.set(JSON.stringify([tableName, column.name]), call);\n\t}\n\tif (unclaimed.length > 0) {\n\t\tconst columns = unclaimed.sort();\n\t\tthrow sqlFamilyError(\"CONTRACT.INFER_COLUMN_TYPE_UNCLAIMED\", [\"contract infer: Prisma 8 cannot write these column types with the configured stack:\", ...columns.map((line) => ` ${line}`)].join(\"\\n\"), {\n\t\t\twhy: \"Prisma 8 reads a column type only through a data type that the target or an extension pack declares.\",\n\t\t\tfix: \"No configured pack has a type for these columns. If a type comes from a database extension that has a Prisma 8 pack, add the pack to extensions in prisma.config.ts. Otherwise change the column's type or remove the column from the database.\",\n\t\t\tmeta: { columns }\n\t\t});\n\t}\n\treturn (tableName, columnName) => {\n\t\tconst type = types.get(JSON.stringify([tableName, columnName]));\n\t\tif (type === void 0) throw new InternalError(`contract infer resolved no type for \"${tableName}\".\"${columnName}\".`);\n\t\treturn type;\n\t};\n}\n//#endregion\n//#region src/core/psl-build/default-mapping.ts\nconst DEFAULT_FUNCTION_ATTRIBUTES = {\n\t\"autoincrement()\": \"@default(autoincrement())\",\n\t\"now()\": \"@default(now())\"\n};\n/**\n* The attribute a stored default prints as: a named function, a literal the column takes, or any\n* other expression as a `sql` literal. `undefined` when a literal has no written form. An expression\n* prints even when the literal would read back as different text: default expressions are compared\n* with case and whitespace ignored (`SqlColumnDefaultIR.isEqualTo`), and canonicalization changes only\n* whitespace (ADR 129).\n*/\nfunction mapDefault(columnDefault, options) {\n\tswitch (columnDefault.kind) {\n\t\tcase \"literal\": {\n\t\t\tconst text = writeDefaultLiteral(columnDefault.value, options);\n\t\t\treturn text === void 0 ? void 0 : { attribute: `@default(${text})` };\n\t\t}\n\t\tcase \"function\": return { attribute: options?.functionAttributes?.[columnDefault.expression] ?? DEFAULT_FUNCTION_ATTRIBUTES[columnDefault.expression] ?? `@default(${printTaggedLiteral(SQL_EXPRESSION_TAG, columnDefault.expression)})` };\n\t}\n}\nfunction writingSurface(support) {\n\tconst entryOf = /* @__PURE__ */ new Map();\n\tconst tagTypes = [];\n\tfor (const [key, entry] of Object.entries(support.entries)) {\n\t\tconst written = entry.written;\n\t\tif (written.kind === \"tag\") {\n\t\t\tconst type = dataTypeId(key);\n\t\t\tif (!entryOf.has(type)) entryOf.set(type, entry);\n\t\t\ttagTypes.push(type);\n\t\t\tcontinue;\n\t\t}\n\t\tif (written.syntax === \"number\") {\n\t\t\tfor (const type of written.types) entryOf.set(type, entry);\n\t\t\tcontinue;\n\t\t}\n\t\tentryOf.set(key, entry);\n\t}\n\treturn {\n\t\tsupport,\n\t\tentryOf,\n\t\ttagTypes\n\t};\n}\nfunction readValue(surface, written) {\n\tconst read = readWrittenValue(surface.support, written);\n\treturn read.ok ? read.value : void 0;\n}\n/** The value of a tag's type that a stored document is, constructed by that type. */\nfunction tagValue(surface, type, value) {\n\ttry {\n\t\treturn surface.support.lookup.get(type)?.valueFrom(value, {});\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn;\n\t}\n}\n/**\n* Every value the stored form could be, in the order a written value would be read: a number or\n* numeral text through the number entry first, then the plain syntax that matches the shape, then\n* each tag, whose stored form is a whole document, which may itself be a number or a boolean.\n*/\nfunction classifications(value, surface) {\n\tconst found = [];\n\tif (typeof value === \"number\") found.push(readValue(surface, {\n\t\tkind: \"number\",\n\t\ttext: numeralText(value)\n\t}));\n\telse if (typeof value === \"boolean\") found.push(readValue(surface, {\n\t\tkind: \"boolean\",\n\t\tvalue\n\t}));\n\telse if (typeof value === \"string\") {\n\t\tfound.push(readValue(surface, {\n\t\t\tkind: \"number\",\n\t\t\ttext: value\n\t\t}));\n\t\tfound.push(readValue(surface, {\n\t\t\tkind: \"string\",\n\t\t\ttext: value\n\t\t}));\n\t}\n\tfor (const type of surface.tagTypes) found.push(tagValue(surface, type, value));\n\treturn found.filter((candidate) => candidate !== void 0);\n}\n/** What the column's type stores for `json` under the column's parameters, or `undefined` when it holds no such value. */\nfunction storedUnder(json, column, lookup) {\n\tconst type = lookup.get(column.id);\n\tif (type === void 0) return void 0;\n\ttry {\n\t\treturn type.toContract(type.valueFrom(json, column.params));\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn;\n\t}\n}\n/** The stored form the column takes this value as, spelled as its parameters give it, or `undefined` when its type takes no such value. */\nfunction admitted(candidate, column, surface) {\n\tconst cast = castTypedValue(surface.support, column.id, column.params, candidate);\n\treturn cast.ok ? cast.value.value : void 0;\n}\n/** The text of the literal: what the entry prints, before the syntax that fences it. */\nfunction printedText(entry, value) {\n\ttry {\n\t\treturn entry.print(value);\n\t} catch {\n\t\treturn;\n\t}\n}\n/** The printed text as the entry's syntax writes it, for reading back. */\nfunction writtenAs(entry, text) {\n\tconst written = entry.written;\n\tif (written.kind === \"tag\") return {\n\t\tkind: \"tag\",\n\t\ttag: written.tag,\n\t\ttext\n\t};\n\tif (written.syntax !== \"boolean\") return {\n\t\tkind: written.syntax,\n\t\ttext\n\t};\n\treturn text === \"true\" || text === \"false\" ? {\n\t\tkind: \"boolean\",\n\t\tvalue: text === \"true\"\n\t} : void 0;\n}\n/** What the printed text reads back as, through the same read a written value takes. */\nfunction readBack(surface, entry, text) {\n\tconst written = writtenAs(entry, text);\n\treturn written === void 0 ? void 0 : readValue(surface, written);\n}\nfunction literalText(entry, text) {\n\tconst written = entry.written;\n\tif (written.kind === \"tag\") return printTaggedLiteral(written.tag, text);\n\treturn written.syntax === \"string\" ? `\"${escapePslString(text)}\"` : text;\n}\n/**\n* The value written as the literal of one of its types, proven by reading the text straight back:\n* the same read, the same cast, and the stored form again. A number is tried first without the\n* trailing fraction zeros the column's scale spells it with.\n*/\nfunction writeScalar(value, column, surface) {\n\tconst shortest = withoutTrailingFractionZeros(value);\n\tconst candidates = [...shortest === void 0 ? [] : classifications(shortest, surface), ...classifications(value, surface)];\n\tfor (const candidate of candidates) {\n\t\tconst entry = surface.entryOf.get(candidate.type);\n\t\tif (entry === void 0) continue;\n\t\tconst stored = admitted(candidate, column, surface);\n\t\tif (stored === void 0 || !sameForm(stored, value)) continue;\n\t\tconst text = printedText(entry, candidate.value);\n\t\tif (text === void 0) continue;\n\t\tconst reread = readBack(surface, entry, text);\n\t\tif (reread === void 0) continue;\n\t\tconst restored = admitted(reread, column, surface);\n\t\tif (restored === void 0 || !sameForm(restored, value)) continue;\n\t\treturn literalText(entry, text);\n\t}\n}\nconst DECIMAL_WITH_FRACTION = /^-?\\d+\\.\\d+$/;\nfunction withoutTrailingFractionZeros(value) {\n\tif (typeof value !== \"string\" || !DECIMAL_WITH_FRACTION.test(value)) return void 0;\n\tconst shortened = value.replace(/0+$/, \"\").replace(/\\.$/, \"\");\n\treturn shortened === value ? void 0 : shortened;\n}\n/** One written element of a list, printed as a value of any type, with no column type to admit it. */\nfunction writeElement(value, of, surface) {\n\tfor (const candidate of classifications(value, surface)) {\n\t\tif (!of.includes(candidate.type)) continue;\n\t\tconst entry = surface.entryOf.get(candidate.type);\n\t\tif (entry === void 0) continue;\n\t\tconst text = printedText(entry, candidate.value);\n\t\tif (text === void 0) continue;\n\t\tconst reread = readBack(surface, entry, text);\n\t\tif (reread === void 0 || !of.includes(reread.type)) continue;\n\t\treturn {\n\t\t\ttext: literalText(entry, text),\n\t\t\tvalue: reread.value\n\t\t};\n\t}\n}\n/**\n* A written list on a scalar column, which the column type's list cast turns into its one value,\n* constructed by the column's type. Each element is classified on its own and must be of a type the\n* cast takes.\n*/\nfunction writeListCast(value, column, surface) {\n\tconst listCast = surface.support.lookup.get(column.id)?.listCast;\n\tif (listCast === void 0) return void 0;\n\tconst parts = [];\n\tconst elements = [];\n\tfor (const element of value) {\n\t\tconst written = writeElement(element, listCast.of, surface);\n\t\tif (written === void 0) return void 0;\n\t\tparts.push(written.text);\n\t\telements.push(written.value);\n\t}\n\tlet cast;\n\ttry {\n\t\tcast = listCast.cast(elements);\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn;\n\t}\n\tconst stored = storedUnder(cast, column, surface.support.lookup);\n\treturn stored !== void 0 && sameForm(stored, value) ? `[${parts.join(\", \")}]` : void 0;\n}\nfunction writeDefaultLiteral(value, options) {\n\tif (value instanceof Date) return void 0;\n\tconst { dataTypes, columnCodec } = options ?? {};\n\tif (dataTypes === void 0 || columnCodec === void 0) return void 0;\n\tconst { lookup } = dataTypes;\n\tconst columnDataType = columnCodec.dataType;\n\tconst columnType = lookup.get(columnDataType);\n\tconst column = {\n\t\tid: columnDataType,\n\t\tparams: columnType === void 0 ? {} : dataTypeParams(columnType, options?.typeParams)\n\t};\n\tconst surface = writingSurface(dataTypes);\n\tif (options?.list === true) {\n\t\tif (!Array.isArray(value)) return void 0;\n\t\tconst parts = [];\n\t\tfor (const element of value) {\n\t\t\tconst written = writeScalar(element, column, surface);\n\t\t\tif (written === void 0) return void 0;\n\t\t\tparts.push(written);\n\t\t}\n\t\treturn `[${parts.join(\", \")}]`;\n\t}\n\tconst written = writeScalar(value, column, surface);\n\tif (written !== void 0) return written;\n\treturn Array.isArray(value) ? writeListCast(value, column, surface) : void 0;\n}\n/** Whether two stored forms are the same JSON value, member by member and element by element. */\nfunction sameForm(left, right) {\n\tif (left === right) return true;\n\tif (Array.isArray(left) !== Array.isArray(right)) return false;\n\tif (typeof left !== \"object\" || typeof right !== \"object\" || left === null || right === null) return false;\n\tconst members = Object.entries(left);\n\tconst others = new Map(Object.entries(right));\n\treturn members.length === others.size && members.every(([key, member]) => {\n\t\tconst other = others.get(key);\n\t\treturn other !== void 0 && sameForm(member, other);\n\t});\n}\n//#endregion\nexport { fewestArgumentsCall, inferColumnTypes, inferredTypeConstructors, mapDefault, pslTypeArgumentText, toEnumMemberName };\n\n//# sourceMappingURL=psl-build.mjs.map"],"mappings":";;;;;;;;;;;AAWA,SAAS,yBAAyB,OAAO;CACxC,MAAM,wBAAwB,IAAI,IAAI;CACtC,KAAK,MAAM,EAAE,MAAM,gBAAgB,0BAA0B,MAAM,cAAc,GAAG;EACnF,IAAI,WAAW,aAAa,MAAM;EACl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AO;CAC3B,IAAI,MAAM,QAAQ,IAAI,MAAM,MAAM,QAAQ,KAAK,GAAG,OAAO;CACzD,IAAI,OAAO,SAAS,YAAY,OAAO,UAAU,YAAY,SAAS,QAAQ,UAAU,MAAM,OAAO;CACrG,MAAM,UAAU,OAAO,QAAQ,IAAI;CACnC,MAAM,SAAS,IAAI,IAAI,OAAO,QAAQ,KAAK,CAAC;CAC5C,OAAO,QAAQ,WAAW,OAAO,QAAQ,QAAQ,OAAO,CAAC,KAAK,YAAY;EACzE,MAAM,QAAQ,OAAO,IAAI,GAAG;EAC5B,OAAO,UAAU,KAAK,KAAK,SAAS,QAAQ,KAAK;CAClD,CAAC;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./types-c1iIhJep-DdMj6TNl.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-CaVn_xxe-D9WdU3Iy.mjs","names":[],"sources":["../../../../2-sql/1-core/schema-ir/dist/types-CaVn_xxe.mjs"],"sourcesContent":["import { f as normalizeIndexOptionValue, l as nameOf } from \"./naming-bM5qm5PY.mjs\";\nimport { IRNodeBase, freezeNode } from \"@internal/framework-components/ir\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\nimport { dataTypeValuesEqual } from \"@internal/framework-components/codec\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { isArrayEqual } from \"@internal/utils/array-equal\";\n//#region src/ir/schema-node-kinds.ts\n/**\n* The `nodeKind` discriminant for each relational schema-diff leaf node.\n* Each node carries a unique value; the differ pairs siblings by `id`, and\n* these kinds distinguish the node types that appear as `PostgresTableSchemaNode`\n* children (columns, primary key, foreign keys, uniques, indexes, checks) from\n* each other and from the RLS policy/role kinds a target defines separately.\n*/\nconst RelationalSchemaNodeKind = {\n\tschema: \"sql-schema\",\n\ttable: \"sql-table\",\n\tcolumn: \"sql-column\",\n\tcolumnDefault: \"sql-column-default\",\n\tprimaryKey: \"sql-primary-key\",\n\tforeignKey: \"sql-foreign-key\",\n\tunique: \"sql-unique\",\n\tindex: \"sql-index\",\n\tcheck: \"sql-check-constraint\"\n};\n/**\n* The one real map from a relational `nodeKind` to the framework-neutral\n* {@link DiffSubjectGranularity} its diff issues carry — the SQL family's\n* post-diff filters (issue category, strict-mode gating) and the framework\n* aggregate's unclaimed-elements sweep key on the granularity, never on the\n* `nodeKind` spelling and never on anything stamped on the node. Resolution\n* is by `nodeKind` equality against this map, not a suffix string match.\n* Target-specific node kinds (Postgres namespace/table/policy/role) are\n* outside this family layer's vocabulary and map their own kinds directly.\n*/\nconst RELATIONAL_NODE_GRANULARITY = {\n\t[RelationalSchemaNodeKind.schema]: \"structural\",\n\t[RelationalSchemaNodeKind.table]: \"entity\",\n\t[RelationalSchemaNodeKind.column]: \"field\",\n\t[RelationalSchemaNodeKind.columnDefault]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.primaryKey]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.foreignKey]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.unique]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.index]: \"auxiliary\",\n\t[RelationalSchemaNodeKind.check]: \"auxiliary\"\n};\nfunction isRelationalSchemaNodeKind(nodeKind) {\n\treturn Object.hasOwn(RELATIONAL_NODE_GRANULARITY, nodeKind);\n}\n/**\n* Looks up the subject granularity for a relational `nodeKind`. Throws for a\n* `nodeKind` outside this map (a target-specific kind, e.g. Postgres's\n* namespace/table/policy/role) — those map their own kinds directly rather\n* than through this family-level map.\n*/\nfunction relationalNodeGranularity(nodeKind) {\n\tif (!isRelationalSchemaNodeKind(nodeKind)) throw new InternalError(`relationalNodeGranularity: unrecognized relational node kind \"${nodeKind}\"`);\n\treturn RELATIONAL_NODE_GRANULARITY[nodeKind];\n}\n/**\n* The one real map from a relational `nodeKind` to its storage `entityKind`\n* — the same vocabulary the contract storage's `entries` dictionary keys use\n* (`elementCoordinates` walks it). Only the whole-table kind has an entity of\n* its own; every other relational node (a column, an index, …) is nested\n* under one and maps to nothing here.\n*/\nconst RELATIONAL_NODE_ENTITY_KIND = { [RelationalSchemaNodeKind.table]: \"table\" };\n/**\n* Looks up the storage `entityKind` for a relational `nodeKind` — sibling of\n* {@link relationalNodeGranularity}, resolved by `nodeKind` equality against\n* {@link RELATIONAL_NODE_ENTITY_KIND}. `undefined` for a target-specific kind\n* (targets map their own kinds directly) or a relational kind with no entity\n* of its own.\n*/\nfunction relationalNodeEntityKind(nodeKind) {\n\treturn isRelationalSchemaNodeKind(nodeKind) ? RELATIONAL_NODE_ENTITY_KIND[nodeKind] : void 0;\n}\n//#endregion\n//#region src/ir/sql-schema-ir-node.ts\n/**\n* SQL Schema IR node base. Carries the family-level\n* `kind = 'sql-schema-ir'` discriminator and inherits the framework's\n* `freezeNode` affordance.\n*\n* SQL Schema IR represents the actual database state as discovered by\n* introspection (the parallel to SQL Contract IR, which represents the\n* desired state).\n*\n* The discriminator is installed as a non-enumerable own property,\n* matching the SqlNode pattern. This keeps `JSON.stringify(node)`\n* canonical (no `kind` field), keeps `toEqual({...})` test assertions\n* against pre-lift flat shapes passing, and keeps `node.kind` readable\n* for dispatch.\n*\n* Both `kind` and `nodeKind` are required: every concrete leaf is a node\n* the generic differ can pair and compare, so every leaf must declare which\n* node it is. `nodeKind` has no default here — every direct subclass sets its\n* own literal value (the relational leaves via `RelationalSchemaNodeKind`,\n* target concretions via their own vocabulary, e.g. `PostgresSchemaNodeKind`).\n*/\nvar SqlSchemaIRNode = class extends IRNodeBase {\n\tconstructor() {\n\t\tsuper();\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: \"sql-schema-ir\",\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: false\n\t\t});\n\t}\n};\n/**\n* Asserts `node` matches `predicate`, narrowing its type to `T`. The one\n* shared implementation every node class's `static assert` and `isEqualTo`\n* reach for, instead of each hand-writing its own throw: the message names\n* the class the caller expected.\n*/\nfunction assertNode(node, className, predicate) {\n\tif (node === void 0 || !predicate(node)) throw new InternalError(`Expected a ${className} but got nodeKind=${node?.nodeKind ?? \"undefined\"}`);\n}\n/**\n* Defines a non-enumerable own property, the same treatment `kind` gets\n* above: a derivation-time render-support field stays out of\n* `JSON.stringify`, `toEqual({...})` structural assertions, and spreads,\n* while remaining directly readable (`node.field`) for the one consumer\n* that resolves it at plan time. A no-op when `value` is `undefined` — the\n* property is simply absent, matching every other optional field on these\n* nodes.\n*/\nfunction defineNonEnumerable(target, key, value) {\n\tif (value === void 0) return;\n\tObject.defineProperty(target, key, {\n\t\tvalue,\n\t\tenumerable: false,\n\t\twritable: false,\n\t\tconfigurable: false\n\t});\n}\n//#endregion\n//#region src/ir/primary-key.ts\n/**\n* Primary-key Schema IR node. Mirrors the Contract IR `PrimaryKey`\n* shape (same `columns` + optional `name`) so verification can compare\n* intent and actual structurally. Defined here independently to avoid\n* a sql-schema-ir -> sql-contract dependency.\n*\n* Implements `DiffableNode` so a primary key is directly a table's diff-tree\n* child. `id` is a fixed sentinel — a table has at most one primary key, so\n* there is never a sibling to disambiguate against. `isEqualTo` compares the\n* column tuple; the PK's own `name` is a database-assigned label with no\n* semantic weight, so it is not compared (mirrors the policy node's\n* name-insensitivity to non-identifying detail).\n*/\nvar PrimaryKey = class PrimaryKey extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.primaryKey;\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"primary-key\";\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof PrimaryKey ? value : new PrimaryKey(value);\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.primaryKey;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"PrimaryKey\", PrimaryKey.is);\n\t\treturn this.columns.length === node.columns.length && this.columns.every((c, i) => c === node.columns[i]);\n\t}\n};\n//#endregion\n//#region src/ir/sql-check-constraint-ir.ts\n/**\n* Schema IR node for a table-level check constraint, carried as an opaque\n* predicate. The expression is never parsed — a database reprints predicates\n* in its own normalized form, so any structured reading of it would drift.\n*\n* Implements `DiffableNode` so a check is directly a table's diff-tree child;\n* `id` is `check:<name>`. `isEqualTo` is mode-selected by the receiver's\n* `prefix` (the differ always calls `expected.isEqualTo(actual)`): a\n* wire-named receiver compares ids only — the wire name's hash already\n* commits to the predicate — while an exact-named receiver byte-compares the\n* expression, which is reliable precisely when both sides came from the same\n* reprint.\n*/\nvar SqlCheckConstraintIR = class SqlCheckConstraintIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.check;\n\tname;\n\texpression;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = nameOf(input.naming);\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tthis.expression = input.expression;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `check:${this.name}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof SqlCheckConstraintIR ? value : new SqlCheckConstraintIR(value);\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.check;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlCheckConstraintIR\", SqlCheckConstraintIR.is);\n\t\tif (this.prefix !== void 0) return this.id === node.id;\n\t\treturn this.expression === node.expression;\n\t}\n};\n//#endregion\n//#region src/ir/sql-default-value.ts\nfunction isList(value) {\n\treturn Array.isArray(value);\n}\n/** Whether two defaults are one value: the same type, parameters and value, element by element for a list. */\nfunction sqlDefaultValuesEqual(a, b) {\n\tif (!isList(a) || !isList(b)) return !isList(a) && !isList(b) && dataTypeValuesEqual(a, b);\n\treturn a.length === b.length && a.every((element, index) => {\n\t\tconst other = b[index];\n\t\tif (element === null || other === null || other === void 0) return element === other;\n\t\treturn dataTypeValuesEqual(element, other);\n\t});\n}\n//#endregion\n//#region src/ir/sql-column-default-ir.ts\n/**\n* Schema-diff node for a column's default value. The default is the one\n* column attribute with an extra/missing/drift lifecycle of its own, so it\n* is a child node of the column rather than a compared attribute: an\n* undeclared live default surfaces as `not-expected`, a declared default the\n* database lacks as `not-found`, and a divergent value as `not-equal` — the\n* three reasons cover the legacy `extra_default` / `default_missing` /\n* `default_mismatch` vocabulary with no attribute inspection.\n*\n* `id` is a fixed sentinel — a column has at most one default. Built\n* transiently by `SqlColumnIR.children()` from the column's own fields;\n* never constructed by derivation or introspection directly.\n*/\nvar SqlColumnDefaultIR = class SqlColumnDefaultIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.columnDefault;\n\tconstructor(input) {\n\t\tsuper();\n\t\tif (input.resolved !== void 0) this.resolved = input.resolved;\n\t\tif (input.raw !== void 0) this.raw = input.raw;\n\t\tdefineNonEnumerable(this, \"authored\", input.authored);\n\t\tdefineNonEnumerable(this, \"value\", input.value);\n\t\tdefineNonEnumerable(this, \"unreadable\", input.unreadable);\n\t\tdefineNonEnumerable(this, \"expressionValue\", input.expressionValue);\n\t\tdefineNonEnumerable(this, \"many\", input.many);\n\t\tdefineNonEnumerable(this, \"codecRef\", input.codecRef);\n\t\tdefineNonEnumerable(this, \"codecBaseNativeType\", input.codecBaseNativeType);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"default\";\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.columnDefault;\n\t}\n\t/**\n\t* Compares with `this` as the expected side. Two literals compare as values of the column's type\n\t* when both sides hold one, and as canonical JSON otherwise; a `Date` the column's codec could not\n\t* read into a value equals nothing. Two expressions compare as text, with\n\t* case and whitespace ignored outside quotes. An expected expression that writes a literal, read by\n\t* the column's codec during introspection, matches a reported literal when the two values are\n\t* equal; when the codec could not read one of them, it compares with the reported text. A resolved\n\t* side against a raw-only side is a mismatch; two raw-only nodes compare their text.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlColumnDefaultIR\", SqlColumnDefaultIR.is);\n\t\tconst expected = this.resolved;\n\t\tconst actual = node.resolved;\n\t\tif (expected?.kind === \"function\" && actual === void 0) return node.raw !== void 0 && sameExpression(expected.expression, node.raw);\n\t\tif (expected === void 0 || actual === void 0) return expected === actual && this.raw === node.raw;\n\t\tif (expected.kind === \"function\") {\n\t\t\tif (actual.kind === \"function\") return sameExpression(expected.expression, actual.expression);\n\t\t\tif (node.value !== void 0 && node.expressionValue !== void 0) return sqlDefaultValuesEqual(node.expressionValue, node.value);\n\t\t\treturn node.raw !== void 0 && sameExpression(expected.expression, node.raw);\n\t\t}\n\t\tif (actual.kind !== \"literal\") return false;\n\t\tif (this.value !== void 0 && node.value !== void 0) return sqlDefaultValuesEqual(this.value, node.value);\n\t\tif (expected.value instanceof Date || actual.value instanceof Date) return false;\n\t\treturn canonicalStringify(expected.value) === canonicalStringify(actual.value);\n\t}\n\t/** Why the column's codec could not read the default the database reports, when it could not; otherwise the value each side holds. */\n\texplainMismatch(actual) {\n\t\tif (!(actual instanceof SqlColumnDefaultIR)) return void 0;\n\t\tif (actual.unreadable !== void 0) return actual.unreadable;\n\t\treturn `The contract holds ${describeDefault(this)}, and the database holds ${describeDefault(actual)}.`;\n\t}\n};\n/** A default as a person reads it: a literal as JSON, the value its type read when there is one, an expression as its text, and the text the database reports beside a value read from it. */\nfunction describeDefault(node) {\n\tconst resolved = node.resolved;\n\tif (resolved === void 0) return node.raw ?? \"no default\";\n\tif (resolved.kind === \"function\") return resolved.expression;\n\tconst shown = JSON.stringify(node.value === void 0 ? resolved.value : jsonOfDefaultValue(node.value));\n\treturn node.raw === void 0 || node.raw === shown ? shown : `${shown} (${node.raw})`;\n}\nfunction isDefaultList(value) {\n\treturn Array.isArray(value);\n}\nfunction jsonOfDefaultValue(value) {\n\treturn isDefaultList(value) ? value.map((element) => element === null ? null : element.value) : value.value;\n}\nfunction sameExpression(a, b) {\n\treturn comparableExpression(a) === comparableExpression(b);\n}\n/** The expression with case and whitespace dropped outside quotes; a quoted literal or identifier keeps both, since they change what it means. */\nfunction comparableExpression(expression) {\n\tlet result = \"\";\n\tlet quote;\n\tfor (const char of expression) if (quote !== void 0) {\n\t\tresult += char;\n\t\tif (char === quote) quote = void 0;\n\t} else if (char === \"'\" || char === \"\\\"\") {\n\t\tquote = char;\n\t\tresult += char;\n\t} else if (!/\\s/.test(char)) result += char.toLowerCase();\n\treturn result;\n}\n//#endregion\n//#region src/ir/sql-column-ir.ts\n/**\n* Schema IR node for a single column on a table, as observed by\n* introspection. Unlike the Contract IR `StorageColumn`, this carries\n* the column's `name` (Schema IR columns are returned as arrays from\n* introspection queries; the parent table re-keys them into a record\n* for downstream consumers).\n*\n* Implements `DiffableNode` so a column is directly a table's diff-tree\n* child: `id` is the column name (unique among a table's columns); `isEqualTo`\n* compares this column's own attributes only — never children, since a\n* column is a leaf. When both sides carry `resolvedNativeType` (stamped at\n* derivation/introspection), the comparison uses the resolved values —\n* resolved native type, nullability, and structured default equality per\n* the relational walk's `columnDefaultsEqual` semantics, with `this` as the\n* expected side. Otherwise it falls back to comparing raw fields.\n*/\nvar SqlColumnIR = class SqlColumnIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.column;\n\tname;\n\tnativeType;\n\tnullable;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = input.name;\n\t\tthis.nativeType = input.nativeType;\n\t\tthis.nullable = input.nullable;\n\t\tif (input.default !== void 0) this.default = input.default;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tif (input.many !== void 0) this.many = input.many;\n\t\tif (input.resolvedNativeType !== void 0) this.resolvedNativeType = input.resolvedNativeType;\n\t\tif (input.resolvedDefault !== void 0) this.resolvedDefault = input.resolvedDefault;\n\t\tdefineNonEnumerable(this, \"authoredDefault\", input.authoredDefault);\n\t\tdefineNonEnumerable(this, \"codecRef\", input.codecRef);\n\t\tdefineNonEnumerable(this, \"codecBaseNativeType\", input.codecBaseNativeType);\n\t\tdefineNonEnumerable(this, \"dataType\", input.dataType);\n\t\tdefineNonEnumerable(this, \"defaultValue\", input.defaultValue);\n\t\tdefineNonEnumerable(this, \"defaultUnreadable\", input.defaultUnreadable);\n\t\tdefineNonEnumerable(this, \"defaultExpressionValue\", input.defaultExpressionValue);\n\t\tdefineNonEnumerable(this, \"reportedType\", input.reportedType);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `column:${this.name}`;\n\t}\n\t/**\n\t* The column's default, when declared/present, is the column's one child\n\t* node — it has an extra/missing/drift lifecycle of its own, so the differ\n\t* recurses to it rather than `isEqualTo` comparing it. Built transiently\n\t* from this column's own fields.\n\t*/\n\tchildren() {\n\t\tif (this.resolvedDefault === void 0 && this.default === void 0) return [];\n\t\treturn [new SqlColumnDefaultIR({\n\t\t\t...ifDefined(\"resolved\", this.resolvedDefault),\n\t\t\t...ifDefined(\"raw\", this.default),\n\t\t\t...ifDefined(\"authored\", this.authoredDefault),\n\t\t\t...ifDefined(\"value\", this.defaultValue),\n\t\t\t...ifDefined(\"unreadable\", this.defaultUnreadable),\n\t\t\t...ifDefined(\"expressionValue\", this.defaultExpressionValue),\n\t\t\t...ifDefined(\"many\", this.many ?? this.codecRef?.many),\n\t\t\t...ifDefined(\"codecRef\", this.codecRef),\n\t\t\t...ifDefined(\"codecBaseNativeType\", this.codecBaseNativeType)\n\t\t})];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.column;\n\t}\n\t/**\n\t* Compares the column's own attributes only — the default lives on the\n\t* child node. When both sides carry `resolvedNativeType`, the resolved\n\t* value governs (array-ness rides on its `[]` suffix); otherwise raw\n\t* fields compare.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlColumnIR\", SqlColumnIR.is);\n\t\tif (this.resolvedNativeType !== void 0 && node.resolvedNativeType !== void 0) return this.resolvedNativeType === node.resolvedNativeType && this.nullable === node.nullable;\n\t\treturn this.nativeType === node.nativeType && this.nullable === node.nullable && Boolean(this.many) === Boolean(node.many);\n\t}\n};\n//#endregion\n//#region src/ir/sql-foreign-key-ir.ts\n/**\n* Schema IR node for a foreign-key constraint as observed by\n* introspection. The `referencedTable` / `referencedColumns` field\n* names match the introspection vocabulary (`pg_constraint.confkey`,\n* etc.) and intentionally differ from the Contract IR's nested\n* `references: { table, columns }` shape so that the verifier's\n* structural comparison stays explicit about which side it's reading.\n*\n* Implements `DiffableNode` so a foreign key is directly a table's diff-tree\n* child. Foreign keys are frequently unnamed (introspection may not carry a\n* constraint name, and the contract side never invents one), so `id` is\n* derived from the referencing/referenced coordinates rather than `name` —\n* the same tuple that makes two FK constraints the same constraint. This\n* also serves as the comparison key: two FKs with the same coordinates are\n* paired by the differ, and `isEqualTo` then compares the remaining\n* attribute — the referential actions.\n*/\nvar SqlForeignKeyIR = class SqlForeignKeyIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.foreignKey;\n\tcolumns;\n\treferencedTable;\n\treferencedColumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = input.columns;\n\t\tthis.referencedTable = input.referencedTable;\n\t\tthis.referencedColumns = input.referencedColumns;\n\t\tif (input.referencedSchema !== void 0) this.referencedSchema = input.referencedSchema;\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tif (input.onDelete !== void 0) this.onDelete = input.onDelete;\n\t\tif (input.onUpdate !== void 0) this.onUpdate = input.onUpdate;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tconst resolvedReferencedNamespace = input.resolvedReferencedNamespace ?? input.referencedSchema;\n\t\tif (resolvedReferencedNamespace !== void 0) this.resolvedReferencedNamespace = resolvedReferencedNamespace;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\tconst referencedNamespace = this.resolvedReferencedNamespace ?? \"\";\n\t\treturn `foreign-key:${this.columns.join(\",\")}->${referencedNamespace}.${this.referencedTable}(${this.referencedColumns.join(\",\")})`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.foreignKey;\n\t}\n\t/**\n\t* Referential-action comparison with `this` as the expected side, matching\n\t* the relational walk's `getReferentialActionMismatches`: `noAction` is the\n\t* database default and equivalent to an undeclared action, and drift is\n\t* flagged only when the expected side declares a (normalized) action.\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlForeignKeyIR\", SqlForeignKeyIR.is);\n\t\treturn referentialActionMatches(this.onDelete, node.onDelete) && referentialActionMatches(this.onUpdate, node.onUpdate);\n\t}\n};\nfunction referentialActionMatches(expected, actual) {\n\tconst normalizedExpected = expected === \"noAction\" ? void 0 : expected;\n\tif (normalizedExpected === void 0) return true;\n\treturn normalizedExpected === (actual === \"noAction\" ? void 0 : actual);\n}\n//#endregion\n//#region src/ir/sql-index-ir.ts\n/**\n* Schema IR node for a secondary index as observed by introspection.\n* Unlike the Contract IR `Index`, the Schema IR carries an explicit\n* `unique` field — introspection sees the underlying index regardless\n* of whether the user expressed it as `@@index` or `@@unique`, and the\n* verifier needs to distinguish them when comparing to the Contract.\n*\n* Implements `DiffableNode` so an index is directly a table's diff-tree\n* child. Indexes are name-identified: every index — contract-derived or\n* introspected — carries its full physical name, and `id` is that name.\n* Names are catalog-unique per schema, so two indexes legitimately sharing\n* one column tuple (a unique index beside a redundant plain index) are two\n* distinct siblings, and expression indexes need no column tuple at all.\n*\n* `isEqualTo` is selected by the receiver (the differ always calls\n* `expected.isEqualTo(actual)`) and delegates to {@link contentEquals} —\n* the single node-owned content relation: both modes compare `unique`\n* strict, `type` and option values through the named normalization seams,\n* and `columns` ordered-strict when both sides carry them; an exact-named\n* receiver (`prefix === undefined`) additionally byte-compares\n* `expression`/`where` (both sides are reprints in the supported flow —\n* normalizing would only mask real drift); a wire-named receiver never\n* compares bodies (the wire-name hash already commits to them).\n*\n* `expression`, `where`, and `unique` are genuine SQL-family attributes —\n* functional and partial indexes are standard SQL that any SQL target may\n* introspect, so the family node must represent them; a target declining\n* to author them is a capability decision, not target-specificity.\n*/\nvar SqlIndexIR = class SqlIndexIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.index;\n\tname;\n\tunique;\n\tconstructor(input) {\n\t\tsuper();\n\t\tconst name = nameOf(input.naming);\n\t\tif (input.columns === void 0 === (input.expression === void 0)) throw new InternalError(`SqlIndexIR \"${name}\": exactly one of columns or expression must be set.`);\n\t\tthis.name = name;\n\t\tthis.unique = input.unique;\n\t\tif (input.naming.kind === \"wire\") this.prefix = input.naming.prefix;\n\t\tif (input.columns !== void 0) this.columns = input.columns;\n\t\tif (input.expression !== void 0) this.expression = input.expression;\n\t\tif (input.where !== void 0) this.where = input.where;\n\t\tconst normalizedType = normalizeIndexType(input.type);\n\t\tif (normalizedType !== void 0) this.type = normalizedType;\n\t\tif (input.options !== void 0) this.options = input.options;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tdefineNonEnumerable(this, \"partial\", input.partial);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `index:${this.name}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic from(value) {\n\t\treturn value instanceof SqlIndexIR ? value : new SqlIndexIR(value);\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.index;\n\t}\n\t/**\n\t* Mode-selected structural equality — see the class doc. Delegates to the\n\t* single node-owned relation: `columns` compare ordered-strict when both\n\t* sides carry them; an exact receiver (`prefix === undefined`)\n\t* byte-compares `expression ?? ''` and `where ?? ''`; a wire-named receiver\n\t* never compares bodies (the wire-name hash already commits to them).\n\t*/\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlIndexIR\", SqlIndexIR.is);\n\t\treturn this.contentEquals(node, {\n\t\t\tcolumnPresence: \"when-both-defined\",\n\t\t\tbodies: this.prefix !== void 0 ? \"ignored\" : \"verbatim\"\n\t\t});\n\t}\n\t/**\n\t* The single index content-equality relation — every comparer (the differ\n\t* via {@link isEqualTo}, the planner's rename content-pairing) calls this\n\t* with its mode-appropriate strictness rather than growing a parallel\n\t* relation:\n\t*\n\t* - `columnPresence: 'when-both-defined'` (the differ's rule) compares\n\t* the tuples ordered-strict only when both sides carry them — a paired\n\t* node's identity already agreed, so a column node meeting an\n\t* expression node skips the tuple.\n\t* - `columnPresence: 'matching'` (the rename-pairing rule) additionally\n\t* requires presence to agree: a column index never pairs an expression\n\t* index.\n\t* - `bodies: 'verbatim'` byte-compares `expression ?? ''` / `where ?? ''`\n\t* (absent ≡ empty, no normalization — both sides are reprints in the\n\t* supported flow); `bodies: 'ignored'` skips them (wire identity —\n\t* the wire-name hash commits to the content).\n\t*\n\t* `unique` compares strictly; `type` and option VALUES compare through\n\t* the named normalization seams below.\n\t*/\n\tcontentEquals(other, strictness) {\n\t\tconst columnsEqual = strictness.columnPresence === \"matching\" ? this.columns === void 0 === (other.columns === void 0) && (this.columns === void 0 || isArrayEqual(this.columns, other.columns ?? [])) : this.columns === void 0 || other.columns === void 0 || isArrayEqual(this.columns, other.columns);\n\t\tif (!(this.unique === other.unique && normalizeIndexType(this.type) === normalizeIndexType(other.type) && indexOptionsEqual(this.options, other.options) && columnsEqual)) return false;\n\t\tif (strictness.bodies === \"ignored\") return true;\n\t\treturn (this.expression ?? \"\") === (other.expression ?? \"\") && (this.where ?? \"\") === (other.where ?? \"\");\n\t}\n};\n/**\n* The btree-default normalization seam: the default access method (`btree`\n* in every supported SQL target) normalizes to absent. Applied at\n* construction — every derivation path (contract tree, introspection, flat\n* family tree) builds through the class, so both compare sides are\n* symmetric by definition — and again inside\n* {@link SqlIndexIR.contentEquals} so the relation holds for any input.\n* The contract JSON and the wire-name content hash keep the authored\n* spelling: `@@index([a], type: \"btree\")` and `@@index([a])` are distinct\n* wire names — but content-equal after normalization, so a spelling change\n* between them converges as a rename via the planner's content\n* pairing (the hashes differ, so hash pairing never pairs them).\n*/\nfunction normalizeIndexType(type) {\n\treturn type === \"btree\" ? void 0 : type;\n}\n/**\n* Option-bag equality: same key set, values compared through\n* {@link normalizeIndexOptionValue} — Postgres introspection returns\n* reloptions values as catalog-reprint strings (`'70'`, `'on'`) while\n* contract option leaves are typed (number, boolean, string).\n*/\nfunction indexOptionsEqual(a, b) {\n\tconst aKeys = a ? Object.keys(a).sort() : [];\n\tconst bKeys = b ? Object.keys(b).sort() : [];\n\tif (aKeys.length !== bKeys.length) return false;\n\tfor (let i = 0; i < aKeys.length; i += 1) if (aKeys[i] !== bKeys[i]) return false;\n\tif (aKeys.length === 0) return true;\n\tfor (const key of aKeys) if (normalizeIndexOptionValue(a?.[key]) !== normalizeIndexOptionValue(b?.[key])) return false;\n\treturn true;\n}\n//#endregion\n//#region src/ir/sql-unique-ir.ts\n/**\n* Schema IR node for a table-level unique constraint as observed by\n* introspection.\n*\n* Implements `DiffableNode` so a unique constraint is directly a table's\n* diff-tree child. Unique constraints are frequently unnamed, so `id` is\n* derived from the column tuple rather than `name` — the column tuple is\n* also what makes two unique constraints the same constraint, so it doubles\n* as the pairing key. There are no further attributes to compare once\n* columns are equal (the differ pairs on `id`), so `isEqualTo` is identity.\n*/\nvar SqlUniqueIR = class SqlUniqueIR extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.unique;\n\tcolumns;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.columns = [...input.columns];\n\t\tif (input.name !== void 0) this.name = input.name;\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tdefineNonEnumerable(this, \"dependsOn\", input.dependsOn);\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn `unique:${this.columns.join(\",\")}`;\n\t}\n\tchildren() {\n\t\treturn [];\n\t}\n\tstatic is(node) {\n\t\treturn node.nodeKind === RelationalSchemaNodeKind.unique;\n\t}\n\tisEqualTo(other) {\n\t\tconst node = blindCast(other);\n\t\tassertNode(node, \"SqlUniqueIR\", SqlUniqueIR.is);\n\t\treturn this.id === node.id;\n\t}\n};\n//#endregion\n//#region src/ir/sql-table-ir.ts\n/**\n* Schema IR node for a single table as observed by introspection.\n*\n* Unlike the Contract IR `StorageTable`, this carries the table's\n* `name` — introspection queries return tables as arrays and the\n* verifier keys them into `SqlSchemaIR.tables` afterwards, so the name\n* stays on the table object for downstream call sites that walk\n* `Object.values(schema.tables)`.\n*\n* The constructor normalises nested IR-class fields so downstream\n* walks see a uniform AST regardless of whether the input was a\n* plain-data literal (from introspection) or already-constructed\n* class instances.\n*\n* Implements `DiffableNode` so a flat (single-schema) tree is directly\n* diffable: `id` is the table name; `isEqualTo` is identity (the table's\n* structural drift is entirely expressed by its children); `children()`\n* yields every column, the primary key (when present), every foreign key,\n* unique, index, and check constraint — the same composition and order as\n* the Postgres table node, minus policies.\n*/\nvar SqlTableIR = class extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.table;\n\tname;\n\tcolumns;\n\tforeignKeys;\n\tuniques;\n\tindexes;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.name = input.name;\n\t\tthis.columns = Object.freeze(Object.fromEntries(Object.entries(input.columns).map(([key, col]) => [key, col instanceof SqlColumnIR ? col : new SqlColumnIR(col)])));\n\t\tthis.foreignKeys = Object.freeze(input.foreignKeys.map((fk) => fk instanceof SqlForeignKeyIR ? fk : new SqlForeignKeyIR(fk)));\n\t\tthis.uniques = Object.freeze(input.uniques.map((u) => u instanceof SqlUniqueIR ? u : new SqlUniqueIR(u)));\n\t\tthis.indexes = Object.freeze(input.indexes.map(SqlIndexIR.from));\n\t\tif (input.primaryKey !== void 0) this.primaryKey = PrimaryKey.from(input.primaryKey);\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tif (input.checks !== void 0 && input.checks.length > 0) this.checks = Object.freeze(input.checks.map(SqlCheckConstraintIR.from));\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn this.name;\n\t}\n\tisEqualTo(other) {\n\t\treturn this.id === other.id;\n\t}\n\tchildren() {\n\t\treturn [\n\t\t\t...Object.values(this.columns),\n\t\t\t...this.primaryKey ? [this.primaryKey] : [],\n\t\t\t...this.foreignKeys,\n\t\t\t...this.uniques,\n\t\t\t...this.indexes,\n\t\t\t...this.checks ?? []\n\t\t];\n\t}\n};\n//#endregion\n//#region src/ir/sql-schema-ir.ts\n/**\n* Root Schema IR node representing the complete database schema as\n* observed by introspection. Target-agnostic; used by both verifiers\n* (compare against intended Contract storage) and migration planners\n* (derive operations needed to reconcile).\n*\n* The constructor normalises nested `SqlTableIR` instances so\n* downstream walks see a uniform AST regardless of whether the input\n* was a plain-data literal or already-constructed class instances.\n*\n* Implements `DiffableNode` as the root of a flat (single-schema) diff\n* tree: `id` is the fixed sentinel `'database'` (roots have no siblings),\n* `isEqualTo` is identity (a container has no own attributes), and\n* `children()` yields the table nodes.\n*/\nvar SqlSchemaIR = class extends SqlSchemaIRNode {\n\tnodeKind = RelationalSchemaNodeKind.schema;\n\ttables;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.tables = Object.freeze(Object.fromEntries(Object.entries(input.tables).map(([key, t]) => [key, t instanceof SqlTableIR ? t : new SqlTableIR(t)])));\n\t\tif (input.annotations !== void 0) this.annotations = input.annotations;\n\t\tfreezeNode(this);\n\t}\n\tget id() {\n\t\treturn \"database\";\n\t}\n\tisEqualTo(other) {\n\t\treturn this.id === other.id;\n\t}\n\tchildren() {\n\t\treturn Object.values(this.tables);\n\t}\n};\n//#endregion\nexport { SqlForeignKeyIR as a, sqlDefaultValuesEqual as c, SqlSchemaIRNode as d, assertNode as f, relationalNodeGranularity as g, relationalNodeEntityKind as h, SqlIndexIR as i, SqlCheckConstraintIR as l, RelationalSchemaNodeKind as m, SqlTableIR as n, SqlColumnIR as o, defineNonEnumerable as p, SqlUniqueIR as r, SqlColumnDefaultIR as s, SqlSchemaIR as t, PrimaryKey as u };\n\n//# sourceMappingURL=types-CaVn_xxe.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAM,2BAA2B;CAChC,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,eAAe;CACf,YAAY;CACZ,YAAY;CACZ,QAAQ;CACR,OAAO;CACP,OAAO;AACR;;;;;;;;;;;AAWA,MAAM,8BAA8B;EAClC,yBAAyB,SAAS;EAClC,yBAAyB,QAAQ;EACjC,yBAAyB,SAAS;EAClC,yBAAyB,gBAAgB;EACzC,yBAAyB,aAAa;EACtC,yBAAyB,aAAa;EACtC,yBAAyB,SAAS;EAClC,yBAAyB,QAAQ;EACjC,yBAAyB,QAAQ;AACnC;AACA,SAAS,2BAA2B,UAAU;CAC7C,OAAO,OAAO,OAAO,6BAA6B,QAAQ;AAC3D;;;;;;;AAOA,SAAS,0BAA0B,UAAU;CAC5C,IAAI,CAAC,2BAA2B,QAAQ,GAAG,MAAM,IAAI,cAAc,iEAAiE,SAAS,EAAE;CAC/I,OAAO,4BAA4B;AACpC;;;;;;;;AAQA,MAAM,8BAA8B,GAAG,yBAAyB,QAAQ,QAAQ;;;;;;;;AAQhF,SAAS,yBAAyB,UAAU;CAC3C,OAAO,2BAA2B,QAAQ,IAAI,4BAA4B,YAAY,KAAK;AAC5F;;;;;;;;;;;;;;;;;;;;;;AAwBA,IAAI,kBAAkB,cAAc,WAAW;CAC9C,cAAc;EACb,MAAM;EACN,OAAO,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