@prisma/orm-target-postgres 8.0.0-rc.11-dev.32 → 8.0.0-rc.11-dev.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/{adapter-bTD1EPrl-BOp2y3Vk.mjs → adapter-bTD1EPrl-2TWKoOVx.mjs} +2 -2
  2. package/dist/{adapter-bTD1EPrl-BOp2y3Vk.mjs.map → adapter-bTD1EPrl-2TWKoOVx.mjs.map} +1 -1
  3. package/dist/adapter.mjs +2 -2
  4. package/dist/adapter__adapter.mjs +1 -1
  5. package/dist/adapter__control.mjs +2 -2
  6. package/dist/adapter__runtime.mjs +3 -3
  7. package/dist/{authoring-DhCDnK1T-CGirVrrH.mjs → authoring-hMsx7htU-MzchK-oB.mjs} +3 -3
  8. package/dist/{authoring-DhCDnK1T-CGirVrrH.mjs.map → authoring-hMsx7htU-MzchK-oB.mjs.map} +1 -1
  9. package/dist/{contract-free-DcfADfM5.mjs → contract-free-CmBUYWYN.mjs} +3 -3
  10. package/dist/{contract-free-DcfADfM5.mjs.map → contract-free-CmBUYWYN.mjs.map} +1 -1
  11. package/dist/{control-BIGO0LQ1.mjs → control-DUGbVzYt.mjs} +8 -8
  12. package/dist/control-DUGbVzYt.mjs.map +1 -0
  13. package/dist/{control-adapter-Bdz-Xa1p-97fNF5gu.mjs → control-adapter-Bdz-Xa1p-DvSr3dSd.mjs} +2 -2
  14. package/dist/{control-adapter-Bdz-Xa1p-97fNF5gu.mjs.map → control-adapter-Bdz-Xa1p-DvSr3dSd.mjs.map} +1 -1
  15. package/dist/{control-policy-CkLZsw31-DjVVWnnz.mjs → control-policy-Bt4h9XRP-D286Iyv0.mjs} +13 -13
  16. package/dist/control-policy-Bt4h9XRP-D286Iyv0.mjs.map +1 -0
  17. package/dist/{data-transform-ChZzy2dP-CxVCat_8.mjs → data-transform-Bo32KRbq-BLn1_UG-.mjs} +3 -3
  18. package/dist/{data-transform-ChZzy2dP-CxVCat_8.mjs.map → data-transform-Bo32KRbq-BLn1_UG-.mjs.map} +1 -1
  19. package/dist/{ddl-CaKDvAty-sHOb0D92.mjs → ddl-DxYRJ8hY-mFzFol6l.mjs} +3 -3
  20. package/dist/{ddl-CaKDvAty-sHOb0D92.mjs.map → ddl-DxYRJ8hY-mFzFol6l.mjs.map} +1 -1
  21. package/dist/{descriptor-meta-CQMRNeLX-CF4MvmN_.mjs → descriptor-meta-D9xFYKRF-Dl74gakf.mjs} +4 -4
  22. package/dist/{descriptor-meta-CQMRNeLX-CF4MvmN_.mjs.map → descriptor-meta-D9xFYKRF-Dl74gakf.mjs.map} +1 -1
  23. package/dist/{diff-database-schema-c9IWEO2V-DCnp7F4-.mjs → diff-database-schema-BAiMsL_e-CTXBlIlV.mjs} +5 -5
  24. package/dist/{diff-database-schema-c9IWEO2V-DCnp7F4-.mjs.map → diff-database-schema-BAiMsL_e-CTXBlIlV.mjs.map} +1 -1
  25. package/dist/migration-PTHAY9Cv.mjs.map +1 -1
  26. package/dist/{op-factory-call-Bp6F2UEs-Bze_DuAk.mjs → op-factory-call-BAtE9hKE-xuF-YyXB.mjs} +4 -4
  27. package/dist/{op-factory-call-Bp6F2UEs-Bze_DuAk.mjs.map → op-factory-call-BAtE9hKE-xuF-YyXB.mjs.map} +1 -1
  28. package/dist/{planner-D9WzYlHl-CS_7pV8A.mjs → planner-CeItKM-b-DiTSmKNl.mjs} +9 -9
  29. package/dist/planner-CeItKM-b-DiTSmKNl.mjs.map +1 -0
  30. package/dist/{planner-produced-postgres-migration-92hFiR1t-BxAT0uTi.mjs → planner-produced-postgres-migration-BAH_r602-DSMj6CDP.mjs} +3 -3
  31. package/dist/{planner-produced-postgres-migration-92hFiR1t-BxAT0uTi.mjs.map → planner-produced-postgres-migration-BAH_r602-DSMj6CDP.mjs.map} +1 -1
  32. package/dist/{planner-sql-checks-CaRMR5SA-DGYjc2Cy.mjs → planner-sql-checks-wYIWo6ux-BCV1kDf6.mjs} +3 -3
  33. package/dist/{planner-sql-checks-CaRMR5SA-DGYjc2Cy.mjs.map → planner-sql-checks-wYIWo6ux-BCV1kDf6.mjs.map} +1 -1
  34. package/dist/{postgres-contract-view-BPe8r8jN-DrorQoWW.mjs → postgres-contract-view-eySKTszQ-CtakBpl3.mjs} +4 -4
  35. package/dist/{postgres-contract-view-BPe8r8jN-DrorQoWW.mjs.map → postgres-contract-view-eySKTszQ-CtakBpl3.mjs.map} +1 -1
  36. package/dist/{postgres-migration-BAGJ7FgH-4XbbekAu.mjs → postgres-migration-DPD4Q7tc-CaWigdRj.mjs} +8 -7
  37. package/dist/postgres-migration-DPD4Q7tc-CaWigdRj.mjs.map +1 -0
  38. package/dist/{postgres-schema-PFL-fpel-s3InB8T0.mjs → postgres-schema-VPEJqIX9-BBIMq9xs.mjs} +3 -3
  39. package/dist/{postgres-schema-PFL-fpel-s3InB8T0.mjs.map → postgres-schema-VPEJqIX9-BBIMq9xs.mjs.map} +1 -1
  40. package/dist/{prisma7-binding-BBC8EYpL.mjs → prisma7-binding-COPEubZc.mjs} +4 -4
  41. package/dist/{prisma7-binding-BBC8EYpL.mjs.map → prisma7-binding-COPEubZc.mjs.map} +1 -1
  42. package/dist/{resolve-ddl-schema-DoVk6G3i-D6YoWjC9.mjs → resolve-ddl-schema-DFOTYsNN-AVDEd24I.mjs} +3 -3
  43. package/dist/{resolve-ddl-schema-DoVk6G3i-D6YoWjC9.mjs.map → resolve-ddl-schema-DFOTYsNN-AVDEd24I.mjs.map} +1 -1
  44. package/dist/target.mjs +16 -16
  45. package/dist/target__contract-free.mjs +3 -3
  46. package/dist/target__control.mjs +2 -2
  47. package/dist/target__data-transform.mjs +1 -1
  48. package/dist/target__diff-database-schema.mjs +1 -1
  49. package/dist/target__issue-planner.mjs +1 -1
  50. package/dist/target__migration.mjs +3 -3
  51. package/dist/target__op-factory-call.mjs +1 -1
  52. package/dist/target__pack.mjs +1 -1
  53. package/dist/target__planner-produced-postgres-migration.mjs +1 -1
  54. package/dist/target__planner-sql-checks.mjs +1 -1
  55. package/dist/target__planner.mjs +2 -2
  56. package/dist/target__prisma7-binding.mjs +1 -1
  57. package/dist/target__runtime.mjs +2 -2
  58. package/dist/target__runtime.mjs.map +1 -1
  59. package/dist/target__schema-ir-annotations.mjs +1 -1
  60. package/dist/target__types.mjs +1 -1
  61. package/package.json +9 -9
  62. package/dist/control-BIGO0LQ1.mjs.map +0 -1
  63. package/dist/control-policy-CkLZsw31-DjVVWnnz.mjs.map +0 -1
  64. package/dist/planner-D9WzYlHl-CS_7pV8A.mjs.map +0 -1
  65. package/dist/postgres-migration-BAGJ7FgH-4XbbekAu.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"prisma7-binding-BBC8EYpL.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/prisma7-binding.mjs"],"sourcesContent":["import { t as parsePostgresDefault } from \"./default-normalizer-Bjtm2F4f.mjs\";\nimport { s as postgresNowGeneratorIdFor } from \"./authoring-DhCDnK1T.mjs\";\nimport { i as postgresCreateNamespace } from \"./postgres-schema-PFL-fpel.mjs\";\nimport { t as postgresTargetDescriptorMeta } from \"./descriptor-meta-CQMRNeLX.mjs\";\nimport { i as createPostgresDefaultMapping, r as createPostgresTypeMap, t as buildPslDocumentAst } from \"./infer-psl-contract-CBsWEERT.mjs\";\nimport { SqlSchemaIR, SqlTableIR } from \"@internal/sql-schema-ir/types\";\nimport { toModelName } from \"@internal/family-sql/psl-infer\";\nimport { flatPslModels } from \"@internal/framework-components/psl-ast\";\n//#region src/core/prisma7-temporal-defaults.ts\nconst RFC_3339 = /^(\\d{4})-(\\d{2})-(\\d{2})[Tt ](\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d+))?(?:[Zz]|([+-])(\\d{2}):(\\d{2}))$/;\nconst MICROS_PER_SECOND = 1e6;\nfunction pad(value, width = 2) {\n\treturn String(value).padStart(width, \"0\");\n}\n/**\n* The microseconds Postgres keeps for a fraction-of-a-second digit string. Every digit counts:\n* `.1234565` is an exact tie, and C's `rint` takes the even neighbour 123456, while `.1234565001`\n* is above the tie and rounds up to 123457.\n*/\nfunction fractionMicros(fraction) {\n\tconst micros = Number(`${fraction}000000`.slice(0, 6));\n\tconst beyondTie = fraction.slice(6).replace(/0+$/, \"\");\n\tif (beyondTie === \"\") return micros;\n\tif (beyondTie === \"5\") return micros % 2 === 0 ? micros : micros + 1;\n\treturn beyondTie > \"5\" ? micros + 1 : micros;\n}\nfunction fractionText(micros) {\n\treturn micros === 0 ? \"\" : `.${pad(micros, 6).replace(/0+$/, \"\")}`;\n}\nfunction offsetText(minutes) {\n\tconst magnitude = Math.abs(minutes);\n\tconst rest = magnitude % 60;\n\treturn `${minutes < 0 ? \"-\" : \"+\"}${pad(Math.floor(magnitude / 60))}${rest === 0 ? \"\" : `:${pad(rest)}`}`;\n}\n/**\n* The text of the column default Postgres stores for a Prisma 7 `DateTime`\n* default, which Prisma 7 writes as `'2024-01-02 03:04:05.123 +02:00'`:\n* `date` keeps the written date, `time` and `timestamp` the written wall-clock\n* time without the offset, and `timetz` the time with the written offset.\n* `timestamptz` is carried in its UTC form, the text a session in UTC prints\n* (`2024-01-02 01:04:05+00`, and `0001-12-31 23:30:00+00 BC` before year 1);\n* a session in another time zone prints the same instant differently.\n* Fractional seconds are rounded to microseconds; the column's own precision\n* does not change a stored default.\n*/\nfunction storedTemporalText(text, nativeType) {\n\tconst match = RFC_3339.exec(text);\n\tif (match === null) return void 0;\n\tconst [, year = \"\", month = \"\", day = \"\", hour, minute, second, fraction = \"\", sign, offsetHours, offsetMinutes] = match;\n\tif (nativeType === \"date\") return `${year}-${month}-${day}`;\n\tconst micros = fractionMicros(fraction);\n\tconst clockSeconds = Number(hour) * 3600 + Number(minute) * 60 + Number(second) + Math.floor(micros / MICROS_PER_SECOND);\n\tconst fractional = fractionText(micros % MICROS_PER_SECOND);\n\tconst offsetMinutesTotal = sign === void 0 ? 0 : (sign === \"-\" ? -1 : 1) * (Number(offsetHours) * 60 + Number(offsetMinutes));\n\tif (nativeType === \"time\" || nativeType === \"timetz\") {\n\t\tconst clock = `${pad(Math.floor(clockSeconds / 3600))}:${pad(Math.floor(clockSeconds / 60) % 60)}:${pad(clockSeconds % 60)}${fractional}`;\n\t\treturn nativeType === \"time\" ? clock : `${clock}${offsetText(offsetMinutesTotal)}`;\n\t}\n\tconst midnight = /* @__PURE__ */ new Date(0);\n\tmidnight.setUTCFullYear(Number(year), Number(month) - 1, Number(day));\n\tconst utcShift = nativeType === \"timestamptz\" ? offsetMinutesTotal * 60 : 0;\n\tconst stamp = new Date(midnight.getTime() + (clockSeconds - utcShift) * 1e3);\n\tconst astronomicalYear = stamp.getUTCFullYear();\n\tconst wallClock = `${pad(astronomicalYear > 0 ? astronomicalYear : 1 - astronomicalYear, 4)}-${pad(stamp.getUTCMonth() + 1)}-${pad(stamp.getUTCDate())} ${pad(stamp.getUTCHours())}:${pad(stamp.getUTCMinutes())}:${pad(stamp.getUTCSeconds())}${fractional}`;\n\tconst era = astronomicalYear > 0 ? \"\" : \" BC\";\n\treturn nativeType === \"timestamptz\" ? `${wallClock}+00${era}` : `${wallClock}${era}`;\n}\n//#endregion\n//#region src/core/prisma7-type-map.ts\n/**\n* What Prisma 7.10.0 creates in Postgres for each Prisma 7 scalar and `@db.*`\n* native type, expressed as the Prisma 8 authoring type constructor that\n* produces the same column. Derived from the SQL recorded in\n* `test/integration/test/fixtures/prisma7-source/reference/migration.sql`.\n* `args` are the constructor's positional arguments. A `@db.*` attribute's own\n* arguments replace them; without any, the column gets `args`, so `@db.Char`\n* is `Char(1)`, the `character(1)` Postgres stores for Prisma 7's `CHAR`.\n*/\nconst prisma7PostgresTypeMap = {\n\tscalars: {\n\t\tString: {\n\t\t\tconstructorName: \"String\",\n\t\t\targs: []\n\t\t},\n\t\tBoolean: {\n\t\t\tconstructorName: \"Boolean\",\n\t\t\targs: []\n\t\t},\n\t\tInt: {\n\t\t\tconstructorName: \"Int\",\n\t\t\targs: []\n\t\t},\n\t\tBigInt: {\n\t\t\tconstructorName: \"BigInt\",\n\t\t\targs: []\n\t\t},\n\t\tFloat: {\n\t\t\tconstructorName: \"Float\",\n\t\t\targs: []\n\t\t},\n\t\tDecimal: {\n\t\t\tconstructorName: \"Numeric\",\n\t\t\targs: [\"65\", \"30\"]\n\t\t},\n\t\tDateTime: {\n\t\t\tconstructorName: \"Timestamp\",\n\t\t\targs: [\"3\"]\n\t\t},\n\t\tJson: {\n\t\t\tconstructorName: \"Jsonb\",\n\t\t\targs: []\n\t\t},\n\t\tBytes: {\n\t\t\tconstructorName: \"Bytes\",\n\t\t\targs: []\n\t\t}\n\t},\n\tnativeTypes: {\n\t\tText: {\n\t\t\tconstructorName: \"String\",\n\t\t\targs: []\n\t\t},\n\t\tVarChar: {\n\t\t\tconstructorName: \"VarChar\",\n\t\t\targs: []\n\t\t},\n\t\tChar: {\n\t\t\tconstructorName: \"Char\",\n\t\t\targs: [\"1\"]\n\t\t},\n\t\tUuid: {\n\t\t\tconstructorName: \"Uuid\",\n\t\t\targs: []\n\t\t},\n\t\tInet: {\n\t\t\tconstructorName: \"Inet\",\n\t\t\targs: []\n\t\t},\n\t\tBoolean: {\n\t\t\tconstructorName: \"Boolean\",\n\t\t\targs: []\n\t\t},\n\t\tInteger: {\n\t\t\tconstructorName: \"Int\",\n\t\t\targs: []\n\t\t},\n\t\tSmallInt: {\n\t\t\tconstructorName: \"SmallInt\",\n\t\t\targs: []\n\t\t},\n\t\tBigInt: {\n\t\t\tconstructorName: \"BigInt\",\n\t\t\targs: []\n\t\t},\n\t\tReal: {\n\t\t\tconstructorName: \"Real\",\n\t\t\targs: []\n\t\t},\n\t\tDoublePrecision: {\n\t\t\tconstructorName: \"Float\",\n\t\t\targs: []\n\t\t},\n\t\tDecimal: {\n\t\t\tconstructorName: \"Numeric\",\n\t\t\targs: []\n\t\t},\n\t\tTimestamp: {\n\t\t\tconstructorName: \"Timestamp\",\n\t\t\targs: []\n\t\t},\n\t\tTimestamptz: {\n\t\t\tconstructorName: \"Timestamptz\",\n\t\t\targs: []\n\t\t},\n\t\tDate: {\n\t\t\tconstructorName: \"Date\",\n\t\t\targs: []\n\t\t},\n\t\tTime: {\n\t\t\tconstructorName: \"Time\",\n\t\t\targs: []\n\t\t},\n\t\tTimetz: {\n\t\t\tconstructorName: \"Timetz\",\n\t\t\targs: []\n\t\t},\n\t\tJson: {\n\t\t\tconstructorName: \"Json\",\n\t\t\targs: []\n\t\t},\n\t\tJsonB: {\n\t\t\tconstructorName: \"Jsonb\",\n\t\t\targs: []\n\t\t},\n\t\tByteA: {\n\t\t\tconstructorName: \"Bytes\",\n\t\t\targs: []\n\t\t}\n\t}\n};\n//#endregion\n//#region src/core/psl-infer/junction-relation-field-names.ts\nconst EMPTY_FOREIGN_KEY_EXTRAS = {\n\textraRelationsByTable: /* @__PURE__ */ new Map(),\n\tcrossSpaceFieldNamesByTable: /* @__PURE__ */ new Map(),\n\tdanglingForeignKeysByTable: /* @__PURE__ */ new Map()\n};\nfunction idTable(name) {\n\treturn new SqlTableIR({\n\t\tname,\n\t\tcolumns: { id: {\n\t\t\tname: \"id\",\n\t\t\tnativeType: \"int4\",\n\t\t\tnullable: false\n\t\t} },\n\t\tforeignKeys: [],\n\t\tuniques: [],\n\t\tindexes: [],\n\t\tprimaryKey: { columns: [\"id\"] }\n\t});\n}\n/**\n* The relation field names `contract infer` prints for an implicit\n* many-to-many junction table whose columns `A` and `B` reference `tableA`\n* and `tableB`, found by running infer's PSL construction on that table.\n*/\nfunction junctionRelationFieldNames(tableA, tableB) {\n\tlet junctionName = \"_junction\";\n\twhile ([tableA, tableB].some((table) => toModelName(table).name === toModelName(junctionName).name)) junctionName = `${junctionName}x`;\n\tconst column = (name) => ({\n\t\tname,\n\t\tnativeType: \"int4\",\n\t\tnullable: false\n\t});\n\tconst foreignKey = (columnName, referencedTable) => ({\n\t\tcolumns: [columnName],\n\t\treferencedTable,\n\t\treferencedColumns: [\"id\"]\n\t});\n\tconst junction = new SqlTableIR({\n\t\tname: junctionName,\n\t\tcolumns: {\n\t\t\tA: column(\"A\"),\n\t\t\tB: column(\"B\")\n\t\t},\n\t\tforeignKeys: [foreignKey(\"A\", tableA), foreignKey(\"B\", tableB)],\n\t\tuniques: [],\n\t\tindexes: [],\n\t\tprimaryKey: { columns: [\"A\", \"B\"] }\n\t});\n\tconst document = buildPslDocumentAst(new SqlSchemaIR({ tables: {\n\t\t[tableA]: idTable(tableA),\n\t\t[tableB]: idTable(tableB),\n\t\t[junctionName]: junction\n\t} }), {\n\t\ttypeMap: createPostgresTypeMap(),\n\t\tdefaultMapping: createPostgresDefaultMapping(),\n\t\tparseRawDefault: parsePostgresDefault\n\t}, EMPTY_FOREIGN_KEY_EXTRAS);\n\tconst junctionModelName = toModelName(junctionName).name;\n\tconst fields = flatPslModels(document).find((model) => model.name === junctionModelName)?.fields;\n\tconst scalarFieldCount = Object.keys(junction.columns).length;\n\tconst [a = \"\", b = \"\"] = (fields ?? []).slice(scalarFieldCount).map((field) => field.name);\n\treturn [a, b];\n}\n//#endregion\n//#region src/core/prisma7-binding.ts\nconst TEMPORAL_NATIVE_TYPES = /* @__PURE__ */ new Set([\n\t\"timestamp\",\n\t\"timestamptz\",\n\t\"date\",\n\t\"time\",\n\t\"timetz\"\n]);\nfunction isTemporalNativeType(nativeType) {\n\treturn TEMPORAL_NATIVE_TYPES.has(nativeType);\n}\nfunction sqlStringLiteral(value) {\n\treturn value === void 0 ? void 0 : `'${value.replace(/'/g, \"''\")}'`;\n}\nfunction base64ToHex(base64) {\n\tif (!/^[A-Za-z0-9+/]*={0,2}$/.test(base64) || base64.length % 4 !== 0) return void 0;\n\treturn `\\\\x${Buffer.from(base64, \"base64\").toString(\"hex\")}`;\n}\nfunction arrayLiteral(literals, typeName) {\n\treturn `ARRAY[${literals.join(\", \")}]::${typeName}[]`;\n}\n/**\n* What the Postgres target supplies to the Prisma 7 interpreter. A `Bytes` or\n* `DateTime` default is carried as the SQL literal of the default Postgres\n* stores (`'\\x68656c6c6f'`, `'2024-01-02 03:04:05'`), and a list default as an\n* `ARRAY[...]` of those literals cast to the column type, rather than through\n* the column codec, whose JSON form (base64, a Temporal value) is not what\n* introspection reads back; verify parses both sides with the same parser.\n*/\nconst prisma7PostgresBinding = {\n\ttarget: postgresTargetDescriptorMeta,\n\tcreateNamespace: postgresCreateNamespace,\n\tproviders: [\"postgresql\", \"postgres\"],\n\ttypeMap: prisma7PostgresTypeMap,\n\tnativeEnum: {\n\t\tentityKind: \"native_enum\",\n\t\ttypeConstructor: [\"pg\", \"enum\"]\n\t},\n\tindexTypes: {\n\t\tBTree: \"btree\",\n\t\tHash: \"hash\",\n\t\tGin: \"gin\",\n\t\tGist: \"gist\",\n\t\tSpGist: \"spgist\",\n\t\tBrin: \"brin\"\n\t},\n\t/** `NAMEDATALEN - 1`. */\n\tidentifierMaxBytes: 63,\n\tjunctionRelationFieldNames,\n\tupdatedAtGeneratorId: postgresNowGeneratorIdFor,\n\tliteralDefaultForm: ({ nativeType, typeParams }) => {\n\t\tif (nativeType === \"json\" || nativeType === \"jsonb\") return { kind: \"json\" };\n\t\tif (nativeType === \"bytea\") return {\n\t\t\tkind: \"sqlExpression\",\n\t\t\tliteral: (text) => sqlStringLiteral(base64ToHex(text)),\n\t\t\tlist: (literals) => arrayLiteral(literals, \"BYTEA\")\n\t\t};\n\t\tif (!isTemporalNativeType(nativeType)) return void 0;\n\t\tconst precision = typeParams?.[\"precision\"];\n\t\tconst typeName = `${nativeType.toUpperCase()}${typeof precision === \"number\" ? `(${precision})` : \"\"}`;\n\t\treturn {\n\t\t\tkind: \"sqlExpression\",\n\t\t\tliteral: (text) => sqlStringLiteral(storedTemporalText(text, nativeType)),\n\t\t\tlist: (literals) => arrayLiteral(literals, typeName)\n\t\t};\n\t}\n};\n//#endregion\nexport { prisma7PostgresBinding };\n\n//# sourceMappingURL=prisma7-binding.mjs.map"],"mappings":";;;;;;;;;AASA,MAAM,WAAW;AACjB,MAAM,oBAAoB;AAC1B,SAAS,IA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,UAAU,OAAO;EACnD;EACA,IAAI,CAAC,qBAAqB,UAAU,GAAG,OAAO,KAAK;EACnD,MAAM,YAAY,aAAa;EAC/B,MAAM,WAAW,GAAG,WAAW,YAAY,IAAI,OAAO,cAAc,WAAW,IAAI,UAAU,KAAK;EAClG,OAAO;GACN,MAAM;GACN,UAAU,SAAS,iBAAiB,mBAAmB,MAAM,UAAU,CAAC;GACxE,OAAO,aAAa,aAAa,UAAU,QAAQ;EACpD;CACD;AACD"}
