@prisma/orm-family-sql 8.0.0-rc.18-dev.29 → 8.0.0-rc.18-dev.30
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-D9QcPJpj.d.mts → attribute-specs-BzBk62Jx.d.mts} +10 -4
- package/dist/{attribute-specs-D9QcPJpj.d.mts.map → attribute-specs-BzBk62Jx.d.mts.map} +1 -1
- package/dist/{authoring-entity-types-CZ-vdwYS-CSU65LVs.d.mts → authoring-entity-types-CZ-vdwYS-DzxLL9BC.d.mts} +2 -2
- package/dist/{authoring-entity-types-CZ-vdwYS-CSU65LVs.d.mts.map → authoring-entity-types-CZ-vdwYS-DzxLL9BC.d.mts.map} +1 -1
- package/dist/{config-types-BJxHMPGt.mjs → config-types-vu5fTaRa.mjs} +2 -2
- package/dist/{config-types-BJxHMPGt.mjs.map → config-types-vu5fTaRa.mjs.map} +1 -1
- package/dist/{contract-builder-CrWbrtE4.mjs → contract-builder-DmX4XnJa.mjs} +95 -10
- package/dist/contract-builder-DmX4XnJa.mjs.map +1 -0
- package/dist/{contract-builder-D-RSOsnc.d.mts → contract-builder-GH-eCIpl.d.mts} +18 -2
- package/dist/contract-builder-GH-eCIpl.d.mts.map +1 -0
- package/dist/contract-prisma7__provider.d.mts +1 -3
- package/dist/contract-prisma7__provider.d.mts.map +1 -1
- package/dist/contract-prisma7__provider.mjs +38 -9
- package/dist/contract-prisma7__provider.mjs.map +1 -1
- package/dist/contract-psl.d.mts +5 -3
- package/dist/contract-psl.d.mts.map +1 -1
- package/dist/contract-psl.mjs +1 -1
- package/dist/contract-psl__attribute-specs.d.mts +1 -1
- package/dist/contract-psl__attribute-specs.mjs +1 -1
- package/dist/contract-psl__provider.mjs +3 -2
- package/dist/contract-psl__provider.mjs.map +1 -1
- package/dist/contract-ts.d.mts +1 -1
- package/dist/contract-ts.mjs +3 -3
- package/dist/contract-ts__config-types.mjs +1 -1
- package/dist/contract-ts__contract-builder.d.mts +1 -1
- package/dist/contract-ts__contract-builder.mjs +2 -2
- package/dist/{control-C56VTBHJ.d.mts → control-B8tb6SEt.d.mts} +72 -12
- package/dist/control-B8tb6SEt.d.mts.map +1 -0
- package/dist/{control-CnKhMUQJ.mjs → control-DNE-Chse.mjs} +10 -6
- package/dist/control-DNE-Chse.mjs.map +1 -0
- package/dist/{control-adapter-BCopdpsT-BPHa2Frw.d.mts → control-adapter-Bn0uhplA-rhq_JtYp.d.mts} +2 -2
- package/dist/{control-adapter-BCopdpsT-BPHa2Frw.d.mts.map → control-adapter-Bn0uhplA-rhq_JtYp.d.mts.map} +1 -1
- package/dist/{control-adapter-ChJhp5vV.d.mts → control-adapter-RwLtGiwa.d.mts} +2 -2
- package/dist/{control-adapter-ChJhp5vV.d.mts.map → control-adapter-RwLtGiwa.d.mts.map} +1 -1
- package/dist/{derived-checks-sRZp_gTF-ermwhVGQ.mjs → derived-checks-CdPHpJSv-B7Bgj3Ao.mjs} +2 -2
- package/dist/{derived-checks-sRZp_gTF-ermwhVGQ.mjs.map → derived-checks-CdPHpJSv-B7Bgj3Ao.mjs.map} +1 -1
- package/dist/{diff-ClZvIVOl.d.mts → diff-B9Z47nHf.d.mts} +2 -2
- package/dist/{diff-ClZvIVOl.d.mts.map → diff-B9Z47nHf.d.mts.map} +1 -1
- package/dist/family.d.mts +9 -9
- package/dist/family.mjs +4 -3
- package/dist/family__control-adapter.d.mts +2 -2
- package/dist/family__control.d.mts +2 -2
- package/dist/family__control.mjs +1 -1
- package/dist/family__diff.d.mts +1 -1
- package/dist/family__migration.d.mts +1 -1
- package/dist/family__pack.d.mts +2 -2
- package/dist/family__pack.mjs +8 -3
- package/dist/family__pack.mjs.map +1 -1
- package/dist/family__psl-build.d.mts +2 -2
- package/dist/family__psl-build.mjs +2 -2
- package/dist/{authoring-type-constructors-0Iv2zdwS-D4LlP1q2.mjs → generator-functions-B4gRRYZB-BTtC2KQz.mjs} +205 -5
- package/dist/generator-functions-B4gRRYZB-BTtC2KQz.mjs.map +1 -0
- package/dist/{interpreter-kQuqdyeP-B-rzJDWE.mjs → interpreter-Bk0xpelv-BifV9Yib.mjs} +9 -9
- package/dist/interpreter-Bk0xpelv-BifV9Yib.mjs.map +1 -0
- package/dist/{migration-RrhpTP1o.d.mts → migration-CSv3UpiC.d.mts} +2 -2
- package/dist/{migration-RrhpTP1o.d.mts.map → migration-CSv3UpiC.d.mts.map} +1 -1
- package/dist/{pack-DNdZwm5w.d.mts → pack-COEyiyfL.d.mts} +74 -4
- package/dist/pack-COEyiyfL.d.mts.map +1 -0
- package/dist/{psl-build-BT8Ue6gd.mjs → psl-build-BkxAXTwj.mjs} +44 -135
- package/dist/psl-build-BkxAXTwj.mjs.map +1 -0
- package/dist/psl-build-O7_tXQ1E.d.mts +108 -0
- package/dist/psl-build-O7_tXQ1E.d.mts.map +1 -0
- package/dist/{psl-column-resolution-BCkhNzOK-DyfXnB-9.d.mts → psl-column-resolution-DNdqpUxt-C8BST0uW.d.mts} +3 -3
- package/dist/psl-column-resolution-DNdqpUxt-C8BST0uW.d.mts.map +1 -0
- package/dist/{psl-field-resolution-C1E-_fQq-VUYD8cnS.mjs → psl-field-resolution-BET6wtHZ-CX2xL99Q.mjs} +110 -46
- package/dist/psl-field-resolution-BET6wtHZ-CX2xL99Q.mjs.map +1 -0
- package/dist/{types-DKU4GeqD-CUClXCme.d.mts → types-DlFdMaDJ-DekbNgDh.d.mts} +3 -3
- package/dist/{types-DKU4GeqD-CUClXCme.d.mts.map → types-DlFdMaDJ-DekbNgDh.d.mts.map} +1 -1
- package/package.json +18 -18
- package/dist/authoring-type-constructors-0Iv2zdwS-D4LlP1q2.mjs.map +0 -1
- package/dist/contract-builder-CrWbrtE4.mjs.map +0 -1
- package/dist/contract-builder-D-RSOsnc.d.mts.map +0 -1
- package/dist/control-C56VTBHJ.d.mts.map +0 -1
- package/dist/control-CnKhMUQJ.mjs.map +0 -1
- package/dist/interpreter-kQuqdyeP-B-rzJDWE.mjs.map +0 -1
- package/dist/pack-DNdZwm5w.d.mts.map +0 -1
- package/dist/psl-build-BT8Ue6gd.mjs.map +0 -1
- package/dist/psl-build-DU55bjfu.d.mts +0 -157
- package/dist/psl-build-DU55bjfu.d.mts.map +0 -1
- package/dist/psl-column-resolution-BCkhNzOK-DyfXnB-9.d.mts.map +0 -1
- package/dist/psl-field-resolution-C1E-_fQq-VUYD8cnS.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interpreter-kQuqdyeP-B-rzJDWE.mjs","names":[],"sources":["../../../../2-sql/2-authoring/contract-psl/dist/interpreter-kQuqdyeP.mjs"],"sourcesContent":["import { i as mapFieldNamesToColumns, n as getAttribute, o as storageName, r as getNamedArgument, t as formatDbAttributeMigrationMessage } from \"./psl-attribute-parsing-BCsFWsSp.mjs\";\nimport { a as getAuthoringEntity, 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, y as contractError } from \"./psl-field-resolution-C1E-_fQq.mjs\";\nimport { t as defaultTableName } from \"./default-table-name-BfFY8qYR.mjs\";\nimport { contributedTypeOf, createPslDiagnosticCollector, diagnosticSource, findBlockDescriptor, interpretExtensionBlocks, nodePslSpan, typeReferenceNode } from \"@internal/psl-parser\";\nimport { CODEC_INSTANCE_KIND, resolvedTypeParams } from \"@internal/sql-contract/types\";\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 { sqlTextFromStored } 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 { 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 { 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}\nfunction declarationsHoldingModels(namespace) {\n\tconst declarations = /* @__PURE__ */ new Set();\n\tfor (const model of Object.values(namespace.models)) {\n\t\tconst written = model.node.syntax.findAncestor(NamespaceDeclarationAst.cast);\n\t\tif (written !== void 0) declarations.add(written.syntax);\n\t}\n\treturn declarations;\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 ${node.name()?.name() ?? 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 unboundNamespace = input.namespaces.find((namespace) => namespace.id === UNBOUND_NAMESPACE_ID && Object.keys(namespace.models).length > 0);\n\t\tconst hasSibling = input.namespaces.some((namespace) => namespace.id !== UNBOUND_NAMESPACE_ID && namespace.declarations.length > 0);\n\t\tif (unboundNamespace !== void 0 && hasSibling) {\n\t\t\tconst holdingModels = declarationsHoldingModels(unboundNamespace);\n\t\t\tfor (const { node, span } of unboundNamespace.declarations) {\n\t\t\t\tif (!holdingModels.has(node.syntax)) continue;\n\t\t\t\tinput.diagnostics.push({\n\t\t\t\t\tcode: \"PSL_RESERVED_NAMESPACE_NAME\",\n\t\t\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\t\t...diagnosticSource(input.sources, node.syntax).at(span)\n\t\t\t\t});\n\t\t\t}\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 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\tnamedTypes: input.namedTypes,\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\tnamespaceId: modelNamespaceId,\n\t\t...ifDefined(\"namespaceExtensionEntities\", input.namespaceExtensionEntities),\n\t\tcodecLookup: input.codecLookup\n\t});\n\tconst inlineIdFields = resolvedFields.filter((field) => field.isId);\n\tif (inlineIdFields.length > 1) diagnostics.push({\n\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\tmessage: `Model \"${model.name}\" cannot declare inline @id on multiple fields; use model-level @@id([...]) for composite identity`,\n\t\t...source.at(model.span)\n\t});\n\tconst singleInlineIdField = inlineIdFields.length === 1 ? inlineIdFields[0] : void 0;\n\tlet primaryKey = singleInlineIdField ? {\n\t\tcolumns: [singleInlineIdField.columnName],\n\t\t...ifDefined(\"name\", singleInlineIdField.idName)\n\t} : void 0;\n\tconst hasInlinePrimaryKey = primaryKey !== void 0;\n\tlet blockPrimaryKeyDeclared = false;\n\tlet controlPolicyDeclared = false;\n\tlet controlPolicy;\n\tconst declaredContributedModelAttributes = /* @__PURE__ */ new Set();\n\tconst modelAttributeEntities = {};\n\tconst resultBackrelationCandidates = [];\n\tfor (const field of Object.values(model.fields)) {\n\t\tconst backrelationTarget = backrelationTargetSymbol(field, input.binder);\n\t\tif (backrelationTarget === void 0) continue;\n\t\tconst relationAttribute = getAttribute(field.attributes, \"relation\");\n\t\tif (!field.list && relationAttribute && relationAttributeDeclaresOwningSide(relationAttribute)) continue;\n\t\tconst attributesValid = validateBackrelationFieldAttributes({\n\t\t\tmodelName: model.name,\n\t\t\tfield,\n\t\t\tsources: input.sources,\n\t\t\tbinder: input.binder,\n\t\t\tdiagnostics\n\t\t});\n\t\tlet relationName;\n\t\tif (relationAttribute) {\n\t\t\tconst parsedRelation = interpretRelationAttribute({\n\t\t\t\tselfModel: model,\n\t\t\t\tfield,\n\t\t\t\tspecContext: fieldSpecContext({\n\t\t\t\t\t...specContext,\n\t\t\t\t\tfield,\n\t\t\t\t\tbinder: input.binder\n\t\t\t\t}),\n\t\t\t\tsymbols: input.symbolTable,\n\t\t\t\tsources: input.sources,\n\t\t\t\tbinder: input.binder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (!parsedRelation) continue;\n\t\t\tif (parsedRelation.fields || parsedRelation.references) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_INVALID_RELATION_ATTRIBUTE\",\n\t\t\t\t\tmessage: `Backrelation list field \"${model.name}.${field.name}\" cannot declare fields/references; define them on the FK-side relation field`,\n\t\t\t\t\t...source.at(relationAttribute.span)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (parsedRelation.onDelete || parsedRelation.onUpdate || parsedRelation.index !== void 0) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_INVALID_RELATION_ATTRIBUTE\",\n\t\t\t\t\tmessage: `Backrelation list field \"${model.name}.${field.name}\" cannot declare onDelete/onUpdate/index; define them on the FK-side relation field`,\n\t\t\t\t\t...source.at(relationAttribute.span)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\trelationName = parsedRelation.name;\n\t\t}\n\t\tif (!attributesValid) continue;\n\t\tresultBackrelationCandidates.push({\n\t\t\tmodelName: model,\n\t\t\ttableName,\n\t\t\tfield,\n\t\t\ttargetModelName: backrelationTarget,\n\t\t\tisList: field.list,\n\t\t\t...ifDefined(\"relationName\", relationName)\n\t\t});\n\t}\n\tconst relationAttributes = Object.values(model.fields).map((field) => ({\n\t\tfield,\n\t\trelation: getAttribute(field.attributes, \"relation\")\n\t})).filter((entry) => Boolean(entry.relation));\n\tconst uniqueConstraints = resolvedFields.filter((field) => field.isUnique).map((field) => ({\n\t\tcolumns: [field.columnName],\n\t\t...ifDefined(\"name\", field.uniqueName)\n\t}));\n\tconst indexNodes = [];\n\tconst checkNodes = [];\n\tconst foreignKeyNodes = [];\n\tfor (const modelAttribute of model.attributes) {\n\t\tif (!Object.hasOwn(sqlAttributeSpecs.model, modelAttribute.name) && !input.modelAttributesByName.has(modelAttribute.name)) continue;\n\t\tif (modelAttribute.name === \"map\") continue;\n\t\tif (modelAttribute.name === \"discriminator\" || modelAttribute.name === \"base\") continue;\n\t\tif (modelAttribute.name === \"control\") {\n\t\t\tif (controlPolicyDeclared) {\n\t\t\t\tdiagnostics.push(duplicateModelAttributeDiagnostic({\n\t\t\t\t\tname: \"control\",\n\t\t\t\t\tmodelName: model.name,\n\t\t\t\t\tsource,\n\t\t\t\t\tspan: modelAttribute.span\n\t\t\t\t}));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tcontrolPolicyDeclared = true;\n\t\t\tconst node = modelAttribute.node;\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tnode,\n\t\t\t\tspec: sqlAttributeSpecs.model.control(specContext),\n\t\t\t\tmodel,\n\t\t\t\tsymbols: input.symbolTable,\n\t\t\t\tsources: input.sources,\n\t\t\t\tbinder: input.binder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed !== void 0) controlPolicy = parsed.policy;\n\t\t\tcontinue;\n\t\t}\n\t\tconst attributeLabel = `Model \"${model.name}\" @@${modelAttribute.name}`;\n\t\tif (modelAttribute.name === \"id\") {\n\t\t\tif (blockPrimaryKeyDeclared) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\t\t\tmessage: `Model \"${model.name}\" declares @@id more than once`,\n\t\t\t\t\t...source.at(modelAttribute.span)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (hasInlinePrimaryKey) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\t\t\tmessage: `Model \"${model.name}\" cannot declare both field-level @id and model-level @@id`,\n\t\t\t\t\t...source.at(modelAttribute.span)\n\t\t\t\t});\n\t\t\t\tblockPrimaryKeyDeclared = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst node = modelAttribute.node;\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tnode,\n\t\t\t\tspec: sqlAttributeSpecs.model.id(specContext),\n\t\t\t\tmodel,\n\t\t\t\tsymbols: input.symbolTable,\n\t\t\t\tsources: input.sources,\n\t\t\t\tbinder: input.binder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed === void 0) continue;\n\t\t\tconst fieldNames = parsed.fields;\n\t\t\tconst nullableFieldName = fieldNames.find((name) => model.fields[name]?.optional === true);\n\t\t\tif (nullableFieldName !== void 0) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\t\t\t\tmessage: `${attributeLabel} cannot include optional field \"${nullableFieldName}\"; primary key columns must be NOT NULL`,\n\t\t\t\t\t...source.at(modelAttribute.span)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst columnNames = mapFieldNamesToColumns({\n\t\t\t\tmodel,\n\t\t\t\tphysicalNames: input.physicalNames,\n\t\t\t\tfieldNames,\n\t\t\t\tsource,\n\t\t\t\tdiagnostics,\n\t\t\t\tspan: modelAttribute.span,\n\t\t\t\tentityLabel: attributeLabel\n\t\t\t});\n\t\t\tif (!columnNames) continue;\n\t\t\tprimaryKey = {\n\t\t\t\tcolumns: columnNames,\n\t\t\t\t...ifDefined(\"name\", parsed.map)\n\t\t\t};\n\t\t\tblockPrimaryKeyDeclared = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (modelAttribute.name === \"unique\") {\n\t\t\tconst node = modelAttribute.node;\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tnode,\n\t\t\t\tspec: sqlAttributeSpecs.model.unique(specContext),\n\t\t\t\tmodel,\n\t\t\t\tsymbols: input.symbolTable,\n\t\t\t\tsources: input.sources,\n\t\t\t\tbinder: input.binder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed === void 0) continue;\n\t\t\tconst columnNames = mapFieldNamesToColumns({\n\t\t\t\tmodel,\n\t\t\t\tphysicalNames: input.physicalNames,\n\t\t\t\tfieldNames: parsed.fields,\n\t\t\t\tsource,\n\t\t\t\tdiagnostics,\n\t\t\t\tspan: modelAttribute.span,\n\t\t\t\tentityLabel: attributeLabel\n\t\t\t});\n\t\t\tif (!columnNames) continue;\n\t\t\tuniqueConstraints.push({\n\t\t\t\tcolumns: columnNames,\n\t\t\t\t...ifDefined(\"name\", parsed.map)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (modelAttribute.name === \"index\") {\n\t\t\tconst node = modelAttribute.node;\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tnode,\n\t\t\t\tspec: sqlAttributeSpecs.model.index(specContext),\n\t\t\t\tmodel,\n\t\t\t\tsymbols: input.symbolTable,\n\t\t\t\tsources: input.sources,\n\t\t\t\tbinder: input.binder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed === void 0) continue;\n\t\t\tlet columnNames;\n\t\t\tif (parsed.fields !== void 0) {\n\t\t\t\tconst mapped = mapFieldNamesToColumns({\n\t\t\t\t\tmodel,\n\t\t\t\t\tphysicalNames: input.physicalNames,\n\t\t\t\t\tfieldNames: parsed.fields,\n\t\t\t\t\tsource,\n\t\t\t\t\tdiagnostics,\n\t\t\t\t\tspan: modelAttribute.span,\n\t\t\t\t\tentityLabel: attributeLabel\n\t\t\t\t});\n\t\t\t\tif (!mapped) continue;\n\t\t\t\tcolumnNames = mapped;\n\t\t\t}\n\t\t\tindexNodes.push(blindCast({\n\t\t\t\t...ifDefined(\"columns\", columnNames),\n\t\t\t\t...ifDefined(\"expression\", parsed.expression === void 0 ? void 0 : sqlTextFromStored(parsed.expression.value.value)),\n\t\t\t\twhere: parsed.where === void 0 ? void 0 : sqlTextFromStored(parsed.where.value.value),\n\t\t\t\tunique: parsed.unique,\n\t\t\t\tname: parsed.name,\n\t\t\t\tmap: parsed.map,\n\t\t\t\ttype: parsed.type,\n\t\t\t\toptions: parsed.options\n\t\t\t}));\n\t\t\tcontinue;\n\t\t}\n\t\tif (modelAttribute.name === \"check\") {\n\t\t\tconst node = modelAttribute.node;\n\t\t\tif (input.capabilities[\"sql\"]?.[\"checkConstraint\"] !== true) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_CHECK_UNSUPPORTED_TARGET\",\n\t\t\t\t\tmessage: `Model \"${model.name}\" declares \"@@check\", but target \"${input.targetId}\" does not support check constraints (the adapter does not report the \"checkConstraint\" capability). Remove the check or author it against a target that supports check constraints.`,\n\t\t\t\t\t...source.at(modelAttribute.span)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tnode,\n\t\t\t\tspec: sqlAttributeSpecs.model.check(specContext),\n\t\t\t\tmodel,\n\t\t\t\tsymbols: input.symbolTable,\n\t\t\t\tsources: input.sources,\n\t\t\t\tbinder: input.binder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed === void 0) continue;\n\t\t\tcheckNodes.push({\n\t\t\t\texpression: sqlTextFromStored(parsed.expression.value.value),\n\t\t\t\tname: parsed.name,\n\t\t\t\tmap: parsed.map\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst contributedModelAttribute = input.modelAttributesByName.get(modelAttribute.name);\n\t\tif (contributedModelAttribute !== void 0) {\n\t\t\tif (contributedModelAttribute.repeatable !== true && declaredContributedModelAttributes.has(modelAttribute.name)) {\n\t\t\t\tdiagnostics.push(duplicateModelAttributeDiagnostic({\n\t\t\t\t\tname: modelAttribute.name,\n\t\t\t\t\tmodelName: model.name,\n\t\t\t\t\tsource,\n\t\t\t\t\tspan: modelAttribute.span\n\t\t\t\t}));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdeclaredContributedModelAttributes.add(modelAttribute.name);\n\t\t\tconst node = modelAttribute.node;\n\t\t\tconst specFactory = input.contributedModelAttributeSpecs[contributedModelAttribute.attribute];\n\t\t\tif (specFactory === void 0) continue;\n\t\t\tconst parsed = interpretModelAttribute({\n\t\t\t\tnode,\n\t\t\t\tspec: specFactory(specContext),\n\t\t\t\tmodel,\n\t\t\t\tsymbols: input.symbolTable,\n\t\t\t\tsources: input.sources,\n\t\t\t\tbinder: input.binder,\n\t\t\t\tdiagnostics\n\t\t\t});\n\t\t\tif (parsed === void 0) continue;\n\t\t\tconst lowered = blindCast(contributedModelAttribute.lower)(parsed, {\n\t\t\t\tfamily: input.familyId,\n\t\t\t\ttarget: input.targetId,\n\t\t\t\tcodecLookup: input.codecLookup,\n\t\t\t\tdataTypeLookup: input.dataTypes.lookup,\n\t\t\t\tmodelName: model.name,\n\t\t\t\tstorageName: tableName,\n\t\t\t\tfieldStorageName: (fieldName) => {\n\t\t\t\t\tconst field = model.fields[fieldName];\n\t\t\t\t\treturn field === void 0 ? void 0 : storageName(field, input.physicalNames);\n\t\t\t\t},\n\t\t\t\tfieldCodecId: (fieldName) => resolvedFields.find((resolved) => resolved.field.name === fieldName)?.descriptor.codecId,\n\t\t\t\tnamespaceId: modelNamespaceId,\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,\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\tif (targetResolution?.kind !== \"model\") {\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 targetModel = targetResolution.symbol;\n\t\tconst targetNamespaceId = targetResolution.namespace.id;\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 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\tnamespaceId: 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,\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(\"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\tnamespaceExtensionEntities: input.namespaceExtensionEntities,\n\t\t\t\tbinder,\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, namespaceId, 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\tnamespaceId,\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 modelLabel(namespaceId, modelName, qualified) {\n\treturn qualified ? `${namespaceId}.${modelName}` : modelName;\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\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 = variants[baseDecl.value];\n\t\t\tif (existingVariant) {\n\t\t\t\tconst qualified = existingVariant.namespace !== baseDecl.base.namespaceId || baseDecl.namespaceId !== baseDecl.base.namespaceId;\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 \"${modelLabel(existingVariant.namespace, existingVariant.model, qualified)}\" and \"${modelLabel(baseDecl.namespaceId, variantName, qualified)}\" on base model \"${modelLabel(baseDecl.base.namespaceId, modelName, qualified)}\"`,\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\tvariants[baseDecl.value] = crossRef(variantName, baseDecl.namespaceId);\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 baseName = baseDecl.base.model.name;\n\t\tif (!discriminatorDeclarations.has(baseDecl.base.key)) {\n\t\t\tconst qualified = baseDecl.namespaceId !== baseDecl.base.namespaceId;\n\t\t\tconst variantLabel = modelLabel(baseDecl.namespaceId, baseDecl.model.name, qualified);\n\t\t\tconst baseLabel = modelLabel(baseDecl.base.namespaceId, baseName, qualified);\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_ORPHANED_BASE\",\n\t\t\t\tmessage: `Model \"${variantLabel}\" declares @@base(${baseLabel}, ...) but \"${baseLabel}\" 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 namespaceSymbols = Object.values(input.symbolTable.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\tfor (const namespace of namespaceSymbols) {\n\t\tfor (const model of Object.values(namespace.models)) {\n\t\t\tmodels.push(model);\n\t\t\tmodelEntries.push({\n\t\t\t\tmodel,\n\t\t\t\tnamespaceId: namespace.id\n\t\t\t});\n\t\t}\n\t\tcompositeTypes.push(...Object.values(namespace.compositeTypes));\n\t}\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.symbolTable.defaultNamespace.id;\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 extensionBlocksByNamespace = /* @__PURE__ */ new Map();\n\tfor (const namespace of namespaceSymbols) {\n\t\tconst extensionBlocks = {};\n\t\textensionBlocksByNamespace.set(namespace, extensionBlocks);\n\t\tfor (const [blockName, block] of Object.entries(namespace.blocks)) {\n\t\t\tconst writtenNamespace = block.node.syntax.findAncestor(NamespaceDeclarationAst.cast);\n\t\t\tif (writtenNamespace === void 0) {\n\t\t\t\tif (!legitimateBlockKeywords.has(block.keyword)) reportUnsupportedTopLevelBlock(block);\n\t\t\t\telse if (isEnumBlock(block)) topLevelEnums.push(block);\n\t\t\t\telse extensionBlocks[blockName] = block;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\textensionBlocks[blockName] = block;\n\t\t\tif (isEnumBlock(block)) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\tcode: \"PSL_ENUM_NAMESPACE_NOT_SUPPORTED\",\n\t\t\t\t\tmessage: `enum \"${block.name}\" inside namespace \"${writtenNamespace.name()?.name() ?? namespace.name}\" is not supported; declare enum at the top level`,\n\t\t\t\t\t...diagnosticSource(input.sources, block.node.syntax).at(nodePslSpan(block.node.syntax, input.sources))\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!legitimateBlockKeywords.has(block.keyword)) reportUnsupportedTopLevelBlock(block);\n\t\t}\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 namespaceIdByModel = new Map(modelEntries.map(({ model, namespaceId }) => [model, namespaceId]));\n\tconst modelCoordinateOf = (model) => {\n\t\tconst namespaceId = namespaceIdByModel.get(model);\n\t\treturn namespaceId === void 0 ? void 0 : {\n\t\t\tnamespaceId,\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 [namespace, extensionBlocks] of extensionBlocksByNamespace) fileExtensionEntityRows(lowerExtensionBlocksForNamespace(extensionBlocks, namespace.id, entityTypesByDiscriminator, extensionEntityContext, parsedBlocks, modelCoordinateOf, input.sources), extensionBlocks);\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 = input.symbolTable.defaultNamespace.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(input.symbolTable.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\tnamespaceExtensionEntities,\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\tnamedTypes: namedTypeResult.storageTypes,\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\tparsedBlocks\n\t\t});\n\t\tmodelNodes.set(model, {\n\t\t\t...result.modelNode,\n\t\t\tnamespaceId\n\t\t});\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 existingByAttribute = modelAttributeEntitiesByNamespace.get(namespaceId) ?? {};\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(namespaceId, 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 }) => [model, {\n\t\tmodel,\n\t\tnamespaceId,\n\t\tkey: modelCoordinateKey(namespaceId, model.name)\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\tif (baseDecl.namespaceId !== baseDecl.base.namespaceId) {\n\t\t\tconst variantLabel = modelLabel(baseDecl.namespaceId, variantName, true);\n\t\t\tconst baseLabel = modelLabel(baseDecl.base.namespaceId, baseDecl.base.model.name, true);\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_BASE_IN_OTHER_NAMESPACE_WITHOUT_MAP\",\n\t\t\t\tmessage: `Model \"${variantLabel}\" declares @@base(${baseLabel}, ...) without @@map, so it would share the table of \"${baseLabel}\", which belongs to namespace \"${baseDecl.base.namespaceId}\". Add @@map to give \"${variantLabel}\" its own table.`,\n\t\t\t\t...baseDecl.source.at(baseDecl.span)\n\t\t\t});\n\t\t}\n\t\tfor (const attribute of baseDecl.model.attributes) {\n\t\t\tif (attribute.node.name()?.isSimpleName(\"check\") !== true) continue;\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: PSL_CHECK_ON_STI_VARIANT,\n\t\t\t\tmessage: `Model \"${variantName}\" declares \"@@check\", but it shares its base model \"${baseDecl.base.model.name}\"'s storage table (single-table inheritance via @@base) and has no table of its own to declare a check constraint on. Declare the check on \"${baseDecl.base.model.name}\" instead.`,\n\t\t\t\t...diagnosticSource(input.sources, attribute.node.syntax).at(nodePslSpan(attribute.node.syntax, input.sources))\n\t\t\t});\n\t\t}\n\t}\n\tconst { modelNodes: mtiLinkedModelNodes, syntheticPkFieldsByVariant } = materializeMtiVariantStorageLinks(Array.from(modelNodes, ([symbol, model]) => ({\n\t\t...model,\n\t\t...modelRelations.has(symbol) ? { relations: [...modelRelations.get(symbol) ?? []].sort((left, right) => compareStrings(left.fieldName, right.fieldName)) } : {}\n\t})), baseDeclarations, stiVariantKeys, defaultNamespaceId);\n\tconst { modelNodes: stiColumnModelNodes, stiBaseFieldsByBase } = materializeStiVariantStorageColumns(mtiLinkedModelNodes, baseDeclarations, stiVariantKeys, defaultNamespaceId);\n\tif (diagnostics.length > 0 || (input.seedDiagnostics?.length ?? 0) > 0) return notOk({\n\t\tsummary: \"PSL to SQL contract interpretation failed\",\n\t\tdiagnostics: [...input.seedDiagnostics ?? [], ...diagnostics.toExternal()]\n\t});\n\tconst { createNamespace } = input;\n\tconst createNamespaceWithExtensions = (nsInput) => {\n\t\tconst entities = namespaceExtensionEntities.get(nsInput.id);\n\t\tconst attributeEntities = modelAttributeEntitiesByNamespace.get(nsInput.id);\n\t\tif (entities === void 0 && attributeEntities === void 0) return createNamespace(nsInput);\n\t\tif (attributeEntities !== void 0) {\n\t\t\tfor (const slot of Object.keys(attributeEntities)) if (Object.hasOwn(nsInput.entries, slot) || entities !== void 0 && slot in entities) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `entries slot \"${slot}\" in namespace \"${nsInput.id}\" is contributed by both a model attribute and a block/base entry kind. A model-attribute entries key must be unique across the namespace's entry kinds.`, { meta: {\n\t\t\t\tslot,\n\t\t\t\tnamespaceId: nsInput.id\n\t\t\t} });\n\t\t}\n\t\tconst mergedValueSet = {\n\t\t\t...nsInput.entries[\"valueSet\"],\n\t\t\t...entities?.[\"valueSet\"]\n\t\t};\n\t\tconst extended = {\n\t\t\t...nsInput,\n\t\t\tentries: {\n\t\t\t\t...nsInput.entries,\n\t\t\t\t...entities,\n\t\t\t\t...attributeEntities,\n\t\t\t\t...Object.keys(mergedValueSet).length > 0 ? { valueSet: mergedValueSet } : {}\n\t\t\t}\n\t\t};\n\t\treturn createNamespace(extended);\n\t};\n\tlet contract;\n\ttry {\n\t\tcontract = buildSqlContractFromDefinition({\n\t\t\ttarget: input.target,\n\t\t\tcapabilities: input.capabilities,\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-kQuqdyeP.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,g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,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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pack-DNdZwm5w.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,WAAW,qCAAqC,6DAA6D;UACpH;mBACS;mBACA;mBACA;mBACA;mBACA;mBACA;0CACuB;iBACzB,UAAU,oCAAoC,6DAA6D;UAClH,sCAAsC,sBAtCnB,mDAsCiJ,iDAAiD,sBAApG,qBAA+K,sBAA0E,oBAA2E;0CACrZ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"psl-build-BT8Ue6gd.mjs","names":[],"sources":["../../../../2-sql/9-family/dist/psl-build.mjs"],"sourcesContent":["import { t as sqlFamilyError } from \"./errors-B5g0xWro.mjs\";\nimport { s as toEnumMemberName } from \"./psl-names-C3cwe0rg.mjs\";\nimport { SQL_EXPRESSION_TAG } from \"@internal/sql-contract/sql-expression\";\nimport { authoringTypeConstructorArguments, authoringTypeConstructors, castTypedValue, instantiateAuthoringFieldPreset, instantiateAuthoringTypeConstructor, printTaggedLiteral, readWrittenValue, validateAuthoringHelperArguments } from \"@internal/framework-components/authoring\";\nimport { dataTypeId, dataTypeParams } from \"@internal/framework-components/codec\";\nimport { InternalError, isInternalError } from \"@internal/utils/internal-error\";\nimport { isRuntimeError } from \"@internal/framework-components/components\";\nimport { isSqlDataType, numeralText, resolveReportedSqlType } from \"@internal/sql-contract/data-type\";\nimport { canonicalizeJson } from \"@internal/framework-components/utils\";\nimport { escapePslString } from \"@internal/sql-contract/data-type-support\";\n//#region src/core/psl-build/inferred-type-constructors.ts\n/** Every constructor of `authoringTypes` marked `inferred`, by the data type its codec represents. */\nfunction inferredTypeConstructors(input) {\n\tconst found = /* @__PURE__ */ new Map();\n\tfor (const { path, descriptor } of authoringTypeConstructors(input.authoringTypes)) {\n\t\tif (descriptor.inferred !== true) continue;\n\t\tconst dataTypeId = input.codecLookup.descriptorFor(descriptor.output.codecId)?.dataType;\n\t\tconst dataType = dataTypeId === void 0 ? void 0 : input.dataTypeLookup.get(dataTypeId);\n\t\tif (dataType === void 0 || !isSqlDataType(dataType)) continue;\n\t\tfound.set(dataType.id, {\n\t\t\tpath,\n\t\t\tdescriptor,\n\t\t\tdataType\n\t\t});\n\t}\n\treturn found;\n}\nfunction normalParams(marked, args) {\n\ttry {\n\t\tconst { typeParams } = instantiateAuthoringTypeConstructor(marked.descriptor, args);\n\t\tconst params = dataTypeParams(marked.dataType, typeParams);\n\t\treturn canonicalizeJson(marked.dataType.sql.normalize(params));\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn;\n\t}\n}\n/**\n* The call to `marked` with the fewest arguments that produces `params`, the normal form of a\n* column's data type parameters: arguments are dropped from the end while the normal form of what\n* the call produces stays `params`. Undefined when the constructor cannot produce them, such as one\n* whose argument names another entity.\n*/\nfunction fewestArgumentsCall(marked, params) {\n\tconst all = authoringTypeConstructorArguments(marked.descriptor, {\n\t\tcodecId: marked.descriptor.output.codecId,\n\t\ttypeParams: params\n\t});\n\tif (all === void 0) return void 0;\n\tconst wanted = canonicalizeJson(params);\n\tconst args = [...all];\n\twhile (args.length > 0 && normalParams(marked, args.slice(0, -1)) === wanted) args.pop();\n\treturn {\n\t\tpath: marked.path,\n\t\targs\n\t};\n}\n/**\n* A type constructor argument as PSL writes it: a number or boolean as written, a string between quotes.\n* Undefined for any other value, such as an array or an object, and for a string PSL cannot carry, because a quote, backslash or line break in it would read back differently.\n*/\nfunction pslTypeArgumentText(value) {\n\tif (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n\tif (typeof value !== \"string\") return void 0;\n\treturn escapePslString(value) === value ? `\"${value}\"` : void 0;\n}\n//#endregion\n//#region src/core/psl-build/column-types.ts\n/** The type the database reported for `column`, which introspection always records. */\nfunction reportedTypeOf(column, tableName) {\n\tif (column.reportedType === void 0) throw new InternalError(`contract infer read column \"${tableName}\".\"${column.name}\" without the type the database reported for it.`);\n\treturn column.reportedType;\n}\nfunction writtenCall(constructors, dataTypes, reported) {\n\tconst resolved = resolveReportedSqlType(reported, dataTypes);\n\tconst marked = resolved && constructors.get(resolved.dataType.id);\n\tconst call = resolved && marked && fewestArgumentsCall(marked, resolved.typeParams);\n\tif (call === void 0) return void 0;\n\tconst args = call.args.map(pslTypeArgumentText);\n\treturn args.every((arg) => arg !== void 0) ? {\n\t\tpath: call.path,\n\t\targs\n\t} : void 0;\n}\n/**\n* The type of every column of `tables` that `isEnumColumn` does not claim: the call, with the\n* fewest arguments, to the constructor marked `inferred` for the data type that claims the\n* column's reported type. When any column has no such call, throws\n* `CONTRACT.INFER_COLUMN_TYPE_UNCLAIMED` listing every one of them.\n*/\nfunction inferColumnTypes(input) {\n\tconst dataTypes = [...input.constructors.values()].map((marked) => marked.dataType);\n\tconst types = /* @__PURE__ */ new Map();\n\tconst unclaimed = [];\n\tfor (const { schemaName, tableName, columns } of input.tables) for (const column of columns) {\n\t\tif (input.isEnumColumn(column)) continue;\n\t\tconst reported = reportedTypeOf(column, tableName);\n\t\tconst call = writtenCall(input.constructors, dataTypes, reported);\n\t\tif (call === void 0) {\n\t\t\tunclaimed.push(`${schemaName}.${tableName}.${column.name}: ${reported.text}${column.many === true ? \"[]\" : \"\"}`);\n\t\t\tcontinue;\n\t\t}\n\t\ttypes.set(JSON.stringify([tableName, column.name]), call);\n\t}\n\tif (unclaimed.length > 0) {\n\t\tconst columns = unclaimed.sort();\n\t\tthrow sqlFamilyError(\"CONTRACT.INFER_COLUMN_TYPE_UNCLAIMED\", [\"contract infer: Prisma 8 cannot write these column types with the configured stack:\", ...columns.map((line) => ` ${line}`)].join(\"\\n\"), {\n\t\t\twhy: \"Prisma 8 reads a column type only through a data type that the target or an extension pack declares.\",\n\t\t\tfix: \"No configured pack has a type for these columns. If a type comes from a database extension that has a Prisma 8 pack, add the pack to extensions in prisma.config.ts. Otherwise change the column's type or remove the column from the database.\",\n\t\t\tmeta: { columns }\n\t\t});\n\t}\n\treturn (tableName, columnName) => {\n\t\tconst type = types.get(JSON.stringify([tableName, columnName]));\n\t\tif (type === void 0) throw new InternalError(`contract infer resolved no type for \"${tableName}\".\"${columnName}\".`);\n\t\treturn type;\n\t};\n}\n//#endregion\n//#region src/core/psl-build/default-mapping.ts\nconst DEFAULT_FUNCTION_ATTRIBUTES = {\n\t\"autoincrement()\": \"@default(autoincrement())\",\n\t\"now()\": \"@default(now())\"\n};\n/**\n* The attribute a stored default prints as: a named function, a literal the column takes, or any\n* other expression as a `sql` literal. `undefined` when a literal has no written form. An expression\n* prints even when the literal would read back as different text: default expressions are compared\n* with case and whitespace ignored (`SqlColumnDefaultIR.isEqualTo`), and canonicalization changes only\n* whitespace (ADR 129).\n*/\nfunction mapDefault(columnDefault, options) {\n\tswitch (columnDefault.kind) {\n\t\tcase \"literal\": {\n\t\t\tconst text = writeDefaultLiteral(columnDefault.value, options);\n\t\t\treturn text === void 0 ? void 0 : { attribute: `@default(${text})` };\n\t\t}\n\t\tcase \"function\": return { attribute: options?.functionAttributes?.[columnDefault.expression] ?? DEFAULT_FUNCTION_ATTRIBUTES[columnDefault.expression] ?? `@default(${printTaggedLiteral(SQL_EXPRESSION_TAG, columnDefault.expression)})` };\n\t}\n}\nfunction writingSurface(support) {\n\tconst entryOf = /* @__PURE__ */ new Map();\n\tconst tagTypes = [];\n\tfor (const [key, entry] of Object.entries(support.entries)) {\n\t\tconst written = entry.written;\n\t\tif (written.kind === \"tag\") {\n\t\t\tconst type = dataTypeId(key);\n\t\t\tif (!entryOf.has(type)) entryOf.set(type, entry);\n\t\t\ttagTypes.push(type);\n\t\t\tcontinue;\n\t\t}\n\t\tif (written.syntax === \"number\") {\n\t\t\tfor (const type of written.types) entryOf.set(type, entry);\n\t\t\tcontinue;\n\t\t}\n\t\tentryOf.set(key, entry);\n\t}\n\treturn {\n\t\tsupport,\n\t\tentryOf,\n\t\ttagTypes\n\t};\n}\nfunction readValue(surface, written) {\n\tconst read = readWrittenValue(surface.support, written);\n\treturn read.ok ? read.value : void 0;\n}\n/** The value of a tag's type that a stored document is, constructed by that type. */\nfunction tagValue(surface, type, value) {\n\ttry {\n\t\treturn surface.support.lookup.get(type)?.valueFrom(value, {});\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn;\n\t}\n}\n/**\n* Every value the stored form could be, in the order a written value would be read: a number or\n* numeral text through the number entry first, then the plain syntax that matches the shape, then\n* each tag, whose stored form is a whole document, which may itself be a number or a boolean.\n*/\nfunction classifications(value, surface) {\n\tconst found = [];\n\tif (typeof value === \"number\") found.push(readValue(surface, {\n\t\tkind: \"number\",\n\t\ttext: numeralText(value)\n\t}));\n\telse if (typeof value === \"boolean\") found.push(readValue(surface, {\n\t\tkind: \"boolean\",\n\t\tvalue\n\t}));\n\telse if (typeof value === \"string\") {\n\t\tfound.push(readValue(surface, {\n\t\t\tkind: \"number\",\n\t\t\ttext: value\n\t\t}));\n\t\tfound.push(readValue(surface, {\n\t\t\tkind: \"string\",\n\t\t\ttext: value\n\t\t}));\n\t}\n\tfor (const type of surface.tagTypes) found.push(tagValue(surface, type, value));\n\treturn found.filter((candidate) => candidate !== void 0);\n}\n/** What the column's type stores for `json` under the column's parameters, or `undefined` when it holds no such value. */\nfunction storedUnder(json, column, lookup) {\n\tconst type = lookup.get(column.id);\n\tif (type === void 0) return void 0;\n\ttry {\n\t\treturn type.toContract(type.valueFrom(json, column.params));\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn;\n\t}\n}\n/** The stored form the column takes this value as, spelled as its parameters give it, or `undefined` when its type takes no such value. */\nfunction admitted(candidate, column, surface) {\n\tconst cast = castTypedValue(surface.support, column.id, column.params, candidate);\n\treturn cast.ok ? cast.value.value : void 0;\n}\n/** The text of the literal: what the entry prints, before the syntax that fences it. */\nfunction printedText(entry, value) {\n\ttry {\n\t\treturn entry.print(value);\n\t} catch {\n\t\treturn;\n\t}\n}\n/** The printed text as the entry's syntax writes it, for reading back. */\nfunction writtenAs(entry, text) {\n\tconst written = entry.written;\n\tif (written.kind === \"tag\") return {\n\t\tkind: \"tag\",\n\t\ttag: written.tag,\n\t\ttext\n\t};\n\tif (written.syntax !== \"boolean\") return {\n\t\tkind: written.syntax,\n\t\ttext\n\t};\n\treturn text === \"true\" || text === \"false\" ? {\n\t\tkind: \"boolean\",\n\t\tvalue: text === \"true\"\n\t} : void 0;\n}\n/** What the printed text reads back as, through the same read a written value takes. */\nfunction readBack(surface, entry, text) {\n\tconst written = writtenAs(entry, text);\n\treturn written === void 0 ? void 0 : readValue(surface, written);\n}\nfunction literalText(entry, text) {\n\tconst written = entry.written;\n\tif (written.kind === \"tag\") return printTaggedLiteral(written.tag, text);\n\treturn written.syntax === \"string\" ? `\"${escapePslString(text)}\"` : text;\n}\n/**\n* The value written as the literal of one of its types, proven by reading the text straight back:\n* the same read, the same cast, and the stored form again. A number is tried first without the\n* trailing fraction zeros the column's scale spells it with.\n*/\nfunction writeScalar(value, column, surface) {\n\tconst shortest = withoutTrailingFractionZeros(value);\n\tconst candidates = [...shortest === void 0 ? [] : classifications(shortest, surface), ...classifications(value, surface)];\n\tfor (const candidate of candidates) {\n\t\tconst entry = surface.entryOf.get(candidate.type);\n\t\tif (entry === void 0) continue;\n\t\tconst stored = admitted(candidate, column, surface);\n\t\tif (stored === void 0 || !sameForm(stored, value)) continue;\n\t\tconst text = printedText(entry, candidate.value);\n\t\tif (text === void 0) continue;\n\t\tconst reread = readBack(surface, entry, text);\n\t\tif (reread === void 0) continue;\n\t\tconst restored = admitted(reread, column, surface);\n\t\tif (restored === void 0 || !sameForm(restored, value)) continue;\n\t\treturn literalText(entry, text);\n\t}\n}\nconst DECIMAL_WITH_FRACTION = /^-?\\d+\\.\\d+$/;\nfunction withoutTrailingFractionZeros(value) {\n\tif (typeof value !== \"string\" || !DECIMAL_WITH_FRACTION.test(value)) return void 0;\n\tconst shortened = value.replace(/0+$/, \"\").replace(/\\.$/, \"\");\n\treturn shortened === value ? void 0 : shortened;\n}\n/** One written element of a list, printed as a value of any type, with no column type to admit it. */\nfunction writeElement(value, of, surface) {\n\tfor (const candidate of classifications(value, surface)) {\n\t\tif (!of.includes(candidate.type)) continue;\n\t\tconst entry = surface.entryOf.get(candidate.type);\n\t\tif (entry === void 0) continue;\n\t\tconst text = printedText(entry, candidate.value);\n\t\tif (text === void 0) continue;\n\t\tconst reread = readBack(surface, entry, text);\n\t\tif (reread === void 0 || !of.includes(reread.type)) continue;\n\t\treturn {\n\t\t\ttext: literalText(entry, text),\n\t\t\tvalue: reread.value\n\t\t};\n\t}\n}\n/**\n* A written list on a scalar column, which the column type's list cast turns into its one value,\n* constructed by the column's type. Each element is classified on its own and must be of a type the\n* cast takes.\n*/\nfunction writeListCast(value, column, surface) {\n\tconst listCast = surface.support.lookup.get(column.id)?.listCast;\n\tif (listCast === void 0) return void 0;\n\tconst parts = [];\n\tconst elements = [];\n\tfor (const element of value) {\n\t\tconst written = writeElement(element, listCast.of, surface);\n\t\tif (written === void 0) return void 0;\n\t\tparts.push(written.text);\n\t\telements.push(written.value);\n\t}\n\tlet cast;\n\ttry {\n\t\tcast = listCast.cast(elements);\n\t} catch (error) {\n\t\tif (isInternalError(error)) throw error;\n\t\treturn;\n\t}\n\tconst stored = storedUnder(cast, column, surface.support.lookup);\n\treturn stored !== void 0 && sameForm(stored, value) ? `[${parts.join(\", \")}]` : void 0;\n}\nfunction writeDefaultLiteral(value, options) {\n\tif (value instanceof Date) return void 0;\n\tconst { dataTypes, columnCodec } = options ?? {};\n\tif (dataTypes === void 0 || columnCodec === void 0) return void 0;\n\tconst { lookup } = dataTypes;\n\tconst columnDataType = columnCodec.dataType;\n\tconst columnType = lookup.get(columnDataType);\n\tconst column = {\n\t\tid: columnDataType,\n\t\tparams: columnType === void 0 ? {} : dataTypeParams(columnType, options?.typeParams)\n\t};\n\tconst surface = writingSurface(dataTypes);\n\tif (options?.list === true) {\n\t\tif (!Array.isArray(value)) return void 0;\n\t\tconst parts = [];\n\t\tfor (const element of value) {\n\t\t\tconst written = writeScalar(element, column, surface);\n\t\t\tif (written === void 0) return void 0;\n\t\t\tparts.push(written);\n\t\t}\n\t\treturn `[${parts.join(\", \")}]`;\n\t}\n\tconst written = writeScalar(value, column, surface);\n\tif (written !== void 0) return written;\n\treturn Array.isArray(value) ? writeListCast(value, column, surface) : void 0;\n}\n/** Whether two stored forms are the same JSON value, member by member and element by element. */\nfunction sameForm(left, right) {\n\tif (left === right) return true;\n\tif (Array.isArray(left) !== Array.isArray(right)) return false;\n\tif (typeof left !== \"object\" || typeof right !== \"object\" || left === null || right === null) return false;\n\tconst members = Object.entries(left);\n\tconst others = new Map(Object.entries(right));\n\treturn members.length === others.size && members.every(([key, member]) => {\n\t\tconst other = others.get(key);\n\t\treturn other !== void 0 && sameForm(member, other);\n\t});\n}\n//#endregion\n//#region src/core/psl-build/generated-values.ts\n/** The PSL call of the default function that produces `generatorId` with `params`, or `undefined` when no default function in the stack writes it. */\nfunction defaultFunctionCallFor(defaultFunctionPrintersByGenerator, generatorId, params) {\n\tconst printer = defaultFunctionPrintersByGenerator.get(generatorId);\n\treturn printer === void 0 ? void 0 : `${printer.functionName}(${printer.printArguments(params)})`;\n}\nconst PHASES = [\"onCreate\", \"onUpdate\"];\nfunction sameParams(left, right) {\n\treturn canonicalizeJson(left ?? {}) === canonicalizeJson(right ?? {});\n}\nfunction sameGenerator(left, right) {\n\tif (left === void 0 || right === void 0) return left === right;\n\treturn left.id === right.id && sameParams(left.params, right.params);\n}\nfunction writesEveryPhase(printForm, column) {\n\treturn PHASES.every((phase) => {\n\t\tconst generatorId = column.generators[phase]?.id;\n\t\treturn generatorId === void 0 || printForm[phase]?.valuesByGenerator.has(generatorId);\n\t});\n}\nfunction writtenArguments(printForm, column) {\n\tconst positional = [];\n\tfor (const [index, name] of printForm.typeParams.entries()) {\n\t\tconst value = column.typeParams?.[name];\n\t\tif (value === void 0) break;\n\t\tconst text = pslTypeArgumentText(value);\n\t\tif (text === void 0) return {\n\t\t\tkind: \"unwritable\",\n\t\t\targument: name,\n\t\t\tvalue\n\t\t};\n\t\tpositional.push({\n\t\t\tindex,\n\t\t\tvalue,\n\t\t\targument: {\n\t\t\t\tkind: \"positional\",\n\t\t\t\tvalue: text\n\t\t\t}\n\t\t});\n\t}\n\tconst named = PHASES.flatMap((phase) => {\n\t\tconst phasePrintForm = printForm[phase];\n\t\tconst generatorId = column.generators[phase]?.id;\n\t\tconst value = generatorId === void 0 ? void 0 : phasePrintForm?.valuesByGenerator.get(generatorId);\n\t\tif (phasePrintForm === void 0 || value === void 0) return [];\n\t\tconst { argument: name, index } = phasePrintForm;\n\t\treturn [{\n\t\t\tindex,\n\t\t\tvalue,\n\t\t\targument: {\n\t\t\t\tkind: \"named\",\n\t\t\t\tname,\n\t\t\t\tvalue\n\t\t\t}\n\t\t}];\n\t});\n\treturn {\n\t\tkind: \"written\",\n\t\targuments: [...positional, ...named]\n\t};\n}\nfunction rejectionOf(preset, args) {\n\ttry {\n\t\tvalidateAuthoringHelperArguments(preset.path.join(\".\"), preset.descriptor.args, args);\n\t\treturn;\n\t} catch (error) {\n\t\tif (isRuntimeError(error) && error.code === \"CONTRACT.ARGUMENT_INVALID\") return error.message;\n\t\tthrow error;\n\t}\n}\nfunction readBackDifferences(preset, column, args) {\n\tconst printed = instantiateAuthoringFieldPreset(preset.descriptor, args);\n\tconst printedGenerators = printed.executionDefaults ?? {};\n\treturn [\n\t\t...printed.descriptor.codecId === column.codecId ? [] : [{\n\t\t\tpart: \"codecId\",\n\t\t\tcolumn: column.codecId,\n\t\t\tprinted: printed.descriptor.codecId\n\t\t}],\n\t\t...sameParams(column.typeParams, printed.descriptor.typeParams) ? [] : [{\n\t\t\tpart: \"typeParams\",\n\t\t\tcolumn: column.typeParams,\n\t\t\tprinted: printed.descriptor.typeParams\n\t\t}],\n\t\t...PHASES.flatMap((phase) => sameGenerator(column.generators[phase], printedGenerators[phase]) ? [] : [{\n\t\t\tpart: phase,\n\t\t\tcolumn: column.generators[phase],\n\t\t\tprinted: printedGenerators[phase]\n\t\t}])\n\t];\n}\nfunction cannotWrite(preset, reason) {\n\treturn {\n\t\tkind: \"cannotWrite\",\n\t\tpreset,\n\t\treason\n\t};\n}\n/**\n* The call of the field preset in the stack that writes a column's codec with its generators. The call is written only for a column that is not a list and whose PSL type stands for its data type, which the preset call takes the place of, and when the preset accepts its arguments as the PSL reader checks them; it is then checked to read back with the column's codec, type params and generators with their params, where absent and empty params count as the same. Otherwise the reason it cannot be written that way.\n*/\nfunction fieldPresetCallFor(input) {\n\tconst { column } = input;\n\tconst byGenerator = input.fieldPresetsByCodecAndGenerator.get(column.codecId);\n\tconst preset = PHASES.map((phase) => column.generators[phase]?.id).map((generatorId) => generatorId === void 0 ? void 0 : byGenerator?.get(generatorId)).find((found) => found !== void 0);\n\tif (preset === void 0) return { kind: \"noPreset\" };\n\tconst { pslType } = column;\n\tif (pslType.kind !== \"dataType\") return cannotWrite(preset, {\n\t\tkind: \"columnType\",\n\t\tcolumnType: pslType.kind,\n\t\ttypeName: pslType.typeName\n\t});\n\tif (column.list) return cannotWrite(preset, { kind: \"list\" });\n\tif (!writesEveryPhase(preset.printForm, column)) return cannotWrite(preset, { kind: \"phasesNotWrittenTogether\" });\n\tconst written = writtenArguments(preset.printForm, column);\n\tif (written.kind === \"unwritable\") return cannotWrite(preset, {\n\t\tkind: \"unwritableArgument\",\n\t\targument: written.argument,\n\t\tvalue: written.value\n\t});\n\tconst args = [];\n\tfor (const { index, value } of written.arguments) args[index] = value;\n\tconst rejection = rejectionOf(preset, args);\n\tif (rejection !== void 0) return cannotWrite(preset, {\n\t\tkind: \"argumentsRejected\",\n\t\tmessage: rejection\n\t});\n\tconst differences = readBackDifferences(preset, column, args);\n\tif (differences.length > 0) return {\n\t\tkind: \"readsBackDifferently\",\n\t\tpreset,\n\t\tdifferences\n\t};\n\treturn {\n\t\tkind: \"call\",\n\t\tpreset,\n\t\targuments: written.arguments.map(({ argument }) => argument)\n\t};\n}\n//#endregion\nexport { defaultFunctionCallFor, fewestArgumentsCall, fieldPresetCallFor, inferColumnTypes, inferredTypeConstructors, mapDefault, pslTypeArgumentText, toEnumMemberName };\n\n//# sourceMappingURL=psl-build.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,yBAAyB,OAAO;CACxC,MAAM,wBAAwB,IAAI,IAAI;CACtC,KAAK,MAAM,EAAE,MAAM,gBAAgB,0BAA0B,MAAM,cAAc,GAAG;EACnF,IAAI,WAAW,aAAa,MAAM;EAClC,MAAM,aAAa,MAAM,YAAY,cAAc,WAAW,OAAO,OAAO,CAAC,EAAE;EAC/E,MAAM,WAAW,eAAe,KAAK,IAAI,KAAK,IAAI,MAAM,eAAe,IAAI,UAAU;EACrF,IAAI,aAAa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AS;CACV,CAAC;CACD,MAAM,cAAc,oBAAoB,QAAQ,QAAQ,IAAI;CAC5D,IAAI,YAAY,SAAS,GAAG,OAAO;EAClC,MAAM;EACN;EACA;CACD;CACA,OAAO;EACN,MAAM;EACN;EACA,WAAW,QAAQ,UAAU,KAAK,EAAE,eAAe,QAAQ;CAC5D;AACD"}
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { u as SqlColumnIR } from "./types-B3AHHPDh-BHh-89fY.mjs";
|
|
2
|
-
import "./types-BGERR8XF.mjs";
|
|
3
|
-
import { r as SqlDataType, s as SqlTypeParams } from "./data-type-C84xngfv.mjs";
|
|
4
|
-
import "./default-mapping-CEISdj2g-DF1LzGBR.mjs";
|
|
5
|
-
import { AuthoringTypeConstructorCall, AuthoringTypeConstructorDescriptor, AuthoringTypeNamespace, FieldPresetsByCodecAndGenerator, PrintableFieldPreset } from "@prisma/orm-framework/components/authoring";
|
|
6
|
-
import { CodecLookupWithDescriptors, DataTypeLookup } from "@prisma/orm-framework/components/codec";
|
|
7
|
-
import { ExecutionMutationDefaultPhases, ExecutionMutationDefaultValue } from "@prisma/orm-framework/contract/types";
|
|
8
|
-
import { DefaultFunctionPrinter } from "@prisma/orm-framework/components/control";
|
|
9
|
-
//#region ../../../2-sql/9-family/dist/psl-build.d.mts
|
|
10
|
-
//#region src/core/psl-build/inferred-type-constructors.d.ts
|
|
11
|
-
/** The type constructor `contract infer` writes for a data type, with the data type it produces. */
|
|
12
|
-
interface InferredTypeConstructor {
|
|
13
|
-
readonly path: readonly string[];
|
|
14
|
-
readonly descriptor: AuthoringTypeConstructorDescriptor;
|
|
15
|
-
readonly dataType: SqlDataType;
|
|
16
|
-
}
|
|
17
|
-
/** The constructors marked `inferred` in a stack, keyed by the id of the data type each produces. */
|
|
18
|
-
type InferredTypeConstructors = ReadonlyMap<string, InferredTypeConstructor>;
|
|
19
|
-
/** Every constructor of `authoringTypes` marked `inferred`, by the data type its codec represents. */
|
|
20
|
-
declare function inferredTypeConstructors(input: {
|
|
21
|
-
readonly authoringTypes: AuthoringTypeNamespace;
|
|
22
|
-
readonly codecLookup: Pick<CodecLookupWithDescriptors, 'descriptorFor'>;
|
|
23
|
-
readonly dataTypeLookup: DataTypeLookup;
|
|
24
|
-
}): InferredTypeConstructors;
|
|
25
|
-
/**
|
|
26
|
-
* The call to `marked` with the fewest arguments that produces `params`, the normal form of a
|
|
27
|
-
* column's data type parameters: arguments are dropped from the end while the normal form of what
|
|
28
|
-
* the call produces stays `params`. Undefined when the constructor cannot produce them, such as one
|
|
29
|
-
* whose argument names another entity.
|
|
30
|
-
*/
|
|
31
|
-
declare function fewestArgumentsCall(marked: InferredTypeConstructor, params: SqlTypeParams): AuthoringTypeConstructorCall | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* A type constructor argument as PSL writes it: a number or boolean as written, a string between quotes.
|
|
34
|
-
* Undefined for any other value, such as an array or an object, and for a string PSL cannot carry, because a quote, backslash or line break in it would read back differently.
|
|
35
|
-
*/
|
|
36
|
-
declare function pslTypeArgumentText(value: unknown): string | undefined;
|
|
37
|
-
//#endregion
|
|
38
|
-
//#region src/core/psl-build/column-types.d.ts
|
|
39
|
-
/** A call to a type constructor as PSL writes it: the constructor's path and its arguments' text. */
|
|
40
|
-
interface PslTypeCall {
|
|
41
|
-
readonly path: readonly string[];
|
|
42
|
-
readonly args: readonly string[];
|
|
43
|
-
}
|
|
44
|
-
/** The PSL type `contract infer` writes for a column that is not an enum, by table and column name. */
|
|
45
|
-
type ColumnTypeOf = (tableName: string, columnName: string) => PslTypeCall;
|
|
46
|
-
/** One introspected table, with the schema it was read from. */
|
|
47
|
-
interface IntrospectedTable {
|
|
48
|
-
readonly schemaName: string;
|
|
49
|
-
readonly tableName: string;
|
|
50
|
-
readonly columns: readonly SqlColumnIR[];
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* The type of every column of `tables` that `isEnumColumn` does not claim: the call, with the
|
|
54
|
-
* fewest arguments, to the constructor marked `inferred` for the data type that claims the
|
|
55
|
-
* column's reported type. When any column has no such call, throws
|
|
56
|
-
* `CONTRACT.INFER_COLUMN_TYPE_UNCLAIMED` listing every one of them.
|
|
57
|
-
*/
|
|
58
|
-
declare function inferColumnTypes(input: {
|
|
59
|
-
readonly tables: readonly IntrospectedTable[];
|
|
60
|
-
readonly constructors: InferredTypeConstructors;
|
|
61
|
-
readonly isEnumColumn: (column: SqlColumnIR) => boolean;
|
|
62
|
-
}): ColumnTypeOf;
|
|
63
|
-
//#endregion
|
|
64
|
-
//#region src/core/psl-build/generated-values.d.ts
|
|
65
|
-
/** The PSL call of the default function that produces `generatorId` with `params`, or `undefined` when no default function in the stack writes it. */
|
|
66
|
-
declare function defaultFunctionCallFor(defaultFunctionPrintersByGenerator: ReadonlyMap<string, DefaultFunctionPrinter>, generatorId: string, params: Readonly<Record<string, unknown>> | undefined): string | undefined;
|
|
67
|
-
type FieldPresetArgument = {
|
|
68
|
-
readonly kind: 'positional';
|
|
69
|
-
readonly value: string;
|
|
70
|
-
} | {
|
|
71
|
-
readonly kind: 'named';
|
|
72
|
-
readonly name: string;
|
|
73
|
-
readonly value: string;
|
|
74
|
-
};
|
|
75
|
-
type ColumnPhase = 'onCreate' | 'onUpdate';
|
|
76
|
-
/**
|
|
77
|
-
* What a column's PSL type stands for. `dataType` is a type that stands for the column's codec and type params alone, written as a bare name such as `String` or a call such as `Timestamptz(3)`. A named type, a value object or an enum, including a native enum written `pg.enum(<Block>)`, names something more.
|
|
78
|
-
*/
|
|
79
|
-
type PslColumnTypeKind = 'dataType' | 'namedType' | 'valueObject' | 'enum';
|
|
80
|
-
/** The name a column's PSL type is written with, and what it stands for. */
|
|
81
|
-
interface PslColumnTypeRef {
|
|
82
|
-
readonly kind: PslColumnTypeKind;
|
|
83
|
-
readonly typeName: string;
|
|
84
|
-
}
|
|
85
|
-
/** Why the call of the preset that writes a column's codec with its generators cannot be written. */
|
|
86
|
-
type FieldPresetUnwritableReason = {
|
|
87
|
-
readonly kind: 'columnType';
|
|
88
|
-
readonly columnType: Exclude<PslColumnTypeKind, 'dataType'>;
|
|
89
|
-
readonly typeName: string;
|
|
90
|
-
} | {
|
|
91
|
-
readonly kind: 'list';
|
|
92
|
-
} | {
|
|
93
|
-
readonly kind: 'phasesNotWrittenTogether';
|
|
94
|
-
} | {
|
|
95
|
-
readonly kind: 'unwritableArgument';
|
|
96
|
-
readonly argument: string;
|
|
97
|
-
readonly value: unknown;
|
|
98
|
-
} | {
|
|
99
|
-
readonly kind: 'argumentsRejected';
|
|
100
|
-
readonly message: string;
|
|
101
|
-
};
|
|
102
|
-
/** A part of the column the preset call, once written, reads back differently. */
|
|
103
|
-
type FieldPresetReadBackDifference = {
|
|
104
|
-
readonly part: 'codecId';
|
|
105
|
-
readonly column: string;
|
|
106
|
-
readonly printed: string;
|
|
107
|
-
} | {
|
|
108
|
-
readonly part: 'typeParams';
|
|
109
|
-
readonly column: Readonly<Record<string, unknown>> | undefined;
|
|
110
|
-
readonly printed: Readonly<Record<string, unknown>> | undefined;
|
|
111
|
-
} | {
|
|
112
|
-
readonly part: ColumnPhase;
|
|
113
|
-
readonly column: ExecutionMutationDefaultValue | undefined;
|
|
114
|
-
readonly printed: ExecutionMutationDefaultValue | undefined;
|
|
115
|
-
};
|
|
116
|
-
/** How a column's generators are written with a field preset, or why they cannot be. */
|
|
117
|
-
type FieldPresetCallChoice = {
|
|
118
|
-
readonly kind: 'noPreset';
|
|
119
|
-
} | {
|
|
120
|
-
readonly kind: 'call';
|
|
121
|
-
readonly preset: PrintableFieldPreset;
|
|
122
|
-
readonly arguments: readonly FieldPresetArgument[];
|
|
123
|
-
} | {
|
|
124
|
-
readonly kind: 'cannotWrite';
|
|
125
|
-
readonly preset: PrintableFieldPreset;
|
|
126
|
-
readonly reason: FieldPresetUnwritableReason;
|
|
127
|
-
} | {
|
|
128
|
-
readonly kind: 'readsBackDifferently';
|
|
129
|
-
readonly preset: PrintableFieldPreset;
|
|
130
|
-
readonly differences: readonly FieldPresetReadBackDifference[];
|
|
131
|
-
};
|
|
132
|
-
interface FieldPresetColumn {
|
|
133
|
-
readonly codecId: string;
|
|
134
|
-
readonly pslType: PslColumnTypeRef;
|
|
135
|
-
readonly list: boolean;
|
|
136
|
-
readonly typeParams: Readonly<Record<string, unknown>> | undefined;
|
|
137
|
-
readonly generators: ExecutionMutationDefaultPhases;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* The call of the field preset in the stack that writes a column's codec with its generators. The call is written only for a column that is not a list and whose PSL type stands for its data type, which the preset call takes the place of, and when the preset accepts its arguments as the PSL reader checks them; it is then checked to read back with the column's codec, type params and generators with their params, where absent and empty params count as the same. Otherwise the reason it cannot be written that way.
|
|
141
|
-
*/
|
|
142
|
-
declare function fieldPresetCallFor(input: {
|
|
143
|
-
readonly fieldPresetsByCodecAndGenerator: FieldPresetsByCodecAndGenerator;
|
|
144
|
-
readonly column: FieldPresetColumn;
|
|
145
|
-
}): FieldPresetCallChoice;
|
|
146
|
-
//#endregion
|
|
147
|
-
//#region src/core/psl-build/psl-names.d.ts
|
|
148
|
-
/**
|
|
149
|
-
* PSL member name for a native-enum value. The value itself always prints
|
|
150
|
-
* explicitly (`member = "value"`), so the returned name never needs a map:
|
|
151
|
-
* a value that already is a valid, non-reserved identifier is kept verbatim
|
|
152
|
-
* (case included); anything else is camelCased/escaped like a field name.
|
|
153
|
-
*/
|
|
154
|
-
declare function toEnumMemberName(value: string): string;
|
|
155
|
-
//#endregion
|
|
156
|
-
export { pslTypeArgumentText as _, FieldPresetUnwritableReason as a, IntrospectedTable as c, PslTypeCall as d, defaultFunctionCallFor as f, inferredTypeConstructors as g, inferColumnTypes as h, FieldPresetReadBackDifference as i, PslColumnTypeKind as l, fieldPresetCallFor as m, FieldPresetArgument as n, InferredTypeConstructor as o, fewestArgumentsCall as p, FieldPresetCallChoice as r, InferredTypeConstructors as s, ColumnTypeOf as t, PslColumnTypeRef as u, toEnumMemberName as v };
|
|
157
|
-
//# sourceMappingURL=psl-build-DU55bjfu.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"psl-build-DU55bjfu.d.mts","names":[],"sources":["../../../../2-sql/9-family/dist/psl-build.d.mts"],"mappings":";;;;;;;;;;;UASU;WACC;WACA,YAAY;WACZ,UAAU;;;KAGhB,2BAA2B,oBAAoB;;iBAEnC,yBAAyB;WAC/B,gBAAgB;WAChB,aAAa,KAAK;WAClB,gBAAgB;IACvB;;;;;;;iBAOa,oBAAoB,QAAQ,yBAAyB,QAAQ,gBAAgB;;;;;iBAK7E,oBAAoB;;;;UAI3B;WACC;WACA;;;KAGN,gBAAgB,mBAAmB,uBAAuB;;UAErD;WACC;WACA;WACA,kBAAkB;;;;;;;;iBAQZ,iBAAiB;WACvB,iBAAiB;WACjB,cAAc;WACd,eAAe,QAAQ;IAC9B;;;;iBAIa,uBAAuB,oCAAoC,oBAAoB,yBAAyB,qBAAqB,QAAQ,SAAS;KAC1J;WACM;WACA;;WAEA;WACA;WACA;;KAEN;;;;KAIA;;UAEK;WACC,MAAM;WACN;;;KAGN;WACM;WACA,YAAY,QAAQ;WACpB;;WAEA;;WAEA;;WAEA;WACA;WACA;;WAEA;WACA;;;KAGN;WACM;WACA;WACA;;WAEA;WACA,QAAQ,SAAS;WACjB,SAAS,SAAS;;WAElB,MAAM;WACN,QAAQ;WACR,SAAS;;;KAGf;WACM;;WAEA;WACA,QAAQ;WACR,oBAAoB;;WAEpB;WACA,QAAQ;WACR,QAAQ;;WAER;WACA,QAAQ;WACR,sBAAsB;;UAEvB;WACC;WACA,SAAS;WACT;WACA,YAAY,SAAS;WACrB,YAAY;;;;;iBAKN,mBAAmB;WACzB,iCAAiC;WACjC,QAAQ;IACf;;;;;;;;;iBASa,iBAAiB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"psl-column-resolution-BCkhNzOK-DyfXnB-9.d.mts","names":[],"sources":["../../../../2-sql/2-authoring/contract-psl/dist/psl-column-resolution-BCkhNzOK.d.mts"],"mappings":";;;;;;;;KAQK;WACM;WACA;WACA,aAAa;;;;;;;;;WASb,WAAW"}
|