@prisma/orm-target-postgres 8.0.0-rc.11-dev.28 → 8.0.0-rc.11-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.
Files changed (43) hide show
  1. package/dist/{adapter-bTD1EPrl-DQ66tQwz.mjs → adapter-bTD1EPrl-BOp2y3Vk.mjs} +2 -2
  2. package/dist/{adapter-bTD1EPrl-DQ66tQwz.mjs.map → adapter-bTD1EPrl-BOp2y3Vk.mjs.map} +1 -1
  3. package/dist/adapter.mjs +2 -2
  4. package/dist/adapter__adapter.mjs +1 -1
  5. package/dist/adapter__control.mjs +6 -2
  6. package/dist/adapter__control.mjs.map +1 -1
  7. package/dist/adapter__runtime.mjs +2 -2
  8. package/dist/{control-DDfLaDsG.mjs → control-BIGO0LQ1.mjs} +5 -5
  9. package/dist/{control-DDfLaDsG.mjs.map → control-BIGO0LQ1.mjs.map} +1 -1
  10. package/dist/{control-adapter-Bdz-Xa1p-rKiOVhsh.mjs → control-adapter-Bdz-Xa1p-97fNF5gu.mjs} +2 -2
  11. package/dist/{control-adapter-Bdz-Xa1p-rKiOVhsh.mjs.map → control-adapter-Bdz-Xa1p-97fNF5gu.mjs.map} +1 -1
  12. package/dist/{control-policy-B8x7UxGf-BjTez7am.mjs → control-policy-CkLZsw31-DjVVWnnz.mjs} +9 -10
  13. package/dist/control-policy-CkLZsw31-DjVVWnnz.mjs.map +1 -0
  14. package/dist/{diff-database-schema-BFX0ZWWK-KVfAPOLF.mjs → diff-database-schema-c9IWEO2V-DCnp7F4-.mjs} +3 -3
  15. package/dist/{diff-database-schema-BFX0ZWWK-KVfAPOLF.mjs.map → diff-database-schema-c9IWEO2V-DCnp7F4-.mjs.map} +1 -1
  16. package/dist/{infer-psl-contract-BaZaJAD9-DTVu5Zab.mjs → infer-psl-contract-CBsWEERT-CdfjzeCW.mjs} +3 -7
  17. package/dist/{infer-psl-contract-BaZaJAD9-DTVu5Zab.mjs.map → infer-psl-contract-CBsWEERT-CdfjzeCW.mjs.map} +1 -1
  18. package/dist/migration-PTHAY9Cv.mjs.map +1 -1
  19. package/dist/{op-factory-call-B3-CevCo-CSV5SL9W.mjs → op-factory-call-Bp6F2UEs-Bze_DuAk.mjs} +3 -3
  20. package/dist/{op-factory-call-B3-CevCo-CSV5SL9W.mjs.map → op-factory-call-Bp6F2UEs-Bze_DuAk.mjs.map} +1 -1
  21. package/dist/{planner-C_TrM6kn-Dj1rgql2.mjs → planner-D9WzYlHl-CS_7pV8A.mjs} +6 -6
  22. package/dist/{planner-C_TrM6kn-Dj1rgql2.mjs.map → planner-D9WzYlHl-CS_7pV8A.mjs.map} +1 -1
  23. package/dist/{planner-ddl-builders-CpXQ-J0X-CL5gNUSG.mjs → planner-ddl-builders-DTCYp-qA-DF16uM8O.mjs} +4 -3
  24. package/dist/planner-ddl-builders-DTCYp-qA-DF16uM8O.mjs.map +1 -0
  25. package/dist/{planner-produced-postgres-migration-CNmh50cN-qepqYtvL.mjs → planner-produced-postgres-migration-92hFiR1t-BxAT0uTi.mjs} +3 -3
  26. package/dist/{planner-produced-postgres-migration-CNmh50cN-qepqYtvL.mjs.map → planner-produced-postgres-migration-92hFiR1t-BxAT0uTi.mjs.map} +1 -1
  27. package/dist/{postgres-migration-CydbiBd3-BRXOU7KP.mjs → postgres-migration-BAGJ7FgH-4XbbekAu.mjs} +3 -3
  28. package/dist/{postgres-migration-CydbiBd3-BRXOU7KP.mjs.map → postgres-migration-BAGJ7FgH-4XbbekAu.mjs.map} +1 -1
  29. package/dist/{prisma7-binding-Db1xpliZ.mjs → prisma7-binding-BBC8EYpL.mjs} +2 -2
  30. package/dist/{prisma7-binding-Db1xpliZ.mjs.map → prisma7-binding-BBC8EYpL.mjs.map} +1 -1
  31. package/dist/target.mjs +9 -9
  32. package/dist/target__control.mjs +1 -1
  33. package/dist/target__diff-database-schema.mjs +1 -1
  34. package/dist/target__issue-planner.mjs +1 -1
  35. package/dist/target__migration.mjs +2 -2
  36. package/dist/target__op-factory-call.mjs +1 -1
  37. package/dist/target__planner-ddl-builders.mjs +1 -1
  38. package/dist/target__planner-produced-postgres-migration.mjs +1 -1
  39. package/dist/target__planner.mjs +2 -2
  40. package/dist/target__prisma7-binding.mjs +1 -1
  41. package/package.json +9 -9
  42. package/dist/control-policy-B8x7UxGf-BjTez7am.mjs.map +0 -1
  43. package/dist/planner-ddl-builders-CpXQ-J0X-CL5gNUSG.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"infer-psl-contract-BaZaJAD9-DTVu5Zab.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/infer-psl-contract-BaZaJAD9.mjs"],"sourcesContent":["import { s as postgresError } from \"./errors-DYyzTYzE.mjs\";\nimport { t as parsePostgresDefault } from \"./default-normalizer-Bjtm2F4f.mjs\";\nimport { t as postgresRenderCheckExpressions } from \"./check-expressions-DFTeR0rd.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { coordinateKey, elementCoordinates } from \"@internal/framework-components/ir\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { composeCheckWirePrefix, computeCheckContentHash, computeIndexContentHash, formatWireName, parseWireName } from \"@internal/sql-schema-ir/naming\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { SqlSchemaIR, SqlTableIR } from \"@internal/sql-schema-ir/types\";\nimport { buildChildRelationField, deriveRelationFieldName, inferRelations, mapDefault, toEnumMemberName, toEnumName, toFieldName, toModelName } from \"@internal/family-sql/psl-infer\";\nimport { UNSPECIFIED_PSL_NAMESPACE_ID, makePslNamespace, makePslNamespaceEntries } from \"@internal/framework-components/psl-ast\";\nimport { isColumnDefault } from \"@internal/contract/types\";\n//#region src/core/psl-infer/infer-names.ts\nfunction buildFieldNamesByTable(tables) {\n\tconst fieldNamesByTable = /* @__PURE__ */ new Map();\n\tfor (const table of Object.values(tables)) {\n\t\tconst assignmentOrder = [...Object.values(table.columns).map((column, index) => {\n\t\t\tconst { name, map } = toFieldName(column.name);\n\t\t\treturn {\n\t\t\t\tcolumnName: column.name,\n\t\t\t\tdesiredFieldName: name,\n\t\t\t\tfieldMap: map,\n\t\t\t\tindex\n\t\t\t};\n\t\t})].sort((left, right) => {\n\t\t\tconst mapComparison = Number(left.fieldMap !== void 0) - Number(right.fieldMap !== void 0);\n\t\t\tif (mapComparison !== 0) return mapComparison;\n\t\t\treturn left.index - right.index;\n\t\t});\n\t\tconst usedFieldNames = /* @__PURE__ */ new Set();\n\t\tconst tableFieldNames = /* @__PURE__ */ new Map();\n\t\tfor (const column of assignmentOrder) {\n\t\t\tconst fieldName = createUniqueFieldName(column.desiredFieldName, usedFieldNames);\n\t\t\tusedFieldNames.add(fieldName);\n\t\t\ttableFieldNames.set(column.columnName, {\n\t\t\t\tfieldName,\n\t\t\t\tfieldMap: column.fieldMap\n\t\t\t});\n\t\t}\n\t\tfieldNamesByTable.set(table.name, tableFieldNames);\n\t}\n\treturn fieldNamesByTable;\n}\nfunction resolveColumnFieldName(fieldNamesByTable, tableName, columnName) {\n\treturn fieldNamesByTable.get(tableName)?.get(columnName)?.fieldName ?? toFieldName(columnName).name;\n}\nfunction createUniqueFieldName(desiredName, usedFieldNames) {\n\tif (!usedFieldNames.has(desiredName)) return desiredName;\n\tlet counter = 2;\n\twhile (usedFieldNames.has(`${desiredName}${counter}`)) counter++;\n\treturn `${desiredName}${counter}`;\n}\nfunction buildTopLevelNameMap(sources, normalize, kind, sourceKind) {\n\tconst results = /* @__PURE__ */ new Map();\n\tconst normalizedToSources = /* @__PURE__ */ new Map();\n\tfor (const source of sources) {\n\t\tconst normalized = normalize(source);\n\t\tresults.set(source, normalized);\n\t\tnormalizedToSources.set(normalized.name, [...normalizedToSources.get(normalized.name) ?? [], source]);\n\t}\n\tconst duplicates = [...normalizedToSources.entries()].filter(([, conflictingSources]) => conflictingSources.length > 1);\n\tif (duplicates.length > 0) throw postgresError(\"CONTRACT.NAME_DUPLICATE\", `PSL ${kind} name collisions detected:\\n${duplicates.map(([normalizedName, conflictingSources]) => `- ${kind} \"${normalizedName}\" from ${sourceKind}s ${conflictingSources.map((source) => `\"${source}\"`).join(\", \")}`).join(\"\\n\")}`, { meta: {\n\t\tkind,\n\t\tnames: duplicates.map(([normalizedName]) => normalizedName)\n\t} });\n\treturn results;\n}\nfunction topologicalSort(models, tables, modelNameMap) {\n\tconst modelByName = /* @__PURE__ */ new Map();\n\tfor (const model of models) modelByName.set(model.name, model);\n\tconst deps = /* @__PURE__ */ new Map();\n\tconst tableToModel = /* @__PURE__ */ new Map();\n\tfor (const tableName of Object.keys(tables)) {\n\t\tconst modelName = modelNameMap.get(tableName);\n\t\tassertDefined(modelName, `topologicalSort: no model name mapped for table \"${tableName}\"`);\n\t\ttableToModel.set(tableName, modelName);\n\t\tdeps.set(modelName, /* @__PURE__ */ new Set());\n\t}\n\tfor (const [tableName, table] of Object.entries(tables)) {\n\t\tconst modelName = tableToModel.get(tableName);\n\t\tassertDefined(modelName, `topologicalSort: no model name recorded for table \"${tableName}\"`);\n\t\tconst modelDeps = deps.get(modelName);\n\t\tassertDefined(modelDeps, `topologicalSort: no dependency set recorded for model \"${modelName}\"`);\n\t\tfor (const fk of table.foreignKeys) {\n\t\t\tconst refModelName = tableToModel.get(fk.referencedTable);\n\t\t\tif (refModelName && refModelName !== modelName) modelDeps.add(refModelName);\n\t\t}\n\t}\n\tconst result = [];\n\tconst visited = /* @__PURE__ */ new Set();\n\tconst visiting = /* @__PURE__ */ new Set();\n\tconst sortedNames = [...deps.keys()].sort();\n\tfunction visit(name) {\n\t\tif (visited.has(name)) return;\n\t\tif (visiting.has(name)) return;\n\t\tvisiting.add(name);\n\t\tconst nameDeps = deps.get(name);\n\t\tassertDefined(nameDeps, `topologicalSort: no dependency set recorded for model \"${name}\"`);\n\t\tconst sortedDeps = [...nameDeps].sort();\n\t\tfor (const dep of sortedDeps) visit(dep);\n\t\tvisiting.delete(name);\n\t\tvisited.add(name);\n\t\tconst model = modelByName.get(name);\n\t\tassertDefined(model, `topologicalSort: no model block recorded for \"${name}\"`);\n\t\tresult.push(model);\n\t}\n\tfor (const name of sortedNames) visit(name);\n\treturn result;\n}\n//#endregion\n//#region src/core/psl-infer/psl-literals.ts\nconst SYNTHETIC_SPAN = {\n\tstart: {\n\t\toffset: 0,\n\t\tline: 1,\n\t\tcolumn: 1\n\t},\n\tend: {\n\t\toffset: 0,\n\t\tline: 1,\n\t\tcolumn: 1\n\t}\n};\nfunction buildSimpleConstraintFieldAttribute(name, constraintName) {\n\tif (constraintName === void 0) return buildAttribute(\"field\", name, []);\n\treturn buildAttribute(\"field\", name, [namedArg(\"map\", `\"${escapePslString(constraintName)}\"`)]);\n}\nfunction parseDefaultAttributeString(attributeText) {\n\treturn buildAttribute(\"field\", \"default\", [positionalArg(attributeText.replace(/^@default\\(/, \"\").replace(/\\)$/, \"\"))]);\n}\nfunction buildMapAttribute(target, mapName) {\n\treturn buildAttribute(target, \"map\", [positionalArg(`\"${escapePslString(mapName)}\"`)]);\n}\nfunction buildAttribute(target, name, args) {\n\treturn {\n\t\tkind: \"attribute\",\n\t\ttarget,\n\t\tname,\n\t\targs,\n\t\tspan: SYNTHETIC_SPAN\n\t};\n}\nfunction positionalArg(value) {\n\treturn {\n\t\tkind: \"positional\",\n\t\tvalue,\n\t\tspan: SYNTHETIC_SPAN\n\t};\n}\nfunction namedArg(name, value) {\n\treturn {\n\t\tkind: \"named\",\n\t\tname,\n\t\tvalue,\n\t\tspan: SYNTHETIC_SPAN\n\t};\n}\nfunction escapePslString(value) {\n\treturn value.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\");\n}\nconst INTEGER_TEXT = /^-?\\d+$/;\nconst SPECIAL_VALUE_TEXT = /^(?:NaN|-?Infinity)$/;\nconst DECIMAL_TEXT = /^(?:-?\\d+(?:\\.\\d+)?|NaN|-?Infinity)$/;\n/** PSL has no exponent syntax, so the decimal point moves to where the exponent puts it. */\nfunction plainNumeral(value) {\n\tconst [coefficient = \"\", exponent] = String(value).split(\"e\");\n\tif (exponent === void 0) return coefficient;\n\tconst sign = coefficient.startsWith(\"-\") ? \"-\" : \"\";\n\tconst [whole = \"\", fraction = \"\"] = coefficient.slice(sign.length).split(\".\");\n\tconst digits = `${whole}${fraction}`;\n\tconst point = whole.length + Number(exponent);\n\tif (point <= 0) return `${sign}0.${\"0\".repeat(-point)}${digits}`;\n\tif (point >= digits.length) return `${sign}${digits}${\"0\".repeat(point - digits.length)}`;\n\treturn `${sign}${digits.slice(0, point)}.${digits.slice(point)}`;\n}\nconst formatPslValue = (value) => {\n\tif (typeof value === \"string\") return `\"${escapePslString(value)}\"`;\n\tif (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n};\nconst formatNumber = (value) => typeof value === \"number\" && Number.isFinite(value) ? plainNumeral(value) : void 0;\n/** PSL has no number for `NaN` or `Infinity`; the float codecs pass their quoted text through. */\nconst formatFloat = (value) => typeof value === \"string\" && SPECIAL_VALUE_TEXT.test(value) ? `\"${value}\"` : formatNumber(value);\n/**\n* `pg/int8@1` reads a PSL number from the text written, so every digit of an `int8` survives. A\n* PSL string is not a `bigint`. A JavaScript number past the safe integer range is already rounded.\n*/\nconst formatInteger = (value) => {\n\tif (typeof value === \"string\") return INTEGER_TEXT.test(value) ? value : void 0;\n\treturn typeof value === \"number\" && Number.isSafeInteger(value) ? String(value) : void 0;\n};\n/**\n* `pg/numeric@1` stores decimal text, `NaN` or `Infinity`, and reads a PSL string as that text. A\n* PSL number would also keep every digit, but has no spelling for `NaN` or `Infinity`.\n*/\nconst formatDecimalText = (value) => {\n\tconst text = typeof value === \"number\" && Number.isFinite(value) ? plainNumeral(value) : value;\n\treturn typeof text === \"string\" && DECIMAL_TEXT.test(text) ? `\"${text}\"` : void 0;\n};\n/**\n* The codecs of `Date`, `Time`, `Timestamp` and `Timestamptz` encode Temporal values, which no PSL\n* literal is. A JSON codec reads a PSL string as a JSON string, not as JSON text, so a JSON default\n* keeps its raw expression.\n*/\nconst noLiteral = () => void 0;\nconst DEFAULT_VALUE_FORMATS = /* @__PURE__ */ new Map([\n\t[\"Int\", formatNumber],\n\t[\"SmallInt\", formatNumber],\n\t[\"Float\", formatFloat],\n\t[\"Real\", formatFloat],\n\t[\"BigInt\", formatInteger],\n\t[\"Numeric\", formatDecimalText],\n\t[\"Date\", noLiteral],\n\t[\"Time\", noLiteral],\n\t[\"Timestamp\", noLiteral],\n\t[\"Timestamptz\", noLiteral],\n\t[\"Json\", noLiteral],\n\t[\"Jsonb\", noLiteral]\n]);\n/** The default value format for a field of a PSL type the Postgres type map resolves. */\nfunction pslDefaultValueFormat(typeName) {\n\treturn DEFAULT_VALUE_FORMATS.get(typeName) ?? formatPslValue;\n}\n/**\n* Formats a resolved list default as PSL literal-list syntax (`[1, 2]`, `[\"a\"]`, `[]`), or returns\n* `undefined` when any element has no literal, such as `null` or a value `format` refuses.\n*/\nfunction formatPslListLiteralValue(elements, format) {\n\tconst parts = [];\n\tfor (const element of elements) {\n\t\tconst part = format(element);\n\t\tif (part === void 0) return void 0;\n\t\tparts.push(part);\n\t}\n\treturn `[${parts.join(\", \")}]`;\n}\n/**\n* Resolves a `SqlColumnIR.default` value into a normalized {@link ColumnDefault}.\n*\n* `SqlSchemaIR` types the column default as `string` (a raw database default\n* expression). Some legacy fixtures and tests still pass already-normalized\n* `ColumnDefault` objects in the same slot, so we accept either shape\n* defensively at runtime.\n*/\nfunction parseColumnDefault(value, nativeType, rawDefaultParser) {\n\tif (typeof value === \"string\") return rawDefaultParser ? rawDefaultParser(value, nativeType) : void 0;\n\treturn isColumnDefault(value) ? value : void 0;\n}\n//#endregion\n//#region src/core/psl-infer/infer-enum-blocks.ts\nconst PSL_SCALAR_TYPE_NAMES = /* @__PURE__ */ new Set([\n\t\"String\",\n\t\"Boolean\",\n\t\"Int\",\n\t\"BigInt\",\n\t\"Float\",\n\t\"Decimal\",\n\t\"DateTime\",\n\t\"Json\",\n\t\"Bytes\"\n]);\n/**\n* Builds one `native_enum` extension-block AST node per introspected enum\n* definition. Block names go through the shared top-level transform\n* (`toEnumName`, intra-enum collisions throw like model collisions) and are\n* then reserved against the model names — an enum whose PSL name a model\n* already claims gets a numeric suffix, with `@@map` carrying the real type\n* name. Members print as explicit `member = \"value\"` pairs: the member name\n* is the sanitized value (deduplicated within the block), the JSON-encoded\n* value carries the truth verbatim.\n*/\nfunction buildNativeEnumBlocks(definitions, modelNames) {\n\tconst enumNames = buildTopLevelNameMap([...definitions.keys()].sort(), toEnumName, \"enum\", \"enum type\");\n\tconst usedTopLevelNames = new Set(PSL_SCALAR_TYPE_NAMES);\n\tfor (const result of modelNames.values()) usedTopLevelNames.add(result.name);\n\tconst enumNameMap = /* @__PURE__ */ new Map();\n\tconst enumBlocks = [];\n\tfor (const [typeName, result] of enumNames) {\n\t\tconst name = createUniqueFieldName(result.name, usedTopLevelNames);\n\t\tusedTopLevelNames.add(name);\n\t\tenumNameMap.set(typeName, name);\n\t\tenumBlocks.push(buildNativeEnumBlock(name, typeName, definitions.get(typeName) ?? []));\n\t}\n\treturn {\n\t\tenumNameMap,\n\t\tenumBlocks\n\t};\n}\nfunction buildNativeEnumBlock(name, typeName, values) {\n\tconst usedMemberNames = /* @__PURE__ */ new Set();\n\tconst parameters = {};\n\tfor (const value of values) {\n\t\tconst memberName = createUniqueFieldName(toEnumMemberName(value), usedMemberNames);\n\t\tusedMemberNames.add(memberName);\n\t\tparameters[memberName] = {\n\t\t\tkind: \"value\",\n\t\t\traw: JSON.stringify(value),\n\t\t\tspan: SYNTHETIC_SPAN\n\t\t};\n\t}\n\treturn {\n\t\tkind: \"native_enum\",\n\t\tkeyword: \"native_enum\",\n\t\tname,\n\t\tparameters,\n\t\tblockAttributes: name === typeName ? [] : [{\n\t\t\tname: \"map\",\n\t\t\targs: [{\n\t\t\t\tkind: \"positional\",\n\t\t\t\tvalue: `\"${escapePslString(typeName)}\"`,\n\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t}],\n\t\t\tspan: SYNTHETIC_SPAN\n\t\t}],\n\t\tattributes: name === typeName ? {} : { map: {\n\t\t\targs: { name: typeName },\n\t\t\tspan: SYNTHETIC_SPAN\n\t\t} },\n\t\tspan: SYNTHETIC_SPAN\n\t};\n}\n//#endregion\n//#region src/core/psl-infer/infer-foreign-keys.ts\n/**\n* Coordinates every element a set of already-assembled contracts declare,\n* mapped to the {@link SqlDescribedContractSpace} that owns it and keyed by\n* the shared {@link coordinateKey} helper. `contract infer` uses this to omit\n* database elements a stack extension pack's contract space already\n* describes — reusing the same coordinate walk the contract-space aggregate\n* and cross-space collision check use (`elementCoordinates`), rather than a\n* bespoke per-entity-kind membership test — and, for a foreign key whose\n* referenced table an entry owns, to resolve the qualified cross-space\n* relation it describes.\n*/\nfunction describedContractOwners(describedContracts) {\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const entry of describedContracts) for (const coordinate of elementCoordinates(entry.contract.storage)) owners.set(coordinateKey(coordinate), entry);\n\treturn owners;\n}\nfunction resolveCrossSpaceTarget(owner, namespaceId, tableName) {\n\tconst domainNamespace = owner.contract.domain.namespaces[namespaceId];\n\tif (domainNamespace === void 0) return;\n\tfor (const [modelName, model] of Object.entries(domainNamespace.models)) {\n\t\tconst storage = blindCast(model.storage);\n\t\tif (storage.namespaceId !== namespaceId || storage.table !== tableName) continue;\n\t\tconst fieldNamesByColumn = /* @__PURE__ */ new Map();\n\t\tfor (const [fieldName, fieldStorage] of Object.entries(storage.fields)) fieldNamesByColumn.set(fieldStorage.column, { fieldName });\n\t\treturn {\n\t\t\tspaceId: owner.spaceId,\n\t\t\tnamespaceId,\n\t\t\tmodelName,\n\t\t\tfieldNamesByColumn\n\t\t};\n\t}\n}\n/**\n* Classifies every foreign key on a surviving table into one of three cases.\n* A foreign key that carries a `referencedSchema` is checked against the\n* pack-owned coordinates first, so a pack-owned target wins even when a local\n* table happens to share its bare name; only foreign keys with no owned\n* coordinate fall through to the local/dangling distinction.\n*\n* - **Cross-space**: `referencedSchema` is set and a described contract owns\n* the coordinate `(referencedSchema, 'table', referencedTable)`. The\n* referenced table is absent from the tree (omitted because the pack\n* describes it, or never introspected — `contract infer` walks a single\n* namespace). Removed from `foreignKeys` (so `inferRelations` never falls\n* back to a bare, unqualified table name for it) and replaced with a\n* `RelationField` qualified with the owning pack's space id and namespace\n* id. `owners` holds only pack-declared coordinates, so an app's own table\n* (e.g. `public.users`) is never owned and cannot be captured here.\n* - **Local**: not a pack-owned coordinate, and the referenced table survived\n* introspection — left untouched, `inferRelations` handles it as before.\n* - **Dangling**: not a pack-owned coordinate, and the referenced table is\n* neither in the tree nor owned by any described contract. Removed from\n* `foreignKeys`, keeping the scalar column, rather than emitting a relation\n* to a model that was never defined.\n*\n* A pack that owns the referenced coordinate but declares no domain model\n* mapped to it is malformed; that case throws rather than degrading to a\n* silent drop, which would contradict the dangling definition above.\n*/\nfunction resolveForeignKeys(tables, owners) {\n\tconst resultTables = {};\n\tconst extraRelationsByTable = /* @__PURE__ */ new Map();\n\tconst crossSpaceFieldNamesByTable = /* @__PURE__ */ new Map();\n\tconst danglingForeignKeysByTable = /* @__PURE__ */ new Map();\n\tfor (const [tableName, table] of Object.entries(tables)) {\n\t\tconst keptForeignKeys = [];\n\t\tfor (const fk of table.foreignKeys) {\n\t\t\tif (fk.referencedSchema !== void 0) {\n\t\t\t\tconst owner = owners.get(coordinateKey({\n\t\t\t\t\tnamespaceId: fk.referencedSchema,\n\t\t\t\t\tentityKind: \"table\",\n\t\t\t\t\tentityName: fk.referencedTable\n\t\t\t\t}));\n\t\t\t\tif (owner !== void 0) {\n\t\t\t\t\tconst target = resolveCrossSpaceTarget(owner, fk.referencedSchema, fk.referencedTable);\n\t\t\t\t\tif (target === void 0) throw postgresError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `contract infer: described contract space \"${owner.spaceId}\" owns storage coordinate \"${fk.referencedSchema}.${fk.referencedTable}\" but declares no domain model mapped to it. A pack that describes a table must also declare the domain model it maps to; this pack is malformed.`, { meta: {\n\t\t\t\t\t\tspaceId: owner.spaceId,\n\t\t\t\t\t\ttableName: fk.referencedTable\n\t\t\t\t\t} });\n\t\t\t\t\tif (!crossSpaceFieldNamesByTable.has(fk.referencedTable)) crossSpaceFieldNamesByTable.set(fk.referencedTable, target.fieldNamesByColumn);\n\t\t\t\t\tconst fieldName = deriveRelationFieldName(fk.columns, fk.referencedTable);\n\t\t\t\t\tconst optional = fk.columns.some((columnName) => table.columns[columnName]?.nullable ?? false);\n\t\t\t\t\tconst relationField = {\n\t\t\t\t\t\t...buildChildRelationField(fieldName, target.modelName, fk, optional, void 0, table),\n\t\t\t\t\t\ttypeNamespaceId: target.namespaceId,\n\t\t\t\t\t\ttypeContractSpaceId: target.spaceId\n\t\t\t\t\t};\n\t\t\t\t\tconst existingRelations = extraRelationsByTable.get(tableName);\n\t\t\t\t\tif (existingRelations) existingRelations.push(relationField);\n\t\t\t\t\telse extraRelationsByTable.set(tableName, [relationField]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (tables[fk.referencedTable] !== void 0) keptForeignKeys.push(fk);\n\t\t\telse {\n\t\t\t\tconst dangling = {\n\t\t\t\t\tcolumns: fk.columns,\n\t\t\t\t\treferencedSchema: fk.referencedSchema,\n\t\t\t\t\treferencedTable: fk.referencedTable\n\t\t\t\t};\n\t\t\t\tconst existingDangling = danglingForeignKeysByTable.get(tableName);\n\t\t\t\tif (existingDangling) existingDangling.push(dangling);\n\t\t\t\telse danglingForeignKeysByTable.set(tableName, [dangling]);\n\t\t\t}\n\t\t}\n\t\tresultTables[tableName] = keptForeignKeys.length === table.foreignKeys.length ? table : new SqlTableIR({\n\t\t\t...table,\n\t\t\tforeignKeys: keptForeignKeys\n\t\t});\n\t}\n\treturn {\n\t\ttables: resultTables,\n\t\textraRelationsByTable,\n\t\tcrossSpaceFieldNamesByTable,\n\t\tdanglingForeignKeysByTable\n\t};\n}\n/**\n* Explains a foreign key `resolveForeignKeys` dropped as dangling: the\n* database enforces it, but its target lives outside the introspected\n* schema, so infer has no model to point a relation at. The suggested fix\n* targets the common cause — an unconfigured extension pack's schema\n* (e.g. Supabase's `auth`).\n*/\nfunction buildDanglingForeignKeyWarning(danglingForeignKeys, fieldNamesByTable, tableName) {\n\treturn `Foreign key ${danglingForeignKeys.map((fk) => {\n\t\tconst fieldNames = fk.columns.map((columnName) => resolveColumnFieldName(fieldNamesByTable, tableName, columnName));\n\t\tconst target = fk.referencedSchema !== void 0 ? `${fk.referencedSchema}.${fk.referencedTable}` : fk.referencedTable;\n\t\treturn `\"${fieldNames.join(\", \")}\" -> \"${target}\"`;\n\t}).join(\", \")} exists in the database, but its target schema is outside the introspected scope, so no relation field was generated. If the target schema is described by an extension pack, add it to extensions and re-run infer.`;\n}\n//#endregion\n//#region src/core/psl-infer/infer-index-attributes.ts\nfunction buildModelConstraintAttribute(name, fields, constraintName) {\n\tconst args = [positionalArg(`[${fields.join(\", \")}]`)];\n\tif (constraintName !== void 0) args.push(namedArg(\"map\", `\"${escapePslString(constraintName)}\"`));\n\treturn buildAttribute(\"model\", name, args);\n}\n/**\n* Emits one `@@index` attribute at full fidelity. The index's identity is\n* re-detected rather than trusted: `name:` is emitted only when the live name\n* parses as a wire name AND that hash recomputes from the introspected\n* content; otherwise the live name is adopted verbatim with `map:`.\n*/\nfunction buildIndexAttribute(index, fieldNames) {\n\tconst args = [];\n\tif (fieldNames !== void 0) args.push(positionalArg(`[${fieldNames.join(\", \")}]`));\n\telse {\n\t\tassertDefined(index.expression, `buildIndexAttribute: index \"${index.name}\" carries neither columns nor expression; SqlIndexIR enforces exactly one`);\n\t\targs.push(namedArg(\"expression\", `\"${escapePslString(index.expression)}\"`));\n\t}\n\tconst parsed = parseWireName(index.name);\n\tconst recomputed = computeIndexContentHash({\n\t\t...index.columns !== void 0 ? { columns: index.columns } : {},\n\t\t...index.expression !== void 0 ? { expression: index.expression } : {},\n\t\t...index.where !== void 0 ? { where: index.where } : {},\n\t\tunique: index.unique,\n\t\t...index.type !== void 0 ? { type: index.type } : {},\n\t\t...index.options !== void 0 ? { options: index.options } : {}\n\t});\n\tif (parsed !== void 0 && parsed.hash === recomputed) args.push(namedArg(\"name\", `\"${escapePslString(parsed.prefix)}\"`));\n\telse args.push(namedArg(\"map\", `\"${escapePslString(index.name)}\"`));\n\tif (index.where !== void 0) args.push(namedArg(\"where\", `\"${escapePslString(index.where)}\"`));\n\tif (index.unique) args.push(namedArg(\"unique\", \"true\"));\n\tconst hasOptions = index.options !== void 0 && Object.keys(index.options).length > 0;\n\tif (index.type !== void 0 || hasOptions) args.push(namedArg(\"type\", `\"${escapePslString(index.type ?? \"btree\")}\"`));\n\tif (hasOptions) {\n\t\tconst entries = Object.entries(index.options ?? {}).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([key, value]) => `${key}: \"${escapePslString(String(value))}\"`);\n\t\targs.push(namedArg(\"options\", `{ ${entries.join(\", \")} }`));\n\t}\n\treturn buildAttribute(\"model\", \"index\", args);\n}\n/**\n* Emits one `@@check` attribute for a live, non-derived check, always in the\n* `map:` form. Re-detecting `name:` is not attempted: the live expression is\n* Postgres's own reprint, but a wire-named check's hash was taken over the\n* author's original text, so recomputing the hash from the reprint would\n* essentially never match. `map:` plus the verbatim reprint is correct\n* regardless — a reprint compared against a later reprint of the same\n* expression is stable, so the emitted contract signs the live database with\n* zero pending operations. `buildPolicyBlocks` makes the same call for\n* `@@map` on adopted RLS policies, for the same reason.\n*/\nfunction buildCheckAttribute(check) {\n\treturn buildAttribute(\"model\", \"check\", [namedArg(\"expression\", `\"${escapePslString(check.expression)}\"`), namedArg(\"map\", `\"${escapePslString(check.name)}\"`)]);\n}\n//#endregion\n//#region src/core/psl-infer/infer-model-blocks.ts\nfunction buildModel(table, typeMap, enumNameMap, fieldNamesByTable, defaultMapping, rawDefaultParser, relationFields, danglingForeignKeys, rlsEnabled = false, policySkipNotes = []) {\n\tconst { name: modelName, map: mapName } = toModelName(table.name);\n\tconst fieldNameMap = fieldNamesByTable.get(table.name);\n\tconst pkColumns = new Set(table.primaryKey?.columns ?? []);\n\tconst isSinglePk = pkColumns.size === 1;\n\tconst singlePkConstraintName = isSinglePk ? table.primaryKey?.name : void 0;\n\tconst uniqueColumns = /* @__PURE__ */ new Map();\n\tfor (const unique of table.uniques) if (unique.columns.length === 1) {\n\t\tconst [columnName = \"\"] = unique.columns;\n\t\tconst existingConstraintName = uniqueColumns.get(columnName);\n\t\tif (!uniqueColumns.has(columnName) || existingConstraintName === void 0 && unique.name) uniqueColumns.set(columnName, unique.name);\n\t}\n\tconst derivedCheckNames = computeDerivedCheckNames(table);\n\tconst fields = [];\n\tfor (const column of Object.values(table.columns)) fields.push(buildScalarField(column, table, typeMap, enumNameMap, fieldNameMap, defaultMapping, rawDefaultParser, pkColumns, isSinglePk, singlePkConstraintName, uniqueColumns, derivedCheckNames));\n\tconst usedFieldNames = new Set(fields.map((field) => field.name));\n\tfor (const rel of relationFields) fields.push(buildRelationField(rel, table.name, fieldNamesByTable, usedFieldNames));\n\tconst modelAttributes = [];\n\tif (table.primaryKey && table.primaryKey.columns.length > 1) {\n\t\tconst pkFieldNames = table.primaryKey.columns.map((columnName) => resolveColumnFieldName(fieldNamesByTable, table.name, columnName));\n\t\tmodelAttributes.push(buildModelConstraintAttribute(\"id\", pkFieldNames, table.primaryKey.name));\n\t}\n\tfor (const unique of table.uniques) if (unique.columns.length > 1) {\n\t\tconst uniqueFieldNames = unique.columns.map((columnName) => resolveColumnFieldName(fieldNamesByTable, table.name, columnName));\n\t\tmodelAttributes.push(buildModelConstraintAttribute(\"unique\", uniqueFieldNames, unique.name));\n\t}\n\tfor (const index of table.indexes) {\n\t\tconst indexFieldNames = index.columns?.map((columnName) => resolveColumnFieldName(fieldNamesByTable, table.name, columnName));\n\t\tmodelAttributes.push(buildIndexAttribute(index, indexFieldNames));\n\t}\n\tfor (const check of table.checks ?? []) if (!derivedCheckNames.has(check.name)) modelAttributes.push(buildCheckAttribute(check));\n\tif (mapName) modelAttributes.push(buildMapAttribute(\"model\", mapName));\n\tif (rlsEnabled) modelAttributes.push(buildAttribute(\"model\", \"rls\", []));\n\tconst warnings = [];\n\tif (!table.primaryKey) warnings.push(\"This table has no primary key in the database\");\n\tif (danglingForeignKeys.length > 0) warnings.push(buildDanglingForeignKeyWarning(danglingForeignKeys, fieldNamesByTable, table.name));\n\tconst commentLines = [...warnings.length > 0 ? [`// WARNING: ${warnings.join(\" \")}`] : [], ...policySkipNotes];\n\tconst comment = commentLines.length > 0 ? commentLines.join(\"\\n\") : void 0;\n\treturn {\n\t\tkind: \"model\",\n\t\tname: modelName,\n\t\tfields,\n\t\tattributes: modelAttributes,\n\t\tspan: SYNTHETIC_SPAN,\n\t\t...comment !== void 0 ? { comment } : {}\n\t};\n}\n/**\n* The live check names that are derived: a live check's name matches\n* `formatWireName(composeCheckWirePrefix(table, column, kind), computeCheckContentHash(expression))`\n* for some column of the table and some candidate `postgresRenderCheckExpressions`\n* would render for that column. Never by comparing expressions — the live\n* body is a Postgres reprint, never the authored text. One set serves both\n* the `@noCheck` waiver below and `@@check` exclusion in `buildModel`, so the\n* two decisions cannot drift apart.\n*\n* `membership` is unreachable here today: infer never emits domain enums\n* (`enumType()` is not inferred), so no inferred column has member values and\n* no membership check is ever derived. The day domain-enum inference exists,\n* its slice extends this by threading the column's member values through.\n*/\nfunction computeDerivedCheckNames(table) {\n\tconst liveCheckNames = new Set((table.checks ?? []).map((check) => check.name));\n\tconst derivedCheckNames = /* @__PURE__ */ new Set();\n\tfor (const column of Object.values(table.columns)) for (const candidate of postgresRenderCheckExpressions({\n\t\ttableName: table.name,\n\t\tcolumnName: column.name,\n\t\tmany: column.many === true,\n\t\tmemberValues: void 0\n\t})) {\n\t\tconst derivedName = formatWireName(composeCheckWirePrefix(table.name, column.name, candidate.kind), computeCheckContentHash(candidate.expression));\n\t\tif (liveCheckNames.has(derivedName)) derivedCheckNames.add(derivedName);\n\t}\n\treturn derivedCheckNames;\n}\nfunction buildScalarField(column, table, typeMap, enumNameMap, fieldNameMap, defaultMapping, rawDefaultParser, pkColumns, isSinglePk, singlePkConstraintName, uniqueColumns, derivedCheckNames) {\n\tconst resolvedField = fieldNameMap?.get(column.name);\n\tconst fieldName = resolvedField?.fieldName ?? toFieldName(column.name).name;\n\tconst fieldMap = resolvedField?.fieldMap;\n\tconst resolution = typeMap.resolve(column.nativeType, table.annotations);\n\tif (\"unsupported\" in resolution) {\n\t\tconst attrs = [];\n\t\tif (fieldMap !== void 0) attrs.push(buildMapAttribute(\"field\", fieldMap));\n\t\treturn {\n\t\t\tkind: \"field\",\n\t\t\tname: fieldName,\n\t\t\ttypeName: `Unsupported(\"${escapePslString(resolution.nativeType)}\")`,\n\t\t\toptional: column.nullable,\n\t\t\tlist: column.many === true,\n\t\t\tattributes: attrs,\n\t\t\tspan: SYNTHETIC_SPAN\n\t\t};\n\t}\n\tlet typeName = resolution.pslType.name;\n\tlet typeConstructor = resolution.pslType.args ? {\n\t\tkind: \"typeConstructor\",\n\t\tpath: [resolution.pslType.name],\n\t\targs: resolution.pslType.args.map(positionalArg),\n\t\tspan: SYNTHETIC_SPAN\n\t} : void 0;\n\tconst enumPslName = enumNameMap.get(column.nativeType);\n\tif (enumPslName) {\n\t\ttypeName = enumPslName;\n\t\ttypeConstructor = {\n\t\t\tkind: \"typeConstructor\",\n\t\t\tpath: [\"pg\", \"enum\"],\n\t\t\targs: [positionalArg(enumPslName)],\n\t\t\tspan: SYNTHETIC_SPAN\n\t\t};\n\t}\n\tconst attributes = [];\n\tconst isId = isSinglePk && pkColumns.has(column.name);\n\tif (isId) attributes.push(buildSimpleConstraintFieldAttribute(\"id\", singlePkConstraintName));\n\tconst defaultAttribute = inferDefaultAttribute(column, enumPslName === void 0 ? pslDefaultValueFormat(resolution.pslType.name) : formatPslValue, defaultMapping, rawDefaultParser);\n\tif (defaultAttribute !== void 0) attributes.push(parseDefaultAttributeString(defaultAttribute));\n\tif (uniqueColumns.has(column.name) && !isId) {\n\t\tconst uniqueConstraintName = uniqueColumns.get(column.name);\n\t\tattributes.push(buildSimpleConstraintFieldAttribute(\"unique\", uniqueConstraintName));\n\t}\n\tif (column.many === true) {\n\t\tconst waivedKinds = postgresRenderCheckExpressions({\n\t\t\ttableName: table.name,\n\t\t\tcolumnName: column.name,\n\t\t\tmany: true,\n\t\t\tmemberValues: void 0\n\t\t}).filter((candidate) => !derivedCheckNames.has(formatWireName(composeCheckWirePrefix(table.name, column.name, candidate.kind), computeCheckContentHash(candidate.expression)))).map((candidate) => candidate.kind);\n\t\tif (waivedKinds.length > 0) attributes.push(buildAttribute(\"field\", \"noCheck\", waivedKinds.map(positionalArg)));\n\t}\n\tif (fieldMap !== void 0) attributes.push(buildMapAttribute(\"field\", fieldMap));\n\treturn {\n\t\tkind: \"field\",\n\t\tname: fieldName,\n\t\ttypeName,\n\t\t...ifDefined(\"typeConstructor\", typeConstructor),\n\t\toptional: column.nullable,\n\t\tlist: column.many === true,\n\t\tattributes,\n\t\tspan: SYNTHETIC_SPAN\n\t};\n}\n/**\n* A literal default prints as the PSL literal its codec accepts. A literal that has no such PSL\n* literal prints as `dbgenerated(...)` with the expression Postgres reported: `contract emit`\n* accepts that on a scalar column and rejects it at the field on a list column.\n*/\nfunction inferDefaultAttribute(column, valueFormat, defaultMapping, rawDefaultParser) {\n\tif (column.default === void 0 && column.resolvedDefault?.kind === \"function\" && column.resolvedDefault.expression === \"autoincrement()\") return \"@default(autoincrement())\";\n\tif (column.many === true && column.resolvedDefault?.kind === \"literal\") {\n\t\tconst { value } = column.resolvedDefault;\n\t\treturn Array.isArray(value) ? literalOrRawAttribute(formatPslListLiteralValue(value, valueFormat), column, defaultMapping) : void 0;\n\t}\n\tconst parsed = parseColumnDefault(column.default, column.nativeType, rawDefaultParser);\n\tif (parsed === void 0) return;\n\tif (parsed.kind === \"literal\") return literalOrRawAttribute(valueFormat(parsed.value), column, defaultMapping);\n\treturn mappedAttribute(parsed, defaultMapping);\n}\nfunction literalOrRawAttribute(literal, column, defaultMapping) {\n\tif (literal !== void 0) return `@default(${literal})`;\n\treturn typeof column.default === \"string\" ? mappedAttribute({\n\t\tkind: \"function\",\n\t\texpression: column.default\n\t}, defaultMapping) : void 0;\n}\n/** A default the mapping can only describe in a comment is dropped: a field AST node has no comment. */\nfunction mappedAttribute(columnDefault, defaultMapping) {\n\tconst result = mapDefault(columnDefault, defaultMapping);\n\treturn \"attribute\" in result ? result.attribute : void 0;\n}\nfunction buildRelationField(rel, hostTableName, fieldNamesByTable, usedFieldNames) {\n\tconst fieldName = createUniqueFieldName(rel.fieldName, usedFieldNames);\n\tusedFieldNames.add(fieldName);\n\tconst args = [];\n\tif (rel.fields && rel.references) {\n\t\tif (rel.relationName) args.push(namedArg(\"name\", `\"${escapePslString(rel.relationName)}\"`));\n\t\targs.push(namedArg(\"fields\", `[${rel.fields.map((columnName) => resolveColumnFieldName(fieldNamesByTable, hostTableName, columnName)).join(\", \")}]`));\n\t\targs.push(namedArg(\"references\", `[${rel.references.map((columnName) => resolveColumnFieldName(fieldNamesByTable, rel.referencedTableName ?? \"\", columnName)).join(\", \")}]`));\n\t\tif (rel.onDelete) args.push(namedArg(\"onDelete\", rel.onDelete));\n\t\tif (rel.onUpdate) args.push(namedArg(\"onUpdate\", rel.onUpdate));\n\t\tif (rel.fkName) args.push(namedArg(\"map\", `\"${escapePslString(rel.fkName)}\"`));\n\t\tif (rel.index === false) args.push(namedArg(\"index\", \"false\"));\n\t} else if (rel.relationName) args.push(namedArg(\"name\", `\"${escapePslString(rel.relationName)}\"`));\n\tconst attrs = args.length > 0 ? [buildAttribute(\"field\", \"relation\", args)] : [];\n\treturn {\n\t\tkind: \"field\",\n\t\tname: fieldName,\n\t\ttypeName: rel.typeName,\n\t\t...ifDefined(\"typeNamespaceId\", rel.typeNamespaceId),\n\t\t...ifDefined(\"typeContractSpaceId\", rel.typeContractSpaceId),\n\t\toptional: rel.optional,\n\t\tlist: rel.list,\n\t\tattributes: attrs,\n\t\tspan: SYNTHETIC_SPAN\n\t};\n}\n//#endregion\n//#region src/core/psl-infer/infer-policy-blocks.ts\nconst POLICY_OPERATION_KEYWORD = {\n\tselect: \"policy_select\",\n\tinsert: \"policy_insert\",\n\tupdate: \"policy_update\",\n\tdelete: \"policy_delete\",\n\tall: \"policy_all\"\n};\n/** The PSL tokenizer's identifier grammar: leading letter/underscore, then letters/digits/`_`/`-`. */\nconst PSL_IDENTIFIER = /^[\\p{L}_][\\p{L}\\p{N}_-]*$/u;\n/** Replaces invalid character runs with `_`; prepends `_` when the first character is invalid. */\nfunction sanitizePolicyHead(raw) {\n\tlet head = raw.replace(/[^\\p{L}\\p{N}_-]+/gu, \"_\");\n\tif (!/^[\\p{L}_]/u.test(head)) head = `_${head}`;\n\treturn head;\n}\n/**\n* Builds one `policy_<operation>` block per introspected policy. Every\n* adopted policy is exact-named: a reprinted body never reliably re-hashes to\n* the live suffix, so `@@map` always carries the physical name and the head\n* is only an identifier. A policy granting to a role whose name is not a\n* legal identifier cannot be authored at all — role references have no\n* `@@map` escape — so it is skipped with a note.\n*/\nfunction buildPolicyBlocks(policiesByTable, modelNameMap, reservedHeads = /* @__PURE__ */ new Set()) {\n\tconst all = [];\n\tfor (const [tableName, policies] of policiesByTable) for (const policy of policies) all.push({\n\t\tpolicy,\n\t\ttableName\n\t});\n\tall.sort((a, b) => {\n\t\tif (a.policy.name !== b.policy.name) return a.policy.name < b.policy.name ? -1 : 1;\n\t\tif (a.tableName !== b.tableName) return a.tableName < b.tableName ? -1 : 1;\n\t\treturn a.policy.operation < b.policy.operation ? -1 : a.policy.operation > b.policy.operation ? 1 : 0;\n\t});\n\tconst usedHeads = new Set(reservedHeads);\n\tconst blocks = [];\n\tconst skipNotesByTable = /* @__PURE__ */ new Map();\n\tfor (const { policy, tableName } of all) {\n\t\tconst modelName = modelNameMap.get(tableName);\n\t\tassertDefined(modelName, `buildPolicyBlocks: policy \"${policy.name}\" targets table \"${tableName}\" with no emitted model; tables and policies come from the same introspection walk`);\n\t\tconst badRole = policy.roles.find((role) => !PSL_IDENTIFIER.test(role));\n\t\tif (badRole !== void 0) {\n\t\t\tconst notes = skipNotesByTable.get(tableName) ?? [];\n\t\t\tnotes.push(`// prisma: skipped policy \"${policy.name}\": role \"${badRole}\" is not a valid PSL identifier and role references cannot be escaped`);\n\t\t\tskipNotesByTable.set(tableName, notes);\n\t\t\tcontinue;\n\t\t}\n\t\tlet head = sanitizePolicyHead(parseWireName(policy.name)?.prefix ?? policy.name);\n\t\tif (usedHeads.has(head)) {\n\t\t\tlet n = 2;\n\t\t\twhile (usedHeads.has(`${head}_${n}`)) n += 1;\n\t\t\thead = `${head}_${n}`;\n\t\t}\n\t\tusedHeads.add(head);\n\t\tblocks.push({\n\t\t\tkind: \"policy\",\n\t\t\tkeyword: POLICY_OPERATION_KEYWORD[policy.operation],\n\t\t\tname: head,\n\t\t\tparameters: {\n\t\t\t\ttarget: {\n\t\t\t\t\tkind: \"ref\",\n\t\t\t\t\tidentifier: modelName,\n\t\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t\t},\n\t\t\t\troles: {\n\t\t\t\t\tkind: \"list\",\n\t\t\t\t\titems: policy.roles.map((role) => ({\n\t\t\t\t\t\tkind: \"ref\",\n\t\t\t\t\t\tidentifier: role,\n\t\t\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t\t\t})),\n\t\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t\t},\n\t\t\t\t...policy.using !== void 0 ? { using: {\n\t\t\t\t\tkind: \"value\",\n\t\t\t\t\traw: JSON.stringify(policy.using),\n\t\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t\t} } : {},\n\t\t\t\t...policy.withCheck !== void 0 ? { withCheck: {\n\t\t\t\t\tkind: \"value\",\n\t\t\t\t\traw: JSON.stringify(policy.withCheck),\n\t\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t\t} } : {},\n\t\t\t\t...policy.permissive ? {} : { permissive: {\n\t\t\t\t\tkind: \"value\",\n\t\t\t\t\traw: \"false\",\n\t\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t\t} }\n\t\t\t},\n\t\t\tblockAttributes: [{\n\t\t\t\tname: \"map\",\n\t\t\t\targs: [{\n\t\t\t\t\tkind: \"positional\",\n\t\t\t\t\tvalue: `\"${escapePslString(policy.name)}\"`,\n\t\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t\t}],\n\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t}],\n\t\t\tattributes: { map: {\n\t\t\t\targs: { name: policy.name },\n\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t} },\n\t\t\tspan: SYNTHETIC_SPAN\n\t\t});\n\t}\n\treturn {\n\t\tblocks,\n\t\tskipNotesByTable\n\t};\n}\n//#endregion\n//#region src/core/psl-infer/postgres-default-mapping.ts\nconst POSTGRES_FUNCTION_ATTRIBUTES = { \"gen_random_uuid()\": \"@default(dbgenerated(\\\"gen_random_uuid()\\\"))\" };\nfunction formatDbGeneratedAttribute(expression) {\n\treturn `@default(dbgenerated(${JSON.stringify(expression)}))`;\n}\nfunction createPostgresDefaultMapping() {\n\treturn {\n\t\tfunctionAttributes: POSTGRES_FUNCTION_ATTRIBUTES,\n\t\tfallbackFunctionAttribute: formatDbGeneratedAttribute\n\t};\n}\n//#endregion\n//#region src/core/psl-infer/postgres-type-map.ts\nconst POSTGRES_TO_PSL = {\n\ttext: \"String\",\n\tbool: \"Boolean\",\n\tboolean: \"Boolean\",\n\tint4: \"Int\",\n\tinteger: \"Int\",\n\tint8: \"BigInt\",\n\tbigint: \"BigInt\",\n\tfloat8: \"Float\",\n\t\"double precision\": \"Float\",\n\tjsonb: \"Jsonb\",\n\tbytea: \"Bytes\"\n};\nconst PRESERVED_NATIVE_TYPES = {\n\t\"character varying\": \"VarChar\",\n\tcharacter: \"Char\",\n\tchar: \"Char\",\n\tvarchar: \"VarChar\",\n\tuuid: \"Uuid\",\n\tinet: \"Inet\",\n\tint2: \"SmallInt\",\n\tsmallint: \"SmallInt\",\n\tfloat4: \"Real\",\n\treal: \"Real\",\n\tnumeric: \"Numeric\",\n\tdecimal: \"Numeric\",\n\ttimestamp: \"Timestamp\",\n\t\"timestamp without time zone\": \"Timestamp\",\n\ttimestamptz: \"Timestamptz\",\n\t\"timestamp with time zone\": \"Timestamptz\",\n\tdate: \"Date\",\n\ttime: \"Time\",\n\t\"time without time zone\": \"Time\",\n\ttimetz: \"Timetz\",\n\t\"time with time zone\": \"Timetz\",\n\tjson: \"Json\"\n};\nconst PARAMETERIZED_NATIVE_TYPES = {\n\t\"character varying\": \"VarChar\",\n\tcharacter: \"Char\",\n\tchar: \"Char\",\n\tvarchar: \"VarChar\",\n\tnumeric: \"Numeric\",\n\tdecimal: \"Numeric\",\n\ttimestamp: \"Timestamp\",\n\ttimestamptz: \"Timestamptz\",\n\ttime: \"Time\",\n\ttimetz: \"Timetz\"\n};\nconst PARAMETERIZED_TYPE_PATTERN = /^(.+?)\\((.+)\\)$/;\nfunction getOwnMappingValue(map, key) {\n\treturn Object.hasOwn(map, key) ? map[key] : void 0;\n}\nfunction splitTypeParameterList(params) {\n\treturn params.split(\",\").map((part) => part.trim()).filter((part) => part.length > 0);\n}\nfunction createPostgresTypeMap(enumTypeNames) {\n\treturn { resolve(nativeType) {\n\t\tif (enumTypeNames?.has(nativeType)) return {\n\t\t\tpslType: { name: nativeType },\n\t\t\tnativeType\n\t\t};\n\t\tconst paramMatch = nativeType.match(PARAMETERIZED_TYPE_PATTERN);\n\t\tif (paramMatch) {\n\t\t\tconst [, baseType = nativeType, params = \"\"] = paramMatch;\n\t\t\tconst typeName = getOwnMappingValue(PARAMETERIZED_NATIVE_TYPES, baseType);\n\t\t\tif (typeName) return {\n\t\t\t\tpslType: {\n\t\t\t\t\tname: typeName,\n\t\t\t\t\targs: splitTypeParameterList(params)\n\t\t\t\t},\n\t\t\t\tnativeType,\n\t\t\t\ttypeParams: {\n\t\t\t\t\tbaseType,\n\t\t\t\t\tparams\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\tconst preservedType = getOwnMappingValue(PRESERVED_NATIVE_TYPES, nativeType);\n\t\tif (preservedType) return {\n\t\t\tpslType: { name: preservedType },\n\t\t\tnativeType\n\t\t};\n\t\tconst pslType = getOwnMappingValue(POSTGRES_TO_PSL, nativeType);\n\t\tif (pslType) return {\n\t\t\tpslType: { name: pslType },\n\t\t\tnativeType\n\t\t};\n\t\treturn {\n\t\t\tunsupported: true,\n\t\t\tnativeType\n\t\t};\n\t} };\n}\n//#endregion\n//#region src/core/psl-infer/infer-psl-contract.ts\n/**\n* Infers a PSL AST (for `printPsl`) from an introspected Postgres schema tree.\n*\n* Target-owned inference: it walks the `PostgresDatabaseSchemaNode` tree and\n* owns the Postgres dialect knowledge — the native type map and default map.\n* It reads raw defaults with `parsePostgresDefault`, the parser introspection\n* and verify use. Relation inference, name transforms, and generic default\n* mapping are shape-neutral utilities imported from the SQL family.\n*\n* The tree's tables (across its namespaces — `contract infer` introspects a\n* single live namespace) are gathered into the model set and emitted in one\n* bucket, alongside native-enum and RLS policy blocks. That bucket is named\n* after the introspected schema when the content needs a `namespace { … }`\n* wrap, and is the flat `UNSPECIFIED_PSL_NAMESPACE_ID` bucket otherwise. This\n* entry point emits nothing else, so its output is always exactly one bucket\n* and byte-identical to the prior flat inference. {@link buildPslDocumentAst}\n* can emit a second, always-flat bucket for content that must stay top-level\n* even under a wrap; no caller asks for one yet.\n*\n* `describedContracts` — the stack's extension packs' already-assembled\n* contracts, each paired with its space id — is consulted while gathering\n* tables: a table whose coordinate `(schemaName, 'table', tableName)` one of\n* those contracts already declares is omitted, before the duplicate-name\n* check below and before relation inference, so it cannot spuriously\n* collide with an app table and never contributes a bare relation field. A\n* surviving table's foreign key into an omitted, pack-owned table is not\n* dropped: {@link resolveForeignKeys} rewrites it into a relation qualified\n* with the pack's space id (`<spaceId>:<namespaceId>.<Model>`) instead.\n*/\nfunction inferPostgresPslContract(tree, describedContracts) {\n\tconst namespaces = Object.values(tree.namespaces);\n\tconst owners = describedContractOwners(describedContracts ?? []);\n\tconst enumDefinitions = /* @__PURE__ */ new Map();\n\tconst packOwnedEnumTypesByNamespace = /* @__PURE__ */ new Map();\n\tconst enumNamespaceNames = /* @__PURE__ */ new Set();\n\tfor (const namespace of namespaces) for (const { typeName, members } of namespace.nativeEnums) {\n\t\tconst owner = owners.get(coordinateKey({\n\t\t\tnamespaceId: namespace.schemaName,\n\t\t\tentityKind: \"native_enum\",\n\t\t\tentityName: typeName\n\t\t}));\n\t\tif (owner !== void 0) {\n\t\t\tconst owned = packOwnedEnumTypesByNamespace.get(namespace.schemaName) ?? /* @__PURE__ */ new Map();\n\t\t\towned.set(typeName, owner.spaceId);\n\t\t\towned.set(`${namespace.schemaName}.${typeName}`, owner.spaceId);\n\t\t\tpackOwnedEnumTypesByNamespace.set(namespace.schemaName, owned);\n\t\t\tcontinue;\n\t\t}\n\t\tenumDefinitions.set(typeName, members);\n\t\tenumNamespaceNames.add(namespace.schemaName);\n\t}\n\tconst tables = {};\n\tconst tableNamespaceNames = /* @__PURE__ */ new Set();\n\tconst rlsEnabledTables = /* @__PURE__ */ new Set();\n\tconst policiesByTable = /* @__PURE__ */ new Map();\n\tfor (const namespace of namespaces) {\n\t\tconst ownedEnumTypes = packOwnedEnumTypesByNamespace.get(namespace.schemaName);\n\t\tfor (const [tableName, table] of Object.entries(namespace.tables)) {\n\t\t\tif (owners.has(coordinateKey({\n\t\t\t\tnamespaceId: namespace.schemaName,\n\t\t\t\tentityKind: \"table\",\n\t\t\t\tentityName: tableName\n\t\t\t}))) continue;\n\t\t\tif (tables[tableName] !== void 0) throw postgresError(\"CONTRACT.INFER_UNSUPPORTED\", `contract infer: duplicate table name \"${tableName}\" across schemas is not yet supported (single-namespace PSL inference emits one flat bucket; multi-namespace \\`namespace { … }\\` output is a later slice).`, { meta: { tableName } });\n\t\t\tif (ownedEnumTypes !== void 0) for (const column of Object.values(table.columns)) {\n\t\t\t\tconst owningSpaceId = ownedEnumTypes.get(column.nativeType);\n\t\t\t\tif (owningSpaceId !== void 0) throw postgresError(\"CONTRACT.INFER_UNSUPPORTED\", `contract infer: column \"${tableName}\".\"${column.name}\" is typed by native enum type \"${column.nativeType}\", which extension pack space \"${owningSpaceId}\" already describes. A cross-space enum-typed column has no authorable PSL form yet; describe the table in that pack's contract or retype the column before re-running contract infer.`, { meta: {\n\t\t\t\t\ttableName,\n\t\t\t\t\tcolumnName: column.name\n\t\t\t\t} });\n\t\t\t}\n\t\t\ttables[tableName] = new SqlTableIR(table);\n\t\t\ttableNamespaceNames.add(namespace.schemaName);\n\t\t\tif (table.rlsEnabled) rlsEnabledTables.add(tableName);\n\t\t\tif (table.policies.length > 0) policiesByTable.set(tableName, table.policies);\n\t\t}\n\t}\n\tlet wrapNamespaceName;\n\tif (enumDefinitions.size > 0 || policiesByTable.size > 0) {\n\t\tconst contentNamespaces = /* @__PURE__ */ new Set([...enumNamespaceNames, ...tableNamespaceNames]);\n\t\tif (contentNamespaces.size > 1) throw postgresError(\"CONTRACT.INFER_UNSUPPORTED\", `contract infer: adopting native enums or RLS policies with content across multiple schemas is not yet supported (single-namespace PSL inference emits one \\`namespace { … }\\` block; multi-namespace output is a later slice). Schemas: ${[...contentNamespaces].sort().join(\", \")}.`, { meta: { schemas: [...contentNamespaces].sort() } });\n\t\twrapNamespaceName = [...contentNamespaces][0];\n\t}\n\tconst { tables: resolvedTables, extraRelationsByTable, crossSpaceFieldNamesByTable, danglingForeignKeysByTable } = resolveForeignKeys(tables, owners);\n\tconst schemaIR = new SqlSchemaIR({ tables: resolvedTables });\n\tconst enumTypeNames = new Set(enumDefinitions.keys());\n\tif (wrapNamespaceName !== void 0) for (const typeName of enumDefinitions.keys()) enumTypeNames.add(`${wrapNamespaceName}.${typeName}`);\n\tconst enumInfo = {\n\t\ttypeNames: enumTypeNames,\n\t\tdefinitions: enumDefinitions\n\t};\n\treturn buildPslDocumentAst(schemaIR, {\n\t\ttypeMap: createPostgresTypeMap(enumInfo.typeNames),\n\t\tdefaultMapping: createPostgresDefaultMapping(),\n\t\tparseRawDefault: parsePostgresDefault,\n\t\t...enumDefinitions.size > 0 ? { enumInfo } : {}\n\t}, {\n\t\textraRelationsByTable,\n\t\tcrossSpaceFieldNamesByTable,\n\t\tdanglingForeignKeysByTable\n\t}, wrapNamespaceName, {\n\t\trlsEnabledTables,\n\t\tpoliciesByTable\n\t});\n}\n/**\n* Builds the PSL document for one introspected schema.\n*\n* `namespaceName` wraps the output in `namespace <name> { … }`; omit it for\n* flat output. `topLevelExtensionBlocks` are declarations that must stay\n* top-level even when a wrap applies, such as a recovered domain enum — a\n* family `enum` inside a namespace is a hard diagnostic. They land in their\n* own always-flat bucket when a wrap applies, and in the single flat bucket\n* when none does; either way they print unwrapped.\n*\n* Their names are reserved before the policy blocks are built, so a policy\n* renames itself out of the way. Against the rest of the top-level scope — the\n* models, the native enums, PSL's scalar type names, and the other blocks in\n* the list — a clash throws instead: a block's name is its contract key\n* (`entries.valueSet[name]`, with no `@@map` escape), so it cannot be rewritten\n* here.\n*/\nfunction buildPslDocumentAst(schemaIR, options, foreignKeyExtras, namespaceName, rlsExtras, topLevelExtensionBlocks = []) {\n\tconst { typeMap, defaultMapping, parseRawDefault: rawDefaultParser } = options;\n\tconst { extraRelationsByTable, crossSpaceFieldNamesByTable, danglingForeignKeysByTable } = foreignKeyExtras;\n\tconst modelNames = buildTopLevelNameMap(Object.keys(schemaIR.tables), toModelName, \"model\", \"table\");\n\tconst modelNameMap = new Map([...modelNames].map(([tableName, result]) => [tableName, result.name]));\n\tconst { enumNameMap: bareEnumNameMap, enumBlocks } = buildNativeEnumBlocks(options.enumInfo?.definitions ?? /* @__PURE__ */ new Map(), modelNames);\n\tconst enumNameMap = new Map(bareEnumNameMap);\n\tif (namespaceName !== void 0) for (const [typeName, pslName] of bareEnumNameMap) enumNameMap.set(`${namespaceName}.${typeName}`, pslName);\n\tconst fieldNamesByTable = new Map([...crossSpaceFieldNamesByTable, ...buildFieldNamesByTable(schemaIR.tables)]);\n\tconst { relationsByTable } = inferRelations(schemaIR.tables, modelNameMap);\n\tconst policyEmission = buildPolicyBlocks(rlsExtras?.policiesByTable ?? /* @__PURE__ */ new Map(), modelNameMap, /* @__PURE__ */ new Set([\n\t\t...modelNameMap.values(),\n\t\t...bareEnumNameMap.values(),\n\t\t...topLevelExtensionBlocks.map((block) => block.name)\n\t]));\n\tconst claimedTopLevelNames = /* @__PURE__ */ new Set([\n\t\t...PSL_SCALAR_TYPE_NAMES,\n\t\t...modelNameMap.values(),\n\t\t...bareEnumNameMap.values()\n\t]);\n\tfor (const block of topLevelExtensionBlocks) {\n\t\tif (claimedTopLevelNames.has(block.name)) throw postgresError(\"CONTRACT.NAME_DUPLICATE\", `contract infer: recovered ${block.keyword} \"${block.name}\" collides with a model, a native enum, a PSL scalar type, or another recovered declaration of the same name. Rename the recovered declaration, or exclude it.`, { meta: {\n\t\t\tkind: block.keyword,\n\t\t\tname: block.name\n\t\t} });\n\t\tclaimedTopLevelNames.add(block.name);\n\t}\n\tconst models = [];\n\tfor (const table of Object.values(schemaIR.tables)) models.push(buildModel(table, typeMap, enumNameMap, fieldNamesByTable, defaultMapping, rawDefaultParser, [...relationsByTable.get(table.name) ?? [], ...extraRelationsByTable.get(table.name) ?? []], danglingForeignKeysByTable.get(table.name) ?? [], rlsExtras?.rlsEnabledTables.has(table.name) ?? false, policyEmission.skipNotesByTable.get(table.name) ?? []));\n\tconst sortedModels = topologicalSort(models, schemaIR.tables, modelNameMap);\n\tconst separateTopLevelBucket = namespaceName !== void 0 && namespaceName !== UNSPECIFIED_PSL_NAMESPACE_ID && topLevelExtensionBlocks.length > 0;\n\tconst namespaces = [];\n\tif (separateTopLevelBucket) namespaces.push(makePslNamespace({\n\t\tkind: \"namespace\",\n\t\tname: UNSPECIFIED_PSL_NAMESPACE_ID,\n\t\tentries: makePslNamespaceEntries([], [], topLevelExtensionBlocks),\n\t\tspan: SYNTHETIC_SPAN\n\t}));\n\tnamespaces.push(makePslNamespace({\n\t\tkind: \"namespace\",\n\t\tname: namespaceName ?? UNSPECIFIED_PSL_NAMESPACE_ID,\n\t\tentries: makePslNamespaceEntries(sortedModels, [], [\n\t\t\t...separateTopLevelBucket ? [] : topLevelExtensionBlocks,\n\t\t\t...enumBlocks,\n\t\t\t...policyEmission.blocks\n\t\t]),\n\t\tspan: SYNTHETIC_SPAN\n\t}));\n\treturn {\n\t\tkind: \"document\",\n\t\tsourceId: \"<sql-schema-ir>\",\n\t\tnamespaces,\n\t\tspan: SYNTHETIC_SPAN\n\t};\n}\n//#endregion\nexport { createPostgresDefaultMapping as i, inferPostgresPslContract as n, createPostgresTypeMap as r, buildPslDocumentAst as t };\n\n//# sourceMappingURL=infer-psl-contract-BaZaJAD9.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,SAAS,uBAAuB,QAAQ;CACvC,MAAM,oCAAoC,IAAI,IAAI;CAClD,KAAK,MAAM,SAAS,OAAO,OAAO,MAAM,GAAG;EAC1C,MAAM,kBAAkB,CAAC,GAAG,OAAO,OAAO,MAAM,OAAO,CAAC,CAAC,KAAK,QAAQ,UAAU;GAC/E,MAAM,EAAE,MAAM,QAAQ,YAAY,OAAO,IAAI;GAC7C,OAAO;IACN,YAAY,OAAO;IACnB,kBAAkB;IAClB,UAAU;IACV;GACD;EACD,CAAC,CAAC,CAAC,CAAC,MAAM,MAAM,UAAU;GACzB,MAAM,gBAAgB,OAAO,KAAK,aAAa,KAAK,CAAC,IAAI,OAAO,MAAM,aAAa,KAAK,CAAC;GACzF,IAAI,kBAAkB,GAAG,OAAO;GAChC,OAAO,KAAK,QAAQ,MAAM;EAC3B,CAAC;EACD,MAAM,iCAAiC,IAAI,IAAI;EAC/C,MAAM,kCAAkC,IAAI,IAAI;EAChD,KAAK,MAAM,UAAU,iBAAiB;GACrC,MAAM,YAAY,sBAAsB,OAAO,kBAAkB,cAAc;GAC/E,eAAe,IAAI,SAAS;GAC5B,gBAAgB,IAAI,OAAO,YAA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WEERT.mjs"],"sourcesContent":["import { s as postgresError } from \"./errors-DYyzTYzE.mjs\";\nimport { t as parsePostgresDefault } from \"./default-normalizer-Bjtm2F4f.mjs\";\nimport { t as postgresRenderCheckExpressions } from \"./check-expressions-DFTeR0rd.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { coordinateKey, elementCoordinates } from \"@internal/framework-components/ir\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { composeCheckWirePrefix, computeCheckContentHash, computeIndexContentHash, formatWireName, parseWireName } from \"@internal/sql-schema-ir/naming\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { SqlSchemaIR, SqlTableIR } from \"@internal/sql-schema-ir/types\";\nimport { buildChildRelationField, deriveRelationFieldName, inferRelations, mapDefault, toEnumMemberName, toEnumName, toFieldName, toModelName } from \"@internal/family-sql/psl-infer\";\nimport { UNSPECIFIED_PSL_NAMESPACE_ID, makePslNamespace, makePslNamespaceEntries } from \"@internal/framework-components/psl-ast\";\nimport { isColumnDefault } from \"@internal/contract/types\";\n//#region src/core/psl-infer/infer-names.ts\nfunction buildFieldNamesByTable(tables) {\n\tconst fieldNamesByTable = /* @__PURE__ */ new Map();\n\tfor (const table of Object.values(tables)) {\n\t\tconst assignmentOrder = [...Object.values(table.columns).map((column, index) => {\n\t\t\tconst { name, map } = toFieldName(column.name);\n\t\t\treturn {\n\t\t\t\tcolumnName: column.name,\n\t\t\t\tdesiredFieldName: name,\n\t\t\t\tfieldMap: map,\n\t\t\t\tindex\n\t\t\t};\n\t\t})].sort((left, right) => {\n\t\t\tconst mapComparison = Number(left.fieldMap !== void 0) - Number(right.fieldMap !== void 0);\n\t\t\tif (mapComparison !== 0) return mapComparison;\n\t\t\treturn left.index - right.index;\n\t\t});\n\t\tconst usedFieldNames = /* @__PURE__ */ new Set();\n\t\tconst tableFieldNames = /* @__PURE__ */ new Map();\n\t\tfor (const column of assignmentOrder) {\n\t\t\tconst fieldName = createUniqueFieldName(column.desiredFieldName, usedFieldNames);\n\t\t\tusedFieldNames.add(fieldName);\n\t\t\ttableFieldNames.set(column.columnName, {\n\t\t\t\tfieldName,\n\t\t\t\tfieldMap: column.fieldMap\n\t\t\t});\n\t\t}\n\t\tfieldNamesByTable.set(table.name, tableFieldNames);\n\t}\n\treturn fieldNamesByTable;\n}\nfunction resolveColumnFieldName(fieldNamesByTable, tableName, columnName) {\n\treturn fieldNamesByTable.get(tableName)?.get(columnName)?.fieldName ?? toFieldName(columnName).name;\n}\nfunction createUniqueFieldName(desiredName, usedFieldNames) {\n\tif (!usedFieldNames.has(desiredName)) return desiredName;\n\tlet counter = 2;\n\twhile (usedFieldNames.has(`${desiredName}${counter}`)) counter++;\n\treturn `${desiredName}${counter}`;\n}\nfunction buildTopLevelNameMap(sources, normalize, kind, sourceKind) {\n\tconst results = /* @__PURE__ */ new Map();\n\tconst normalizedToSources = /* @__PURE__ */ new Map();\n\tfor (const source of sources) {\n\t\tconst normalized = normalize(source);\n\t\tresults.set(source, normalized);\n\t\tnormalizedToSources.set(normalized.name, [...normalizedToSources.get(normalized.name) ?? [], source]);\n\t}\n\tconst duplicates = [...normalizedToSources.entries()].filter(([, conflictingSources]) => conflictingSources.length > 1);\n\tif (duplicates.length > 0) throw postgresError(\"CONTRACT.NAME_DUPLICATE\", `PSL ${kind} name collisions detected:\\n${duplicates.map(([normalizedName, conflictingSources]) => `- ${kind} \"${normalizedName}\" from ${sourceKind}s ${conflictingSources.map((source) => `\"${source}\"`).join(\", \")}`).join(\"\\n\")}`, { meta: {\n\t\tkind,\n\t\tnames: duplicates.map(([normalizedName]) => normalizedName)\n\t} });\n\treturn results;\n}\nfunction topologicalSort(models, tables, modelNameMap) {\n\tconst modelByName = /* @__PURE__ */ new Map();\n\tfor (const model of models) modelByName.set(model.name, model);\n\tconst deps = /* @__PURE__ */ new Map();\n\tconst tableToModel = /* @__PURE__ */ new Map();\n\tfor (const tableName of Object.keys(tables)) {\n\t\tconst modelName = modelNameMap.get(tableName);\n\t\tassertDefined(modelName, `topologicalSort: no model name mapped for table \"${tableName}\"`);\n\t\ttableToModel.set(tableName, modelName);\n\t\tdeps.set(modelName, /* @__PURE__ */ new Set());\n\t}\n\tfor (const [tableName, table] of Object.entries(tables)) {\n\t\tconst modelName = tableToModel.get(tableName);\n\t\tassertDefined(modelName, `topologicalSort: no model name recorded for table \"${tableName}\"`);\n\t\tconst modelDeps = deps.get(modelName);\n\t\tassertDefined(modelDeps, `topologicalSort: no dependency set recorded for model \"${modelName}\"`);\n\t\tfor (const fk of table.foreignKeys) {\n\t\t\tconst refModelName = tableToModel.get(fk.referencedTable);\n\t\t\tif (refModelName && refModelName !== modelName) modelDeps.add(refModelName);\n\t\t}\n\t}\n\tconst result = [];\n\tconst visited = /* @__PURE__ */ new Set();\n\tconst visiting = /* @__PURE__ */ new Set();\n\tconst sortedNames = [...deps.keys()].sort();\n\tfunction visit(name) {\n\t\tif (visited.has(name)) return;\n\t\tif (visiting.has(name)) return;\n\t\tvisiting.add(name);\n\t\tconst nameDeps = deps.get(name);\n\t\tassertDefined(nameDeps, `topologicalSort: no dependency set recorded for model \"${name}\"`);\n\t\tconst sortedDeps = [...nameDeps].sort();\n\t\tfor (const dep of sortedDeps) visit(dep);\n\t\tvisiting.delete(name);\n\t\tvisited.add(name);\n\t\tconst model = modelByName.get(name);\n\t\tassertDefined(model, `topologicalSort: no model block recorded for \"${name}\"`);\n\t\tresult.push(model);\n\t}\n\tfor (const name of sortedNames) visit(name);\n\treturn result;\n}\n//#endregion\n//#region src/core/psl-infer/psl-literals.ts\nconst SYNTHETIC_SPAN = {\n\tstart: {\n\t\toffset: 0,\n\t\tline: 1,\n\t\tcolumn: 1\n\t},\n\tend: {\n\t\toffset: 0,\n\t\tline: 1,\n\t\tcolumn: 1\n\t}\n};\nfunction buildSimpleConstraintFieldAttribute(name, constraintName) {\n\tif (constraintName === void 0) return buildAttribute(\"field\", name, []);\n\treturn buildAttribute(\"field\", name, [namedArg(\"map\", `\"${escapePslString(constraintName)}\"`)]);\n}\nfunction parseDefaultAttributeString(attributeText) {\n\treturn buildAttribute(\"field\", \"default\", [positionalArg(attributeText.replace(/^@default\\(/, \"\").replace(/\\)$/, \"\"))]);\n}\nfunction buildMapAttribute(target, mapName) {\n\treturn buildAttribute(target, \"map\", [positionalArg(`\"${escapePslString(mapName)}\"`)]);\n}\nfunction buildAttribute(target, name, args) {\n\treturn {\n\t\tkind: \"attribute\",\n\t\ttarget,\n\t\tname,\n\t\targs,\n\t\tspan: SYNTHETIC_SPAN\n\t};\n}\nfunction positionalArg(value) {\n\treturn {\n\t\tkind: \"positional\",\n\t\tvalue,\n\t\tspan: SYNTHETIC_SPAN\n\t};\n}\nfunction namedArg(name, value) {\n\treturn {\n\t\tkind: \"named\",\n\t\tname,\n\t\tvalue,\n\t\tspan: SYNTHETIC_SPAN\n\t};\n}\nfunction escapePslString(value) {\n\treturn value.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\");\n}\nconst INTEGER_TEXT = /^-?\\d+$/;\nconst SPECIAL_VALUE_TEXT = /^(?:NaN|-?Infinity)$/;\nconst DECIMAL_TEXT = /^(?:-?\\d+(?:\\.\\d+)?|NaN|-?Infinity)$/;\n/** PSL has no exponent syntax, so the decimal point moves to where the exponent puts it. */\nfunction plainNumeral(value) {\n\tconst [coefficient = \"\", exponent] = String(value).split(\"e\");\n\tif (exponent === void 0) return coefficient;\n\tconst sign = coefficient.startsWith(\"-\") ? \"-\" : \"\";\n\tconst [whole = \"\", fraction = \"\"] = coefficient.slice(sign.length).split(\".\");\n\tconst digits = `${whole}${fraction}`;\n\tconst point = whole.length + Number(exponent);\n\tif (point <= 0) return `${sign}0.${\"0\".repeat(-point)}${digits}`;\n\tif (point >= digits.length) return `${sign}${digits}${\"0\".repeat(point - digits.length)}`;\n\treturn `${sign}${digits.slice(0, point)}.${digits.slice(point)}`;\n}\nconst formatPslValue = (value) => {\n\tif (typeof value === \"string\") return `\"${escapePslString(value)}\"`;\n\tif (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n};\nconst formatNumber = (value) => typeof value === \"number\" && Number.isFinite(value) ? plainNumeral(value) : void 0;\n/** PSL has no number for `NaN` or `Infinity`; the float codecs pass their quoted text through. */\nconst formatFloat = (value) => typeof value === \"string\" && SPECIAL_VALUE_TEXT.test(value) ? `\"${value}\"` : formatNumber(value);\n/**\n* `pg/int8@1` reads a PSL number from the text written, so every digit of an `int8` survives. A\n* PSL string is not a `bigint`. A JavaScript number past the safe integer range is already rounded.\n*/\nconst formatInteger = (value) => {\n\tif (typeof value === \"string\") return INTEGER_TEXT.test(value) ? value : void 0;\n\treturn typeof value === \"number\" && Number.isSafeInteger(value) ? String(value) : void 0;\n};\n/**\n* `pg/numeric@1` stores decimal text, `NaN` or `Infinity`, and reads a PSL string as that text. A\n* PSL number would also keep every digit, but has no spelling for `NaN` or `Infinity`.\n*/\nconst formatDecimalText = (value) => {\n\tconst text = typeof value === \"number\" && Number.isFinite(value) ? plainNumeral(value) : value;\n\treturn typeof text === \"string\" && DECIMAL_TEXT.test(text) ? `\"${text}\"` : void 0;\n};\n/**\n* The codecs of `Date`, `Time`, `Timestamp` and `Timestamptz` encode Temporal values, which no PSL\n* literal is. A JSON codec reads a PSL string as a JSON string, not as JSON text, so a JSON default\n* keeps its raw expression.\n*/\nconst noLiteral = () => void 0;\nconst DEFAULT_VALUE_FORMATS = /* @__PURE__ */ new Map([\n\t[\"Int\", formatNumber],\n\t[\"SmallInt\", formatNumber],\n\t[\"Float\", formatFloat],\n\t[\"Real\", formatFloat],\n\t[\"BigInt\", formatInteger],\n\t[\"Numeric\", formatDecimalText],\n\t[\"Date\", noLiteral],\n\t[\"Time\", noLiteral],\n\t[\"Timestamp\", noLiteral],\n\t[\"Timestamptz\", noLiteral],\n\t[\"Json\", noLiteral],\n\t[\"Jsonb\", noLiteral]\n]);\n/** The default value format for a field of a PSL type the Postgres type map resolves. */\nfunction pslDefaultValueFormat(typeName) {\n\treturn DEFAULT_VALUE_FORMATS.get(typeName) ?? formatPslValue;\n}\n/**\n* Formats a resolved list default as PSL literal-list syntax (`[1, 2]`, `[\"a\"]`, `[]`), or returns\n* `undefined` when any element has no literal, such as `null` or a value `format` refuses.\n*/\nfunction formatPslListLiteralValue(elements, format) {\n\tconst parts = [];\n\tfor (const element of elements) {\n\t\tconst part = format(element);\n\t\tif (part === void 0) return void 0;\n\t\tparts.push(part);\n\t}\n\treturn `[${parts.join(\", \")}]`;\n}\n/**\n* Resolves a `SqlColumnIR.default` value into a normalized {@link ColumnDefault}.\n*\n* `SqlSchemaIR` types the column default as `string` (a raw database default\n* expression). Some legacy fixtures and tests still pass already-normalized\n* `ColumnDefault` objects in the same slot, so we accept either shape\n* defensively at runtime.\n*/\nfunction parseColumnDefault(value, nativeType, rawDefaultParser) {\n\tif (typeof value === \"string\") return rawDefaultParser ? rawDefaultParser(value, nativeType) : void 0;\n\treturn isColumnDefault(value) ? value : void 0;\n}\n//#endregion\n//#region src/core/psl-infer/infer-enum-blocks.ts\nconst PSL_SCALAR_TYPE_NAMES = /* @__PURE__ */ new Set([\n\t\"String\",\n\t\"Boolean\",\n\t\"Int\",\n\t\"BigInt\",\n\t\"Float\",\n\t\"Decimal\",\n\t\"DateTime\",\n\t\"Json\",\n\t\"Bytes\"\n]);\n/**\n* Builds one `native_enum` extension-block AST node per introspected enum\n* definition. Block names go through the shared top-level transform\n* (`toEnumName`, intra-enum collisions throw like model collisions) and are\n* then reserved against the model names — an enum whose PSL name a model\n* already claims gets a numeric suffix, with `@@map` carrying the real type\n* name. Members print as explicit `member = \"value\"` pairs: the member name\n* is the sanitized value (deduplicated within the block), the JSON-encoded\n* value carries the truth verbatim.\n*/\nfunction buildNativeEnumBlocks(definitions, modelNames) {\n\tconst enumNames = buildTopLevelNameMap([...definitions.keys()].sort(), toEnumName, \"enum\", \"enum type\");\n\tconst usedTopLevelNames = new Set(PSL_SCALAR_TYPE_NAMES);\n\tfor (const result of modelNames.values()) usedTopLevelNames.add(result.name);\n\tconst enumNameMap = /* @__PURE__ */ new Map();\n\tconst enumBlocks = [];\n\tfor (const [typeName, result] of enumNames) {\n\t\tconst name = createUniqueFieldName(result.name, usedTopLevelNames);\n\t\tusedTopLevelNames.add(name);\n\t\tenumNameMap.set(typeName, name);\n\t\tenumBlocks.push(buildNativeEnumBlock(name, typeName, definitions.get(typeName) ?? []));\n\t}\n\treturn {\n\t\tenumNameMap,\n\t\tenumBlocks\n\t};\n}\nfunction buildNativeEnumBlock(name, typeName, values) {\n\tconst usedMemberNames = /* @__PURE__ */ new Set();\n\tconst parameters = {};\n\tfor (const value of values) {\n\t\tconst memberName = createUniqueFieldName(toEnumMemberName(value), usedMemberNames);\n\t\tusedMemberNames.add(memberName);\n\t\tparameters[memberName] = {\n\t\t\tkind: \"value\",\n\t\t\traw: JSON.stringify(value),\n\t\t\tspan: SYNTHETIC_SPAN\n\t\t};\n\t}\n\treturn {\n\t\tkind: \"native_enum\",\n\t\tkeyword: \"native_enum\",\n\t\tname,\n\t\tparameters,\n\t\tblockAttributes: name === typeName ? [] : [{\n\t\t\tname: \"map\",\n\t\t\targs: [{\n\t\t\t\tkind: \"positional\",\n\t\t\t\tvalue: `\"${escapePslString(typeName)}\"`,\n\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t}],\n\t\t\tspan: SYNTHETIC_SPAN\n\t\t}],\n\t\tattributes: name === typeName ? {} : { map: {\n\t\t\targs: { name: typeName },\n\t\t\tspan: SYNTHETIC_SPAN\n\t\t} },\n\t\tspan: SYNTHETIC_SPAN\n\t};\n}\n//#endregion\n//#region src/core/psl-infer/infer-foreign-keys.ts\n/**\n* Coordinates every element a set of already-assembled contracts declare,\n* mapped to the {@link SqlDescribedContractSpace} that owns it and keyed by\n* the shared {@link coordinateKey} helper. `contract infer` uses this to omit\n* database elements a stack extension pack's contract space already\n* describes — reusing the same coordinate walk the contract-space aggregate\n* and cross-space collision check use (`elementCoordinates`), rather than a\n* bespoke per-entity-kind membership test — and, for a foreign key whose\n* referenced table an entry owns, to resolve the qualified cross-space\n* relation it describes.\n*/\nfunction describedContractOwners(describedContracts) {\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const entry of describedContracts) for (const coordinate of elementCoordinates(entry.contract.storage)) owners.set(coordinateKey(coordinate), entry);\n\treturn owners;\n}\nfunction resolveCrossSpaceTarget(owner, namespaceId, tableName) {\n\tconst domainNamespace = owner.contract.domain.namespaces[namespaceId];\n\tif (domainNamespace === void 0) return;\n\tfor (const [modelName, model] of Object.entries(domainNamespace.models)) {\n\t\tconst storage = blindCast(model.storage);\n\t\tif (storage.namespaceId !== namespaceId || storage.table !== tableName) continue;\n\t\tconst fieldNamesByColumn = /* @__PURE__ */ new Map();\n\t\tfor (const [fieldName, fieldStorage] of Object.entries(storage.fields)) fieldNamesByColumn.set(fieldStorage.column, { fieldName });\n\t\treturn {\n\t\t\tspaceId: owner.spaceId,\n\t\t\tnamespaceId,\n\t\t\tmodelName,\n\t\t\tfieldNamesByColumn\n\t\t};\n\t}\n}\n/**\n* Classifies every foreign key on a surviving table into one of three cases.\n* A foreign key that carries a `referencedSchema` is checked against the\n* pack-owned coordinates first, so a pack-owned target wins even when a local\n* table happens to share its bare name; only foreign keys with no owned\n* coordinate fall through to the local/dangling distinction.\n*\n* - **Cross-space**: `referencedSchema` is set and a described contract owns\n* the coordinate `(referencedSchema, 'table', referencedTable)`. The\n* referenced table is absent from the tree (omitted because the pack\n* describes it, or never introspected — `contract infer` walks a single\n* namespace). Removed from `foreignKeys` (so `inferRelations` never falls\n* back to a bare, unqualified table name for it) and replaced with a\n* `RelationField` qualified with the owning pack's space id and namespace\n* id. `owners` holds only pack-declared coordinates, so an app's own table\n* (e.g. `public.users`) is never owned and cannot be captured here.\n* - **Local**: not a pack-owned coordinate, and the referenced table survived\n* introspection — left untouched, `inferRelations` handles it as before.\n* - **Dangling**: not a pack-owned coordinate, and the referenced table is\n* neither in the tree nor owned by any described contract. Removed from\n* `foreignKeys`, keeping the scalar column, rather than emitting a relation\n* to a model that was never defined.\n*\n* A pack that owns the referenced coordinate but declares no domain model\n* mapped to it is malformed; that case throws rather than degrading to a\n* silent drop, which would contradict the dangling definition above.\n*/\nfunction resolveForeignKeys(tables, owners) {\n\tconst resultTables = {};\n\tconst extraRelationsByTable = /* @__PURE__ */ new Map();\n\tconst crossSpaceFieldNamesByTable = /* @__PURE__ */ new Map();\n\tconst danglingForeignKeysByTable = /* @__PURE__ */ new Map();\n\tfor (const [tableName, table] of Object.entries(tables)) {\n\t\tconst keptForeignKeys = [];\n\t\tfor (const fk of table.foreignKeys) {\n\t\t\tif (fk.referencedSchema !== void 0) {\n\t\t\t\tconst owner = owners.get(coordinateKey({\n\t\t\t\t\tnamespaceId: fk.referencedSchema,\n\t\t\t\t\tentityKind: \"table\",\n\t\t\t\t\tentityName: fk.referencedTable\n\t\t\t\t}));\n\t\t\t\tif (owner !== void 0) {\n\t\t\t\t\tconst target = resolveCrossSpaceTarget(owner, fk.referencedSchema, fk.referencedTable);\n\t\t\t\t\tif (target === void 0) throw postgresError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `contract infer: described contract space \"${owner.spaceId}\" owns storage coordinate \"${fk.referencedSchema}.${fk.referencedTable}\" but declares no domain model mapped to it. A pack that describes a table must also declare the domain model it maps to; this pack is malformed.`, { meta: {\n\t\t\t\t\t\tspaceId: owner.spaceId,\n\t\t\t\t\t\ttableName: fk.referencedTable\n\t\t\t\t\t} });\n\t\t\t\t\tif (!crossSpaceFieldNamesByTable.has(fk.referencedTable)) crossSpaceFieldNamesByTable.set(fk.referencedTable, target.fieldNamesByColumn);\n\t\t\t\t\tconst fieldName = deriveRelationFieldName(fk.columns, fk.referencedTable);\n\t\t\t\t\tconst optional = fk.columns.some((columnName) => table.columns[columnName]?.nullable ?? false);\n\t\t\t\t\tconst relationField = {\n\t\t\t\t\t\t...buildChildRelationField(fieldName, target.modelName, fk, optional, void 0, table),\n\t\t\t\t\t\ttypeNamespaceId: target.namespaceId,\n\t\t\t\t\t\ttypeContractSpaceId: target.spaceId\n\t\t\t\t\t};\n\t\t\t\t\tconst existingRelations = extraRelationsByTable.get(tableName);\n\t\t\t\t\tif (existingRelations) existingRelations.push(relationField);\n\t\t\t\t\telse extraRelationsByTable.set(tableName, [relationField]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (tables[fk.referencedTable] !== void 0) keptForeignKeys.push(fk);\n\t\t\telse {\n\t\t\t\tconst dangling = {\n\t\t\t\t\tcolumns: fk.columns,\n\t\t\t\t\treferencedSchema: fk.referencedSchema,\n\t\t\t\t\treferencedTable: fk.referencedTable\n\t\t\t\t};\n\t\t\t\tconst existingDangling = danglingForeignKeysByTable.get(tableName);\n\t\t\t\tif (existingDangling) existingDangling.push(dangling);\n\t\t\t\telse danglingForeignKeysByTable.set(tableName, [dangling]);\n\t\t\t}\n\t\t}\n\t\tresultTables[tableName] = keptForeignKeys.length === table.foreignKeys.length ? table : new SqlTableIR({\n\t\t\t...table,\n\t\t\tforeignKeys: keptForeignKeys\n\t\t});\n\t}\n\treturn {\n\t\ttables: resultTables,\n\t\textraRelationsByTable,\n\t\tcrossSpaceFieldNamesByTable,\n\t\tdanglingForeignKeysByTable\n\t};\n}\n/**\n* Explains a foreign key `resolveForeignKeys` dropped as dangling: the\n* database enforces it, but its target lives outside the introspected\n* schema, so infer has no model to point a relation at. The suggested fix\n* targets the common cause — an unconfigured extension pack's schema\n* (e.g. Supabase's `auth`).\n*/\nfunction buildDanglingForeignKeyWarning(danglingForeignKeys, fieldNamesByTable, tableName) {\n\treturn `Foreign key ${danglingForeignKeys.map((fk) => {\n\t\tconst fieldNames = fk.columns.map((columnName) => resolveColumnFieldName(fieldNamesByTable, tableName, columnName));\n\t\tconst target = fk.referencedSchema !== void 0 ? `${fk.referencedSchema}.${fk.referencedTable}` : fk.referencedTable;\n\t\treturn `\"${fieldNames.join(\", \")}\" -> \"${target}\"`;\n\t}).join(\", \")} exists in the database, but its target schema is outside the introspected scope, so no relation field was generated. If the target schema is described by an extension pack, add it to extensions and re-run infer.`;\n}\n//#endregion\n//#region src/core/psl-infer/infer-index-attributes.ts\nfunction buildModelConstraintAttribute(name, fields, constraintName) {\n\tconst args = [positionalArg(`[${fields.join(\", \")}]`)];\n\tif (constraintName !== void 0) args.push(namedArg(\"map\", `\"${escapePslString(constraintName)}\"`));\n\treturn buildAttribute(\"model\", name, args);\n}\n/**\n* Emits one `@@index` attribute at full fidelity. The index's identity is\n* re-detected rather than trusted: `name:` is emitted only when the live name\n* parses as a wire name AND that hash recomputes from the introspected\n* content; otherwise the live name is adopted verbatim with `map:`.\n*/\nfunction buildIndexAttribute(index, fieldNames) {\n\tconst args = [];\n\tif (fieldNames !== void 0) args.push(positionalArg(`[${fieldNames.join(\", \")}]`));\n\telse {\n\t\tassertDefined(index.expression, `buildIndexAttribute: index \"${index.name}\" carries neither columns nor expression; SqlIndexIR enforces exactly one`);\n\t\targs.push(namedArg(\"expression\", `\"${escapePslString(index.expression)}\"`));\n\t}\n\tconst parsed = parseWireName(index.name);\n\tconst recomputed = computeIndexContentHash({\n\t\t...index.columns !== void 0 ? { columns: index.columns } : {},\n\t\t...index.expression !== void 0 ? { expression: index.expression } : {},\n\t\t...index.where !== void 0 ? { where: index.where } : {},\n\t\tunique: index.unique,\n\t\t...index.type !== void 0 ? { type: index.type } : {},\n\t\t...index.options !== void 0 ? { options: index.options } : {}\n\t});\n\tif (parsed !== void 0 && parsed.hash === recomputed) args.push(namedArg(\"name\", `\"${escapePslString(parsed.prefix)}\"`));\n\telse args.push(namedArg(\"map\", `\"${escapePslString(index.name)}\"`));\n\tif (index.where !== void 0) args.push(namedArg(\"where\", `\"${escapePslString(index.where)}\"`));\n\tif (index.unique) args.push(namedArg(\"unique\", \"true\"));\n\tconst hasOptions = index.options !== void 0 && Object.keys(index.options).length > 0;\n\tif (index.type !== void 0 || hasOptions) args.push(namedArg(\"type\", `\"${escapePslString(index.type ?? \"btree\")}\"`));\n\tif (hasOptions) {\n\t\tconst entries = Object.entries(index.options ?? {}).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([key, value]) => `${key}: \"${escapePslString(String(value))}\"`);\n\t\targs.push(namedArg(\"options\", `{ ${entries.join(\", \")} }`));\n\t}\n\treturn buildAttribute(\"model\", \"index\", args);\n}\n/**\n* Emits one `@@check` attribute for a live, non-derived check, always in the\n* `map:` form. Re-detecting `name:` is not attempted: the live expression is\n* Postgres's own reprint, but a wire-named check's hash was taken over the\n* author's original text, so recomputing the hash from the reprint would\n* essentially never match. `map:` plus the verbatim reprint is correct\n* regardless — a reprint compared against a later reprint of the same\n* expression is stable, so the emitted contract signs the live database with\n* zero pending operations. `buildPolicyBlocks` makes the same call for\n* `@@map` on adopted RLS policies, for the same reason.\n*/\nfunction buildCheckAttribute(check) {\n\treturn buildAttribute(\"model\", \"check\", [namedArg(\"expression\", `\"${escapePslString(check.expression)}\"`), namedArg(\"map\", `\"${escapePslString(check.name)}\"`)]);\n}\n//#endregion\n//#region src/core/psl-infer/infer-model-blocks.ts\nfunction buildModel(table, typeMap, enumNameMap, fieldNamesByTable, defaultMapping, rawDefaultParser, relationFields, danglingForeignKeys, rlsEnabled = false, policySkipNotes = []) {\n\tconst { name: modelName, map: mapName } = toModelName(table.name);\n\tconst fieldNameMap = fieldNamesByTable.get(table.name);\n\tconst pkColumns = new Set(table.primaryKey?.columns ?? []);\n\tconst isSinglePk = pkColumns.size === 1;\n\tconst singlePkConstraintName = isSinglePk ? table.primaryKey?.name : void 0;\n\tconst uniqueColumns = /* @__PURE__ */ new Map();\n\tfor (const unique of table.uniques) if (unique.columns.length === 1) {\n\t\tconst [columnName = \"\"] = unique.columns;\n\t\tconst existingConstraintName = uniqueColumns.get(columnName);\n\t\tif (!uniqueColumns.has(columnName) || existingConstraintName === void 0 && unique.name) uniqueColumns.set(columnName, unique.name);\n\t}\n\tconst derivedCheckNames = computeDerivedCheckNames(table);\n\tconst fields = [];\n\tfor (const column of Object.values(table.columns)) fields.push(buildScalarField(column, table, typeMap, enumNameMap, fieldNameMap, defaultMapping, rawDefaultParser, pkColumns, isSinglePk, singlePkConstraintName, uniqueColumns, derivedCheckNames));\n\tconst usedFieldNames = new Set(fields.map((field) => field.name));\n\tfor (const rel of relationFields) fields.push(buildRelationField(rel, table.name, fieldNamesByTable, usedFieldNames));\n\tconst modelAttributes = [];\n\tif (table.primaryKey && table.primaryKey.columns.length > 1) {\n\t\tconst pkFieldNames = table.primaryKey.columns.map((columnName) => resolveColumnFieldName(fieldNamesByTable, table.name, columnName));\n\t\tmodelAttributes.push(buildModelConstraintAttribute(\"id\", pkFieldNames, table.primaryKey.name));\n\t}\n\tfor (const unique of table.uniques) if (unique.columns.length > 1) {\n\t\tconst uniqueFieldNames = unique.columns.map((columnName) => resolveColumnFieldName(fieldNamesByTable, table.name, columnName));\n\t\tmodelAttributes.push(buildModelConstraintAttribute(\"unique\", uniqueFieldNames, unique.name));\n\t}\n\tfor (const index of table.indexes) {\n\t\tconst indexFieldNames = index.columns?.map((columnName) => resolveColumnFieldName(fieldNamesByTable, table.name, columnName));\n\t\tmodelAttributes.push(buildIndexAttribute(index, indexFieldNames));\n\t}\n\tfor (const check of table.checks ?? []) if (!derivedCheckNames.has(check.name)) modelAttributes.push(buildCheckAttribute(check));\n\tif (mapName) modelAttributes.push(buildMapAttribute(\"model\", mapName));\n\tif (rlsEnabled) modelAttributes.push(buildAttribute(\"model\", \"rls\", []));\n\tconst warnings = [];\n\tif (!table.primaryKey) warnings.push(\"This table has no primary key in the database\");\n\tif (danglingForeignKeys.length > 0) warnings.push(buildDanglingForeignKeyWarning(danglingForeignKeys, fieldNamesByTable, table.name));\n\tconst commentLines = [...warnings.length > 0 ? [`// WARNING: ${warnings.join(\" \")}`] : [], ...policySkipNotes];\n\tconst comment = commentLines.length > 0 ? commentLines.join(\"\\n\") : void 0;\n\treturn {\n\t\tkind: \"model\",\n\t\tname: modelName,\n\t\tfields,\n\t\tattributes: modelAttributes,\n\t\tspan: SYNTHETIC_SPAN,\n\t\t...comment !== void 0 ? { comment } : {}\n\t};\n}\n/**\n* The live check names that are derived: a live check's name matches\n* `formatWireName(composeCheckWirePrefix(table, column, kind), computeCheckContentHash(expression))`\n* for some column of the table and some candidate `postgresRenderCheckExpressions`\n* would render for that column. Never by comparing expressions — the live\n* body is a Postgres reprint, never the authored text. One set serves both\n* the `@noCheck` waiver below and `@@check` exclusion in `buildModel`, so the\n* two decisions cannot drift apart.\n*\n* `membership` is unreachable here today: infer never emits domain enums\n* (`enumType()` is not inferred), so no inferred column has member values and\n* no membership check is ever derived. The day domain-enum inference exists,\n* its slice extends this by threading the column's member values through.\n*/\nfunction computeDerivedCheckNames(table) {\n\tconst liveCheckNames = new Set((table.checks ?? []).map((check) => check.name));\n\tconst derivedCheckNames = /* @__PURE__ */ new Set();\n\tfor (const column of Object.values(table.columns)) for (const candidate of postgresRenderCheckExpressions({\n\t\ttableName: table.name,\n\t\tcolumnName: column.name,\n\t\tmany: column.many === true,\n\t\tmemberValues: void 0\n\t})) {\n\t\tconst derivedName = formatWireName(composeCheckWirePrefix(table.name, column.name, candidate.kind), computeCheckContentHash(candidate.expression));\n\t\tif (liveCheckNames.has(derivedName)) derivedCheckNames.add(derivedName);\n\t}\n\treturn derivedCheckNames;\n}\nfunction buildScalarField(column, table, typeMap, enumNameMap, fieldNameMap, defaultMapping, rawDefaultParser, pkColumns, isSinglePk, singlePkConstraintName, uniqueColumns, derivedCheckNames) {\n\tconst resolvedField = fieldNameMap?.get(column.name);\n\tconst fieldName = resolvedField?.fieldName ?? toFieldName(column.name).name;\n\tconst fieldMap = resolvedField?.fieldMap;\n\tconst resolution = typeMap.resolve(column.nativeType, table.annotations);\n\tif (\"unsupported\" in resolution) {\n\t\tconst attrs = [];\n\t\tif (fieldMap !== void 0) attrs.push(buildMapAttribute(\"field\", fieldMap));\n\t\treturn {\n\t\t\tkind: \"field\",\n\t\t\tname: fieldName,\n\t\t\ttypeName: `Unsupported(\"${escapePslString(resolution.nativeType)}\")`,\n\t\t\toptional: column.nullable,\n\t\t\tlist: column.many === true,\n\t\t\tattributes: attrs,\n\t\t\tspan: SYNTHETIC_SPAN\n\t\t};\n\t}\n\tlet typeName = resolution.pslType.name;\n\tlet typeConstructor = resolution.pslType.args ? {\n\t\tkind: \"typeConstructor\",\n\t\tpath: [resolution.pslType.name],\n\t\targs: resolution.pslType.args.map(positionalArg),\n\t\tspan: SYNTHETIC_SPAN\n\t} : void 0;\n\tconst enumPslName = enumNameMap.get(column.nativeType);\n\tif (enumPslName) {\n\t\ttypeName = enumPslName;\n\t\ttypeConstructor = {\n\t\t\tkind: \"typeConstructor\",\n\t\t\tpath: [\"pg\", \"enum\"],\n\t\t\targs: [positionalArg(enumPslName)],\n\t\t\tspan: SYNTHETIC_SPAN\n\t\t};\n\t}\n\tconst attributes = [];\n\tconst isId = isSinglePk && pkColumns.has(column.name);\n\tif (isId) attributes.push(buildSimpleConstraintFieldAttribute(\"id\", singlePkConstraintName));\n\tconst defaultAttribute = inferDefaultAttribute(column, enumPslName === void 0 ? pslDefaultValueFormat(resolution.pslType.name) : formatPslValue, defaultMapping, rawDefaultParser);\n\tif (defaultAttribute !== void 0) attributes.push(parseDefaultAttributeString(defaultAttribute));\n\tif (uniqueColumns.has(column.name) && !isId) {\n\t\tconst uniqueConstraintName = uniqueColumns.get(column.name);\n\t\tattributes.push(buildSimpleConstraintFieldAttribute(\"unique\", uniqueConstraintName));\n\t}\n\tif (column.many === true) {\n\t\tconst waivedKinds = postgresRenderCheckExpressions({\n\t\t\ttableName: table.name,\n\t\t\tcolumnName: column.name,\n\t\t\tmany: true,\n\t\t\tmemberValues: void 0\n\t\t}).filter((candidate) => !derivedCheckNames.has(formatWireName(composeCheckWirePrefix(table.name, column.name, candidate.kind), computeCheckContentHash(candidate.expression)))).map((candidate) => candidate.kind);\n\t\tif (waivedKinds.length > 0) attributes.push(buildAttribute(\"field\", \"noCheck\", waivedKinds.map(positionalArg)));\n\t}\n\tif (fieldMap !== void 0) attributes.push(buildMapAttribute(\"field\", fieldMap));\n\treturn {\n\t\tkind: \"field\",\n\t\tname: fieldName,\n\t\ttypeName,\n\t\t...ifDefined(\"typeConstructor\", typeConstructor),\n\t\toptional: column.nullable,\n\t\tlist: column.many === true,\n\t\tattributes,\n\t\tspan: SYNTHETIC_SPAN\n\t};\n}\n/**\n* A literal default prints as the PSL literal its codec accepts. A literal that has no such PSL\n* literal prints as `dbgenerated(...)` with the expression Postgres reported: `contract emit`\n* accepts that on a scalar column and rejects it at the field on a list column.\n*/\nfunction inferDefaultAttribute(column, valueFormat, defaultMapping, rawDefaultParser) {\n\tif (column.default === void 0 && column.resolvedDefault?.kind === \"function\" && column.resolvedDefault.expression === \"autoincrement()\") return \"@default(autoincrement())\";\n\tif (column.many === true && column.resolvedDefault?.kind === \"literal\") {\n\t\tconst { value } = column.resolvedDefault;\n\t\treturn Array.isArray(value) ? literalOrRawAttribute(formatPslListLiteralValue(value, valueFormat), column, defaultMapping) : void 0;\n\t}\n\tconst parsed = parseColumnDefault(column.default, column.nativeType, rawDefaultParser);\n\tif (parsed === void 0) return;\n\tif (parsed.kind === \"literal\") return literalOrRawAttribute(valueFormat(parsed.value), column, defaultMapping);\n\treturn mappedAttribute(parsed, defaultMapping);\n}\nfunction literalOrRawAttribute(literal, column, defaultMapping) {\n\tif (literal !== void 0) return `@default(${literal})`;\n\treturn typeof column.default === \"string\" ? mappedAttribute({\n\t\tkind: \"function\",\n\t\texpression: column.default\n\t}, defaultMapping) : void 0;\n}\n/** A default the mapping can only describe in a comment is dropped: a field AST node has no comment. */\nfunction mappedAttribute(columnDefault, defaultMapping) {\n\tconst result = mapDefault(columnDefault, defaultMapping);\n\treturn \"attribute\" in result ? result.attribute : void 0;\n}\nfunction buildRelationField(rel, hostTableName, fieldNamesByTable, usedFieldNames) {\n\tconst fieldName = createUniqueFieldName(rel.fieldName, usedFieldNames);\n\tusedFieldNames.add(fieldName);\n\tconst args = [];\n\tif (rel.fields && rel.references) {\n\t\tif (rel.relationName) args.push(namedArg(\"name\", `\"${escapePslString(rel.relationName)}\"`));\n\t\targs.push(namedArg(\"fields\", `[${rel.fields.map((columnName) => resolveColumnFieldName(fieldNamesByTable, hostTableName, columnName)).join(\", \")}]`));\n\t\targs.push(namedArg(\"references\", `[${rel.references.map((columnName) => resolveColumnFieldName(fieldNamesByTable, rel.referencedTableName ?? \"\", columnName)).join(\", \")}]`));\n\t\tif (rel.onDelete) args.push(namedArg(\"onDelete\", rel.onDelete));\n\t\tif (rel.onUpdate) args.push(namedArg(\"onUpdate\", rel.onUpdate));\n\t\tif (rel.fkName) args.push(namedArg(\"map\", `\"${escapePslString(rel.fkName)}\"`));\n\t\tif (rel.index === false) args.push(namedArg(\"index\", \"false\"));\n\t} else if (rel.relationName) args.push(namedArg(\"name\", `\"${escapePslString(rel.relationName)}\"`));\n\tconst attrs = args.length > 0 ? [buildAttribute(\"field\", \"relation\", args)] : [];\n\treturn {\n\t\tkind: \"field\",\n\t\tname: fieldName,\n\t\ttypeName: rel.typeName,\n\t\t...ifDefined(\"typeNamespaceId\", rel.typeNamespaceId),\n\t\t...ifDefined(\"typeContractSpaceId\", rel.typeContractSpaceId),\n\t\toptional: rel.optional,\n\t\tlist: rel.list,\n\t\tattributes: attrs,\n\t\tspan: SYNTHETIC_SPAN\n\t};\n}\n//#endregion\n//#region src/core/psl-infer/infer-policy-blocks.ts\nconst POLICY_OPERATION_KEYWORD = {\n\tselect: \"policy_select\",\n\tinsert: \"policy_insert\",\n\tupdate: \"policy_update\",\n\tdelete: \"policy_delete\",\n\tall: \"policy_all\"\n};\n/** The PSL tokenizer's identifier grammar: leading letter/underscore, then letters/digits/`_`/`-`. */\nconst PSL_IDENTIFIER = /^[\\p{L}_][\\p{L}\\p{N}_-]*$/u;\n/** Replaces invalid character runs with `_`; prepends `_` when the first character is invalid. */\nfunction sanitizePolicyHead(raw) {\n\tlet head = raw.replace(/[^\\p{L}\\p{N}_-]+/gu, \"_\");\n\tif (!/^[\\p{L}_]/u.test(head)) head = `_${head}`;\n\treturn head;\n}\n/**\n* Builds one `policy_<operation>` block per introspected policy. Every\n* adopted policy is exact-named: a reprinted body never reliably re-hashes to\n* the live suffix, so `@@map` always carries the physical name and the head\n* is only an identifier. A policy granting to a role whose name is not a\n* legal identifier cannot be authored at all — role references have no\n* `@@map` escape — so it is skipped with a note.\n*/\nfunction buildPolicyBlocks(policiesByTable, modelNameMap, reservedHeads = /* @__PURE__ */ new Set()) {\n\tconst all = [];\n\tfor (const [tableName, policies] of policiesByTable) for (const policy of policies) all.push({\n\t\tpolicy,\n\t\ttableName\n\t});\n\tall.sort((a, b) => {\n\t\tif (a.policy.name !== b.policy.name) return a.policy.name < b.policy.name ? -1 : 1;\n\t\tif (a.tableName !== b.tableName) return a.tableName < b.tableName ? -1 : 1;\n\t\treturn a.policy.operation < b.policy.operation ? -1 : a.policy.operation > b.policy.operation ? 1 : 0;\n\t});\n\tconst usedHeads = new Set(reservedHeads);\n\tconst blocks = [];\n\tconst skipNotesByTable = /* @__PURE__ */ new Map();\n\tfor (const { policy, tableName } of all) {\n\t\tconst modelName = modelNameMap.get(tableName);\n\t\tassertDefined(modelName, `buildPolicyBlocks: policy \"${policy.name}\" targets table \"${tableName}\" with no emitted model; tables and policies come from the same introspection walk`);\n\t\tconst badRole = policy.roles.find((role) => !PSL_IDENTIFIER.test(role));\n\t\tif (badRole !== void 0) {\n\t\t\tconst notes = skipNotesByTable.get(tableName) ?? [];\n\t\t\tnotes.push(`// prisma: skipped policy \"${policy.name}\": role \"${badRole}\" is not a valid PSL identifier and role references cannot be escaped`);\n\t\t\tskipNotesByTable.set(tableName, notes);\n\t\t\tcontinue;\n\t\t}\n\t\tlet head = sanitizePolicyHead(parseWireName(policy.name)?.prefix ?? policy.name);\n\t\tif (usedHeads.has(head)) {\n\t\t\tlet n = 2;\n\t\t\twhile (usedHeads.has(`${head}_${n}`)) n += 1;\n\t\t\thead = `${head}_${n}`;\n\t\t}\n\t\tusedHeads.add(head);\n\t\tblocks.push({\n\t\t\tkind: \"policy\",\n\t\t\tkeyword: POLICY_OPERATION_KEYWORD[policy.operation],\n\t\t\tname: head,\n\t\t\tparameters: {\n\t\t\t\ttarget: {\n\t\t\t\t\tkind: \"ref\",\n\t\t\t\t\tidentifier: modelName,\n\t\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t\t},\n\t\t\t\troles: {\n\t\t\t\t\tkind: \"list\",\n\t\t\t\t\titems: policy.roles.map((role) => ({\n\t\t\t\t\t\tkind: \"ref\",\n\t\t\t\t\t\tidentifier: role,\n\t\t\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t\t\t})),\n\t\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t\t},\n\t\t\t\t...policy.using !== void 0 ? { using: {\n\t\t\t\t\tkind: \"value\",\n\t\t\t\t\traw: JSON.stringify(policy.using),\n\t\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t\t} } : {},\n\t\t\t\t...policy.withCheck !== void 0 ? { withCheck: {\n\t\t\t\t\tkind: \"value\",\n\t\t\t\t\traw: JSON.stringify(policy.withCheck),\n\t\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t\t} } : {},\n\t\t\t\t...policy.permissive ? {} : { permissive: {\n\t\t\t\t\tkind: \"value\",\n\t\t\t\t\traw: \"false\",\n\t\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t\t} }\n\t\t\t},\n\t\t\tblockAttributes: [{\n\t\t\t\tname: \"map\",\n\t\t\t\targs: [{\n\t\t\t\t\tkind: \"positional\",\n\t\t\t\t\tvalue: `\"${escapePslString(policy.name)}\"`,\n\t\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t\t}],\n\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t}],\n\t\t\tattributes: { map: {\n\t\t\t\targs: { name: policy.name },\n\t\t\t\tspan: SYNTHETIC_SPAN\n\t\t\t} },\n\t\t\tspan: SYNTHETIC_SPAN\n\t\t});\n\t}\n\treturn {\n\t\tblocks,\n\t\tskipNotesByTable\n\t};\n}\n//#endregion\n//#region src/core/psl-infer/postgres-default-mapping.ts\nfunction formatDbGeneratedAttribute(expression) {\n\treturn `@default(dbgenerated(${JSON.stringify(expression)}))`;\n}\nfunction createPostgresDefaultMapping() {\n\treturn { fallbackFunctionAttribute: formatDbGeneratedAttribute };\n}\n//#endregion\n//#region src/core/psl-infer/postgres-type-map.ts\nconst POSTGRES_TO_PSL = {\n\ttext: \"String\",\n\tbool: \"Boolean\",\n\tboolean: \"Boolean\",\n\tint4: \"Int\",\n\tinteger: \"Int\",\n\tint8: \"BigInt\",\n\tbigint: \"BigInt\",\n\tfloat8: \"Float\",\n\t\"double precision\": \"Float\",\n\tjsonb: \"Jsonb\",\n\tbytea: \"Bytes\"\n};\nconst PRESERVED_NATIVE_TYPES = {\n\t\"character varying\": \"VarChar\",\n\tcharacter: \"Char\",\n\tchar: \"Char\",\n\tvarchar: \"VarChar\",\n\tuuid: \"Uuid\",\n\tinet: \"Inet\",\n\tint2: \"SmallInt\",\n\tsmallint: \"SmallInt\",\n\tfloat4: \"Real\",\n\treal: \"Real\",\n\tnumeric: \"Numeric\",\n\tdecimal: \"Numeric\",\n\ttimestamp: \"Timestamp\",\n\t\"timestamp without time zone\": \"Timestamp\",\n\ttimestamptz: \"Timestamptz\",\n\t\"timestamp with time zone\": \"Timestamptz\",\n\tdate: \"Date\",\n\ttime: \"Time\",\n\t\"time without time zone\": \"Time\",\n\ttimetz: \"Timetz\",\n\t\"time with time zone\": \"Timetz\",\n\tjson: \"Json\"\n};\nconst PARAMETERIZED_NATIVE_TYPES = {\n\t\"character varying\": \"VarChar\",\n\tcharacter: \"Char\",\n\tchar: \"Char\",\n\tvarchar: \"VarChar\",\n\tnumeric: \"Numeric\",\n\tdecimal: \"Numeric\",\n\ttimestamp: \"Timestamp\",\n\ttimestamptz: \"Timestamptz\",\n\ttime: \"Time\",\n\ttimetz: \"Timetz\"\n};\nconst PARAMETERIZED_TYPE_PATTERN = /^(.+?)\\((.+)\\)$/;\nfunction getOwnMappingValue(map, key) {\n\treturn Object.hasOwn(map, key) ? map[key] : void 0;\n}\nfunction splitTypeParameterList(params) {\n\treturn params.split(\",\").map((part) => part.trim()).filter((part) => part.length > 0);\n}\nfunction createPostgresTypeMap(enumTypeNames) {\n\treturn { resolve(nativeType) {\n\t\tif (enumTypeNames?.has(nativeType)) return {\n\t\t\tpslType: { name: nativeType },\n\t\t\tnativeType\n\t\t};\n\t\tconst paramMatch = nativeType.match(PARAMETERIZED_TYPE_PATTERN);\n\t\tif (paramMatch) {\n\t\t\tconst [, baseType = nativeType, params = \"\"] = paramMatch;\n\t\t\tconst typeName = getOwnMappingValue(PARAMETERIZED_NATIVE_TYPES, baseType);\n\t\t\tif (typeName) return {\n\t\t\t\tpslType: {\n\t\t\t\t\tname: typeName,\n\t\t\t\t\targs: splitTypeParameterList(params)\n\t\t\t\t},\n\t\t\t\tnativeType,\n\t\t\t\ttypeParams: {\n\t\t\t\t\tbaseType,\n\t\t\t\t\tparams\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\tconst preservedType = getOwnMappingValue(PRESERVED_NATIVE_TYPES, nativeType);\n\t\tif (preservedType) return {\n\t\t\tpslType: { name: preservedType },\n\t\t\tnativeType\n\t\t};\n\t\tconst pslType = getOwnMappingValue(POSTGRES_TO_PSL, nativeType);\n\t\tif (pslType) return {\n\t\t\tpslType: { name: pslType },\n\t\t\tnativeType\n\t\t};\n\t\treturn {\n\t\t\tunsupported: true,\n\t\t\tnativeType\n\t\t};\n\t} };\n}\n//#endregion\n//#region src/core/psl-infer/infer-psl-contract.ts\n/**\n* Infers a PSL AST (for `printPsl`) from an introspected Postgres schema tree.\n*\n* Target-owned inference: it walks the `PostgresDatabaseSchemaNode` tree and\n* owns the Postgres dialect knowledge — the native type map and default map.\n* It reads raw defaults with `parsePostgresDefault`, the parser introspection\n* and verify use. Relation inference, name transforms, and generic default\n* mapping are shape-neutral utilities imported from the SQL family.\n*\n* The tree's tables (across its namespaces — `contract infer` introspects a\n* single live namespace) are gathered into the model set and emitted in one\n* bucket, alongside native-enum and RLS policy blocks. That bucket is named\n* after the introspected schema when the content needs a `namespace { … }`\n* wrap, and is the flat `UNSPECIFIED_PSL_NAMESPACE_ID` bucket otherwise. This\n* entry point emits nothing else, so its output is always exactly one bucket\n* and byte-identical to the prior flat inference. {@link buildPslDocumentAst}\n* can emit a second, always-flat bucket for content that must stay top-level\n* even under a wrap; no caller asks for one yet.\n*\n* `describedContracts` — the stack's extension packs' already-assembled\n* contracts, each paired with its space id — is consulted while gathering\n* tables: a table whose coordinate `(schemaName, 'table', tableName)` one of\n* those contracts already declares is omitted, before the duplicate-name\n* check below and before relation inference, so it cannot spuriously\n* collide with an app table and never contributes a bare relation field. A\n* surviving table's foreign key into an omitted, pack-owned table is not\n* dropped: {@link resolveForeignKeys} rewrites it into a relation qualified\n* with the pack's space id (`<spaceId>:<namespaceId>.<Model>`) instead.\n*/\nfunction inferPostgresPslContract(tree, describedContracts) {\n\tconst namespaces = Object.values(tree.namespaces);\n\tconst owners = describedContractOwners(describedContracts ?? []);\n\tconst enumDefinitions = /* @__PURE__ */ new Map();\n\tconst packOwnedEnumTypesByNamespace = /* @__PURE__ */ new Map();\n\tconst enumNamespaceNames = /* @__PURE__ */ new Set();\n\tfor (const namespace of namespaces) for (const { typeName, members } of namespace.nativeEnums) {\n\t\tconst owner = owners.get(coordinateKey({\n\t\t\tnamespaceId: namespace.schemaName,\n\t\t\tentityKind: \"native_enum\",\n\t\t\tentityName: typeName\n\t\t}));\n\t\tif (owner !== void 0) {\n\t\t\tconst owned = packOwnedEnumTypesByNamespace.get(namespace.schemaName) ?? /* @__PURE__ */ new Map();\n\t\t\towned.set(typeName, owner.spaceId);\n\t\t\towned.set(`${namespace.schemaName}.${typeName}`, owner.spaceId);\n\t\t\tpackOwnedEnumTypesByNamespace.set(namespace.schemaName, owned);\n\t\t\tcontinue;\n\t\t}\n\t\tenumDefinitions.set(typeName, members);\n\t\tenumNamespaceNames.add(namespace.schemaName);\n\t}\n\tconst tables = {};\n\tconst tableNamespaceNames = /* @__PURE__ */ new Set();\n\tconst rlsEnabledTables = /* @__PURE__ */ new Set();\n\tconst policiesByTable = /* @__PURE__ */ new Map();\n\tfor (const namespace of namespaces) {\n\t\tconst ownedEnumTypes = packOwnedEnumTypesByNamespace.get(namespace.schemaName);\n\t\tfor (const [tableName, table] of Object.entries(namespace.tables)) {\n\t\t\tif (owners.has(coordinateKey({\n\t\t\t\tnamespaceId: namespace.schemaName,\n\t\t\t\tentityKind: \"table\",\n\t\t\t\tentityName: tableName\n\t\t\t}))) continue;\n\t\t\tif (tables[tableName] !== void 0) throw postgresError(\"CONTRACT.INFER_UNSUPPORTED\", `contract infer: duplicate table name \"${tableName}\" across schemas is not yet supported (single-namespace PSL inference emits one flat bucket; multi-namespace \\`namespace { … }\\` output is a later slice).`, { meta: { tableName } });\n\t\t\tif (ownedEnumTypes !== void 0) for (const column of Object.values(table.columns)) {\n\t\t\t\tconst owningSpaceId = ownedEnumTypes.get(column.nativeType);\n\t\t\t\tif (owningSpaceId !== void 0) throw postgresError(\"CONTRACT.INFER_UNSUPPORTED\", `contract infer: column \"${tableName}\".\"${column.name}\" is typed by native enum type \"${column.nativeType}\", which extension pack space \"${owningSpaceId}\" already describes. A cross-space enum-typed column has no authorable PSL form yet; describe the table in that pack's contract or retype the column before re-running contract infer.`, { meta: {\n\t\t\t\t\ttableName,\n\t\t\t\t\tcolumnName: column.name\n\t\t\t\t} });\n\t\t\t}\n\t\t\ttables[tableName] = new SqlTableIR(table);\n\t\t\ttableNamespaceNames.add(namespace.schemaName);\n\t\t\tif (table.rlsEnabled) rlsEnabledTables.add(tableName);\n\t\t\tif (table.policies.length > 0) policiesByTable.set(tableName, table.policies);\n\t\t}\n\t}\n\tlet wrapNamespaceName;\n\tif (enumDefinitions.size > 0 || policiesByTable.size > 0) {\n\t\tconst contentNamespaces = /* @__PURE__ */ new Set([...enumNamespaceNames, ...tableNamespaceNames]);\n\t\tif (contentNamespaces.size > 1) throw postgresError(\"CONTRACT.INFER_UNSUPPORTED\", `contract infer: adopting native enums or RLS policies with content across multiple schemas is not yet supported (single-namespace PSL inference emits one \\`namespace { … }\\` block; multi-namespace output is a later slice). Schemas: ${[...contentNamespaces].sort().join(\", \")}.`, { meta: { schemas: [...contentNamespaces].sort() } });\n\t\twrapNamespaceName = [...contentNamespaces][0];\n\t}\n\tconst { tables: resolvedTables, extraRelationsByTable, crossSpaceFieldNamesByTable, danglingForeignKeysByTable } = resolveForeignKeys(tables, owners);\n\tconst schemaIR = new SqlSchemaIR({ tables: resolvedTables });\n\tconst enumTypeNames = new Set(enumDefinitions.keys());\n\tif (wrapNamespaceName !== void 0) for (const typeName of enumDefinitions.keys()) enumTypeNames.add(`${wrapNamespaceName}.${typeName}`);\n\tconst enumInfo = {\n\t\ttypeNames: enumTypeNames,\n\t\tdefinitions: enumDefinitions\n\t};\n\treturn buildPslDocumentAst(schemaIR, {\n\t\ttypeMap: createPostgresTypeMap(enumInfo.typeNames),\n\t\tdefaultMapping: createPostgresDefaultMapping(),\n\t\tparseRawDefault: parsePostgresDefault,\n\t\t...enumDefinitions.size > 0 ? { enumInfo } : {}\n\t}, {\n\t\textraRelationsByTable,\n\t\tcrossSpaceFieldNamesByTable,\n\t\tdanglingForeignKeysByTable\n\t}, wrapNamespaceName, {\n\t\trlsEnabledTables,\n\t\tpoliciesByTable\n\t});\n}\n/**\n* Builds the PSL document for one introspected schema.\n*\n* `namespaceName` wraps the output in `namespace <name> { … }`; omit it for\n* flat output. `topLevelExtensionBlocks` are declarations that must stay\n* top-level even when a wrap applies, such as a recovered domain enum — a\n* family `enum` inside a namespace is a hard diagnostic. They land in their\n* own always-flat bucket when a wrap applies, and in the single flat bucket\n* when none does; either way they print unwrapped.\n*\n* Their names are reserved before the policy blocks are built, so a policy\n* renames itself out of the way. Against the rest of the top-level scope — the\n* models, the native enums, PSL's scalar type names, and the other blocks in\n* the list — a clash throws instead: a block's name is its contract key\n* (`entries.valueSet[name]`, with no `@@map` escape), so it cannot be rewritten\n* here.\n*/\nfunction buildPslDocumentAst(schemaIR, options, foreignKeyExtras, namespaceName, rlsExtras, topLevelExtensionBlocks = []) {\n\tconst { typeMap, defaultMapping, parseRawDefault: rawDefaultParser } = options;\n\tconst { extraRelationsByTable, crossSpaceFieldNamesByTable, danglingForeignKeysByTable } = foreignKeyExtras;\n\tconst modelNames = buildTopLevelNameMap(Object.keys(schemaIR.tables), toModelName, \"model\", \"table\");\n\tconst modelNameMap = new Map([...modelNames].map(([tableName, result]) => [tableName, result.name]));\n\tconst { enumNameMap: bareEnumNameMap, enumBlocks } = buildNativeEnumBlocks(options.enumInfo?.definitions ?? /* @__PURE__ */ new Map(), modelNames);\n\tconst enumNameMap = new Map(bareEnumNameMap);\n\tif (namespaceName !== void 0) for (const [typeName, pslName] of bareEnumNameMap) enumNameMap.set(`${namespaceName}.${typeName}`, pslName);\n\tconst fieldNamesByTable = new Map([...crossSpaceFieldNamesByTable, ...buildFieldNamesByTable(schemaIR.tables)]);\n\tconst { relationsByTable } = inferRelations(schemaIR.tables, modelNameMap);\n\tconst policyEmission = buildPolicyBlocks(rlsExtras?.policiesByTable ?? /* @__PURE__ */ new Map(), modelNameMap, /* @__PURE__ */ new Set([\n\t\t...modelNameMap.values(),\n\t\t...bareEnumNameMap.values(),\n\t\t...topLevelExtensionBlocks.map((block) => block.name)\n\t]));\n\tconst claimedTopLevelNames = /* @__PURE__ */ new Set([\n\t\t...PSL_SCALAR_TYPE_NAMES,\n\t\t...modelNameMap.values(),\n\t\t...bareEnumNameMap.values()\n\t]);\n\tfor (const block of topLevelExtensionBlocks) {\n\t\tif (claimedTopLevelNames.has(block.name)) throw postgresError(\"CONTRACT.NAME_DUPLICATE\", `contract infer: recovered ${block.keyword} \"${block.name}\" collides with a model, a native enum, a PSL scalar type, or another recovered declaration of the same name. Rename the recovered declaration, or exclude it.`, { meta: {\n\t\t\tkind: block.keyword,\n\t\t\tname: block.name\n\t\t} });\n\t\tclaimedTopLevelNames.add(block.name);\n\t}\n\tconst models = [];\n\tfor (const table of Object.values(schemaIR.tables)) models.push(buildModel(table, typeMap, enumNameMap, fieldNamesByTable, defaultMapping, rawDefaultParser, [...relationsByTable.get(table.name) ?? [], ...extraRelationsByTable.get(table.name) ?? []], danglingForeignKeysByTable.get(table.name) ?? [], rlsExtras?.rlsEnabledTables.has(table.name) ?? false, policyEmission.skipNotesByTable.get(table.name) ?? []));\n\tconst sortedModels = topologicalSort(models, schemaIR.tables, modelNameMap);\n\tconst separateTopLevelBucket = namespaceName !== void 0 && namespaceName !== UNSPECIFIED_PSL_NAMESPACE_ID && topLevelExtensionBlocks.length > 0;\n\tconst namespaces = [];\n\tif (separateTopLevelBucket) namespaces.push(makePslNamespace({\n\t\tkind: \"namespace\",\n\t\tname: UNSPECIFIED_PSL_NAMESPACE_ID,\n\t\tentries: makePslNamespaceEntries([], [], topLevelExtensionBlocks),\n\t\tspan: SYNTHETIC_SPAN\n\t}));\n\tnamespaces.push(makePslNamespace({\n\t\tkind: \"namespace\",\n\t\tname: namespaceName ?? UNSPECIFIED_PSL_NAMESPACE_ID,\n\t\tentries: makePslNamespaceEntries(sortedModels, [], [\n\t\t\t...separateTopLevelBucket ? [] : topLevelExtensionBlocks,\n\t\t\t...enumBlocks,\n\t\t\t...policyEmission.blocks\n\t\t]),\n\t\tspan: SYNTHETIC_SPAN\n\t}));\n\treturn {\n\t\tkind: \"document\",\n\t\tsourceId: \"<sql-schema-ir>\",\n\t\tnamespaces,\n\t\tspan: SYNTHETIC_SPAN\n\t};\n}\n//#endregion\nexport { createPostgresDefaultMapping as i, inferPostgresPslContract as n, createPostgresTypeMap as r, buildPslDocumentAst as t };\n\n//# sourceMappingURL=infer-psl-contract-CBsWEERT.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,SAAS,uBAAuB,QAAQ;CACvC,MAAM,oCA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Q,SAAS,QAAQ,YAAY;CAC1E,MAAM,yBAAyB,kBAAkB,KAAK,KAAK,kBAAkB,gCAAgC,wBAAwB,SAAS;CAC9I,MAAM,aAAa,CAAC;CACpB,IAAI,wBAAwB,WAAW,KAAK,iBAAiB;EAC5D,MAAM;EACN,MAAM;EACN,SAAS,wBAAwB,CAAC,GAAG,CAAC,GAAG,uBAAuB;EAChE,MAAM;CACP,CAAC,CAAC;CACF,WAAW,KAAK,iBAAiB;EAChC,MAAM;EACN,MAAM,iBAAiB;EACvB,SAAS,wBAAwB,cAAc,CAAC,GAAG;GAClD,GAAG,yBAAyB,CAAC,IAAI;GACjC,GAAG;GACH,GAAG,eAAe;EACnB,CAAC;EACD,MAAM;CACP,CAAC,CAAC;CACF,OAAO;EACN,MAAM;EACN,UAAU;EACV;EACA,MAAM;CACP;AACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"migration-PTHAY9Cv.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/migration.mjs"],"sourcesContent":["import { I as createExtension } from \"./op-factory-call-B3-CevCo.mjs\";\nimport { t as dataTransform } from \"./data-transform-ChZzy2dP.mjs\";\nimport { t as PostgresMigration } from \"./postgres-migration-CydbiBd3.mjs\";\nimport { checkExpression, col, fn, foreignKey, lit, primaryKey, unique } from \"@internal/sql-relational-core/contract-free\";\nimport { placeholder } from \"@internal/errors/migration\";\nimport { MigrationCLI } from \"@internal/cli/migration-cli\";\n//#region src/core/migrations/operations/raw.ts\n/**\n* Identity factory for an already-materialized `SqlMigrationPlanOperation`.\n*\n* The planner uses this via `liftOpToCall` to carry ops produced by SQL\n* family methods, codec control hooks, and component database dependencies\n* alongside migration IR without reverse-engineering them. Users writing\n* raw migrations can pass a full op shape directly — typically built by\n* composing SQL family helpers — to author a migration that bypasses the\n* structured call classes.\n*/\nfunction rawSql(op) {\n\treturn op;\n}\n//#endregion\nexport { PostgresMigration as Migration, MigrationCLI, checkExpression, col, createExtension, dataTransform, fn, foreignKey, lit, placeholder, primaryKey, rawSql, unique };\n\n//# sourceMappingURL=migration.mjs.map"],"mappings":";;;;;;;;;;;;;;AAiBA,SAAS,OAAO,IAAI;CACnB,OAAO;AACR"}