1
+ {"version":3,"file":"prisma7-binding-COPEubZc.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/prisma7-binding.mjs"],"sourcesContent":["import { t as parsePostgresDefault } from \"./default-normalizer-Bjtm2F4f.mjs\";\nimport { s as postgresNowGeneratorIdFor } from \"./authoring-hMsx7htU.mjs\";\nimport { i as postgresCreateNamespace } from \"./postgres-schema-VPEJqIX9.mjs\";\nimport { t as postgresTargetDescriptorMeta } from \"./descriptor-meta-D9xFYKRF.mjs\";\nimport { i as createPostgresDefaultMapping, r as createPostgresTypeMap, t as buildPslDocumentAst } from \"./infer-psl-contract-CBsWEERT.mjs\";\nimport { SqlSchemaIR, SqlTableIR } from \"@internal/sql-schema-ir/types\";\nimport { toModelName } from \"@internal/family-sql/psl-infer\";\nimport { flatPslModels } from \"@internal/framework-components/psl-ast\";\n//#region src/core/prisma7-temporal-defaults.ts\nconst RFC_3339 = /^(\\d{4})-(\\d{2})-(\\d{2})[Tt ](\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d+))?(?:[Zz]|([+-])(\\d{2}):(\\d{2}))$/;\nconst MICROS_PER_SECOND = 1e6;\nfunction pad(value, width = 2) {\n\treturn String(value).padStart(width, \"0\");\n}\n/**\n* The microseconds Postgres keeps for a fraction-of-a-second digit string. Every digit counts:\n* `.1234565` is an exact tie, and C's `rint` takes the even neighbour 123456, while `.1234565001`\n* is above the tie and rounds up to 123457.\n*/\nfunction fractionMicros(fraction) {\n\tconst micros = Number(`${fraction}000000`.slice(0, 6));\n\tconst beyondTie = fraction.slice(6).replace(/0+$/, \"\");\n\tif (beyondTie === \"\") return micros;\n\tif (beyondTie === \"5\") return micros % 2 === 0 ? micros : micros + 1;\n\treturn beyondTie > \"5\" ? micros + 1 : micros;\n}\nfunction fractionText(micros) {\n\treturn micros === 0 ? \"\" : `.${pad(micros, 6).replace(/0+$/, \"\")}`;\n}\nfunction offsetText(minutes) {\n\tconst magnitude = Math.abs(minutes);\n\tconst rest = magnitude % 60;\n\treturn `${minutes < 0 ? \"-\" : \"+\"}${pad(Math.floor(magnitude / 60))}${rest === 0 ? \"\" : `:${pad(rest)}`}`;\n}\n/**\n* The text of the column default Postgres stores for a Prisma 7 `DateTime`\n* default, which Prisma 7 writes as `'2024-01-02 03:04:05.123 +02:00'`:\n* `date` keeps the written date, `time` and `timestamp` the written wall-clock\n* time without the offset, and `timetz` the time with the written offset.\n* `timestamptz` is carried in its UTC form, the text a session in UTC prints\n* (`2024-01-02 01:04:05+00`, and `0001-12-31 23:30:00+00 BC` before year 1);\n* a session in another time zone prints the same instant differently.\n* Fractional seconds are rounded to microseconds; the column's own precision\n* does not change a stored default.\n*/\nfunction storedTemporalText(text, nativeType) {\n\tconst match = RFC_3339.exec(text);\n\tif (match === null) return void 0;\n\tconst [, year = \"\", month = \"\", day = \"\", hour, minute, second, fraction = \"\", sign, offsetHours, offsetMinutes] = match;\n\tif (nativeType === \"date\") return `${year}-${month}-${day}`;\n\tconst micros = fractionMicros(fraction);\n\tconst clockSeconds = Number(hour) * 3600 + Number(minute) * 60 + Number(second) + Math.floor(micros / MICROS_PER_SECOND);\n\tconst fractional = fractionText(micros % MICROS_PER_SECOND);\n\tconst offsetMinutesTotal = sign === void 0 ? 0 : (sign === \"-\" ? -1 : 1) * (Number(offsetHours) * 60 + Number(offsetMinutes));\n\tif (nativeType === \"time\" || nativeType === \"timetz\") {\n\t\tconst clock = `${pad(Math.floor(clockSeconds / 3600))}:${pad(Math.floor(clockSeconds / 60) % 60)}:${pad(clockSeconds % 60)}${fractional}`;\n\t\treturn nativeType === \"time\" ? clock : `${clock}${offsetText(offsetMinutesTotal)}`;\n\t}\n\tconst midnight = /* @__PURE__ */ new Date(0);\n\tmidnight.setUTCFullYear(Number(year), Number(month) - 1, Number(day));\n\tconst utcShift = nativeType === \"timestamptz\" ? offsetMinutesTotal * 60 : 0;\n\tconst stamp = new Date(midnight.getTime() + (clockSeconds - utcShift) * 1e3);\n\tconst astronomicalYear = stamp.getUTCFullYear();\n\tconst wallClock = `${pad(astronomicalYear > 0 ? astronomicalYear : 1 - astronomicalYear, 4)}-${pad(stamp.getUTCMonth() + 1)}-${pad(stamp.getUTCDate())} ${pad(stamp.getUTCHours())}:${pad(stamp.getUTCMinutes())}:${pad(stamp.getUTCSeconds())}${fractional}`;\n\tconst era = astronomicalYear > 0 ? \"\" : \" BC\";\n\treturn nativeType === \"timestamptz\" ? `${wallClock}+00${era}` : `${wallClock}${era}`;\n}\n//#endregion\n//#region src/core/prisma7-type-map.ts\n/**\n* What Prisma 7.10.0 creates in Postgres for each Prisma 7 scalar and `@db.*`\n* native type, expressed as the Prisma 8 authoring type constructor that\n* produces the same column. Derived from the SQL recorded in\n* `test/integration/test/fixtures/prisma7-source/reference/migration.sql`.\n* `args` are the constructor's positional arguments. A `@db.*` attribute's own\n* arguments replace them; without any, the column gets `args`, so `@db.Char`\n* is `Char(1)`, the `character(1)` Postgres stores for Prisma 7's `CHAR`.\n*/\nconst prisma7PostgresTypeMap = {\n\tscalars: {\n\t\tString: {\n\t\t\tconstructorName: \"String\",\n\t\t\targs: []\n\t\t},\n\t\tBoolean: {\n\t\t\tconstructorName: \"Boolean\",\n\t\t\targs: []\n\t\t},\n\t\tInt: {\n\t\t\tconstructorName: \"Int\",\n\t\t\targs: []\n\t\t},\n\t\tBigInt: {\n\t\t\tconstructorName: \"BigInt\",\n\t\t\targs: []\n\t\t},\n\t\tFloat: {\n\t\t\tconstructorName: \"Float\",\n\t\t\targs: []\n\t\t},\n\t\tDecimal: {\n\t\t\tconstructorName: \"Numeric\",\n\t\t\targs: [\"65\", \"30\"]\n\t\t},\n\t\tDateTime: {\n\t\t\tconstructorName: \"Timestamp\",\n\t\t\targs: [\"3\"]\n\t\t},\n\t\tJson: {\n\t\t\tconstructorName: \"Jsonb\",\n\t\t\targs: []\n\t\t},\n\t\tBytes: {\n\t\t\tconstructorName: \"Bytes\",\n\t\t\targs: []\n\t\t}\n\t},\n\tnativeTypes: {\n\t\tText: {\n\t\t\tconstructorName: \"String\",\n\t\t\targs: []\n\t\t},\n\t\tVarChar: {\n\t\t\tconstructorName: \"VarChar\",\n\t\t\targs: []\n\t\t},\n\t\tChar: {\n\t\t\tconstructorName: \"Char\",\n\t\t\targs: [\"1\"]\n\t\t},\n\t\tUuid: {\n\t\t\tconstructorName: \"Uuid\",\n\t\t\targs: []\n\t\t},\n\t\tInet: {\n\t\t\tconstructorName: \"Inet\",\n\t\t\targs: []\n\t\t},\n\t\tBoolean: {\n\t\t\tconstructorName: \"Boolean\",\n\t\t\targs: []\n\t\t},\n\t\tInteger: {\n\t\t\tconstructorName: \"Int\",\n\t\t\targs: []\n\t\t},\n\t\tSmallInt: {\n\t\t\tconstructorName: \"SmallInt\",\n\t\t\targs: []\n\t\t},\n\t\tBigInt: {\n\t\t\tconstructorName: \"BigInt\",\n\t\t\targs: []\n\t\t},\n\t\tReal: {\n\t\t\tconstructorName: \"Real\",\n\t\t\targs: []\n\t\t},\n\t\tDoublePrecision: {\n\t\t\tconstructorName: \"Float\",\n\t\t\targs: []\n\t\t},\n\t\tDecimal: {\n\t\t\tconstructorName: \"Numeric\",\n\t\t\targs: []\n\t\t},\n\t\tTimestamp: {\n\t\t\tconstructorName: \"Timestamp\",\n\t\t\targs: []\n\t\t},\n\t\tTimestamptz: {\n\t\t\tconstructorName: \"Timestamptz\",\n\t\t\targs: []\n\t\t},\n\t\tDate: {\n\t\t\tconstructorName: \"Date\",\n\t\t\targs: []\n\t\t},\n\t\tTime: {\n\t\t\tconstructorName: \"Time\",\n\t\t\targs: []\n\t\t},\n\t\tTimetz: {\n\t\t\tconstructorName: \"Timetz\",\n\t\t\targs: []\n\t\t},\n\t\tJson: {\n\t\t\tconstructorName: \"Json\",\n\t\t\targs: []\n\t\t},\n\t\tJsonB: {\n\t\t\tconstructorName: \"Jsonb\",\n\t\t\targs: []\n\t\t},\n\t\tByteA: {\n\t\t\tconstructorName: \"Bytes\",\n\t\t\targs: []\n\t\t}\n\t}\n};\n//#endregion\n//#region src/core/psl-infer/junction-relation-field-names.ts\nconst EMPTY_FOREIGN_KEY_EXTRAS = {\n\textraRelationsByTable: /* @__PURE__ */ new Map(),\n\tcrossSpaceFieldNamesByTable: /* @__PURE__ */ new Map(),\n\tdanglingForeignKeysByTable: /* @__PURE__ */ new Map()\n};\nfunction idTable(name) {\n\treturn new SqlTableIR({\n\t\tname,\n\t\tcolumns: { id: {\n\t\t\tname: \"id\",\n\t\t\tnativeType: \"int4\",\n\t\t\tnullable: false\n\t\t} },\n\t\tforeignKeys: [],\n\t\tuniques: [],\n\t\tindexes: [],\n\t\tprimaryKey: { columns: [\"id\"] }\n\t});\n}\n/**\n* The relation field names `contract infer` prints for an implicit\n* many-to-many junction table whose columns `A` and `B` reference `tableA`\n* and `tableB`, found by running infer's PSL construction on that table.\n*/\nfunction junctionRelationFieldNames(tableA, tableB) {\n\tlet junctionName = \"_junction\";\n\twhile ([tableA, tableB].some((table) => toModelName(table).name === toModelName(junctionName).name)) junctionName = `${junctionName}x`;\n\tconst column = (name) => ({\n\t\tname,\n\t\tnativeType: \"int4\",\n\t\tnullable: false\n\t});\n\tconst foreignKey = (columnName, referencedTable) => ({\n\t\tcolumns: [columnName],\n\t\treferencedTable,\n\t\treferencedColumns: [\"id\"]\n\t});\n\tconst junction = new SqlTableIR({\n\t\tname: junctionName,\n\t\tcolumns: {\n\t\t\tA: column(\"A\"),\n\t\t\tB: column(\"B\")\n\t\t},\n\t\tforeignKeys: [foreignKey(\"A\", tableA), foreignKey(\"B\", tableB)],\n\t\tuniques: [],\n\t\tindexes: [],\n\t\tprimaryKey: { columns: [\"A\", \"B\"] }\n\t});\n\tconst document = buildPslDocumentAst(new SqlSchemaIR({ tables: {\n\t\t[tableA]: idTable(tableA),\n\t\t[tableB]: idTable(tableB),\n\t\t[junctionName]: junction\n\t} }), {\n\t\ttypeMap: createPostgresTypeMap(),\n\t\tdefaultMapping: createPostgresDefaultMapping(),\n\t\tparseRawDefault: parsePostgresDefault\n\t}, EMPTY_FOREIGN_KEY_EXTRAS);\n\tconst junctionModelName = toModelName(junctionName).name;\n\tconst fields = flatPslModels(document).find((model) => model.name === junctionModelName)?.fields;\n\tconst scalarFieldCount = Object.keys(junction.columns).length;\n\tconst [a = \"\", b = \"\"] = (fields ?? []).slice(scalarFieldCount).map((field) => field.name);\n\treturn [a, b];\n}\n//#endregion\n//#region src/core/prisma7-binding.ts\nconst TEMPORAL_NATIVE_TYPES = /* @__PURE__ */ new Set([\n\t\"timestamp\",\n\t\"timestamptz\",\n\t\"date\",\n\t\"time\",\n\t\"timetz\"\n]);\nfunction isTemporalNativeType(nativeType) {\n\treturn TEMPORAL_NATIVE_TYPES.has(nativeType);\n}\nfunction sqlStringLiteral(value) {\n\treturn value === void 0 ? void 0 : `'${value.replace(/'/g, \"''\")}'`;\n}\nfunction base64ToHex(base64) {\n\tif (!/^[A-Za-z0-9+/]*={0,2}$/.test(base64) || base64.length % 4 !== 0) return void 0;\n\treturn `\\\\x${Buffer.from(base64, \"base64\").toString(\"hex\")}`;\n}\nfunction arrayLiteral(literals, typeName) {\n\treturn `ARRAY[${literals.join(\", \")}]::${typeName}[]`;\n}\n/**\n* What the Postgres target supplies to the Prisma 7 interpreter. A `Bytes` or\n* `DateTime` default is carried as the SQL literal of the default Postgres\n* stores (`'\\x68656c6c6f'`, `'2024-01-02 03:04:05'`), and a list default as an\n* `ARRAY[...]` of those literals cast to the column type, rather than through\n* the column codec, whose JSON form (base64, a Temporal value) is not what\n* introspection reads back; verify parses both sides with the same parser.\n*/\nconst prisma7PostgresBinding = {\n\ttarget: postgresTargetDescriptorMeta,\n\tcreateNamespace: postgresCreateNamespace,\n\tproviders: [\"postgresql\", \"postgres\"],\n\ttypeMap: prisma7PostgresTypeMap,\n\tnativeEnum: {\n\t\tentityKind: \"native_enum\",\n\t\ttypeConstructor: [\"pg\", \"enum\"]\n\t},\n\tindexTypes: {\n\t\tBTree: \"btree\",\n\t\tHash: \"hash\",\n\t\tGin: \"gin\",\n\t\tGist: \"gist\",\n\t\tSpGist: \"spgist\",\n\t\tBrin: \"brin\"\n\t},\n\t/** `NAMEDATALEN - 1`. */\n\tidentifierMaxBytes: 63,\n\tjunctionRelationFieldNames,\n\tupdatedAtGeneratorId: postgresNowGeneratorIdFor,\n\tliteralDefaultForm: ({ nativeType, typeParams }) => {\n\t\tif (nativeType === \"json\" || nativeType === \"jsonb\") return { kind: \"json\" };\n\t\tif (nativeType === \"bytea\") return {\n\t\t\tkind: \"sqlExpression\",\n\t\t\tliteral: (text) => sqlStringLiteral(base64ToHex(text)),\n\t\t\tlist: (literals) => arrayLiteral(literals, \"BYTEA\")\n\t\t};\n\t\tif (!isTemporalNativeType(nativeType)) return void 0;\n\t\tconst precision = typeParams?.[\"precision\"];\n\t\tconst typeName = `${nativeType.toUpperCase()}${typeof precision === \"number\" ? `(${precision})` : \"\"}`;\n\t\treturn {\n\t\t\tkind: \"sqlExpression\",\n\t\t\tliteral: (text) => sqlStringLiteral(storedTemporalText(text, nativeType)),\n\t\t\tlist: (literals) => arrayLiteral(literals, typeName)\n\t\t};\n\t}\n};\n//#endregion\nexport { prisma7PostgresBinding };\n\n//# sourceMappingURL=prisma7-binding.mjs.map"],"mappings":";;;;;;;;;AASA,MAAM,WAAW;AACjB,MAAM,oBAAoB;AAC1B,SAAS,IAAI,OAAO,QAAQ,GAAG;CAC9B,OAAO,OAAO,KAAK,CAAC,CAAC,SAAS,OAAO,GAAG;AACzC;;;;;;AAMA,SAAS,eAAe,UAAU;CACjC,M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W,YAAY,IAAI,OAAO,cAAc,WAAW,IAAI,UAAU,KAAK;EAClG,OAAO;GACN,MAAM;GACN,UAAU,SAAS,iBAAiB,mBAAmB,MAAM,UAAU,CAAC;GACxE,OAAO,aAAa,aAAa,UAAU,QAAQ;EACpD;CACD;AACD"}
@@ -1,7 +1,7 @@
1
1
  import { t as DEFAULT_NAMESPACE_ID } from "./namespace-ids-xtp_ZY86-Cpp8PTxD.mjs";
