@prisma-next/target-postgres 0.4.1 → 0.5.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/codec-ids-CojIXVf9.mjs +29 -0
- package/dist/codec-ids-CojIXVf9.mjs.map +1 -0
- package/dist/codec-ids.d.mts +28 -0
- package/dist/codec-ids.d.mts.map +1 -0
- package/dist/codec-ids.mjs +3 -0
- package/dist/codec-types.d.mts +42 -0
- package/dist/codec-types.d.mts.map +1 -0
- package/dist/codec-types.mjs +3 -0
- package/dist/codecs-BoahtY_Q.mjs +385 -0
- package/dist/codecs-BoahtY_Q.mjs.map +1 -0
- package/dist/codecs-D-F2KJqt.d.mts +299 -0
- package/dist/codecs-D-F2KJqt.d.mts.map +1 -0
- package/dist/codecs.d.mts +2 -0
- package/dist/codecs.mjs +3 -0
- package/dist/control.d.mts +1 -1
- package/dist/control.mjs +9 -1982
- package/dist/control.mjs.map +1 -1
- package/dist/data-transform-CxFRBIUp.d.mts +32 -0
- package/dist/data-transform-CxFRBIUp.d.mts.map +1 -0
- package/dist/data-transform-VfEGzXWt.mjs +39 -0
- package/dist/data-transform-VfEGzXWt.mjs.map +1 -0
- package/dist/data-transform.d.mts +2 -0
- package/dist/data-transform.mjs +3 -0
- package/dist/default-normalizer-DNOpRoOF.mjs +131 -0
- package/dist/default-normalizer-DNOpRoOF.mjs.map +1 -0
- package/dist/default-normalizer.d.mts +19 -0
- package/dist/default-normalizer.d.mts.map +1 -0
- package/dist/default-normalizer.mjs +3 -0
- package/dist/{descriptor-meta-DkvCmY98.mjs → descriptor-meta-BVoVtyp-.mjs} +1 -1
- package/dist/{descriptor-meta-DkvCmY98.mjs.map → descriptor-meta-BVoVtyp-.mjs.map} +1 -1
- package/dist/errors-AFvEPZ1R.mjs +34 -0
- package/dist/errors-AFvEPZ1R.mjs.map +1 -0
- package/dist/errors.d.mts +27 -0
- package/dist/errors.d.mts.map +1 -0
- package/dist/errors.mjs +3 -0
- package/dist/issue-planner-CFjB0_oO.mjs +879 -0
- package/dist/issue-planner-CFjB0_oO.mjs.map +1 -0
- package/dist/issue-planner.d.mts +85 -0
- package/dist/issue-planner.d.mts.map +1 -0
- package/dist/issue-planner.mjs +3 -0
- package/dist/migration.d.mts +5 -79
- package/dist/migration.d.mts.map +1 -1
- package/dist/migration.mjs +6 -428
- package/dist/migration.mjs.map +1 -1
- package/dist/native-type-normalizer-CInai_oY.mjs +38 -0
- package/dist/native-type-normalizer-CInai_oY.mjs.map +1 -0
- package/dist/native-type-normalizer.d.mts +18 -0
- package/dist/native-type-normalizer.d.mts.map +1 -0
- package/dist/native-type-normalizer.mjs +3 -0
- package/dist/op-factory-call-BKlruaiC.mjs +605 -0
- package/dist/op-factory-call-BKlruaiC.mjs.map +1 -0
- package/dist/op-factory-call-C3bWXKSP.d.mts +304 -0
- package/dist/op-factory-call-C3bWXKSP.d.mts.map +1 -0
- package/dist/op-factory-call.d.mts +3 -0
- package/dist/op-factory-call.mjs +3 -0
- package/dist/pack.d.mts +1 -1
- package/dist/pack.mjs +1 -1
- package/dist/planner-CLUvVhUN.mjs +98 -0
- package/dist/planner-CLUvVhUN.mjs.map +1 -0
- package/dist/planner-ddl-builders-Dxvw1LHw.mjs +132 -0
- package/dist/planner-ddl-builders-Dxvw1LHw.mjs.map +1 -0
- package/dist/planner-ddl-builders.d.mts +22 -0
- package/dist/planner-ddl-builders.d.mts.map +1 -0
- package/dist/planner-ddl-builders.mjs +3 -0
- package/dist/planner-identity-values-Dju-o5GF.mjs +91 -0
- package/dist/planner-identity-values-Dju-o5GF.mjs.map +1 -0
- package/dist/planner-identity-values.d.mts +20 -0
- package/dist/planner-identity-values.d.mts.map +1 -0
- package/dist/planner-identity-values.mjs +3 -0
- package/dist/planner-produced-postgres-migration-CRRTno6Z.d.mts +20 -0
- package/dist/planner-produced-postgres-migration-CRRTno6Z.d.mts.map +1 -0
- package/dist/planner-produced-postgres-migration-DSSPq8QS.mjs +33 -0
- package/dist/planner-produced-postgres-migration-DSSPq8QS.mjs.map +1 -0
- package/dist/planner-produced-postgres-migration.d.mts +5 -0
- package/dist/planner-produced-postgres-migration.mjs +3 -0
- package/dist/planner-schema-lookup-B7lkypwn.mjs +29 -0
- package/dist/planner-schema-lookup-B7lkypwn.mjs.map +1 -0
- package/dist/planner-schema-lookup.d.mts +22 -0
- package/dist/planner-schema-lookup.d.mts.map +1 -0
- package/dist/planner-schema-lookup.mjs +3 -0
- package/dist/planner-sql-checks-7jkgm9TX.mjs +241 -0
- package/dist/planner-sql-checks-7jkgm9TX.mjs.map +1 -0
- package/dist/planner-sql-checks.d.mts +55 -0
- package/dist/planner-sql-checks.d.mts.map +1 -0
- package/dist/planner-sql-checks.mjs +3 -0
- package/dist/{planner-target-details-MXb3oeul.d.mts → planner-target-details-DH-azLu-.d.mts} +1 -1
- package/dist/{planner-target-details-MXb3oeul.d.mts.map → planner-target-details-DH-azLu-.d.mts.map} +1 -1
- package/dist/planner-target-details.d.mts +2 -0
- package/dist/planner-target-details.mjs +1 -0
- package/dist/planner.d.mts +68 -0
- package/dist/planner.d.mts.map +1 -0
- package/dist/planner.mjs +4 -0
- package/dist/postgres-migration-BjA3Zmts.d.mts +50 -0
- package/dist/postgres-migration-BjA3Zmts.d.mts.map +1 -0
- package/dist/postgres-migration-qtmtbONe.mjs +52 -0
- package/dist/postgres-migration-qtmtbONe.mjs.map +1 -0
- package/dist/render-ops-D6_DHdOK.mjs +8 -0
- package/dist/render-ops-D6_DHdOK.mjs.map +1 -0
- package/dist/render-ops.d.mts +11 -0
- package/dist/render-ops.d.mts.map +1 -0
- package/dist/render-ops.mjs +3 -0
- package/dist/render-typescript-1rF_SB4g.mjs +85 -0
- package/dist/render-typescript-1rF_SB4g.mjs.map +1 -0
- package/dist/render-typescript.d.mts +15 -0
- package/dist/render-typescript.d.mts.map +1 -0
- package/dist/render-typescript.mjs +3 -0
- package/dist/runtime.d.mts +15 -3
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs +10 -1
- package/dist/runtime.mjs.map +1 -1
- package/dist/shared-Bxkt8pNO.d.mts +41 -0
- package/dist/shared-Bxkt8pNO.d.mts.map +1 -0
- package/dist/sql-utils-r-Lw535w.mjs +76 -0
- package/dist/sql-utils-r-Lw535w.mjs.map +1 -0
- package/dist/sql-utils.d.mts +59 -0
- package/dist/sql-utils.d.mts.map +1 -0
- package/dist/sql-utils.mjs +3 -0
- package/dist/statement-builders-BPnmt6wx.mjs +116 -0
- package/dist/statement-builders-BPnmt6wx.mjs.map +1 -0
- package/dist/statement-builders.d.mts +23 -0
- package/dist/statement-builders.d.mts.map +1 -0
- package/dist/statement-builders.mjs +3 -0
- package/dist/tables-BmdW_FWO.mjs +477 -0
- package/dist/tables-BmdW_FWO.mjs.map +1 -0
- package/dist/types-ClK03Ojd.d.mts +10 -0
- package/dist/types-ClK03Ojd.d.mts.map +1 -0
- package/dist/types.d.mts +2 -0
- package/dist/types.mjs +1 -0
- package/package.json +37 -20
- package/src/core/codec-ids.ts +30 -0
- package/src/core/codecs.ts +645 -0
- package/src/core/default-normalizer.ts +131 -0
- package/src/core/descriptor-meta.ts +1 -1
- package/src/core/errors.ts +33 -0
- package/src/core/json-schema-type-expression.ts +131 -0
- package/src/core/migrations/op-factory-call.ts +1 -5
- package/src/core/migrations/operations/columns.ts +1 -1
- package/src/core/migrations/operations/constraints.ts +1 -1
- package/src/core/migrations/operations/data-transform.ts +27 -21
- package/src/core/migrations/operations/dependencies.ts +1 -1
- package/src/core/migrations/operations/enums.ts +1 -1
- package/src/core/migrations/operations/indexes.ts +1 -1
- package/src/core/migrations/operations/shared.ts +1 -1
- package/src/core/migrations/operations/tables.ts +1 -1
- package/src/core/migrations/planner-ddl-builders.ts +1 -1
- package/src/core/migrations/planner-recipes.ts +1 -1
- package/src/core/migrations/planner-sql-checks.ts +1 -1
- package/src/core/migrations/planner.ts +2 -4
- package/src/core/migrations/postgres-migration.ts +54 -1
- package/src/core/migrations/render-typescript.ts +22 -12
- package/src/core/migrations/runner.ts +2 -4
- package/src/core/native-type-normalizer.ts +49 -0
- package/src/core/sql-utils.ts +104 -0
- package/src/exports/codec-ids.ts +1 -0
- package/src/exports/codec-types.ts +51 -0
- package/src/exports/codecs.ts +2 -0
- package/src/exports/data-transform.ts +1 -0
- package/src/exports/default-normalizer.ts +1 -0
- package/src/exports/errors.ts +1 -0
- package/src/exports/issue-planner.ts +1 -0
- package/src/exports/migration.ts +6 -0
- package/src/exports/native-type-normalizer.ts +1 -0
- package/src/exports/op-factory-call.ts +25 -0
- package/src/exports/planner-ddl-builders.ts +8 -0
- package/src/exports/planner-identity-values.ts +1 -0
- package/src/exports/planner-produced-postgres-migration.ts +1 -0
- package/src/exports/planner-schema-lookup.ts +6 -0
- package/src/exports/planner-sql-checks.ts +11 -0
- package/src/exports/planner-target-details.ts +1 -0
- package/src/exports/planner.ts +1 -0
- package/src/exports/render-ops.ts +1 -0
- package/src/exports/render-typescript.ts +1 -0
- package/src/exports/runtime.ts +19 -4
- package/src/exports/sql-utils.ts +7 -0
- package/src/exports/statement-builders.ts +7 -0
- package/src/exports/types.ts +1 -0
- package/dist/postgres-migration-BsHJHV9O.mjs +0 -2793
- package/dist/postgres-migration-BsHJHV9O.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"postgres-migration-BsHJHV9O.mjs","names":["MAX_IDENTIFIER_LENGTH","enumTypeExistsCheck","columnTypeCheck","FORMAT_TYPE_DISPLAY: ReadonlyMap<string, string>","REFERENTIAL_ACTION_SQL: Record<ReferentialAction, string>","constraintDefs: string[]","SqlMigration"],"sources":["../../../6-adapters/postgres/dist/sql-utils-DkUJyZmA.mjs","../../../6-adapters/postgres/dist/codec-ids-5g4Gwrgm.mjs","../../../6-adapters/postgres/dist/codecs-DiPlMi3-.mjs","../../../6-adapters/postgres/dist/descriptor-meta-BB9XPAFi.mjs","../../../../1-framework/2-authoring/ids/dist/index.mjs","../../../6-adapters/postgres/dist/control.mjs","../src/core/migrations/planner-type-resolution.ts","../src/core/migrations/planner-sql-checks.ts","../src/core/migrations/operations/shared.ts","../src/core/migrations/operations/columns.ts","../src/core/migrations/operations/constraints.ts","../src/core/migrations/operations/dependencies.ts","../src/core/migrations/operations/enums.ts","../src/core/migrations/operations/indexes.ts","../src/core/migrations/operations/tables.ts","../src/core/migrations/postgres-migration.ts"],"sourcesContent":["//#region src/core/sql-utils.ts\n/**\n* Shared SQL utility functions for the Postgres adapter.\n*\n* These functions handle safe SQL identifier and literal escaping\n* with security validations to prevent injection and encoding issues.\n*/\n/**\n* Error thrown when an invalid SQL identifier or literal is detected.\n* Boundary layers map this to structured envelopes.\n*/\nvar SqlEscapeError = class extends Error {\n\tconstructor(message, value, kind) {\n\t\tsuper(message);\n\t\tthis.value = value;\n\t\tthis.kind = kind;\n\t\tthis.name = \"SqlEscapeError\";\n\t}\n};\n/**\n* Maximum length for PostgreSQL identifiers (NAMEDATALEN - 1).\n*/\nconst MAX_IDENTIFIER_LENGTH = 63;\n/**\n* Validates and quotes a PostgreSQL identifier (table, column, type, schema names).\n*\n* Security validations:\n* - Rejects null bytes which could cause truncation or unexpected behavior\n* - Rejects empty identifiers\n* - Warns on identifiers exceeding PostgreSQL's 63-character limit\n*\n* @throws {SqlEscapeError} If the identifier contains null bytes or is empty\n*/\nfunction quoteIdentifier(identifier) {\n\tif (identifier.length === 0) throw new SqlEscapeError(\"Identifier cannot be empty\", identifier, \"identifier\");\n\tif (identifier.includes(\"\\0\")) throw new SqlEscapeError(\"Identifier cannot contain null bytes\", identifier.replace(/\\0/g, \"\\\\0\"), \"identifier\");\n\tif (identifier.length > MAX_IDENTIFIER_LENGTH) console.warn(`Identifier \"${identifier.slice(0, 20)}...\" exceeds PostgreSQL's ${MAX_IDENTIFIER_LENGTH}-character limit and will be truncated`);\n\treturn `\"${identifier.replace(/\"/g, \"\\\"\\\"\")}\"`;\n}\n/**\n* Escapes a string literal for safe use in SQL statements.\n*\n* Security validations:\n* - Rejects null bytes which could cause truncation or unexpected behavior\n*\n* Note: This assumes PostgreSQL's `standard_conforming_strings` is ON (default since PG 9.1).\n* Backslashes are treated as literal characters, not escape sequences.\n*\n* @throws {SqlEscapeError} If the value contains null bytes\n*/\nfunction escapeLiteral(value) {\n\tif (value.includes(\"\\0\")) throw new SqlEscapeError(\"Literal value cannot contain null bytes\", value.replace(/\\0/g, \"\\\\0\"), \"literal\");\n\treturn value.replace(/'/g, \"''\");\n}\n/**\n* Builds a qualified name (schema.object) with proper quoting.\n*/\nfunction qualifyName(schemaName, objectName) {\n\treturn `${quoteIdentifier(schemaName)}.${quoteIdentifier(objectName)}`;\n}\n/**\n* Validates that an enum value doesn't exceed PostgreSQL's label length limit.\n*\n* PostgreSQL enum labels have a maximum length of NAMEDATALEN-1 (63 bytes by default).\n* Unlike identifiers, enum labels that exceed this limit cause an error rather than\n* silent truncation.\n*\n* @param value - The enum value to validate\n* @param enumTypeName - Name of the enum type (for error messages)\n* @throws {SqlEscapeError} If the value exceeds the maximum length\n*/\nfunction validateEnumValueLength(value, enumTypeName) {\n\tif (value.length > MAX_IDENTIFIER_LENGTH) throw new SqlEscapeError(`Enum value \"${value.slice(0, 20)}...\" for type \"${enumTypeName}\" exceeds PostgreSQL's ${MAX_IDENTIFIER_LENGTH}-character label limit`, value, \"literal\");\n}\n\n//#endregion\nexport { validateEnumValueLength as a, quoteIdentifier as i, escapeLiteral as n, qualifyName as r, SqlEscapeError as t };\n//# sourceMappingURL=sql-utils-DkUJyZmA.mjs.map","import { SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_TIMESTAMP_CODEC_ID, SQL_VARCHAR_CODEC_ID } from \"@prisma-next/sql-relational-core/ast\";\n\n//#region src/core/codec-ids.ts\nconst PG_TEXT_CODEC_ID = \"pg/text@1\";\nconst PG_ENUM_CODEC_ID = \"pg/enum@1\";\nconst PG_CHAR_CODEC_ID = \"pg/char@1\";\nconst PG_VARCHAR_CODEC_ID = \"pg/varchar@1\";\nconst PG_INT_CODEC_ID = \"pg/int@1\";\nconst PG_INT2_CODEC_ID = \"pg/int2@1\";\nconst PG_INT4_CODEC_ID = \"pg/int4@1\";\nconst PG_INT8_CODEC_ID = \"pg/int8@1\";\nconst PG_FLOAT_CODEC_ID = \"pg/float@1\";\nconst PG_FLOAT4_CODEC_ID = \"pg/float4@1\";\nconst PG_FLOAT8_CODEC_ID = \"pg/float8@1\";\nconst PG_NUMERIC_CODEC_ID = \"pg/numeric@1\";\nconst PG_BOOL_CODEC_ID = \"pg/bool@1\";\nconst PG_BIT_CODEC_ID = \"pg/bit@1\";\nconst PG_VARBIT_CODEC_ID = \"pg/varbit@1\";\nconst PG_TIMESTAMP_CODEC_ID = \"pg/timestamp@1\";\nconst PG_TIMESTAMPTZ_CODEC_ID = \"pg/timestamptz@1\";\nconst PG_TIME_CODEC_ID = \"pg/time@1\";\nconst PG_TIMETZ_CODEC_ID = \"pg/timetz@1\";\nconst PG_INTERVAL_CODEC_ID = \"pg/interval@1\";\nconst PG_JSON_CODEC_ID = \"pg/json@1\";\nconst PG_JSONB_CODEC_ID = \"pg/jsonb@1\";\n\n//#endregion\nexport { SQL_CHAR_CODEC_ID as C, SQL_TIMESTAMP_CODEC_ID as D, SQL_TEXT_CODEC_ID as E, SQL_VARCHAR_CODEC_ID as O, PG_VARCHAR_CODEC_ID as S, SQL_INT_CODEC_ID as T, PG_TIMESTAMPTZ_CODEC_ID as _, PG_FLOAT4_CODEC_ID as a, PG_TIME_CODEC_ID as b, PG_INT2_CODEC_ID as c, PG_INTERVAL_CODEC_ID as d, PG_INT_CODEC_ID as f, PG_TEXT_CODEC_ID as g, PG_NUMERIC_CODEC_ID as h, PG_ENUM_CODEC_ID as i, PG_INT4_CODEC_ID as l, PG_JSON_CODEC_ID as m, PG_BOOL_CODEC_ID as n, PG_FLOAT8_CODEC_ID as o, PG_JSONB_CODEC_ID as p, PG_CHAR_CODEC_ID as r, PG_FLOAT_CODEC_ID as s, PG_BIT_CODEC_ID as t, PG_INT8_CODEC_ID as u, PG_TIMESTAMP_CODEC_ID as v, SQL_FLOAT_CODEC_ID as w, PG_VARBIT_CODEC_ID as x, PG_TIMETZ_CODEC_ID as y };\n//# sourceMappingURL=codec-ids-5g4Gwrgm.mjs.map","import { S as PG_VARCHAR_CODEC_ID, _ as PG_TIMESTAMPTZ_CODEC_ID, a as PG_FLOAT4_CODEC_ID, b as PG_TIME_CODEC_ID, c as PG_INT2_CODEC_ID, d as PG_INTERVAL_CODEC_ID, f as PG_INT_CODEC_ID, g as PG_TEXT_CODEC_ID, h as PG_NUMERIC_CODEC_ID, i as PG_ENUM_CODEC_ID, l as PG_INT4_CODEC_ID, m as PG_JSON_CODEC_ID, n as PG_BOOL_CODEC_ID, o as PG_FLOAT8_CODEC_ID, p as PG_JSONB_CODEC_ID, r as PG_CHAR_CODEC_ID, s as PG_FLOAT_CODEC_ID, t as PG_BIT_CODEC_ID, u as PG_INT8_CODEC_ID, v as PG_TIMESTAMP_CODEC_ID, x as PG_VARBIT_CODEC_ID, y as PG_TIMETZ_CODEC_ID } from \"./codec-ids-5g4Gwrgm.mjs\";\nimport { codec, defineCodecs, sqlCodecDefinitions } from \"@prisma-next/sql-relational-core/ast\";\nimport { ifDefined } from \"@prisma-next/utils/defined\";\nimport { type } from \"arktype\";\n\n//#region src/core/json-schema-type-expression.ts\nconst MAX_DEPTH = 32;\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\nfunction escapeStringLiteral(str) {\n\treturn str.replace(/\\\\/g, \"\\\\\\\\\").replace(/'/g, \"\\\\'\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\");\n}\nfunction quotePropertyKey(key) {\n\treturn /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(key) ? key : `'${escapeStringLiteral(key)}'`;\n}\nfunction renderLiteral(value) {\n\tif (typeof value === \"string\") return `'${escapeStringLiteral(value)}'`;\n\tif (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n\tif (value === null) return \"null\";\n\treturn \"unknown\";\n}\nfunction renderUnion(items, depth) {\n\treturn items.map((item) => render(item, depth)).join(\" | \");\n}\nfunction renderObjectType(schema, depth) {\n\tconst properties = isRecord(schema[\"properties\"]) ? schema[\"properties\"] : {};\n\tconst required = Array.isArray(schema[\"required\"]) ? new Set(schema[\"required\"].filter((key) => typeof key === \"string\")) : /* @__PURE__ */ new Set();\n\tconst keys = Object.keys(properties).sort((left, right) => left.localeCompare(right));\n\tif (keys.length === 0) {\n\t\tconst additionalProperties = schema[\"additionalProperties\"];\n\t\tif (additionalProperties === true || additionalProperties === void 0) return \"Record<string, unknown>\";\n\t\treturn `Record<string, ${render(additionalProperties, depth)}>`;\n\t}\n\treturn `{ ${keys.map((key) => {\n\t\tconst valueSchema = properties[key];\n\t\tconst optionalMarker = required.has(key) ? \"\" : \"?\";\n\t\treturn `${quotePropertyKey(key)}${optionalMarker}: ${render(valueSchema, depth)}`;\n\t}).join(\"; \")} }`;\n}\nfunction renderArrayType(schema, depth) {\n\tif (Array.isArray(schema[\"items\"])) return `readonly [${schema[\"items\"].map((item) => render(item, depth)).join(\", \")}]`;\n\tif (schema[\"items\"] !== void 0) {\n\t\tconst itemType = render(schema[\"items\"], depth);\n\t\treturn itemType.includes(\" | \") || itemType.includes(\" & \") ? `(${itemType})[]` : `${itemType}[]`;\n\t}\n\treturn \"unknown[]\";\n}\nfunction render(schema, depth) {\n\tif (depth > MAX_DEPTH || !isRecord(schema)) return \"JsonValue\";\n\tconst nextDepth = depth + 1;\n\tif (\"const\" in schema) return renderLiteral(schema[\"const\"]);\n\tif (Array.isArray(schema[\"enum\"])) return schema[\"enum\"].map((value) => renderLiteral(value)).join(\" | \");\n\tif (Array.isArray(schema[\"oneOf\"])) return renderUnion(schema[\"oneOf\"], nextDepth);\n\tif (Array.isArray(schema[\"anyOf\"])) return renderUnion(schema[\"anyOf\"], nextDepth);\n\tif (Array.isArray(schema[\"allOf\"])) return schema[\"allOf\"].map((item) => render(item, nextDepth)).join(\" & \");\n\tif (Array.isArray(schema[\"type\"])) return schema[\"type\"].map((item) => render({\n\t\t...schema,\n\t\ttype: item\n\t}, nextDepth)).join(\" | \");\n\tswitch (schema[\"type\"]) {\n\t\tcase \"string\": return \"string\";\n\t\tcase \"number\":\n\t\tcase \"integer\": return \"number\";\n\t\tcase \"boolean\": return \"boolean\";\n\t\tcase \"null\": return \"null\";\n\t\tcase \"array\": return renderArrayType(schema, nextDepth);\n\t\tcase \"object\": return renderObjectType(schema, nextDepth);\n\t\tdefault: break;\n\t}\n\treturn \"JsonValue\";\n}\nfunction renderTypeScriptTypeFromJsonSchema(schema) {\n\treturn render(schema, 0);\n}\n\n//#endregion\n//#region src/core/codecs.ts\nconst lengthParamsSchema = type({ length: \"number.integer > 0\" });\nconst numericParamsSchema = type({\n\tprecision: \"number.integer > 0 & number.integer <= 1000\",\n\t\"scale?\": \"number.integer >= 0\"\n});\nconst precisionParamsSchema = type({ \"precision?\": \"number.integer >= 0 & number.integer <= 6\" });\nfunction renderLength(typeName, typeParams) {\n\tconst length = typeParams[\"length\"];\n\tif (length === void 0) return;\n\tif (typeof length !== \"number\" || !Number.isFinite(length) || !Number.isInteger(length)) throw new Error(`renderOutputType: expected integer \"length\" in typeParams for ${typeName}, got ${String(length)}`);\n\treturn `${typeName}<${length}>`;\n}\nfunction renderPrecision(typeName, typeParams) {\n\tconst precision = typeParams[\"precision\"];\n\tif (precision === void 0) return typeName;\n\tif (typeof precision !== \"number\" || !Number.isFinite(precision) || !Number.isInteger(precision)) throw new Error(`renderOutputType: expected integer \"precision\" in typeParams for ${typeName}, got ${String(precision)}`);\n\treturn `${typeName}<${precision}>`;\n}\nfunction renderJsonOutputType(typeParams) {\n\tconst typeName = typeParams[\"type\"];\n\tif (typeof typeName === \"string\" && typeName.trim().length > 0) return typeName.trim();\n\tconst schema = typeParams[\"schemaJson\"];\n\tif (schema && typeof schema === \"object\") return renderTypeScriptTypeFromJsonSchema(schema);\n\tthrow new Error(`renderOutputType: JSON codec typeParams must contain \"type\" (string) or \"schemaJson\" (object), got keys: ${Object.keys(typeParams).join(\", \")}`);\n}\nfunction aliasCodec(base, options) {\n\treturn {\n\t\tid: options.typeId,\n\t\ttargetTypes: options.targetTypes,\n\t\t...ifDefined(\"meta\", options.meta),\n\t\t...ifDefined(\"paramsSchema\", base.paramsSchema),\n\t\t...ifDefined(\"init\", base.init),\n\t\t...ifDefined(\"encode\", base.encode),\n\t\t...ifDefined(\"traits\", base.traits),\n\t\t...ifDefined(\"renderOutputType\", base.renderOutputType),\n\t\tdecode: base.decode,\n\t\tencodeJson: base.encodeJson,\n\t\tdecodeJson: base.decodeJson\n\t};\n}\nconst sqlCharCodec = sqlCodecDefinitions.char.codec;\nconst sqlVarcharCodec = sqlCodecDefinitions.varchar.codec;\nconst sqlIntCodec = sqlCodecDefinitions.int.codec;\nconst sqlFloatCodec = sqlCodecDefinitions.float.codec;\nconst sqlTextCodec = sqlCodecDefinitions.text.codec;\nconst sqlTimestampCodec = sqlCodecDefinitions.timestamp.codec;\nconst pgTextCodec = codec({\n\ttypeId: PG_TEXT_CODEC_ID,\n\ttargetTypes: [\"text\"],\n\ttraits: [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"textual\"\n\t],\n\tencode: (value) => value,\n\tdecode: (wire) => wire,\n\tmeta: { db: { sql: { postgres: { nativeType: \"text\" } } } }\n});\nconst pgCharCodec = aliasCodec(sqlCharCodec, {\n\ttypeId: PG_CHAR_CODEC_ID,\n\ttargetTypes: [\"character\"],\n\tmeta: { db: { sql: { postgres: { nativeType: \"character\" } } } }\n});\nconst pgVarcharCodec = aliasCodec(sqlVarcharCodec, {\n\ttypeId: PG_VARCHAR_CODEC_ID,\n\ttargetTypes: [\"character varying\"],\n\tmeta: { db: { sql: { postgres: { nativeType: \"character varying\" } } } }\n});\nconst pgIntCodec = aliasCodec(sqlIntCodec, {\n\ttypeId: PG_INT_CODEC_ID,\n\ttargetTypes: [\"int4\"],\n\tmeta: { db: { sql: { postgres: { nativeType: \"integer\" } } } }\n});\nconst pgFloatCodec = aliasCodec(sqlFloatCodec, {\n\ttypeId: PG_FLOAT_CODEC_ID,\n\ttargetTypes: [\"float8\"],\n\tmeta: { db: { sql: { postgres: { nativeType: \"double precision\" } } } }\n});\nconst pgInt4Codec = codec({\n\ttypeId: PG_INT4_CODEC_ID,\n\ttargetTypes: [\"int4\"],\n\ttraits: [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t],\n\tencode: (value) => value,\n\tdecode: (wire) => wire,\n\tmeta: { db: { sql: { postgres: { nativeType: \"integer\" } } } }\n});\nconst pgNumericCodec = codec({\n\ttypeId: PG_NUMERIC_CODEC_ID,\n\ttargetTypes: [\"numeric\", \"decimal\"],\n\ttraits: [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t],\n\tencode: (value) => value,\n\tdecode: (wire) => {\n\t\tif (typeof wire === \"number\") return String(wire);\n\t\treturn wire;\n\t},\n\tparamsSchema: numericParamsSchema,\n\trenderOutputType: (typeParams) => {\n\t\tconst precision = typeParams[\"precision\"];\n\t\tif (precision === void 0) return void 0;\n\t\tif (typeof precision !== \"number\" || !Number.isFinite(precision) || !Number.isInteger(precision)) throw new Error(`renderOutputType: expected integer \"precision\" in typeParams for Numeric, got ${String(precision)}`);\n\t\tconst scale = typeParams[\"scale\"];\n\t\treturn typeof scale === \"number\" ? `Numeric<${precision}, ${scale}>` : `Numeric<${precision}>`;\n\t},\n\tmeta: { db: { sql: { postgres: { nativeType: \"numeric\" } } } }\n});\nconst pgInt2Codec = codec({\n\ttypeId: PG_INT2_CODEC_ID,\n\ttargetTypes: [\"int2\"],\n\ttraits: [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t],\n\tencode: (value) => value,\n\tdecode: (wire) => wire,\n\tmeta: { db: { sql: { postgres: { nativeType: \"smallint\" } } } }\n});\nconst pgInt8Codec = codec({\n\ttypeId: PG_INT8_CODEC_ID,\n\ttargetTypes: [\"int8\"],\n\ttraits: [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t],\n\tencode: (value) => value,\n\tdecode: (wire) => wire,\n\tmeta: { db: { sql: { postgres: { nativeType: \"bigint\" } } } }\n});\nconst pgFloat4Codec = codec({\n\ttypeId: PG_FLOAT4_CODEC_ID,\n\ttargetTypes: [\"float4\"],\n\ttraits: [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t],\n\tencode: (value) => value,\n\tdecode: (wire) => wire,\n\tmeta: { db: { sql: { postgres: { nativeType: \"real\" } } } }\n});\nconst pgFloat8Codec = codec({\n\ttypeId: PG_FLOAT8_CODEC_ID,\n\ttargetTypes: [\"float8\"],\n\ttraits: [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t],\n\tencode: (value) => value,\n\tdecode: (wire) => wire,\n\tmeta: { db: { sql: { postgres: { nativeType: \"double precision\" } } } }\n});\nconst pgTimestampCodec = codec({\n\ttypeId: PG_TIMESTAMP_CODEC_ID,\n\ttargetTypes: [\"timestamp\"],\n\ttraits: [\"equality\", \"order\"],\n\tencode: (value) => {\n\t\tif (value instanceof Date) return value.toISOString();\n\t\tif (typeof value === \"string\") return value;\n\t\treturn String(value);\n\t},\n\tdecode: (wire) => {\n\t\tif (wire instanceof Date) return wire.toISOString();\n\t\treturn wire;\n\t},\n\tencodeJson: (value) => value instanceof Date ? value.toISOString() : value,\n\tdecodeJson: (json) => {\n\t\tif (typeof json !== \"string\") throw new Error(`Expected ISO date string for pg/timestamp@1, got ${typeof json}`);\n\t\tconst date = new Date(json);\n\t\tif (Number.isNaN(date.getTime())) throw new Error(`Invalid ISO date string for pg/timestamp@1: ${json}`);\n\t\treturn date;\n\t},\n\tparamsSchema: precisionParamsSchema,\n\trenderOutputType: (typeParams) => renderPrecision(\"Timestamp\", typeParams),\n\tmeta: { db: { sql: { postgres: { nativeType: \"timestamp without time zone\" } } } }\n});\nconst pgTimestamptzCodec = codec({\n\ttypeId: PG_TIMESTAMPTZ_CODEC_ID,\n\ttargetTypes: [\"timestamptz\"],\n\ttraits: [\"equality\", \"order\"],\n\tencode: (value) => {\n\t\tif (value instanceof Date) return value.toISOString();\n\t\tif (typeof value === \"string\") return value;\n\t\treturn String(value);\n\t},\n\tdecode: (wire) => {\n\t\tif (wire instanceof Date) return wire.toISOString();\n\t\treturn wire;\n\t},\n\tencodeJson: (value) => value instanceof Date ? value.toISOString() : value,\n\tdecodeJson: (json) => {\n\t\tif (typeof json !== \"string\") throw new Error(`Expected ISO date string for pg/timestamptz@1, got ${typeof json}`);\n\t\tconst date = new Date(json);\n\t\tif (Number.isNaN(date.getTime())) throw new Error(`Invalid ISO date string for pg/timestamptz@1: ${json}`);\n\t\treturn date;\n\t},\n\tparamsSchema: precisionParamsSchema,\n\trenderOutputType: (typeParams) => renderPrecision(\"Timestamptz\", typeParams),\n\tmeta: { db: { sql: { postgres: { nativeType: \"timestamp with time zone\" } } } }\n});\nconst pgTimeCodec = codec({\n\ttypeId: PG_TIME_CODEC_ID,\n\ttargetTypes: [\"time\"],\n\ttraits: [\"equality\", \"order\"],\n\tencode: (value) => value,\n\tdecode: (wire) => wire,\n\tparamsSchema: precisionParamsSchema,\n\trenderOutputType: (typeParams) => renderPrecision(\"Time\", typeParams),\n\tmeta: { db: { sql: { postgres: { nativeType: \"time\" } } } }\n});\nconst pgTimetzCodec = codec({\n\ttypeId: PG_TIMETZ_CODEC_ID,\n\ttargetTypes: [\"timetz\"],\n\ttraits: [\"equality\", \"order\"],\n\tencode: (value) => value,\n\tdecode: (wire) => wire,\n\tparamsSchema: precisionParamsSchema,\n\trenderOutputType: (typeParams) => renderPrecision(\"Timetz\", typeParams),\n\tmeta: { db: { sql: { postgres: { nativeType: \"timetz\" } } } }\n});\nconst pgBoolCodec = codec({\n\ttypeId: PG_BOOL_CODEC_ID,\n\ttargetTypes: [\"bool\"],\n\ttraits: [\"equality\", \"boolean\"],\n\tencode: (value) => value,\n\tdecode: (wire) => wire,\n\tmeta: { db: { sql: { postgres: { nativeType: \"boolean\" } } } }\n});\nconst pgBitCodec = codec({\n\ttypeId: PG_BIT_CODEC_ID,\n\ttargetTypes: [\"bit\"],\n\ttraits: [\"equality\", \"order\"],\n\tencode: (value) => value,\n\tdecode: (wire) => wire,\n\tparamsSchema: lengthParamsSchema,\n\trenderOutputType: (typeParams) => renderLength(\"Bit\", typeParams),\n\tmeta: { db: { sql: { postgres: { nativeType: \"bit\" } } } }\n});\nconst pgVarbitCodec = codec({\n\ttypeId: PG_VARBIT_CODEC_ID,\n\ttargetTypes: [\"bit varying\"],\n\ttraits: [\"equality\", \"order\"],\n\tencode: (value) => value,\n\tdecode: (wire) => wire,\n\tparamsSchema: lengthParamsSchema,\n\trenderOutputType: (typeParams) => renderLength(\"VarBit\", typeParams),\n\tmeta: { db: { sql: { postgres: { nativeType: \"bit varying\" } } } }\n});\nconst pgEnumCodec = codec({\n\ttypeId: PG_ENUM_CODEC_ID,\n\ttargetTypes: [\"enum\"],\n\ttraits: [\"equality\", \"order\"],\n\tencode: (value) => value,\n\tdecode: (wire) => wire,\n\trenderOutputType: (typeParams) => {\n\t\tconst values = typeParams[\"values\"];\n\t\tif (!Array.isArray(values)) throw new Error(`renderOutputType: expected array \"values\" in typeParams for enum, got ${typeof values}`);\n\t\treturn values.map((value) => `'${String(value).replace(/\\\\/g, \"\\\\\\\\\").replace(/'/g, \"\\\\'\")}'`).join(\" | \");\n\t}\n});\nconst pgIntervalCodec = codec({\n\ttypeId: PG_INTERVAL_CODEC_ID,\n\ttargetTypes: [\"interval\"],\n\ttraits: [\"equality\", \"order\"],\n\tencode: (value) => value,\n\tdecode: (wire) => {\n\t\tif (typeof wire === \"string\") return wire;\n\t\treturn JSON.stringify(wire);\n\t},\n\tparamsSchema: precisionParamsSchema,\n\trenderOutputType: (typeParams) => renderPrecision(\"Interval\", typeParams),\n\tmeta: { db: { sql: { postgres: { nativeType: \"interval\" } } } }\n});\nconst pgJsonCodec = codec({\n\ttypeId: PG_JSON_CODEC_ID,\n\ttargetTypes: [\"json\"],\n\ttraits: [],\n\tencode: (value) => JSON.stringify(value),\n\tdecode: (wire) => typeof wire === \"string\" ? JSON.parse(wire) : wire,\n\trenderOutputType: renderJsonOutputType,\n\tmeta: { db: { sql: { postgres: { nativeType: \"json\" } } } }\n});\nconst pgJsonbCodec = codec({\n\ttypeId: PG_JSONB_CODEC_ID,\n\ttargetTypes: [\"jsonb\"],\n\ttraits: [\"equality\"],\n\tencode: (value) => JSON.stringify(value),\n\tdecode: (wire) => typeof wire === \"string\" ? JSON.parse(wire) : wire,\n\trenderOutputType: renderJsonOutputType,\n\tmeta: { db: { sql: { postgres: { nativeType: \"jsonb\" } } } }\n});\nconst codecs = defineCodecs().add(\"char\", sqlCharCodec).add(\"varchar\", sqlVarcharCodec).add(\"int\", sqlIntCodec).add(\"float\", sqlFloatCodec).add(\"sql-text\", sqlTextCodec).add(\"sql-timestamp\", sqlTimestampCodec).add(\"text\", pgTextCodec).add(\"character\", pgCharCodec).add(\"character varying\", pgVarcharCodec).add(\"integer\", pgIntCodec).add(\"double precision\", pgFloatCodec).add(\"int4\", pgInt4Codec).add(\"int2\", pgInt2Codec).add(\"int8\", pgInt8Codec).add(\"float4\", pgFloat4Codec).add(\"float8\", pgFloat8Codec).add(\"numeric\", pgNumericCodec).add(\"timestamp\", pgTimestampCodec).add(\"timestamptz\", pgTimestamptzCodec).add(\"time\", pgTimeCodec).add(\"timetz\", pgTimetzCodec).add(\"bool\", pgBoolCodec).add(\"bit\", pgBitCodec).add(\"bit varying\", pgVarbitCodec).add(\"interval\", pgIntervalCodec).add(\"enum\", pgEnumCodec).add(\"json\", pgJsonCodec).add(\"jsonb\", pgJsonbCodec);\nconst codecDefinitions = codecs.codecDefinitions;\nconst dataTypes = codecs.dataTypes;\n\n//#endregion\nexport { dataTypes as n, codecDefinitions as t };\n//# sourceMappingURL=codecs-DiPlMi3-.mjs.map","import { C as SQL_CHAR_CODEC_ID, D as SQL_TIMESTAMP_CODEC_ID, E as SQL_TEXT_CODEC_ID, O as SQL_VARCHAR_CODEC_ID, S as PG_VARCHAR_CODEC_ID, T as SQL_INT_CODEC_ID, _ as PG_TIMESTAMPTZ_CODEC_ID, a as PG_FLOAT4_CODEC_ID, b as PG_TIME_CODEC_ID, c as PG_INT2_CODEC_ID, d as PG_INTERVAL_CODEC_ID, f as PG_INT_CODEC_ID, g as PG_TEXT_CODEC_ID, h as PG_NUMERIC_CODEC_ID, i as PG_ENUM_CODEC_ID, l as PG_INT4_CODEC_ID, m as PG_JSON_CODEC_ID, n as PG_BOOL_CODEC_ID, o as PG_FLOAT8_CODEC_ID, p as PG_JSONB_CODEC_ID, r as PG_CHAR_CODEC_ID, s as PG_FLOAT_CODEC_ID, t as PG_BIT_CODEC_ID, u as PG_INT8_CODEC_ID, v as PG_TIMESTAMP_CODEC_ID, w as SQL_FLOAT_CODEC_ID, x as PG_VARBIT_CODEC_ID, y as PG_TIMETZ_CODEC_ID } from \"./codec-ids-5g4Gwrgm.mjs\";\nimport { t as codecDefinitions } from \"./codecs-DiPlMi3-.mjs\";\nimport { a as validateEnumValueLength, i as quoteIdentifier, n as escapeLiteral, r as qualifyName } from \"./sql-utils-DkUJyZmA.mjs\";\nimport { arraysEqual } from \"@prisma-next/family-sql/schema-verify\";\n\n//#region src/core/enum-control-hooks.ts\nconst ENUM_INTROSPECT_QUERY = `\n SELECT\n n.nspname AS schema_name,\n t.typname AS type_name,\n array_agg(e.enumlabel ORDER BY e.enumsortorder) AS values\n FROM pg_type t\n JOIN pg_namespace n ON t.typnamespace = n.oid\n JOIN pg_enum e ON t.oid = e.enumtypid\n WHERE n.nspname = $1\n GROUP BY n.nspname, t.typname\n ORDER BY n.nspname, t.typname\n`;\n/**\n* Type guard for string arrays. Used for runtime validation of introspected data.\n*/\nfunction isStringArray(value) {\n\treturn Array.isArray(value) && value.every((entry) => typeof entry === \"string\");\n}\n/**\n* Parses a PostgreSQL array value into a JavaScript string array.\n*\n* PostgreSQL's `pg` library may return `array_agg` results either as:\n* - A JavaScript array (when type parsers are configured)\n* - A string in PostgreSQL array literal format: `{value1,value2,...}`\n*\n* Handles PostgreSQL's quoting rules for array elements:\n* - Elements containing commas, double quotes, backslashes, or whitespace are double-quoted\n* - Inside quoted elements, `\\\"` represents `\"` and `\\\\` represents `\\`\n*\n* @param value - The value to parse (array or PostgreSQL array string)\n* @returns A string array, or null if the value cannot be parsed\n*/\nfunction parsePostgresArray(value) {\n\tif (isStringArray(value)) return value;\n\tif (typeof value === \"string\" && value.startsWith(\"{\") && value.endsWith(\"}\")) {\n\t\tconst inner = value.slice(1, -1);\n\t\tif (inner === \"\") return [];\n\t\treturn parseArrayElements(inner);\n\t}\n\treturn null;\n}\nfunction parseArrayElements(input) {\n\tconst result = [];\n\tlet i = 0;\n\twhile (i < input.length) {\n\t\tif (input[i] === \",\") {\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\t\tif (input[i] === \"\\\"\") {\n\t\t\ti++;\n\t\t\tlet element = \"\";\n\t\t\twhile (i < input.length && input[i] !== \"\\\"\") {\n\t\t\t\tif (input[i] === \"\\\\\" && i + 1 < input.length) {\n\t\t\t\t\ti++;\n\t\t\t\t\telement += input[i];\n\t\t\t\t} else element += input[i];\n\t\t\t\ti++;\n\t\t\t}\n\t\t\ti++;\n\t\t\tresult.push(element);\n\t\t} else {\n\t\t\tconst nextComma = input.indexOf(\",\", i);\n\t\t\tif (nextComma === -1) {\n\t\t\t\tresult.push(input.slice(i).trim());\n\t\t\t\ti = input.length;\n\t\t\t} else {\n\t\t\t\tresult.push(input.slice(i, nextComma).trim());\n\t\t\t\ti = nextComma;\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}\n/**\n* Extracts enum values from a StorageTypeInstance.\n* Returns null if values are missing or invalid.\n*/\nfunction getEnumValues(typeInstance) {\n\tconst values = typeInstance.typeParams?.[\"values\"];\n\treturn isStringArray(values) ? values : null;\n}\n/**\n* Reads existing enum values from the schema IR for a given native type.\n* Uses optional chaining to simplify navigation through the annotations structure.\n*/\nfunction readExistingEnumValues(schema, nativeType) {\n\tconst existing = ((schema.annotations?.[\"pg\"])?.[\"storageTypes\"])?.[nativeType];\n\tif (!existing || existing.codecId !== PG_ENUM_CODEC_ID) return null;\n\treturn getEnumValues(existing);\n}\n/**\n* Determines what changes are needed to transform existing enum values to desired values.\n*\n* Returns one of:\n* - `unchanged`: No changes needed, values match exactly\n* - `add_values`: New values can be safely appended (PostgreSQL supports this)\n* - `rebuild`: Full enum rebuild required (value removal, reordering, or both)\n*\n* Note: PostgreSQL enums can only have values added (not removed or reordered) without\n* a full type rebuild involving temp type creation and column migration.\n*\n* @param existing - Current enum values in the database\n* @param desired - Target enum values from the contract\n* @returns The type of change required\n*/\nfunction determineEnumDiff(existing, desired) {\n\tif (arraysEqual(existing, desired)) return { kind: \"unchanged\" };\n\tconst existingSet = new Set(existing);\n\tconst desiredSet = new Set(desired);\n\tconst missingValues = desired.filter((value) => !existingSet.has(value));\n\tconst removedValues = existing.filter((value) => !desiredSet.has(value));\n\tconst orderMismatch = missingValues.length === 0 && removedValues.length === 0 && !arraysEqual(existing, desired);\n\tif (removedValues.length > 0 || orderMismatch) return {\n\t\tkind: \"rebuild\",\n\t\tremovedValues\n\t};\n\treturn {\n\t\tkind: \"add_values\",\n\t\tvalues: missingValues\n\t};\n}\nfunction enumTypeExistsCheck(schemaName, typeName, exists = true) {\n\treturn `SELECT ${exists ? \"EXISTS\" : \"NOT EXISTS\"} (\n SELECT 1\n FROM pg_type t\n JOIN pg_namespace n ON t.typnamespace = n.oid\n WHERE n.nspname = '${escapeLiteral(schemaName)}'\n AND t.typname = '${escapeLiteral(typeName)}'\n)`;\n}\nfunction buildCreateEnumOperation(typeName, nativeType, schemaName, values) {\n\tfor (const value of values) validateEnumValueLength(value, typeName);\n\tconst literalValues = values.map((value) => `'${escapeLiteral(value)}'`).join(\", \");\n\tconst qualifiedType = qualifyName(schemaName, nativeType);\n\treturn {\n\t\tid: `type.${typeName}`,\n\t\tlabel: `Create type ${typeName}`,\n\t\tsummary: `Creates enum type ${typeName}`,\n\t\toperationClass: \"additive\",\n\t\ttarget: { id: \"postgres\" },\n\t\tprecheck: [{\n\t\t\tdescription: `ensure type \"${nativeType}\" does not exist`,\n\t\t\tsql: enumTypeExistsCheck(schemaName, nativeType, false)\n\t\t}],\n\t\texecute: [{\n\t\t\tdescription: `create type \"${nativeType}\"`,\n\t\t\tsql: `CREATE TYPE ${qualifiedType} AS ENUM (${literalValues})`\n\t\t}],\n\t\tpostcheck: [{\n\t\t\tdescription: `verify type \"${nativeType}\" exists`,\n\t\t\tsql: enumTypeExistsCheck(schemaName, nativeType)\n\t\t}]\n\t};\n}\n/**\n* Computes the optimal position for inserting a new enum value to maintain\n* the desired order relative to existing values.\n*\n* PostgreSQL's `ALTER TYPE ADD VALUE` supports BEFORE/AFTER positioning.\n* This function finds the best reference value by:\n* 1. Looking for the nearest preceding value that already exists\n* 2. Falling back to the nearest following value if no preceding exists\n* 3. Defaulting to end-of-list if no reference is found\n*\n* @param options.desired - The target ordered list of all enum values\n* @param options.desiredIndex - Index of the value being inserted in the desired list\n* @param options.current - Current list of enum values (being built up incrementally)\n* @returns SQL clause (e.g., \" AFTER 'x'\") and insert position for tracking\n*/\nfunction computeInsertPosition(options) {\n\tconst { desired, desiredIndex, current } = options;\n\tconst currentSet = new Set(current);\n\tconst previous = desired.slice(0, desiredIndex).reverse().find((candidate) => currentSet.has(candidate));\n\tconst next = desired.slice(desiredIndex + 1).find((candidate) => currentSet.has(candidate));\n\treturn {\n\t\tclause: previous ? ` AFTER '${escapeLiteral(previous)}'` : next ? ` BEFORE '${escapeLiteral(next)}'` : \"\",\n\t\tinsertAt: previous ? current.indexOf(previous) + 1 : next ? current.indexOf(next) : current.length\n\t};\n}\n/**\n* Builds operations to add new enum values to an existing PostgreSQL enum type.\n*\n* Each new value is added with `ALTER TYPE ... ADD VALUE IF NOT EXISTS` for idempotency.\n* Values are inserted in the correct order using BEFORE/AFTER positioning to match\n* the desired final order.\n*\n* This is a safe, non-destructive operation - existing data is not affected.\n*\n* @param options.typeName - Contract-level type name (e.g., 'Role')\n* @param options.nativeType - PostgreSQL type name (e.g., 'role')\n* @param options.schemaName - PostgreSQL schema (e.g., 'public')\n* @param options.desired - Target ordered list of all enum values\n* @param options.existing - Current enum values in the database\n* @returns Array of migration operations to add each missing value\n*/\nfunction buildAddValueOperations(options) {\n\tconst { typeName, nativeType, schemaName } = options;\n\tconst current = [...options.existing];\n\tconst currentSet = new Set(current);\n\tconst operations = [];\n\tfor (let index = 0; index < options.desired.length; index += 1) {\n\t\tconst value = options.desired[index];\n\t\tif (value === void 0) continue;\n\t\tif (currentSet.has(value)) continue;\n\t\tvalidateEnumValueLength(value, typeName);\n\t\tconst { clause, insertAt } = computeInsertPosition({\n\t\t\tdesired: options.desired,\n\t\t\tdesiredIndex: index,\n\t\t\tcurrent\n\t\t});\n\t\toperations.push({\n\t\t\tid: `type.${typeName}.value.${value}`,\n\t\t\tlabel: `Add value ${value} to ${typeName}`,\n\t\t\tsummary: `Adds enum value ${value} to ${typeName}`,\n\t\t\toperationClass: \"widening\",\n\t\t\ttarget: { id: \"postgres\" },\n\t\t\tprecheck: [],\n\t\t\texecute: [{\n\t\t\t\tdescription: `add value \"${value}\" if not exists`,\n\t\t\t\tsql: `ALTER TYPE ${qualifyName(schemaName, nativeType)} ADD VALUE IF NOT EXISTS '${escapeLiteral(value)}'${clause}`\n\t\t\t}],\n\t\t\tpostcheck: []\n\t\t});\n\t\tcurrent.splice(insertAt, 0, value);\n\t\tcurrentSet.add(value);\n\t}\n\treturn operations;\n}\n/**\n* Collects columns using the enum type from the contract (desired state).\n* Used for type-safe reference tracking.\n*/\nfunction collectEnumColumnsFromContract(contract, typeName, nativeType) {\n\tconst columns = [];\n\tfor (const [tableName, table] of Object.entries(contract.storage.tables)) for (const [columnName, column] of Object.entries(table.columns)) if (column.typeRef === typeName || column.nativeType === nativeType && column.codecId === PG_ENUM_CODEC_ID) columns.push({\n\t\ttable: tableName,\n\t\tcolumn: columnName\n\t});\n\treturn columns;\n}\n/**\n* Collects columns using the enum type from the schema IR (live database state).\n* This ensures we find ALL dependent columns, including those added outside the contract\n* (e.g., manual DDL), which is critical for safe enum rebuild operations.\n*/\nfunction collectEnumColumnsFromSchema(schema, nativeType) {\n\tconst columns = [];\n\tfor (const [tableName, table] of Object.entries(schema.tables)) for (const [columnName, column] of Object.entries(table.columns)) if (column.nativeType === nativeType) columns.push({\n\t\ttable: tableName,\n\t\tcolumn: columnName\n\t});\n\treturn columns;\n}\n/**\n* Collects all columns using the enum type from both contract AND live database.\n* Merges and deduplicates to ensure we migrate ALL dependent columns during rebuild.\n*\n* This is critical for data integrity: if a column exists in the database using\n* this enum but is not in the contract (e.g., added via manual DDL), we must\n* still migrate it to avoid DROP TYPE failures.\n*/\nfunction collectAllEnumColumns(contract, schema, typeName, nativeType) {\n\tconst contractColumns = collectEnumColumnsFromContract(contract, typeName, nativeType);\n\tconst schemaColumns = collectEnumColumnsFromSchema(schema, nativeType);\n\tconst seen = /* @__PURE__ */ new Set();\n\tconst result = [];\n\tfor (const col of [...contractColumns, ...schemaColumns]) {\n\t\tconst key = `${col.table}.${col.column}`;\n\t\tif (!seen.has(key)) {\n\t\t\tseen.add(key);\n\t\t\tresult.push(col);\n\t\t}\n\t}\n\treturn result.sort((a, b) => {\n\t\tconst tableCompare = a.table.localeCompare(b.table);\n\t\treturn tableCompare !== 0 ? tableCompare : a.column.localeCompare(b.column);\n\t});\n}\n/**\n* Builds a SQL check to verify a column's type matches an expected type.\n*/\nfunction columnTypeCheck(options) {\n\treturn `SELECT EXISTS (\n SELECT 1\n FROM information_schema.columns\n WHERE table_schema = '${escapeLiteral(options.schemaName)}'\n AND table_name = '${escapeLiteral(options.tableName)}'\n AND column_name = '${escapeLiteral(options.columnName)}'\n AND udt_name = '${escapeLiteral(options.expectedType)}'\n)`;\n}\n/** PostgreSQL maximum identifier length (NAMEDATALEN - 1) */\nconst MAX_IDENTIFIER_LENGTH = 63;\n/** Suffix added to enum type names during rebuild operations */\nconst REBUILD_SUFFIX = \"__pn_rebuild\";\n/**\n* Builds an SQL check to verify no rows contain any of the removed enum values.\n* This prevents data loss during enum rebuild operations.\n*\n* @param schemaName - PostgreSQL schema name\n* @param tableName - Table containing the enum column\n* @param columnName - Column using the enum type\n* @param removedValues - Array of enum values being removed\n* @returns SQL query that returns true if no rows contain removed values\n*/\nfunction noRemovedValuesExistCheck(schemaName, tableName, columnName, removedValues) {\n\tif (removedValues.length === 0) return \"SELECT true\";\n\tconst valuesList = removedValues.map((v) => `'${escapeLiteral(v)}'`).join(\", \");\n\treturn `SELECT NOT EXISTS (\n SELECT 1 FROM ${qualifyName(schemaName, tableName)}\n WHERE ${quoteIdentifier(columnName)}::text IN (${valuesList})\n LIMIT 1\n)`;\n}\n/**\n* Builds a migration operation to recreate a PostgreSQL enum type with updated values.\n*\n* This is required when:\n* - Enum values are removed (PostgreSQL doesn't support direct removal)\n* - Enum values are reordered (PostgreSQL doesn't support reordering)\n*\n* The operation:\n* 1. Creates a new enum type with the desired values (temp name)\n* 2. Migrates all columns to use the new type via text cast\n* 3. Drops the original type\n* 4. Renames the temp type to the original name\n*\n* IMPORTANT: If values are being removed and data exists using those values,\n* the operation will fail at the precheck stage with a clear error message.\n* This prevents silent data loss.\n*\n* @param options.typeName - Contract-level type name\n* @param options.nativeType - PostgreSQL type name\n* @param options.schemaName - PostgreSQL schema\n* @param options.values - Desired final enum values\n* @param options.removedValues - Values being removed (for data loss checks)\n* @param options.contract - Full contract for column discovery\n* @param options.schema - Current schema IR for column discovery\n* @returns Migration operation for full enum rebuild\n*/\nfunction buildRecreateEnumOperation(options) {\n\tconst tempTypeName = `${options.nativeType}${REBUILD_SUFFIX}`;\n\tif (tempTypeName.length > MAX_IDENTIFIER_LENGTH) {\n\t\tconst maxBaseLength = MAX_IDENTIFIER_LENGTH - 12;\n\t\tthrow new Error(`Enum type name \"${options.nativeType}\" is too long for rebuild operation. Maximum length is ${maxBaseLength} characters (type name + \"${REBUILD_SUFFIX}\" suffix must fit within PostgreSQL's ${MAX_IDENTIFIER_LENGTH}-character identifier limit).`);\n\t}\n\tconst qualifiedOriginal = qualifyName(options.schemaName, options.nativeType);\n\tconst qualifiedTemp = qualifyName(options.schemaName, tempTypeName);\n\tconst literalValues = options.values.map((value) => `'${escapeLiteral(value)}'`).join(\", \");\n\tconst columnRefs = collectAllEnumColumns(options.contract, options.schema, options.typeName, options.nativeType);\n\tconst alterColumns = columnRefs.map((ref) => ({\n\t\tdescription: `alter ${ref.table}.${ref.column} to ${tempTypeName}`,\n\t\tsql: `ALTER TABLE ${qualifyName(options.schemaName, ref.table)}\nALTER COLUMN ${quoteIdentifier(ref.column)}\nTYPE ${qualifiedTemp}\nUSING ${quoteIdentifier(ref.column)}::text::${qualifiedTemp}`\n\t}));\n\tconst postchecks = [\n\t\t{\n\t\t\tdescription: `verify type \"${options.nativeType}\" exists`,\n\t\t\tsql: enumTypeExistsCheck(options.schemaName, options.nativeType)\n\t\t},\n\t\t{\n\t\t\tdescription: `verify temp type \"${tempTypeName}\" was removed`,\n\t\t\tsql: enumTypeExistsCheck(options.schemaName, tempTypeName, false)\n\t\t},\n\t\t...columnRefs.map((ref) => ({\n\t\t\tdescription: `verify ${ref.table}.${ref.column} uses type \"${options.nativeType}\"`,\n\t\t\tsql: columnTypeCheck({\n\t\t\t\tschemaName: options.schemaName,\n\t\t\t\ttableName: ref.table,\n\t\t\t\tcolumnName: ref.column,\n\t\t\t\texpectedType: options.nativeType\n\t\t\t})\n\t\t}))\n\t];\n\treturn {\n\t\tid: `type.${options.typeName}.rebuild`,\n\t\tlabel: `Rebuild type ${options.typeName}`,\n\t\tsummary: `Recreates enum type ${options.typeName} with updated values`,\n\t\toperationClass: \"destructive\",\n\t\ttarget: { id: \"postgres\" },\n\t\tprecheck: [{\n\t\t\tdescription: `ensure type \"${options.nativeType}\" exists`,\n\t\t\tsql: enumTypeExistsCheck(options.schemaName, options.nativeType)\n\t\t}, ...options.removedValues.length > 0 ? columnRefs.map((ref) => ({\n\t\t\tdescription: `ensure no rows in ${ref.table}.${ref.column} contain removed values (${options.removedValues.join(\", \")})`,\n\t\t\tsql: noRemovedValuesExistCheck(options.schemaName, ref.table, ref.column, options.removedValues)\n\t\t})) : []],\n\t\texecute: [\n\t\t\t{\n\t\t\t\tdescription: `drop orphaned temp type \"${tempTypeName}\" if exists`,\n\t\t\t\tsql: `DROP TYPE IF EXISTS ${qualifiedTemp}`\n\t\t\t},\n\t\t\t{\n\t\t\t\tdescription: `create temp type \"${tempTypeName}\"`,\n\t\t\t\tsql: `CREATE TYPE ${qualifiedTemp} AS ENUM (${literalValues})`\n\t\t\t},\n\t\t\t...alterColumns,\n\t\t\t{\n\t\t\t\tdescription: `drop type \"${options.nativeType}\"`,\n\t\t\t\tsql: `DROP TYPE ${qualifiedOriginal}`\n\t\t\t},\n\t\t\t{\n\t\t\t\tdescription: `rename type \"${tempTypeName}\" to \"${options.nativeType}\"`,\n\t\t\t\tsql: `ALTER TYPE ${qualifiedTemp} RENAME TO ${quoteIdentifier(options.nativeType)}`\n\t\t\t}\n\t\t],\n\t\tpostcheck: postchecks\n\t};\n}\n/**\n* Postgres enum hooks for planning, verifying, and introspecting `storage.types`.\n*/\nconst pgEnumControlHooks = {\n\tplanTypeOperations: ({ typeName, typeInstance, contract, schema, schemaName }) => {\n\t\tconst desired = getEnumValues(typeInstance);\n\t\tif (!desired || desired.length === 0) return { operations: [] };\n\t\tconst schemaNamespace = schemaName ?? \"public\";\n\t\tconst existing = readExistingEnumValues(schema, typeInstance.nativeType);\n\t\tif (!existing) return { operations: [buildCreateEnumOperation(typeName, typeInstance.nativeType, schemaNamespace, desired)] };\n\t\tconst diff = determineEnumDiff(existing, desired);\n\t\tif (diff.kind === \"unchanged\") return { operations: [] };\n\t\tif (diff.kind === \"rebuild\") return { operations: [buildRecreateEnumOperation({\n\t\t\ttypeName,\n\t\t\tnativeType: typeInstance.nativeType,\n\t\t\tschemaName: schemaNamespace,\n\t\t\tvalues: desired,\n\t\t\tremovedValues: diff.removedValues,\n\t\t\tcontract,\n\t\t\tschema\n\t\t})] };\n\t\treturn { operations: buildAddValueOperations({\n\t\t\ttypeName,\n\t\t\tnativeType: typeInstance.nativeType,\n\t\t\tschemaName: schemaNamespace,\n\t\t\tdesired,\n\t\t\texisting\n\t\t}) };\n\t},\n\tverifyType: ({ typeName, typeInstance, schema }) => {\n\t\tconst desired = getEnumValues(typeInstance);\n\t\tif (!desired) return [];\n\t\tconst existing = readExistingEnumValues(schema, typeInstance.nativeType);\n\t\tif (!existing) return [{\n\t\t\tkind: \"type_missing\",\n\t\t\ttypeName,\n\t\t\tmessage: `Type \"${typeName}\" is missing from database`\n\t\t}];\n\t\tconst diff = determineEnumDiff(existing, desired);\n\t\tif (diff.kind === \"unchanged\") return [];\n\t\tconst existingSet = new Set(existing);\n\t\tconst desiredSet = new Set(desired);\n\t\tconst addedValues = desired.filter((v) => !existingSet.has(v));\n\t\tconst removedValues = existing.filter((v) => !desiredSet.has(v));\n\t\treturn [{\n\t\t\tkind: \"enum_values_changed\",\n\t\t\ttypeName,\n\t\t\taddedValues,\n\t\t\tremovedValues,\n\t\t\tmessage: diff.kind === \"add_values\" ? `Enum type \"${typeName}\" needs new values: ${addedValues.join(\", \")}` : `Enum type \"${typeName}\" values changed (requires rebuild): +[${addedValues.join(\", \")}] -[${removedValues.join(\", \")}]`\n\t\t}];\n\t},\n\tintrospectTypes: async ({ driver, schemaName }) => {\n\t\tconst namespace = schemaName ?? \"public\";\n\t\tconst result = await driver.query(ENUM_INTROSPECT_QUERY, [namespace]);\n\t\tconst types = {};\n\t\tfor (const row of result.rows) {\n\t\t\tconst values = parsePostgresArray(row.values);\n\t\t\tif (!values) throw new Error(`Failed to parse enum values for type \"${row.type_name}\": unexpected format: ${JSON.stringify(row.values)}`);\n\t\t\ttypes[row.type_name] = {\n\t\t\t\tcodecId: PG_ENUM_CODEC_ID,\n\t\t\t\tnativeType: row.type_name,\n\t\t\t\ttypeParams: { values }\n\t\t\t};\n\t\t}\n\t\treturn types;\n\t}\n};\n\n//#endregion\n//#region src/core/descriptor-meta.ts\n/** Creates a type import spec for codec types */\nconst codecTypeImport = (named) => ({\n\tpackage: \"@prisma-next/adapter-postgres/codec-types\",\n\tnamed,\n\talias: named\n});\nfunction isPositiveInteger(value) {\n\treturn typeof value === \"number\" && Number.isFinite(value) && Number.isInteger(value) && value > 0;\n}\nfunction isNonNegativeInteger(value) {\n\treturn typeof value === \"number\" && Number.isFinite(value) && Number.isInteger(value) && value >= 0;\n}\nfunction expandLength({ nativeType, typeParams }) {\n\tif (!typeParams || !(\"length\" in typeParams)) return nativeType;\n\tconst length = typeParams[\"length\"];\n\tif (!isPositiveInteger(length)) throw new Error(`Invalid \"length\" type parameter for \"${nativeType}\": expected a positive integer, got ${JSON.stringify(length)}`);\n\treturn `${nativeType}(${length})`;\n}\nfunction expandPrecision({ nativeType, typeParams }) {\n\tif (!typeParams || !(\"precision\" in typeParams)) return nativeType;\n\tconst precision = typeParams[\"precision\"];\n\tif (!isPositiveInteger(precision)) throw new Error(`Invalid \"precision\" type parameter for \"${nativeType}\": expected a positive integer, got ${JSON.stringify(precision)}`);\n\treturn `${nativeType}(${precision})`;\n}\nfunction expandNumeric({ nativeType, typeParams }) {\n\tconst hasPrecision = typeParams && \"precision\" in typeParams;\n\tconst hasScale = typeParams && \"scale\" in typeParams;\n\tif (!hasPrecision && !hasScale) return nativeType;\n\tif (!hasPrecision && hasScale) throw new Error(`Invalid type parameters for \"${nativeType}\": \"scale\" requires \"precision\" to be specified`);\n\tif (hasPrecision) {\n\t\tconst precision = typeParams[\"precision\"];\n\t\tif (!isPositiveInteger(precision)) throw new Error(`Invalid \"precision\" type parameter for \"${nativeType}\": expected a positive integer, got ${JSON.stringify(precision)}`);\n\t\tif (hasScale) {\n\t\t\tconst scale = typeParams[\"scale\"];\n\t\t\tif (!isNonNegativeInteger(scale)) throw new Error(`Invalid \"scale\" type parameter for \"${nativeType}\": expected a non-negative integer, got ${JSON.stringify(scale)}`);\n\t\t\treturn `${nativeType}(${precision},${scale})`;\n\t\t}\n\t\treturn `${nativeType}(${precision})`;\n\t}\n\treturn nativeType;\n}\nconst lengthHooks = { expandNativeType: expandLength };\nconst precisionHooks = { expandNativeType: expandPrecision };\nconst numericHooks = { expandNativeType: expandNumeric };\nconst identityHooks = { expandNativeType: ({ nativeType }) => nativeType };\nconst postgresQueryOperations = [{\n\tmethod: \"ilike\",\n\targs: [{\n\t\ttraits: [\"textual\"],\n\t\tnullable: false\n\t}, {\n\t\tcodecId: PG_TEXT_CODEC_ID,\n\t\tnullable: false\n\t}],\n\treturns: {\n\t\tcodecId: PG_BOOL_CODEC_ID,\n\t\tnullable: false\n\t},\n\tlowering: {\n\t\ttargetFamily: \"sql\",\n\t\tstrategy: \"infix\",\n\t\ttemplate: \"{{self}} ILIKE {{arg0}}\"\n\t}\n}];\nconst postgresAdapterDescriptorMeta = {\n\tkind: \"adapter\",\n\tfamilyId: \"sql\",\n\ttargetId: \"postgres\",\n\tid: \"postgres\",\n\tversion: \"0.0.1\",\n\tcapabilities: {\n\t\tpostgres: {\n\t\t\torderBy: true,\n\t\t\tlimit: true,\n\t\t\tlateral: true,\n\t\t\tjsonAgg: true,\n\t\t\treturning: true\n\t\t},\n\t\tsql: {\n\t\t\tenums: true,\n\t\t\treturning: true,\n\t\t\tdefaultInInsert: true\n\t\t}\n\t},\n\ttypes: {\n\t\tcodecTypes: {\n\t\t\tcodecInstances: Object.values(codecDefinitions).map((def) => def.codec),\n\t\t\timport: {\n\t\t\t\tpackage: \"@prisma-next/adapter-postgres/codec-types\",\n\t\t\t\tnamed: \"CodecTypes\",\n\t\t\t\talias: \"PgTypes\"\n\t\t\t},\n\t\t\ttypeImports: [\n\t\t\t\t{\n\t\t\t\t\tpackage: \"@prisma-next/adapter-postgres/codec-types\",\n\t\t\t\t\tnamed: \"JsonValue\",\n\t\t\t\t\talias: \"JsonValue\"\n\t\t\t\t},\n\t\t\t\tcodecTypeImport(\"Char\"),\n\t\t\t\tcodecTypeImport(\"Varchar\"),\n\t\t\t\tcodecTypeImport(\"Numeric\"),\n\t\t\t\tcodecTypeImport(\"Bit\"),\n\t\t\t\tcodecTypeImport(\"VarBit\"),\n\t\t\t\tcodecTypeImport(\"Timestamp\"),\n\t\t\t\tcodecTypeImport(\"Timestamptz\"),\n\t\t\t\tcodecTypeImport(\"Time\"),\n\t\t\t\tcodecTypeImport(\"Timetz\"),\n\t\t\t\tcodecTypeImport(\"Interval\")\n\t\t\t],\n\t\t\tcontrolPlaneHooks: {\n\t\t\t\t[SQL_CHAR_CODEC_ID]: lengthHooks,\n\t\t\t\t[SQL_VARCHAR_CODEC_ID]: lengthHooks,\n\t\t\t\t[SQL_TIMESTAMP_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_CHAR_CODEC_ID]: lengthHooks,\n\t\t\t\t[PG_VARCHAR_CODEC_ID]: lengthHooks,\n\t\t\t\t[PG_NUMERIC_CODEC_ID]: numericHooks,\n\t\t\t\t[PG_BIT_CODEC_ID]: lengthHooks,\n\t\t\t\t[PG_VARBIT_CODEC_ID]: lengthHooks,\n\t\t\t\t[PG_TIMESTAMP_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_TIMESTAMPTZ_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_TIME_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_TIMETZ_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_INTERVAL_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_ENUM_CODEC_ID]: pgEnumControlHooks,\n\t\t\t\t[PG_JSON_CODEC_ID]: identityHooks,\n\t\t\t\t[PG_JSONB_CODEC_ID]: identityHooks\n\t\t\t}\n\t\t},\n\t\tstorage: [\n\t\t\t{\n\t\t\t\ttypeId: PG_TEXT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"text\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: SQL_TEXT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"text\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: SQL_CHAR_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"character\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: SQL_VARCHAR_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"character varying\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: SQL_INT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"int4\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: SQL_FLOAT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"float8\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: SQL_TIMESTAMP_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"timestamp\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_CHAR_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"character\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_VARCHAR_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"character varying\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"int4\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_FLOAT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"float8\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INT4_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"int4\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INT2_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"int2\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INT8_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"int8\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_FLOAT4_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"float4\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_FLOAT8_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"float8\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_NUMERIC_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"numeric\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIMESTAMP_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"timestamp\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIMESTAMPTZ_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"timestamptz\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIME_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"time\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIMETZ_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"timetz\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_BOOL_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"bool\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_BIT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"bit\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_VARBIT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"bit varying\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INTERVAL_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"interval\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_JSON_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"json\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_JSONB_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"jsonb\"\n\t\t\t}\n\t\t],\n\t\tqueryOperationTypes: { import: {\n\t\t\tpackage: \"@prisma-next/adapter-postgres/operation-types\",\n\t\t\tnamed: \"QueryOperationTypes\",\n\t\t\talias: \"PgAdapterQueryOps\"\n\t\t} }\n\t}\n};\n\n//#endregion\nexport { postgresQueryOperations as n, pgEnumControlHooks as r, postgresAdapterDescriptorMeta as t };\n//# sourceMappingURL=descriptor-meta-BB9XPAFi.mjs.map","import { ifDefined } from \"@prisma-next/utils/defined\";\n\n//#region src/generator-ids.ts\nconst builtinGeneratorIds = [\n\t\"ulid\",\n\t\"nanoid\",\n\t\"uuidv7\",\n\t\"uuidv4\",\n\t\"cuid2\",\n\t\"ksuid\"\n];\n\n//#endregion\n//#region src/index.ts\nfunction resolveNanoidColumnDescriptor(params) {\n\tconst rawSize = params?.[\"size\"];\n\tif (rawSize === void 0) return {\n\t\ttype: {\n\t\t\tcodecId: \"sql/char@1\",\n\t\t\tnativeType: \"character\"\n\t\t},\n\t\ttypeParams: { length: 21 }\n\t};\n\tif (typeof rawSize !== \"number\" || !Number.isInteger(rawSize) || rawSize < 2 || rawSize > 255) throw new Error(\"nanoid size must be an integer between 2 and 255\");\n\treturn {\n\t\ttype: {\n\t\t\tcodecId: \"sql/char@1\",\n\t\t\tnativeType: \"character\"\n\t\t},\n\t\ttypeParams: { length: rawSize }\n\t};\n}\nconst builtinGeneratorMetadataById = {\n\tulid: {\n\t\tapplicableCodecIds: [\"pg/text@1\", \"sql/char@1\"],\n\t\tgeneratedColumnDescriptor: {\n\t\t\ttype: {\n\t\t\t\tcodecId: \"sql/char@1\",\n\t\t\t\tnativeType: \"character\"\n\t\t\t},\n\t\t\ttypeParams: { length: 26 }\n\t\t}\n\t},\n\tnanoid: {\n\t\tapplicableCodecIds: [\"pg/text@1\", \"sql/char@1\"],\n\t\tgeneratedColumnDescriptor: {\n\t\t\ttype: {\n\t\t\t\tcodecId: \"sql/char@1\",\n\t\t\t\tnativeType: \"character\"\n\t\t\t},\n\t\t\ttypeParams: { length: 21 }\n\t\t},\n\t\tresolveGeneratedColumnDescriptor: resolveNanoidColumnDescriptor\n\t},\n\tuuidv7: {\n\t\tapplicableCodecIds: [\"pg/text@1\", \"sql/char@1\"],\n\t\tgeneratedColumnDescriptor: {\n\t\t\ttype: {\n\t\t\t\tcodecId: \"sql/char@1\",\n\t\t\t\tnativeType: \"character\"\n\t\t\t},\n\t\t\ttypeParams: { length: 36 }\n\t\t}\n\t},\n\tuuidv4: {\n\t\tapplicableCodecIds: [\"pg/text@1\", \"sql/char@1\"],\n\t\tgeneratedColumnDescriptor: {\n\t\t\ttype: {\n\t\t\t\tcodecId: \"sql/char@1\",\n\t\t\t\tnativeType: \"character\"\n\t\t\t},\n\t\t\ttypeParams: { length: 36 }\n\t\t}\n\t},\n\tcuid2: {\n\t\tapplicableCodecIds: [\"pg/text@1\", \"sql/char@1\"],\n\t\tgeneratedColumnDescriptor: {\n\t\t\ttype: {\n\t\t\t\tcodecId: \"sql/char@1\",\n\t\t\t\tnativeType: \"character\"\n\t\t\t},\n\t\t\ttypeParams: { length: 24 }\n\t\t}\n\t},\n\tksuid: {\n\t\tapplicableCodecIds: [\"pg/text@1\", \"sql/char@1\"],\n\t\tgeneratedColumnDescriptor: {\n\t\t\ttype: {\n\t\t\t\tcodecId: \"sql/char@1\",\n\t\t\t\tnativeType: \"character\"\n\t\t\t},\n\t\t\ttypeParams: { length: 27 }\n\t\t}\n\t}\n};\nconst builtinGeneratorRegistryMetadata = builtinGeneratorIds.map((id) => ({\n\tid,\n\tapplicableCodecIds: builtinGeneratorMetadataById[id].applicableCodecIds\n}));\nfunction resolveBuiltinGeneratedColumnDescriptor(input) {\n\tconst metadata = builtinGeneratorMetadataById[input.id];\n\tif (metadata.resolveGeneratedColumnDescriptor) return metadata.resolveGeneratedColumnDescriptor(input.params);\n\treturn metadata.generatedColumnDescriptor;\n}\nfunction createGeneratedSpec(id, options) {\n\tconst params = options;\n\tconst resolvedDescriptor = resolveBuiltinGeneratedColumnDescriptor({\n\t\tid,\n\t\t...ifDefined(\"params\", params)\n\t});\n\treturn {\n\t\ttype: resolvedDescriptor.type,\n\t\tnullable: false,\n\t\t...ifDefined(\"typeParams\", resolvedDescriptor.typeParams),\n\t\tgenerated: {\n\t\t\tkind: \"generator\",\n\t\t\tid,\n\t\t\t...ifDefined(\"params\", params)\n\t\t}\n\t};\n}\nconst ulid = (options) => createGeneratedSpec(\"ulid\", options);\nconst nanoid = (options) => createGeneratedSpec(\"nanoid\", options);\nconst uuidv7 = (options) => createGeneratedSpec(\"uuidv7\", options);\nconst uuidv4 = (options) => createGeneratedSpec(\"uuidv4\", options);\nconst cuid2 = (options) => createGeneratedSpec(\"cuid2\", options);\nconst ksuid = (options) => createGeneratedSpec(\"ksuid\", options);\n\n//#endregion\nexport { builtinGeneratorIds, builtinGeneratorRegistryMetadata, cuid2, ksuid, nanoid, resolveBuiltinGeneratedColumnDescriptor, ulid, uuidv4, uuidv7 };\n//# sourceMappingURL=index.mjs.map","import { i as quoteIdentifier, n as escapeLiteral, r as qualifyName, t as SqlEscapeError } from \"./sql-utils-DkUJyZmA.mjs\";\nimport { r as pgEnumControlHooks, t as postgresAdapterDescriptorMeta } from \"./descriptor-meta-BB9XPAFi.mjs\";\nimport { ifDefined } from \"@prisma-next/utils/defined\";\nimport { builtinGeneratorRegistryMetadata, resolveBuiltinGeneratedColumnDescriptor } from \"@prisma-next/ids\";\n\n//#region src/core/default-normalizer.ts\n/**\n* Pre-compiled regex patterns for performance.\n* These are compiled once at module load time rather than on each function call.\n*/\nconst NEXTVAL_PATTERN = /^nextval\\s*\\(/i;\nconst NOW_FUNCTION_PATTERN = /^(now\\s*\\(\\s*\\)|CURRENT_TIMESTAMP)$/i;\nconst CLOCK_TIMESTAMP_PATTERN = /^clock_timestamp\\s*\\(\\s*\\)$/i;\nconst TIMESTAMP_CAST_SUFFIX = /::timestamp(?:tz|\\s+(?:with|without)\\s+time\\s+zone)?$/i;\nconst TEXT_CAST_SUFFIX = /::text$/i;\nconst NOW_LITERAL_PATTERN = /^'now'$/i;\nconst UUID_PATTERN = /^gen_random_uuid\\s*\\(\\s*\\)$/i;\nconst UUID_OSSP_PATTERN = /^uuid_generate_v4\\s*\\(\\s*\\)$/i;\nconst NULL_PATTERN = /^NULL(?:::.+)?$/i;\nconst TRUE_PATTERN = /^true$/i;\nconst FALSE_PATTERN = /^false$/i;\nconst NUMERIC_PATTERN = /^-?\\d+(\\.\\d+)?$/;\nconst STRING_LITERAL_PATTERN = /^'((?:[^']|'')*)'(?:::(?:\"[^\"]+\"|[\\w\\s]+)(?:\\(\\d+\\))?)?$/;\n/**\n* Returns the canonical expression for a timestamp default function, or undefined\n* if the expression is not a recognized timestamp default.\n*\n* Keeps now()/CURRENT_TIMESTAMP and clock_timestamp() distinct:\n* - now(), CURRENT_TIMESTAMP, ('now'::text)::timestamp... → 'now()'\n* - clock_timestamp(), clock_timestamp()::timestamptz → 'clock_timestamp()'\n*\n* These are semantically different in Postgres: now() returns the transaction\n* start time (constant within a transaction), while clock_timestamp() returns\n* the actual wall-clock time (can differ across rows in a single INSERT).\n*/\nfunction canonicalizeTimestampDefault(expr) {\n\tif (NOW_FUNCTION_PATTERN.test(expr)) return \"now()\";\n\tif (CLOCK_TIMESTAMP_PATTERN.test(expr)) return \"clock_timestamp()\";\n\tif (!TIMESTAMP_CAST_SUFFIX.test(expr)) return void 0;\n\tlet inner = expr.replace(TIMESTAMP_CAST_SUFFIX, \"\").trim();\n\tif (inner.startsWith(\"(\") && inner.endsWith(\")\")) inner = inner.slice(1, -1).trim();\n\tif (NOW_FUNCTION_PATTERN.test(inner)) return \"now()\";\n\tif (CLOCK_TIMESTAMP_PATTERN.test(inner)) return \"clock_timestamp()\";\n\tinner = inner.replace(TEXT_CAST_SUFFIX, \"\").trim();\n\tif (NOW_LITERAL_PATTERN.test(inner)) return \"now()\";\n}\n/**\n* Parses a raw Postgres column default expression into a normalized ColumnDefault.\n* This enables semantic comparison between contract defaults and introspected schema defaults.\n*\n* Used by the migration diff layer to normalize raw database defaults during comparison,\n* keeping the introspection layer focused on faithful data capture.\n*\n* @param rawDefault - Raw default expression from information_schema.columns.column_default\n* @param nativeType - Native column type, used for type-aware parsing (bigint tagging, JSON detection)\n* @returns Normalized ColumnDefault or undefined if the expression cannot be parsed\n*/\nfunction parsePostgresDefault(rawDefault, nativeType) {\n\tconst trimmed = rawDefault.trim();\n\tconst normalizedType = nativeType?.toLowerCase();\n\tconst isBigInt = normalizedType === \"bigint\" || normalizedType === \"int8\";\n\tif (NEXTVAL_PATTERN.test(trimmed)) return {\n\t\tkind: \"function\",\n\t\texpression: \"autoincrement()\"\n\t};\n\tconst canonicalTimestamp = canonicalizeTimestampDefault(trimmed);\n\tif (canonicalTimestamp) return {\n\t\tkind: \"function\",\n\t\texpression: canonicalTimestamp\n\t};\n\tif (UUID_PATTERN.test(trimmed)) return {\n\t\tkind: \"function\",\n\t\texpression: \"gen_random_uuid()\"\n\t};\n\tif (UUID_OSSP_PATTERN.test(trimmed)) return {\n\t\tkind: \"function\",\n\t\texpression: \"gen_random_uuid()\"\n\t};\n\tif (NULL_PATTERN.test(trimmed)) return {\n\t\tkind: \"literal\",\n\t\tvalue: null\n\t};\n\tif (TRUE_PATTERN.test(trimmed)) return {\n\t\tkind: \"literal\",\n\t\tvalue: true\n\t};\n\tif (FALSE_PATTERN.test(trimmed)) return {\n\t\tkind: \"literal\",\n\t\tvalue: false\n\t};\n\tif (NUMERIC_PATTERN.test(trimmed)) {\n\t\tconst num = Number(trimmed);\n\t\tif (!Number.isFinite(num)) return void 0;\n\t\tif (isBigInt && !Number.isSafeInteger(num)) return {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: trimmed\n\t\t};\n\t\treturn {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: num\n\t\t};\n\t}\n\tconst stringMatch = trimmed.match(STRING_LITERAL_PATTERN);\n\tif (stringMatch?.[1] !== void 0) {\n\t\tconst unescaped = stringMatch[1].replace(/''/g, \"'\");\n\t\tif (normalizedType === \"json\" || normalizedType === \"jsonb\") try {\n\t\t\treturn {\n\t\t\t\tkind: \"literal\",\n\t\t\t\tvalue: JSON.parse(unescaped)\n\t\t\t};\n\t\t} catch {}\n\t\tif (isBigInt && NUMERIC_PATTERN.test(unescaped)) {\n\t\t\tconst num = Number(unescaped);\n\t\t\tif (Number.isSafeInteger(num)) return {\n\t\t\t\tkind: \"literal\",\n\t\t\t\tvalue: num\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tkind: \"literal\",\n\t\t\t\tvalue: unescaped\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: unescaped\n\t\t};\n\t}\n\treturn {\n\t\tkind: \"function\",\n\t\texpression: trimmed\n\t};\n}\n\n//#endregion\n//#region src/core/control-adapter.ts\n/**\n* Postgres control plane adapter for control-plane operations like introspection.\n* Provides target-specific implementations for control-plane domain actions.\n*/\nvar PostgresControlAdapter = class {\n\tfamilyId = \"sql\";\n\ttargetId = \"postgres\";\n\t/**\n\t* Target-specific normalizer for raw Postgres default expressions.\n\t* Used by schema verification to normalize raw defaults before comparison.\n\t*/\n\tnormalizeDefault = parsePostgresDefault;\n\t/**\n\t* Target-specific normalizer for Postgres schema native type names.\n\t* Used by schema verification to normalize introspected type names\n\t* before comparison with contract native types.\n\t*/\n\tnormalizeNativeType = normalizeSchemaNativeType;\n\t/**\n\t* Introspects a Postgres database schema and returns a raw SqlSchemaIR.\n\t*\n\t* This is a pure schema discovery operation that queries the Postgres catalog\n\t* and returns the schema structure without type mapping or contract enrichment.\n\t* Type mapping and enrichment are handled separately by enrichment helpers.\n\t*\n\t* Uses batched queries to minimize database round trips (7 queries instead of 5T+3).\n\t*\n\t* @param driver - ControlDriverInstance<'sql', 'postgres'> instance for executing queries\n\t* @param contract - Optional contract for contract-guided introspection (filtering, optimization)\n\t* @param schema - Schema name to introspect (defaults to 'public')\n\t* @returns Promise resolving to SqlSchemaIR representing the live database schema\n\t*/\n\tasync introspect(driver, _contract, schema = \"public\") {\n\t\tconst [tablesResult, columnsResult, pkResult, fkResult, uniqueResult, indexResult, extensionsResult] = await Promise.all([\n\t\t\tdriver.query(`SELECT table_name\n FROM information_schema.tables\n WHERE table_schema = $1\n AND table_type = 'BASE TABLE'\n ORDER BY table_name`, [schema]),\n\t\t\tdriver.query(`SELECT\n c.table_name,\n column_name,\n data_type,\n udt_name,\n is_nullable,\n character_maximum_length,\n numeric_precision,\n numeric_scale,\n column_default,\n format_type(a.atttypid, a.atttypmod) AS formatted_type\n FROM information_schema.columns c\n JOIN pg_catalog.pg_class cl\n ON cl.relname = c.table_name\n JOIN pg_catalog.pg_namespace ns\n ON ns.nspname = c.table_schema\n AND ns.oid = cl.relnamespace\n JOIN pg_catalog.pg_attribute a\n ON a.attrelid = cl.oid\n AND a.attname = c.column_name\n AND a.attnum > 0\n AND NOT a.attisdropped\n WHERE c.table_schema = $1\n ORDER BY c.table_name, c.ordinal_position`, [schema]),\n\t\t\tdriver.query(`SELECT\n tc.table_name,\n tc.constraint_name,\n kcu.column_name,\n kcu.ordinal_position\n FROM information_schema.table_constraints tc\n JOIN information_schema.key_column_usage kcu\n ON tc.constraint_name = kcu.constraint_name\n AND tc.table_schema = kcu.table_schema\n AND tc.table_name = kcu.table_name\n WHERE tc.table_schema = $1\n AND tc.constraint_type = 'PRIMARY KEY'\n ORDER BY tc.table_name, kcu.ordinal_position`, [schema]),\n\t\t\tdriver.query(`SELECT\n tc.table_name,\n tc.constraint_name,\n kcu.column_name,\n kcu.ordinal_position,\n ref_ns.nspname AS referenced_table_schema,\n ref_cl.relname AS referenced_table_name,\n ref_att.attname AS referenced_column_name,\n rc.delete_rule,\n rc.update_rule\n FROM information_schema.table_constraints tc\n JOIN information_schema.key_column_usage kcu\n ON tc.constraint_name = kcu.constraint_name\n AND tc.table_schema = kcu.table_schema\n AND tc.table_name = kcu.table_name\n JOIN pg_catalog.pg_constraint pgc\n ON pgc.conname = tc.constraint_name\n AND pgc.connamespace = (\n SELECT oid FROM pg_catalog.pg_namespace WHERE nspname = tc.table_schema\n )\n JOIN pg_catalog.pg_class ref_cl\n ON ref_cl.oid = pgc.confrelid\n JOIN pg_catalog.pg_namespace ref_ns\n ON ref_ns.oid = ref_cl.relnamespace\n JOIN pg_catalog.pg_attribute ref_att\n ON ref_att.attrelid = pgc.confrelid\n AND ref_att.attnum = pgc.confkey[kcu.ordinal_position]\n JOIN information_schema.referential_constraints rc\n ON rc.constraint_name = tc.constraint_name\n AND rc.constraint_schema = tc.table_schema\n WHERE tc.table_schema = $1\n AND tc.constraint_type = 'FOREIGN KEY'\n ORDER BY tc.table_name, tc.constraint_name, kcu.ordinal_position`, [schema]),\n\t\t\tdriver.query(`SELECT\n tc.table_name,\n tc.constraint_name,\n kcu.column_name,\n kcu.ordinal_position\n FROM information_schema.table_constraints tc\n JOIN information_schema.key_column_usage kcu\n ON tc.constraint_name = kcu.constraint_name\n AND tc.table_schema = kcu.table_schema\n AND tc.table_name = kcu.table_name\n WHERE tc.table_schema = $1\n AND tc.constraint_type = 'UNIQUE'\n ORDER BY tc.table_name, tc.constraint_name, kcu.ordinal_position`, [schema]),\n\t\t\tdriver.query(`SELECT\n i.tablename,\n i.indexname,\n ix.indisunique,\n a.attname,\n a.attnum\n FROM pg_indexes i\n JOIN pg_class ic ON ic.relname = i.indexname\n JOIN pg_namespace ins ON ins.oid = ic.relnamespace AND ins.nspname = $1\n JOIN pg_index ix ON ix.indexrelid = ic.oid\n JOIN pg_class t ON t.oid = ix.indrelid\n JOIN pg_namespace tn ON tn.oid = t.relnamespace AND tn.nspname = $1\n LEFT JOIN pg_attribute a ON a.attrelid = t.oid AND a.attnum = ANY(ix.indkey) AND a.attnum > 0\n WHERE i.schemaname = $1\n AND NOT EXISTS (\n SELECT 1\n FROM information_schema.table_constraints tc\n WHERE tc.table_schema = $1\n AND tc.table_name = i.tablename\n AND tc.constraint_name = i.indexname\n )\n ORDER BY i.tablename, i.indexname, a.attnum`, [schema]),\n\t\t\tdriver.query(`SELECT extname\n FROM pg_extension\n ORDER BY extname`, [])\n\t\t]);\n\t\tconst columnsByTable = groupBy(columnsResult.rows, \"table_name\");\n\t\tconst pksByTable = groupBy(pkResult.rows, \"table_name\");\n\t\tconst fksByTable = groupBy(fkResult.rows, \"table_name\");\n\t\tconst uniquesByTable = groupBy(uniqueResult.rows, \"table_name\");\n\t\tconst indexesByTable = groupBy(indexResult.rows, \"tablename\");\n\t\tconst pkConstraintsByTable = /* @__PURE__ */ new Map();\n\t\tfor (const row of pkResult.rows) {\n\t\t\tlet constraints = pkConstraintsByTable.get(row.table_name);\n\t\t\tif (!constraints) {\n\t\t\t\tconstraints = /* @__PURE__ */ new Set();\n\t\t\t\tpkConstraintsByTable.set(row.table_name, constraints);\n\t\t\t}\n\t\t\tconstraints.add(row.constraint_name);\n\t\t}\n\t\tconst tables = {};\n\t\tfor (const tableRow of tablesResult.rows) {\n\t\t\tconst tableName = tableRow.table_name;\n\t\t\tconst columns = {};\n\t\t\tfor (const colRow of columnsByTable.get(tableName) ?? []) {\n\t\t\t\tlet nativeType = colRow.udt_name;\n\t\t\t\tconst formattedType = colRow.formatted_type ? normalizeFormattedType(colRow.formatted_type, colRow.data_type, colRow.udt_name) : null;\n\t\t\t\tif (formattedType) nativeType = formattedType;\n\t\t\t\telse if (colRow.data_type === \"character varying\" || colRow.data_type === \"character\") if (colRow.character_maximum_length) nativeType = `${colRow.data_type}(${colRow.character_maximum_length})`;\n\t\t\t\telse nativeType = colRow.data_type;\n\t\t\t\telse if (colRow.data_type === \"numeric\" || colRow.data_type === \"decimal\") if (colRow.numeric_precision && colRow.numeric_scale !== null) nativeType = `${colRow.data_type}(${colRow.numeric_precision},${colRow.numeric_scale})`;\n\t\t\t\telse if (colRow.numeric_precision) nativeType = `${colRow.data_type}(${colRow.numeric_precision})`;\n\t\t\t\telse nativeType = colRow.data_type;\n\t\t\t\telse nativeType = colRow.udt_name || colRow.data_type;\n\t\t\t\tcolumns[colRow.column_name] = {\n\t\t\t\t\tname: colRow.column_name,\n\t\t\t\t\tnativeType,\n\t\t\t\t\tnullable: colRow.is_nullable === \"YES\",\n\t\t\t\t\t...ifDefined(\"default\", colRow.column_default ?? void 0)\n\t\t\t\t};\n\t\t\t}\n\t\t\tconst pkRows = [...pksByTable.get(tableName) ?? []];\n\t\t\tconst primaryKeyColumns = pkRows.sort((a, b) => a.ordinal_position - b.ordinal_position).map((row) => row.column_name);\n\t\t\tconst primaryKey = primaryKeyColumns.length > 0 ? {\n\t\t\t\tcolumns: primaryKeyColumns,\n\t\t\t\t...pkRows[0]?.constraint_name ? { name: pkRows[0].constraint_name } : {}\n\t\t\t} : void 0;\n\t\t\tconst foreignKeysMap = /* @__PURE__ */ new Map();\n\t\t\tfor (const fkRow of fksByTable.get(tableName) ?? []) {\n\t\t\t\tconst existing = foreignKeysMap.get(fkRow.constraint_name);\n\t\t\t\tif (existing) {\n\t\t\t\t\texisting.columns.push(fkRow.column_name);\n\t\t\t\t\texisting.referencedColumns.push(fkRow.referenced_column_name);\n\t\t\t\t} else foreignKeysMap.set(fkRow.constraint_name, {\n\t\t\t\t\tcolumns: [fkRow.column_name],\n\t\t\t\t\treferencedTable: fkRow.referenced_table_name,\n\t\t\t\t\treferencedColumns: [fkRow.referenced_column_name],\n\t\t\t\t\tname: fkRow.constraint_name,\n\t\t\t\t\tdeleteRule: fkRow.delete_rule,\n\t\t\t\t\tupdateRule: fkRow.update_rule\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst foreignKeys = Array.from(foreignKeysMap.values()).map((fk) => ({\n\t\t\t\tcolumns: Object.freeze([...fk.columns]),\n\t\t\t\treferencedTable: fk.referencedTable,\n\t\t\t\treferencedColumns: Object.freeze([...fk.referencedColumns]),\n\t\t\t\tname: fk.name,\n\t\t\t\t...ifDefined(\"onDelete\", mapReferentialAction(fk.deleteRule)),\n\t\t\t\t...ifDefined(\"onUpdate\", mapReferentialAction(fk.updateRule))\n\t\t\t}));\n\t\t\tconst pkConstraints = pkConstraintsByTable.get(tableName) ?? /* @__PURE__ */ new Set();\n\t\t\tconst uniquesMap = /* @__PURE__ */ new Map();\n\t\t\tfor (const uniqueRow of uniquesByTable.get(tableName) ?? []) {\n\t\t\t\tif (pkConstraints.has(uniqueRow.constraint_name)) continue;\n\t\t\t\tconst existing = uniquesMap.get(uniqueRow.constraint_name);\n\t\t\t\tif (existing) existing.columns.push(uniqueRow.column_name);\n\t\t\t\telse uniquesMap.set(uniqueRow.constraint_name, {\n\t\t\t\t\tcolumns: [uniqueRow.column_name],\n\t\t\t\t\tname: uniqueRow.constraint_name\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst uniques = Array.from(uniquesMap.values()).map((uq) => ({\n\t\t\t\tcolumns: Object.freeze([...uq.columns]),\n\t\t\t\tname: uq.name\n\t\t\t}));\n\t\t\tconst indexesMap = /* @__PURE__ */ new Map();\n\t\t\tfor (const idxRow of indexesByTable.get(tableName) ?? []) {\n\t\t\t\tif (!idxRow.attname) continue;\n\t\t\t\tconst existing = indexesMap.get(idxRow.indexname);\n\t\t\t\tif (existing) existing.columns.push(idxRow.attname);\n\t\t\t\telse indexesMap.set(idxRow.indexname, {\n\t\t\t\t\tcolumns: [idxRow.attname],\n\t\t\t\t\tname: idxRow.indexname,\n\t\t\t\t\tunique: idxRow.indisunique\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst indexes = Array.from(indexesMap.values()).map((idx) => ({\n\t\t\t\tcolumns: Object.freeze([...idx.columns]),\n\t\t\t\tname: idx.name,\n\t\t\t\tunique: idx.unique\n\t\t\t}));\n\t\t\ttables[tableName] = {\n\t\t\t\tname: tableName,\n\t\t\t\tcolumns,\n\t\t\t\t...ifDefined(\"primaryKey\", primaryKey),\n\t\t\t\tforeignKeys,\n\t\t\t\tuniques,\n\t\t\t\tindexes\n\t\t\t};\n\t\t}\n\t\tconst dependencies = extensionsResult.rows.map((row) => ({ id: `postgres.extension.${row.extname}` }));\n\t\tconst storageTypes = await pgEnumControlHooks.introspectTypes?.({\n\t\t\tdriver,\n\t\t\tschemaName: schema\n\t\t}) ?? {};\n\t\treturn {\n\t\t\ttables,\n\t\t\tdependencies,\n\t\t\tannotations: { pg: {\n\t\t\t\tschema,\n\t\t\t\tversion: await this.getPostgresVersion(driver),\n\t\t\t\t...ifDefined(\"storageTypes\", Object.keys(storageTypes).length > 0 ? storageTypes : void 0)\n\t\t\t} }\n\t\t};\n\t}\n\t/**\n\t* Gets the Postgres version from the database.\n\t*/\n\tasync getPostgresVersion(driver) {\n\t\treturn ((await driver.query(\"SELECT version() AS version\", [])).rows[0]?.version ?? \"\").match(/PostgreSQL (\\d+\\.\\d+)/)?.[1] ?? \"unknown\";\n\t}\n};\n/**\n* Pre-computed lookup map for simple prefix-based type normalization.\n* Maps short Postgres type names to their canonical SQL names.\n* Using a Map for O(1) lookup instead of multiple startsWith checks.\n*/\nconst TYPE_PREFIX_MAP = new Map([\n\t[\"varchar\", \"character varying\"],\n\t[\"bpchar\", \"character\"],\n\t[\"varbit\", \"bit varying\"]\n]);\n/**\n* Normalizes a Postgres schema native type to its canonical form for comparison.\n*\n* Uses a pre-computed lookup map for simple prefix replacements (O(1))\n* and handles complex temporal type normalization separately.\n*/\nfunction normalizeSchemaNativeType(nativeType) {\n\tconst trimmed = nativeType.trim();\n\tfor (const [prefix, replacement] of TYPE_PREFIX_MAP) if (trimmed.startsWith(prefix)) return replacement + trimmed.slice(prefix.length);\n\tif (trimmed.includes(\" with time zone\")) {\n\t\tif (trimmed.startsWith(\"timestamp\")) return `timestamptz${trimmed.slice(9).replace(\" with time zone\", \"\")}`;\n\t\tif (trimmed.startsWith(\"time\")) return `timetz${trimmed.slice(4).replace(\" with time zone\", \"\")}`;\n\t}\n\tif (trimmed.includes(\" without time zone\")) return trimmed.replace(\" without time zone\", \"\");\n\treturn trimmed;\n}\nfunction normalizeFormattedType(formattedType, dataType, udtName) {\n\tif (formattedType === \"integer\") return \"int4\";\n\tif (formattedType === \"smallint\") return \"int2\";\n\tif (formattedType === \"bigint\") return \"int8\";\n\tif (formattedType === \"real\") return \"float4\";\n\tif (formattedType === \"double precision\") return \"float8\";\n\tif (formattedType === \"boolean\") return \"bool\";\n\tif (formattedType.startsWith(\"varchar\")) return formattedType.replace(\"varchar\", \"character varying\");\n\tif (formattedType.startsWith(\"bpchar\")) return formattedType.replace(\"bpchar\", \"character\");\n\tif (formattedType.startsWith(\"varbit\")) return formattedType.replace(\"varbit\", \"bit varying\");\n\tif (dataType === \"timestamp with time zone\" || udtName === \"timestamptz\") return formattedType.replace(\"timestamp\", \"timestamptz\").replace(\" with time zone\", \"\").trim();\n\tif (dataType === \"timestamp without time zone\" || udtName === \"timestamp\") return formattedType.replace(\" without time zone\", \"\").trim();\n\tif (dataType === \"time with time zone\" || udtName === \"timetz\") return formattedType.replace(\"time\", \"timetz\").replace(\" with time zone\", \"\").trim();\n\tif (dataType === \"time without time zone\" || udtName === \"time\") return formattedType.replace(\" without time zone\", \"\").trim();\n\tif (formattedType.startsWith(\"\\\"\") && formattedType.endsWith(\"\\\"\")) return formattedType.slice(1, -1);\n\treturn formattedType;\n}\nconst PG_REFERENTIAL_ACTION_MAP = {\n\t\"NO ACTION\": \"noAction\",\n\tRESTRICT: \"restrict\",\n\tCASCADE: \"cascade\",\n\t\"SET NULL\": \"setNull\",\n\t\"SET DEFAULT\": \"setDefault\"\n};\n/**\n* Maps a Postgres referential action rule to the canonical SqlReferentialAction.\n* Returns undefined for 'NO ACTION' (the database default) to keep the IR sparse.\n* Throws for unrecognized rules to prevent silent data loss.\n*/\nfunction mapReferentialAction(rule) {\n\tconst mapped = PG_REFERENTIAL_ACTION_MAP[rule];\n\tif (mapped === void 0) throw new Error(`Unknown PostgreSQL referential action rule: \"${rule}\". Expected one of: NO ACTION, RESTRICT, CASCADE, SET NULL, SET DEFAULT.`);\n\tif (mapped === \"noAction\") return void 0;\n\treturn mapped;\n}\n/**\n* Groups an array of objects by a specified key.\n* Returns a Map for O(1) lookup by group key.\n*/\nfunction groupBy(items, key) {\n\tconst map = /* @__PURE__ */ new Map();\n\tfor (const item of items) {\n\t\tconst groupKey = item[key];\n\t\tlet group = map.get(groupKey);\n\t\tif (!group) {\n\t\t\tgroup = [];\n\t\t\tmap.set(groupKey, group);\n\t\t}\n\t\tgroup.push(item);\n\t}\n\treturn map;\n}\n\n//#endregion\n//#region src/core/control-mutation-defaults.ts\nfunction invalidArgumentDiagnostic(input) {\n\treturn {\n\t\tok: false,\n\t\tdiagnostic: {\n\t\t\tcode: \"PSL_INVALID_DEFAULT_FUNCTION_ARGUMENT\",\n\t\t\tmessage: input.message,\n\t\t\tsourceId: input.context.sourceId,\n\t\t\tspan: input.span\n\t\t}\n\t};\n}\nfunction executionGenerator(id, params) {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"execution\",\n\t\t\tgenerated: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid,\n\t\t\t\t...params ? { params } : {}\n\t\t\t}\n\t\t}\n\t};\n}\nfunction expectNoArgs(input) {\n\tif (input.call.args.length === 0) return;\n\treturn invalidArgumentDiagnostic({\n\t\tcontext: input.context,\n\t\tspan: input.call.span,\n\t\tmessage: `Default function \"${input.call.name}\" does not accept arguments. Use ${input.usage}.`\n\t});\n}\nfunction parseIntegerArgument(raw) {\n\tconst trimmed = raw.trim();\n\tif (!/^-?\\d+$/.test(trimmed)) return;\n\tconst value = Number(trimmed);\n\tif (!Number.isInteger(value)) return;\n\treturn value;\n}\nfunction parseStringLiteral(raw) {\n\tconst match = raw.trim().match(/^(['\"])(.*)\\1$/s);\n\tif (!match) return;\n\treturn match[2] ?? \"\";\n}\nfunction lowerAutoincrement(input) {\n\tconst maybeNoArgs = expectNoArgs({\n\t\tcall: input.call,\n\t\tcontext: input.context,\n\t\tusage: \"`autoincrement()`\"\n\t});\n\tif (maybeNoArgs) return maybeNoArgs;\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: \"autoincrement()\"\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerNow(input) {\n\tconst maybeNoArgs = expectNoArgs({\n\t\tcall: input.call,\n\t\tcontext: input.context,\n\t\tusage: \"`now()`\"\n\t});\n\tif (maybeNoArgs) return maybeNoArgs;\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: \"now()\"\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerUuid(input) {\n\tif (input.call.args.length === 0) return executionGenerator(\"uuidv4\");\n\tif (input.call.args.length !== 1) return invalidArgumentDiagnostic({\n\t\tcontext: input.context,\n\t\tspan: input.call.span,\n\t\tmessage: \"Default function \\\"uuid\\\" accepts at most one version argument: `uuid()`, `uuid(4)`, or `uuid(7)`.\"\n\t});\n\tconst version = parseIntegerArgument(input.call.args[0]?.raw ?? \"\");\n\tif (version === 4) return executionGenerator(\"uuidv4\");\n\tif (version === 7) return executionGenerator(\"uuidv7\");\n\treturn invalidArgumentDiagnostic({\n\t\tcontext: input.context,\n\t\tspan: input.call.args[0]?.span ?? input.call.span,\n\t\tmessage: \"Default function \\\"uuid\\\" supports only `uuid()`, `uuid(4)`, or `uuid(7)` in SQL PSL provider v1.\"\n\t});\n}\nfunction lowerCuid(input) {\n\tif (input.call.args.length === 0) return {\n\t\tok: false,\n\t\tdiagnostic: {\n\t\t\tcode: \"PSL_UNKNOWN_DEFAULT_FUNCTION\",\n\t\t\tmessage: \"Default function \\\"cuid()\\\" is not supported in SQL PSL provider v1. Use `cuid(2)` instead.\",\n\t\t\tsourceId: input.context.sourceId,\n\t\t\tspan: input.call.span\n\t\t}\n\t};\n\tif (input.call.args.length !== 1) return invalidArgumentDiagnostic({\n\t\tcontext: input.context,\n\t\tspan: input.call.span,\n\t\tmessage: \"Default function \\\"cuid\\\" accepts exactly one version argument: `cuid(2)`.\"\n\t});\n\tif (parseIntegerArgument(input.call.args[0]?.raw ?? \"\") === 2) return executionGenerator(\"cuid2\");\n\treturn invalidArgumentDiagnostic({\n\t\tcontext: input.context,\n\t\tspan: input.call.args[0]?.span ?? input.call.span,\n\t\tmessage: \"Default function \\\"cuid\\\" supports only `cuid(2)` in SQL PSL provider v1.\"\n\t});\n}\nfunction lowerUlid(input) {\n\tconst maybeNoArgs = expectNoArgs({\n\t\tcall: input.call,\n\t\tcontext: input.context,\n\t\tusage: \"`ulid()`\"\n\t});\n\tif (maybeNoArgs) return maybeNoArgs;\n\treturn executionGenerator(\"ulid\");\n}\nfunction lowerNanoid(input) {\n\tif (input.call.args.length === 0) return executionGenerator(\"nanoid\");\n\tif (input.call.args.length !== 1) return invalidArgumentDiagnostic({\n\t\tcontext: input.context,\n\t\tspan: input.call.span,\n\t\tmessage: \"Default function \\\"nanoid\\\" accepts at most one size argument: `nanoid()` or `nanoid(<2-255>)`.\"\n\t});\n\tconst size = parseIntegerArgument(input.call.args[0]?.raw ?? \"\");\n\tif (size !== void 0 && size >= 2 && size <= 255) return executionGenerator(\"nanoid\", { size });\n\treturn invalidArgumentDiagnostic({\n\t\tcontext: input.context,\n\t\tspan: input.call.args[0]?.span ?? input.call.span,\n\t\tmessage: \"Default function \\\"nanoid\\\" size argument must be an integer between 2 and 255.\"\n\t});\n}\nfunction lowerDbgenerated(input) {\n\tif (input.call.args.length !== 1) return invalidArgumentDiagnostic({\n\t\tcontext: input.context,\n\t\tspan: input.call.span,\n\t\tmessage: \"Default function \\\"dbgenerated\\\" requires exactly one string argument: `dbgenerated(\\\"...\\\")`.\"\n\t});\n\tconst rawExpression = parseStringLiteral(input.call.args[0]?.raw ?? \"\");\n\tif (rawExpression === void 0) return invalidArgumentDiagnostic({\n\t\tcontext: input.context,\n\t\tspan: input.call.args[0]?.span ?? input.call.span,\n\t\tmessage: \"Default function \\\"dbgenerated\\\" argument must be a string literal.\"\n\t});\n\tif (rawExpression.trim().length === 0) return invalidArgumentDiagnostic({\n\t\tcontext: input.context,\n\t\tspan: input.call.args[0]?.span ?? input.call.span,\n\t\tmessage: \"Default function \\\"dbgenerated\\\" argument cannot be empty.\"\n\t});\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: rawExpression\n\t\t\t}\n\t\t}\n\t};\n}\nconst postgresDefaultFunctionRegistryEntries = [\n\t[\"autoincrement\", {\n\t\tlower: lowerAutoincrement,\n\t\tusageSignatures: [\"autoincrement()\"]\n\t}],\n\t[\"now\", {\n\t\tlower: lowerNow,\n\t\tusageSignatures: [\"now()\"]\n\t}],\n\t[\"uuid\", {\n\t\tlower: lowerUuid,\n\t\tusageSignatures: [\n\t\t\t\"uuid()\",\n\t\t\t\"uuid(4)\",\n\t\t\t\"uuid(7)\"\n\t\t]\n\t}],\n\t[\"cuid\", {\n\t\tlower: lowerCuid,\n\t\tusageSignatures: [\"cuid(2)\"]\n\t}],\n\t[\"ulid\", {\n\t\tlower: lowerUlid,\n\t\tusageSignatures: [\"ulid()\"]\n\t}],\n\t[\"nanoid\", {\n\t\tlower: lowerNanoid,\n\t\tusageSignatures: [\"nanoid()\", \"nanoid(<2-255>)\"]\n\t}],\n\t[\"dbgenerated\", {\n\t\tlower: lowerDbgenerated,\n\t\tusageSignatures: [\"dbgenerated(\\\"...\\\")\"]\n\t}]\n];\nconst postgresScalarTypeDescriptors = new Map([\n\t[\"String\", \"pg/text@1\"],\n\t[\"Boolean\", \"pg/bool@1\"],\n\t[\"Int\", \"pg/int4@1\"],\n\t[\"BigInt\", \"pg/int8@1\"],\n\t[\"Float\", \"pg/float8@1\"],\n\t[\"Decimal\", \"pg/numeric@1\"],\n\t[\"DateTime\", \"pg/timestamptz@1\"],\n\t[\"Json\", \"pg/jsonb@1\"],\n\t[\"Bytes\", \"pg/bytea@1\"]\n]);\nfunction createPostgresDefaultFunctionRegistry() {\n\treturn new Map(postgresDefaultFunctionRegistryEntries);\n}\nfunction createPostgresMutationDefaultGeneratorDescriptors() {\n\treturn builtinGeneratorRegistryMetadata.map(({ id, applicableCodecIds }) => ({\n\t\tid,\n\t\tapplicableCodecIds,\n\t\tresolveGeneratedColumnDescriptor: ({ generated }) => {\n\t\t\tif (generated.kind !== \"generator\" || generated.id !== id) return;\n\t\t\tconst descriptor = resolveBuiltinGeneratedColumnDescriptor({\n\t\t\t\tid,\n\t\t\t\t...generated.params ? { params: generated.params } : {}\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tcodecId: descriptor.type.codecId,\n\t\t\t\tnativeType: descriptor.type.nativeType,\n\t\t\t\t...descriptor.type.typeRef ? { typeRef: descriptor.type.typeRef } : {},\n\t\t\t\t...descriptor.typeParams ? { typeParams: descriptor.typeParams } : {}\n\t\t\t};\n\t\t}\n\t}));\n}\nfunction createPostgresScalarTypeDescriptors() {\n\treturn new Map(postgresScalarTypeDescriptors);\n}\n\n//#endregion\n//#region src/exports/control.ts\nconst postgresAdapterDescriptor = {\n\t...postgresAdapterDescriptorMeta,\n\tscalarTypeDescriptors: createPostgresScalarTypeDescriptors(),\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: createPostgresDefaultFunctionRegistry(),\n\t\tgeneratorDescriptors: createPostgresMutationDefaultGeneratorDescriptors()\n\t},\n\tcreate() {\n\t\treturn new PostgresControlAdapter();\n\t}\n};\nvar control_default = postgresAdapterDescriptor;\n\n//#endregion\nexport { SqlEscapeError, control_default as default, escapeLiteral, normalizeSchemaNativeType, parsePostgresDefault, qualifyName, quoteIdentifier };\n//# sourceMappingURL=control.mjs.map","import type { StorageColumn, StorageTypeInstance } from '@prisma-next/sql-contract/types';\n\nexport type ResolvedColumnTypeMetadata = Pick<\n StorageColumn,\n 'nativeType' | 'codecId' | 'typeParams'\n>;\n\nexport function resolveColumnTypeMetadata(\n column: StorageColumn,\n storageTypes: Record<string, StorageTypeInstance>,\n): ResolvedColumnTypeMetadata {\n if (!column.typeRef) {\n return column;\n }\n\n const referencedType = storageTypes[column.typeRef];\n if (!referencedType) {\n return column;\n }\n\n return {\n codecId: referencedType.codecId,\n nativeType: referencedType.nativeType,\n typeParams: referencedType.typeParams,\n };\n}\n","import { escapeLiteral, quoteIdentifier } from '@prisma-next/adapter-postgres/control';\nimport type { CodecControlHooks } from '@prisma-next/family-sql/control';\nimport type { StorageColumn, StorageTypeInstance } from '@prisma-next/sql-contract/types';\nimport { resolveColumnTypeMetadata } from './planner-type-resolution';\n\nexport function qualifyTableName(schema: string, table: string): string {\n return `${quoteIdentifier(schema)}.${quoteIdentifier(table)}`;\n}\n\nexport function toRegclassLiteral(schema: string, name: string): string {\n const regclass = `${quoteIdentifier(schema)}.${quoteIdentifier(name)}`;\n return `'${escapeLiteral(regclass)}'`;\n}\n\n/**\n * When `table` is omitted the check matches by name + schema across all tables.\n * Pass `table` to scope the check to a single table (prevents false matches on\n * identically-named constraints in different tables).\n */\nexport function constraintExistsCheck({\n constraintName,\n schema,\n table,\n exists = true,\n}: {\n constraintName: string;\n schema: string;\n table?: string;\n exists?: boolean;\n}): string {\n const existsClause = exists ? 'EXISTS' : 'NOT EXISTS';\n const tableFilter = table\n ? `AND c.conrelid = to_regclass(${toRegclassLiteral(schema, table)})`\n : '';\n return `SELECT ${existsClause} (\n SELECT 1 FROM pg_constraint c\n JOIN pg_namespace n ON c.connamespace = n.oid\n WHERE c.conname = '${escapeLiteral(constraintName)}'\n AND n.nspname = '${escapeLiteral(schema)}'\n ${tableFilter}\n)`;\n}\n\nexport function columnExistsCheck({\n schema,\n table,\n column,\n exists = true,\n}: {\n schema: string;\n table: string;\n column: string;\n exists?: boolean;\n}): string {\n const existsClause = exists ? '' : 'NOT ';\n return `SELECT ${existsClause}EXISTS (\n SELECT 1\n FROM information_schema.columns\n WHERE table_schema = '${escapeLiteral(schema)}'\n AND table_name = '${escapeLiteral(table)}'\n AND column_name = '${escapeLiteral(column)}'\n)`;\n}\n\nexport function columnNullabilityCheck({\n schema,\n table,\n column,\n nullable,\n}: {\n schema: string;\n table: string;\n column: string;\n nullable: boolean;\n}): string {\n const expected = nullable ? 'YES' : 'NO';\n return `SELECT EXISTS (\n SELECT 1\n FROM information_schema.columns\n WHERE table_schema = '${escapeLiteral(schema)}'\n AND table_name = '${escapeLiteral(table)}'\n AND column_name = '${escapeLiteral(column)}'\n AND is_nullable = '${expected}'\n)`;\n}\n\nexport function tableIsEmptyCheck(qualifiedTableName: string): string {\n return `SELECT NOT EXISTS (SELECT 1 FROM ${qualifiedTableName} LIMIT 1)`;\n}\n\nexport function columnHasNoDefaultCheck(opts: {\n schema: string;\n table: string;\n column: string;\n}): string {\n return `SELECT NOT EXISTS (\n SELECT 1\n FROM information_schema.columns\n WHERE table_schema = '${escapeLiteral(opts.schema)}'\n AND table_name = '${escapeLiteral(opts.table)}'\n AND column_name = '${escapeLiteral(opts.column)}'\n AND column_default IS NOT NULL\n)`;\n}\n\nconst FORMAT_TYPE_DISPLAY: ReadonlyMap<string, string> = new Map([\n ['int2', 'smallint'],\n ['int4', 'integer'],\n ['int8', 'bigint'],\n ['float4', 'real'],\n ['float8', 'double precision'],\n ['bool', 'boolean'],\n ['timestamp', 'timestamp without time zone'],\n ['timestamptz', 'timestamp with time zone'],\n ['time', 'time without time zone'],\n ['timetz', 'time with time zone'],\n]);\n\nconst UNQUOTED_POSTGRES_IDENTIFIER_PATTERN = /^[a-z_][a-z0-9_$]*$/;\n\nconst POSTGRES_RESERVED_IDENTIFIER_WORDS = new Set([\n 'all',\n 'analyse',\n 'analyze',\n 'and',\n 'any',\n 'array',\n 'as',\n 'asc',\n 'asymmetric',\n 'authorization',\n 'between',\n 'binary',\n 'both',\n 'case',\n 'cast',\n 'check',\n 'collate',\n 'column',\n 'constraint',\n 'create',\n 'current_catalog',\n 'current_date',\n 'current_role',\n 'current_time',\n 'current_timestamp',\n 'current_user',\n 'default',\n 'deferrable',\n 'desc',\n 'distinct',\n 'do',\n 'else',\n 'end',\n 'except',\n 'false',\n 'fetch',\n 'for',\n 'foreign',\n 'freeze',\n 'from',\n 'full',\n 'grant',\n 'group',\n 'having',\n 'ilike',\n 'in',\n 'initially',\n 'inner',\n 'intersect',\n 'into',\n 'is',\n 'isnull',\n 'join',\n 'lateral',\n 'leading',\n 'left',\n 'like',\n 'limit',\n 'localtime',\n 'localtimestamp',\n 'natural',\n 'not',\n 'notnull',\n 'null',\n 'offset',\n 'on',\n 'only',\n 'or',\n 'order',\n 'outer',\n 'overlaps',\n 'placing',\n 'primary',\n 'references',\n 'right',\n 'select',\n 'session_user',\n 'similar',\n 'some',\n 'symmetric',\n 'table',\n 'then',\n 'to',\n 'trailing',\n 'true',\n 'union',\n 'unique',\n 'user',\n 'using',\n 'variadic',\n 'verbose',\n 'when',\n 'where',\n 'window',\n 'with',\n]);\n\nfunction formatUserDefinedTypeName(identifier: string): string {\n if (\n UNQUOTED_POSTGRES_IDENTIFIER_PATTERN.test(identifier) &&\n !POSTGRES_RESERVED_IDENTIFIER_WORDS.has(identifier)\n ) {\n return identifier;\n }\n\n return quoteIdentifier(identifier);\n}\n\nexport function buildExpectedFormatType(\n column: StorageColumn,\n codecHooks: Map<string, CodecControlHooks>,\n storageTypes: Record<string, StorageTypeInstance> = {},\n): string {\n const resolved = resolveColumnTypeMetadata(column, storageTypes);\n\n if (resolved.typeParams && resolved.codecId) {\n const hooks = codecHooks.get(resolved.codecId);\n if (hooks?.expandNativeType) {\n return hooks.expandNativeType({\n nativeType: resolved.nativeType,\n codecId: resolved.codecId,\n typeParams: resolved.typeParams,\n });\n }\n }\n\n if (column.typeRef) {\n return formatUserDefinedTypeName(resolved.nativeType);\n }\n\n return FORMAT_TYPE_DISPLAY.get(resolved.nativeType) ?? resolved.nativeType;\n}\n\nexport function columnTypeCheck({\n schema,\n table,\n column,\n expectedType,\n}: {\n schema: string;\n table: string;\n column: string;\n expectedType: string;\n}): string {\n return `SELECT EXISTS (\n SELECT 1\n FROM pg_attribute a\n JOIN pg_class c ON c.oid = a.attrelid\n JOIN pg_namespace n ON n.oid = c.relnamespace\n WHERE n.nspname = '${escapeLiteral(schema)}'\n AND c.relname = '${escapeLiteral(table)}'\n AND a.attname = '${escapeLiteral(column)}'\n AND format_type(a.atttypid, a.atttypmod) = '${escapeLiteral(expectedType)}'\n AND NOT a.attisdropped\n)`;\n}\n\nexport function columnDefaultExistsCheck({\n schema,\n table,\n column,\n exists = true,\n}: {\n schema: string;\n table: string;\n column: string;\n exists?: boolean;\n}): string {\n const nullCheck = exists ? 'IS NOT NULL' : 'IS NULL';\n return `SELECT EXISTS (\n SELECT 1\n FROM information_schema.columns\n WHERE table_schema = '${escapeLiteral(schema)}'\n AND table_name = '${escapeLiteral(table)}'\n AND column_name = '${escapeLiteral(column)}'\n AND column_default ${nullCheck}\n)`;\n}\n\nexport function tableHasPrimaryKeyCheck(\n schema: string,\n table: string,\n exists: boolean,\n constraintName?: string,\n): string {\n const comparison = exists ? '' : 'NOT ';\n const constraintFilter = constraintName\n ? `AND c2.relname = '${escapeLiteral(constraintName)}'`\n : '';\n return `SELECT ${comparison}EXISTS (\n SELECT 1\n FROM pg_index i\n JOIN pg_class c ON c.oid = i.indrelid\n JOIN pg_namespace n ON n.oid = c.relnamespace\n LEFT JOIN pg_class c2 ON c2.oid = i.indexrelid\n WHERE n.nspname = '${escapeLiteral(schema)}'\n AND c.relname = '${escapeLiteral(table)}'\n AND i.indisprimary\n ${constraintFilter}\n)`;\n}\n","import { quoteIdentifier } from '@prisma-next/adapter-postgres/control';\nimport type { SqlMigrationPlanOperation } from '@prisma-next/family-sql/control';\nimport type { ReferentialAction } from '@prisma-next/sql-contract/types';\nimport { ifDefined } from '@prisma-next/utils/defined';\nimport type { OperationClass, PostgresPlanTargetDetails } from '../planner-target-details';\n\nexport type Op = SqlMigrationPlanOperation<PostgresPlanTargetDetails>;\n\n/**\n * Literal-args shape for a column definition consumed by `createTable` and\n * `addColumn`. Fully materialized: codec expansion and default rendering have\n * already happened in the wrapper.\n *\n * - `typeSql` is the column's DDL type string (e.g. `\"integer\"`, `\"SERIAL\"`,\n * `\"varchar(100)\"`), already produced by `buildColumnTypeSql` in the\n * call-factory wrapper.\n * - `defaultSql` is the full `DEFAULT …` clause (e.g. `\"DEFAULT 42\"`) or an\n * empty string when the column has no default, matching\n * `buildColumnDefaultSql`'s output.\n */\nexport interface ColumnSpec {\n readonly name: string;\n readonly typeSql: string;\n readonly defaultSql: string;\n readonly nullable: boolean;\n}\n\n/**\n * Literal-args shape for a foreign key definition. The referenced table is\n * assumed to live in the same schema as the constrained table.\n */\nexport interface ForeignKeySpec {\n readonly name: string;\n readonly columns: readonly string[];\n readonly references: {\n readonly table: string;\n readonly columns: readonly string[];\n };\n readonly onDelete?: ReferentialAction;\n readonly onUpdate?: ReferentialAction;\n}\n\nexport function step(description: string, sql: string) {\n return { description, sql };\n}\n\nexport function targetDetails(\n objectType: OperationClass,\n name: string,\n schema: string,\n table?: string,\n): { readonly id: 'postgres'; readonly details: PostgresPlanTargetDetails } {\n return {\n id: 'postgres',\n details: { schema, objectType, name, ...ifDefined('table', table) },\n };\n}\n\nexport function renderColumnDefinition(column: ColumnSpec): string {\n const parts = [\n quoteIdentifier(column.name),\n column.typeSql,\n column.defaultSql,\n column.nullable ? '' : 'NOT NULL',\n ].filter(Boolean);\n return parts.join(' ');\n}\n","import { quoteIdentifier } from '@prisma-next/adapter-postgres/control';\nimport {\n columnDefaultExistsCheck,\n columnExistsCheck,\n columnNullabilityCheck,\n columnTypeCheck,\n qualifyTableName,\n} from '../planner-sql-checks';\nimport { type ColumnSpec, type Op, step, targetDetails } from './shared';\n\nexport function addColumn(schemaName: string, tableName: string, column: ColumnSpec): Op {\n const qualified = qualifyTableName(schemaName, tableName);\n const parts = [\n `ALTER TABLE ${qualified}`,\n `ADD COLUMN ${quoteIdentifier(column.name)} ${column.typeSql}`,\n column.defaultSql,\n column.nullable ? '' : 'NOT NULL',\n ].filter(Boolean);\n const addSql = parts.join(' ');\n\n return {\n id: `column.${tableName}.${column.name}`,\n label: `Add column \"${column.name}\" to \"${tableName}\"`,\n operationClass: 'additive',\n target: targetDetails('column', column.name, schemaName, tableName),\n precheck: [\n step(\n `ensure column \"${column.name}\" is missing`,\n columnExistsCheck({\n schema: schemaName,\n table: tableName,\n column: column.name,\n exists: false,\n }),\n ),\n ],\n execute: [step(`add column \"${column.name}\"`, addSql)],\n postcheck: [\n step(\n `verify column \"${column.name}\" exists`,\n columnExistsCheck({ schema: schemaName, table: tableName, column: column.name }),\n ),\n ],\n };\n}\n\nexport function dropColumn(schemaName: string, tableName: string, columnName: string): Op {\n const qualified = qualifyTableName(schemaName, tableName);\n return {\n id: `dropColumn.${tableName}.${columnName}`,\n label: `Drop column \"${columnName}\" from \"${tableName}\"`,\n operationClass: 'destructive',\n target: targetDetails('column', columnName, schemaName, tableName),\n precheck: [\n step(\n `ensure column \"${columnName}\" exists`,\n columnExistsCheck({ schema: schemaName, table: tableName, column: columnName }),\n ),\n ],\n execute: [\n step(\n `drop column \"${columnName}\"`,\n `ALTER TABLE ${qualified} DROP COLUMN ${quoteIdentifier(columnName)}`,\n ),\n ],\n postcheck: [\n step(\n `verify column \"${columnName}\" does not exist`,\n columnExistsCheck({\n schema: schemaName,\n table: tableName,\n column: columnName,\n exists: false,\n }),\n ),\n ],\n };\n}\n\n/**\n * `qualifiedTargetType` is the new column type as it appears in the\n * `ALTER COLUMN TYPE` clause (schema-qualified for user-defined types, raw\n * native name for built-ins). `formatTypeExpected` is the unqualified\n * `format_type` form used in the postcheck. `rawTargetTypeForLabel` is the\n * string appearing in the human-readable label (typically `toType` when\n * explicit, else the column's native type).\n */\nexport function alterColumnType(\n schemaName: string,\n tableName: string,\n columnName: string,\n options: {\n readonly qualifiedTargetType: string;\n readonly formatTypeExpected: string;\n readonly rawTargetTypeForLabel: string;\n readonly using?: string;\n },\n): Op {\n const qualified = qualifyTableName(schemaName, tableName);\n const usingClause = options.using\n ? ` USING ${options.using}`\n : ` USING ${quoteIdentifier(columnName)}::${options.qualifiedTargetType}`;\n return {\n id: `alterType.${tableName}.${columnName}`,\n label: `Alter type of \"${tableName}\".\"${columnName}\" to ${options.rawTargetTypeForLabel}`,\n operationClass: 'destructive',\n target: targetDetails('column', columnName, schemaName, tableName),\n precheck: [\n step(\n `ensure column \"${columnName}\" exists`,\n columnExistsCheck({ schema: schemaName, table: tableName, column: columnName }),\n ),\n ],\n execute: [\n step(\n `alter type of \"${columnName}\"`,\n `ALTER TABLE ${qualified} ALTER COLUMN ${quoteIdentifier(columnName)} TYPE ${options.qualifiedTargetType}${usingClause}`,\n ),\n ],\n postcheck: [\n step(\n `verify column \"${columnName}\" has type \"${options.formatTypeExpected}\"`,\n columnTypeCheck({\n schema: schemaName,\n table: tableName,\n column: columnName,\n expectedType: options.formatTypeExpected,\n }),\n ),\n ],\n meta: { warning: 'TABLE_REWRITE' },\n };\n}\n\nexport function setNotNull(schemaName: string, tableName: string, columnName: string): Op {\n const qualified = qualifyTableName(schemaName, tableName);\n return {\n id: `alterNullability.setNotNull.${tableName}.${columnName}`,\n label: `Set NOT NULL on \"${tableName}\".\"${columnName}\"`,\n operationClass: 'destructive',\n target: targetDetails('column', columnName, schemaName, tableName),\n precheck: [\n step(\n `ensure column \"${columnName}\" exists`,\n columnExistsCheck({ schema: schemaName, table: tableName, column: columnName }),\n ),\n step(\n `ensure no NULL values in \"${columnName}\"`,\n `SELECT NOT EXISTS (SELECT 1 FROM ${qualified} WHERE ${quoteIdentifier(columnName)} IS NULL)`,\n ),\n ],\n execute: [\n step(\n `set NOT NULL on \"${columnName}\"`,\n `ALTER TABLE ${qualified} ALTER COLUMN ${quoteIdentifier(columnName)} SET NOT NULL`,\n ),\n ],\n postcheck: [\n step(\n `verify column \"${columnName}\" is NOT NULL`,\n columnNullabilityCheck({\n schema: schemaName,\n table: tableName,\n column: columnName,\n nullable: false,\n }),\n ),\n ],\n };\n}\n\nexport function dropNotNull(schemaName: string, tableName: string, columnName: string): Op {\n const qualified = qualifyTableName(schemaName, tableName);\n return {\n id: `alterNullability.dropNotNull.${tableName}.${columnName}`,\n label: `Drop NOT NULL on \"${tableName}\".\"${columnName}\"`,\n operationClass: 'widening',\n target: targetDetails('column', columnName, schemaName, tableName),\n precheck: [\n step(\n `ensure column \"${columnName}\" exists`,\n columnExistsCheck({ schema: schemaName, table: tableName, column: columnName }),\n ),\n ],\n execute: [\n step(\n `drop NOT NULL on \"${columnName}\"`,\n `ALTER TABLE ${qualified} ALTER COLUMN ${quoteIdentifier(columnName)} DROP NOT NULL`,\n ),\n ],\n postcheck: [\n step(\n `verify column \"${columnName}\" is nullable`,\n columnNullabilityCheck({\n schema: schemaName,\n table: tableName,\n column: columnName,\n nullable: true,\n }),\n ),\n ],\n };\n}\n\n/**\n * `defaultSql` is the full `DEFAULT …` clause as produced by\n * `buildColumnDefaultSql` — e.g. `\"DEFAULT 42\"`,\n * `\"DEFAULT (CURRENT_TIMESTAMP)\"`, or `\"DEFAULT nextval('seq'::regclass)\"`.\n *\n * `operationClass` defaults to `'additive'` (setting a default on a column\n * that currently has none). The reconciliation planner passes `'widening'`\n * when the column already has a different default — policy enforcement\n * treats that as a widening change rather than an additive one.\n */\nexport function setDefault(\n schemaName: string,\n tableName: string,\n columnName: string,\n defaultSql: string,\n operationClass: 'additive' | 'widening' = 'additive',\n): Op {\n const qualified = qualifyTableName(schemaName, tableName);\n return {\n id: `setDefault.${tableName}.${columnName}`,\n label: `Set default on \"${tableName}\".\"${columnName}\"`,\n operationClass,\n target: targetDetails('column', columnName, schemaName, tableName),\n precheck: [\n step(\n `ensure column \"${columnName}\" exists`,\n columnExistsCheck({ schema: schemaName, table: tableName, column: columnName }),\n ),\n ],\n execute: [\n step(\n `set default on \"${columnName}\"`,\n `ALTER TABLE ${qualified} ALTER COLUMN ${quoteIdentifier(columnName)} SET ${defaultSql}`,\n ),\n ],\n postcheck: [\n step(\n `verify column \"${columnName}\" has a default`,\n columnDefaultExistsCheck({\n schema: schemaName,\n table: tableName,\n column: columnName,\n exists: true,\n }),\n ),\n ],\n };\n}\n\nexport function dropDefault(schemaName: string, tableName: string, columnName: string): Op {\n const qualified = qualifyTableName(schemaName, tableName);\n return {\n id: `dropDefault.${tableName}.${columnName}`,\n label: `Drop default on \"${tableName}\".\"${columnName}\"`,\n operationClass: 'destructive',\n target: targetDetails('column', columnName, schemaName, tableName),\n precheck: [\n step(\n `ensure column \"${columnName}\" exists`,\n columnExistsCheck({ schema: schemaName, table: tableName, column: columnName }),\n ),\n ],\n execute: [\n step(\n `drop default on \"${columnName}\"`,\n `ALTER TABLE ${qualified} ALTER COLUMN ${quoteIdentifier(columnName)} DROP DEFAULT`,\n ),\n ],\n postcheck: [\n step(\n `verify column \"${columnName}\" has no default`,\n columnDefaultExistsCheck({\n schema: schemaName,\n table: tableName,\n column: columnName,\n exists: false,\n }),\n ),\n ],\n };\n}\n","import { quoteIdentifier } from '@prisma-next/adapter-postgres/control';\nimport type { ReferentialAction } from '@prisma-next/sql-contract/types';\nimport { constraintExistsCheck, qualifyTableName } from '../planner-sql-checks';\nimport { type ForeignKeySpec, type Op, step, targetDetails } from './shared';\n\nconst REFERENTIAL_ACTION_SQL: Record<ReferentialAction, string> = {\n noAction: 'NO ACTION',\n restrict: 'RESTRICT',\n cascade: 'CASCADE',\n setNull: 'SET NULL',\n setDefault: 'SET DEFAULT',\n};\n\nfunction renderForeignKeySql(schemaName: string, tableName: string, fk: ForeignKeySpec): string {\n let sql = `ALTER TABLE ${qualifyTableName(schemaName, tableName)}\nADD CONSTRAINT ${quoteIdentifier(fk.name)}\nFOREIGN KEY (${fk.columns.map(quoteIdentifier).join(', ')})\nREFERENCES ${qualifyTableName(schemaName, fk.references.table)} (${fk.references.columns\n .map(quoteIdentifier)\n .join(', ')})`;\n\n if (fk.onDelete !== undefined) {\n const action = REFERENTIAL_ACTION_SQL[fk.onDelete];\n if (!action) {\n throw new Error(`Unknown referential action for onDelete: ${String(fk.onDelete)}`);\n }\n sql += `\\nON DELETE ${action}`;\n }\n if (fk.onUpdate !== undefined) {\n const action = REFERENTIAL_ACTION_SQL[fk.onUpdate];\n if (!action) {\n throw new Error(`Unknown referential action for onUpdate: ${String(fk.onUpdate)}`);\n }\n sql += `\\nON UPDATE ${action}`;\n }\n return sql;\n}\n\nexport function addPrimaryKey(\n schemaName: string,\n tableName: string,\n constraintName: string,\n columns: readonly string[],\n): Op {\n const qualified = qualifyTableName(schemaName, tableName);\n const columnList = columns.map(quoteIdentifier).join(', ');\n return {\n id: `primaryKey.${tableName}.${constraintName}`,\n label: `Add primary key on \"${tableName}\"`,\n operationClass: 'additive',\n target: targetDetails('primaryKey', constraintName, schemaName, tableName),\n precheck: [\n step(\n `ensure primary key \"${constraintName}\" does not exist`,\n constraintExistsCheck({\n constraintName,\n schema: schemaName,\n table: tableName,\n exists: false,\n }),\n ),\n ],\n execute: [\n step(\n `add primary key \"${constraintName}\"`,\n `ALTER TABLE ${qualified} ADD CONSTRAINT ${quoteIdentifier(constraintName)} PRIMARY KEY (${columnList})`,\n ),\n ],\n postcheck: [\n step(\n `verify primary key \"${constraintName}\" exists`,\n constraintExistsCheck({ constraintName, schema: schemaName, table: tableName }),\n ),\n ],\n };\n}\n\nexport function addUnique(\n schemaName: string,\n tableName: string,\n constraintName: string,\n columns: readonly string[],\n): Op {\n const qualified = qualifyTableName(schemaName, tableName);\n const columnList = columns.map(quoteIdentifier).join(', ');\n return {\n id: `unique.${tableName}.${constraintName}`,\n label: `Add unique constraint on \"${tableName}\" (${columns.join(', ')})`,\n operationClass: 'additive',\n target: targetDetails('unique', constraintName, schemaName, tableName),\n precheck: [\n step(\n `ensure constraint \"${constraintName}\" does not exist`,\n constraintExistsCheck({\n constraintName,\n schema: schemaName,\n table: tableName,\n exists: false,\n }),\n ),\n ],\n execute: [\n step(\n `add unique constraint \"${constraintName}\"`,\n `ALTER TABLE ${qualified} ADD CONSTRAINT ${quoteIdentifier(constraintName)} UNIQUE (${columnList})`,\n ),\n ],\n postcheck: [\n step(\n `verify constraint \"${constraintName}\" exists`,\n constraintExistsCheck({ constraintName, schema: schemaName, table: tableName }),\n ),\n ],\n };\n}\n\nexport function addForeignKey(schemaName: string, tableName: string, fk: ForeignKeySpec): Op {\n return {\n id: `foreignKey.${tableName}.${fk.name}`,\n label: `Add foreign key \"${fk.name}\" on \"${tableName}\"`,\n operationClass: 'additive',\n target: targetDetails('foreignKey', fk.name, schemaName, tableName),\n precheck: [\n step(\n `ensure FK \"${fk.name}\" does not exist`,\n constraintExistsCheck({\n constraintName: fk.name,\n schema: schemaName,\n table: tableName,\n exists: false,\n }),\n ),\n ],\n execute: [step(`add FK \"${fk.name}\"`, renderForeignKeySql(schemaName, tableName, fk))],\n postcheck: [\n step(\n `verify FK \"${fk.name}\" exists`,\n constraintExistsCheck({\n constraintName: fk.name,\n schema: schemaName,\n table: tableName,\n }),\n ),\n ],\n };\n}\n\n/**\n * `kind` feeds the operation's `target.details.objectType`. Descriptor-flow\n * does not carry kind information in its drop-constraint descriptor, so the\n * default is `'unique'`. The reconciliation planner passes the correct kind\n * (`'foreignKey'`, `'primaryKey'`, or `'unique'`) based on the `SchemaIssue`\n * that produced the drop.\n */\nexport function dropConstraint(\n schemaName: string,\n tableName: string,\n constraintName: string,\n kind: 'foreignKey' | 'unique' | 'primaryKey' = 'unique',\n): Op {\n const qualified = qualifyTableName(schemaName, tableName);\n return {\n id: `dropConstraint.${tableName}.${constraintName}`,\n label: `Drop constraint \"${constraintName}\" on \"${tableName}\"`,\n operationClass: 'destructive',\n target: targetDetails(kind, constraintName, schemaName, tableName),\n precheck: [\n step(\n `ensure constraint \"${constraintName}\" exists`,\n constraintExistsCheck({ constraintName, schema: schemaName, table: tableName }),\n ),\n ],\n execute: [\n step(\n `drop constraint \"${constraintName}\"`,\n `ALTER TABLE ${qualified} DROP CONSTRAINT ${quoteIdentifier(constraintName)}`,\n ),\n ],\n postcheck: [\n step(\n `verify constraint \"${constraintName}\" does not exist`,\n constraintExistsCheck({\n constraintName,\n schema: schemaName,\n table: tableName,\n exists: false,\n }),\n ),\n ],\n };\n}\n","import { quoteIdentifier } from '@prisma-next/adapter-postgres/control';\nimport { type Op, step } from './shared';\n\nexport function createExtension(extensionName: string): Op {\n return {\n id: `extension.${extensionName}`,\n label: `Create extension \"${extensionName}\"`,\n operationClass: 'additive',\n target: { id: 'postgres' },\n precheck: [],\n execute: [\n step(\n `Create extension \"${extensionName}\"`,\n `CREATE EXTENSION IF NOT EXISTS ${quoteIdentifier(extensionName)}`,\n ),\n ],\n postcheck: [],\n };\n}\n\nexport function createSchema(schemaName: string): Op {\n return {\n id: `schema.${schemaName}`,\n label: `Create schema \"${schemaName}\"`,\n operationClass: 'additive',\n target: { id: 'postgres' },\n precheck: [],\n execute: [\n step(\n `Create schema \"${schemaName}\"`,\n `CREATE SCHEMA IF NOT EXISTS ${quoteIdentifier(schemaName)}`,\n ),\n ],\n postcheck: [],\n };\n}\n","import { escapeLiteral, qualifyName, quoteIdentifier } from '@prisma-next/adapter-postgres/control';\nimport { type Op, step, targetDetails } from './shared';\n\nfunction enumTypeExistsCheck(schemaName: string, nativeType: string, exists = true): string {\n const clause = exists ? 'EXISTS' : 'NOT EXISTS';\n return `SELECT ${clause} (\n SELECT 1\n FROM pg_type t\n JOIN pg_namespace n ON t.typnamespace = n.oid\n WHERE n.nspname = '${escapeLiteral(schemaName)}'\n AND t.typname = '${escapeLiteral(nativeType)}'\n)`;\n}\n\nexport function createEnumType(\n schemaName: string,\n typeName: string,\n values: readonly string[],\n): Op {\n const qualifiedType = qualifyName(schemaName, typeName);\n const literalValues = values.map((v) => `'${escapeLiteral(v)}'`).join(', ');\n return {\n id: `type.${typeName}`,\n label: `Create enum type \"${typeName}\"`,\n operationClass: 'additive',\n target: targetDetails('type', typeName, schemaName),\n precheck: [\n step(\n `ensure type \"${typeName}\" does not exist`,\n enumTypeExistsCheck(schemaName, typeName, false),\n ),\n ],\n execute: [\n step(\n `create enum type \"${typeName}\"`,\n `CREATE TYPE ${qualifiedType} AS ENUM (${literalValues})`,\n ),\n ],\n postcheck: [\n step(`verify type \"${typeName}\" exists`, enumTypeExistsCheck(schemaName, typeName)),\n ],\n };\n}\n\n/**\n * `typeName` is the contract-facing type name (used for id/label).\n * `nativeType` is the Postgres type name to mutate (may differ for external types).\n */\nexport function addEnumValues(\n schemaName: string,\n typeName: string,\n nativeType: string,\n values: readonly string[],\n): Op {\n const qualifiedType = qualifyName(schemaName, nativeType);\n return {\n id: `type.${typeName}.addValues`,\n label: `Add values to enum type \"${typeName}\": ${values.join(', ')}`,\n operationClass: 'additive',\n target: targetDetails('type', typeName, schemaName),\n precheck: [\n step(`ensure type \"${nativeType}\" exists`, enumTypeExistsCheck(schemaName, nativeType)),\n ],\n execute: values.map((value) =>\n step(\n `add value '${value}' to enum \"${nativeType}\"`,\n `ALTER TYPE ${qualifiedType} ADD VALUE '${escapeLiteral(value)}'`,\n ),\n ),\n postcheck: [\n step(`verify type \"${nativeType}\" exists`, enumTypeExistsCheck(schemaName, nativeType)),\n ],\n };\n}\n\nexport function dropEnumType(schemaName: string, typeName: string): Op {\n const qualified = qualifyName(schemaName, typeName);\n return {\n id: `type.${typeName}.drop`,\n label: `Drop enum type \"${typeName}\"`,\n operationClass: 'destructive',\n target: targetDetails('type', typeName, schemaName),\n precheck: [step(`ensure type \"${typeName}\" exists`, enumTypeExistsCheck(schemaName, typeName))],\n execute: [step(`drop enum type \"${typeName}\"`, `DROP TYPE ${qualified}`)],\n postcheck: [\n step(`verify type \"${typeName}\" removed`, enumTypeExistsCheck(schemaName, typeName, false)),\n ],\n };\n}\n\nexport function renameType(schemaName: string, fromName: string, toName: string): Op {\n const qualifiedFrom = qualifyName(schemaName, fromName);\n return {\n id: `type.${fromName}.rename`,\n label: `Rename type \"${fromName}\" to \"${toName}\"`,\n operationClass: 'destructive',\n target: targetDetails('type', fromName, schemaName),\n precheck: [\n step(`ensure type \"${fromName}\" exists`, enumTypeExistsCheck(schemaName, fromName)),\n step(\n `ensure type \"${toName}\" does not already exist`,\n enumTypeExistsCheck(schemaName, toName, false),\n ),\n ],\n execute: [\n step(\n `rename type \"${fromName}\" to \"${toName}\"`,\n `ALTER TYPE ${qualifiedFrom} RENAME TO ${quoteIdentifier(toName)}`,\n ),\n ],\n postcheck: [step(`verify type \"${toName}\" exists`, enumTypeExistsCheck(schemaName, toName))],\n };\n}\n","import { quoteIdentifier } from '@prisma-next/adapter-postgres/control';\nimport { qualifyTableName, toRegclassLiteral } from '../planner-sql-checks';\nimport { type Op, step, targetDetails } from './shared';\n\nexport function createIndex(\n schemaName: string,\n tableName: string,\n indexName: string,\n columns: readonly string[],\n): Op {\n const qualified = qualifyTableName(schemaName, tableName);\n const columnList = columns.map(quoteIdentifier).join(', ');\n return {\n id: `index.${tableName}.${indexName}`,\n label: `Create index \"${indexName}\" on \"${tableName}\"`,\n operationClass: 'additive',\n target: targetDetails('index', indexName, schemaName, tableName),\n precheck: [\n step(\n `ensure index \"${indexName}\" does not exist`,\n `SELECT to_regclass(${toRegclassLiteral(schemaName, indexName)}) IS NULL`,\n ),\n ],\n execute: [\n step(\n `create index \"${indexName}\"`,\n `CREATE INDEX ${quoteIdentifier(indexName)} ON ${qualified} (${columnList})`,\n ),\n ],\n postcheck: [\n step(\n `verify index \"${indexName}\" exists`,\n `SELECT to_regclass(${toRegclassLiteral(schemaName, indexName)}) IS NOT NULL`,\n ),\n ],\n };\n}\n\nexport function dropIndex(schemaName: string, tableName: string, indexName: string): Op {\n return {\n id: `dropIndex.${tableName}.${indexName}`,\n label: `Drop index \"${indexName}\"`,\n operationClass: 'destructive',\n target: targetDetails('index', indexName, schemaName, tableName),\n precheck: [\n step(\n `ensure index \"${indexName}\" exists`,\n `SELECT to_regclass(${toRegclassLiteral(schemaName, indexName)}) IS NOT NULL`,\n ),\n ],\n execute: [\n step(`drop index \"${indexName}\"`, `DROP INDEX ${qualifyTableName(schemaName, indexName)}`),\n ],\n postcheck: [\n step(\n `verify index \"${indexName}\" does not exist`,\n `SELECT to_regclass(${toRegclassLiteral(schemaName, indexName)}) IS NULL`,\n ),\n ],\n };\n}\n","import { quoteIdentifier } from '@prisma-next/adapter-postgres/control';\nimport { qualifyTableName, toRegclassLiteral } from '../planner-sql-checks';\nimport { type ColumnSpec, type Op, renderColumnDefinition, step, targetDetails } from './shared';\n\nexport function createTable(\n schemaName: string,\n tableName: string,\n columns: ReadonlyArray<ColumnSpec>,\n primaryKey?: { readonly columns: readonly string[] },\n): Op {\n const qualified = qualifyTableName(schemaName, tableName);\n const columnDefs = columns.map(renderColumnDefinition);\n const constraintDefs: string[] = [];\n if (primaryKey) {\n constraintDefs.push(`PRIMARY KEY (${primaryKey.columns.map(quoteIdentifier).join(', ')})`);\n }\n const allDefs = [...columnDefs, ...constraintDefs];\n const createSql = `CREATE TABLE ${qualified} (\\n ${allDefs.join(',\\n ')}\\n)`;\n\n return {\n id: `table.${tableName}`,\n label: `Create table \"${tableName}\"`,\n summary: `Creates table \"${tableName}\"`,\n operationClass: 'additive',\n target: targetDetails('table', tableName, schemaName),\n precheck: [\n step(\n `ensure table \"${tableName}\" does not exist`,\n `SELECT to_regclass(${toRegclassLiteral(schemaName, tableName)}) IS NULL`,\n ),\n ],\n execute: [step(`create table \"${tableName}\"`, createSql)],\n postcheck: [\n step(\n `verify table \"${tableName}\" exists`,\n `SELECT to_regclass(${toRegclassLiteral(schemaName, tableName)}) IS NOT NULL`,\n ),\n ],\n };\n}\n\nexport function dropTable(schemaName: string, tableName: string): Op {\n const qualified = qualifyTableName(schemaName, tableName);\n return {\n id: `dropTable.${tableName}`,\n label: `Drop table \"${tableName}\"`,\n operationClass: 'destructive',\n target: targetDetails('table', tableName, schemaName),\n precheck: [\n step(\n `ensure table \"${tableName}\" exists`,\n `SELECT to_regclass(${toRegclassLiteral(schemaName, tableName)}) IS NOT NULL`,\n ),\n ],\n execute: [step(`drop table \"${tableName}\"`, `DROP TABLE ${qualified}`)],\n postcheck: [\n step(\n `verify table \"${tableName}\" does not exist`,\n `SELECT to_regclass(${toRegclassLiteral(schemaName, tableName)}) IS NULL`,\n ),\n ],\n };\n}\n","import { Migration as SqlMigration } from '@prisma-next/family-sql/migration';\nimport type { PostgresPlanTargetDetails } from './planner-target-details';\n\n/**\n * Target-owned base class for Postgres migrations.\n *\n * Fixes the `SqlMigration` generic to `PostgresPlanTargetDetails` and the\n * abstract `targetId` to the Postgres target-id string literal, so both\n * user-authored migrations and renderer-generated scaffolds (the output of\n * `renderCallsToTypeScript`) can extend `PostgresMigration` directly without\n * redeclaring target-local identity.\n *\n * Mirrors `MongoMigration` in `@prisma-next/family-mongo`: the renderer\n * emits `extends Migration` against a target-specific re-export of this\n * class from `@prisma-next/target-postgres/migration`, keeping the\n * authoring surface target-scoped rather than family-scoped.\n */\nexport abstract class PostgresMigration extends SqlMigration<PostgresPlanTargetDetails> {\n readonly targetId = 'postgres' as const;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAWA,IAAI,iBAAiB,cAAc,MAAM;CACxC,YAAY,SAAS,OAAO,MAAM;AACjC,QAAM,QAAQ;AACd,OAAK,QAAQ;AACb,OAAK,OAAO;AACZ,OAAK,OAAO;;;;;;AAMd,MAAMA,0BAAwB;;;;;;;;;;;AAW9B,SAAS,gBAAgB,YAAY;AACpC,KAAI,WAAW,WAAW,EAAG,OAAM,IAAI,eAAe,8BAA8B,YAAY,aAAa;AAC7G,KAAI,WAAW,SAAS,KAAK,CAAE,OAAM,IAAI,eAAe,wCAAwC,WAAW,QAAQ,OAAO,MAAM,EAAE,aAAa;AAC/I,KAAI,WAAW,SAASA,wBAAuB,SAAQ,KAAK,eAAe,WAAW,MAAM,GAAG,GAAG,CAAC,4BAA4BA,wBAAsB,wCAAwC;AAC7L,QAAO,IAAI,WAAW,QAAQ,MAAM,OAAO,CAAC;;;;;;;;;;;;;AAa7C,SAAS,cAAc,OAAO;AAC7B,KAAI,MAAM,SAAS,KAAK,CAAE,OAAM,IAAI,eAAe,2CAA2C,MAAM,QAAQ,OAAO,MAAM,EAAE,UAAU;AACrI,QAAO,MAAM,QAAQ,MAAM,K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mBAAmB;CAC9B,CAAC,QAAQ,UAAU;CACnB,CAAC,aAAa,8BAA8B;CAC5C,CAAC,eAAe,2BAA2B;CAC3C,CAAC,QAAQ,yBAAyB;CAClC,CAAC,UAAU,sBAAsB;CAClC,CAAC;AAEF,MAAM,uCAAuC;AAE7C,MAAM,qCAAqC,IAAI,IAAI;CACjD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,SAAS,0BAA0B,YAA4B;AAC7D,KACE,qCAAqC,KAAK,WAAW,IACrD,CAAC,mCAAmC,IAAI,WAAW,CAEnD,QAAO;AAGT,QAAO,gBAAgB,WAAW;;AAGpC,SAAgB,wBACd,QACA,YACA,eAAoD,EAAE,EAC9C;CACR,MAAM,WAAW,0BAA0B,QAAQ,aAAa;AAEhE,KAAI,SAAS,cAAc,SAAS,SAAS;EAC3C,MAAM,QAAQ,WAAW,IAAI,SAAS,QAAQ;AAC9C,MAAI,OAAO,iBACT,QAAO,MAAM,iBAAiB;GAC5B,YAAY,SAAS;GACrB,SAAS,SAAS;GAClB,YAAY,SAAS;GACtB,CAAC;;AAIN,KAAI,OAAO,QACT,QAAO,0BAA0B,SAAS,WAAW;AAGvD,QAAO,oBAAoB,IAAI,SAAS,WAAW,IAAI,SAAS;;AAGlE,SAAgB,gBAAgB,EAC9B,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