1
+ {"version":3,"file":"migration-PTHAY9Cv.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/migration.mjs"],"sourcesContent":["import { I as createExtension } from \"./op-factory-call-Bp6F2UEs.mjs\";\nimport { t as dataTransform } from \"./data-transform-ChZzy2dP.mjs\";\nimport { t as PostgresMigration } from \"./postgres-migration-BAGJ7FgH.mjs\";\nimport { checkExpression, col, fn, foreignKey, lit, primaryKey, unique } from \"@internal/sql-relational-core/contract-free\";\nimport { placeholder } from \"@internal/errors/migration\";\nimport { MigrationCLI } from \"@internal/cli/migration-cli\";\n//#region src/core/migrations/operations/raw.ts\n/**\n* Identity factory for an already-materialized `SqlMigrationPlanOperation`.\n*\n* The planner uses this via `liftOpToCall` to carry ops produced by SQL\n* family methods, codec control hooks, and component database dependencies\n* alongside migration IR without reverse-engineering them. Users writing\n* raw migrations can pass a full op shape directly — typically built by\n* composing SQL family helpers — to author a migration that bypasses the\n* structured call classes.\n*/\nfunction rawSql(op) {\n\treturn op;\n}\n//#endregion\nexport { PostgresMigration as Migration, MigrationCLI, checkExpression, col, createExtension, dataTransform, fn, foreignKey, lit, placeholder, primaryKey, rawSql, unique };\n\n//# sourceMappingURL=migration.mjs.map"],"mappings":";;;;;;;;;;;;;;AAiBA,SAAS,OAAO,IAAI;CACnB,OAAO;AACR"}
@@ -3,7 +3,7 @@ import { t as DEFAULT_NAMESPACE_ID } from "./namespace-ids-xtp_ZY86-Cpp8PTxD.mjs
3
3
  import { a as validateEnumValueLength, i as quoteQualifiedName, r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-6j9YTLpr-BCyCBPBg.mjs";
4
4
  import { C as nativeEnumValueExistsAst, D as tableExistsAst, E as rlsPolicyExistsAst, O as tableIsEmptyAst, S as nativeEnumTypeExistsAst, T as rlsEnabledAst, _ as dropIndex$1, a as columnDefaultAst, b as extensionExistsAst, c as columnTypeAst, d as createPolicy, f as createSchema, g as dropDefaultAction, h as disableRowLevelSecurity$1, i as alterTable, l as constraintExistsAst, m as createType, n as alterIndexRename, o as columnExistsAst, p as createTable, r as alterPolicyRename, s as columnNullabilityAst, t as addColumnAction, u as createIndex$1, v as dropPolicy, w as noNullValuesAst, x as indexExistsAst, y as dropType } from "./ddl-CaKDvAty-sHOb0D92.mjs";
5
5
  import { n as qualifyTableName } from "./planner-sql-checks-CaRMR5SA-DGYjc2Cy.mjs";
6
- import { n as buildColumnTypeSql } from "./planner-ddl-builders-CpXQ-J0X-CL5gNUSG.mjs";
6
+ import { n as buildColumnTypeSql } from "./planner-ddl-builders-DTCYp-qA-DF16uM8O.mjs";
7
7
  import { FunctionColumnDefault, LiteralColumnDefault } from "@prisma/orm-family-sql/relational-core/ast";
8
8
  import { blindCast } from "@prisma/orm-framework/utils/casts";
9
9
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
@@ -14,7 +14,7 @@ import { InternalError, assertNever } from "@prisma/orm-framework/utils/internal
14
14
  import { errorUnfilledPlaceholder } from "@prisma/orm-framework/errors/migration";
15
15
  import { TsExpression, jsonToTsSource } from "@prisma/orm-framework/ts-render";
16
16
  import { REFERENTIAL_ACTION_SQL } from "@prisma/orm-family-sql/contract/referential-action-sql";
17
- //#region ../../../3-targets/3-targets/postgres/dist/op-factory-call-B3-CevCo.mjs
17
+ //#region ../../../3-targets/3-targets/postgres/dist/op-factory-call-Bp6F2UEs.mjs
18
18
  /**
19
19
  * Maps a planner schema name to the contract-free DDL builder's optional
20
20
  * `schema` field: the unbound sentinel becomes `undefined` (the builder omits
@@ -2059,4 +2059,4 @@ var RenamePostgresRlsPolicyCall = class extends PostgresOpFactoryCallNode {
2059
2059
  //#endregion
2060
2060
  export { RenameIndexCall as A, DropNativeEnumTypeCall as C, EnableRowLevelSecurityCall as D, DropTableCall as E, createExtension as F, installExtension as I, postgresDefaultToDdlColumnDefault as L, SetDefaultCall as M, SetNotNullCall as N, RawSqlCall as O, buildTargetDetails as P, DropIndexCall as S, DropPostgresRlsPolicyCall as T, DisableRowLevelSecurityCall as _, AddNotNullColumnDirectCall as a, DropConstraintCall as b, AddUniqueCall as c, CreateIndexCall as d, CreateNativeEnumTypeCall as f, DataTransformCall as g, CreateTableCall as h, AddNativeEnumValueCall as i, RenamePostgresRlsPolicyCall as j, RenameCheckConstraintCall as k, AlterColumnTypeCall as l, CreateSchemaCall as m, AddColumnCall as n, AddNotNullColumnWithTempDefaultCall as o, CreatePostgresRlsPolicyCall as p, AddForeignKeyCall as r, AddPrimaryKeyCall as s, AddCheckConstraintCall as t, CreateExtensionCall as u, DropCheckConstraintCall as v, DropNotNullCall as w, DropDefaultCall as x, DropColumnCall as y };
2061
2061
 
2062
- //# sourceMappingURL=op-factory-call-B3-CevCo-CSV5SL9W.mjs.map
2062
+ //# sourceMappingURL=op-factory-call-Bp6F2UEs-Bze_DuAk.mjs.map