2
- import { d as isPostgresSchema } from "./postgres-schema-PFL-fpel-s3InB8T0.mjs";
2
+ import { d as isPostgresSchema } from "./postgres-schema-VPEJqIX9-BBIMq9xs.mjs";
3
3
  import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
4
- //#region ../../../3-targets/3-targets/postgres/dist/resolve-ddl-schema-DoVk6G3i.mjs
4
+ //#region ../../../3-targets/3-targets/postgres/dist/resolve-ddl-schema-DFOTYsNN.mjs
5
5
  /**
6
6
  * Given the contract's storage and a namespace id, returns the live Postgres
7
7
  * DDL schema name that namespace maps to. A named Postgres namespace dispatches
@@ -19,4 +19,4 @@ function resolveDdlSchemaForNamespaceStorage(storage, namespaceId) {
19
19
  //#endregion
20
20
  export { resolveDdlSchemaForNamespaceStorage as t };
21
21
 
22
- //# sourceMappingURL=resolve-ddl-schema-DoVk6G3i-D6YoWjC9.mjs.map
22
+ //# sourceMappingURL=resolve-ddl-schema-DFOTYsNN-AVDEd24I.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-ddl-schema-DoVk6G3i-D6YoWjC9.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/resolve-ddl-schema-DoVk6G3i.mjs"],"sourcesContent":["import { t as DEFAULT_NAMESPACE_ID } from \"./namespace-ids-xtp_ZY86.mjs\";\nimport { r as isPostgresSchema } from \"./postgres-schema-PFL-fpel.mjs\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\n//#region src/core/migrations/resolve-ddl-schema.ts\n/**\n* Given the contract's storage and a namespace id, returns the live Postgres\n* DDL schema name that namespace maps to. A named Postgres namespace dispatches\n* to its `ddlSchemaName(storage)`; the unbound sentinel resolves to\n* `DEFAULT_NAMESPACE_ID` (the search-path default for offline planning); a\n* bare object payload (used by some tests) falls back to the namespace id\n* itself.\n*/\nfunction resolveDdlSchemaForNamespaceStorage(storage, namespaceId) {\n\tif (namespaceId === UNBOUND_NAMESPACE_ID) return DEFAULT_NAMESPACE_ID;\n\tconst namespace = storage.namespaces[namespaceId];\n\tif (namespace && isPostgresSchema(namespace)) return namespace.ddlSchemaName(storage);\n\treturn namespaceId;\n}\n//#endregion\nexport { resolveDdlSchemaForNamespaceStorage as t };\n\n//# sourceMappingURL=resolve-ddl-schema-DoVk6G3i.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,oCAAoC,SAAS,aAAa;CAClE,IAAI,gBAAgB,sBAAsB,OAAO;CACjD,MAAM,YAAY,QAAQ,WAAW;CACrC,IAAI,aAAa,iBAAiB,SAAS,GAAG,OAAO,UAAU,cAAc,OAAO;CACpF,OAAO;AACR"}
1
+ {"version":3,"file":"resolve-ddl-schema-DFOTYsNN-AVDEd24I.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/resolve-ddl-schema-DFOTYsNN.mjs"],"sourcesContent":["import { t as DEFAULT_NAMESPACE_ID } from \"./namespace-ids-xtp_ZY86.mjs\";\nimport { r as isPostgresSchema } from \"./postgres-schema-VPEJqIX9.mjs\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\n//#region src/core/migrations/resolve-ddl-schema.ts\n/**\n* Given the contract's storage and a namespace id, returns the live Postgres\n* DDL schema name that namespace maps to. A named Postgres namespace dispatches\n* to its `ddlSchemaName(storage)`; the unbound sentinel resolves to\n* `DEFAULT_NAMESPACE_ID` (the search-path default for offline planning); a\n* bare object payload (used by some tests) falls back to the namespace id\n* itself.\n*/\nfunction resolveDdlSchemaForNamespaceStorage(storage, namespaceId) {\n\tif (namespaceId === UNBOUND_NAMESPACE_ID) return DEFAULT_NAMESPACE_ID;\n\tconst namespace = storage.namespaces[namespaceId];\n\tif (namespace && isPostgresSchema(namespace)) return namespace.ddlSchemaName(storage);\n\treturn namespaceId;\n}\n//#endregion\nexport { resolveDdlSchemaForNamespaceStorage as t };\n\n//# sourceMappingURL=resolve-ddl-schema-DFOTYsNN.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,oCAAoC,SAAS,aAAa;CAClE,IAAI,gBAAgB,sBAAsB,OAAO;CACjD,MAAM,YAAY,QAAQ,WAAW;CACrC,IAAI,aAAa,iBAAiB,SAAS,GAAG,OAAO,UAAU,cAAc,OAAO;CACpF,OAAO;AACR"}
package/dist/target.mjs CHANGED
@@ -6,34 +6,34 @@ import { t as PostgresNativeEnum } from "./postgres-native-enum-CdP3b_-R-Cgz9KEK
6
6
  import { C as pgTimestamptzDateColumn, D as pgUuidColumn, E as pgUnboundedIntColumn, O as pgVarbitColumn, S as pgTextColumn, T as pgTimetzColumn, _ as pgIntColumn, a as pgBitColumn, b as pgJsonbColumn, c as pgEnumDescriptor, d as pgFloatColumn, f as pgInetColumn, g as pgInt8NumberColumn, h as pgInt8Column, i as isPgEnumParams, k as pgVarcharColumn, l as pgFloat4Column, m as pgInt4Column, n as PgTimestamptzDateDescriptor, o as pgBoolColumn, p as pgInt2Column, s as pgCharColumn, t as PgTimestamptzDateCodec, u as pgFloat8Column, v as pgIntervalColumn, w as pgTimestamptzDateDescriptor, x as pgNumericColumn, y as pgJsonColumn } from "./codecs-7isLDrZp-DmbSAn6K.mjs";
