@prisma/orm-family-sql 8.0.0-rc.17-dev.31 → 8.0.0-rc.17-dev.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/{authoring-type-constructors-0Iv2zdwS-D-AoEcR1.mjs → authoring-type-constructors-0Iv2zdwS-DjC0oxBn.mjs} +2 -2
  2. package/dist/{authoring-type-constructors-0Iv2zdwS-D-AoEcR1.mjs.map → authoring-type-constructors-0Iv2zdwS-DjC0oxBn.mjs.map} +1 -1
  3. package/dist/{config-types-DabYoGbo.mjs → config-types-GKGrPAno.mjs} +2 -2
  4. package/dist/{config-types-DabYoGbo.mjs.map → config-types-GKGrPAno.mjs.map} +1 -1
  5. package/dist/{contract-builder-C5n9DeDD.mjs → contract-builder-uPgNqtxM.mjs} +3 -3
  6. package/dist/{contract-builder-C5n9DeDD.mjs.map → contract-builder-uPgNqtxM.mjs.map} +1 -1
  7. package/dist/contract-prisma7__provider.mjs +4 -4
  8. package/dist/contract-psl.mjs +1 -1
  9. package/dist/contract-psl__attribute-specs.mjs +1 -1
  10. package/dist/contract-psl__provider.mjs +2 -2
  11. package/dist/contract-psl__provider.mjs.map +1 -1
  12. package/dist/contract-ts.mjs +3 -3
  13. package/dist/contract-ts__config-types.mjs +1 -1
  14. package/dist/contract-ts__contract-builder.mjs +2 -2
  15. package/dist/contract.mjs +1 -1
  16. package/dist/contract__validators.mjs +1 -1
  17. package/dist/{control-BICnlTqY.mjs → control-DoMJbS3w.mjs} +5 -5
  18. package/dist/{control-BICnlTqY.mjs.map → control-DoMJbS3w.mjs.map} +1 -1
  19. package/dist/{derived-checks-DSMOrZN--C03ao8_m.mjs → derived-checks-DSMOrZN--D4sGB1Rt.mjs} +2 -2
  20. package/dist/{derived-checks-DSMOrZN--C03ao8_m.mjs.map → derived-checks-DSMOrZN--D4sGB1Rt.mjs.map} +1 -1
  21. package/dist/family.mjs +3 -3
  22. package/dist/family__control.mjs +2 -2
  23. package/dist/family__ir.mjs +1 -1
  24. package/dist/family__pack.mjs +2 -2
  25. package/dist/{interpreter-DJQBAjo4-DEwoC6An.mjs → interpreter-0z4AxG0I-DO_n08hz.mjs} +26 -12
  26. package/dist/interpreter-0z4AxG0I-DO_n08hz.mjs.map +1 -0
  27. package/dist/orm-client.d.mts +56 -56
  28. package/dist/orm-client.d.mts.map +1 -1
  29. package/dist/orm-client.mjs +190 -177
  30. package/dist/orm-client.mjs.map +1 -1
  31. package/dist/{psl-field-resolution-D4jnVVTd-CsmY9mnF.mjs → psl-field-resolution-D4jnVVTd-Drt-tbfu.mjs} +3 -3
  32. package/dist/{psl-field-resolution-D4jnVVTd-CsmY9mnF.mjs.map → psl-field-resolution-D4jnVVTd-Drt-tbfu.mjs.map} +1 -1
  33. package/dist/{sql-contract-serializer-DDaAVCQr-CK2KUyq0.mjs → sql-contract-serializer-DDaAVCQr-BAb4jKvV.mjs} +2 -2
  34. package/dist/{sql-contract-serializer-DDaAVCQr-CK2KUyq0.mjs.map → sql-contract-serializer-DDaAVCQr-BAb4jKvV.mjs.map} +1 -1
  35. package/dist/{validators-B9prRmOP.mjs → validators-BMWQ7-5D.mjs} +3 -3
  36. package/dist/validators-BMWQ7-5D.mjs.map +1 -0
  37. package/package.json +18 -18
  38. package/dist/interpreter-DJQBAjo4-DEwoC6An.mjs.map +0 -1
  39. package/dist/validators-B9prRmOP.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"interpreter-DJQBAjo4-DEwoC6An.mjs","names":[],"sources":["../../../../2-sql/2-authoring/contract-psl/dist/interpreter-DJQBAjo4.mjs"],"sourcesContent":["import { C as mapFieldNamesToColumns, S as getNamedArgument, a as getAuthoringEntity, b as formatDbAttributeMigrationMessage, c as resolveFieldTypeDescriptor, d as fieldSpecContext, f as interpretFieldAttribute, g as sqlAttributeSpecs, h as modelSpecContext, i as bareTypeConstructorOf, l as toNamedTypeFieldDescriptor, m as modelAttributeSpecsFrom, p as interpretModelAttribute, r as modelCoordinateKey, s as instantiatePslTypeConstructor, t as collectResolvedFields, u as PSL_CHECK_ON_STI_VARIANT, v as readWrittenNumberForCodec, w as storageName, x as getAttribute, y as contractError } from \"./psl-field-resolution-D4jnVVTd.mjs\";\nimport { t as defaultTableName } from \"./default-table-name-BfFY8qYR.mjs\";\nimport { contributedTypeOf, createPslDiagnosticCollector, diagnosticSource, findBlockDescriptor, interpretExtensionBlocks, nodePslSpan, typeReferenceNode } from \"@internal/psl-parser\";\nimport { buildSqlContractFromDefinition } from \"@internal/sql-contract-ts/contract-builder\";\nimport { assertDefined, invariant } from \"@internal/utils/assertions\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { instantiateAuthoringEntityType, instantiateAuthoringTypeConstructor, isAuthoringEntityTypeDescriptor, isAuthoringModelAttributeDescriptor } from \"@internal/framework-components/authoring\";\nimport { claimedBlockKeywords, enumMemberAttributeDiagnostics, fkRelationPairKey, requiredOneToOneBackrelationDiagnostic, unsupportedBlockDiagnostic } from \"@internal/psl-parser/interpret\";\nimport { sqlTextFromCanonical } from \"@internal/sql-contract/sql-expression\";\nimport { isStructuredError } from \"@internal/utils/structured-error\";\nimport { NamespaceDeclarationAst } from \"@internal/psl-parser/syntax\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { crossRef } from \"@internal/contract/types\";\nimport { resolveToOneRelationNullable } from \"@internal/contract-authoring\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { UNBOUND_PSL_NAMESPACE_NAME, UNSPECIFIED_PSL_NAMESPACE_ID } from \"@internal/framework-components/psl-ast\";\nimport { providesPslEntityPlacement } from \"@internal/sql-contract/entity-handle-lowering-hook\";\nimport { FOREIGN_KEY_INDEX_UNRESOLVED } from \"@internal/sql-contract/foreign-key-materialization\";\nimport { isAuthoredIndexInput } from \"@internal/sql-contract/index-naming\";\nimport { CODEC_INSTANCE_KIND, resolvedTypeParams } from \"@internal/sql-contract/types\";\nimport { deriveValueSetFromEntity } from \"@internal/sql-contract/value-set-derivation-hook\";\n//#region src/psl-named-type-resolution.ts\nfunction baseColumnDescriptor(resolution, enumTypeDescriptors) {\n\tif (resolution?.kind === \"block\") return enumTypeDescriptors.get(resolution.symbol);\n\tconst scalar = bareTypeConstructorOf(resolution);\n\treturn scalar === void 0 ? void 0 : instantiateAuthoringTypeConstructor(scalar, []);\n}\nfunction validateNamedTypeAttributes(input) {\n\tlet hasUnsupportedNamedTypeAttribute = false;\n\tfor (const attribute of input.declaration.attributes) {\n\t\tif (attribute.name.startsWith(\"db.\")) {\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: \"PSL_UNSUPPORTED_NAMED_TYPE_ATTRIBUTE\",\n\t\t\t\tmessage: formatDbAttributeMigrationMessage(attribute),\n\t\t\t\t...input.source.at(attribute.span)\n\t\t\t});\n\t\t\thasUnsupportedNamedTypeAttribute = true;\n\t\t\tcontinue;\n\t\t}\n\t\tinput.diagnostics.push({\n\t\t\tcode: \"PSL_UNSUPPORTED_NAMED_TYPE_ATTRIBUTE\",\n\t\t\tmessage: `Named type \"${input.declaration.name}\" uses unsupported attribute \"${attribute.name}\"`,\n\t\t\t...input.source.at(attribute.span)\n\t\t});\n\t\thasUnsupportedNamedTypeAttribute = true;\n\t}\n\treturn hasUnsupportedNamedTypeAttribute;\n}\nfunction resolveNamedTypeDeclarations(input) {\n\tconst storageTypeEntries = [];\n\tconst namedTypeDescriptors = /* @__PURE__ */ new Map();\n\tconst storageTypeOf = (descriptor) => ({\n\t\tkind: CODEC_INSTANCE_KIND,\n\t\tcodecId: descriptor.codecId,\n\t\ttypeParams: descriptor.typeParams ?? {}\n\t});\n\tfor (const declaration of input.declarations) {\n\t\tconst source = diagnosticSource(input.source.sources, declaration.node.syntax);\n\t\tconst reference = typeReferenceNode(declaration);\n\t\tconst resolution = reference === void 0 ? void 0 : input.binder.symbolForNode(reference);\n\t\tif (declaration.isConstructor) {\n\t\t\tconst typeConstructor = declaration.typeConstructor;\n\t\t\tif (typeConstructor === void 0) {\n\t\t\t\tinput.diagnostics.push({\n\t\t\t\t\tcode: \"PSL_UNSUPPORTED_NAMED_TYPE_BASE\",\n\t\t\t\t\tmessage: `Named type \"${declaration.name}\" must declare a base type or constructor`,\n\t\t\t\t\t...source.at(declaration.span)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (validateNamedTypeAttributes({\n\t\t\t\tdeclaration,\n\t\t\t\tsource,\n\t\t\t\tdiagnostics: input.diagnostics\n\t\t\t})) continue;\n\t\t\tconst descriptor = resolution?.kind === \"contributedType\" && resolution.symbol.descriptor.kind === \"typeConstructor\" ? resolution.symbol.descriptor : void 0;\n\t\t\tif (!descriptor) {\n\t\t\t\tinput.diagnostics.push({\n\t\t\t\t\tcode: \"PSL_UNSUPPORTED_NAMED_TYPE_CONSTRUCTOR\",\n\t\t\t\t\tmessage: `Named type \"${declaration.name}\" references unsupported constructor \"${typeConstructor.path.join(\".\")}\"`,\n\t\t\t\t\t...source.at(typeConstructor.span)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst storageType = instantiatePslTypeConstructor({\n\t\t\t\tcall: typeConstructor,\n\t\t\t\tdescriptor,\n\t\t\t\tcodecLookup: input.codecLookup,\n\t\t\t\tdiagnostics: input.diagnostics,\n\t\t\t\tsource,\n\t\t\t\tentityLabel: `Named type \"${declaration.name}\"`\n\t\t\t});\n\t\t\tif (!storageType) continue;\n\t\t\tnamedTypeDescriptors.set(declaration, toNamedTypeFieldDescriptor(declaration.name, storageType));\n\t\t\tstorageTypeEntries.push([declaration.name, storageTypeOf(storageType)]);\n\t\t\tcontinue;\n\t\t}\n\t\tconst baseType = declaration.baseType;\n\t\tif (baseType === void 0) {\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: \"PSL_UNSUPPORTED_NAMED_TYPE_BASE\",\n\t\t\t\tmessage: `Named type \"${declaration.name}\" must declare a base type or constructor`,\n\t\t\t\t...source.at(declaration.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst baseDescriptor = baseColumnDescriptor(resolution, input.enumTypeDescriptors);\n\t\tif (!baseDescriptor) {\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: \"PSL_UNSUPPORTED_NAMED_TYPE_BASE\",\n\t\t\t\tmessage: `Named type \"${declaration.name}\" references unsupported base type \"${baseType}\"`,\n\t\t\t\t...source.at(declaration.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (validateNamedTypeAttributes({\n\t\t\tdeclaration,\n\t\t\tsource,\n\t\t\tdiagnostics: input.diagnostics\n\t\t})) continue;\n\t\tconst descriptor = toNamedTypeFieldDescriptor(declaration.name, baseDescriptor);\n\t\tnamedTypeDescriptors.set(declaration, descriptor);\n\t\tstorageTypeEntries.push([declaration.name, storageTypeOf(baseDescriptor)]);\n\t}\n\treturn {\n\t\tstorageTypes: Object.fromEntries(storageTypeEntries),\n\t\tnamedTypeDescriptors\n\t};\n}\n//#endregion\n//#region src/psl-relation-resolution.ts\nconst REFERENTIAL_ACTION_MAP = {\n\tNoAction: \"noAction\",\n\tRestrict: \"restrict\",\n\tCascade: \"cascade\",\n\tSetNull: \"setNull\",\n\tSetDefault: \"setDefault\",\n\tnoAction: \"noAction\",\n\trestrict: \"restrict\",\n\tcascade: \"cascade\",\n\tsetNull: \"setNull\",\n\tsetDefault: \"setDefault\"\n};\nfunction modelName(key) {\n\treturn typeof key === \"string\" ? key : key.name;\n}\nfunction normalizeReferentialAction(actionToken) {\n\treturn REFERENTIAL_ACTION_MAP[actionToken];\n}\nfunction interpretRelationAttribute(input) {\n\tconst node = getAttribute(input.field.attributes, \"relation\")?.node;\n\tif (node === void 0) return void 0;\n\treturn interpretFieldAttribute({\n\t\tsymbols: input.symbols,\n\t\tnode,\n\t\tspec: sqlAttributeSpecs.field.relation(input.specContext),\n\t\tmodel: input.selfModel,\n\t\tfield: input.field,\n\t\tsources: input.sources,\n\t\tbinder: input.binder,\n\t\tdiagnostics: input.diagnostics\n\t});\n}\nfunction indexFkRelations(input) {\n\tconst modelRelations = /* @__PURE__ */ new Map();\n\tconst fkRelationsByPair = /* @__PURE__ */ new Map();\n\tconst fkRelationsByDeclaringModel = /* @__PURE__ */ new Map();\n\tfor (const relation of input.fkRelationMetadata) {\n\t\tconst declaringFkRelations = fkRelationsByDeclaringModel.get(relation.declaringModelName);\n\t\tif (declaringFkRelations) declaringFkRelations.push(relation);\n\t\telse fkRelationsByDeclaringModel.set(relation.declaringModelName, [relation]);\n\t\tconst existing = modelRelations.get(relation.declaringModelName);\n\t\tconst current = existing ?? [];\n\t\tif (!existing) modelRelations.set(relation.declaringModelName, current);\n\t\tcurrent.push({\n\t\t\tfieldName: relation.declaringFieldName,\n\t\t\ttoModel: modelName(relation.targetModelName),\n\t\t\ttoTable: relation.targetTableName,\n\t\t\t...ifDefined(\"toNamespaceId\", relation.targetNamespaceId),\n\t\t\tcardinality: \"N:1\",\n\t\t\tnullable: relation.nullable,\n\t\t\ton: {\n\t\t\t\tparentTable: relation.declaringTableName,\n\t\t\t\tparentColumns: relation.localColumns,\n\t\t\t\tchildTable: relation.targetTableName,\n\t\t\t\tchildColumns: relation.referencedColumns\n\t\t\t}\n\t\t});\n\t\tlet targets = fkRelationsByPair.get(relation.declaringModelName);\n\t\tif (!targets) {\n\t\t\ttargets = /* @__PURE__ */ new Map();\n\t\t\tfkRelationsByPair.set(relation.declaringModelName, targets);\n\t\t}\n\t\tconst pairRelations = targets.get(relation.targetModelName);\n\t\tif (pairRelations) pairRelations.push(relation);\n\t\telse targets.set(relation.targetModelName, [relation]);\n\t}\n\treturn {\n\t\tmodelRelations,\n\t\tfkRelationsByPair,\n\t\tfkRelationsByDeclaringModel\n\t};\n}\nfunction idColumnsAreExactlyFkPair(idColumns, parentColumns, childColumns) {\n\tif (idColumns.length !== parentColumns.length + childColumns.length) return false;\n\tconst fkColumns = /* @__PURE__ */ new Set([...parentColumns, ...childColumns]);\n\tif (fkColumns.size !== parentColumns.length + childColumns.length) return false;\n\treturn idColumns.every((column) => fkColumns.has(column));\n}\n/**\n* Reorders the child FK's junction columns into the target model's id-column\n* order. Returns undefined unless the FK references exactly the target's full\n* id, because downstream consumers pair `through.childColumns` positionally\n* against the target id columns — an FK referencing anything else (a non-id\n* unique, a partial id) would produce a silently wrong join.\n*/\nfunction childColumnsInTargetIdOrder(childFk, targetIdColumns) {\n\tif (childFk.referencedColumns.length !== targetIdColumns.length) return;\n\tconst localByReferenced = /* @__PURE__ */ new Map();\n\tfor (const [index, referencedColumn] of childFk.referencedColumns.entries()) {\n\t\tconst localColumn = childFk.localColumns[index];\n\t\tif (localColumn === void 0) return;\n\t\tlocalByReferenced.set(referencedColumn, localColumn);\n\t}\n\tif (localByReferenced.size !== targetIdColumns.length) return;\n\tconst ordered = [];\n\tfor (const idColumn of targetIdColumns) {\n\t\tconst localColumn = localByReferenced.get(idColumn);\n\t\tif (localColumn === void 0) return;\n\t\tordered.push(localColumn);\n\t}\n\treturn ordered;\n}\n/**\n* Finds explicit junction models that connect a bare backrelation list field\n* to its target model: a model whose composite id columns are exactly the FK\n* columns of one relation back to the candidate's model (the parent side) and\n* one relation to the candidate's target model (the child side). The child\n* FK must reference exactly the target model's id columns; its junction\n* columns are carried in target-id order on the pair. A relation name on the\n* list field pins the parent-side FK relation, which is how self-referential\n* many-to-many sides are disambiguated.\n*\n* Alongside the recognised pairs, returns junction-shaped near-misses (models\n* that link both sides but were declined) so the caller can emit a\n* junction-specific diagnostic instead of the generic orphaned-list message.\n*/\nfunction findJunctionFkPairs(input) {\n\tconst targetIdColumns = input.modelIdColumns.get(input.candidate.targetModelName);\n\tif (!targetIdColumns || targetIdColumns.length === 0) return {\n\t\tpairs: [],\n\t\tnearMisses: []\n\t};\n\tconst pairs = [];\n\tconst nearMisses = [];\n\tfor (const [junctionModelName, junctionFks] of input.fkRelationsByDeclaringModel) {\n\t\tconst idColumns = input.modelIdColumns.get(junctionModelName);\n\t\tfor (const parentFk of junctionFks) {\n\t\t\tif (parentFk.targetModelName !== input.candidate.modelName) continue;\n\t\t\tif (input.candidate.relationName !== void 0 && parentFk.relationName !== input.candidate.relationName) continue;\n\t\t\tfor (const childFk of junctionFks) {\n\t\t\t\tif (childFk === parentFk || childFk.targetModelName !== input.candidate.targetModelName) continue;\n\t\t\t\tif (!idColumns || !idColumnsAreExactlyFkPair(idColumns, parentFk.localColumns, childFk.localColumns)) {\n\t\t\t\t\tnearMisses.push({\n\t\t\t\t\t\tjunctionModelName: modelName(junctionModelName),\n\t\t\t\t\t\treason: \"id-not-fk-covering\"\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst orderedChildColumns = childColumnsInTargetIdOrder(childFk, targetIdColumns);\n\t\t\t\tif (!orderedChildColumns) {\n\t\t\t\t\tnearMisses.push({\n\t\t\t\t\t\tjunctionModelName: modelName(junctionModelName),\n\t\t\t\t\t\treason: \"target-fk-not-id\"\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tpairs.push({\n\t\t\t\t\tparentFk,\n\t\t\t\t\tchildFk,\n\t\t\t\t\tchildColumnsInTargetIdOrder: orderedChildColumns\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\tpairs,\n\t\tnearMisses\n\t};\n}\nfunction junctionNearMissDiagnostic(candidate, nearMiss, sources) {\n\tconst source = diagnosticSource(sources, candidate.field.node.syntax);\n\tconst listField = `${modelName(candidate.modelName)}.${candidate.field.name}`;\n\tconst targetModelName = modelName(candidate.targetModelName);\n\tconst data = {\n\t\tlistField,\n\t\tjunctionModel: nearMiss.junctionModelName,\n\t\ttargetModel: targetModelName\n\t};\n\tif (nearMiss.reason === \"target-fk-not-id\") return {\n\t\tcode: \"PSL_JUNCTION_TARGET_FK_NOT_ID\",\n\t\tmessage: `Backrelation list field \"${listField}\" found junction model \"${nearMiss.junctionModelName}\", but its foreign key to \"${targetModelName}\" does not reference \"${targetModelName}\"'s @id. The junction's target-side foreign key must reference \"${targetModelName}\"'s full @id columns for many-to-many recognition.`,\n\t\t...source.at(candidate.field.span),\n\t\tdata\n\t};\n\treturn {\n\t\tcode: \"PSL_JUNCTION_ID_NOT_FK_COVERING\",\n\t\tmessage: `Backrelation list field \"${listField}\" found junction-shaped model \"${nearMiss.junctionModelName}\" linking \"${modelName(candidate.modelName)}\" and \"${targetModelName}\", but its id does not cover exactly its foreign-key columns. Declare @@id([...]) on \"${nearMiss.junctionModelName}\" listing exactly the two foreign-key columns for many-to-many recognition.`,\n\t\t...source.at(candidate.field.span),\n\t\tdata\n\t};\n}\nfunction manyToManyRelationNode(candidate, pair) {\n\treturn {\n\t\tfieldName: candidate.field.name,\n\t\ttoModel: modelName(pair.childFk.targetModelName),\n\t\ttoTable: pair.childFk.targetTableName,\n\t\t...ifDefined(\"toNamespaceId\", pair.childFk.targetNamespaceId),\n\t\tcardinality: \"N:M\",\n\t\ton: {\n\t\t\tparentTable: candidate.tableName,\n\t\t\tparentColumns: pair.parentFk.referencedColumns,\n\t\t\tchildTable: pair.parentFk.declaringTableName,\n\t\t\tchildColumns: pair.parentFk.localColumns\n\t\t},\n\t\tthrough: {\n\t\t\ttable: pair.parentFk.declaringTableName,\n\t\t\t...ifDefined(\"namespaceId\", pair.parentFk.declaringNamespaceId),\n\t\t\tparentColumns: pair.parentFk.localColumns,\n\t\t\tchildColumns: pair.childColumnsInTargetIdOrder\n\t\t}\n\t};\n}\nfunction relationsForModel(modelRelations, modelName) {\n\tconst existing = modelRelations.get(modelName);\n\tif (existing) return existing;\n\tconst created = [];\n\tmodelRelations.set(modelName, created);\n\treturn created;\n}\n/**\n* A set of columns is unique when it exactly matches one of the model's unique\n* column sets — its primary key, any single- or multi-column `@unique` /\n* `@@unique` constraint, or a unique index over plain columns with no `where`\n* clause. Set equality (not subset) is required: a singular back-relation means\n* at most one child per parent, which a unique constraint covering exactly the\n* FK columns guarantees.\n*/\nfunction fkColumnsAreUnique(localColumns, uniqueColumnSets) {\n\tconst local = new Set(localColumns);\n\treturn uniqueColumnSets.some((columns) => columns.length === local.size && columns.every((column) => local.has(column)));\n}\nfunction applyBackrelationCandidates(input) {\n\tfor (const candidate of input.backrelationCandidates) {\n\t\tconst source = diagnosticSource(input.sources, candidate.field.node.syntax);\n\t\tconst pairMatches = input.fkRelationsByPair.get(candidate.targetModelName)?.get(candidate.modelName) ?? [];\n\t\tconst matches = candidate.relationName ? pairMatches.filter((relation) => relation.relationName === candidate.relationName) : [...pairMatches];\n\t\tif (matches.length === 0) {\n\t\t\tconst invalidIndex = input.invalidFkPairings.findIndex((pairing) => {\n\t\t\t\tif (pairing.relationName !== candidate.relationName) return false;\n\t\t\t\tif (\"pairKey\" in pairing) return typeof candidate.targetModelName === \"string\" && typeof candidate.modelName === \"string\" && pairing.pairKey === fkRelationPairKey(candidate.targetModelName, candidate.modelName);\n\t\t\t\treturn pairing.declaringModel === candidate.targetModelName && pairing.targetModel === candidate.modelName;\n\t\t\t});\n\t\t\tif (invalidIndex !== -1) {\n\t\t\t\tinput.invalidFkPairings.splice(invalidIndex, 1);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (candidate.isList) {\n\t\t\t\tconst { pairs: junctionPairs, nearMisses } = findJunctionFkPairs({\n\t\t\t\t\tcandidate,\n\t\t\t\t\tfkRelationsByDeclaringModel: input.fkRelationsByDeclaringModel,\n\t\t\t\t\tmodelIdColumns: input.modelIdColumns\n\t\t\t\t});\n\t\t\t\tconst junctionPair = junctionPairs[0];\n\t\t\t\tif (junctionPairs.length === 1 && junctionPair) {\n\t\t\t\t\trelationsForModel(input.modelRelations, candidate.modelName).push(manyToManyRelationNode(candidate, junctionPair));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (junctionPairs.length > 1) {\n\t\t\t\t\tinput.diagnostics.push({\n\t\t\t\t\t\tcode: \"PSL_AMBIGUOUS_BACKRELATION\",\n\t\t\t\t\t\tmessage: `Backrelation list field \"${modelName(candidate.modelName)}.${candidate.field.name}\" matches multiple junction FK pairs for a many-to-many relation. Add @relation(name: \"...\") (or @relation(\"...\")) to the list field and the junction FK-side relation pointing back at \"${modelName(candidate.modelName)}\" to disambiguate.`,\n\t\t\t\t\t\t...source.at(candidate.field.span)\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst nearMiss = nearMisses[0];\n\t\t\t\tif (nearMiss) {\n\t\t\t\t\tinput.diagnostics.push(junctionNearMissDiagnostic(candidate, nearMiss, input.sources));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: \"PSL_ORPHANED_BACKRELATION\",\n\t\t\t\tmessage: `Backrelation field \"${modelName(candidate.modelName)}.${candidate.field.name}\" has no matching FK-side relation on model \"${modelName(candidate.targetModelName)}\". Add @relation(fields: [...], references: [...]) on the FK-side relation${candidate.isList ? \" or use an explicit join model for many-to-many\" : \"\"}.`,\n\t\t\t\t...source.at(candidate.field.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (matches.length > 1) {\n\t\t\tinput.diagnostics.push({\n\t\t\t\tcode: \"PSL_AMBIGUOUS_BACKRELATION\",\n\t\t\t\tmessage: `Backrelation field \"${modelName(candidate.modelName)}.${candidate.field.name}\" matches multiple FK-side relations on model \"${modelName(candidate.targetModelName)}\". Add @relation(name: \"...\") (or @relation(\"...\")) to both sides to disambiguate.`,\n\t\t\t\t...source.at(candidate.field.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tinvariant(matches.length === 1, \"Backrelation matching requires exactly one match\");\n\t\tconst matched = matches[0];\n\t\tassertDefined(matched, \"Backrelation matching requires a defined relation match\");\n\t\tif (!candidate.isList) {\n\t\t\tconst uniqueColumnSets = input.modelUniqueColumnSets.get(matched.declaringModelName) ?? [];\n\t\t\tif (!fkColumnsAreUnique(matched.localColumns, uniqueColumnSets)) {\n\t\t\t\tinput.diagnostics.push({\n\t\t\t\t\tcode: \"PSL_NON_UNIQUE_BACKRELATION\",\n\t\t\t\t\tmessage: `Backrelation field \"${modelName(candidate.modelName)}.${candidate.field.name}\" is singular, but the matching FK on \"${modelName(matched.declaringModelName)}\" (fields ${matched.localColumns.map((column) => `\"${column}\"`).join(\", \")}) is not unique. A singular back-relation implies at most one related row; add @unique (or @@unique([...])) to the FK fields, or make \"${candidate.field.name}\" a list.`,\n\t\t\t\t\t...source.at(candidate.field.span)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tif (!candidate.isList && !candidate.field.optional) input.diagnostics.push(requiredOneToOneBackrelationDiagnostic({\n\t\t\tmodelName: modelName(candidate.modelName),\n\t\t\tfield: candidate.field,\n\t\t\ttargetModelName: modelName(candidate.targetModelName),\n\t\t\tsources: input.sources,\n\t\t\trecordNoun: \"row\"\n\t\t}));\n\t\trelationsForModel(input.modelRelations, candidate.modelName).push({\n\t\t\tfieldName: candidate.field.name,\n\t\t\ttoModel: modelName(matched.declaringModelName),\n\t\t\ttoTable: matched.declaringTableName,\n\t\t\t...ifDefined(\"toNamespaceId\", matched.declaringNamespaceId),\n\t\t\t...candidate.isList ? { cardinality: \"1:N\" } : {\n\t\t\t\tcardinality: \"1:1\",\n\t\t\t\tnullable: true\n\t\t\t},\n\t\t\ton: {\n\t\t\t\tparentTable: candidate.tableName,\n\t\t\t\tparentColumns: matched.referencedColumns,\n\t\t\t\tchildTable: matched.declaringTableName,\n\t\t\t\tchildColumns: matched.localColumns\n\t\t\t}\n\t\t});\n\t}\n}\nfunction validateBackrelationFieldAttributes(input) {\n\tconst source = diagnosticSource(input.sources, input.field.node.syntax);\n\tlet valid = true;\n\tfor (const attribute of input.field.attributes) {\n\t\tif (attribute.name === \"relation\") continue;\n\t\tinput.diagnostics.push({\n\t\t\tcode: \"PSL_UNSUPPORTED_FIELD_ATTRIBUTE\",\n\t\t\tmessage: `Field \"${input.modelName}.${input.field.name}\" uses unsupported attribute \"@${attribute.name}\"`,\n\t\t\t...source.at(attribute.span)\n\t\t});\n\t\tvalid = false;\n\t}\n\treturn valid;\n}\n//#endregion\n//#region src/interpreter.ts\nfunction buildComposedExtensionPackRefs(target, extensionIds, extensionPackRefs = []) {\n\tif (extensionIds.length === 0) return;\n\tconst extensionPackRefById = new Map(extensionPackRefs.map((packRef) => [packRef.id, packRef]));\n\treturn Object.fromEntries(extensionIds.map((extensionId) => [extensionId, extensionPackRefById.get(extensionId) ?? {\n\t\tkind: \"extension\",\n\t\tid: extensionId,\n\t\tfamilyId: target.familyId,\n\t\ttargetId: target.targetId,\n\t\tversion: \"0.0.1\"\n\t}]));\n}\nfunction compareStrings(left, right) {\n\tif (left < right) return -1;\n\tif (left > right) return 1;\n\treturn 0;\n}\n/**\n* Per-target namespace-block validation: walk the AST's namespace buckets and\n* emit diagnostics for syntactic constructs the target does not accept.\n*\n* - **SQLite** has no schema concept and rejects every explicit\n* `namespace { … }` block. The implicit `__unspecified__` bucket\n* (produced by the parser for top-level declarations outside any\n* block) is the only namespace SQLite accepts.\n* - **Postgres** accepts every explicit block — `namespace unbound { … }`\n* is the late-binding opt-in (lowers to the IR `__unbound__` slot in\n* a follow-on commit), `namespace public { … }` reopen-merges with\n* the implicit bucket, and any other name lowers to a named schema.\n*\n* Storage-side lowering of these buckets to IR namespace slots is not\n* yet wired; this helper closes only the diagnostic surface.\n*/\n/**\n* Per-target namespace lowering: map a PSL AST namespace bucket name to the\n* resolved IR namespace id (the key downstream consumers use against\n* `SqlStorage.namespaces`).\n*\n* - **Postgres**: an explicit `namespace unbound { … }` block lowers\n* to the framework sentinel `__unbound__` — the slot whose binding\n* the connection's `search_path` resolves at runtime. Every other\n* explicit bucket name (e.g. `auth`, `public`) passes through as a\n* named schema id. The implicit `__unspecified__` bucket — top-level\n* declarations outside any `namespace { … }` block — leaves the\n* coordinate unset; downstream consumers treat unset as the\n* late-bound default, and TS / PSL authoring stay byte-identical\n* on single-namespace contracts. (A future round will add a\n* target-default-namespace surface so `__unspecified__` lowers to\n* `public` consistently on both authoring paths.)\n* - **SQLite**: SQLite has no schema concept; every namespace\n* collapses to the late-bound default. The namespace-block\n* validation step (above) has already rejected any explicit\n* `namespace { … }` block on SQLite, so the only bucket the\n* lowering ever sees there is `__unspecified__`.\n*\n* Returns `undefined` for targets / bucket names with no explicit\n* namespaceId to assign — callers leave the model's `namespaceId`\n* slot empty (which means the late-bound default at the `StorageTable`\n* layer; emitted JSON omits the field).\n*/\nfunction resolveNamespaceIdForSqlTarget(input) {\n\tif (input.targetId !== \"postgres\") return;\n\tif (input.bucketName === UNSPECIFIED_PSL_NAMESPACE_ID) return \"public\";\n\tif (input.bucketName === UNBOUND_PSL_NAMESPACE_NAME) return UNBOUND_NAMESPACE_ID;\n\treturn input.bucketName;\n}\n/**\n* A namespace block is the unbound block when its name RESOLVES to the\n* unbound id — both the `namespace unbound { }` spelling (mapped by\n* {@link resolveNamespaceIdForSqlTarget}) and the raw sentinel spelling\n* `namespace __unbound__ { }` (passed through verbatim) behave identically:\n* same models-sibling restriction, same block-lowering bucket.\n*/\nfunction isUnboundNamespaceBlock(ns, targetId) {\n\treturn resolveNamespaceIdForSqlTarget({\n\t\tbucketName: ns.name,\n\t\ttargetId\n\t}) === UNBOUND_NAMESPACE_ID;\n}\nfunction validateNamespaceBlocksForSqlTarget(input) {\n\tif (input.targetId === \"sqlite\") {\n\t\tfor (const namespace of input.namespaces) for (const { node, span } of namespace.declarations) input.diagnostics.push({\n\t\t\tcode: \"PSL_UNSUPPORTED_NAMESPACE_BLOCK\",\n\t\t\tmessage: `SQLite does not support \\`namespace ${namespace.name} { … }\\` blocks (SQLite has no schema concept; declare models at the document top level instead).`,\n\t\t\t...diagnosticSource(input.sources, node.syntax).at(span)\n\t\t});\n\t\treturn;\n\t}\n\tif (input.targetId === \"postgres\") {\n\t\tconst unboundBlock = input.namespaces.find((ns) => isUnboundNamespaceBlock(ns, input.targetId) && Object.keys(ns.models).length > 0);\n\t\tconst hasSibling = input.namespaces.some((ns) => !isUnboundNamespaceBlock(ns, input.targetId));\n\t\tif (unboundBlock !== void 0 && hasSibling) for (const { node, span } of unboundBlock.declarations) input.diagnostics.push({\n\t\t\tcode: \"PSL_RESERVED_NAMESPACE_NAME\",\n\t\t\tmessage: \"Namespace \\\"unbound\\\" is reserved for the late-binding sentinel mapping; a `namespace unbound { … }` containing models cannot appear alongside other named namespace blocks. Use `namespace unbound { … }` alone (no sibling named namespaces) for late-binding multi-tenant contracts.\",\n\t\t\t...diagnosticSource(input.sources, node.syntax).at(span)\n\t\t});\n\t}\n}\n/**\n* Walks the flat `entityTypes` namespace tree in `authoringContributions` and\n* returns a map from discriminator string to the matching descriptor. The\n* interpreter uses this to dispatch parsed extension blocks to their factory\n* without naming any specific discriminator value (generic, by-discriminator).\n*/\nfunction buildEntityTypesByDiscriminator(contributions) {\n\tconst result = /* @__PURE__ */ new Map();\n\tconst namespace = contributions?.entityTypes;\n\tif (namespace === void 0) return result;\n\tconst walk = (node) => {\n\t\tfor (const value of Object.values(node)) if (isAuthoringEntityTypeDescriptor(value)) result.set(value.discriminator, value);\n\t\telse if (typeof value === \"object\" && value !== null) walk(value);\n\t};\n\twalk(namespace);\n\treturn result;\n}\n/**\n* The `PSL_DUPLICATE_ATTRIBUTE` diagnostic for a model attribute declared\n* more than once on one model. Shared by the built-in `@@control` path and\n* the contributed-model-attribute path so the code and wording stay in one\n* place. `name` is the bare attribute name (`control`, `rls`, …).\n*/\nfunction duplicateModelAttributeDiagnostic(input) {\n\treturn {\n\t\tcode: \"PSL_DUPLICATE_ATTRIBUTE\",\n\t\tmessage: `\\`@@${input.name}\\` declared more than once on model \"${input.modelName}\".`,\n\t\t...input.source.at(input.span)\n\t};\n}\nfunction isResolvedModelReference(value) {\n\tif (typeof value !== \"object\" || value === null || !(\"declaration\" in value)) return false;\n\tconst declaration = value.declaration;\n\treturn typeof declaration === \"object\" && declaration !== null && \"kind\" in declaration && declaration.kind === \"model\";\n}\nfunction validateBlockModelAttributeRequirements(input) {\n\tfor (const [blockSymbol, envelope] of input.parsedBlocks) {\n\t\tconst requirement = findBlockDescriptor(input.pslBlockDescriptors, blockSymbol.keyword)?.requiresModelAttribute;\n\t\tif (requirement === void 0) continue;\n\t\tconst target = envelope.values[requirement.parameter];\n\t\tif (!isResolvedModelReference(target)) continue;\n\t\tconst model = target.declaration;\n\t\tif (model.attributes.some((attribute) => attribute.name === requirement.attribute)) continue;\n\t\tinput.diagnostics.push({\n\t\t\tcode: \"PSL_EXTENSION_TARGET_MODEL_MISSING_ATTRIBUTE\",\n\t\t\tmessage: `\\`${blockSymbol.keyword}\\` block \"${envelope.name}\" targets model \"${model.name}\", which does not declare \\`@@${requirement.attribute}\\`. Add \\`@@${requirement.attribute}\\` to model \"${model.name}\".`,\n\t\t\t...diagnosticSource(input.sources, blockSymbol.node.syntax).at(envelope.parameterSpans[requirement.parameter] ?? envelope.span)\n\t\t});\n\t}\n}\n/**\n* Walks the flat `modelAttributes` namespace tree in `authoringContributions`\n* and returns a map from bare `@@` attribute name to the matching\n* descriptor. The model-attribute loop in `buildModelNodeFromPsl` uses this\n* to dispatch a contributed attribute without naming any specific attribute.\n*/\nfunction buildModelAttributesByName(contributions) {\n\tconst result = /* @__PURE__ */ new Map();\n\tconst namespace = contributions?.modelAttributes;\n\tif (namespace === void 0) return result;\n\tconst walk = (node) => {\n\t\tfor (const value of Object.values(node)) if (isAuthoringModelAttributeDescriptor(value)) result.set(value.attribute, value);\n\t\telse if (typeof value === \"object\" && value !== null) walk(value);\n\t};\n\twalk(namespace);\n\treturn result;\n}\n/**\n* This pass is intentionally generic: no discriminator value is named here.\n* The factory (registered by the target pack) owns all block-specific logic.\n*/\nfunction lowerExtensionBlocksForNamespace(blocks, ownerNamespaceId, entityTypesByDiscriminator, entityContext, parsedBlocks, modelCoordinateOf, sources) {\n\tconst rows = [];\n\tfor (const blockSymbol of Object.values(blocks)) {\n\t\tconst envelope = parsedBlocks.get(blockSymbol);\n\t\tif (envelope === void 0) continue;\n\t\tconst descriptor = entityTypesByDiscriminator.get(envelope.kind);\n\t\tif (descriptor === void 0) continue;\n\t\tlet resolvedModelRefs;\n\t\tfor (const [paramName, value] of Object.entries(envelope.values)) {\n\t\t\tif (!isResolvedModelReference(value)) continue;\n\t\t\tconst coordinate = modelCoordinateOf(value.declaration);\n\t\t\tinvariant(coordinate !== void 0, `model mappings cover every collected model; \\`${envelope.keyword}\\` block \"${envelope.name}\" selected model \"${value.declaration.name}\" in \\`${paramName}\\` without a storage coordinate`);\n\t\t\tresolvedModelRefs = {\n\t\t\t\t...resolvedModelRefs ?? {},\n\t\t\t\t[paramName]: coordinate\n\t\t\t};\n\t\t}\n\t\tconst annotatedBlock = {\n\t\t\t...envelope,\n\t\t\tnamespaceId: ownerNamespaceId,\n\t\t\t...resolvedModelRefs !== void 0 ? { resolvedModelRefs } : {}\n\t\t};\n\t\tconst entity = instantiateAuthoringEntityType(descriptor.discriminator, descriptor, [annotatedBlock], {\n\t\t\t...entityContext,\n\t\t\tsourceId: sources.sourceFileFor(blockSymbol.node.syntax).filename\n\t\t});\n\t\tif (entity === void 0) continue;\n\t\tconst namespaceId = providesPslEntityPlacement(descriptor.output) ? descriptor.output.pslPlacement(entity).namespaceId : ownerNamespaceId;\n\t\trows.push({\n\t\t\tnamespaceId,\n\t\t\tentityKind: descriptor.discriminator,\n\t\t\tkey: envelope.name,\n\t\t\tentity\n\t\t});\n\t\tconst derivedValueSet = deriveValueSetFromEntity(descriptor.output, entity);\n\t\tif (derivedValueSet !== void 0) rows.push({\n\t\t\tnamespaceId,\n\t\t\tentityKind: \"valueSet\",\n\t\t\tkey: envelope.name,\n\t\t\tentity: derivedValueSet\n\t\t});\n\t}\n\treturn rows;\n}\nfunction processEnumDeclarations(input) {\n\tconst enumHandles = /* @__PURE__ */ new Map();\n\tconst enumTypeDescriptors = /* @__PURE__ */ new Map();\n\tif (input.enumBlocks.length === 0) return {\n\t\tenumHandles,\n\t\tenumTypeDescriptors\n\t};\n\tconst enumDescriptor = getAuthoringEntity(input.authoringContributions, [\"enum\"]);\n\tif (!enumDescriptor) {\n\t\tfor (const symbol of input.enumBlocks) input.diagnostics.push({\n\t\t\tcode: \"PSL_ENUM_MISSING_FACTORY\",\n\t\t\tmessage: `enum \"${symbol.name}\" requires an \"enum\" entityType factory in the active authoring contributions`,\n\t\t\t...diagnosticSource(input.source.sources, symbol.node.syntax).at(symbol.span)\n\t\t});\n\t\treturn {\n\t\t\tenumHandles,\n\t\t\tenumTypeDescriptors\n\t\t};\n\t}\n\tfor (const symbol of input.enumBlocks) {\n\t\tconst envelope = input.parsedBlocks.get(symbol);\n\t\tinput.diagnostics.push(...enumMemberAttributeDiagnostics(symbol, input.source.sources));\n\t\tif (envelope === void 0) continue;\n\t\tconst handle = instantiateAuthoringEntityType(\"enum\", enumDescriptor, [envelope], {\n\t\t\t...input.entityContext,\n\t\t\tsourceId: input.source.sources.sourceFileFor(symbol.node.syntax).filename\n\t\t});\n\t\tif (handle === void 0 || handle === null) continue;\n\t\tenumHandles.set(symbol, handle);\n\t\tenumTypeDescriptors.set(symbol, { codecId: handle.codecId });\n\t}\n\treturn {\n\t\tenumHandles,\n\t\tenumTypeDescriptors\n\t};\n}\n/**\n* The owning side of a relation is the one that declares `fields`/`references` on its\n* `@relation` attribute — those name the FK columns. A singular model-typed field whose\n* `@relation` carries only a name (or nothing at all) is the back side: infer prints exactly\n* that shape for a 1:1 back-relation whenever the FK needs disambiguating (two FKs between the\n* same table pair, or a self-referencing unique FK). Checking for the attribute's mere presence\n* would misclassify that back side as the owning side.\n*/\nfunction relationAttributeDeclaresOwningSide(relationAttribute) {\n\treturn getNamedArgument(relationAttribute, \"fields\") !== void 0 || getNamedArgument(relationAttribute, \"references\") !== void 0;\n}\nfunction relationNullabilityMismatch(relationField, localColumns, resolvedFields) {\n\treturn resolveToOneRelationNullable({\n\t\tdeclaredNullable: relationField.optional,\n\t\tlocalFieldNullability: resolvedFields.filter((resolvedField) => localColumns.includes(resolvedField.columnName)).map((resolvedField) => resolvedField.nullable),\n\t\townsReference: true\n\t}).contradiction !== void 0;\n}\nfunction relationNullabilityMismatchDiagnostic(modelName, relationAttribute, source) {\n\tconst fieldLabel = `Relation field \"${modelName}.${relationAttribute.field.name}\"`;\n\treturn {\n\t\tcode: \"PSL_RELATION_NULLABILITY_MISMATCH\",\n\t\tmessage: relationAttribute.field.optional ? `${fieldLabel} is optional but every field in @relation(fields: [...]) is required. Make one of those fields optional with \"?\" or remove \"?\" from \"${relationAttribute.field.name}\".` : `${fieldLabel} is required but a field in @relation(fields: [...]) is optional. Add \"?\" to \"${relationAttribute.field.name}\" or make those fields required.`,\n\t\t...source.at(relationAttribute.field.span)\n\t};\n}\nfunction buildModelNodeFromPsl(input) {\n\tconst { model, diagnostics } = input;\n\tconst source = diagnosticSource(input.sources, model.node.syntax);\n\tconst tableName = storageName(model, input.physicalNames);\n\tconst specContext = modelSpecContext({\n\t\tsymbols: input.symbolTable,\n\t\tmodel,\n\t\tdefaultFunctionRegistry: input.defaultFunctionRegistry,\n\t\tdataTypes: input.dataTypes\n\t});\n\tconst modelNamespaceId = input.namespaceId;\n\tconst namespaceExtensionEntitiesForModel = modelNamespaceId !== void 0 ? input.namespaceExtensionEntities?.get(modelNamespaceId) : void 0;\n\tconst resolvedFields = collectResolvedFields({\n\t\tmodel,\n\t\tphysicalNames: input.physicalNames,\n\t\tsymbolTable: input.symbolTable,\n\t\tenumTypeDescriptors: input.enumTypeDescriptors,\n\t\tnamedTypeDescriptors: input.namedTypeDescriptors,\n\t\tvalueObjectTypes: input.valueObjectTypes,\n\t\tauthoringContributions: input.authoringContributions,\n\t\ttargetId: input.targetId,\n\t\tdefaultFunctionRegistry: input.defaultFunctionRegistry,\n\t\tdataTypes: input.dataTypes,\n\t\tgeneratorDescriptorById: input.generatorDescriptorById,\n\t\tdiagnostics,\n\t\tsources: input.sources,\n\t\tbinder: input.binder,\n\t\tscalarColumnDescriptors: input.scalarColumnDescriptors,\n\t\tenumHandles: input.enumHandles,\n\t\tcapabilities: input.capabilities,\n\t\t...ifDefined(\"namespaceId\", modelNamespaceId),\n\t\t...ifDefined(\"namespaceExtensionEntities\", namespaceExtensionEntitiesForModel),\n\t\tcodecLookup: input.codecLookup\n\t});\n\tconst inlineIdFields = resolvedFields.filter((field) => field.isId);\n\tif (inlineIdFields.length > 1) diagnostics.push({\n\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\tmessage: `Model \"${model.name}\" cannot declare inline @id on multiple fields; use model-level @@id([...]) for composite identity`,\n\t\t...source.at(model.span)\n\t});\n\tconst singleInlineIdField = inlineIdFields.length === 1 ? inlineIdFields[0] : void 0;\n\tlet primaryKey = singleInlineIdField ? {\n\t\tcolumns: [singleInlineIdField.columnName],\n\t\t...ifDefined(\"name\", singleInlineIdField.idName)\n\t} : void 0;\n\tconst hasInlinePrimaryKey = primaryKey !== void 0;\n\tlet blockPrimaryKeyDeclared = false;\n\tlet controlPolicyDeclared = false;\n\tlet controlPolicy;\n\tconst declaredContributedModelAttributes = /* @__PURE__ */ new Set();\n\tconst modelAttributeEntities = {};\n\tconst resultBackrelationCandidates = [];\n\tfor (const field of Object.values(model.fields)) {\n\t\tconst backrelationTarget = backrelationTargetSymbol(field, input.binder);\n\t\tif (backrelationTarget === void 0) continue;\n\t\tconst relationAttribute = getAttribute(field.attributes, \"relation\");\n\t\tif (!field.list && relationAttribute && relationAttributeDeclaresOwningSide(relationAttribute)) continue;\n\t\tconst attributesValid = validateBackrelationFieldAttributes({\n\t\t\tmodelName: model.name,\n\t\t\tfield,\n\t\t\tsources: input.sources,\n\t\t\tbinder: input.binder,\n\t\t\tdiagnostics\n\t\t});\n\t\tlet relationName;\n\t\tif (relationAttribute) {\n\t\t\tconst parsedRelation = interpretRelationAttribute({\n\t\t\t\tselfModel: model,\n\t\t\t\tfield,\n\t\t\t\tspecContext: fieldSpecContext({\n\t\t\t\t\t...specContext,\n\t\t\t\t\tfield,\n\t\t\t\t\tbinder: input.binder\n\t\t\t\t}),\n\t\t\t\tsymbols: input.symbolTable,\n\t\t\t\tsources: input.sources,\n\t\t\t\tbinder: input.binder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (!parsedRelation) continue;\n\t\t\tif (parsedRelation.fields || parsedRelation.references) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_INVALID_RELATION_ATTRIBUTE\",\n\t\t\t\t\tmessage: `Backrelation list field \"${model.name}.${field.name}\" cannot declare fields/references; define them on the FK-side relation field`,\n\t\t\t\t\t...source.at(relationAttribute.span)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (parsedRelation.onDelete || parsedRelation.onUpdate || parsedRelation.index !== void 0) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_INVALID_RELATION_ATTRIBUTE\",\n\t\t\t\t\tmessage: `Backrelation list field \"${model.name}.${field.name}\" cannot declare onDelete/onUpdate/index; define them on the FK-side relation field`,\n\t\t\t\t\t...source.at(relationAttribute.span)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\trelationName = parsedRelation.name;\n\t\t}\n\t\tif (!attributesValid) continue;\n\t\tresultBackrelationCandidates.push({\n\t\t\tmodelName: model,\n\t\t\ttableName,\n\t\t\tfield,\n\t\t\ttargetModelName: backrelationTarget,\n\t\t\tisList: field.list,\n\t\t\t...ifDefined(\"relationName\", relationName)\n\t\t});\n\t}\n\tconst relationAttributes = Object.values(model.fields).map((field) => ({\n\t\tfield,\n\t\trelation: getAttribute(field.attributes, \"relation\")\n\t})).filter((entry) => Boolean(entry.relation));\n\tconst uniqueConstraints = resolvedFields.filter((field) => field.isUnique).map((field) => ({\n\t\tcolumns: [field.columnName],\n\t\t...ifDefined(\"name\", field.uniqueName)\n\t}));\n\tconst indexNodes = [];\n\tconst checkNodes = [];\n\tconst foreignKeyNodes = [];\n\tfor (const modelAttribute of model.attributes) {\n\t\tif (!Object.hasOwn(sqlAttributeSpecs.model, modelAttribute.name) && !input.modelAttributesByName.has(modelAttribute.name)) continue;\n\t\tif (modelAttribute.name === \"map\") continue;\n\t\tif (modelAttribute.name === \"discriminator\" || modelAttribute.name === \"base\") continue;\n\t\tif (modelAttribute.name === \"control\") {\n\t\t\tif (controlPolicyDeclared) {\n\t\t\t\tdiagnostics.push(duplicateModelAttributeDiagnostic({\n\t\t\t\t\tname: \"control\",\n\t\t\t\t\tmodelName: model.name,\n\t\t\t\t\tsource,\n\t\t\t\t\tspan: modelAttribute.span\n\t\t\t\t}));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tcontrolPolicyDeclared = true;\n\t\t\tconst node = modelAttribute.node;\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tnode,\n\t\t\t\tspec: sqlAttributeSpecs.model.control(specContext),\n\t\t\t\tmodel,\n\t\t\t\tsymbols: input.symbolTable,\n\t\t\t\tsources: input.sources,\n\t\t\t\tbinder: input.binder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed !== void 0) controlPolicy = parsed.policy;\n\t\t\tcontinue;\n\t\t}\n\t\tconst attributeLabel = `Model \"${model.name}\" @@${modelAttribute.name}`;\n\t\tif (modelAttribute.name === \"id\") {\n\t\t\tif (blockPrimaryKeyDeclared) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\t\t\tmessage: `Model \"${model.name}\" declares @@id more than once`,\n\t\t\t\t\t...source.at(modelAttribute.span)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (hasInlinePrimaryKey) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\t\t\tmessage: `Model \"${model.name}\" cannot declare both field-level @id and model-level @@id`,\n\t\t\t\t\t...source.at(modelAttribute.span)\n\t\t\t\t});\n\t\t\t\tblockPrimaryKeyDeclared = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst node = modelAttribute.node;\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tnode,\n\t\t\t\tspec: sqlAttributeSpecs.model.id(specContext),\n\t\t\t\tmodel,\n\t\t\t\tsymbols: input.symbolTable,\n\t\t\t\tsources: input.sources,\n\t\t\t\tbinder: input.binder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed === void 0) continue;\n\t\t\tconst fieldNames = parsed.fields;\n\t\t\tconst nullableFieldName = fieldNames.find((name) => model.fields[name]?.optional === true);\n\t\t\tif (nullableFieldName !== void 0) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\t\t\tmessage: `${attributeLabel} cannot include optional field \"${nullableFieldName}\"; primary key columns must be NOT NULL`,\n\t\t\t\t\t...source.at(modelAttribute.span)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst columnNames = mapFieldNamesToColumns({\n\t\t\t\tmodel,\n\t\t\t\tphysicalNames: input.physicalNames,\n\t\t\t\tfieldNames,\n\t\t\t\tsource,\n\t\t\t\tdiagnostics,\n\t\t\t\tspan: modelAttribute.span,\n\t\t\t\tentityLabel: attributeLabel\n\t\t\t});\n\t\t\tif (!columnNames) continue;\n\t\t\tprimaryKey = {\n\t\t\t\tcolumns: columnNames,\n\t\t\t\t...ifDefined(\"name\", parsed.map)\n\t\t\t};\n\t\t\tblockPrimaryKeyDeclared = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (modelAttribute.name === \"unique\") {\n\t\t\tconst node = modelAttribute.node;\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tnode,\n\t\t\t\tspec: sqlAttributeSpecs.model.unique(specContext),\n\t\t\t\tmodel,\n\t\t\t\tsymbols: input.symbolTable,\n\t\t\t\tsources: input.sources,\n\t\t\t\tbinder: input.binder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed === void 0) continue;\n\t\t\tconst columnNames = mapFieldNamesToColumns({\n\t\t\t\tmodel,\n\t\t\t\tphysicalNames: input.physicalNames,\n\t\t\t\tfieldNames: parsed.fields,\n\t\t\t\tsource,\n\t\t\t\tdiagnostics,\n\t\t\t\tspan: modelAttribute.span,\n\t\t\t\tentityLabel: attributeLabel\n\t\t\t});\n\t\t\tif (!columnNames) continue;\n\t\t\tuniqueConstraints.push({\n\t\t\t\tcolumns: columnNames,\n\t\t\t\t...ifDefined(\"name\", parsed.map)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (modelAttribute.name === \"index\") {\n\t\t\tconst node = modelAttribute.node;\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tnode,\n\t\t\t\tspec: sqlAttributeSpecs.model.index(specContext),\n\t\t\t\tmodel,\n\t\t\t\tsymbols: input.symbolTable,\n\t\t\t\tsources: input.sources,\n\t\t\t\tbinder: input.binder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed === void 0) continue;\n\t\t\tlet columnNames;\n\t\t\tif (parsed.fields !== void 0) {\n\t\t\t\tconst mapped = mapFieldNamesToColumns({\n\t\t\t\t\tmodel,\n\t\t\t\t\tphysicalNames: input.physicalNames,\n\t\t\t\t\tfieldNames: parsed.fields,\n\t\t\t\t\tsource,\n\t\t\t\t\tdiagnostics,\n\t\t\t\t\tspan: modelAttribute.span,\n\t\t\t\t\tentityLabel: attributeLabel\n\t\t\t\t});\n\t\t\t\tif (!mapped) continue;\n\t\t\t\tcolumnNames = mapped;\n\t\t\t}\n\t\t\tindexNodes.push(blindCast({\n\t\t\t\t...ifDefined(\"columns\", columnNames),\n\t\t\t\t...ifDefined(\"expression\", parsed.expression === void 0 ? void 0 : sqlTextFromCanonical(parsed.expression.value)),\n\t\t\t\twhere: parsed.where === void 0 ? void 0 : sqlTextFromCanonical(parsed.where.value),\n\t\t\t\tunique: parsed.unique,\n\t\t\t\tname: parsed.name,\n\t\t\t\tmap: parsed.map,\n\t\t\t\ttype: parsed.type,\n\t\t\t\toptions: parsed.options\n\t\t\t}));\n\t\t\tcontinue;\n\t\t}\n\t\tif (modelAttribute.name === \"check\") {\n\t\t\tconst node = modelAttribute.node;\n\t\t\tif (input.capabilities[\"sql\"]?.[\"checkConstraint\"] !== true) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_CHECK_UNSUPPORTED_TARGET\",\n\t\t\t\t\tmessage: `Model \"${model.name}\" declares \"@@check\", but target \"${input.targetId}\" does not support check constraints (the adapter does not report the \"checkConstraint\" capability). Remove the check or author it against a target that supports check constraints.`,\n\t\t\t\t\t...source.at(modelAttribute.span)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tnode,\n\t\t\t\tspec: sqlAttributeSpecs.model.check(specContext),\n\t\t\t\tmodel,\n\t\t\t\tsymbols: input.symbolTable,\n\t\t\t\tsources: input.sources,\n\t\t\t\tbinder: input.binder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed === void 0) continue;\n\t\t\tcheckNodes.push({\n\t\t\t\texpression: sqlTextFromCanonical(parsed.expression.value),\n\t\t\t\tname: parsed.name,\n\t\t\t\tmap: parsed.map\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst contributedModelAttribute = input.modelAttributesByName.get(modelAttribute.name);\n\t\tif (contributedModelAttribute !== void 0) {\n\t\t\tif (contributedModelAttribute.repeatable !== true && declaredContributedModelAttributes.has(modelAttribute.name)) {\n\t\t\t\tdiagnostics.push(duplicateModelAttributeDiagnostic({\n\t\t\t\t\tname: modelAttribute.name,\n\t\t\t\t\tmodelName: model.name,\n\t\t\t\t\tsource,\n\t\t\t\t\tspan: modelAttribute.span\n\t\t\t\t}));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdeclaredContributedModelAttributes.add(modelAttribute.name);\n\t\t\tconst node = modelAttribute.node;\n\t\t\tconst specFactory = input.contributedModelAttributeSpecs[contributedModelAttribute.attribute];\n\t\t\tif (specFactory === void 0) continue;\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tnode,\n\t\t\t\tspec: specFactory(specContext),\n\t\t\t\tmodel,\n\t\t\t\tsymbols: input.symbolTable,\n\t\t\t\tsources: input.sources,\n\t\t\t\tbinder: input.binder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed === void 0) continue;\n\t\t\tconst lowered = blindCast(contributedModelAttribute.lower)(parsed, {\n\t\t\t\tfamily: input.familyId,\n\t\t\t\ttarget: input.targetId,\n\t\t\t\tcodecLookup: input.codecLookup,\n\t\t\t\tdataTypeLookup: input.dataTypes.lookup,\n\t\t\t\tmodelName: model.name,\n\t\t\t\tstorageName: tableName,\n\t\t\t\tfieldStorageName: (fieldName) => {\n\t\t\t\t\tconst field = model.fields[fieldName];\n\t\t\t\t\treturn field === void 0 ? void 0 : storageName(field, input.physicalNames);\n\t\t\t\t},\n\t\t\t\tfieldCodecId: (fieldName) => resolvedFields.find((resolved) => resolved.field.name === fieldName)?.descriptor.codecId,\n\t\t\t\tnamespaceId: modelNamespaceId ?? input.defaultNamespaceId,\n\t\t\t\tsourceId: source.sources.sourceFileFor(source.node).filename,\n\t\t\t\tdiagnostics: { push: (d) => {\n\t\t\t\t\tdiagnostics.pushExternal(blindCast(d));\n\t\t\t\t} }\n\t\t\t});\n\t\t\tif (lowered === void 0) continue;\n\t\t\tif (\"index\" in lowered) {\n\t\t\t\tif (!isAuthoredIndexInput(lowered.index)) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `model attribute \"@@${modelAttribute.name}\" on model \"${model.name}\" lowered to a malformed index. A contributed attribute that returns { index } must return an authored-index input: exactly one of a columns list or an expression, plus explicit where/unique/name/map and a type-with-options pair.`, { meta: {\n\t\t\t\t\tattribute: modelAttribute.name,\n\t\t\t\t\tmodelName: model.name\n\t\t\t\t} });\n\t\t\t\tindexNodes.push(lowered.index);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst slot = modelAttributeEntities[contributedModelAttribute.attribute] ?? {};\n\t\t\tmodelAttributeEntities[contributedModelAttribute.attribute] = slot;\n\t\t\tslot[lowered.key] = lowered.entity;\n\t\t\tcontinue;\n\t\t}\n\t\tthrow new InternalError(`Model attribute \"@@${modelAttribute.name}\" is registered but has no interpreter branch`);\n\t}\n\tconst resultFkRelationMetadata = [];\n\tconst relationIndexLocations = [];\n\tconst resultInvalidFkPairings = [];\n\tconst resultCrossSpaceRelations = [];\n\tfor (const relationAttribute of relationAttributes) {\n\t\tconst { typeName: fieldTypeName, typeNamespaceId: fieldTypeNamespaceId, typeContractSpaceId: fieldTypeContractSpaceId } = relationAttribute.field;\n\t\tif (relationAttribute.field.list) {\n\t\t\tif (fieldTypeContractSpaceId !== void 0) diagnostics.push({\n\t\t\t\tcode: \"PSL_UNSUPPORTED_CROSS_SPACE_LIST\",\n\t\t\t\tmessage: `Relation field \"${model.name}.${relationAttribute.field.name}\" is a cross-space list relation (type \"${fieldTypeContractSpaceId}:${fieldTypeNamespaceId !== void 0 ? `${fieldTypeNamespaceId}.` : \"\"}${fieldTypeName}[]\"). Cross-space relations must be singular in v0.1 — list cross-space relations are not supported.`,\n\t\t\t\t...source.at(relationAttribute.field.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (!relationAttributeDeclaresOwningSide(relationAttribute.relation)) continue;\n\t\tif (fieldTypeContractSpaceId !== void 0) {\n\t\t\tconst extContractForSpace = input.composedExtensionContracts.get(fieldTypeContractSpaceId);\n\t\t\tif (extContractForSpace === void 0) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_UNKNOWN_CONTRACT_SPACE\",\n\t\t\t\t\tmessage: `Relation field \"${model.name}.${relationAttribute.field.name}\" references contract space \"${fieldTypeContractSpaceId}\" which is not declared in extensions. Add \"${fieldTypeContractSpaceId}\" to extensions in prisma.config.ts.`,\n\t\t\t\t\t...source.at(relationAttribute.field.span),\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tspace: fieldTypeContractSpaceId,\n\t\t\t\t\t\tsuggestedPack: fieldTypeContractSpaceId\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst parsedRelation = interpretRelationAttribute({\n\t\t\t\tselfModel: model,\n\t\t\t\tfield: relationAttribute.field,\n\t\t\t\tspecContext: fieldSpecContext({\n\t\t\t\t\t...specContext,\n\t\t\t\t\tfield: relationAttribute.field,\n\t\t\t\t\tbinder: input.binder\n\t\t\t\t}),\n\t\t\t\tsymbols: input.symbolTable,\n\t\t\t\tsources: input.sources,\n\t\t\t\tbinder: input.binder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (!parsedRelation) continue;\n\t\t\tif (!parsedRelation.fields || !parsedRelation.references) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_INVALID_RELATION_ATTRIBUTE\",\n\t\t\t\t\tmessage: `Relation field \"${model.name}.${relationAttribute.field.name}\" requires fields and references arguments`,\n\t\t\t\t\t...source.at(relationAttribute.relation.span)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst localColumns = mapFieldNamesToColumns({\n\t\t\t\tmodel,\n\t\t\t\tphysicalNames: input.physicalNames,\n\t\t\t\tfieldNames: parsedRelation.fields,\n\t\t\t\tsource,\n\t\t\t\tdiagnostics,\n\t\t\t\tspan: relationAttribute.relation.span,\n\t\t\t\tentityLabel: `Relation field \"${model.name}.${relationAttribute.field.name}\"`\n\t\t\t});\n\t\t\tif (!localColumns) continue;\n\t\t\tif (relationNullabilityMismatch(relationAttribute.field, localColumns, resolvedFields)) {\n\t\t\t\tdiagnostics.push(relationNullabilityMismatchDiagnostic(model.name, relationAttribute, source));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst referencedColumns = parsedRelation.references;\n\t\t\tif (localColumns.length !== referencedColumns.length) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_INVALID_RELATION_ATTRIBUTE\",\n\t\t\t\t\tmessage: `Relation field \"${model.name}.${relationAttribute.field.name}\" must provide the same number of fields and references`,\n\t\t\t\t\t...source.at(relationAttribute.relation.span)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst onDelete = parsedRelation.onDelete ? normalizeReferentialAction(parsedRelation.onDelete) : void 0;\n\t\t\tconst onUpdate = parsedRelation.onUpdate ? normalizeReferentialAction(parsedRelation.onUpdate) : void 0;\n\t\t\tconst crossTargetNamespaceId = fieldTypeNamespaceId ?? UNBOUND_NAMESPACE_ID;\n\t\t\tconst extContract = extContractForSpace;\n\t\t\tconst resolvedTable = extContract.domain.namespaces[crossTargetNamespaceId]?.models[fieldTypeName]?.storage[\"table\"];\n\t\t\tif (typeof resolvedTable !== \"string\") {\n\t\t\t\tconst availableModels = Object.keys(extContract.domain.namespaces[crossTargetNamespaceId]?.models ?? {}).join(\", \") || \"(none)\";\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_UNKNOWN_CROSS_SPACE_TARGET\",\n\t\t\t\t\tmessage: `Relation field \"${model.name}.${relationAttribute.field.name}\" references model \"${fieldTypeName}\" in namespace \"${crossTargetNamespaceId}\" of space \"${fieldTypeContractSpaceId}\", but that model was not found in the extension contract. Available models: ${availableModels}`,\n\t\t\t\t\t...source.at(relationAttribute.field.span),\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tspace: fieldTypeContractSpaceId,\n\t\t\t\t\t\tnamespace: crossTargetNamespaceId,\n\t\t\t\t\t\tmodel: fieldTypeName\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst crossTargetTableName = resolvedTable;\n\t\t\tforeignKeyNodes.push({\n\t\t\t\tcolumns: localColumns,\n\t\t\t\treferences: {\n\t\t\t\t\tmodel: fieldTypeName,\n\t\t\t\t\ttable: crossTargetTableName,\n\t\t\t\t\tcolumns: referencedColumns,\n\t\t\t\t\tnamespaceId: crossTargetNamespaceId,\n\t\t\t\t\tspaceId: fieldTypeContractSpaceId\n\t\t\t\t},\n\t\t\t\t...ifDefined(\"name\", parsedRelation.map),\n\t\t\t\t...ifDefined(\"onDelete\", onDelete),\n\t\t\t\t...ifDefined(\"onUpdate\", onUpdate),\n\t\t\t\t...ifDefined(\"index\", parsedRelation.index)\n\t\t\t});\n\t\t\tif (typeof parsedRelation.index === \"string\") relationIndexLocations.push({\n\t\t\t\tnamespaceId: modelNamespaceId ?? input.defaultNamespaceId,\n\t\t\t\ttableName,\n\t\t\t\tcolumns: localColumns,\n\t\t\t\tindex: parsedRelation.index,\n\t\t\t\tlocation: source.at(relationAttribute.relation.span)\n\t\t\t});\n\t\t\tresultCrossSpaceRelations.push({\n\t\t\t\tfieldName: relationAttribute.field.name,\n\t\t\t\ttoModel: fieldTypeName,\n\t\t\t\ttoTable: crossTargetTableName,\n\t\t\t\tcardinality: \"N:1\",\n\t\t\t\tnullable: relationAttribute.field.optional,\n\t\t\t\tspaceId: fieldTypeContractSpaceId,\n\t\t\t\tnamespaceId: crossTargetNamespaceId,\n\t\t\t\ton: {\n\t\t\t\t\tparentTable: tableName,\n\t\t\t\t\tparentColumns: localColumns,\n\t\t\t\t\tchildTable: crossTargetTableName,\n\t\t\t\t\tchildColumns: referencedColumns\n\t\t\t\t}\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst qualifiedTypeName = fieldTypeNamespaceId ? `${fieldTypeNamespaceId}.${fieldTypeName}` : fieldTypeName;\n\t\tconst typeReference = typeReferenceNode(relationAttribute.field);\n\t\tconst targetResolution = typeReference === void 0 ? void 0 : input.binder.symbolForNode(typeReference);\n\t\tif (targetResolution?.kind === \"unresolved\") continue;\n\t\tconst targetModel = targetResolution?.kind === \"model\" ? targetResolution.symbol : void 0;\n\t\tif (targetModel === void 0) {\n\t\t\tconst foundKind = targetResolution === void 0 ? void 0 : relationTargetKindLabel(targetResolution);\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_RELATION_TARGET\",\n\t\t\t\tmessage: foundKind === void 0 ? `Relation field \"${model.name}.${relationAttribute.field.name}\" references unknown model \"${qualifiedTypeName}\"` : `Relation field \"${model.name}.${relationAttribute.field.name}\" references ${foundKind} \"${qualifiedTypeName}\"; a relation target must be a model`,\n\t\t\t\t...source.at(relationAttribute.field.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst parsedRelation = interpretRelationAttribute({\n\t\t\tselfModel: model,\n\t\t\tfield: relationAttribute.field,\n\t\t\tspecContext: fieldSpecContext({\n\t\t\t\t...specContext,\n\t\t\t\tfield: relationAttribute.field,\n\t\t\t\tbinder: input.binder\n\t\t\t}),\n\t\t\tsymbols: input.symbolTable,\n\t\t\tsources: input.sources,\n\t\t\tbinder: input.binder,\n\t\t\tdiagnostics\n\t\t});\n\t\tif (!parsedRelation) continue;\n\t\tif (!parsedRelation.fields || !parsedRelation.references) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_RELATION_ATTRIBUTE\",\n\t\t\t\tmessage: `Relation field \"${model.name}.${relationAttribute.field.name}\" requires fields and references arguments`,\n\t\t\t\t...source.at(relationAttribute.relation.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst localColumns = mapFieldNamesToColumns({\n\t\t\tmodel,\n\t\t\tphysicalNames: input.physicalNames,\n\t\t\tfieldNames: parsedRelation.fields,\n\t\t\tsource,\n\t\t\tdiagnostics,\n\t\t\tspan: relationAttribute.relation.span,\n\t\t\tentityLabel: `Relation field \"${model.name}.${relationAttribute.field.name}\"`\n\t\t});\n\t\tif (!localColumns) continue;\n\t\tif (relationNullabilityMismatch(relationAttribute.field, localColumns, resolvedFields)) {\n\t\t\tdiagnostics.push(relationNullabilityMismatchDiagnostic(model.name, relationAttribute, source));\n\t\t\tresultInvalidFkPairings.push({\n\t\t\t\tdeclaringModel: model,\n\t\t\t\ttargetModel,\n\t\t\t\t...ifDefined(\"relationName\", parsedRelation.name)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst referencedColumns = mapFieldNamesToColumns({\n\t\t\tmodel: targetModel,\n\t\t\tphysicalNames: input.physicalNames,\n\t\t\tfieldNames: parsedRelation.references,\n\t\t\tsource,\n\t\t\tdiagnostics,\n\t\t\tspan: relationAttribute.relation.span,\n\t\t\tentityLabel: `Relation field \"${model.name}.${relationAttribute.field.name}\"`\n\t\t});\n\t\tif (!referencedColumns) continue;\n\t\tif (localColumns.length !== referencedColumns.length) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_RELATION_ATTRIBUTE\",\n\t\t\t\tmessage: `Relation field \"${model.name}.${relationAttribute.field.name}\" must provide the same number of fields and references`,\n\t\t\t\t...source.at(relationAttribute.relation.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst onDelete = parsedRelation.onDelete ? normalizeReferentialAction(parsedRelation.onDelete) : void 0;\n\t\tconst onUpdate = parsedRelation.onUpdate ? normalizeReferentialAction(parsedRelation.onUpdate) : void 0;\n\t\tconst targetNamespaceId = resolveNamespaceIdForSqlTarget({\n\t\t\tbucketName: targetModel.node.syntax.findAncestor(NamespaceDeclarationAst.cast)?.name()?.name() ?? UNSPECIFIED_PSL_NAMESPACE_ID,\n\t\t\ttargetId: input.targetId\n\t\t});\n\t\tconst targetTableName = storageName(targetModel, input.physicalNames);\n\t\tforeignKeyNodes.push({\n\t\t\tcolumns: localColumns,\n\t\t\treferences: {\n\t\t\t\tmodel: targetModel.name,\n\t\t\t\ttable: targetTableName,\n\t\t\t\tcolumns: referencedColumns,\n\t\t\t\t...ifDefined(\"namespaceId\", targetNamespaceId)\n\t\t\t},\n\t\t\t...ifDefined(\"name\", parsedRelation.map),\n\t\t\t...ifDefined(\"onDelete\", onDelete),\n\t\t\t...ifDefined(\"onUpdate\", onUpdate),\n\t\t\t...ifDefined(\"index\", parsedRelation.index)\n\t\t});\n\t\tif (typeof parsedRelation.index === \"string\") relationIndexLocations.push({\n\t\t\tnamespaceId: modelNamespaceId ?? input.defaultNamespaceId,\n\t\t\ttableName,\n\t\t\tcolumns: localColumns,\n\t\t\tindex: parsedRelation.index,\n\t\t\tlocation: source.at(relationAttribute.relation.span)\n\t\t});\n\t\tresultFkRelationMetadata.push({\n\t\t\tdeclaringModelName: model,\n\t\t\tdeclaringFieldName: relationAttribute.field.name,\n\t\t\tdeclaringTableName: tableName,\n\t\t\t...ifDefined(\"declaringNamespaceId\", modelNamespaceId),\n\t\t\ttargetModelName: targetModel,\n\t\t\ttargetTableName,\n\t\t\t...ifDefined(\"targetNamespaceId\", targetNamespaceId),\n\t\t\t...ifDefined(\"relationName\", parsedRelation.name),\n\t\t\tnullable: relationAttribute.field.optional,\n\t\t\tlocalColumns,\n\t\t\treferencedColumns\n\t\t});\n\t}\n\treturn {\n\t\tmodelNode: {\n\t\t\tmodelName: model.name,\n\t\t\ttableName,\n\t\t\tfields: resolvedFields.map((resolvedField) => {\n\t\t\t\tconst common = {\n\t\t\t\t\tfieldName: resolvedField.field.name,\n\t\t\t\t\tcolumnName: resolvedField.columnName,\n\t\t\t\t\tdescriptor: resolvedField.descriptor,\n\t\t\t\t\tnullable: resolvedField.nullable,\n\t\t\t\t\t...ifDefined(\"many\", resolvedField.many),\n\t\t\t\t\t...ifDefined(\"elementNullable\", resolvedField.many ? resolvedField.elementNullable === true : void 0),\n\t\t\t\t\t...ifDefined(\"default\", resolvedField.defaultValue),\n\t\t\t\t\t...ifDefined(\"executionDefaults\", resolvedField.executionDefaults)\n\t\t\t\t};\n\t\t\t\tif (resolvedField.valueObjectTypeName !== void 0) return {\n\t\t\t\t\t...common,\n\t\t\t\t\tvalueObjectName: resolvedField.valueObjectTypeName\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\t...common,\n\t\t\t\t\t...ifDefined(\"noCheck\", resolvedField.noCheck),\n\t\t\t\t\t...ifDefined(\"enumTypeHandle\", resolvedField.enumTypeHandle)\n\t\t\t\t};\n\t\t\t}),\n\t\t\t...ifDefined(\"id\", primaryKey),\n\t\t\t...uniqueConstraints.length > 0 ? { uniques: uniqueConstraints } : {},\n\t\t\t...indexNodes.length > 0 ? { indexes: indexNodes } : {},\n\t\t\t...checkNodes.length > 0 ? { checks: checkNodes } : {},\n\t\t\t...foreignKeyNodes.length > 0 ? { foreignKeys: foreignKeyNodes } : {},\n\t\t\t...ifDefined(\"control\", controlPolicy)\n\t\t},\n\t\tfkRelationMetadata: resultFkRelationMetadata,\n\t\trelationIndexLocations,\n\t\tinvalidFkPairings: resultInvalidFkPairings,\n\t\tcrossSpaceRelations: resultCrossSpaceRelations,\n\t\tbackrelationCandidates: resultBackrelationCandidates,\n\t\tmodelAttributeEntities\n\t};\n}\nfunction buildValueObjectNodes(input) {\n\tconst { compositeTypes, enumHandles, diagnostics, sources, binder } = input;\n\treturn compositeTypes.map((compositeType) => {\n\t\tfor (const attribute of compositeType.attributes) diagnostics.push({\n\t\t\tcode: \"PSL_UNSUPPORTED_COMPOSITE_TYPE_ATTRIBUTE\",\n\t\t\tmessage: `Composite type \"${compositeType.name}\" uses attribute \"@@${attribute.name}\", which a composite type does not take`,\n\t\t\t...diagnosticSource(sources, compositeType.node.syntax).at(attribute.span)\n\t\t});\n\t\tconst fields = [];\n\t\tfor (const field of Object.values(compositeType.fields)) {\n\t\t\tfor (const attribute of field.attributes) diagnostics.push({\n\t\t\t\tcode: \"PSL_UNSUPPORTED_FIELD_ATTRIBUTE\",\n\t\t\t\tmessage: `Member \"${field.name}\" of composite type \"${compositeType.name}\" uses attribute \"@${attribute.name}\", which a composite type member does not take`,\n\t\t\t\t...diagnosticSource(sources, field.node.syntax).at(attribute.span)\n\t\t\t});\n\t\t\tconst common = {\n\t\t\t\tfieldName: field.name,\n\t\t\t\tnullable: field.optional,\n\t\t\t\t...ifDefined(\"many\", field.list ? true : void 0),\n\t\t\t\t...ifDefined(\"elementNullable\", field.list ? field.elementOptional : void 0)\n\t\t\t};\n\t\t\tconst fieldTypeReference = typeReferenceNode(field);\n\t\t\tconst fieldTypeResolution = fieldTypeReference === void 0 ? void 0 : binder.symbolForNode(fieldTypeReference);\n\t\t\tif (fieldTypeResolution?.kind === \"compositeType\") {\n\t\t\t\tfields.push({\n\t\t\t\t\t...common,\n\t\t\t\t\tvalueObjectName: fieldTypeResolution.symbol.name\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst resolved = resolveFieldTypeDescriptor({\n\t\t\t\tfield,\n\t\t\t\tresolution: fieldTypeResolution,\n\t\t\t\tenumTypeDescriptors: input.enumTypeDescriptors,\n\t\t\t\tnamedTypeDescriptors: input.namedTypeDescriptors,\n\t\t\t\tdiagnostics,\n\t\t\t\tsources,\n\t\t\t\tentityLabel: `Field \"${compositeType.name}.${field.name}\"`,\n\t\t\t\tnamespaceId: input.defaultNamespaceId,\n\t\t\t\t...ifDefined(\"namespaceExtensionEntities\", input.defaultNamespaceExtensionEntities),\n\t\t\t\tcodecLookup: input.codecLookup\n\t\t\t});\n\t\t\tif (!resolved.ok) continue;\n\t\t\tconst { descriptor } = resolved;\n\t\t\tif (descriptor.valueSet !== void 0) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_UNSUPPORTED_FIELD_TYPE\",\n\t\t\t\t\tmessage: `Field \"${compositeType.name}.${field.name}\" is typed by the storage enum \"${descriptor.valueSet.entityName}\", which a composite type member cannot use: a member has no column to store it in. Use a PSL enum instead.`,\n\t\t\t\t\t...diagnosticSource(sources, field.node.syntax).at(field.span)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfields.push({\n\t\t\t\t...common,\n\t\t\t\tdescriptor: {\n\t\t\t\t\tcodecId: descriptor.codecId,\n\t\t\t\t\t...ifDefined(\"typeParams\", resolvedTypeParams(descriptor, input.namedTypes))\n\t\t\t\t},\n\t\t\t\t...ifDefined(\"enumTypeHandle\", fieldTypeResolution?.kind === \"block\" ? enumHandles.get(fieldTypeResolution.symbol) : void 0)\n\t\t\t});\n\t\t}\n\t\treturn {\n\t\t\tname: compositeType.name,\n\t\t\tfields\n\t\t};\n\t});\n}\nfunction isStringTyped(field, stringCodecId, binder) {\n\tconst node = typeReferenceNode(field);\n\tconst scalar = contributedTypeOf(node === void 0 ? void 0 : binder.symbolForNode(node), binder);\n\treturn stringCodecId !== void 0 && scalar?.descriptor.kind === \"typeConstructor\" && scalar.descriptor.output.codecId === stringCodecId;\n}\nfunction collectPolymorphismDeclarations(identities, symbols, sources, binder, specContextFor, stringCodecId, diagnostics) {\n\tconst discriminatorDeclarations = /* @__PURE__ */ new Map();\n\tconst baseDeclarations = /* @__PURE__ */ new Map();\n\tfor (const { model, key } of identities.values()) {\n\t\tconst source = diagnosticSource(sources, model.node.syntax);\n\t\tconst discriminatorNode = getAttribute(model.attributes, \"discriminator\")?.node;\n\t\tif (discriminatorNode !== void 0) {\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tnode: discriminatorNode,\n\t\t\t\tsymbols,\n\t\t\t\tspec: sqlAttributeSpecs.model.discriminator(specContextFor(model)),\n\t\t\t\tmodel,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed !== void 0) {\n\t\t\t\tconst span = nodePslSpan(discriminatorNode.syntax, sources);\n\t\t\t\tconst discField = model.fields[parsed.field];\n\t\t\t\tif (discField && !isStringTyped(discField, stringCodecId, binder)) diagnostics.push({\n\t\t\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\t\t\tmessage: `Discriminator field \"${parsed.field}\" on model \"${model.name}\" must be of type String, but is \"${discField.typeName}\"`,\n\t\t\t\t\t...source.at(span)\n\t\t\t\t});\n\t\t\t\telse discriminatorDeclarations.set(key, {\n\t\t\t\t\tmodel,\n\t\t\t\t\tfieldName: parsed.field,\n\t\t\t\t\tspan,\n\t\t\t\t\tsource\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst baseNode = getAttribute(model.attributes, \"base\")?.node;\n\t\tif (baseNode !== void 0) {\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tnode: baseNode,\n\t\t\t\tsymbols,\n\t\t\t\tspec: sqlAttributeSpecs.model.base(specContextFor(model)),\n\t\t\t\tmodel,\n\t\t\t\tsources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed !== void 0) {\n\t\t\t\tconst base = identities.get(parsed.base.declaration);\n\t\t\t\tinvariant(base !== void 0, `Resolved base model \"${parsed.base.declaration.name}\" is missing from the collected model identities`);\n\t\t\t\tbaseDeclarations.set(key, {\n\t\t\t\t\tmodel,\n\t\t\t\t\tsource,\n\t\t\t\t\tbase,\n\t\t\t\t\tvalue: parsed.value,\n\t\t\t\t\tspan: nodePslSpan(baseNode.syntax, sources)\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\tdiscriminatorDeclarations,\n\t\tbaseDeclarations\n\t};\n}\nfunction resolvePolymorphism(models, physicalNames, discriminatorDeclarations, baseDeclarations, syntheticPkFieldsByVariant, stiBaseFieldsByBase, diagnostics) {\n\tlet patched = models;\n\tfor (const [baseKey, fieldNames] of stiBaseFieldsByBase) {\n\t\tconst baseModel = patched[baseKey];\n\t\tif (!baseModel || fieldNames.length === 0) continue;\n\t\tpatched = {\n\t\t\t...patched,\n\t\t\t[baseKey]: stripStorageOnlyDomainFields(baseModel, fieldNames)\n\t\t};\n\t}\n\tfor (const [modelKey, decl] of discriminatorDeclarations) {\n\t\tconst modelName = decl.model.name;\n\t\tif (baseDeclarations.has(modelKey)) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_DISCRIMINATOR_AND_BASE\",\n\t\t\t\tmessage: `Model \"${modelName}\" cannot have both @@discriminator and @@base`,\n\t\t\t\t...decl.source.at(decl.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst model = patched[modelKey];\n\t\tif (!model) continue;\n\t\tconst variants = {};\n\t\tconst seenValues = /* @__PURE__ */ new Map();\n\t\tfor (const baseDecl of baseDeclarations.values()) {\n\t\t\tif (baseDecl.base.key !== modelKey) continue;\n\t\t\tconst variantName = baseDecl.model.name;\n\t\t\tconst existingVariant = seenValues.get(baseDecl.value);\n\t\t\tif (existingVariant) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_DUPLICATE_DISCRIMINATOR_VALUE\",\n\t\t\t\t\tmessage: `Discriminator value \"${baseDecl.value}\" is used by both \"${existingVariant}\" and \"${variantName}\" on base model \"${modelName}\"`,\n\t\t\t\t\t...baseDecl.source.at(baseDecl.span)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tseenValues.set(baseDecl.value, variantName);\n\t\t\tvariants[variantName] = { value: baseDecl.value };\n\t\t}\n\t\tif (Object.keys(variants).length === 0) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_ORPHANED_DISCRIMINATOR\",\n\t\t\t\tmessage: `Model \"${modelName}\" has @@discriminator but no variant models declare @@base(${modelName}, ...)`,\n\t\t\t\t...decl.source.at(decl.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tpatched = {\n\t\t\t...patched,\n\t\t\t[modelKey]: {\n\t\t\t\t...model,\n\t\t\t\tdiscriminator: { field: decl.fieldName },\n\t\t\t\tvariants\n\t\t\t}\n\t\t};\n\t}\n\tfor (const [variantKey, baseDecl] of baseDeclarations) {\n\t\tconst variantName = baseDecl.model.name;\n\t\tconst baseName = baseDecl.base.model.name;\n\t\tif (!discriminatorDeclarations.has(baseDecl.base.key)) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_ORPHANED_BASE\",\n\t\t\t\tmessage: `Model \"${variantName}\" declares @@base(${baseName}, ...) but \"${baseName}\" has no @@discriminator`,\n\t\t\t\t...baseDecl.source.at(baseDecl.span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (discriminatorDeclarations.has(variantKey)) continue;\n\t\tconst variantModel = patched[variantKey];\n\t\tif (!variantModel) continue;\n\t\tconst resolvedTable = storageName(getAttribute(baseDecl.model.attributes, \"map\") !== void 0 ? baseDecl.model : baseDecl.base.model, physicalNames);\n\t\tconst patchedVariant = {\n\t\t\t...variantModel,\n\t\t\tbase: crossRef(baseName, baseDecl.base.namespaceId),\n\t\t\t...resolvedTable ? { storage: {\n\t\t\t\t...variantModel.storage,\n\t\t\t\ttable: resolvedTable\n\t\t\t} } : {}\n\t\t};\n\t\tpatched = {\n\t\t\t...patched,\n\t\t\t[variantKey]: stripStorageOnlyDomainFields(patchedVariant, syntheticPkFieldsByVariant.get(variantKey) ?? [])\n\t\t};\n\t}\n\treturn patched;\n}\n/**\n* Multi-table-inheritance variants (`@@base` + their own `@@map`) live in a\n* separate table from their base. The ORM joins that table to the base on the\n* shared primary key (`base.id = variant.id`), so the variant storage table\n* must carry the base PK column even though the variant domain model declares\n* only its own fields. This enriches each MTI variant's `ModelNode` with that\n* link column, a primary key on it, and a FK back to the base table.\n*\n* The link column is reported back per variant in `syntheticPkFieldsByVariant`\n* so the domain-model patch can drop it again — keeping the variant's domain\n* surface thin (its create/read inputs don't gain a redundant `id`) while the\n* storage table stays joinable. Single-table-inheritance variants (no own\n* table) are left untouched.\n*/\nfunction materializeMtiVariantStorageLinks(modelNodes, baseDeclarations, stiVariantKeys, defaultNamespaceId) {\n\tconst keyOf = (node) => modelCoordinateKey(node.namespaceId ?? defaultNamespaceId, node.modelName);\n\tconst nodeByModel = new Map(modelNodes.map((node) => [keyOf(node), node]));\n\tconst syntheticPkFieldsByVariant = /* @__PURE__ */ new Map();\n\treturn {\n\t\tmodelNodes: modelNodes.map((node) => {\n\t\t\tconst variantKey = keyOf(node);\n\t\t\tconst baseDecl = baseDeclarations.get(variantKey);\n\t\t\tif (!baseDecl) return node;\n\t\t\tconst baseNode = nodeByModel.get(baseDecl.base.key);\n\t\t\tif (!baseNode) return node;\n\t\t\tif (stiVariantKeys.has(variantKey)) return node;\n\t\t\tconst basePrimaryKey = baseNode.id;\n\t\t\tif (!basePrimaryKey || basePrimaryKey.columns.length === 0) return node;\n\t\t\tconst existingColumns = new Set(node.fields.map((field) => field.columnName));\n\t\t\tconst linkFields = [];\n\t\t\tfor (const pkColumn of basePrimaryKey.columns) {\n\t\t\t\tif (existingColumns.has(pkColumn)) continue;\n\t\t\t\tconst baseField = baseNode.fields.find((field) => field.columnName === pkColumn);\n\t\t\t\tif (!baseField) continue;\n\t\t\t\tlinkFields.push({\n\t\t\t\t\tfieldName: baseField.fieldName,\n\t\t\t\t\tcolumnName: pkColumn,\n\t\t\t\t\tdescriptor: baseField.descriptor,\n\t\t\t\t\tnullable: false,\n\t\t\t\t\tmany: false\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (linkFields.length === 0) return node;\n\t\t\tsyntheticPkFieldsByVariant.set(variantKey, linkFields.map((field) => field.fieldName));\n\t\t\tconst foreignKey = {\n\t\t\t\tcolumns: basePrimaryKey.columns,\n\t\t\t\treferences: {\n\t\t\t\t\tmodel: baseNode.modelName,\n\t\t\t\t\ttable: baseNode.tableName,\n\t\t\t\t\tcolumns: basePrimaryKey.columns,\n\t\t\t\t\t...ifDefined(\"namespaceId\", baseNode.namespaceId)\n\t\t\t\t},\n\t\t\t\tconstraint: true,\n\t\t\t\tonDelete: \"cascade\"\n\t\t\t};\n\t\t\treturn {\n\t\t\t\t...node,\n\t\t\t\tfields: [...linkFields, ...node.fields],\n\t\t\t\tid: { columns: basePrimaryKey.columns },\n\t\t\t\tforeignKeys: [...node.foreignKeys ?? [], foreignKey]\n\t\t\t};\n\t\t}),\n\t\tsyntheticPkFieldsByVariant\n\t};\n}\n/**\n* Single-table-inheritance variants (`@@base` with no own `@@map`) share the\n* base table: `resolvePolymorphism` points the variant's `storage.table` at the\n* base, and the ORM reads variant-declared fields straight off the base table.\n* For that to validate and round-trip, the base storage table must physically\n* carry every STI variant's declared columns. This enriches the base\n* `ModelNode` with those columns.\n*\n* The materialised columns are always nullable in storage: the base table hosts\n* every variant's rows, so a column a variant declares as required is still\n* NULL on sibling-variant rows. The variant's domain field keeps its declared\n* nullability — required-in-domain / nullable-in-storage is the intended STI\n* shape.\n*\n* Collisions (two variants declaring the same column, or a variant column name\n* clashing with a base column) are resolved skip-if-exists here, mirroring the\n* MTI link guard; surfacing them as diagnostics is tracked separately\n* (TML-2827).\n*/\nfunction materializeStiVariantStorageColumns(modelNodes, baseDeclarations, stiVariantKeys, defaultNamespaceId) {\n\tif (stiVariantKeys.size === 0) return {\n\t\tmodelNodes: [...modelNodes],\n\t\tstiBaseFieldsByBase: /* @__PURE__ */ new Map()\n\t};\n\tconst keyOf = (node) => modelCoordinateKey(node.namespaceId ?? defaultNamespaceId, node.modelName);\n\tconst nodeByModel = new Map(modelNodes.map((node) => [keyOf(node), node]));\n\tconst stiColumnsByBase = /* @__PURE__ */ new Map();\n\tfor (const variantKey of stiVariantKeys) {\n\t\tconst variantNode = nodeByModel.get(variantKey);\n\t\tconst baseDecl = baseDeclarations.get(variantKey);\n\t\tif (!variantNode || !baseDecl) continue;\n\t\tconst baseNode = nodeByModel.get(baseDecl.base.key);\n\t\tif (!baseNode) continue;\n\t\tconst baseColumns = new Set(baseNode.fields.map((field) => field.columnName));\n\t\tconst claimed = stiColumnsByBase.get(baseDecl.base.key) ?? [];\n\t\tconst claimedColumns = new Set(claimed.map((field) => field.columnName));\n\t\tfor (const field of variantNode.fields) {\n\t\t\tif (baseColumns.has(field.columnName) || claimedColumns.has(field.columnName)) continue;\n\t\t\tclaimedColumns.add(field.columnName);\n\t\t\tclaimed.push({\n\t\t\t\t...field,\n\t\t\t\tnullable: true\n\t\t\t});\n\t\t}\n\t\tstiColumnsByBase.set(baseDecl.base.key, claimed);\n\t}\n\tconst stiBaseFieldsByBase = /* @__PURE__ */ new Map();\n\tfor (const [baseName, columns] of stiColumnsByBase) stiBaseFieldsByBase.set(baseName, columns.map((field) => field.fieldName));\n\treturn {\n\t\tmodelNodes: modelNodes.map((node) => {\n\t\t\tif (stiVariantKeys.has(keyOf(node))) return {\n\t\t\t\t...node,\n\t\t\t\tsharesBaseTable: true\n\t\t\t};\n\t\t\tconst stiColumns = stiColumnsByBase.get(keyOf(node));\n\t\t\tif (!stiColumns || stiColumns.length === 0) return node;\n\t\t\treturn {\n\t\t\t\t...node,\n\t\t\t\tfields: [...node.fields, ...stiColumns]\n\t\t\t};\n\t\t}),\n\t\tstiBaseFieldsByBase\n\t};\n}\n/**\n* Drop the storage-only link fields (added by\n* {@link materializeMtiVariantStorageLinks}) from a variant's domain model, so\n* the domain surface stays thin while the storage table keeps the link column.\n*/\nfunction stripStorageOnlyDomainFields(model, fieldNames) {\n\tif (fieldNames.length === 0) return model;\n\tconst fields = { ...model.fields };\n\tfor (const name of fieldNames) delete fields[name];\n\tconst storage = blindCast(model.storage);\n\tconst storageFields = { ...storage.fields };\n\tfor (const name of fieldNames) delete storageFields[name];\n\treturn {\n\t\t...model,\n\t\tfields,\n\t\tstorage: {\n\t\t\t...storage,\n\t\t\tfields: storageFields\n\t\t}\n\t};\n}\nfunction backrelationTargetSymbol(field, binder) {\n\tconst typeReference = typeReferenceNode(field);\n\tif (typeReference === void 0) return void 0;\n\tconst resolution = binder.symbolForNode(typeReference);\n\treturn resolution?.kind === \"model\" ? resolution.symbol : void 0;\n}\nfunction relationTargetKindLabel(resolution) {\n\tswitch (resolution.kind) {\n\t\tcase \"compositeType\": return \"composite type\";\n\t\tcase \"namedType\": return \"named type\";\n\t\tcase \"block\": return resolution.symbol.keyword;\n\t\tcase \"namespace\":\n\t\tcase \"contributedNamespace\": return \"namespace\";\n\t\tcase \"contributedType\": return \"type\";\n\t\tdefault: return;\n\t}\n}\n/**\n* The relation a refusal of `index: \"<name>\"` belongs to, and the message to report there; `undefined` for every other error.\n*/\nfunction relationIndexRefusal(error, locations) {\n\tif (!isStructuredError(error) || error.meta?.[\"reason\"] !== FOREIGN_KEY_INDEX_UNRESOLVED) return;\n\tconst { namespaceId, tableName, columns, index } = error.meta ?? {};\n\tconst at = locations.find((candidate) => candidate.namespaceId === namespaceId && candidate.tableName === tableName && candidate.index === index && Array.isArray(columns) && candidate.columns.length === columns.length && candidate.columns.every((column, position) => column === columns[position]));\n\tif (at === void 0) return void 0;\n\treturn {\n\t\tat,\n\t\tmessage: error.fix === void 0 ? error.message : `${error.message} ${error.fix}`\n\t};\n}\nfunction interpretPslDocumentToSqlContract(input) {\n\tif (!input.target) throw new InternalError(\"PSL interpretation requires an explicit target context from composition.\");\n\tif (!input.scalarColumnDescriptors) throw new InternalError(\"PSL interpretation requires composed scalar type descriptors.\");\n\tconst [anchorDocument] = input.documents;\n\tassertDefined(anchorDocument, \"interpretPslDocumentToSqlContract requires at least one document\");\n\tconst source = diagnosticSource(input.sources, anchorDocument.syntax);\n\tconst diagnostics = createPslDiagnosticCollector(input.sources);\n\tconst modelAttributesByName = buildModelAttributesByName(input.authoringContributions);\n\tconst contributedModelSpecs = modelAttributeSpecsFrom(modelAttributesByName);\n\tconst composedPslBlockDescriptors = input.authoringContributions?.pslBlockDescriptors ?? {};\n\tconst { binder, dataTypes } = input;\n\tconst defaultFunctionRegistry = input.controlMutationDefaults?.defaultFunctionRegistry ?? /* @__PURE__ */ new Map();\n\tconst specContextFor = (model) => modelSpecContext({\n\t\tsymbols: input.symbolTable,\n\t\tmodel,\n\t\tdefaultFunctionRegistry,\n\t\tdataTypes\n\t});\n\tconst { topLevel } = input.symbolTable;\n\tconst namespaceSymbols = Object.values(topLevel.namespaces);\n\tvalidateNamespaceBlocksForSqlTarget({\n\t\tnamespaces: namespaceSymbols,\n\t\ttargetId: input.target.targetId,\n\t\tsource,\n\t\tsources: input.sources,\n\t\tbinder,\n\t\tdiagnostics\n\t});\n\tconst { parsedBlocks, diagnostics: blockDiagnostics } = interpretExtensionBlocks({\n\t\tsymbolTable: input.symbolTable,\n\t\tsources: input.sources,\n\t\tpslBlockDescriptors: composedPslBlockDescriptors,\n\t\tbinder,\n\t\tdataTypes\n\t});\n\tdiagnostics.push(...blockDiagnostics);\n\tvalidateBlockModelAttributeRequirements({\n\t\tparsedBlocks,\n\t\tpslBlockDescriptors: composedPslBlockDescriptors,\n\t\tsources: input.sources,\n\t\tdiagnostics\n\t});\n\tconst models = [];\n\tconst modelEntries = [];\n\tconst compositeTypes = [];\n\tconst collectScope = (bucketName, scopeModels, scopeCompositeTypes) => {\n\t\tconst resolvedNamespaceId = resolveNamespaceIdForSqlTarget({\n\t\t\tbucketName,\n\t\t\ttargetId: input.target.targetId\n\t\t});\n\t\tfor (const model of scopeModels) {\n\t\t\tmodels.push(model);\n\t\t\tmodelEntries.push({\n\t\t\t\tmodel,\n\t\t\t\tnamespaceId: resolvedNamespaceId\n\t\t\t});\n\t\t}\n\t\tfor (const compositeType of scopeCompositeTypes) compositeTypes.push(compositeType);\n\t};\n\tcollectScope(UNSPECIFIED_PSL_NAMESPACE_ID, Object.values(topLevel.models), Object.values(topLevel.compositeTypes));\n\tfor (const namespace of namespaceSymbols) collectScope(namespace.name, Object.values(namespace.models), Object.values(namespace.compositeTypes));\n\tconst physicalNames = /* @__PURE__ */ new Map();\n\tfor (const model of models) {\n\t\tconst mapNode = getAttribute(model.attributes, \"map\")?.node;\n\t\tconst mapped = mapNode === void 0 ? void 0 : interpretModelAttribute({\n\t\t\tnode: mapNode,\n\t\t\tsymbols: input.symbolTable,\n\t\t\tspec: sqlAttributeSpecs.model.map(specContextFor(model)),\n\t\t\tmodel,\n\t\t\tsources: input.sources,\n\t\t\tbinder,\n\t\t\tdiagnostics\n\t\t});\n\t\tphysicalNames.set(model, mapped?.name ?? defaultTableName(model.name));\n\t\tfor (const field of Object.values(model.fields)) {\n\t\t\tconst mapNode = getAttribute(field.attributes, \"map\")?.node;\n\t\t\tconst mapped = mapNode === void 0 ? void 0 : interpretFieldAttribute({\n\t\t\t\tnode: mapNode,\n\t\t\t\tsymbols: input.symbolTable,\n\t\t\t\tspec: sqlAttributeSpecs.field.map(fieldSpecContext({\n\t\t\t\t\t...specContextFor(model),\n\t\t\t\t\tfield,\n\t\t\t\t\tbinder\n\t\t\t\t})),\n\t\t\t\tmodel,\n\t\t\t\tfield,\n\t\t\t\tsources: input.sources,\n\t\t\t\tbinder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tphysicalNames.set(field, mapped?.name ?? field.name);\n\t\t}\n\t}\n\tconst defaultNamespaceId = input.target.defaultNamespaceId;\n\tconst composedExtensions = new Set(input.composedExtensions ?? []);\n\tconst composedExtensionContracts = input.composedExtensionContracts;\n\tconst generatorDescriptors = input.controlMutationDefaults?.generatorDescriptors ?? [];\n\tconst generatorDescriptorById = /* @__PURE__ */ new Map();\n\tfor (const descriptor of generatorDescriptors) generatorDescriptorById.set(descriptor.id, descriptor);\n\tconst isEnumBlock = (block) => block.keyword === \"enum\";\n\tconst legitimateBlockKeywords = claimedBlockKeywords(input.authoringContributions?.pslBlockDescriptors);\n\tconst reportUnsupportedTopLevelBlock = (block) => {\n\t\tdiagnostics.push(unsupportedBlockDiagnostic(block, input.sources));\n\t};\n\tconst topLevelEnums = [];\n\tconst topLevelExtensionBlocks = {};\n\tfor (const [blockName, block] of Object.entries(topLevel.blocks)) {\n\t\tif (!legitimateBlockKeywords.has(block.keyword)) {\n\t\t\treportUnsupportedTopLevelBlock(block);\n\t\t\tcontinue;\n\t\t}\n\t\tif (isEnumBlock(block)) topLevelEnums.push(block);\n\t\telse topLevelExtensionBlocks[blockName] = block;\n\t}\n\tfor (const namespace of namespaceSymbols) for (const block of Object.values(namespace.blocks)) {\n\t\tif (isEnumBlock(block)) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_ENUM_NAMESPACE_NOT_SUPPORTED\",\n\t\t\t\tmessage: `enum \"${block.name}\" inside namespace \"${namespace.name}\" is not supported; declare enum at the top level`,\n\t\t\t\t...diagnosticSource(input.sources, block.node.syntax).at(nodePslSpan(block.node.syntax, input.sources))\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (!legitimateBlockKeywords.has(block.keyword)) reportUnsupportedTopLevelBlock(block);\n\t}\n\tconst enumResult = processEnumDeclarations({\n\t\tenumBlocks: topLevelEnums,\n\t\tparsedBlocks,\n\t\tsource,\n\t\tauthoringContributions: input.authoringContributions,\n\t\tentityContext: {\n\t\t\tfamily: input.target.familyId,\n\t\t\ttarget: input.target.targetId,\n\t\t\tcodecLookup: input.codecLookup,\n\t\t\tdataTypeLookup: input.dataTypes.lookup,\n\t\t\tsourceId: source.sources.sourceFileFor(source.node).filename,\n\t\t\tdiagnostics: { push: (d) => {\n\t\t\t\tdiagnostics.pushExternal(blindCast(d));\n\t\t\t} },\n\t\t\treadWrittenNumber: ({ text, codecId, subject }) => {\n\t\t\t\tif (input.codecLookup.descriptorFor(codecId) === void 0) return void 0;\n\t\t\t\tconst reading = readWrittenNumberForCodec({\n\t\t\t\t\ttext,\n\t\t\t\t\tcodecId,\n\t\t\t\t\tcodecLookup: input.codecLookup,\n\t\t\t\t\tdataTypes: input.dataTypes,\n\t\t\t\t\tsubject\n\t\t\t\t});\n\t\t\t\treturn reading.ok ? reading : {\n\t\t\t\t\tok: false,\n\t\t\t\t\tmessage: reading.message\n\t\t\t\t};\n\t\t\t},\n\t\t\t...ifDefined(\"enumInferenceCodecs\", input.enumInferenceCodecs)\n\t\t},\n\t\tdiagnostics\n\t});\n\tconst allEnumTypeDescriptors = enumResult.enumTypeDescriptors;\n\tconst enumHandles = enumResult.enumHandles;\n\tconst validEnumHandles = Object.fromEntries(Array.from(enumHandles, ([symbol, handle]) => [symbol.name, handle]));\n\tconst entityTypesByDiscriminator = buildEntityTypesByDiscriminator(input.authoringContributions);\n\tconst authoringWarnings = [];\n\tconst extensionEntityContext = {\n\t\tfamily: input.target.familyId,\n\t\ttarget: input.target.targetId,\n\t\t...ifDefined(\"enumInferenceCodecs\", input.enumInferenceCodecs),\n\t\tcodecLookup: input.codecLookup,\n\t\tdataTypeLookup: input.dataTypes.lookup,\n\t\tsourceId: source.sources.sourceFileFor(source.node).filename,\n\t\tdiagnostics: { push: (d) => {\n\t\t\tdiagnostics.pushExternal(blindCast(d));\n\t\t} },\n\t\twarnings: authoringWarnings\n\t};\n\tconst modelCoordinateOf = (model) => {\n\t\treturn {\n\t\t\tnamespaceId: resolveNamespaceIdForSqlTarget({\n\t\t\t\tbucketName: model.node.syntax.findAncestor(NamespaceDeclarationAst.cast)?.name()?.name() ?? UNSPECIFIED_PSL_NAMESPACE_ID,\n\t\t\t\ttargetId: input.target.targetId\n\t\t\t}) ?? defaultNamespaceId,\n\t\t\ttableName: storageName(model, physicalNames)\n\t\t};\n\t};\n\tconst namespaceExtensionEntities = /* @__PURE__ */ new Map();\n\tconst fileExtensionEntityRows = (rows, blocks) => {\n\t\tfor (const row of rows) {\n\t\t\tlet entities = namespaceExtensionEntities.get(row.namespaceId);\n\t\t\tif (entities === void 0) {\n\t\t\t\tentities = {};\n\t\t\t\tnamespaceExtensionEntities.set(row.namespaceId, entities);\n\t\t\t}\n\t\t\tconst slot = entities[row.entityKind] ?? {};\n\t\t\tentities[row.entityKind] = slot;\n\t\t\tif (Object.hasOwn(slot, row.key)) {\n\t\t\t\tconst block = Object.values(blocks).find((candidate) => candidate.name === row.key);\n\t\t\t\tinvariant(block !== void 0, \"Lowered entity has an owning block\");\n\t\t\t\tdiagnostics.pushUnlocated({\n\t\t\t\t\tcode: \"PSL_DUPLICATE_EXTENSION_ENTITY\",\n\t\t\t\t\tmessage: `entries slot \"${row.entityKind}\" in namespace \"${row.namespaceId}\": entity \"${row.key}\" is declared more than once in the same namespace.`,\n\t\t\t\t\t...diagnosticSource(input.sources, block.node.syntax).at()\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tslot[row.key] = row.entity;\n\t\t}\n\t};\n\tfor (const ns of namespaceSymbols) {\n\t\tif (ns.name === UNSPECIFIED_PSL_NAMESPACE_ID) continue;\n\t\tconst nsId = resolveNamespaceIdForSqlTarget({\n\t\t\tbucketName: ns.name,\n\t\t\ttargetId: input.target.targetId\n\t\t});\n\t\tif (nsId === void 0) continue;\n\t\tfileExtensionEntityRows(lowerExtensionBlocksForNamespace(ns.blocks, nsId, entityTypesByDiscriminator, extensionEntityContext, parsedBlocks, modelCoordinateOf, input.sources), ns.blocks);\n\t}\n\tif (Object.keys(topLevelExtensionBlocks).length > 0) fileExtensionEntityRows(lowerExtensionBlocksForNamespace(topLevelExtensionBlocks, resolveNamespaceIdForSqlTarget({\n\t\tbucketName: UNSPECIFIED_PSL_NAMESPACE_ID,\n\t\ttargetId: input.target.targetId\n\t}) ?? defaultNamespaceId, entityTypesByDiscriminator, extensionEntityContext, parsedBlocks, modelCoordinateOf, input.sources), topLevelExtensionBlocks);\n\tconst defaultNsExtensionValueSets = namespaceExtensionEntities.get(defaultNamespaceId)?.[\"valueSet\"];\n\tif (defaultNsExtensionValueSets !== void 0) {\n\t\tfor (const name of Object.keys(defaultNsExtensionValueSets)) if (Object.hasOwn(validEnumHandles, name)) {\n\t\t\tconst enumSymbol = topLevel.blocks[name];\n\t\t\tinvariant(enumSymbol !== void 0, \"Domain enum has an owning block\");\n\t\t\tdiagnostics.pushUnlocated({\n\t\t\t\tcode: \"PSL_VALUE_SET_NAME_COLLISION\",\n\t\t\t\tmessage: `namespace \"${defaultNamespaceId}\": name \"${name}\" is declared both as a domain enum and as an extension entity that derives a value-set; rename one`,\n\t\t\t\t...diagnosticSource(input.sources, enumSymbol.node.syntax).at()\n\t\t\t});\n\t\t}\n\t}\n\tconst isScalarRefinement = (symbol) => {\n\t\tconst reference = typeReferenceNode(symbol);\n\t\treturn !symbol.isConstructor && symbol.baseType !== void 0 && reference !== void 0 && bareTypeConstructorOf(binder.symbolForNode(reference)) !== void 0;\n\t};\n\tconst allNamedTypes = Object.values(topLevel.namedTypes);\n\tconst namedTypeResult = resolveNamedTypeDeclarations({\n\t\tdeclarations: [...allNamedTypes.filter(isScalarRefinement), ...allNamedTypes.filter((symbol) => !isScalarRefinement(symbol))],\n\t\tsource,\n\t\tbinder,\n\t\tenumTypeDescriptors: allEnumTypeDescriptors,\n\t\tcodecLookup: input.codecLookup,\n\t\tdiagnostics\n\t});\n\tconst storageTypes = { ...namedTypeResult.storageTypes };\n\tconst modelNodes = /* @__PURE__ */ new Map();\n\tconst fkRelationMetadata = [];\n\tconst relationIndexLocations = [];\n\tconst invalidFkPairings = [];\n\tconst backrelationCandidates = [];\n\tconst crossSpaceRelationsByModel = /* @__PURE__ */ new Map();\n\tconst modelAttributeEntitiesByNamespace = /* @__PURE__ */ new Map();\n\tconst valueObjects = buildValueObjectNodes({\n\t\tcompositeTypes,\n\t\tenumTypeDescriptors: allEnumTypeDescriptors,\n\t\tenumHandles,\n\t\tnamedTypeDescriptors: namedTypeResult.namedTypeDescriptors,\n\t\tnamedTypes: namedTypeResult.storageTypes,\n\t\tdiagnostics,\n\t\tsources: input.sources,\n\t\tdefaultNamespaceId,\n\t\tdefaultNamespaceExtensionEntities: namespaceExtensionEntities.get(defaultNamespaceId),\n\t\tcodecLookup: input.codecLookup,\n\t\tbinder\n\t});\n\tconst valueObjectTypes = {\n\t\tnodes: new Map(valueObjects.map((valueObject) => [valueObject.name, valueObject])),\n\t\tdeclaredMembers: new Map(compositeTypes.map((compositeType) => [compositeType.name, new Set(Object.keys(compositeType.fields))]))\n\t};\n\tfor (const { model, namespaceId } of modelEntries) {\n\t\tconst result = buildModelNodeFromPsl({\n\t\t\tmodel,\n\t\t\tphysicalNames,\n\t\t\tnamespaceId,\n\t\t\tvalueObjectTypes,\n\t\t\tenumTypeDescriptors: allEnumTypeDescriptors,\n\t\t\tnamedTypeDescriptors: namedTypeResult.namedTypeDescriptors,\n\t\t\tcomposedExtensionContracts,\n\t\t\tfamilyId: input.target.familyId,\n\t\t\ttargetId: input.target.targetId,\n\t\t\tauthoringContributions: input.authoringContributions,\n\t\t\tdefaultFunctionRegistry,\n\t\t\tdataTypes,\n\t\t\tgeneratorDescriptorById,\n\t\t\tscalarColumnDescriptors: input.scalarColumnDescriptors,\n\t\t\tsources: input.sources,\n\t\t\tbinder,\n\t\t\tsymbolTable: input.symbolTable,\n\t\t\tdiagnostics,\n\t\t\tenumHandles,\n\t\t\tcapabilities: input.capabilities,\n\t\t\t...namespaceExtensionEntities.size > 0 ? { namespaceExtensionEntities } : {},\n\t\t\tcodecLookup: input.codecLookup,\n\t\t\tmodelAttributesByName,\n\t\t\tcontributedModelAttributeSpecs: contributedModelSpecs,\n\t\t\tdefaultNamespaceId,\n\t\t\tparsedBlocks\n\t\t});\n\t\tmodelNodes.set(model, namespaceId !== void 0 ? {\n\t\t\t...result.modelNode,\n\t\t\tnamespaceId\n\t\t} : result.modelNode);\n\t\tfkRelationMetadata.push(...result.fkRelationMetadata);\n\t\trelationIndexLocations.push(...result.relationIndexLocations);\n\t\tinvalidFkPairings.push(...result.invalidFkPairings);\n\t\tbackrelationCandidates.push(...result.backrelationCandidates);\n\t\tif (result.crossSpaceRelations.length > 0) {\n\t\t\tconst existing = crossSpaceRelationsByModel.get(model) ?? [];\n\t\t\tcrossSpaceRelationsByModel.set(model, [...existing, ...result.crossSpaceRelations]);\n\t\t}\n\t\tif (Object.keys(result.modelAttributeEntities).length > 0) {\n\t\t\tconst nsKey = namespaceId ?? defaultNamespaceId;\n\t\t\tconst existingByAttribute = modelAttributeEntitiesByNamespace.get(nsKey) ?? {};\n\t\t\tfor (const [attribute, keyed] of Object.entries(result.modelAttributeEntities)) existingByAttribute[attribute] = {\n\t\t\t\t...existingByAttribute[attribute] ?? {},\n\t\t\t\t...keyed\n\t\t\t};\n\t\t\tmodelAttributeEntitiesByNamespace.set(nsKey, existingByAttribute);\n\t\t}\n\t}\n\tconst { modelRelations, fkRelationsByPair, fkRelationsByDeclaringModel } = indexFkRelations({ fkRelationMetadata });\n\tconst modelIdColumns = /* @__PURE__ */ new Map();\n\tconst modelUniqueColumnSets = /* @__PURE__ */ new Map();\n\tfor (const [model, modelNode] of modelNodes) {\n\t\tif (modelNode.id) modelIdColumns.set(model, modelNode.id.columns);\n\t\tconst uniqueColumnSets = [];\n\t\tif (modelNode.id) uniqueColumnSets.push(modelNode.id.columns);\n\t\tfor (const unique of modelNode.uniques ?? []) uniqueColumnSets.push(unique.columns);\n\t\tfor (const index of modelNode.indexes ?? []) if (index.unique === true && index.columns !== void 0 && index.where === void 0) uniqueColumnSets.push(index.columns);\n\t\tmodelUniqueColumnSets.set(model, uniqueColumnSets);\n\t}\n\tapplyBackrelationCandidates({\n\t\tbackrelationCandidates,\n\t\tfkRelationsByPair,\n\t\tinvalidFkPairings,\n\t\tfkRelationsByDeclaringModel,\n\t\tmodelIdColumns,\n\t\tmodelUniqueColumnSets,\n\t\tmodelRelations,\n\t\tdiagnostics,\n\t\tsources: input.sources\n\t});\n\tfor (const [modelName, relations] of crossSpaceRelationsByModel) {\n\t\tconst existing = modelRelations.get(modelName);\n\t\tif (existing) existing.push(...relations);\n\t\telse modelRelations.set(modelName, [...relations]);\n\t}\n\tconst { discriminatorDeclarations, baseDeclarations } = collectPolymorphismDeclarations(new Map(modelEntries.map(({ model, namespaceId }) => {\n\t\tconst resolvedNamespaceId = namespaceId ?? defaultNamespaceId;\n\t\treturn [model, {\n\t\t\tmodel,\n\t\t\tnamespaceId: resolvedNamespaceId,\n\t\t\tkey: modelCoordinateKey(resolvedNamespaceId, model.name)\n\t\t}];\n\t})), input.symbolTable, input.sources, binder, specContextFor, input.scalarColumnDescriptors.get(\"String\")?.codecId, diagnostics);\n\tconst stiVariantKeys = /* @__PURE__ */ new Set();\n\tfor (const [variantKey, declaration] of baseDeclarations) if (!(getAttribute(declaration.model.attributes, \"map\") !== void 0)) stiVariantKeys.add(variantKey);\n\tfor (const variantKey of stiVariantKeys) {\n\t\tconst baseDecl = baseDeclarations.get(variantKey);\n\t\tinvariant(baseDecl !== void 0, `stiVariantKeys is derived from baseDeclarations.keys(), so \"${variantKey}\" must have a base declaration`);\n\t\tconst variantName = baseDecl.model.name;\n\t\tfor (const attribute of baseDecl.model.attributes) {\n\t\t\tif (attribute.node.name()?.isSimpleName(\"check\") !== true) continue;\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: PSL_CHECK_ON_STI_VARIANT,\n\t\t\t\tmessage: `Model \"${variantName}\" declares \"@@check\", but it shares its base model \"${baseDecl.base.model.name}\"'s storage table (single-table inheritance via @@base) and has no table of its own to declare a check constraint on. Declare the check on \"${baseDecl.base.model.name}\" instead.`,\n\t\t\t\t...diagnosticSource(input.sources, attribute.node.syntax).at(nodePslSpan(attribute.node.syntax, input.sources))\n\t\t\t});\n\t\t}\n\t}\n\tconst { modelNodes: mtiLinkedModelNodes, syntheticPkFieldsByVariant } = materializeMtiVariantStorageLinks(Array.from(modelNodes, ([symbol, model]) => ({\n\t\t...model,\n\t\t...modelRelations.has(symbol) ? { relations: [...modelRelations.get(symbol) ?? []].sort((left, right) => compareStrings(left.fieldName, right.fieldName)) } : {}\n\t})), baseDeclarations, stiVariantKeys, defaultNamespaceId);\n\tconst { modelNodes: stiColumnModelNodes, stiBaseFieldsByBase } = materializeStiVariantStorageColumns(mtiLinkedModelNodes, baseDeclarations, stiVariantKeys, defaultNamespaceId);\n\tif (diagnostics.length > 0 || (input.seedDiagnostics?.length ?? 0) > 0) return notOk({\n\t\tsummary: \"PSL to SQL contract interpretation failed\",\n\t\tdiagnostics: [...input.seedDiagnostics ?? [], ...diagnostics.toExternal()]\n\t});\n\tconst { createNamespace } = input;\n\tconst createNamespaceWithExtensions = (nsInput) => {\n\t\tconst entities = namespaceExtensionEntities.get(nsInput.id);\n\t\tconst attributeEntities = modelAttributeEntitiesByNamespace.get(nsInput.id);\n\t\tif (entities === void 0 && attributeEntities === void 0) return createNamespace(nsInput);\n\t\tif (attributeEntities !== void 0) {\n\t\t\tfor (const slot of Object.keys(attributeEntities)) if (Object.hasOwn(nsInput.entries, slot) || entities !== void 0 && slot in entities) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `entries slot \"${slot}\" in namespace \"${nsInput.id}\" is contributed by both a model attribute and a block/base entry kind. A model-attribute entries key must be unique across the namespace's entry kinds.`, { meta: {\n\t\t\t\tslot,\n\t\t\t\tnamespaceId: nsInput.id\n\t\t\t} });\n\t\t}\n\t\tconst mergedValueSet = {\n\t\t\t...nsInput.entries[\"valueSet\"],\n\t\t\t...entities?.[\"valueSet\"]\n\t\t};\n\t\tconst extended = {\n\t\t\t...nsInput,\n\t\t\tentries: {\n\t\t\t\t...nsInput.entries,\n\t\t\t\t...entities,\n\t\t\t\t...attributeEntities,\n\t\t\t\t...Object.keys(mergedValueSet).length > 0 ? { valueSet: mergedValueSet } : {}\n\t\t\t}\n\t\t};\n\t\treturn createNamespace(extended);\n\t};\n\tlet contract;\n\ttry {\n\t\tcontract = buildSqlContractFromDefinition({\n\t\t\ttarget: input.target,\n\t\t\twarnings: authoringWarnings.length > 0 ? authoringWarnings : void 0,\n\t\t\t...ifDefined(\"extensions\", buildComposedExtensionPackRefs(input.target, [...composedExtensions].sort(compareStrings), input.composedExtensionPackRefs)),\n\t\t\t...Object.keys(storageTypes).length > 0 ? { storageTypes } : {},\n\t\t\t...Object.keys(validEnumHandles).length > 0 ? { enums: validEnumHandles } : {},\n\t\t\t...namespaceExtensionEntities.size > 0 ? { namespaces: [...namespaceExtensionEntities.keys()] } : {},\n\t\t\tcreateNamespace: createNamespaceWithExtensions,\n\t\t\t...ifDefined(\"valueObjects\", valueObjects.length > 0 ? valueObjects : void 0),\n\t\t\tmodels: stiColumnModelNodes\n\t\t}, input.codecLookup, input.dataTypes.lookup);\n\t} catch (error) {\n\t\tconst refusal = relationIndexRefusal(error, relationIndexLocations);\n\t\tif (refusal === void 0) throw error;\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_INVALID_RELATION_ATTRIBUTE\",\n\t\t\tmessage: refusal.message,\n\t\t\t...refusal.at.location\n\t\t});\n\t\treturn notOk({\n\t\t\tsummary: \"PSL to SQL contract interpretation failed\",\n\t\t\tdiagnostics: diagnostics.toExternal()\n\t\t});\n\t}\n\tconst modelsByCoordinate = {};\n\tfor (const [namespaceId, namespaceSlice] of Object.entries(contract.domain.namespaces)) for (const [modelName, model] of Object.entries(namespaceSlice.models)) {\n\t\tconst coordinate = modelCoordinateKey(namespaceId, modelName);\n\t\tinvariant(!Object.hasOwn(modelsByCoordinate, coordinate), `symbol table guarantees coordinate uniqueness; duplicate model \"${namespaceId}.${modelName}\" reached interpretation`);\n\t\tmodelsByCoordinate[coordinate] = model;\n\t}\n\tconst polyDiagnostics = createPslDiagnosticCollector(input.sources);\n\tconst polymorphicModels = resolvePolymorphism(modelsByCoordinate, physicalNames, discriminatorDeclarations, baseDeclarations, syntheticPkFieldsByVariant, stiBaseFieldsByBase, polyDiagnostics);\n\tif (polyDiagnostics.length > 0) return notOk({\n\t\tsummary: \"PSL to SQL contract interpretation failed\",\n\t\tdiagnostics: polyDiagnostics.toExternal()\n\t});\n\tconst filteredRoots = Object.fromEntries(Object.entries(contract.roots).filter(([, crossReference]) => !baseDeclarations.has(modelCoordinateKey(crossReference.namespace, crossReference.model))));\n\treturn ok({\n\t\t...contract,\n\t\troots: filteredRoots,\n\t\tdomain: { namespaces: Object.fromEntries(Object.entries(contract.domain.namespaces).map(([namespaceId, namespaceSlice]) => [namespaceId, {\n\t\t\tmodels: Object.fromEntries(Object.entries(namespaceSlice.models).map(([modelName, model]) => [modelName, polymorphicModels[modelCoordinateKey(namespaceId, modelName)] ?? model])),\n\t\t\t...ifDefined(\"enum\", namespaceSlice.enum),\n\t\t\t...ifDefined(\"valueObjects\", namespaceSlice.valueObjects)\n\t\t}])) }\n\t});\n}\n//#endregion\nexport { normalizeReferentialAction as a, indexFkRelations as i, interpretPslDocumentToSqlContract as n, applyBackrelationCandidates as r, buildEntityTypesByDiscriminator as t };\n\n//#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0 @@
1
- {"version":3,"file":"validators-B9prRmOP.mjs","names":[],"sources":["../../../../2-sql/1-core/contract/dist/validators.mjs"],"sourcesContent":["import { t as contractError } from \"./contract-errors-BCN6RVI5.mjs\";\nimport { a as ColumnDefaultFunctionSchema, c as ForeignKeyReferenceSchema, d as IndexSchema, f as ReferentialActionSchema, i as CheckConstraintSchema, l as ForeignKeySchema, m as StorageValueSetSchema, o as ColumnDefaultLiteralSchema, p as StorageTableSchema, s as ColumnDefaultSchema, t as composeSqlEntityKinds, u as ForeignKeySourceSchema } from \"./entity-kinds-DDTkNIr9.mjs\";\nimport { a as sameColumns$1, s as startsWithColumns } from \"./index-equivalence-DswCiq5l.mjs\";\nimport { computeCheckContentHash, computeIndexContentHash } from \"@internal/sql-schema-ir/naming\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { isPlainRecord } from \"@internal/framework-components/ir\";\nimport { DATA_TYPE_ID_PATTERN } from \"@internal/framework-components/codec\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { type } from \"arktype\";\nimport { ContractValidationError } from \"@internal/contract/contract-validation-error\";\nimport { ContractExecutionSectionSchema, CrossReferenceSchema } from \"@internal/contract/types\";\nimport { validateContractDomain } from \"@internal/contract/validate-domain\";\nimport { canonicalizeJson } from \"@internal/framework-components/utils\";\n//#region src/default-sql-text.ts\nconst UNSAFE_DEFAULT_TEXT = /;|--|\\/\\*|\\$\\$|\\bSELECT\\b/i;\n/** Returns undefined when the text may be rendered as `DEFAULT (<text>)`, else the reason. */\nfunction checkSqlDefaultText(text) {\n\treturn UNSAFE_DEFAULT_TEXT.test(text) ? \"Default SQL must not contain semicolons, SQL comment tokens, dollar-quoting, or subqueries.\" : void 0;\n}\n/**\n* Names the Prisma default function that raw SQL text is exactly, ignoring surrounding whitespace. The planners treat the contract expressions `now()` and `autoincrement()` as those functions, so raw SQL with that text would not be used as written.\n*/\nfunction reservedSqlDefaultText(text) {\n\tswitch (text.trim()) {\n\t\tcase \"now()\": return \"now\";\n\t\tcase \"autoincrement()\": return \"autoincrement\";\n\t\tdefault: return;\n\t}\n}\n//#endregion\n//#region src/relation-storage.ts\nfunction sameColumns(left, right) {\n\treturn left.length === right.length && left.every((column, index) => column === right[index]);\n}\n/**\n* The storage facts behind a same-space to-one relation's nullability: which side owns the\n* foreign key, and whether each local column is nullable.\n*/\nfunction resolveSqlToOneRelationStorage(contract, modelStorage, relation) {\n\tconst table = blindCast(contract.storage.namespaces[modelStorage.namespaceId]?.entries.table?.[modelStorage.table]);\n\tconst columns = relation.on.localFields.map((fieldName) => {\n\t\tconst columnName = modelStorage.fields[fieldName]?.column;\n\t\tconst column = columnName === void 0 ? void 0 : table?.columns[columnName];\n\t\treturn {\n\t\t\tname: columnName ?? fieldName,\n\t\t\tnullable: column?.nullable ?? true\n\t\t};\n\t});\n\tconst columnNames = columns.map((column) => column.name);\n\treturn {\n\t\townsForeignKey: relation.cardinality === \"N:1\" || (table?.foreignKeys ?? []).some((foreignKey) => sameColumns(foreignKey.source.columns, columnNames)),\n\t\tcolumns\n\t};\n}\n//#endregion\n//#region src/validators.ts\nconst ControlPolicySchema = type(\"'managed' | 'tolerated' | 'external' | 'observed'\");\nconst DomainEnumRefSchema = type({\n\tplane: \"'domain'\",\n\tnamespaceId: \"string\",\n\tentityKind: \"'enum'\",\n\tentityName: \"string\",\n\t\"spaceId?\": \"string\"\n});\n/** Document-scoped `storage.types`: codec triples only. */\nconst DocumentScopedStorageTypeSchema = type.declare().type({\n\tkind: \"'codec-instance'\",\n\tcodecId: \"string\",\n\tdataType: DATA_TYPE_ID_PATTERN,\n\t\"typeParams?\": \"Record<string, unknown>\"\n});\n/**\n* Domain enum entry under `domain.namespaces[id].enum[name]`.\n* Carries the codec id and an ordered `members` array of `{name, value}` pairs.\n*/\nconst ContractEnumSchema = type({\n\t\"+\": \"reject\",\n\tcodecId: \"string\",\n\tmembers: type({\n\t\tname: \"string\",\n\t\tvalue: \"string | number | boolean | null | unknown[] | Record<string, unknown>\"\n\t}).array().readonly()\n});\n/**\n* Derives a schema map from a descriptor map: maps each kind's key to its\n* `schema` field. Used by validation functions to validate entries.\n*/\nfunction schemaViewOf(kinds) {\n\treturn new Map([...kinds].map(([k, d]) => [k, d.schema]));\n}\nconst DEFAULT_SQL_KINDS = composeSqlEntityKinds();\n/**\n* Builds the per-namespace entry schema for `storage.namespaces[id]`.\n*\n* Validation is descriptor-driven: the `kinds` map carries both the schema\n* (used here for structural validation) and the construct function (used at\n* hydration time). An unregistered key fails validation naming the kind and\n* the namespace id, so validation fails closed.\n*/\nfunction createNamespaceEntrySchema(kinds) {\n\tconst schemas = schemaViewOf(kinds);\n\tconst knownKinds = new Set(kinds.keys());\n\treturn type({\n\t\t\"+\": \"reject\",\n\t\tid: \"string\",\n\t\t\"kind?\": \"string\",\n\t\tentries: \"object\"\n\t}).narrow((ns, ctx) => {\n\t\tif (!isPlainRecord(ns.entries)) return ctx.mustBe(\"an entries object\");\n\t\tfor (const [key, innerMap] of Object.entries(ns.entries)) {\n\t\t\tif (!knownKinds.has(key)) return ctx.reject({ expected: `entries key \"${key}\" in namespace \"${ns.id}\" is not a registered entity kind` });\n\t\t\tif (!isPlainRecord(innerMap)) return ctx.reject({ expected: `entries[\"${key}\"] in namespace \"${ns.id}\" must be an object` });\n\t\t\tconst entrySchema = blindCast(schemas.get(key));\n\t\t\tfor (const [, value] of Object.entries(innerMap)) {\n\t\t\t\tconst parsed = entrySchema(value);\n\t\t\t\tif (parsed instanceof type.errors) return ctx.reject({ expected: parsed.summary });\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t});\n}\n/**\n* Builds the storage schema. Pack contributions reach the per-namespace\n* entry shape through {@link createNamespaceEntrySchema}; the\n* document-scoped `storage.types` field (codec triples only) and the\n* storage hash stay family-shared.\n*/\nfunction createSqlStorageSchema(kinds) {\n\tconst namespaceEntry = createNamespaceEntrySchema(kinds);\n\treturn type({\n\t\t\"+\": \"reject\",\n\t\tstorageHash: \"string\",\n\t\t\"types?\": type({ \"[string]\": DocumentScopedStorageTypeSchema }),\n\t\t\"namespaces?\": type({ \"[string]\": namespaceEntry })\n\t});\n}\nconst StorageSchema = createSqlStorageSchema(DEFAULT_SQL_KINDS);\n/** The refusal of a value-object column when the stack declares no value-object storage type. */\nfunction valueObjectStorageTypeMissingMessage(columnPath) {\n\treturn `${columnPath}: a value-object column needs the stack's value-object storage type, and the stack declares none`;\n}\nconst LISTED_STORED_TYPE_NAMES = 5;\nfunction fieldOf(value, key) {\n\treturn isPlainRecord(value) ? value[key] : void 0;\n}\nfunction entriesOf(value) {\n\treturn isPlainRecord(value) ? Object.entries(value) : [];\n}\nfunction storedTypeNamePaths(storage) {\n\tconst columns = entriesOf(fieldOf(storage, \"namespaces\")).flatMap(([namespaceId, namespace]) => entriesOf(fieldOf(fieldOf(namespace, \"entries\"), \"table\")).flatMap(([tableName, table]) => entriesOf(fieldOf(table, \"columns\")).map(([columnName, column]) => ({\n\t\tpath: `storage.namespaces.${namespaceId}.entries.table.${tableName}.columns.${columnName}`,\n\t\tentry: column\n\t}))));\n\tconst types = entriesOf(fieldOf(storage, \"types\")).map(([typeName, entry]) => ({\n\t\tpath: `storage.types.${typeName}`,\n\t\tentry\n\t}));\n\treturn [...columns, ...types].filter(({ entry }) => isPlainRecord(entry) && Object.hasOwn(entry, \"nativeType\")).map(({ path }) => path);\n}\n/**\n* Contracts emitted before a column named its data type stored the database type name in `nativeType` on columns and `storage.types` entries. The first five such keys are reported with their paths and the rest are counted, so an old contract is refused with a short message that says what changed.\n*/\nfunction storedTypeNameProblems(storage) {\n\tconst paths = storedTypeNamePaths(storage);\n\tconst listed = paths.slice(0, LISTED_STORED_TYPE_NAMES).map((path) => `${path}.nativeType: contracts no longer store a column's database type name; the column names its data type in \"dataType\"`);\n\tconst unlisted = paths.length - listed.length;\n\treturn unlisted > 0 ? [...listed, `and ${unlisted} more ${unlisted === 1 ? \"path\" : \"paths\"} (${paths.length} in all)`] : listed;\n}\n/**\n* Any entries entity that declares both a `tableName` and a physical `name`\n* (e.g. a target's RLS policy entities) shares one physical-name space per\n* table: two such entries of one kind on the same table would collide as\n* DDL (`CREATE POLICY \"<name>\" ON <table>` fails on the second), while the\n* same name on different tables is legal. Structural — no entry-kind\n* vocabulary; `table` entries are keyed by name already and are excluded.\n*/\nfunction validateTableScopedEntryNames(storage, errors) {\n\tfor (const [namespaceId, ns] of Object.entries(storage.namespaces)) {\n\t\tif (!isPlainRecord(ns.entries)) continue;\n\t\tfor (const [entriesKind, slot] of Object.entries(ns.entries)) {\n\t\t\tif (entriesKind === \"table\" || !isPlainRecord(slot)) continue;\n\t\t\tconst seen = /* @__PURE__ */ new Map();\n\t\t\tfor (const entity of Object.values(slot)) {\n\t\t\t\tif (typeof entity !== \"object\" || entity === null) continue;\n\t\t\t\tconst record = blindCast(entity);\n\t\t\t\tconst name = record[\"name\"];\n\t\t\t\tconst tableName = record[\"tableName\"];\n\t\t\t\tif (typeof name !== \"string\" || typeof tableName !== \"string\") continue;\n\t\t\t\tconst key = JSON.stringify([tableName, name]);\n\t\t\t\tseen.set(key, (seen.get(key) ?? 0) + 1);\n\t\t\t\tif (seen.get(key) === 2) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": ${entriesKind} \"${name}\" is declared multiple times`);\n\t\t\t}\n\t\t}\n\t}\n}\nfunction eachStorageTable(storage) {\n\treturn Object.entries(storage.namespaces).flatMap(([namespaceId, ns]) => Object.entries(ns.entries[\"table\"] ?? {}).map(([tableName, table]) => ({\n\t\tnamespaceId,\n\t\ttableName,\n\t\ttable\n\t})));\n}\nfunction findDuplicateValue(values) {\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const value of values) {\n\t\tif (seen.has(value)) return value;\n\t\tseen.add(value);\n\t}\n}\n/** A column may appear at most once in one index's element tuple. */\nfunction rejectRepeatedIndexColumns(indexes, coordinate, errors) {\n\tfor (const index of indexes) {\n\t\tconst duplicateColumn = findDuplicateValue(index.columns ?? []);\n\t\tif (duplicateColumn !== void 0) errors.push(`${coordinate}: index contains duplicate column \"${duplicateColumn}\"`);\n\t}\n}\n/**\n* Two wire-named indexes with the same content are one index written twice —\n* the content hash is their identity, so neither spelling can survive. An\n* exact-named index is identified by its name instead, so content twins under\n* two names are legal and a repeated name is rejected by the named-object\n* check.\n*/\nfunction rejectDuplicateWireNamedIndexContent(indexes, coordinate, errors) {\n\tconst seenContent = /* @__PURE__ */ new Set();\n\tfor (const index of indexes) {\n\t\tif (index.prefix === void 0) continue;\n\t\tconst content = computeIndexContentHash(index);\n\t\tif (seenContent.has(content)) {\n\t\t\terrors.push(`${coordinate}: duplicate index definition on columns [${(index.columns ?? []).join(\", \")}]`);\n\t\t\tcontinue;\n\t\t}\n\t\tseenContent.add(content);\n\t}\n}\n/**\n* Two wire-named checks with the same predicate are one check written twice —\n* the content hash is their identity, so neither spelling can survive, and\n* whitespace variants of one predicate collapse onto the same hash. An\n* exact-named check is identified by its name instead, so content twins under\n* two names are legal (the legacy shape a database adopts from) and a repeated\n* name is rejected by the named-object check.\n*/\nfunction rejectDuplicateWireNamedCheckContent(checks, coordinate, errors) {\n\tconst seenContent = /* @__PURE__ */ new Set();\n\tfor (const check of checks) {\n\t\tif (check.prefix === void 0) continue;\n\t\tconst content = computeCheckContentHash(check.expression);\n\t\tif (seenContent.has(content)) {\n\t\t\terrors.push(`${coordinate}: duplicate check constraint definition (expression \"${check.expression}\")`);\n\t\t\tcontinue;\n\t\t}\n\t\tseenContent.add(content);\n\t}\n}\nfunction isContractFieldType(value) {\n\tif (!isPlainRecord(value)) return false;\n\tconst kind = value[\"kind\"];\n\tif (kind === \"scalar\") {\n\t\tif (typeof value[\"codecId\"] !== \"string\") return false;\n\t\tconst typeParams = value[\"typeParams\"];\n\t\tif (typeParams !== void 0 && !isPlainRecord(typeParams)) return false;\n\t\treturn true;\n\t}\n\tif (kind === \"valueObject\") return typeof value[\"name\"] === \"string\";\n\tif (kind === \"union\") {\n\t\tconst members = value[\"members\"];\n\t\tif (!Array.isArray(members)) return false;\n\t\treturn members.every((m) => isContractFieldType(m));\n\t}\n\treturn false;\n}\nconst ModelFieldSchema = type({\n\t\"+\": \"reject\",\n\tnullable: \"boolean\",\n\ttype: type(\"unknown\").narrow((value, ctx) => isContractFieldType(value) ? true : ctx.mustBe(\"scalar, valueObject, or union field type\")),\n\tmany: type(\"false\").or({\n\t\t\"+\": \"reject\",\n\t\telementNullable: \"boolean\"\n\t}).default(false),\n\t\"dict?\": \"true\",\n\t\"valueSet?\": DomainEnumRefSchema\n});\nconst ModelStorageSchema = type({\n\ttable: \"string\",\n\tnamespaceId: \"string\",\n\tfields: type({ \"[string]\": type({\n\t\tcolumn: \"string\",\n\t\t\"codecId?\": \"string\",\n\t\t\"nullable?\": \"boolean\"\n\t}) })\n});\nconst ContractRelationThroughSchema = type({\n\t\"+\": \"reject\",\n\ttable: \"string\",\n\tnamespaceId: \"string\",\n\tparentColumns: type.string.array().readonly(),\n\tchildColumns: type.string.array().readonly(),\n\ttargetColumns: type.string.array().readonly()\n});\nconst ContractRelationOnSchema = type({\n\t\"+\": \"reject\",\n\tlocalFields: type.string.array().readonly(),\n\ttargetFields: type.string.array().readonly()\n});\nconst ContractManyToManyRelationSchema = type({\n\t\"+\": \"reject\",\n\tto: CrossReferenceSchema,\n\tcardinality: \"'N:M'\",\n\ton: ContractRelationOnSchema,\n\tthrough: ContractRelationThroughSchema\n});\nconst ContractToOneRelationSchema = type({\n\t\"+\": \"reject\",\n\tto: CrossReferenceSchema,\n\tcardinality: \"'1:1' | 'N:1'\",\n\t\"nullable?\": \"boolean\",\n\ton: ContractRelationOnSchema\n});\nconst ContractToManyRelationSchema = type({\n\t\"+\": \"reject\",\n\tto: CrossReferenceSchema,\n\tcardinality: \"'1:N'\",\n\ton: ContractRelationOnSchema\n});\nconst ContractReferenceRelationSchema = ContractManyToManyRelationSchema.or(ContractToOneRelationSchema).or(ContractToManyRelationSchema);\nconst ContractEmbedRelationSchema = type({\n\t\"+\": \"reject\",\n\tto: CrossReferenceSchema,\n\tcardinality: \"'1:1' | '1:N'\"\n});\nconst ContractRelationSchema = ContractReferenceRelationSchema.or(ContractEmbedRelationSchema);\nconst ModelSchema = type({\n\tstorage: ModelStorageSchema,\n\t\"fields?\": type({ \"[string]\": ModelFieldSchema }),\n\t\"relations?\": type({ \"[string]\": ContractRelationSchema }),\n\t\"discriminator?\": \"unknown\",\n\t\"variants?\": \"unknown\",\n\t\"base?\": CrossReferenceSchema,\n\t\"owner?\": \"string\"\n});\nconst ContractMetaSchema = type({ \"[string]\": \"unknown\" });\n/**\n* Builds the full SQL contract schema. The storage subtree threads\n* pack contributions through {@link createSqlStorageSchema}; the rest\n* of the contract envelope is family-shared.\n*/\nfunction createSqlContractSchema(kinds) {\n\tconst storage = createSqlStorageSchema(kinds);\n\treturn type({\n\t\t\"+\": \"reject\",\n\t\ttarget: \"string\",\n\t\ttargetFamily: \"'sql'\",\n\t\t\"coreHash?\": \"string\",\n\t\tprofileHash: \"string\",\n\t\t\"capabilities?\": \"Record<string, Record<string, boolean>>\",\n\t\t\"extensions?\": \"Record<string, unknown>\",\n\t\t\"meta?\": ContractMetaSchema,\n\t\t\"defaultControlPolicy?\": ControlPolicySchema,\n\t\t\"roots?\": type({ \"[string]\": CrossReferenceSchema }),\n\t\tdomain: type({ namespaces: type({ \"[string]\": type({\n\t\t\tmodels: type({ \"[string]\": ModelSchema }),\n\t\t\t\"valueObjects?\": type({ \"[string]\": type({ fields: type({ \"[string]\": ModelFieldSchema }) }) }),\n\t\t\t\"enum?\": type({ \"[string]\": ContractEnumSchema })\n\t\t}) }) }),\n\t\tstorage,\n\t\t\"execution?\": ContractExecutionSectionSchema\n\t});\n}\nconst SqlContractSchema = createSqlContractSchema(DEFAULT_SQL_KINDS);\n/**\n* Validates the structural shape of SqlStorage using Arktype. Pure\n* structural check: namespace IR is never materialized here (that needs\n* a target concretion via the serializer hydration path), so this throws\n* on invalid input and constructs nothing.\n*\n* @param value - The storage value to validate\n* @throws Error if the storage structure is invalid\n*/\nfunction validateStorage(value) {\n\tconst storedTypeNames = storedTypeNameProblems(value);\n\tconst result = StorageSchema(value);\n\tconst errors = storedTypeNames.length > 0 ? [...storedTypeNames] : result instanceof type.errors ? result.map((p) => p.message) : [];\n\tif (errors.length > 0) throw contractError(\"CONTRACT.VALIDATION_FAILED\", `Storage validation failed: ${errors.join(\"; \")}`, { meta: { errors } });\n}\nfunction validateModel(value) {\n\tconst result = ModelSchema(value);\n\tif (result instanceof type.errors) {\n\t\tconst errors = result.map((p) => p.message);\n\t\tthrow contractError(\"CONTRACT.VALIDATION_FAILED\", `Model validation failed: ${errors.join(\"; \")}`, { meta: { errors } });\n\t}\n\treturn result;\n}\n/**\n* Structural arktype validation of an SQL contract envelope. Internal\n* helper for {@link validateSqlContractFully} — exposed only inside\n* this module, since the family seam-of-record is the\n* `SqlContractSerializerBase.deserializeContract` SPI.\n*/\nfunction validateSqlContractStructure(value, contractSchema) {\n\tif (typeof value !== \"object\" || value === null) throw new ContractValidationError(\"Contract structural validation failed: value must be an object\", \"structural\");\n\tconst targetFamily = \"targetFamily\" in value ? value.targetFamily : void 0;\n\tif (targetFamily !== void 0 && targetFamily !== \"sql\") throw new ContractValidationError(`Unsupported target family: ${targetFamily}`, \"structural\");\n\tconst storedTypeNames = storedTypeNameProblems(fieldOf(value, \"storage\"));\n\tif (storedTypeNames.length > 0) throw new ContractValidationError(`Contract structural validation failed: ${storedTypeNames.join(\"; \")}`, \"structural\");\n\tconst contractResult = contractSchema(value);\n\tif (contractResult instanceof type.errors) throw new ContractValidationError(`Contract structural validation failed: ${contractResult.map((p) => p.message).join(\"; \")}`, \"structural\");\n\treturn blindCast(contractResult);\n}\nfunction foreignKeyBackingError(table, fk) {\n\tconst { index } = fk;\n\tif (index === void 0) return void 0;\n\tconst columns = fk.source.columns;\n\tif (\"name\" in index) {\n\t\tconst named = table.indexes.find((candidate) => candidate.name === index.name);\n\t\tif (named === void 0) return `is indexed by \"${index.name}\", but the table has no index with that name`;\n\t\treturn named.columns !== void 0 && startsWithColumns(named.columns, columns) ? void 0 : `is indexed by \"${index.name}\", but that index does not start with those columns`;\n\t}\n\tif (\"primaryKey\" in index) return table.primaryKey !== void 0 && startsWithColumns(table.primaryKey.columns, columns) ? void 0 : \"is indexed by the primary key, but the table's primary key does not start with those columns\";\n\tconst described = `the unique constraint on [${index.unique.join(\", \")}]`;\n\tif (!table.uniques.some((unique) => sameColumns$1(unique.columns, index.unique))) return `is indexed by ${described}, but the table has no unique constraint on those columns`;\n\treturn startsWithColumns(index.unique, columns) ? void 0 : `is indexed by ${described}, which does not start with those columns`;\n}\n/**\n* Validates semantic constraints on SqlStorage that cannot be expressed in Arktype schemas.\n*\n* Returns an array of human-readable error strings. Empty array = valid.\n*\n* Currently checks:\n* - duplicate named primary key / unique / index / foreign key objects within a table\n* - duplicate unique, index, or foreign key declarations within a table\n* - duplicate columns within primary key / unique / index definitions\n* - nullable columns in primary key definitions\n* - `setNull` referential action on a non-nullable FK column (would fail at runtime)\n* - `setDefault` referential action on a non-nullable FK column without a DEFAULT (would fail at runtime)\n* - a foreign key whose `index` is an index, primary key or unique constraint its table does not have\n*/\nfunction validateStorageSemantics(storage) {\n\tconst errors = [];\n\tvalidateTableScopedEntryNames(storage, errors);\n\tfor (const { namespaceId, tableName, table: rawTable } of eachStorageTable(storage)) {\n\t\tconst table = blindCast(rawTable);\n\t\tconst namedObjects = /* @__PURE__ */ new Map();\n\t\tconst registerNamedObject = (kind, name) => {\n\t\t\tif (!name) return;\n\t\t\tnamedObjects.set(name, [...namedObjects.get(name) ?? [], kind]);\n\t\t};\n\t\tregisterNamedObject(\"primary key\", table.primaryKey?.name);\n\t\tfor (const unique of table.uniques) registerNamedObject(\"unique constraint\", unique.name);\n\t\tfor (const index of table.indexes) registerNamedObject(\"index\", index.name);\n\t\tfor (const fk of table.foreignKeys) registerNamedObject(\"foreign key\", fk.name);\n\t\tfor (const check of table.checks ?? []) registerNamedObject(\"check constraint\", check.name);\n\t\tfor (const [name, kinds] of namedObjects) if (kinds.length > 1) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": named object \"${name}\" is declared multiple times (${kinds.join(\", \")})`);\n\t\tif (table.primaryKey) {\n\t\t\tconst duplicateColumn = findDuplicateValue(table.primaryKey.columns);\n\t\t\tif (duplicateColumn !== void 0) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": primary key contains duplicate column \"${duplicateColumn}\"`);\n\t\t\tfor (const columnName of table.primaryKey.columns) if (table.columns[columnName]?.nullable === true) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": primary key column \"${columnName}\" is nullable; primary key columns must be NOT NULL`);\n\t\t}\n\t\tconst seenUniqueDefinitions = /* @__PURE__ */ new Set();\n\t\tfor (const unique of table.uniques) {\n\t\t\tconst duplicateColumn = findDuplicateValue(unique.columns);\n\t\t\tif (duplicateColumn !== void 0) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": unique constraint contains duplicate column \"${duplicateColumn}\"`);\n\t\t\tconst signature = JSON.stringify({ columns: unique.columns });\n\t\t\tif (seenUniqueDefinitions.has(signature)) {\n\t\t\t\terrors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": duplicate unique constraint definition on columns [${unique.columns.join(\", \")}]`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tseenUniqueDefinitions.add(signature);\n\t\t}\n\t\tconst tableCoordinate = `Namespace \"${namespaceId}\" table \"${tableName}\"`;\n\t\trejectRepeatedIndexColumns(table.indexes, tableCoordinate, errors);\n\t\trejectDuplicateWireNamedIndexContent(table.indexes, tableCoordinate, errors);\n\t\tfor (const fk of table.foreignKeys) {\n\t\t\tconst error = foreignKeyBackingError(table, fk);\n\t\t\tif (error !== void 0) errors.push(`${tableCoordinate}: foreign key on columns [${fk.source.columns.join(\", \")}] ${error}`);\n\t\t}\n\t\tconst seenForeignKeyDefinitions = /* @__PURE__ */ new Set();\n\t\tfor (const fk of table.foreignKeys) {\n\t\t\tconst signature = JSON.stringify({\n\t\t\t\tsource: fk.source,\n\t\t\t\ttarget: fk.target,\n\t\t\t\tonDelete: fk.onDelete ?? null,\n\t\t\t\tonUpdate: fk.onUpdate ?? null\n\t\t\t});\n\t\t\tif (seenForeignKeyDefinitions.has(signature)) {\n\t\t\t\terrors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": duplicate foreign key definition on columns [${fk.source.columns.join(\", \")}]`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tseenForeignKeyDefinitions.add(signature);\n\t\t}\n\t\tfor (const fk of table.foreignKeys) for (const colName of fk.source.columns) {\n\t\t\tconst column = table.columns[colName];\n\t\t\tif (!column) continue;\n\t\t\tif (fk.onDelete === \"setNull\" && !column.nullable) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": onDelete setNull on foreign key column \"${colName}\" which is NOT NULL`);\n\t\t\tif (fk.onUpdate === \"setNull\" && !column.nullable) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": onUpdate setNull on foreign key column \"${colName}\" which is NOT NULL`);\n\t\t\tif (fk.onDelete === \"setDefault\" && !column.nullable && column.default === void 0) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": onDelete setDefault on foreign key column \"${colName}\" which is NOT NULL and has no DEFAULT`);\n\t\t\tif (fk.onUpdate === \"setDefault\" && !column.nullable && column.default === void 0) errors.push(`Namespace \"${namespaceId}\" table \"${tableName}\": onUpdate setDefault on foreign key column \"${colName}\" which is NOT NULL and has no DEFAULT`);\n\t\t}\n\t\trejectDuplicateWireNamedCheckContent(table.checks ?? [], tableCoordinate, errors);\n\t}\n\treturn errors;\n}\n/**\n* SQL storage logical-consistency checks: every model.storage.table resolves to a real table, every domain field has a model.storage.fields entry, and every model.storage.fields[*].column resolves to a real column. Throws `ContractValidationError` on the first mismatch.\n*/\nfunction validateModelStorageReferences(contract) {\n\tfor (const [namespaceId, namespace] of Object.entries(contract.domain.namespaces)) for (const [modelName, model] of Object.entries(namespace.models)) {\n\t\tconst modelStorage = blindCast(model.storage);\n\t\tconst qualifiedName = `${namespaceId}:${modelName}`;\n\t\tconst storageNamespaceId = modelStorage.namespaceId;\n\t\tif (storageNamespaceId !== namespaceId) throw new ContractValidationError(`Model \"${qualifiedName}\" storage.namespaceId \"${storageNamespaceId}\" does not match domain namespace \"${namespaceId}\"`, \"storage\");\n\t\tconst storageTable = modelStorage.table;\n\t\tconst rawTable = contract.storage.namespaces[storageNamespaceId]?.entries.table?.[storageTable];\n\t\tif (rawTable === void 0) throw new ContractValidationError(`Model \"${qualifiedName}\" references non-existent table \"${storageNamespaceId}.${storageTable}\"`, \"storage\");\n\t\tconst table = blindCast(rawTable);\n\t\tfor (const fieldName of Object.keys(model.fields)) if (!Object.hasOwn(modelStorage.fields, fieldName)) throw new ContractValidationError(`Model \"${qualifiedName}\" field \"${fieldName}\" has no entry in storage.fields, so no column holds it`, \"storage\");\n\t\tconst columnNames = new Set(Object.keys(table.columns));\n\t\tfor (const [fieldName, field] of Object.entries(modelStorage.fields)) if (!columnNames.has(field.column)) throw new ContractValidationError(`Model \"${qualifiedName}\" field \"${fieldName}\" references non-existent column \"${field.column}\" in table \"${storageTable}\"`, \"storage\");\n\t}\n}\n/** The names of a model's own fields and of the fields it inherits from its base models. */\nfunction fieldNamesWithInherited(contract, namespaceId, modelName) {\n\tconst names = /* @__PURE__ */ new Set();\n\tconst seen = /* @__PURE__ */ new Set();\n\tlet coordinate = {\n\t\tnamespace: namespaceId,\n\t\tmodel: modelName\n\t};\n\twhile (coordinate !== void 0) {\n\t\tconst key = JSON.stringify([coordinate.namespace, coordinate.model]);\n\t\tif (seen.has(key)) break;\n\t\tseen.add(key);\n\t\tconst model = contract.domain.namespaces[coordinate.namespace]?.models[coordinate.model];\n\t\tif (model === void 0) break;\n\t\tfor (const name of Object.keys(model.fields)) names.add(name);\n\t\tcoordinate = model.base;\n\t}\n\treturn names;\n}\n/**\n* Every relation joins on fields: its local fields are fields of the model that declares it, and its target fields are fields of the target model. The target side of a many-to-many relation names columns of its junction table instead. A cross-space relation's target is in another contract, so its target side is not checked. Throws `ContractValidationError` on the first name that is not a field.\n*/\nfunction validateRelationJoinFields(contract) {\n\tfor (const [namespaceId, namespace] of Object.entries(contract.domain.namespaces)) for (const [modelName, model] of Object.entries(namespace.models)) for (const [relationName, relation] of Object.entries(model.relations)) {\n\t\tif (!(\"on\" in relation)) continue;\n\t\tconst location = `Relation \"${relationName}\" on model \"${namespaceId}:${modelName}\"`;\n\t\tconst localFields = fieldNamesWithInherited(contract, namespaceId, modelName);\n\t\tfor (const field of relation.on.localFields) if (!localFields.has(field)) throw new ContractValidationError(`${location} joins on \"${field}\", which is not a field of model \"${namespaceId}:${modelName}\"`, \"domain\");\n\t\tif (relation.cardinality === \"N:M\") {\n\t\t\tconst { namespaceId: junctionNamespaceId, table: junctionTable } = relation.through;\n\t\t\tfor (const column of relation.on.targetFields) if (!lookupStorageColumn(contract, junctionNamespaceId, junctionTable, column)) throw new ContractValidationError(`${location} joins on \"${column}\", which is not a column of junction table \"${junctionNamespaceId}.${junctionTable}\"`, \"domain\");\n\t\t\tcontinue;\n\t\t}\n\t\tif (relation.to.space !== void 0) continue;\n\t\tconst targetFields = fieldNamesWithInherited(contract, relation.to.namespace, relation.to.model);\n\t\tfor (const field of relation.on.targetFields) if (!targetFields.has(field)) throw new ContractValidationError(`${location} joins on \"${field}\", which is not a field of model \"${relation.to.namespace}:${relation.to.model}\"`, \"domain\");\n\t}\n}\n/**\n* Every execution default targets a column some model's field maps: an execution default is declared on a field, and it belongs to that field. Throws `ContractValidationError` on the first default on a column no field maps.\n*/\nfunction validateExecutionDefaultsTargetMappedColumns(contract) {\n\tconst mappedColumns = /* @__PURE__ */ new Set();\n\tfor (const namespace of Object.values(contract.domain.namespaces)) for (const model of Object.values(namespace.models)) {\n\t\tconst modelStorage = blindCast(model.storage);\n\t\tfor (const field of Object.values(modelStorage.fields)) mappedColumns.add(JSON.stringify([\n\t\t\tmodelStorage.namespaceId,\n\t\t\tmodelStorage.table,\n\t\t\tfield.column\n\t\t]));\n\t}\n\tfor (const { ref } of contract.execution?.mutations.defaults ?? []) if (!mappedColumns.has(JSON.stringify([\n\t\tref.namespace,\n\t\tref.entry,\n\t\tref.field\n\t]))) throw new ContractValidationError(`Execution default for column \"${ref.field}\" of table \"${ref.namespace}.${ref.entry}\" targets a column no field maps; execution defaults are declared on fields. Give the column a database default instead.`, \"storage\");\n}\n/**\n* Cross-table consistency checks for SQL storage: primary key, unique,\n* index, and foreign key column references resolve to real columns;\n* NOT NULL columns don't carry a literal `null` default; FK column\n* counts match their referenced columns. Throws on the first mismatch.\n*/\nfunction validateSqlStorageConsistency(contract) {\n\tfor (const { namespaceId, tableName, table: rawTable } of eachStorageTable(contract.storage)) {\n\t\tconst table = blindCast(rawTable);\n\t\tconst columnNames = new Set(Object.keys(table.columns));\n\t\tif (table.primaryKey) {\n\t\t\tfor (const colName of table.primaryKey.columns) if (!columnNames.has(colName)) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" primaryKey references non-existent column \"${colName}\"`, \"storage\");\n\t\t}\n\t\tfor (const unique of table.uniques) for (const colName of unique.columns) if (!columnNames.has(colName)) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" unique constraint references non-existent column \"${colName}\"`, \"storage\");\n\t\tfor (const index of table.indexes) for (const colName of index.columns ?? []) if (!columnNames.has(colName)) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" index references non-existent column \"${colName}\"`, \"storage\");\n\t\tfor (const [colName, column] of Object.entries(table.columns)) if (!column.nullable && column.default?.kind === \"literal\" && column.default.value === null) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" column \"${colName}\" is NOT NULL but has a literal null default`, \"storage\");\n\t\tfor (const fk of table.foreignKeys) {\n\t\t\tif (fk.source.namespaceId !== namespaceId || fk.source.tableName !== tableName) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" contains foreignKey with mismatched source coordinates (${fk.source.namespaceId}.${fk.source.tableName})`, \"storage\");\n\t\t\tfor (const colName of fk.source.columns) if (!columnNames.has(colName)) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" foreignKey references non-existent column \"${colName}\"`, \"storage\");\n\t\t\tif (fk.target.spaceId === void 0) {\n\t\t\t\tconst referencedRaw = contract.storage.namespaces[fk.target.namespaceId]?.entries.table?.[fk.target.tableName];\n\t\t\t\tif (referencedRaw === void 0) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" foreignKey references non-existent table \"${fk.target.namespaceId}.${fk.target.tableName}\"`, \"storage\");\n\t\t\t\tconst referencedTable = blindCast(referencedRaw);\n\t\t\t\tconst referencedColumnNames = new Set(Object.keys(referencedTable.columns));\n\t\t\t\tfor (const colName of fk.target.columns) if (!referencedColumnNames.has(colName)) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" foreignKey references non-existent column \"${colName}\" in table \"${fk.target.tableName}\"`, \"storage\");\n\t\t\t}\n\t\t\tif (fk.source.columns.length !== fk.target.columns.length) throw new ContractValidationError(`Namespace \"${namespaceId}\" table \"${tableName}\" foreignKey column count (${fk.source.columns.length}) does not match referenced column count (${fk.target.columns.length})`, \"storage\");\n\t\t}\n\t}\n}\n/**\n* Full SQL contract validation: structural (arktype) +\n* framework-shared domain + SQL storage logical-consistency + SQL\n* storage semantic + model ↔ storage reference checks. Throws\n* `ContractValidationError` on the first failure. Returns the\n* validated flat-data shape; IR class hydration happens in the SPI\n* base on top of this helper.\n*/\nfunction validateSqlContractFully(value, options) {\n\tconst validated = validateSqlContractStructure(typeof value === \"object\" && value !== null ? (() => {\n\t\tconst { schemaVersion: _, _generated: _g, ...rest } = blindCast(value);\n\t\treturn rest;\n\t})() : value, options?.contractSchema ?? SqlContractSchema);\n\tvalidateContractDomain({\n\t\troots: validated.roots,\n\t\tdomain: validated.domain\n\t});\n\tvalidateSqlStorageConsistency(validated);\n\tconst semanticErrors = validateStorageSemantics(validated.storage);\n\tif (semanticErrors.length > 0) throw new ContractValidationError(`Contract semantic validation failed: ${semanticErrors.join(\"; \")}`, \"storage\");\n\tvalidateModelStorageReferences(validated);\n\tvalidateExecutionDefaultsTargetMappedColumns(validated);\n\tvalidateRelationJoinFields(validated);\n\tvalidateRelationThroughConsistency(validated);\n\tvalidateToOneRelationNullabilityAgainstStorage(validated);\n\treturn validated;\n}\n/**\n* A same-space to-one relation that states `nullable` must agree with its local FK columns:\n* nullable exactly when one of them is nullable (a column that cannot be resolved counts as\n* nullable). A relation without the flag is left to hydration, which derives it the same way.\n*/\nfunction validateToOneRelationNullabilityAgainstStorage(contract) {\n\tfor (const [namespaceId, namespace] of Object.entries(contract.domain.namespaces)) for (const [modelName, model] of Object.entries(namespace.models)) {\n\t\tconst storage = blindCast(model.storage);\n\t\tfor (const [relationName, relation] of Object.entries(model.relations)) {\n\t\t\tif (!(\"on\" in relation && (relation.cardinality === \"1:1\" || relation.cardinality === \"N:1\") && relation.to.space === void 0) || relation.nullable === void 0) continue;\n\t\t\tconst location = `Relation \"${relationName}\" on model \"${namespaceId}:${modelName}\"`;\n\t\t\tconst { ownsForeignKey, columns } = resolveSqlToOneRelationStorage(contract, storage, relation);\n\t\t\tif (!ownsForeignKey) {\n\t\t\t\tif (relation.nullable) continue;\n\t\t\t\tthrow new ContractValidationError(`${location} is required but does not own the foreign key, so nothing in storage guarantees the related row exists`, \"storage\");\n\t\t\t}\n\t\t\tconst anyNullable = columns.some((column) => column.nullable);\n\t\t\tif (relation.nullable === anyNullable) continue;\n\t\t\tconst columnList = columns.filter((column) => column.nullable !== relation.nullable).map((column) => `\"${column.name}\"`).join(\", \");\n\t\t\tthrow new ContractValidationError(relation.nullable ? `${location} is nullable but every local FK column is NOT NULL (columns ${columnList})` : `${location} is required but a local FK column is nullable (columns ${columnList})`, \"storage\");\n\t\t}\n\t}\n}\n/** Storage column lookup for through-consistency validation. */\nfunction lookupStorageColumn(contract, namespaceId, tableName, columnName) {\n\tconst rawTable = contract.storage.namespaces[namespaceId]?.entries.table?.[tableName];\n\tif (rawTable === void 0) return;\n\treturn blindCast(rawTable).columns[columnName];\n}\n/**\n* Two storage columns share a type when their `dataType` and `typeParams` match. `codecId` and\n* `nullable` are not compared: they do not change the database type that governs a join.\n*/\nfunction sameStorageType(a, b) {\n\treturn a.dataType === b.dataType && canonicalizeJson(a.typeParams ?? {}) === canonicalizeJson(b.typeParams ?? {});\n}\nfunction describeColumnType(column) {\n\treturn column.typeParams === void 0 ? column.dataType : `${column.dataType} ${canonicalizeJson(column.typeParams)}`;\n}\n/**\n* Validates one side of an N:M join: the junction columns and the model\n* columns they pair against positionally must be equal in number, exist in\n* their tables, and share the same storage type (`dataType` + `typeParams`).\n* The junction's storage foreign keys already guarantee this for user-declared\n* FK constraints, but `through` is a logical descriptor never tied to them by\n* the rest of validation — and the TS builder accepts explicit join columns\n* without requiring a junction FK at all — so this checks the columns directly\n* against storage, one path regardless of how the junction was authored.\n*\n* Joined columns must be the *same* storage type, not merely compatible:\n* relying on implicit conversion (e.g. `text`↔`character`) is unsafe on writes\n* — `character(n)` space-padding makes such coercions non-associative — and no\n* ADR sanctions heterogeneous junction columns. Equality is the conservative\n* default; it can be relaxed deliberately if a real use case ever appears.\n*/\nfunction validateThroughJoinSide(input) {\n\tconst fail = (detail) => new ContractValidationError(`Many-to-many relation \"${input.qualifiedName}\" ${detail}`, \"storage\");\n\tif (input.junctionColumns.length !== input.modelColumns.length) throw fail(`pairs ${input.junctionColumnsLabel} (${input.junctionColumns.length}) with ${input.modelColumnsLabel} (${input.modelColumns.length}) of differing length; they join positionally and must match.`);\n\tfor (const [index, junctionColumnName] of input.junctionColumns.entries()) {\n\t\tconst modelColumnRef = input.modelColumns[index];\n\t\tif (modelColumnRef === void 0) continue;\n\t\tconst junctionColumn = lookupStorageColumn(input.contract, input.junctionNamespaceId, input.junctionTable, junctionColumnName);\n\t\tif (junctionColumn === void 0) throw fail(`${input.junctionColumnsLabel} references column \"${junctionColumnName}\" absent from junction table \"${input.junctionNamespaceId}.${input.junctionTable}\".`);\n\t\tconst model = input.model;\n\t\tif (model === void 0) continue;\n\t\tlet modelColumnName = modelColumnRef;\n\t\tif (model.fieldToColumn !== void 0) {\n\t\t\tconst mapped = model.fieldToColumn[modelColumnRef];\n\t\t\tif (mapped === void 0) throw fail(`${input.modelColumnsLabel} references field \"${modelColumnRef}\" absent from model on table \"${model.namespaceId}.${model.table}\".`);\n\t\t\tmodelColumnName = mapped.column;\n\t\t}\n\t\tconst modelColumn = lookupStorageColumn(input.contract, model.namespaceId, model.table, modelColumnName);\n\t\tif (modelColumn === void 0) throw fail(`${input.modelColumnsLabel} references column \"${modelColumnName}\" absent from table \"${model.namespaceId}.${model.table}\".`);\n\t\tif (!sameStorageType(junctionColumn, modelColumn)) throw fail(`joins \"${input.junctionTable}.${junctionColumnName}\" (${describeColumnType(junctionColumn)}) with \"${model.table}.${modelColumnName}\" (${describeColumnType(modelColumn)}) of differing storage type; junction columns must match the type of the column they reference.`);\n\t}\n}\n/**\n* Validates that every N:M relation's `through` descriptor is consistent with\n* the storage columns it joins: both join sides match in column count,\n* reference columns that exist in their tables, and pair columns of the same\n* storage type. Without this, a `through` that disagrees with storage surfaces\n* as a silently wrong JOIN at query time rather than a validation error here.\n*/\nfunction validateRelationThroughConsistency(contract) {\n\tfor (const [namespaceId, namespace] of Object.entries(contract.domain.namespaces)) for (const [modelName, model] of Object.entries(namespace.models)) for (const [relationName, relation] of Object.entries(model.relations)) {\n\t\tif (relation.cardinality !== \"N:M\") continue;\n\t\tconst qualifiedName = `${namespaceId}.${modelName}.${relationName}`;\n\t\tconst { on, through } = relation;\n\t\tconst modelStorage = blindCast(model.storage);\n\t\tvalidateThroughJoinSide({\n\t\t\tcontract,\n\t\t\tqualifiedName,\n\t\t\tmodelColumns: on.localFields,\n\t\t\tmodelColumnsLabel: \"on.localFields\",\n\t\t\tmodel: {\n\t\t\t\tnamespaceId,\n\t\t\t\ttable: modelStorage.table,\n\t\t\t\tfieldToColumn: modelStorage.fields\n\t\t\t},\n\t\t\tjunctionColumns: through.parentColumns,\n\t\t\tjunctionColumnsLabel: \"through.parentColumns\",\n\t\t\tjunctionNamespaceId: through.namespaceId,\n\t\t\tjunctionTable: through.table\n\t\t});\n\t\tconst targetModel = relation.to.space === void 0 ? contract.domain.namespaces[relation.to.namespace]?.models[relation.to.model] : void 0;\n\t\tconst targetModelSide = targetModel === void 0 ? void 0 : {\n\t\t\tnamespaceId: relation.to.namespace,\n\t\t\ttable: blindCast(targetModel.storage).table\n\t\t};\n\t\tvalidateThroughJoinSide({\n\t\t\tcontract,\n\t\t\tqualifiedName,\n\t\t\tmodelColumns: through.targetColumns,\n\t\t\tmodelColumnsLabel: \"through.targetColumns\",\n\t\t\t...ifDefined(\"model\", targetModelSide),\n\t\t\tjunctionColumns: through.childColumns,\n\t\t\tjunctionColumnsLabel: \"through.childColumns\",\n\t\t\tjunctionNamespaceId: through.namespaceId,\n\t\t\tjunctionTable: through.table\n\t\t});\n\t}\n}\n//#endregion\nexport { CheckConstraintSchema, ColumnDefaultFunctionSchema, ColumnDefaultLiteralSchema, ColumnDefaultSchema, ContractEnumSchema, ForeignKeyReferenceSchema, ForeignKeySchema, ForeignKeySourceSchema, IndexSchema, ReferentialActionSchema, StorageTableSchema, StorageValueSetSchema, checkSqlDefaultText, createNamespaceEntrySchema, createSqlContractSchema, createSqlStorageSchema, reservedSqlDefaultText, resolveSqlToOneRelationStorage, validateExecutionDefaultsTargetMappedColumns, validateModel, validateModelStorageReferences, validateRelationJoinFields, validateSqlContractFully, validateSqlStorageConsistency, validateStorage, validateStorageSemantics, valueObjectStorageTypeMissingMessage };\n\n//# sourceMappingURL=validators.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,MAAM,sBAAsB;;AAE5B,SAAS,oBAAoB,MAAM;CAClC,OAAO,oBAAoB,KAAK,IAAI,IAAI,gGAAgG,KAAK;AAC9I;;;;AAIA,SAAS,uBAAuB,MAAM;CACrC,QAAQ,KAAK,KAAK,GAAlB;EACC,KAAK,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