@prisma/orm-family-sql 8.0.0-rc.17-dev.6 → 8.0.0-rc.17-dev.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/attribute-specs-15pm1Qvk.d.mts +106 -0
- package/dist/attribute-specs-15pm1Qvk.d.mts.map +1 -0
- package/dist/{authoring-type-constructors-0Iv2zdwS-CcpLSwei.mjs → authoring-type-constructors-0Iv2zdwS-hVVlzpLW.mjs} +2 -2
- package/dist/{authoring-type-constructors-0Iv2zdwS-CcpLSwei.mjs.map → authoring-type-constructors-0Iv2zdwS-hVVlzpLW.mjs.map} +1 -1
- package/dist/{contract-builder-DEtvdts6.mjs → contract-builder-BSipKPrc.mjs} +3 -3
- package/dist/{contract-builder-DEtvdts6.mjs.map → contract-builder-BSipKPrc.mjs.map} +1 -1
- package/dist/contract-prisma7__provider.mjs +2 -2
- package/dist/contract-psl.d.mts +2 -2
- package/dist/contract-psl.d.mts.map +1 -1
- package/dist/contract-psl.mjs +1 -1
- package/dist/contract-psl__attribute-specs.d.mts +2 -86
- package/dist/contract-psl__attribute-specs.mjs +1 -1
- package/dist/contract-psl__provider.mjs +1 -1
- package/dist/contract-psl__provider.mjs.map +1 -1
- package/dist/contract-ts.mjs +1 -1
- package/dist/contract-ts__contract-builder.mjs +1 -1
- package/dist/contract.d.mts +2 -2
- package/dist/contract.mjs +2 -2
- package/dist/contract__sql-expression.d.mts +2 -2
- package/dist/contract__sql-expression.mjs +2 -2
- package/dist/{control-BK2oKZmT.d.mts → control-3kVclzEh.d.mts} +20 -19
- package/dist/control-3kVclzEh.d.mts.map +1 -0
- package/dist/{control-4kwMnHYO.mjs → control-CXHnIBSV.mjs} +5 -5
- package/dist/{control-4kwMnHYO.mjs.map → control-CXHnIBSV.mjs.map} +1 -1
- package/dist/family.d.mts +5 -5
- package/dist/family.mjs +3 -3
- package/dist/family__control.d.mts +1 -1
- package/dist/family__control.mjs +2 -2
- package/dist/family__diff.mjs +1 -1
- package/dist/family__pack.d.mts +1 -1
- package/dist/family__pack.mjs +2 -2
- package/dist/family__psl-build.d.mts +2 -2
- package/dist/family__psl-build.mjs +1 -1
- package/dist/family__psl-infer.d.mts +1 -1
- package/dist/{interpreter-DlG-2o64-CDb20sM1.mjs → interpreter-BTM9k0wn-DPrWFd6h.mjs} +54 -26
- package/dist/interpreter-BTM9k0wn-DPrWFd6h.mjs.map +1 -0
- package/dist/{pack-D3L1b4Ag.d.mts → pack-g2rKoDhU.d.mts} +19 -18
- package/dist/pack-g2rKoDhU.d.mts.map +1 -0
- package/dist/{psl-build-C_n5uPZH.d.mts → psl-build-TrbDSGOA.d.mts} +2 -2
- package/dist/psl-build-TrbDSGOA.d.mts.map +1 -0
- package/dist/{psl-build-DTE03hcr.mjs → psl-build-vdqjrTx6.mjs} +7 -4
- package/dist/psl-build-vdqjrTx6.mjs.map +1 -0
- package/dist/{psl-column-resolution-CNtNJ7g7-DOrhyw4S.d.mts → psl-column-resolution-Dm5LhN9b-Bz-Ax2iC.d.mts} +2 -2
- package/dist/psl-column-resolution-Dm5LhN9b-Bz-Ax2iC.d.mts.map +1 -0
- package/dist/{psl-field-resolution-BW0ZuqBd--WxiBxb0.mjs → psl-field-resolution-CAJsUfST-BYuz5Nqh.mjs} +306 -284
- package/dist/psl-field-resolution-CAJsUfST-BYuz5Nqh.mjs.map +1 -0
- package/dist/{psl-infer-DsHE9xAU.d.mts → psl-infer-Dp_NzWE0.d.mts} +2 -2
- package/dist/{psl-infer-DsHE9xAU.d.mts.map → psl-infer-Dp_NzWE0.d.mts.map} +1 -1
- package/dist/{schema-verify-DIfHSB4I-k8l0LZZB.mjs → schema-verify-DIfHSB4I-CcxNNnKO.mjs} +2 -2
- package/dist/{schema-verify-DIfHSB4I-k8l0LZZB.mjs.map → schema-verify-DIfHSB4I-CcxNNnKO.mjs.map} +1 -1
- package/dist/{sql-expression-DE_MTt3T.d.mts → sql-expression-DWyTh9M1.d.mts} +10 -3
- package/dist/sql-expression-DWyTh9M1.d.mts.map +1 -0
- package/dist/{sql-expression-D7GsLgDM.mjs → sql-expression-Dek0jx_g.mjs} +17 -4
- package/dist/sql-expression-Dek0jx_g.mjs.map +1 -0
- package/dist/{type-map-3w0ieDAb-DiMpKEc2.d.mts → type-map-BMCZ_fb9-BTmWHQ-J.d.mts} +6 -3
- package/dist/type-map-BMCZ_fb9-BTmWHQ-J.d.mts.map +1 -0
- package/package.json +18 -18
- package/dist/contract-psl__attribute-specs.d.mts.map +0 -1
- package/dist/control-BK2oKZmT.d.mts.map +0 -1
- package/dist/interpreter-DlG-2o64-CDb20sM1.mjs.map +0 -1
- package/dist/pack-D3L1b4Ag.d.mts.map +0 -1
- package/dist/psl-build-C_n5uPZH.d.mts.map +0 -1
- package/dist/psl-build-DTE03hcr.mjs.map +0 -1
- package/dist/psl-column-resolution-CNtNJ7g7-DOrhyw4S.d.mts.map +0 -1
- package/dist/psl-field-resolution-BW0ZuqBd--WxiBxb0.mjs.map +0 -1
- package/dist/sql-expression-D7GsLgDM.mjs.map +0 -1
- package/dist/sql-expression-DE_MTt3T.d.mts.map +0 -1
- package/dist/type-map-3w0ieDAb-DiMpKEc2.d.mts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interpreter-BTM9k0wn-DPrWFd6h.mjs","names":[],"sources":["../../../../2-sql/2-authoring/contract-psl/dist/interpreter-BTM9k0wn.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-CAJsUfST.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\tconst modelAttributeNodes = Array.from(model.node.attributes());\n\tfor (const [attributeIndex, modelAttribute] of model.attributes.entries()) {\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 = modelAttributeNodes[attributeIndex];\n\t\t\tif (node === void 0) continue;\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 = modelAttributeNodes[attributeIndex];\n\t\t\tif (node === void 0) continue;\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 = modelAttributeNodes[attributeIndex];\n\t\t\tif (node === void 0) continue;\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 = modelAttributeNodes[attributeIndex];\n\t\t\tif (node === void 0) continue;\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 = modelAttributeNodes[attributeIndex];\n\t\t\tif (node === void 0) continue;\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 = modelAttributeNodes[attributeIndex];\n\t\t\tif (node === void 0) continue;\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.node.attributes()) {\n\t\t\tif (attribute.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.syntax).at(nodePslSpan(attribute.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//# sourceMappingURL=interpreter-BTM9k0wn.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAS,qBAAqB,YAAY,qBAAqB;CAC9D,IAAI,YAAY,SAAS,SAAS,OAAO,oBAAoB,IAAI,WAAW,MAAM;CAClF,MAAM,SAAS,sBAAsB,UAAU;CAC/C,OAAO,WAAW,KAAK,IAAI,KAAK,IAAI,oCAAoC,QAAQ,CAAC,CAAC;AACnF;AACA,SAAS,4BAA4B,OAAO;CAC3C,IAAI,mCAAmC;CACvC,KAAK,MAAM,aAAa,MAAM,YAAY,YAAY;EACrD,IAAI,UAAU,KAAK,WAAW,KAAK,GAAG;GACrC,MAAM,YAAY,KAAK;IACtB,MAAM;IACN,SAAS,kCAAkC,SAAS;IACpD,GAAG,MAAM,OAAO,GAAG,UAAU,IAAI;GAClC,CAAC;GACD,mCAAmC;GACnC;EACD;EACA,MAAM,YAAY,KAAK;GACtB,MAAM;GACN,SAAS,eAAe,MAAM,YAAY,KAAK,gCAAgC,UAAU,KAAK;GAC9F,GAAG,MAAM,OAAO,GAAG,UAAU,IAAI;EAClC,CAAC;EACD,mCAAmC;CACpC;CACA,OAAO;AACR;AACA,SAAS,6BAA6B,OAAO;CAC5C,MAAM,qBAAqB,CAAC;CAC5B,MAAM,uCAAuC,IAAI,IAAI;CACrD,MAAM,iBAAiB,gBAAgB;EACtC,MAAM;EACN,SAAS,WAAW;EACpB,YAAY,WAAW,cAAc,CAAC;CACvC;CACA,KAAK,MAAM,eAAe,MAAM,cAAc;EAC7C,MAAM,SAAS,iBAAiB,MAAM,OAAO,SAAS,YAAY,KAAK,MAAM;EAC7E,MAAM,YAAY,kBAAkB,WAAW;EAC/C,MAAM,aAAa,cAAc,KAAK,IAAI,KAAK,IAAI,MAAM,OAAO,cAAc,SAAS;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AAO,YAAY,OAAO,QAAQ,SAAS,OAAO,UAAU,CAAC,CAAC,KAAK,CAAC,aAAa,oBAAoB,CAAC,aAAa;GACxI,QAAQ,OAAO,YAAY,OAAO,QAAQ,eAAe,MAAM,CAAC,CAAC,KAAK,CAAC,WAAW,WAAW,CAAC,WAAW,kBAAkB,mBAAmB,aAAa,SAAS,MAAM,KAAK,CAAC,CAAC;GACjL,GAAG,UAAU,QAAQ,eAAe,IAAI;GACxC,GAAG,UAAU,gBAAgB,eAAe,YAAY;EACzD,CAAC,CAAC,CAAC,EAAE;CACN,CAAC;AACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { a as ParsedNullLiteral, i as EnumMemberListDefault, n as DefaultFunctionCall, r as EnumMemberDefault } from "./attribute-specs-15pm1Qvk.mjs";
|
|
1
2
|
import { t as sqlFamilyEnumSpec } from "./authoring-entity-types-CZ-vdwYS-BQPeBSla.mjs";
|
|
2
3
|
//#region ../../../2-sql/9-family/dist/pack.d.mts
|
|
3
4
|
//#region src/exports/pack.d.ts
|
|
@@ -237,58 +238,58 @@ declare const sqlFamilyPack: {
|
|
|
237
238
|
};
|
|
238
239
|
readonly attributeSpecs: {
|
|
239
240
|
readonly model: {
|
|
240
|
-
readonly map: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
241
|
+
readonly map: (_ctx: import("@prisma/orm-framework/psl-parser").AttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
241
242
|
name: string;
|
|
242
243
|
}, import("@prisma/orm-framework/psl-parser").ModelAttributeCtx>;
|
|
243
|
-
readonly id: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
244
|
+
readonly id: (_ctx: import("@prisma/orm-framework/psl-parser").AttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
244
245
|
fields: string[];
|
|
245
246
|
readonly map?: string;
|
|
246
247
|
}, import("@prisma/orm-framework/psl-parser").ModelAttributeCtx>;
|
|
247
|
-
readonly unique: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
248
|
+
readonly unique: (_ctx: import("@prisma/orm-framework/psl-parser").AttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
248
249
|
fields: string[];
|
|
249
250
|
readonly map?: string;
|
|
250
251
|
}, import("@prisma/orm-framework/psl-parser").ModelAttributeCtx>;
|
|
251
|
-
readonly index: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
252
|
+
readonly index: (ctx: import("@prisma/orm-framework/psl-parser").AttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
252
253
|
fields?: string[];
|
|
253
|
-
readonly expression?:
|
|
254
|
-
readonly where?:
|
|
254
|
+
readonly expression?: import("@prisma/orm-framework/psl-parser").ParsedTypedValue;
|
|
255
|
+
readonly where?: import("@prisma/orm-framework/psl-parser").ParsedTypedValue;
|
|
255
256
|
readonly unique?: boolean;
|
|
256
257
|
readonly name?: string;
|
|
257
258
|
readonly map?: string;
|
|
258
259
|
readonly type?: string;
|
|
259
260
|
readonly options?: Record<string, string>;
|
|
260
261
|
}, import("@prisma/orm-framework/psl-parser").ModelAttributeCtx>;
|
|
261
|
-
readonly check: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
262
|
-
readonly expression:
|
|
262
|
+
readonly check: (ctx: import("@prisma/orm-framework/psl-parser").AttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
263
|
+
readonly expression: import("@prisma/orm-framework/psl-parser").ParsedTypedValue;
|
|
263
264
|
readonly name?: string;
|
|
264
265
|
readonly map?: string;
|
|
265
266
|
}, import("@prisma/orm-framework/psl-parser").ModelAttributeCtx>;
|
|
266
|
-
readonly control: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
267
|
+
readonly control: (_ctx: import("@prisma/orm-framework/psl-parser").AttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
267
268
|
policy: "managed" | "tolerated" | "external" | "observed";
|
|
268
269
|
}, import("@prisma/orm-framework/psl-parser").ModelAttributeCtx>;
|
|
269
|
-
readonly discriminator: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
270
|
+
readonly discriminator: (_ctx: import("@prisma/orm-framework/psl-parser").AttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
270
271
|
field: string;
|
|
271
272
|
}, import("@prisma/orm-framework/psl-parser").ModelAttributeCtx>;
|
|
272
|
-
readonly base: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
273
|
+
readonly base: (_ctx: import("@prisma/orm-framework/psl-parser").AttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
273
274
|
base: import("@prisma/orm-framework/psl-parser").ResolvedEntityReference<import("@prisma/orm-framework/psl-parser").ModelSymbol>;
|
|
274
275
|
value: string;
|
|
275
276
|
}, import("@prisma/orm-framework/psl-parser").ModelAttributeCtx>;
|
|
276
277
|
};
|
|
277
278
|
readonly field: {
|
|
278
|
-
readonly map: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
279
|
+
readonly map: (_ctx: import("@prisma/orm-framework/psl-parser").FieldAttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
279
280
|
name: string;
|
|
280
281
|
}, import("@prisma/orm-framework/psl-parser").FieldAttributeCtx>;
|
|
281
|
-
readonly id: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
282
|
+
readonly id: (_ctx: import("@prisma/orm-framework/psl-parser").FieldAttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
282
283
|
readonly map?: string;
|
|
283
284
|
}, import("@prisma/orm-framework/psl-parser").FieldAttributeCtx>;
|
|
284
|
-
readonly unique: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
285
|
+
readonly unique: (_ctx: import("@prisma/orm-framework/psl-parser").FieldAttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
285
286
|
readonly map?: string;
|
|
286
287
|
}, import("@prisma/orm-framework/psl-parser").FieldAttributeCtx>;
|
|
287
|
-
readonly noCheck: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
288
|
+
readonly noCheck: (_ctx: import("@prisma/orm-framework/psl-parser").FieldAttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
288
289
|
first?: "membership" | "elementNotNull";
|
|
289
290
|
second?: "membership" | "elementNotNull";
|
|
290
291
|
}, import("@prisma/orm-framework/psl-parser").FieldAttributeCtx>;
|
|
291
|
-
readonly relation: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
292
|
+
readonly relation: (_ctx: import("@prisma/orm-framework/psl-parser").FieldAttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
292
293
|
name?: string;
|
|
293
294
|
readonly fields?: string[];
|
|
294
295
|
readonly references?: string[];
|
|
@@ -298,7 +299,7 @@ declare const sqlFamilyPack: {
|
|
|
298
299
|
readonly index?: string | boolean;
|
|
299
300
|
}, import("@prisma/orm-framework/psl-parser").FieldAttributeCtx>;
|
|
300
301
|
readonly default: (ctx: import("@prisma/orm-framework/psl-parser").FieldAttributeSpecContext) => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
301
|
-
value: import("@prisma/orm-framework/psl-parser").
|
|
302
|
+
value: import("@prisma/orm-framework/psl-parser").ParsedWrittenScalar | ParsedNullLiteral | import("@prisma/orm-framework/psl-parser").ParsedWrittenList<import("@prisma/orm-framework/psl-parser").ParsedWrittenScalar | ParsedNullLiteral> | DefaultFunctionCall | EnumMemberDefault | EnumMemberListDefault;
|
|
302
303
|
}, import("@prisma/orm-framework/psl-parser").FieldAttributeCtx>;
|
|
303
304
|
};
|
|
304
305
|
};
|
|
@@ -306,4 +307,4 @@ declare const sqlFamilyPack: {
|
|
|
306
307
|
};
|
|
307
308
|
//#endregion
|
|
308
309
|
export { sqlFamilyPack as t };
|
|
309
|
-
//# sourceMappingURL=pack-
|
|
310
|
+
//# sourceMappingURL=pack-g2rKoDhU.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pack-g2rKoDhU.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/pack.d.mts"],"mappings":";;;;cAEc;WACH;WACA;WACA;WACA;WACA;aACE;eACE;iBACE;iBACA;mBACE;mBACA;qBACE;;;;eAIN;iBACE;iBACA;mBACE;mBACA;qBACE;;;;eAIN;iBACE;iBACA;mBACE;mBACA;mBACA;qBACE;uBACE;uBACA;uBACA;uBACA;uBACA;;;;iBAIN;mBACE;mBACA;qBACE;uBACE;uBACA;uBACA;uBACA;;;;;eAKR;iBACE;iBACA;mBACE;mBACA;qBACE;;;;eAIN;iBACE;iBACA;mBACE;mBACA;qBACE;;;;eAIN;iBACE;mBACE;mBACA;qBACE;qBACA;uBACE;;qBAEF;uBACE;yBACE;yBACA;;;qBAGJ;;;iBAGJ;mBACE;mBACA;qBACE;qBACA;uBACE;;qBAEF;uBACE;yBACE;yBACA;;;qBAGJ;;;iBAGJ;mBACE;mBACA;qBACE;qBACA;uBACE;;qBAEF;uBACE;yBACE;yBACA;;;qBAGJ;;;iBAGJ;mBACE;mBACA;qBACE;qBACA;qBACA;uBACE;yBACE;yBACA;yBACA;yBACA;yBACA;;;;mBAIN;qBACE;qBACA;uBACE;yBACE;yBACA;yBACA;yBACA;;;qBAGJ;uBACE;yBACE;yBACA;yBACA;2BACE;6BACE;6BACA;6BACA;;;;;qBAKR;;;iBAGJ;mBACE;mBACA;qBACE;qBACA;uBACE;;qBAEF;uBACE;yBACE;yBACA;;;qBAGJ;;;iBAGJ;mBACE;mBACA;qBACE;qBACA;uBACE;;qBAEF;uBACE;yBACE;yBACA;;;qBAGJ;;;;;aAKR;eACE;iBACE;mBACE;mBACA;mBACA;qBACE;qBACA;qBACA;;mBAEF;qBACE;qBACA;uBACE;yBACE;yBACA;;;;;;;aAOZ,gEAAgE;aAChE;eACE;QACP;QACA;QACA;QACA;QACA;UACE;;QAEF,aAAa;QACb;UACE,2CAA2C;YACzC;4CACgC;;;;aAI/B;eACE;iBACE,MAAM,qCAAqC,wDAAwD;UAC1G;0CACgC;iBACzB,KAAK,qCAAqC,wDAAwD;UACzG;mBACS;0CACuB;iBACzB,SAAS,qCAAqC,wDAAwD;UAC7G;mBACS;0CACuB;iBACzB,QAAQ,oCAAoC,wDAAwD;UAC3G;mBACS,4CAA4C;mBAC5C,uCAAuC;mBACvC;mBACA;mBACA;mBACA;mBACA,UAAU;0CACa;iBACzB,QAAQ,oCAAoC,wDAAwD;mBAClG,2CAA2C;mBAC3C;mBACA;0CACuB;iBACzB,UAAU,qCAAqC,wDAAwD;UAC9G;0CACgC;iBACzB,gBAAgB,qCAAqC,wDAAwD;UACpH;0CACgC;iBACzB,OAAO,qCAAqC,wDAAwD;UAC3G,qCAAqC,uDAAuD;UAC5F;0CACgC;;eAE3B;iBACE,MAAM,qCAAqC,6DAA6D;UAC/G;0CACgC;iBACzB,KAAK,qCAAqC,6DAA6D;mBACrG;0CACuB;iBACzB,SAAS,qCAAqC,6DAA6D;mBACzG;0CACuB;iBACzB,UAAU,qCAAqC,6DAA6D;UACnH;UACA;0CACgC;iBACzB,WAAW,qCAAqC,6DAA6D;UACpH;mBACS;mBACA;mBACA;mBACA;mBACA;mBACA;0CACuB;iBACzB,UAAU,oCAAoC,6DAA6D;UAClH,sCAAsC,sBA1CnB,mDA0CiJ,iDAAiD,sBAApG,qBAA+K,sBAA0E,oBAA2E;0CACrZ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./type-map-
|
|
1
|
+
import "./type-map-BMCZ_fb9-BTmWHQ-J.mjs";
|
|
2
2
|
//#region ../../../2-sql/9-family/dist/psl-build.d.mts
|
|
3
3
|
//#region src/core/psl-build/psl-names.d.ts
|
|
4
4
|
/**
|
|
@@ -10,4 +10,4 @@ import "./type-map-3w0ieDAb-DiMpKEc2.mjs";
|
|
|
10
10
|
declare function toEnumMemberName(value: string): string;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { toEnumMemberName as t };
|
|
13
|
-
//# sourceMappingURL=psl-build-
|
|
13
|
+
//# sourceMappingURL=psl-build-TrbDSGOA.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"psl-build-TrbDSGOA.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/psl-build.d.mts"],"mappings":";;;;;;;;;iBAQiB,iBAAiB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as numeralText } from "./numeral-text-Cqu87pVe-DJCqBaSC.mjs";
|
|
2
2
|
import { i as escapePslString } from "./data-type-support-Bu-VpT7z.mjs";
|
|
3
3
|
import { m as defaultInCanonicalForm } from "./types-D0GFxty0-CP8b4dR3.mjs";
|
|
4
|
-
import
|
|
4
|
+
import "./sql-expression-Dek0jx_g.mjs";
|
|
5
5
|
import { authoringEntryType, printTaggedLiteral } from "@prisma/orm-framework/components/authoring";
|
|
6
6
|
import { canonicalFormOf, dataTypeId } from "@prisma/orm-framework/components/codec";
|
|
7
7
|
//#region ../../../2-sql/9-family/dist/psl-build.mjs
|
|
@@ -11,7 +11,10 @@ const DEFAULT_FUNCTION_ATTRIBUTES = {
|
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* The attribute a stored default prints as: a named function, a literal the column takes, or any
|
|
14
|
-
* other expression as a `sql` literal. `undefined` when a literal has no written form.
|
|
14
|
+
* other expression as a `sql` literal. `undefined` when a literal has no written form. An expression
|
|
15
|
+
* prints even when the literal would read back as different text: default expressions are compared
|
|
16
|
+
* with case and whitespace ignored (`resolvedDefaultsEqual`), and canonicalization changes only
|
|
17
|
+
* whitespace (ADR 129).
|
|
15
18
|
*/
|
|
16
19
|
function mapDefault(columnDefault, options) {
|
|
17
20
|
switch (columnDefault.kind) {
|
|
@@ -19,7 +22,7 @@ function mapDefault(columnDefault, options) {
|
|
|
19
22
|
const text = writeDefaultLiteral(columnDefault.value, options);
|
|
20
23
|
return text === void 0 ? void 0 : { attribute: `@default(${text})` };
|
|
21
24
|
}
|
|
22
|
-
case "function": return { attribute: options?.functionAttributes?.[columnDefault.expression] ?? DEFAULT_FUNCTION_ATTRIBUTES[columnDefault.expression] ?? `@default(${
|
|
25
|
+
case "function": return { attribute: options?.functionAttributes?.[columnDefault.expression] ?? DEFAULT_FUNCTION_ATTRIBUTES[columnDefault.expression] ?? `@default(${printTaggedLiteral("sql", columnDefault.expression)})` };
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
28
|
function writingSurface(entries) {
|
|
@@ -213,4 +216,4 @@ function sameForm(left, right) {
|
|
|
213
216
|
//#endregion
|
|
214
217
|
export { mapDefault as t };
|
|
215
218
|
|
|
216
|
-
//# sourceMappingURL=psl-build-
|
|
219
|
+
//# sourceMappingURL=psl-build-vdqjrTx6.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"psl-build-vdqjrTx6.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/psl-build.mjs"],"sourcesContent":["import { s as toEnumMemberName } from \"./psl-names-C3cwe0rg.mjs\";\nimport { SQL_EXPRESSION_TAG } from \"@internal/sql-contract/sql-expression\";\nimport { authoringEntryType, printTaggedLiteral } from \"@internal/framework-components/authoring\";\nimport { canonicalFormOf, dataTypeId } from \"@internal/framework-components/codec\";\nimport { numeralText } from \"@internal/sql-contract/data-type\";\nimport { defaultInCanonicalForm } from \"@internal/sql-schema-ir/types\";\nimport { escapePslString } from \"@internal/sql-contract/data-type-support\";\n//#region src/core/psl-build/default-mapping.ts\nconst DEFAULT_FUNCTION_ATTRIBUTES = {\n\t\"autoincrement()\": \"@default(autoincrement())\",\n\t\"now()\": \"@default(now())\"\n};\n/**\n* The attribute a stored default prints as: a named function, a literal the column takes, or any\n* other expression as a `sql` literal. `undefined` when a literal has no written form. An expression\n* prints even when the literal would read back as different text: default expressions are compared\n* with case and whitespace ignored (`resolvedDefaultsEqual`), and canonicalization changes only\n* whitespace (ADR 129).\n*/\nfunction mapDefault(columnDefault, options) {\n\tswitch (columnDefault.kind) {\n\t\tcase \"literal\": {\n\t\t\tconst text = writeDefaultLiteral(columnDefault.value, options);\n\t\t\treturn text === void 0 ? void 0 : { attribute: `@default(${text})` };\n\t\t}\n\t\tcase \"function\": return { attribute: options?.functionAttributes?.[columnDefault.expression] ?? DEFAULT_FUNCTION_ATTRIBUTES[columnDefault.expression] ?? `@default(${printTaggedLiteral(SQL_EXPRESSION_TAG, columnDefault.expression)})` };\n\t}\n}\nfunction writingSurface(entries) {\n\tconst entryOf = /* @__PURE__ */ new Map();\n\tlet classify;\n\tlet plainStringType;\n\tlet plainBooleanType;\n\tconst tagTypes = [];\n\tfor (const [key, entry] of Object.entries(entries)) {\n\t\tconst written = entry.written;\n\t\tif (written.kind === \"tag\") {\n\t\t\tconst type = dataTypeId(authoringEntryType(key, entry));\n\t\t\tif (!entryOf.has(type)) entryOf.set(type, entry);\n\t\t\ttagTypes.push(type);\n\t\t\tcontinue;\n\t\t}\n\t\tif (written.syntax === \"number\") {\n\t\t\tclassify = written.classify;\n\t\t\tfor (const type of written.types) entryOf.set(type, entry);\n\t\t\tcontinue;\n\t\t}\n\t\tentryOf.set(key, entry);\n\t\tif (written.syntax === \"string\") plainStringType = dataTypeId(key);\n\t\telse plainBooleanType = dataTypeId(key);\n\t}\n\treturn {\n\t\tentryOf,\n\t\tclassify,\n\t\tplainStringType,\n\t\tplainBooleanType,\n\t\ttagTypes\n\t};\n}\n/**\n* Every type the stored form could be a value of, in the order a written value would be read: a\n* number or numeral text through the classifier first, then the plain syntax that matches the\n* shape, then each tag, whose canonical form is a whole document.\n*/\nfunction classifications(value, surface) {\n\tconst found = [];\n\tif (typeof value === \"number\") {\n\t\tconst classified = surface.classify?.(numeralText(value));\n\t\treturn classified === void 0 ? [] : [classified];\n\t}\n\tif (typeof value === \"boolean\") return surface.plainBooleanType === void 0 ? [] : [{\n\t\ttype: surface.plainBooleanType,\n\t\tvalue\n\t}];\n\tif (typeof value === \"string\") {\n\t\tconst classified = surface.classify?.(value);\n\t\tif (classified !== void 0) found.push(classified);\n\t\tif (surface.plainStringType !== void 0) found.push({\n\t\t\ttype: surface.plainStringType,\n\t\t\tvalue\n\t\t});\n\t}\n\tfor (const type of surface.tagTypes) found.push({\n\t\ttype,\n\t\tvalue\n\t});\n\treturn found;\n}\n/** The stored form the column takes this value as, or `undefined` when its type takes no such value. */\nfunction admitted(candidate, columnDataType, lookup) {\n\tif (candidate.type === columnDataType) return candidate.value;\n\tconst cast = lookup.get(columnDataType)?.casts[candidate.type];\n\tif (cast === void 0) return void 0;\n\ttry {\n\t\treturn cast(candidate.value);\n\t} catch {\n\t\treturn;\n\t}\n}\n/** The text of the literal: what the entry prints, before the syntax that fences it. */\nfunction printedText(entry, value) {\n\ttry {\n\t\treturn entry.print(value);\n\t} catch {\n\t\treturn;\n\t}\n}\n/** What the entry reads the printed text back as, which for a number is the classifier's answer. */\nfunction readBack(entry, type, text) {\n\tconst written = entry.written;\n\ttry {\n\t\treturn written.kind === \"plain\" && written.syntax === \"number\" ? written.classify(text) : {\n\t\t\ttype,\n\t\t\tvalue: written.parse(text)\n\t\t};\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction literalText(entry, text) {\n\tconst written = entry.written;\n\tif (written.kind === \"tag\") return printTaggedLiteral(written.tag, text);\n\treturn written.syntax === \"string\" ? `\"${escapePslString(text)}\"` : text;\n}\n/**\n* The value written as the literal of one of its types, proven by reading the text straight back:\n* the same entry, the same cast, and the stored form again.\n*/\nfunction writeScalar(value, columnDataType, lookup, surface) {\n\tfor (const candidate of classifications(value, surface)) {\n\t\tconst entry = surface.entryOf.get(candidate.type);\n\t\tif (entry === void 0) continue;\n\t\tconst stored = admitted(candidate, columnDataType, lookup);\n\t\tif (stored === void 0 || !sameForm(stored, value)) continue;\n\t\tconst text = printedText(entry, candidate.value);\n\t\tif (text === void 0) continue;\n\t\tconst reread = readBack(entry, candidate.type, text);\n\t\tif (reread === void 0) continue;\n\t\tconst restored = admitted(reread, columnDataType, lookup);\n\t\tif (restored === void 0 || !sameForm(restored, value)) continue;\n\t\treturn literalText(entry, text);\n\t}\n}\n/** One written element of a list, printed as a value of any type, with no column type to admit it. */\nfunction writeElement(value, of, surface) {\n\tfor (const candidate of classifications(value, surface)) {\n\t\tif (!of.includes(candidate.type)) continue;\n\t\tconst entry = surface.entryOf.get(candidate.type);\n\t\tif (entry === void 0) continue;\n\t\tconst text = printedText(entry, candidate.value);\n\t\tif (text === void 0) continue;\n\t\tconst reread = readBack(entry, candidate.type, text);\n\t\tif (reread === void 0 || !of.includes(reread.type)) continue;\n\t\treturn {\n\t\t\ttext: literalText(entry, text),\n\t\t\tvalue: reread.value\n\t\t};\n\t}\n}\n/**\n* A written list on a scalar column, which the column type's list cast turns into its one value.\n* Each element is classified on its own and must be of a type the cast takes.\n*/\nfunction writeListCast(value, columnDataType, lookup, surface) {\n\tconst listCast = lookup.get(columnDataType)?.listCast;\n\tif (listCast === void 0) return void 0;\n\tconst parts = [];\n\tconst elements = [];\n\tfor (const element of value) {\n\t\tconst written = writeElement(element, listCast.of, surface);\n\t\tif (written === void 0) return void 0;\n\t\tparts.push(written.text);\n\t\telements.push(written.value);\n\t}\n\ttry {\n\t\tif (!sameForm(listCast.cast(elements), value)) return void 0;\n\t} catch {\n\t\treturn;\n\t}\n\treturn `[${parts.join(\", \")}]`;\n}\nfunction writeDefaultLiteral(stored, options) {\n\tif (stored instanceof Date) return void 0;\n\tconst { dataTypes, columnCodec } = options ?? {};\n\tif (dataTypes === void 0 || columnCodec === void 0) return void 0;\n\tconst { entries, lookup } = dataTypes;\n\tconst columnDataType = columnCodec.dataType;\n\tconst { value } = defaultInCanonicalForm(stored, canonicalFormOf(columnCodec, lookup), options?.list === true);\n\tif (value instanceof Date) return void 0;\n\tconst surface = writingSurface(entries);\n\tif (options?.list === true) {\n\t\tif (!Array.isArray(value)) return void 0;\n\t\tconst parts = [];\n\t\tfor (const element of value) {\n\t\t\tconst written = writeScalar(element, columnDataType, lookup, surface);\n\t\t\tif (written === void 0) return void 0;\n\t\t\tparts.push(written);\n\t\t}\n\t\treturn `[${parts.join(\", \")}]`;\n\t}\n\tconst written = writeScalar(value, columnDataType, lookup, surface);\n\tif (written !== void 0) return written;\n\treturn Array.isArray(value) ? writeListCast(value, columnDataType, lookup, surface) : void 0;\n}\n/** Whether two canonical forms are the same JSON value, member by member and element by element. */\nfunction sameForm(left, right) {\n\tif (left === right) return true;\n\tif (Array.isArray(left) !== Array.isArray(right)) return false;\n\tif (typeof left !== \"object\" || typeof right !== \"object\" || left === null || right === null) return false;\n\tconst members = Object.entries(left);\n\tconst others = new Map(Object.entries(right));\n\treturn members.length === others.size && members.every(([key, member]) => {\n\t\tconst other = others.get(key);\n\t\treturn other !== void 0 && sameForm(member, other);\n\t});\n}\n//#endregion\nexport { mapDefault, toEnumMemberName };\n\n//# sourceMappingURL=psl-build.mjs.map"],"mappings":";;;;;;;AAQA,MAAM,8BAA8B;CACnC,mBAAmB;CACnB,SAAS;AACV;;;;;;;;AAQA,SAAS,WAAW,eAAe,SAAS;CAC3C,QAAQ,cAAc,MAAtB;EACC,KAAK,WAAW;GACf,MAAM,OAAO,oBAAoB,cAAc,OAAO,OAAO;GAC7D,OAAO,SAAS,KAAK,IAAI,KAAK,IAAI,EAAE,WAAW,YAAY,KAAK,GAAG;EACpE;EACA,KAAK,YAAY,OAAO,EAAE,WAAW,SAAS,qBAAqB,cAAc,eAAe,4BAA4B,cAAc,eAAe,YAAY,mBAAA,OAAuC,cAAc,UAAU,EAAE,GAAG;CAC1O;AACD;AACA,SAAS,eAAe,SAAS;CAChC,MAAM,0BAA0B,IAAI,IAAI;CACxC,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM,WAAW,CAAC;CAClB,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,OAAO,GA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
|
import { ColumnDefault, ExecutionMutationDefaultPhases, ValueSetRef } from "@prisma/orm-framework/contract/types";
|
|
5
5
|
import "@prisma/orm-framework/components/control";
|
|
6
6
|
import "@prisma/orm-framework/psl-parser";
|
|
7
|
-
//#region ../../../2-sql/2-authoring/contract-psl/dist/psl-column-resolution-
|
|
7
|
+
//#region ../../../2-sql/2-authoring/contract-psl/dist/psl-column-resolution-Dm5LhN9b.d.mts
|
|
8
8
|
//#region src/psl-column-resolution.d.ts
|
|
9
9
|
type ColumnDescriptor = {
|
|
10
10
|
readonly codecId: string;
|
|
@@ -22,4 +22,4 @@ type ColumnDescriptor = {
|
|
|
22
22
|
};
|
|
23
23
|
//#endregion
|
|
24
24
|
export { ColumnDescriptor as t };
|
|
25
|
-
//# sourceMappingURL=psl-column-resolution-
|
|
25
|
+
//# sourceMappingURL=psl-column-resolution-Dm5LhN9b-Bz-Ax2iC.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"psl-column-resolution-Dm5LhN9b-Bz-Ax2iC.d.mts","names":[],"sources":["../../../../2-sql/2-authoring/contract-psl/dist/psl-column-resolution-Dm5LhN9b.d.mts"],"mappings":";;;;;;;;KAQK;WACM;WACA;WACA,aAAa;;;;;;;;;WASb,WAAW"}
|