7
7
  import { n as postgresCodecRegistry, t as postgresCodecDescriptorRegistry } from "./codecs-BrJWpXPJ.mjs";
8
8
  import { a as validateEnumValueLength, i as quoteQualifiedName, n as qualifyName, r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-6j9YTLpr-BCyCBPBg.mjs";
9
- import { c as PostgresSchema, d as isPostgresSchema, h as postgresCreateNamespace, i as PostgresRlsPolicy, l as PostgresTableSource, m as policyInputFromSerialized, n as PostgresRlsEnablement, o as PostgresRole, u as PostgresUnboundSchema } from "./postgres-schema-PFL-fpel-s3InB8T0.mjs";
9
+ import { c as PostgresSchema, d as isPostgresSchema, h as postgresCreateNamespace, i as PostgresRlsPolicy, l as PostgresTableSource, m as policyInputFromSerialized, n as PostgresRlsEnablement, o as PostgresRole, u as PostgresUnboundSchema } from "./postgres-schema-VPEJqIX9-BBIMq9xs.mjs";
10
10
  import { a as PostgresAlterTable, c as PostgresCreateSchema, d as PostgresDdlNode, f as PostgresDisableRowLevelSecurity, h as PostgresDropType, i as PostgresAlterPolicyRename, l as PostgresCreateTable, m as PostgresDropPolicy, n as DropDefaultAction, o as PostgresCreateIndex, p as PostgresDropIndex, r as PostgresAlterIndexRename, s as PostgresCreatePolicy, t as AddColumnAction, u as PostgresCreateType } from "./nodes-DAvDJLvJ-BBdvFXNa.mjs";
11
- import { A as toRegclass, D as tableExistsAst, E as rlsPolicyExistsAst, O as tableIsEmptyAst, T as rlsEnabledAst, a as columnDefaultAst, b as extensionExistsAst, c as columnTypeAst, f as createSchema, g as dropDefaultAction, i as alterTable, k as tablePrimaryKeyAst, l as constraintExistsAst, o as columnExistsAst, p as createTable, s as columnNullabilityAst, t as addColumnAction, w as noNullValuesAst, x as indexExistsAst } from "./ddl-CaKDvAty-sHOb0D92.mjs";
12
- import { a as jsonb, c as textArray, i as int8, l as timestamptz, n as buildSignMarkerBootstrapQueries, o as pgTable, r as int4, s as text, t as buildControlTableBootstrapQueries, u as timestamptzJsDate } from "./contract-free-DcfADfM5.mjs";
11
+ import { A as toRegclass, D as tableExistsAst, E as rlsPolicyExistsAst, O as tableIsEmptyAst, T as rlsEnabledAst, a as columnDefaultAst, b as extensionExistsAst, c as columnTypeAst, f as createSchema, g as dropDefaultAction, i as alterTable, k as tablePrimaryKeyAst, l as constraintExistsAst, o as columnExistsAst, p as createTable, s as columnNullabilityAst, t as addColumnAction, w as noNullValuesAst, x as indexExistsAst } from "./ddl-DxYRJ8hY-mFzFol6l.mjs";
12
+ import { a as jsonb, c as textArray, i as int8, l as timestamptz, n as buildSignMarkerBootstrapQueries, o as pgTable, r as int4, s as text, t as buildControlTableBootstrapQueries, u as timestamptzJsDate } from "./contract-free-CmBUYWYN.mjs";
13
13
  import { n as postgresResolveDefault, t as parsePostgresDefault } from "./default-normalizer-Bjtm2F4f-uV5vvkVt.mjs";
14
14
  import { n as computeContentHash, t as POLICY_OPERATION_PREDICATES } from "./canonicalize-CrN3u_xM-D4MrOqcB.mjs";
15
- import { a as plainDateTimeNow, i as instantNowControlDescriptor, n as PLAIN_DATE_TIME_NOW_GENERATOR_ID, o as plainDateTimeNowControlDescriptor, r as instantNow, t as INSTANT_NOW_GENERATOR_ID } from "./authoring-DhCDnK1T-CGirVrrH.mjs";
15
+ import { a as plainDateTimeNow, i as instantNowControlDescriptor, n as PLAIN_DATE_TIME_NOW_GENERATOR_ID, o as plainDateTimeNowControlDescriptor, r as instantNow, t as INSTANT_NOW_GENERATOR_ID } from "./authoring-hMsx7htU-MzchK-oB.mjs";
16
16
  import { t as postgresRenderCheckExpressions } from "./check-expressions-DFTeR0rd-CSxSpyMV.mjs";
17
17
  import { n as PostgresSchemaNodeKind, r as PostgresTableSchemaNode, t as PostgresNativeEnumSchemaNode } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
18
18
  import { i as PostgresRoleSchemaNode, n as PostgresNamespaceSchemaNode, r as PostgresPolicySchemaNode, t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs";
19
- import { t as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-DoVk6G3i-D6YoWjC9.mjs";
20
- import { n as qualifyTableName, t as buildExpectedFormatType } from "./planner-sql-checks-CaRMR5SA-DGYjc2Cy.mjs";
19
+ import { t as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-DFOTYsNN-AVDEd24I.mjs";
20
+ import { n as qualifyTableName, t as buildExpectedFormatType } from "./planner-sql-checks-wYIWo6ux-BCV1kDf6.mjs";
21
21
  import { n as buildColumnTypeSql, r as renderDefaultLiteral, t as buildColumnDefaultSql } from "./planner-ddl-builders-DTCYp-qA-DF16uM8O.mjs";
22
- import { A as RenameIndexCall, C as DropNativeEnumTypeCall, D as EnableRowLevelSecurityCall, E as DropTableCall, F as createExtension, M as SetDefaultCall, N as SetNotNullCall, O as RawSqlCall, S as DropIndexCall, T as DropPostgresRlsPolicyCall, _ as DisableRowLevelSecurityCall, b as DropConstraintCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, g as DataTransformCall, h as CreateTableCall, i as AddNativeEnumValueCall, j as RenamePostgresRlsPolicyCall, k as RenameCheckConstraintCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, o as AddNotNullColumnWithTempDefaultCall, p as CreatePostgresRlsPolicyCall, r as AddForeignKeyCall, s as AddPrimaryKeyCall, t as AddCheckConstraintCall, u as CreateExtensionCall, v as DropCheckConstraintCall, w as DropNotNullCall, x as DropDefaultCall, y as DropColumnCall } from "./op-factory-call-Bp6F2UEs-Bze_DuAk.mjs";
22
+ import { A as RenameIndexCall, C as DropNativeEnumTypeCall, D as EnableRowLevelSecurityCall, E as DropTableCall, F as createExtension, M as SetDefaultCall, N as SetNotNullCall, O as RawSqlCall, S as DropIndexCall, T as DropPostgresRlsPolicyCall, _ as DisableRowLevelSecurityCall, b as DropConstraintCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, g as DataTransformCall, h as CreateTableCall, i as AddNativeEnumValueCall, j as RenamePostgresRlsPolicyCall, k as RenameCheckConstraintCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, o as AddNotNullColumnWithTempDefaultCall, p as CreatePostgresRlsPolicyCall, r as AddForeignKeyCall, s as AddPrimaryKeyCall, t as AddCheckConstraintCall, u as CreateExtensionCall, v as DropCheckConstraintCall, w as DropNotNullCall, x as DropDefaultCall, y as DropColumnCall } from "./op-factory-call-BAtE9hKE-xuF-YyXB.mjs";
23
23
  import { n as resolveIdentityValue, t as buildBuiltinIdentityValue } from "./planner-identity-values-BmHn5C6U-BYBbUAyR.mjs";
24
24
  import { i as hasUniqueConstraint, n as hasForeignKey, r as hasIndex, t as buildSchemaLookupMap } from "./planner-schema-lookup-kMIVP2y--CdO4VlnF.mjs";
25
- import { a as planIssues, t as coalesceSubtreeIssues } from "./control-policy-CkLZsw31-DjVVWnnz.mjs";
26
- import { n as contractToPostgresDatabaseSchemaNode, t as buildPostgresPlanDiff } from "./diff-database-schema-c9IWEO2V-DCnp7F4-.mjs";
27
- import { n as PostgresContractView, t as PostgresContractSerializer } from "./postgres-contract-view-BPe8r8jN-DrorQoWW.mjs";
28
- import { t as dataTransform } from "./data-transform-ChZzy2dP-CxVCat_8.mjs";
29
- import { t as PostgresMigration } from "./postgres-migration-BAGJ7FgH-4XbbekAu.mjs";
25
+ import { a as planIssues, t as coalesceSubtreeIssues } from "./control-policy-Bt4h9XRP-D286Iyv0.mjs";
26
+ import { n as contractToPostgresDatabaseSchemaNode, t as buildPostgresPlanDiff } from "./diff-database-schema-BAiMsL_e-CTXBlIlV.mjs";
27
+ import { n as PostgresContractView, t as PostgresContractSerializer } from "./postgres-contract-view-eySKTszQ-CtakBpl3.mjs";
28
+ import { t as dataTransform } from "./data-transform-Bo32KRbq-BLn1_UG-.mjs";
29
+ import { t as PostgresMigration } from "./postgres-migration-DPD4Q7tc-CaWigdRj.mjs";
30
30
  import { t as renderOps } from "./render-ops-D2vJApKB-B281fzmn.mjs";
31
31
  import { t as renderCallsToTypeScript } from "./render-typescript-Dqp1Spgn-B128r1qw.mjs";
32
- import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-92hFiR1t-BxAT0uTi.mjs";
33
- import { t as createPostgresMigrationPlanner } from "./planner-D9WzYlHl-CS_7pV8A.mjs";
32
+ import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-BAH_r602-DSMj6CDP.mjs";
33
+ import { t as createPostgresMigrationPlanner } from "./planner-CeItKM-b-DiTSmKNl.mjs";
34
34
  import { n as parsePostgresListText, t as decodePostgresListText } from "./list-decoder-DXee1orj-K3y-hxiI.mjs";
35
- import { t as postgresRenderDefault } from "./control-BIGO0LQ1.mjs";
35
+ import { t as postgresRenderDefault } from "./control-DUGbVzYt.mjs";
36
36
  import { a as foreignKey, c as primaryKey, i as fn, l as rawSql, n as checkExpression, o as lit, r as col, s as placeholder, t as MigrationCLI, u as unique } from "./migration-PTHAY9Cv.mjs";
37
37
  import { t as normalizeSchemaNativeType } from "./native-type-normalizer-yvd3tqv-.mjs";
38
- import { t as prisma7PostgresBinding } from "./prisma7-binding-BBC8EYpL.mjs";
38
+ import { t as prisma7PostgresBinding } from "./prisma7-binding-COPEubZc.mjs";
39
39
  export { AddCheckConstraintCall, AddColumnAction, AddColumnCall, AddForeignKeyCall, AddNativeEnumValueCall, AddNotNullColumnWithTempDefaultCall, AddPrimaryKeyCall, AddUniqueCall, AlterColumnTypeCall, CreateExtensionCall, CreateIndexCall, CreateNativeEnumTypeCall, CreatePostgresRlsPolicyCall, CreateSchemaCall, CreateTableCall, DataTransformCall, DisableRowLevelSecurityCall, DropCheckConstraintCall, DropColumnCall, DropConstraintCall, DropDefaultAction, DropDefaultCall, DropIndexCall, DropNativeEnumTypeCall, DropNotNullCall, DropPostgresRlsPolicyCall, DropTableCall, EnableRowLevelSecurityCall, INSTANT_NOW_GENERATOR_ID, PostgresMigration as Migration, MigrationCLI, PG_BIT_CODEC_ID, PG_BOOL_CODEC_ID, PG_BYTEA_CODEC_ID, PG_CHAR_CODEC_ID, PG_DATE_STRING_CODEC_ID, PG_DATE_TEMPORAL_CODEC_ID, PG_ENUM_CODEC_ID, PG_FLOAT4_CODEC_ID, PG_FLOAT8_CODEC_ID, PG_FLOAT_CODEC_ID, PG_INET_CODEC_ID, PG_INT2_CODEC_ID, PG_INT4_CODEC_ID, PG_INT8_CODEC_ID, PG_INT8_NUMBER_CODEC_ID, PG_INTERVAL_CODEC_ID, PG_INT_CODEC_ID, PG_JSONB_CODEC_ID, PG_JSON_CODEC_ID, PG_NUMERIC_CODEC_ID, PG_TEXT_ARRAY_CODEC_ID, PG_TEXT_CODEC_ID, PG_TIMESTAMPTZ_DATE_CODEC_ID, PG_TIMESTAMPTZ_STRING_CODEC_ID, PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, PG_TIMESTAMP_STRING_CODEC_ID, PG_TIMESTAMP_TEMPORAL_CODEC_ID, PG_TIMETZ_CODEC_ID, PG_TIME_STRING_CODEC_ID, PG_TIME_TEMPORAL_CODEC_ID, PG_UNBOUNDED_INT_CODEC_ID, PG_UUID_CODEC_ID, PG_VARBIT_CODEC_ID, PG_VARCHAR_CODEC_ID, PLAIN_DATE_TIME_NOW_GENERATOR_ID, POLICY_OPERATION_PREDICATES, PgTimestamptzDateCodec, PgTimestamptzDateDescriptor, PostgresAlterIndexRename, PostgresAlterPolicyRename, PostgresAlterTable, PostgresCodecDescriptor, PostgresContractSerializer, PostgresContractView, PostgresCreateIndex, PostgresCreatePolicy, PostgresCreateSchema, PostgresCreateTable, PostgresCreateType, PostgresDatabaseSchemaNode, PostgresDdlNode, PostgresDisableRowLevelSecurity, PostgresDropIndex, PostgresDropPolicy, PostgresDropType, PostgresNamespaceSchemaNode, PostgresNativeEnum, PostgresNativeEnumSchemaNode, PostgresPolicySchemaNode, PostgresRlsEnablement, PostgresRlsPolicy, PostgresRole, PostgresRoleSchemaNode, PostgresSchema, PostgresSchemaNodeKind, PostgresTableSchemaNode, PostgresTableSource, PostgresUnboundSchema, RawSqlCall, RenameCheckConstraintCall, RenameIndexCall, RenamePostgresRlsPolicyCall, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID, SetDefaultCall, SetNotNullCall, TypeScriptRenderablePostgresMigration, addColumnAction, alterTable, buildBuiltinIdentityValue, buildColumnDefaultSql, buildColumnTypeSql, buildControlTableBootstrapQueries, buildExpectedFormatType, buildPostgresCodecDescriptorRegistry, buildPostgresPlanDiff, buildSchemaLookupMap, buildSignMarkerBootstrapQueries, checkExpression, coalesceSubtreeIssues, col, columnDefaultAst, columnExistsAst, columnNullabilityAst, columnTypeAst, computeContentHash, constraintExistsAst, contractToPostgresDatabaseSchemaNode, createExtension, createPostgresMigrationPlanner, createSchema, createTable, dataTransform, decodePostgresListText, definePostgresCodecs, dropDefaultAction, errorPostgresMigrationStackMissing, escapeLiteral, extensionExistsAst, fn, foreignKey, hasForeignKey, hasIndex, hasUniqueConstraint, indexExistsAst, instantNow, instantNowControlDescriptor, int4, int8, isPgEnumParams, isPostgresCodecDescriptor, isPostgresSchema, jsonb, lit, noNullValuesAst, normalizeSchemaNativeType, parsePostgresDefault, parsePostgresListText, pgBitColumn, pgBoolColumn, pgCharColumn, pgEnumDescriptor, pgFloat4Column, pgFloat8Column, pgFloatColumn, pgInetColumn, pgInt2Column, pgInt4Column, pgInt8Column, pgInt8NumberColumn, pgIntColumn, pgIntervalColumn, pgJsonColumn, pgJsonbColumn, pgNumericColumn, pgTable, pgTextColumn, pgTimestamptzDateColumn, pgTimestamptzDateDescriptor, pgTimetzColumn, pgUnboundedIntColumn, pgUuidColumn, pgVarbitColumn, pgVarcharColumn, placeholder, plainDateTimeNow, plainDateTimeNowControlDescriptor, planIssues, policyInputFromSerialized, postgresAggregateDescriptors, postgresCodec, postgresCodecDescriptorRegistry, postgresCodecRegistry, postgresCreateNamespace, postgresError, postgresRenderCheckExpressions, postgresRenderDefault, postgresResolveDefault, primaryKey, prisma7PostgresBinding, qualifyName, qualifyTableName, quoteIdentifier, quoteQualifiedName, rawSql, renderCallsToTypeScript, renderDefaultLiteral, renderOps, resolveDdlSchemaForNamespaceStorage, resolveIdentityValue, rlsEnabledAst, rlsPolicyExistsAst, tableExistsAst, tableIsEmptyAst, tablePrimaryKeyAst, text, textArray, timestamptz, timestamptzJsDate, toRegclass, unique, validateEnumValueLength };
@@ -1,4 +1,4 @@
1
- import { l as PostgresTableSource } from "./postgres-schema-PFL-fpel-s3InB8T0.mjs";
2
- import { A as toRegclass, D as tableExistsAst, E as rlsPolicyExistsAst, O as tableIsEmptyAst, T as rlsEnabledAst, a as columnDefaultAst, b as extensionExistsAst, c as columnTypeAst, f as createSchema, g as dropDefaultAction, i as alterTable, k as tablePrimaryKeyAst, l as constraintExistsAst, o as columnExistsAst, p as createTable, s as columnNullabilityAst, t as addColumnAction, w as noNullValuesAst, x as indexExistsAst } from "./ddl-CaKDvAty-sHOb0D92.mjs";
3
- import { a as jsonb, c as textArray, i as int8, l as timestamptz, n as buildSignMarkerBootstrapQueries, o as pgTable, r as int4, s as text, t as buildControlTableBootstrapQueries, u as timestamptzJsDate } from "./contract-free-DcfADfM5.mjs";
1
+ import { l as PostgresTableSource } from "./postgres-schema-VPEJqIX9-BBIMq9xs.mjs";
2
+ import { A as toRegclass, D as tableExistsAst, E as rlsPolicyExistsAst, O as tableIsEmptyAst, T as rlsEnabledAst, a as columnDefaultAst, b as extensionExistsAst, c as columnTypeAst, f as createSchema, g as dropDefaultAction, i as alterTable, k as tablePrimaryKeyAst, l as constraintExistsAst, o as columnExistsAst, p as createTable, s as columnNullabilityAst, t as addColumnAction, w as noNullValuesAst, x as indexExistsAst } from "./ddl-DxYRJ8hY-mFzFol6l.mjs";
3
+ import { a as jsonb, c as textArray, i as int8, l as timestamptz, n as buildSignMarkerBootstrapQueries, o as pgTable, r as int4, s as text, t as buildControlTableBootstrapQueries, u as timestamptzJsDate } from "./contract-free-CmBUYWYN.mjs";
4
4
  export { PostgresTableSource, addColumnAction, alterTable, buildControlTableBootstrapQueries, buildSignMarkerBootstrapQueries, columnDefaultAst, columnExistsAst, columnNullabilityAst, columnTypeAst, constraintExistsAst, createSchema, createTable, dropDefaultAction, extensionExistsAst, indexExistsAst, int4, int8, jsonb, noNullValuesAst, pgTable, rlsEnabledAst, rlsPolicyExistsAst, tableExistsAst, tableIsEmptyAst, tablePrimaryKeyAst, text, textArray, timestamptz, timestamptzJsDate, toRegclass };
@@ -1,4 +1,4 @@
1
- import { i as instantNowControlDescriptor, n as PLAIN_DATE_TIME_NOW_GENERATOR_ID, o as plainDateTimeNowControlDescriptor, t as INSTANT_NOW_GENERATOR_ID } from "./authoring-DhCDnK1T-CGirVrrH.mjs";
1
+ import { i as instantNowControlDescriptor, n as PLAIN_DATE_TIME_NOW_GENERATOR_ID, o as plainDateTimeNowControlDescriptor, t as INSTANT_NOW_GENERATOR_ID } from "./authoring-hMsx7htU-MzchK-oB.mjs";
2
2
  import { n as parsePostgresListText, t as decodePostgresListText } from "./list-decoder-DXee1orj-K3y-hxiI.mjs";
3
- import { n as postgresTargetDescriptor, t as postgresRenderDefault } from "./control-BIGO0LQ1.mjs";
3
+ import { n as postgresTargetDescriptor, t as postgresRenderDefault } from "./control-DUGbVzYt.mjs";
4
4
  export { INSTANT_NOW_GENERATOR_ID, PLAIN_DATE_TIME_NOW_GENERATOR_ID, decodePostgresListText, postgresTargetDescriptor as default, instantNowControlDescriptor, parsePostgresListText, plainDateTimeNowControlDescriptor, postgresRenderDefault };
@@ -1,2 +1,2 @@
1
- import { t as dataTransform } from "./data-transform-ChZzy2dP-CxVCat_8.mjs";
1
+ import { t as dataTransform } from "./data-transform-Bo32KRbq-BLn1_UG-.mjs";
2
2
  export { dataTransform };
@@ -1,2 +1,2 @@
1
- import { t as buildPostgresPlanDiff } from "./diff-database-schema-c9IWEO2V-DCnp7F4-.mjs";
1
+ import { t as buildPostgresPlanDiff } from "./diff-database-schema-BAiMsL_e-CTXBlIlV.mjs";
2
2
  export { buildPostgresPlanDiff };
@@ -1,2 +1,2 @@
1
- import { a as planIssues, t as coalesceSubtreeIssues } from "./control-policy-CkLZsw31-DjVVWnnz.mjs";
1
+ import { a as planIssues, t as coalesceSubtreeIssues } from "./control-policy-Bt4h9XRP-D286Iyv0.mjs";
2
2
  export { coalesceSubtreeIssues, planIssues };
@@ -1,5 +1,5 @@
1
- import { F as createExtension } from "./op-factory-call-Bp6F2UEs-Bze_DuAk.mjs";
2
- import { t as dataTransform } from "./data-transform-ChZzy2dP-CxVCat_8.mjs";
3
- import { t as PostgresMigration } from "./postgres-migration-BAGJ7FgH-4XbbekAu.mjs";
1
+ import { F as createExtension } from "./op-factory-call-BAtE9hKE-xuF-YyXB.mjs";
2
+ import { t as dataTransform } from "./data-transform-Bo32KRbq-BLn1_UG-.mjs";
3
+ import { t as PostgresMigration } from "./postgres-migration-DPD4Q7tc-CaWigdRj.mjs";
4
4
  import { a as foreignKey, c as primaryKey, i as fn, l as rawSql, n as checkExpression, o as lit, r as col, s as placeholder, t as MigrationCLI, u as unique } from "./migration-PTHAY9Cv.mjs";
5
5
  export { PostgresMigration as Migration, MigrationCLI, checkExpression, col, createExtension, dataTransform, fn, foreignKey, lit, placeholder, primaryKey, rawSql, unique };
@@ -1,2 +1,2 @@
1
- import { A as RenameIndexCall, C as DropNativeEnumTypeCall, D as EnableRowLevelSecurityCall, E as DropTableCall, M as SetDefaultCall, N as SetNotNullCall, O as RawSqlCall, S as DropIndexCall, T as DropPostgresRlsPolicyCall, _ as DisableRowLevelSecurityCall, b as DropConstraintCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, g as DataTransformCall, h as CreateTableCall, i as AddNativeEnumValueCall, j as RenamePostgresRlsPolicyCall, k as RenameCheckConstraintCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, o as AddNotNullColumnWithTempDefaultCall, p as CreatePostgresRlsPolicyCall, r as AddForeignKeyCall, s as AddPrimaryKeyCall, t as AddCheckConstraintCall, u as CreateExtensionCall, v as DropCheckConstraintCall, w as DropNotNullCall, x as DropDefaultCall, y as DropColumnCall } from "./op-factory-call-Bp6F2UEs-Bze_DuAk.mjs";
1
+ import { A as RenameIndexCall, C as DropNativeEnumTypeCall, D as EnableRowLevelSecurityCall, E as DropTableCall, M as SetDefaultCall, N as SetNotNullCall, O as RawSqlCall, S as DropIndexCall, T as DropPostgresRlsPolicyCall, _ as DisableRowLevelSecurityCall, b as DropConstraintCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, g as DataTransformCall, h as CreateTableCall, i as AddNativeEnumValueCall, j as RenamePostgresRlsPolicyCall, k as RenameCheckConstraintCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, o as AddNotNullColumnWithTempDefaultCall, p as CreatePostgresRlsPolicyCall, r as AddForeignKeyCall, s as AddPrimaryKeyCall, t as AddCheckConstraintCall, u as CreateExtensionCall, v as DropCheckConstraintCall, w as DropNotNullCall, x as DropDefaultCall, y as DropColumnCall } from "./op-factory-call-BAtE9hKE-xuF-YyXB.mjs";
2
2
  export { AddCheckConstraintCall, AddColumnCall, AddForeignKeyCall, AddNativeEnumValueCall, AddNotNullColumnWithTempDefaultCall, AddPrimaryKeyCall, AddUniqueCall, AlterColumnTypeCall, CreateExtensionCall, CreateIndexCall, CreateNativeEnumTypeCall, CreatePostgresRlsPolicyCall, CreateSchemaCall, CreateTableCall, DataTransformCall, DisableRowLevelSecurityCall, DropCheckConstraintCall, DropColumnCall, DropConstraintCall, DropDefaultCall, DropIndexCall, DropNativeEnumTypeCall, DropNotNullCall, DropPostgresRlsPolicyCall, DropTableCall, EnableRowLevelSecurityCall, RawSqlCall, RenameCheckConstraintCall, RenameIndexCall, RenamePostgresRlsPolicyCall, SetDefaultCall, SetNotNullCall };
@@ -1,2 +1,2 @@
1
- import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-CQMRNeLX-CF4MvmN_.mjs";
1
+ import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-D9xFYKRF-Dl74gakf.mjs";
2
2
  export { postgresTargetDescriptorMeta as default };
@@ -1,2 +1,2 @@
1
- import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-92hFiR1t-BxAT0uTi.mjs";
1
+ import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-BAH_r602-DSMj6CDP.mjs";
2
2
  export { TypeScriptRenderablePostgresMigration };
@@ -1,2 +1,2 @@
1
- import { n as qualifyTableName, t as buildExpectedFormatType } from "./planner-sql-checks-CaRMR5SA-DGYjc2Cy.mjs";
1
+ import { n as qualifyTableName, t as buildExpectedFormatType } from "./planner-sql-checks-wYIWo6ux-BCV1kDf6.mjs";
2
2
  export { buildExpectedFormatType, qualifyTableName };
@@ -1,3 +1,3 @@
1
- import { n as contractToPostgresDatabaseSchemaNode } from "./diff-database-schema-c9IWEO2V-DCnp7F4-.mjs";
2
- import { t as createPostgresMigrationPlanner } from "./planner-D9WzYlHl-CS_7pV8A.mjs";
1
+ import { n as contractToPostgresDatabaseSchemaNode } from "./diff-database-schema-BAiMsL_e-CTXBlIlV.mjs";
2
+ import { t as createPostgresMigrationPlanner } from "./planner-CeItKM-b-DiTSmKNl.mjs";
3
3
  export { contractToPostgresDatabaseSchemaNode, createPostgresMigrationPlanner };
@@ -1,2 +1,2 @@
1
- import { t as prisma7PostgresBinding } from "./prisma7-binding-BBC8EYpL.mjs";
1
+ import { t as prisma7PostgresBinding } from "./prisma7-binding-COPEubZc.mjs";
2
2
  export { prisma7PostgresBinding };
@@ -1,6 +1,6 @@
1
- import { a as plainDateTimeNow, n as PLAIN_DATE_TIME_NOW_GENERATOR_ID, r as instantNow, t as INSTANT_NOW_GENERATOR_ID } from "./authoring-DhCDnK1T-CGirVrrH.mjs";
1
+ import { a as plainDateTimeNow, n as PLAIN_DATE_TIME_NOW_GENERATOR_ID, r as instantNow, t as INSTANT_NOW_GENERATOR_ID } from "./authoring-hMsx7htU-MzchK-oB.mjs";
2
2
  import { t as postgresTargetDescriptorMetaRuntime } from "./descriptor-meta-runtime-UwYdV8fD-B_m_Ha8r.mjs";
3
- import { n as PostgresContractView, t as PostgresContractSerializer } from "./postgres-contract-view-BPe8r8jN-DrorQoWW.mjs";
3
+ import { n as PostgresContractView, t as PostgresContractSerializer } from "./postgres-contract-view-eySKTszQ-CtakBpl3.mjs";
4
4
  import { t as decodePostgresListText } from "./list-decoder-DXee1orj-K3y-hxiI.mjs";
5
5
  //#region ../../../3-targets/3-targets/postgres/dist/runtime.mjs
6
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"target__runtime.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/runtime.mjs"],"sourcesContent":["import { c as PLAIN_DATE_TIME_NOW_GENERATOR_ID, d as INSTANT_NOW_GENERATOR_ID, f as instantNow, l as plainDateTimeNow } from \"./authoring-DhCDnK1T.mjs\";\nimport { t as postgresTargetDescriptorMetaRuntime } from \"./descriptor-meta-runtime-UwYdV8fD.mjs\";\nimport { n as PostgresContractSerializer, t as PostgresContractView } from \"./postgres-contract-view-BPe8r8jN.mjs\";\nimport { t as decodePostgresListText } from \"./list-decoder-DXee1orj.mjs\";\n//#region src/exports/runtime.ts\n/**\n* Target-postgres deliberately does NOT import `SqlRuntimeTargetDescriptor` from `@internal/sql-runtime`. The target package is a control-plane residence and must not pull the SQL execution-plane package into its dependency closure. The runtime descriptor here is shaped to satisfy the framework's `RuntimeTargetDescriptor` plus the structural `SqlStaticContributions` (`codecs:` returning a descriptor list) that\n* `@internal/sql-runtime` consumers narrow to at composition time.\n*\n* The target itself contributes no codecs — postgres-specific codecs ship from the postgres adapter and from extension packs (pgvector, arktype-json, etc.).\n*/\nconst postgresRuntimeTargetDescriptor = {\n\t...postgresTargetDescriptorMetaRuntime,\n\tcodecs: () => [],\n\tlistDecoder: () => decodePostgresListText,\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"postgres\"\n\t\t};\n\t}\n};\n//#endregion\nexport { INSTANT_NOW_GENERATOR_ID, PLAIN_DATE_TIME_NOW_GENERATOR_ID, PostgresContractSerializer, PostgresContractView, decodePostgresListText, postgresRuntimeTargetDescriptor as default, instantNow, plainDateTimeNow };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;;;AAWA,MAAM,kCAAkC;CACvC,GAAG;CACH,cAAc,CAAC;CACf,mBAAmB;CACnB,SAAS;EACR,OAAO;GACN,UAAU;GACV,UAAU;EACX;CACD;AACD"}
1
+ {"version":3,"file":"target__runtime.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/runtime.mjs"],"sourcesContent":["import { c as PLAIN_DATE_TIME_NOW_GENERATOR_ID, d as INSTANT_NOW_GENERATOR_ID, f as instantNow, l as plainDateTimeNow } from \"./authoring-hMsx7htU.mjs\";\nimport { t as postgresTargetDescriptorMetaRuntime } from \"./descriptor-meta-runtime-UwYdV8fD.mjs\";\nimport { n as PostgresContractSerializer, t as PostgresContractView } from \"./postgres-contract-view-eySKTszQ.mjs\";\nimport { t as decodePostgresListText } from \"./list-decoder-DXee1orj.mjs\";\n//#region src/exports/runtime.ts\n/**\n* Target-postgres deliberately does NOT import `SqlRuntimeTargetDescriptor` from `@internal/sql-runtime`. The target package is a control-plane residence and must not pull the SQL execution-plane package into its dependency closure. The runtime descriptor here is shaped to satisfy the framework's `RuntimeTargetDescriptor` plus the structural `SqlStaticContributions` (`codecs:` returning a descriptor list) that\n* `@internal/sql-runtime` consumers narrow to at composition time.\n*\n* The target itself contributes no codecs — postgres-specific codecs ship from the postgres adapter and from extension packs (pgvector, arktype-json, etc.).\n*/\nconst postgresRuntimeTargetDescriptor = {\n\t...postgresTargetDescriptorMetaRuntime,\n\tcodecs: () => [],\n\tlistDecoder: () => decodePostgresListText,\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"postgres\"\n\t\t};\n\t}\n};\n//#endregion\nexport { INSTANT_NOW_GENERATOR_ID, PLAIN_DATE_TIME_NOW_GENERATOR_ID, PostgresContractSerializer, PostgresContractView, decodePostgresListText, postgresRuntimeTargetDescriptor as default, instantNow, plainDateTimeNow };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;;;AAWA,MAAM,kCAAkC;CACvC,GAAG;CACH,cAAc,CAAC;CACf,mBAAmB;CACnB,SAAS;EACR,OAAO;GACN,UAAU;GACV,UAAU;EACX;CACD;AACD"}
@@ -1,2 +1,2 @@
1
- import { t as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-DoVk6G3i-D6YoWjC9.mjs";
1
+ import { t as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-DFOTYsNN-AVDEd24I.mjs";
2
2
  export { resolveDdlSchemaForNamespaceStorage };
@@ -1,5 +1,5 @@
1
1
  import { t as PostgresNativeEnum } from "./postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs";
2
- import { c as PostgresSchema, d as isPostgresSchema, h as postgresCreateNamespace, i as PostgresRlsPolicy, m as policyInputFromSerialized, n as PostgresRlsEnablement, o as PostgresRole, u as PostgresUnboundSchema } from "./postgres-schema-PFL-fpel-s3InB8T0.mjs";
2
+ import { c as PostgresSchema, d as isPostgresSchema, h as postgresCreateNamespace, i as PostgresRlsPolicy, m as policyInputFromSerialized, n as PostgresRlsEnablement, o as PostgresRole, u as PostgresUnboundSchema } from "./postgres-schema-VPEJqIX9-BBIMq9xs.mjs";
3
3
  import { t as postgresRenderCheckExpressions } from "./check-expressions-DFTeR0rd-CSxSpyMV.mjs";
4
4
  import { n as PostgresSchemaNodeKind, r as PostgresTableSchemaNode, t as PostgresNativeEnumSchemaNode } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
5
5
  import { i as PostgresRoleSchemaNode, n as PostgresNamespaceSchemaNode, r as PostgresPolicySchemaNode, t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/orm-target-postgres",
3
- "version": "8.0.0-rc.11-dev.32",
3
+ "version": "8.0.0-rc.11-dev.34",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -9,9 +9,9 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@prisma/orm-family-sql": "8.0.0-rc.11-dev.32",
13
- "@prisma/orm-framework": "8.0.0-rc.11-dev.32",
14
- "@prisma/orm-toolchain": "8.0.0-rc.11-dev.32",
12
+ "@prisma/orm-family-sql": "8.0.0-rc.11-dev.34",
13
+ "@prisma/orm-framework": "8.0.0-rc.11-dev.34",
14
+ "@prisma/orm-toolchain": "8.0.0-rc.11-dev.34",
15
15
  "@standard-schema/spec": "^1.1.0",
16
16
  "@types/node": "26.1.2",
17
17
  "@types/pg": "8.20.4",
@@ -22,11 +22,11 @@
22
22
  "postgres-array": "2.0.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@internal/adapter-postgres": "8.0.0-rc.11-dev.32",
26
- "@internal/driver-postgres": "8.0.0-rc.11-dev.32",
27
- "@internal/target-postgres": "8.0.0-rc.11-dev.32",
28
- "@repo/tsconfig": "8.0.0-rc.11-dev.32",
29
- "@repo/tsdown": "8.0.0-rc.11-dev.32",
25
+ "@internal/adapter-postgres": "8.0.0-rc.11-dev.34",
26
+ "@internal/driver-postgres": "8.0.0-rc.11-dev.34",
27
+ "@internal/target-postgres": "8.0.0-rc.11-dev.34",
28
+ "@repo/tsconfig": "8.0.0-rc.11-dev.34",
29
+ "@repo/tsdown": "8.0.0-rc.11-dev.34",
30
30
  "tsdown": "0.22.14",
31
31
  "typescript": "5.9.3",
32
32
  "vitest": "5.0.0-rc.2"
@@ -1 +0,0 @@
1
- {"version":3,"file":"control-BIGO0LQ1.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/control.mjs"],"sourcesContent":["import { s as postgresError } from \"./errors-DYyzTYzE.mjs\";\nimport { n as postgresResolveDefault } from \"./default-normalizer-Bjtm2F4f.mjs\";\nimport { c as PLAIN_DATE_TIME_NOW_GENERATOR_ID, d as INSTANT_NOW_GENERATOR_ID, p as instantNowControlDescriptor, u as plainDateTimeNowControlDescriptor } from \"./authoring-DhCDnK1T.mjs\";\nimport { t as postgresTargetDescriptorMeta } from \"./descriptor-meta-CQMRNeLX.mjs\";\nimport { a as postgresDiffSubjectGranularity, i as postgresDiffSubjectEntityKind } from \"./postgres-table-schema-node-BBkitBQh.mjs\";\nimport { i as PostgresDatabaseSchemaNode } from \"./postgres-role-schema-node-B8Z5i5D-.mjs\";\nimport { n as diffPostgresSchema, r as contractToPostgresDatabaseSchemaNode } from \"./diff-database-schema-c9IWEO2V.mjs\";\nimport { r as renderDefaultLiteral } from \"./planner-ddl-builders-DTCYp-qA.mjs\";\nimport { n as PostgresContractSerializer } from \"./postgres-contract-view-BPe8r8jN.mjs\";\nimport { t as createPostgresMigrationPlanner } from \"./planner-D9WzYlHl.mjs\";\nimport { n as inferPostgresPslContract } from \"./infer-psl-contract-CBsWEERT.mjs\";\nimport { n as parsePostgresListText, t as decodePostgresListText } from \"./list-decoder-DXee1orj.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { buildNativeTypeExpander, runnerFailure, runnerSuccess } from \"@internal/family-sql/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { notOk, ok, okVoid } from \"@internal/utils/result\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { SqlSchemaVerifierBase } from \"@internal/family-sql/ir\";\nimport { SqlQueryError } from \"@internal/sql-errors\";\n//#region src/core/migrations/runner.ts\nconst LOCK_DOMAIN = \"prisma_8.contract.marker\";\n/**\n* Deep clones and freezes a record object to prevent mutation.\n* Recursively clones nested objects and arrays to ensure complete isolation.\n*/\nfunction cloneAndFreezeRecord(value) {\n\tconst cloned = {};\n\tfor (const [key, val] of Object.entries(value)) if (val === null || val === void 0) cloned[key] = val;\n\telse if (Array.isArray(val)) cloned[key] = Object.freeze([...val]);\n\telse if (typeof val === \"object\") cloned[key] = cloneAndFreezeRecord(val);\n\telse cloned[key] = val;\n\treturn Object.freeze(cloned);\n}\nfunction createPostgresMigrationRunner(family) {\n\treturn new PostgresMigrationRunner(family);\n}\nvar PostgresMigrationRunner = class {\n\tfamily;\n\tconstructor(family) {\n\t\tthis.family = family;\n\t}\n\t/**\n\t* Body of the migration runner without transaction management. The\n\t* caller ({@link PostgresMigrationRunner.execute}) owns the\n\t* `BEGIN`/`COMMIT`/`ROLLBACK` lifecycle.\n\t*/\n\tasync executeOnConnection(options) {\n\t\tconst schema = options.schemaName ?? Object.keys(options.destinationContract.storage.namespaces).find((id) => id !== UNBOUND_NAMESPACE_ID) ?? UNBOUND_NAMESPACE_ID;\n\t\tconst driver = options.driver;\n\t\tif (options.space !== void 0 && options.space !== options.plan.spaceId) throw postgresError(\"MIGRATION.CONTRACT_SPACE_VIOLATION\", `SqlMigrationRunner: options.space (${options.space}) does not match plan.spaceId (${options.plan.spaceId})`, { meta: {\n\t\t\tspace: options.space,\n\t\t\tplanSpaceId: options.plan.spaceId\n\t\t} });\n\t\tconst space = options.plan.spaceId;\n\t\tconst lockKey = `${LOCK_DOMAIN}:${schema}:${space}`;\n\t\tconst planOps = blindCast(await Promise.all(options.plan.operations));\n\t\tconst destinationCheck = this.ensurePlanMatchesDestinationContract(options.plan.destination, options.destinationContract);\n\t\tif (!destinationCheck.ok) return destinationCheck;\n\t\tconst policyCheck = this.enforcePolicyCompatibility(options.policy, planOps);\n\t\tif (!policyCheck.ok) return policyCheck;\n\t\tawait this.acquireLock(driver, lockKey);\n\t\tconst ensureResult = await this.ensureControlTables(driver, options.destinationContract);\n\t\tif (!ensureResult.ok) return ensureResult;\n\t\tconst existingMarker = await this.family.readMarker({\n\t\t\tdriver,\n\t\t\tspace\n\t\t});\n\t\tconst markerCheck = this.ensureMarkerCompatibility(existingMarker, options.plan);\n\t\tif (!markerCheck.ok) return markerCheck;\n\t\tconst markerAtDestination = this.markerMatchesDestination(existingMarker, options.plan);\n\t\tconst isSelfEdge = options.plan.origin?.storageHash === options.plan.destination.storageHash;\n\t\tconst skipOperations = markerAtDestination && options.plan.origin != null && !isSelfEdge;\n\t\tlet applyValue;\n\t\tif (skipOperations) applyValue = {\n\t\t\toperationsExecuted: 0,\n\t\t\texecutedOperations: []\n\t\t};\n\t\telse {\n\t\t\tconst applyResult = await this.applyPlan(driver, options, planOps);\n\t\t\tif (!applyResult.ok) return applyResult;\n\t\t\tapplyValue = applyResult.value;\n\t\t}\n\t\tif (space === APP_SPACE_ID) {\n\t\t\tconst schemaNode = await this.family.introspect({\n\t\t\t\tdriver,\n\t\t\t\tcontract: options.destinationContract\n\t\t\t});\n\t\t\tconst schemaVerifyResult = this.family.verifySchema({\n\t\t\t\tcontract: options.destinationContract,\n\t\t\t\tschema: schemaNode,\n\t\t\t\tstrict: options.strictVerification ?? true,\n\t\t\t\tframeworkComponents: options.frameworkComponents\n\t\t\t});\n\t\t\tif (!schemaVerifyResult.ok) return runnerFailure(\"MIGRATION.SCHEMA_VERIFY_FAILED\", schemaVerifyResult.summary, {\n\t\t\t\twhy: \"The resulting database schema does not satisfy the destination contract.\",\n\t\t\t\tmeta: { issues: schemaVerifyResult.schema.issues }\n\t\t\t});\n\t\t}\n\t\tconst incomingInvariants = options.plan.providedInvariants ?? [];\n\t\tconst existingInvariants = new Set(existingMarker?.invariants ?? []);\n\t\tconst incomingIsSubsetOfExisting = incomingInvariants.every((id) => existingInvariants.has(id));\n\t\tif (!(isSelfEdge && applyValue.operationsExecuted === 0 && incomingIsSubsetOfExisting)) {\n\t\t\tconst markerResult = await this.upsertMarker(driver, options, existingMarker, space);\n\t\t\tif (!markerResult.ok) return markerResult;\n\t\t\tawait this.recordLedgerEntries(driver, options, applyValue.executedOperations, planOps.length);\n\t\t}\n\t\treturn runnerSuccess({\n\t\t\toperationsPlanned: planOps.length,\n\t\t\toperationsExecuted: applyValue.operationsExecuted\n\t\t});\n\t}\n\tasync execute(options) {\n\t\tconst driver = options.driver;\n\t\tconst perSpaceOptions = options.perSpaceOptions;\n\t\tif (perSpaceOptions.length === 0) return ok({ perSpaceResults: [] });\n\t\tawait this.beginTransaction(driver);\n\t\tlet committed = false;\n\t\ttry {\n\t\t\tconst perSpaceResults = [];\n\t\t\tfor (const spaceOptions of perSpaceOptions) {\n\t\t\t\tconst space = spaceOptions.space ?? spaceOptions.plan.spaceId;\n\t\t\t\tconst result = await this.executeOnConnection({\n\t\t\t\t\t...spaceOptions,\n\t\t\t\t\tdriver,\n\t\t\t\t\tspace\n\t\t\t\t});\n\t\t\t\tif (!result.ok) return notOk({\n\t\t\t\t\t...result.failure,\n\t\t\t\t\tfailingSpace: space\n\t\t\t\t});\n\t\t\t\tperSpaceResults.push({\n\t\t\t\t\tspace,\n\t\t\t\t\tvalue: result.value\n\t\t\t\t});\n\t\t\t}\n\t\t\tawait this.commitTransaction(driver);\n\t\t\tcommitted = true;\n\t\t\treturn ok({ perSpaceResults });\n\t\t} finally {\n\t\t\tif (!committed) await this.rollbackTransaction(driver);\n\t\t}\n\t}\n\tasync applyPlan(driver, options, ops) {\n\t\tconst checks = options.executionChecks;\n\t\tconst runPrechecks = checks?.prechecks !== false;\n\t\tconst runPostchecks = checks?.postchecks !== false;\n\t\tconst runIdempotency = checks?.idempotencyChecks !== false;\n\t\tlet operationsExecuted = 0;\n\t\tconst executedOperations = [];\n\t\tfor (const operation of ops) {\n\t\t\toptions.callbacks?.onOperationStart?.(operation);\n\t\t\ttry {\n\t\t\t\tif (runPostchecks && runIdempotency) {\n\t\t\t\t\tif (await this.expectationsAreSatisfied(driver, operation.postcheck)) {\n\t\t\t\t\t\texecutedOperations.push(this.createPostcheckPreSatisfiedSkipRecord(operation));\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (runPrechecks) {\n\t\t\t\t\tconst precheckResult = await this.runExpectationSteps(driver, operation.precheck, operation, \"precheck\");\n\t\t\t\t\tif (!precheckResult.ok) return precheckResult;\n\t\t\t\t}\n\t\t\t\tconst executeResult = await this.runExecuteSteps(driver, operation.execute, operation);\n\t\t\t\tif (!executeResult.ok) return executeResult;\n\t\t\t\tif (runPostchecks) {\n\t\t\t\t\tconst postcheckResult = await this.runExpectationSteps(driver, operation.postcheck, operation, \"postcheck\");\n\t\t\t\t\tif (!postcheckResult.ok) return postcheckResult;\n\t\t\t\t}\n\t\t\t\texecutedOperations.push(operation);\n\t\t\t\toperationsExecuted += 1;\n\t\t\t} finally {\n\t\t\t\toptions.callbacks?.onOperationComplete?.(operation);\n\t\t\t}\n\t\t}\n\t\treturn ok({\n\t\t\toperationsExecuted,\n\t\t\texecutedOperations\n\t\t});\n\t}\n\tasync ensureControlTables(driver, contract) {\n\t\tconst lowererContext = { contract };\n\t\tconst [schemaQuery, ...tableQueries] = this.family.bootstrapControlTableQueries();\n\t\tif (schemaQuery === void 0) throw new InternalError(\"Postgres control-table bootstrap must include CREATE SCHEMA\");\n\t\tawait this.executeStatement(driver, await this.family.lowerAst(schemaQuery, lowererContext));\n\t\tconst legacyDetection = await this.detectLegacyMarkerShape(driver);\n\t\tif (!legacyDetection.ok) return legacyDetection;\n\t\tfor (const query of tableQueries) await this.executeStatement(driver, await this.family.lowerAst(query, lowererContext));\n\t\treturn okVoid();\n\t}\n\tasync detectLegacyMarkerShape(driver) {\n\t\tconst result = await driver.query(`select column_name\n from information_schema.columns\n where table_schema = 'prisma_contract'\n and table_name = 'marker'`);\n\t\tif (result.rows.length === 0) return okVoid();\n\t\tconst columns = new Set(result.rows.map((row) => row.column_name));\n\t\tif (columns.has(\"space\")) return okVoid();\n\t\treturn runnerFailure(\"MIGRATION.LEGACY_MARKER_SHAPE\", \"Legacy marker-table shape detected on prisma_contract.marker (no `space` column). Prisma 8 is in pre-1.0; the previous transitional auto-migration to the per-space-row schema has been removed. Drop `prisma_contract.marker` and re-run `dbInit` to reinitialise from a clean baseline.\", { meta: {\n\t\t\ttable: \"prisma_contract.marker\",\n\t\t\tcolumns: [...columns].sort()\n\t\t} });\n\t}\n\tasync runExpectationSteps(driver, steps, operation, phase) {\n\t\tfor (const step of steps) {\n\t\t\tconst result = await driver.query(step.sql, step.params ?? []);\n\t\t\tif (!this.stepResultIsTrue(result.rows)) return runnerFailure(phase === \"precheck\" ? \"MIGRATION.PRECHECK_FAILED\" : \"MIGRATION.POSTCHECK_FAILED\", `Operation ${operation.id} failed during ${phase}: ${step.description}`, { meta: {\n\t\t\t\toperationId: operation.id,\n\t\t\t\tphase,\n\t\t\t\tstepDescription: step.description\n\t\t\t} });\n\t\t}\n\t\treturn okVoid();\n\t}\n\tasync runExecuteSteps(driver, steps, operation) {\n\t\tfor (const step of steps) try {\n\t\t\tawait driver.query(step.sql, step.params ?? []);\n\t\t} catch (error) {\n\t\t\tif (SqlQueryError.is(error)) return runnerFailure(\"MIGRATION.EXECUTION_FAILED\", `Operation ${operation.id} failed during execution: ${step.description}`, {\n\t\t\t\twhy: error.message,\n\t\t\t\tmeta: {\n\t\t\t\t\toperationId: operation.id,\n\t\t\t\t\tstepDescription: step.description,\n\t\t\t\t\tsql: step.sql,\n\t\t\t\t\tsqlState: error.sqlState,\n\t\t\t\t\tconstraint: error.constraint,\n\t\t\t\t\ttable: error.table,\n\t\t\t\t\tcolumn: error.column,\n\t\t\t\t\tdetail: error.detail\n\t\t\t\t}\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t\treturn okVoid();\n\t}\n\tstepResultIsTrue(rows) {\n\t\tif (!rows || rows.length === 0) return false;\n\t\tconst firstRow = rows[0];\n\t\tconst firstValue = firstRow ? Object.values(firstRow)[0] : void 0;\n\t\tif (typeof firstValue === \"boolean\") return firstValue;\n\t\tif (typeof firstValue === \"number\") return firstValue !== 0;\n\t\tif (typeof firstValue === \"string\") {\n\t\t\tconst lower = firstValue.toLowerCase();\n\t\t\tif (lower === \"t\" || lower === \"true\" || lower === \"1\") return true;\n\t\t\tif (lower === \"f\" || lower === \"false\" || lower === \"0\") return false;\n\t\t\treturn firstValue.length > 0;\n\t\t}\n\t\treturn Boolean(firstValue);\n\t}\n\tasync expectationsAreSatisfied(driver, steps) {\n\t\tif (steps.length === 0) return false;\n\t\tfor (const step of steps) {\n\t\t\tconst result = await driver.query(step.sql, step.params ?? []);\n\t\t\tif (!this.stepResultIsTrue(result.rows)) return false;\n\t\t}\n\t\treturn true;\n\t}\n\tcreatePostcheckPreSatisfiedSkipRecord(operation) {\n\t\tconst clonedMeta = operation.meta ? cloneAndFreezeRecord(operation.meta) : void 0;\n\t\tconst runnerMeta = Object.freeze({\n\t\t\tskipped: true,\n\t\t\treason: \"postcheck_pre_satisfied\"\n\t\t});\n\t\tconst mergedMeta = Object.freeze({\n\t\t\t...clonedMeta ?? {},\n\t\t\trunner: runnerMeta\n\t\t});\n\t\tconst frozenPostcheck = Object.freeze([...operation.postcheck]);\n\t\treturn Object.freeze({\n\t\t\tid: operation.id,\n\t\t\tlabel: operation.label,\n\t\t\t...ifDefined(\"summary\", operation.summary),\n\t\t\toperationClass: operation.operationClass,\n\t\t\ttarget: operation.target,\n\t\t\tprecheck: Object.freeze([]),\n\t\t\texecute: Object.freeze([]),\n\t\t\tpostcheck: frozenPostcheck,\n\t\t\t...ifDefined(\"meta\", operation.meta || mergedMeta ? mergedMeta : void 0)\n\t\t});\n\t}\n\tmarkerMatchesDestination(marker, plan) {\n\t\tif (!marker) return false;\n\t\tif (marker.storageHash !== plan.destination.storageHash) return false;\n\t\tif (plan.destination.profileHash && marker.profileHash !== plan.destination.profileHash) return false;\n\t\treturn true;\n\t}\n\tenforcePolicyCompatibility(policy, operations) {\n\t\tconst allowedClasses = new Set(policy.allowedOperationClasses);\n\t\tfor (const operation of operations) if (!allowedClasses.has(operation.operationClass)) return runnerFailure(\"MIGRATION.POLICY_VIOLATION\", `Operation ${operation.id} has class \"${operation.operationClass}\" which is not allowed by policy.`, {\n\t\t\twhy: `Policy only allows: ${policy.allowedOperationClasses.join(\", \")}.`,\n\t\t\tmeta: {\n\t\t\t\toperationId: operation.id,\n\t\t\t\toperationClass: operation.operationClass,\n\t\t\t\tallowedClasses: policy.allowedOperationClasses\n\t\t\t}\n\t\t});\n\t\treturn okVoid();\n\t}\n\tensureMarkerCompatibility(marker, plan) {\n\t\tconst origin = plan.origin ?? null;\n\t\tif (!origin) return okVoid();\n\t\tif (!marker) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Missing contract marker: expected origin storage hash ${origin.storageHash}.`, { meta: { expectedOriginStorageHash: origin.storageHash } });\n\t\tif (marker.storageHash !== origin.storageHash) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Existing contract marker (${marker.storageHash}) does not match plan origin (${origin.storageHash}).`, { meta: {\n\t\t\tmarkerStorageHash: marker.storageHash,\n\t\t\texpectedOriginStorageHash: origin.storageHash\n\t\t} });\n\t\tif (origin.profileHash && marker.profileHash !== origin.profileHash) return runnerFailure(\"MIGRATION.MARKER_ORIGIN_MISMATCH\", `Existing contract marker profile hash (${marker.profileHash}) does not match plan origin profile hash (${origin.profileHash}).`, { meta: {\n\t\t\tmarkerProfileHash: marker.profileHash,\n\t\t\texpectedOriginProfileHash: origin.profileHash\n\t\t} });\n\t\treturn okVoid();\n\t}\n\tensurePlanMatchesDestinationContract(destination, contract) {\n\t\tif (destination.storageHash !== contract.storage.storageHash) return runnerFailure(\"MIGRATION.DESTINATION_CONTRACT_MISMATCH\", `Plan destination storage hash (${destination.storageHash}) does not match provided contract storage hash (${contract.storage.storageHash}).`, { meta: {\n\t\t\tplanStorageHash: destination.storageHash,\n\t\t\tcontractStorageHash: contract.storage.storageHash\n\t\t} });\n\t\tif (destination.profileHash && contract.profileHash && destination.profileHash !== contract.profileHash) return runnerFailure(\"MIGRATION.DESTINATION_CONTRACT_MISMATCH\", `Plan destination profile hash (${destination.profileHash}) does not match provided contract profile hash (${contract.profileHash}).`, { meta: {\n\t\t\tplanProfileHash: destination.profileHash,\n\t\t\tcontractProfileHash: contract.profileHash\n\t\t} });\n\t\treturn okVoid();\n\t}\n\tasync upsertMarker(driver, options, existingMarker, space) {\n\t\tconst destination = {\n\t\t\tstorageHash: options.plan.destination.storageHash,\n\t\t\tprofileHash: options.plan.destination.profileHash ?? options.destinationContract.profileHash ?? options.plan.destination.storageHash,\n\t\t\tinvariants: options.plan.providedInvariants ?? []\n\t\t};\n\t\tif (!existingMarker) {\n\t\t\tawait this.family.initMarker({\n\t\t\t\tdriver,\n\t\t\t\tspace,\n\t\t\t\tdestination\n\t\t\t});\n\t\t\treturn okVoid();\n\t\t}\n\t\tif (!await this.family.updateMarker({\n\t\t\tdriver,\n\t\t\tspace,\n\t\t\texpectedFrom: existingMarker.storageHash,\n\t\t\tdestination\n\t\t})) return runnerFailure(\"MIGRATION.MARKER_CAS_FAILURE\", \"Marker was modified by another process during migration execution.\", { meta: {\n\t\t\tspace,\n\t\t\texpectedStorageHash: existingMarker.storageHash,\n\t\t\tdestinationStorageHash: options.plan.destination.storageHash\n\t\t} });\n\t\treturn okVoid();\n\t}\n\tasync recordLedgerEntries(driver, options, executedOperations, planOpsLength) {\n\t\tconst space = options.plan.spaceId;\n\t\tconst edges = options.migrationEdges;\n\t\tconst totalEdgeOps = edges.reduce((sum, edge) => sum + edge.operationCount, 0);\n\t\tif (totalEdgeOps !== planOpsLength) throw new InternalError(`Ledger write: plan.operations length (${planOpsLength}) does not match sum of migrationEdges operationCount (${totalEdgeOps})`);\n\t\tlet offset = 0;\n\t\tfor (const edge of edges) {\n\t\t\tconst edgeOps = executedOperations.slice(offset, offset + edge.operationCount);\n\t\t\toffset += edge.operationCount;\n\t\t\tawait this.family.writeLedgerEntry({\n\t\t\t\tdriver,\n\t\t\t\tspace,\n\t\t\t\tentry: {\n\t\t\t\t\tedgeId: `${edge.from}->${edge.to}`,\n\t\t\t\t\tfrom: edge.from,\n\t\t\t\t\tto: edge.to,\n\t\t\t\t\tmigrationName: edge.dirName,\n\t\t\t\t\tmigrationHash: edge.migrationHash,\n\t\t\t\t\toperations: edgeOps,\n\t\t\t\t\t...ifDefined(\"destinationContractJson\", edge.destinationContractJson)\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\tasync acquireLock(driver, key) {\n\t\tawait driver.query(\"select pg_advisory_xact_lock(hashtext($1))\", [key]);\n\t}\n\tasync beginTransaction(driver) {\n\t\tawait driver.query(\"BEGIN\");\n\t}\n\tasync commitTransaction(driver) {\n\t\tawait driver.query(\"COMMIT\");\n\t}\n\tasync rollbackTransaction(driver) {\n\t\tawait driver.query(\"ROLLBACK\");\n\t}\n\tasync executeStatement(driver, statement) {\n\t\tawait driver.query(statement.sql, statement.params);\n\t}\n};\n//#endregion\n//#region src/core/postgres-schema-verifier.ts\n/**\n* Postgres target `SchemaVerifier` concretion. Plugs into the\n* SQL-shared verification surface; production verification today still\n* routes through the family verify verdict (`verifySqlSchemaByDiff` over\n* `diffPostgresSchema`), which carries options (codec hooks,\n* normalizers, framework components) that the framework-level\n* `SchemaVerifyOptions` shape does not yet surface.\n*\n* The hooks return the empty list pending the call-site migration that\n* routes the existing verifier behaviour through the SPI — at that\n* point `verifyCommonSqlSchema` will likely lift onto the family base\n* (mirroring `verifyCommonMongoSchema`) and `verifyTargetExtensions`\n* will house Postgres-only kinds (functions, RLS policies in a future\n* project).\n*/\nvar PostgresSchemaVerifier = class extends SqlSchemaVerifierBase {\n\tverifyCommonSqlSchema(_options) {\n\t\treturn [];\n\t}\n\tverifyTargetExtensions(_options) {\n\t\treturn [];\n\t}\n};\n//#endregion\n//#region src/exports/control.ts\nfunction postgresRenderDefault(def, column) {\n\tif (def.kind === \"function\") return def.expression;\n\treturn renderDefaultLiteral(def.value, column);\n}\nconst postgresTargetDescriptor = {\n\t...postgresTargetDescriptorMeta,\n\tcontractSerializer: new PostgresContractSerializer(),\n\tschemaVerifier: new PostgresSchemaVerifier(),\n\tinferPslContract(schema, describedContracts) {\n\t\tPostgresDatabaseSchemaNode.assert(schema);\n\t\treturn inferPostgresPslContract(schema, describedContracts);\n\t},\n\tdiffSchema(input) {\n\t\treturn diffPostgresSchema(input);\n\t},\n\tclassifySubjectGranularity: postgresDiffSubjectGranularity,\n\tclassifyEntityKind: postgresDiffSubjectEntityKind,\n\tmigrations: {\n\t\tcreatePlanner(adapter) {\n\t\t\treturn createPostgresMigrationPlanner(adapter);\n\t\t},\n\t\tcreateRunner(family) {\n\t\t\treturn createPostgresMigrationRunner(family);\n\t\t},\n\t\tcontractToSchema(contract, frameworkComponents) {\n\t\t\tconst expander = buildNativeTypeExpander(frameworkComponents);\n\t\t\treturn contractToPostgresDatabaseSchemaNode(blindCast(contract), {\n\t\t\t\tannotationNamespace: \"pg\",\n\t\t\t\t...ifDefined(\"expandNativeType\", expander),\n\t\t\t\trenderDefault: postgresRenderDefault,\n\t\t\t\tresolveDefault: postgresResolveDefault\n\t\t\t});\n\t\t}\n\t},\n\tcreate() {\n\t\treturn {\n\t\t\tfamilyId: \"sql\",\n\t\t\ttargetId: \"postgres\"\n\t\t};\n\t},\n\t/**\n\t* Direct method for SQL-specific usage.\n\t* @deprecated Use migrations.createPlanner() for CLI compatibility.\n\t*/\n\tcreatePlanner(adapter) {\n\t\treturn createPostgresMigrationPlanner(adapter);\n\t},\n\t/**\n\t* Direct method for SQL-specific usage.\n\t* @deprecated Use migrations.createRunner() for CLI compatibility.\n\t*/\n\tcreateRunner(family) {\n\t\treturn createPostgresMigrationRunner(family);\n\t}\n};\n//#endregion\nexport { INSTANT_NOW_GENERATOR_ID, PLAIN_DATE_TIME_NOW_GENERATOR_ID, decodePostgresListText, postgresTargetDescriptor as default, instantNowControlDescriptor, parsePostgresListText, plainDateTimeNowControlDescriptor, postgresRenderDefault };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsBA,MAAM,cAAc;;;;;AAKpB,SAAS,qBAAqB,OAAO;CACpC,MAAM,SAAS,CAAC;CAChB,KAAK,MAAM,CAAC,KAAK,QAAQ,OAAO,QAAQ,KAAK,GAAG,IAAI,QAAQ,QAAQ,QAAQ,KAAK,GAAG,OAAO,OAAO;MAC7F,IAAI,MAAM,Q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