@prisma/orm-target-postgres 8.0.0-rc.19-dev.7 → 8.0.0-rc.19-dev.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-svGTIjA2-DDDsFolD.mjs → adapter-svGTIjA2-CtHa7kMs.mjs} +5 -5
- package/dist/{adapter-svGTIjA2-DDDsFolD.mjs.map → adapter-svGTIjA2-CtHa7kMs.mjs.map} +1 -1
- package/dist/adapter.mjs +4 -4
- package/dist/adapter__adapter.mjs +2 -2
- package/dist/adapter__control.mjs +3 -3
- package/dist/adapter__runtime.mjs +4 -4
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/{authoring-VPJEKQsx-B3xbnZ0h.mjs → authoring-SbdvmVJh-CgZp23qA.mjs} +4 -4
- package/dist/{authoring-VPJEKQsx-B3xbnZ0h.mjs.map → authoring-SbdvmVJh-CgZp23qA.mjs.map} +1 -1
- package/dist/{autoincrement-widths-O1bL_G0T-B7F3b4oU.mjs → autoincrement-widths-DonNJgfS-A-hWa3rO.mjs} +3 -3
- package/dist/{autoincrement-widths-O1bL_G0T-B7F3b4oU.mjs.map → autoincrement-widths-DonNJgfS-A-hWa3rO.mjs.map} +1 -1
- package/dist/{codec-descriptor-hKN22hwP-BypvXBN8.mjs → codec-descriptor-DoR-cTFZ-DKTk9Oxm.mjs} +3 -3
- package/dist/{codec-descriptor-hKN22hwP-BypvXBN8.mjs.map → codec-descriptor-DoR-cTFZ-DKTk9Oxm.mjs.map} +1 -1
- package/dist/{codec-registry-D-jIXuQB-XNXvqLOs.mjs → codec-registry-D7XslgPe-Gg6TMpPg.mjs} +5 -5
- package/dist/{codec-registry-D-jIXuQB-XNXvqLOs.mjs.map → codec-registry-D7XslgPe-Gg6TMpPg.mjs.map} +1 -1
- package/dist/{codecs-CI5UwRqu-CayL_h8W.mjs → codecs-CRl9-i_r-CTWJYxL0.mjs} +6 -7
- package/dist/codecs-CRl9-i_r-CTWJYxL0.mjs.map +1 -0
- package/dist/{contract-contributions-Xz2FpyfI-3anGCDno.mjs → contract-contributions-Xz2FpyfI-CZW0_mEj.mjs} +5 -5
- package/dist/{contract-contributions-Xz2FpyfI-3anGCDno.mjs.map → contract-contributions-Xz2FpyfI-CZW0_mEj.mjs.map} +1 -1
- package/dist/{control-policy-B5xybjfP-BzOX_BG7.mjs → control-policy-DzFOPk9n-BmAgBCQb.mjs} +8 -8
- package/dist/{control-policy-B5xybjfP-BzOX_BG7.mjs.map → control-policy-DzFOPk9n-BmAgBCQb.mjs.map} +1 -1
- package/dist/{data-type-entries-B7ROystY-Bb3OHfWo.mjs → data-type-entries-gQW3-KSb-uOS_mZiH.mjs} +4 -5
- package/dist/data-type-entries-gQW3-KSb-uOS_mZiH.mjs.map +1 -0
- package/dist/{data-types-pNqSURzU-D7jy77Ic.mjs → data-types-Chx0mjTP-Dy6isAwB.mjs} +10 -38
- package/dist/data-types-Chx0mjTP-Dy6isAwB.mjs.map +1 -0
- package/dist/{descriptor-meta-BkD3nXF_-CnmmCqRU.mjs → descriptor-meta-BkD3nXF_-NNc0jaU9.mjs} +3 -3
- package/dist/{descriptor-meta-BkD3nXF_-CnmmCqRU.mjs.map → descriptor-meta-BkD3nXF_-NNc0jaU9.mjs.map} +1 -1
- package/dist/{descriptor-meta-BC8Pg1Bl-BHgZYJCX.mjs → descriptor-meta-DBH6aAIM-Cm1rNZaF.mjs} +7 -7
- package/dist/{descriptor-meta-BC8Pg1Bl-BHgZYJCX.mjs.map → descriptor-meta-DBH6aAIM-Cm1rNZaF.mjs.map} +1 -1
- package/dist/{descriptor-meta-runtime-MeHMduyv-fTAvyjqM.mjs → descriptor-meta-runtime-Dft1L7eE-CUaKX_mx.mjs} +3 -3
- package/dist/{descriptor-meta-runtime-MeHMduyv-fTAvyjqM.mjs.map → descriptor-meta-runtime-Dft1L7eE-CUaKX_mx.mjs.map} +1 -1
- package/dist/{diff-database-schema-CnpMv6hw-Ddjwwt23.mjs → diff-database-schema-B1NfYBTr-DPdFDCpE.mjs} +3 -3
- package/dist/{diff-database-schema-CnpMv6hw-Ddjwwt23.mjs.map → diff-database-schema-B1NfYBTr-DPdFDCpE.mjs.map} +1 -1
- package/dist/{infer-psl-contract-DEHEkYxP-D1nRXaLH.mjs → infer-psl-contract-BSSHcuRi-DryV3wqN.mjs} +7 -7
- package/dist/{infer-psl-contract-DEHEkYxP-D1nRXaLH.mjs.map → infer-psl-contract-BSSHcuRi-DryV3wqN.mjs.map} +1 -1
- package/dist/migration-CbOh59ZJ.mjs.map +1 -1
- package/dist/{native-type-normalizer-B7L7_uaK.mjs → native-type-normalizer-B7ZQZOCb.mjs} +2 -2
- package/dist/{native-type-normalizer-B7L7_uaK.mjs.map → native-type-normalizer-B7ZQZOCb.mjs.map} +1 -1
- package/dist/{op-factory-call-Dg9wUfmo-OAo-HYAA.mjs → op-factory-call-ClvHxHDs-CeVV_tro.mjs} +4 -4
- package/dist/{op-factory-call-Dg9wUfmo-OAo-HYAA.mjs.map → op-factory-call-ClvHxHDs-CeVV_tro.mjs.map} +1 -1
- package/dist/{planner-D4CwrKzY-ClI8oVZM.mjs → planner-CvVTpZSI-Dkpd9l81.mjs} +7 -7
- package/dist/{planner-D4CwrKzY-ClI8oVZM.mjs.map → planner-CvVTpZSI-Dkpd9l81.mjs.map} +1 -1
- package/dist/{planner-ddl-builders-D7TKi2Cg-Bxxam4cQ.mjs → planner-ddl-builders-cYnH52gC-DaVKo24n.mjs} +3 -3
- package/dist/{planner-ddl-builders-D7TKi2Cg-Bxxam4cQ.mjs.map → planner-ddl-builders-cYnH52gC-DaVKo24n.mjs.map} +1 -1
- package/dist/{planner-identity-values-kXe6EviB-BfD5Gxo_.mjs → planner-identity-values-QstrMJ2U-Cb8Fdh_W.mjs} +3 -3
- package/dist/{planner-identity-values-kXe6EviB-BfD5Gxo_.mjs.map → planner-identity-values-QstrMJ2U-Cb8Fdh_W.mjs.map} +1 -1
- package/dist/{planner-produced-postgres-migration-CBA24iBB-CLmwH9md.mjs → planner-produced-postgres-migration-CGnbXiL_-Clhk4Jqj.mjs} +4 -4
- package/dist/{planner-produced-postgres-migration-CBA24iBB-CLmwH9md.mjs.map → planner-produced-postgres-migration-CGnbXiL_-Clhk4Jqj.mjs.map} +1 -1
- package/dist/{planner-sql-checks-DJ9RWk0S-DpNK0_as.mjs → planner-sql-checks-D-K44J19-BgZ15ipJ.mjs} +3 -3
- package/dist/{planner-sql-checks-DJ9RWk0S-DpNK0_as.mjs.map → planner-sql-checks-D-K44J19-BgZ15ipJ.mjs.map} +1 -1
- package/dist/{postgres-codec-traits-C8pMXZ1--D7uZOMyN.mjs → postgres-codec-traits-CnP5Bjxp-C8JED4J1.mjs} +3 -3
- package/dist/{postgres-codec-traits-C8pMXZ1--D7uZOMyN.mjs.map → postgres-codec-traits-CnP5Bjxp-C8JED4J1.mjs.map} +1 -1
- package/dist/{postgres-contract-view-DRppzflo-DxrBP7Tj.mjs → postgres-contract-view-BO2elRMz-K6dYYr20.mjs} +15 -8
- package/dist/postgres-contract-view-BO2elRMz-K6dYYr20.mjs.map +1 -0
- package/dist/{postgres-migration--GsVSHhN-wW4poHE7.mjs → postgres-migration-gIPIgR1z-CvKPHina.mjs} +8 -8
- package/dist/{postgres-migration--GsVSHhN-wW4poHE7.mjs.map → postgres-migration-gIPIgR1z-CvKPHina.mjs.map} +1 -1
- package/dist/{prisma7-binding-DsXmgX4b.mjs → prisma7-binding-TQ2GIDxX.mjs} +7 -7
- package/dist/{prisma7-binding-DsXmgX4b.mjs.map → prisma7-binding-TQ2GIDxX.mjs.map} +1 -1
- package/dist/{render-ops-BoFTJ9D1-BsFhuMdE.mjs → render-ops-DKPk74iS-Cfil02bJ.mjs} +3 -3
- package/dist/{render-ops-BoFTJ9D1-BsFhuMdE.mjs.map → render-ops-DKPk74iS-Cfil02bJ.mjs.map} +1 -1
- package/dist/{sql-renderer-BdWJPa5F-u46YBOY7.mjs → sql-renderer-BdWJPa5F-Q6M1dydc.mjs} +3 -3
- package/dist/{sql-renderer-BdWJPa5F-u46YBOY7.mjs.map → sql-renderer-BdWJPa5F-Q6M1dydc.mjs.map} +1 -1
- package/dist/target.mjs +20 -20
- package/dist/target__codec-descriptor.mjs +1 -1
- package/dist/target__codecs.mjs +2 -2
- package/dist/target__control.mjs +11 -11
- package/dist/target__control.mjs.map +1 -1
- package/dist/target__data-types.mjs +2 -2
- package/dist/target__diff-database-schema.mjs +1 -1
- package/dist/target__full-text-index-authoring.mjs +1 -1
- package/dist/target__issue-planner.mjs +1 -1
- package/dist/target__migration.mjs +2 -2
- package/dist/target__native-type-normalizer.mjs +1 -1
- package/dist/target__op-factory-call.mjs +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__planner-ddl-builders.mjs +1 -1
- package/dist/target__planner-identity-values.mjs +1 -1
- package/dist/target__planner-produced-postgres-migration.mjs +1 -1
- package/dist/target__planner-sql-checks.mjs +1 -1
- package/dist/target__planner.mjs +2 -2
- package/dist/target__prisma7-binding.mjs +1 -1
- package/dist/target__render-ops.mjs +1 -1
- package/dist/target__runtime.mjs +4 -4
- package/dist/target__runtime.mjs.map +1 -1
- package/package.json +9 -9
- package/dist/codecs-CI5UwRqu-CayL_h8W.mjs.map +0 -1
- package/dist/data-type-entries-B7ROystY-Bb3OHfWo.mjs.map +0 -1
- package/dist/data-types-pNqSURzU-D7jy77Ic.mjs.map +0 -1
- package/dist/postgres-contract-view-DRppzflo-DxrBP7Tj.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prisma7-binding-DsXmgX4b.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/prisma7-binding.mjs"],"sourcesContent":["import { D as pgTime, I as pgUuid, N as pgTimetz, R as pgVarchar, S as pgNumeric, T as pgText, _ as pgInt8, a as pgBytea, b as pgJsonb, c as pgDate, f as pgFloat4, g as pgInt4, h as pgInt2, i as pgBool, j as pgTimestamptz, k as pgTimestamp, m as pgInet, o as pgChar, p as pgFloat8, y as pgJson, z as postgresDataTypes } from \"./data-types-pNqSURzU.mjs\";\nimport { t as postgresDataTypeEntries } from \"./data-type-entries-B7ROystY.mjs\";\nimport { a as postgresCodecDescriptorRegistry } from \"./codec-registry-D-jIXuQB.mjs\";\nimport { l as postgresScalarAndNativeTypeConstructors } from \"./authoring-VPJEKQsx.mjs\";\nimport { i as postgresCreateNamespace } from \"./postgres-schema-C6w1rzOF.mjs\";\nimport { t as postgresTargetDescriptorMeta } from \"./descriptor-meta-BC8Pg1Bl.mjs\";\nimport { n as defaultPrimaryKeyName, t as defaultForeignKeyName } from \"./default-constraint-names-CtcRXhV8.mjs\";\nimport { i as noInferredDefaults, r as createPostgresDefaultMapping, t as buildPslDocumentAst, u as noColumnDefaults } from \"./infer-psl-contract-DEHEkYxP.mjs\";\nimport { createDataTypeLookup } from \"@internal/framework-components/codec\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { authoringTypeConstructorArguments } from \"@internal/framework-components/authoring\";\nimport { SqlSchemaIR, SqlTableIR } from \"@internal/sql-schema-ir/types\";\nimport { inferredTypeConstructors } from \"@internal/family-sql/psl-build\";\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})$/;\n/**\n* What a Prisma 7 `DateTime` default, such as `2024-01-02T03:04:05.123+02:00`, means on a column of `dataType`, as the body of the type's tag: `date` keeps the written date, `time` and `timestamp` the written wall-clock time without the offset, `timetz` the time with the written offset, and `timestamptz` the written instant, offset included. The tag reads the body as Postgres reads the default Prisma 7 writes. `undefined` for text that is not an RFC 3339 date and time, or a type that is not a date or time type.\n*/\nfunction prisma7TemporalTagBody(text, dataType) {\n\tconst match = RFC_3339.exec(text);\n\tif (match === null) return void 0;\n\tconst [, date = \"\", clock = \"\", zone = \"\"] = match;\n\tconst offset = zone.toUpperCase();\n\tswitch (dataType) {\n\t\tcase pgDate.id: return date;\n\t\tcase pgTime.id: return clock;\n\t\tcase pgTimetz.id: return `${clock}${offset}`;\n\t\tcase pgTimestamp.id: return `${date}T${clock}`;\n\t\tcase pgTimestamptz.id: return `${date}T${clock}${offset}`;\n\t\tdefault: return;\n\t}\n}\nconst MICROSECONDS_PER_SECOND = 1000000n;\nconst POSTGRES_EPOCH_MS = Date.UTC(2e3, 0, 1);\n/**\n* The value PostgreSQL stores for a Prisma 7 `DateTime` default with more fraction digits than a column of `dataType` with `precision` holds, written in the same RFC 3339 form: the fraction is first rounded to microseconds as PostgreSQL reads text, then to `precision` digits as it rounds a value for its column, a tie going away from midnight on 2000-01-01, PostgreSQL's epoch. `undefined` when the column holds the text as written, or for a date column, which keeps only the date.\n*/\nfunction prisma7TemporalStored(text, dataType, precision) {\n\tconst match = RFC_3339.exec(text);\n\tif (match === null || dataType === pgDate.id) return void 0;\n\tconst [, date = \"\", clock = \"\", zone = \"\"] = match;\n\tconst [hms = \"\", fraction = \"\"] = clock.split(\".\");\n\tif (fraction.length <= precision) return void 0;\n\tconst [year, month, day] = date.split(\"-\").map(Number);\n\tconst [hour, minute, second] = hms.split(\":\").map(Number);\n\tconst wallMs = (/* @__PURE__ */ new Date(0)).setUTCFullYear(year ?? 0, (month ?? 1) - 1, day ?? 1);\n\tconst wall = (BigInt(wallMs - POSTGRES_EPOCH_MS) / 1000n + BigInt((hour ?? 0) * 3600 + (minute ?? 0) * 60 + (second ?? 0))) * MICROSECONDS_PER_SECOND + microsecondsOf(fraction);\n\tconst instant = dataType === pgTimestamptz.id ? wall - offsetMicroseconds(zone) : wall;\n\tconst tieGoesEarlier = (dataType === pgTimestamp.id || dataType === pgTimestamptz.id) && instant < 0n;\n\treturn `${printedWall(roundedTo(wall, 10n ** BigInt(6 - precision), tieGoesEarlier), precision)}${zone}`;\n}\n/** PostgreSQL reads the fraction of a second as a double and rounds it to whole microseconds. */\nfunction microsecondsOf(fraction) {\n\tif (fraction.length <= 6) return BigInt(fraction.padEnd(6, \"0\"));\n\tconst scaled = Number(`0.${fraction}`) * 1e6;\n\tconst floor = Math.floor(scaled);\n\tconst rest = scaled - floor;\n\tconst rounded = rest > .5 || rest === .5 && floor % 2 === 1 ? floor + 1 : floor;\n\treturn BigInt(rounded);\n}\nfunction offsetMicroseconds(zone) {\n\tconst offset = /^([+-])(\\d{2}):(\\d{2})$/.exec(zone);\n\tif (offset === null) return 0n;\n\tconst [, sign, hours = \"0\", minutes = \"0\"] = offset;\n\tconst seconds = BigInt(Number(hours) * 3600 + Number(minutes) * 60);\n\treturn (sign === \"-\" ? -seconds : seconds) * MICROSECONDS_PER_SECOND;\n}\nfunction roundedTo(value, step, tieGoesEarlier) {\n\tconst rest = (value % step + step) % step;\n\tconst below = value - rest;\n\tconst twice = rest * 2n;\n\tif (twice > step || twice === step && !tieGoesEarlier) return below + step;\n\treturn below;\n}\nfunction printedWall(microseconds, precision) {\n\tconst rest = (microseconds % MICROSECONDS_PER_SECOND + MICROSECONDS_PER_SECOND) % MICROSECONDS_PER_SECOND;\n\tconst seconds = (microseconds - rest) / MICROSECONDS_PER_SECOND;\n\tconst at = new Date(POSTGRES_EPOCH_MS + Number(seconds) * 1e3);\n\tconst two = (n) => String(n).padStart(2, \"0\");\n\treturn `${`${String(at.getUTCFullYear()).padStart(4, \"0\")}-${two(at.getUTCMonth() + 1)}-${two(at.getUTCDate())}`}T${`${two(at.getUTCHours())}:${two(at.getUTCMinutes())}:${two(at.getUTCSeconds())}`}${precision === 0 ? \"\" : `.${String(rest).padStart(6, \"0\").slice(0, precision)}`}`;\n}\n//#endregion\n//#region src/core/prisma7-type-map.ts\nconst of = (type, params = {}) => ({\n\tdataType: type.id,\n\tparams\n});\n/**\n* What Prisma 7.10.0 creates in Postgres for each Prisma 7 scalar and `@db.*` native type, as a data type and its parameters. Derived from the SQL recorded in `test/integration/test/fixtures/prisma7-source/reference/migration.sql`. A `@db.*` attribute's own arguments replace the parameters; without any, the column gets these, so `@db.Char` is the `character(1)` Postgres stores for Prisma 7's `CHAR`.\n*/\nconst prisma7PostgresTypes = {\n\tscalars: {\n\t\tString: of(pgText),\n\t\tBoolean: of(pgBool),\n\t\tInt: of(pgInt4),\n\t\tBigInt: of(pgInt8),\n\t\tFloat: of(pgFloat8),\n\t\tDecimal: of(pgNumeric, {\n\t\t\tprecision: 65,\n\t\t\tscale: 30\n\t\t}),\n\t\tDateTime: of(pgTimestamp, { precision: 3 }),\n\t\tJson: of(pgJsonb),\n\t\tBytes: of(pgBytea)\n\t},\n\tnativeTypes: {\n\t\tText: of(pgText),\n\t\tVarChar: of(pgVarchar),\n\t\tChar: of(pgChar, { length: 1 }),\n\t\tUuid: of(pgUuid),\n\t\tInet: of(pgInet),\n\t\tBoolean: of(pgBool),\n\t\tInteger: of(pgInt4),\n\t\tSmallInt: of(pgInt2),\n\t\tBigInt: of(pgInt8),\n\t\tReal: of(pgFloat4),\n\t\tDoublePrecision: of(pgFloat8),\n\t\tDecimal: of(pgNumeric),\n\t\tTimestamp: of(pgTimestamp),\n\t\tTimestamptz: of(pgTimestamptz),\n\t\tDate: of(pgDate),\n\t\tTime: of(pgTime),\n\t\tTimetz: of(pgTimetz),\n\t\tJson: of(pgJson),\n\t\tJsonB: of(pgJsonb),\n\t\tByteA: of(pgBytea)\n\t}\n};\nconst marked = inferredTypeConstructors({\n\tauthoringTypes: postgresScalarAndNativeTypeConstructors,\n\tcodecLookup: postgresCodecDescriptorRegistry,\n\tdataTypeLookup: createDataTypeLookup(postgresDataTypes)\n});\n/**\n* The constructor marked `inferred` for the column's data type, with every parameter Prisma 7 gives the column as an argument. The reader builds a contract, so it keeps each parameter rather than the fewest arguments printed PSL writes.\n*/\nfunction mappingOf({ dataType, params }) {\n\tconst markedConstructor = marked.get(dataType);\n\tconst args = markedConstructor === void 0 ? void 0 : authoringTypeConstructorArguments(markedConstructor.descriptor, {\n\t\tcodecId: markedConstructor.descriptor.output.codecId,\n\t\ttypeParams: params\n\t});\n\tif (markedConstructor === void 0 || args === void 0) throw new InternalError(`No constructor marked inferred writes ${dataType} with these parameters.`);\n\treturn {\n\t\tconstructorName: markedConstructor.path.join(\".\"),\n\t\targs\n\t};\n}\nfunction mappingsOf(types) {\n\treturn Object.fromEntries(Object.entries(types).map(([name, type]) => [name, mappingOf(type)]));\n}\n/** {@link prisma7PostgresTypes} as the Prisma 7 reader takes it: each type's constructor call. */\nconst prisma7PostgresTypeMap = {\n\tscalars: mappingsOf(prisma7PostgresTypes.scalars),\n\tnativeTypes: mappingsOf(prisma7PostgresTypes.nativeTypes)\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\ttypeText: \"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\ttypeText: \"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\tcolumnTypes: () => ({\n\t\t\tpath: [\"Int\"],\n\t\t\targs: [],\n\t\t\tvalues: []\n\t\t}),\n\t\tdefaultMapping: createPostgresDefaultMapping(),\n\t\tdefaultOf: noInferredDefaults,\n\t\tcolumnDefaults: noColumnDefaults\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\n/** The date and time types a Prisma 7 `DateTime` default can be written on. */\nconst DATE_TIME_TYPES = /* @__PURE__ */ new Set([\n\tpgTimestamp.id,\n\tpgTimestamptz.id,\n\tpgDate.id,\n\tpgTime.id,\n\tpgTimetz.id\n]);\nconst ENTRIES = postgresDataTypeEntries();\n/** The tag the authoring entry of `dataType` writes its values with. */\nfunction tagOf(dataType) {\n\tconst written = ENTRIES[dataType]?.written;\n\treturn written?.kind === \"tag\" ? written.tag : void 0;\n}\n/** A date or time column without a precision holds microseconds. */\nfunction precisionOf(typeParams) {\n\tconst precision = typeParams?.[\"precision\"];\n\treturn typeof precision === \"number\" ? precision : 6;\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}\n/**\n* What the Postgres target supplies to the Prisma 7 interpreter. A `Bytes` or\n* `DateTime` default is read through the tag its column type's authoring entry\n* writes, as the current schema language reads it: a `Bytes` default's base64\n* as the hex body of `bytea`, and a `DateTime` default as the body of the date\n* or time tag that keeps what the written value means on the column.\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\tdefaultConstraintNames: {\n\t\tprimaryKey: defaultPrimaryKeyName,\n\t\tforeignKey: defaultForeignKeyName\n\t},\n\tjunctionRelationFieldNames,\n\tliteralDefaultForm: ({ dataType, typeParams }) => {\n\t\tif (dataType === pgJson.id || dataType === pgJsonb.id) return { kind: \"json\" };\n\t\tconst tag = tagOf(dataType);\n\t\tif (tag === void 0) return void 0;\n\t\tif (dataType === pgBytea.id) return {\n\t\t\tkind: \"tag\",\n\t\t\ttag,\n\t\t\tbody: base64ToHex\n\t\t};\n\t\tif (!DATE_TIME_TYPES.has(dataType)) return void 0;\n\t\treturn {\n\t\t\tkind: \"tag\",\n\t\t\ttag,\n\t\t\tbody: (text) => prisma7TemporalTagBody(text, dataType),\n\t\t\tfinerThanColumn: (text) => {\n\t\t\t\tconst heldDigits = precisionOf(typeParams);\n\t\t\t\tconst stored = prisma7TemporalStored(text, dataType, heldDigits);\n\t\t\t\treturn stored === void 0 ? void 0 : {\n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N;GACA,OAAO,SAAS,uBAAuB,MAAM,QAAQ;GACrD,kBAAkB,SAAS;IAC1B,MAAM,aAAa,YAAY,UAAU;IACzC,MAAM,SAAS,sBAAsB,MAAM,UAAU,UAAU;IAC/D,OAAO,WAAW,KAAK,IAAI,KAAK,IAAI;KACnC;KACA;IACD;GACD;EACD;CACD;AACD"}
|
|
1
|
+
{"version":3,"file":"prisma7-binding-TQ2GIDxX.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/prisma7-binding.mjs"],"sourcesContent":["import { D as pgTime, I as pgUuid, N as pgTimetz, R as pgVarchar, S as pgNumeric, T as pgText, _ as pgInt8, a as pgBytea, b as pgJsonb, c as pgDate, f as pgFloat4, g as pgInt4, h as pgInt2, i as pgBool, j as pgTimestamptz, k as pgTimestamp, m as pgInet, o as pgChar, p as pgFloat8, y as pgJson, z as postgresDataTypes } from \"./data-types-Chx0mjTP.mjs\";\nimport { t as postgresDataTypeEntries } from \"./data-type-entries-gQW3-KSb.mjs\";\nimport { a as postgresCodecDescriptorRegistry } from \"./codec-registry-D7XslgPe.mjs\";\nimport { l as postgresScalarAndNativeTypeConstructors } from \"./authoring-SbdvmVJh.mjs\";\nimport { i as postgresCreateNamespace } from \"./postgres-schema-C6w1rzOF.mjs\";\nimport { t as postgresTargetDescriptorMeta } from \"./descriptor-meta-DBH6aAIM.mjs\";\nimport { n as defaultPrimaryKeyName, t as defaultForeignKeyName } from \"./default-constraint-names-CtcRXhV8.mjs\";\nimport { i as noInferredDefaults, r as createPostgresDefaultMapping, t as buildPslDocumentAst, u as noColumnDefaults } from \"./infer-psl-contract-BSSHcuRi.mjs\";\nimport { createDataTypeLookup } from \"@internal/framework-components/codec\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { authoringTypeConstructorArguments } from \"@internal/framework-components/authoring\";\nimport { SqlSchemaIR, SqlTableIR } from \"@internal/sql-schema-ir/types\";\nimport { inferredTypeConstructors } from \"@internal/family-sql/psl-build\";\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})$/;\n/**\n* What a Prisma 7 `DateTime` default, such as `2024-01-02T03:04:05.123+02:00`, means on a column of `dataType`, as the body of the type's tag: `date` keeps the written date, `time` and `timestamp` the written wall-clock time without the offset, `timetz` the time with the written offset, and `timestamptz` the written instant, offset included. The tag reads the body as Postgres reads the default Prisma 7 writes. `undefined` for text that is not an RFC 3339 date and time, or a type that is not a date or time type.\n*/\nfunction prisma7TemporalTagBody(text, dataType) {\n\tconst match = RFC_3339.exec(text);\n\tif (match === null) return void 0;\n\tconst [, date = \"\", clock = \"\", zone = \"\"] = match;\n\tconst offset = zone.toUpperCase();\n\tswitch (dataType) {\n\t\tcase pgDate.id: return date;\n\t\tcase pgTime.id: return clock;\n\t\tcase pgTimetz.id: return `${clock}${offset}`;\n\t\tcase pgTimestamp.id: return `${date}T${clock}`;\n\t\tcase pgTimestamptz.id: return `${date}T${clock}${offset}`;\n\t\tdefault: return;\n\t}\n}\nconst MICROSECONDS_PER_SECOND = 1000000n;\nconst POSTGRES_EPOCH_MS = Date.UTC(2e3, 0, 1);\n/**\n* The value PostgreSQL stores for a Prisma 7 `DateTime` default with more fraction digits than a column of `dataType` with `precision` holds, written in the same RFC 3339 form: the fraction is first rounded to microseconds as PostgreSQL reads text, then to `precision` digits as it rounds a value for its column, a tie going away from midnight on 2000-01-01, PostgreSQL's epoch. `undefined` when the column holds the text as written, or for a date column, which keeps only the date.\n*/\nfunction prisma7TemporalStored(text, dataType, precision) {\n\tconst match = RFC_3339.exec(text);\n\tif (match === null || dataType === pgDate.id) return void 0;\n\tconst [, date = \"\", clock = \"\", zone = \"\"] = match;\n\tconst [hms = \"\", fraction = \"\"] = clock.split(\".\");\n\tif (fraction.length <= precision) return void 0;\n\tconst [year, month, day] = date.split(\"-\").map(Number);\n\tconst [hour, minute, second] = hms.split(\":\").map(Number);\n\tconst wallMs = (/* @__PURE__ */ new Date(0)).setUTCFullYear(year ?? 0, (month ?? 1) - 1, day ?? 1);\n\tconst wall = (BigInt(wallMs - POSTGRES_EPOCH_MS) / 1000n + BigInt((hour ?? 0) * 3600 + (minute ?? 0) * 60 + (second ?? 0))) * MICROSECONDS_PER_SECOND + microsecondsOf(fraction);\n\tconst instant = dataType === pgTimestamptz.id ? wall - offsetMicroseconds(zone) : wall;\n\tconst tieGoesEarlier = (dataType === pgTimestamp.id || dataType === pgTimestamptz.id) && instant < 0n;\n\treturn `${printedWall(roundedTo(wall, 10n ** BigInt(6 - precision), tieGoesEarlier), precision)}${zone}`;\n}\n/** PostgreSQL reads the fraction of a second as a double and rounds it to whole microseconds. */\nfunction microsecondsOf(fraction) {\n\tif (fraction.length <= 6) return BigInt(fraction.padEnd(6, \"0\"));\n\tconst scaled = Number(`0.${fraction}`) * 1e6;\n\tconst floor = Math.floor(scaled);\n\tconst rest = scaled - floor;\n\tconst rounded = rest > .5 || rest === .5 && floor % 2 === 1 ? floor + 1 : floor;\n\treturn BigInt(rounded);\n}\nfunction offsetMicroseconds(zone) {\n\tconst offset = /^([+-])(\\d{2}):(\\d{2})$/.exec(zone);\n\tif (offset === null) return 0n;\n\tconst [, sign, hours = \"0\", minutes = \"0\"] = offset;\n\tconst seconds = BigInt(Number(hours) * 3600 + Number(minutes) * 60);\n\treturn (sign === \"-\" ? -seconds : seconds) * MICROSECONDS_PER_SECOND;\n}\nfunction roundedTo(value, step, tieGoesEarlier) {\n\tconst rest = (value % step + step) % step;\n\tconst below = value - rest;\n\tconst twice = rest * 2n;\n\tif (twice > step || twice === step && !tieGoesEarlier) return below + step;\n\treturn below;\n}\nfunction printedWall(microseconds, precision) {\n\tconst rest = (microseconds % MICROSECONDS_PER_SECOND + MICROSECONDS_PER_SECOND) % MICROSECONDS_PER_SECOND;\n\tconst seconds = (microseconds - rest) / MICROSECONDS_PER_SECOND;\n\tconst at = new Date(POSTGRES_EPOCH_MS + Number(seconds) * 1e3);\n\tconst two = (n) => String(n).padStart(2, \"0\");\n\treturn `${`${String(at.getUTCFullYear()).padStart(4, \"0\")}-${two(at.getUTCMonth() + 1)}-${two(at.getUTCDate())}`}T${`${two(at.getUTCHours())}:${two(at.getUTCMinutes())}:${two(at.getUTCSeconds())}`}${precision === 0 ? \"\" : `.${String(rest).padStart(6, \"0\").slice(0, precision)}`}`;\n}\n//#endregion\n//#region src/core/prisma7-type-map.ts\nconst of = (type, params = {}) => ({\n\tdataType: type.id,\n\tparams\n});\n/**\n* What Prisma 7.10.0 creates in Postgres for each Prisma 7 scalar and `@db.*` native type, as a data type and its parameters. Derived from the SQL recorded in `test/integration/test/fixtures/prisma7-source/reference/migration.sql`. A `@db.*` attribute's own arguments replace the parameters; without any, the column gets these, so `@db.Char` is the `character(1)` Postgres stores for Prisma 7's `CHAR`.\n*/\nconst prisma7PostgresTypes = {\n\tscalars: {\n\t\tString: of(pgText),\n\t\tBoolean: of(pgBool),\n\t\tInt: of(pgInt4),\n\t\tBigInt: of(pgInt8),\n\t\tFloat: of(pgFloat8),\n\t\tDecimal: of(pgNumeric, {\n\t\t\tprecision: 65,\n\t\t\tscale: 30\n\t\t}),\n\t\tDateTime: of(pgTimestamp, { precision: 3 }),\n\t\tJson: of(pgJsonb),\n\t\tBytes: of(pgBytea)\n\t},\n\tnativeTypes: {\n\t\tText: of(pgText),\n\t\tVarChar: of(pgVarchar),\n\t\tChar: of(pgChar, { length: 1 }),\n\t\tUuid: of(pgUuid),\n\t\tInet: of(pgInet),\n\t\tBoolean: of(pgBool),\n\t\tInteger: of(pgInt4),\n\t\tSmallInt: of(pgInt2),\n\t\tBigInt: of(pgInt8),\n\t\tReal: of(pgFloat4),\n\t\tDoublePrecision: of(pgFloat8),\n\t\tDecimal: of(pgNumeric),\n\t\tTimestamp: of(pgTimestamp),\n\t\tTimestamptz: of(pgTimestamptz),\n\t\tDate: of(pgDate),\n\t\tTime: of(pgTime),\n\t\tTimetz: of(pgTimetz),\n\t\tJson: of(pgJson),\n\t\tJsonB: of(pgJsonb),\n\t\tByteA: of(pgBytea)\n\t}\n};\nconst marked = inferredTypeConstructors({\n\tauthoringTypes: postgresScalarAndNativeTypeConstructors,\n\tcodecLookup: postgresCodecDescriptorRegistry,\n\tdataTypeLookup: createDataTypeLookup(postgresDataTypes)\n});\n/**\n* The constructor marked `inferred` for the column's data type, with every parameter Prisma 7 gives the column as an argument. The reader builds a contract, so it keeps each parameter rather than the fewest arguments printed PSL writes.\n*/\nfunction mappingOf({ dataType, params }) {\n\tconst markedConstructor = marked.get(dataType);\n\tconst args = markedConstructor === void 0 ? void 0 : authoringTypeConstructorArguments(markedConstructor.descriptor, {\n\t\tcodecId: markedConstructor.descriptor.output.codecId,\n\t\ttypeParams: params\n\t});\n\tif (markedConstructor === void 0 || args === void 0) throw new InternalError(`No constructor marked inferred writes ${dataType} with these parameters.`);\n\treturn {\n\t\tconstructorName: markedConstructor.path.join(\".\"),\n\t\targs\n\t};\n}\nfunction mappingsOf(types) {\n\treturn Object.fromEntries(Object.entries(types).map(([name, type]) => [name, mappingOf(type)]));\n}\n/** {@link prisma7PostgresTypes} as the Prisma 7 reader takes it: each type's constructor call. */\nconst prisma7PostgresTypeMap = {\n\tscalars: mappingsOf(prisma7PostgresTypes.scalars),\n\tnativeTypes: mappingsOf(prisma7PostgresTypes.nativeTypes)\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\ttypeText: \"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\ttypeText: \"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\tcolumnTypes: () => ({\n\t\t\tpath: [\"Int\"],\n\t\t\targs: [],\n\t\t\tvalues: []\n\t\t}),\n\t\tdefaultMapping: createPostgresDefaultMapping(),\n\t\tdefaultOf: noInferredDefaults,\n\t\tcolumnDefaults: noColumnDefaults\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\n/** The date and time types a Prisma 7 `DateTime` default can be written on. */\nconst DATE_TIME_TYPES = /* @__PURE__ */ new Set([\n\tpgTimestamp.id,\n\tpgTimestamptz.id,\n\tpgDate.id,\n\tpgTime.id,\n\tpgTimetz.id\n]);\nconst ENTRIES = postgresDataTypeEntries();\n/** The tag the authoring entry of `dataType` writes its values with. */\nfunction tagOf(dataType) {\n\tconst written = ENTRIES[dataType]?.written;\n\treturn written?.kind === \"tag\" ? written.tag : void 0;\n}\n/** A date or time column without a precision holds microseconds. */\nfunction precisionOf(typeParams) {\n\tconst precision = typeParams?.[\"precision\"];\n\treturn typeof precision === \"number\" ? precision : 6;\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}\n/**\n* What the Postgres target supplies to the Prisma 7 interpreter. A `Bytes` or\n* `DateTime` default is read through the tag its column type's authoring entry\n* writes, as the current schema language reads it: a `Bytes` default's base64\n* as the hex body of `bytea`, and a `DateTime` default as the body of the date\n* or time tag that keeps what the written value means on the column.\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\tdefaultConstraintNames: {\n\t\tprimaryKey: defaultPrimaryKeyName,\n\t\tforeignKey: defaultForeignKeyName\n\t},\n\tjunctionRelationFieldNames,\n\tliteralDefaultForm: ({ dataType, typeParams }) => {\n\t\tif (dataType === pgJson.id || dataType === pgJsonb.id) return { kind: \"json\" };\n\t\tconst tag = tagOf(dataType);\n\t\tif (tag === void 0) return void 0;\n\t\tif (dataType === pgBytea.id) return {\n\t\t\tkind: \"tag\",\n\t\t\ttag,\n\t\t\tbody: base64ToHex\n\t\t};\n\t\tif (!DATE_TIME_TYPES.has(dataType)) return void 0;\n\t\treturn {\n\t\t\tkind: \"tag\",\n\t\t\ttag,\n\t\t\tbody: (text) => prisma7TemporalTagBody(text, dataType),\n\t\t\tfinerThanColumn: (text) => {\n\t\t\t\tconst heldDigits = precisionOf(typeParams);\n\t\t\t\tconst stored = prisma7TemporalStored(text, dataType, heldDigits);\n\t\t\t\treturn stored === void 0 ? void 0 : {\n\t\t\t\t\theldDigits,\n\t\t\t\t\tstored\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t}\n};\n//#endregion\nexport { prisma7PostgresBinding };\n\n//# sourceMappingURL=prisma7-binding.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAM,WAAW;;;;AAIjB,SAAS,uBAAuB,MAAM,UAAU;CAC/C,MAAM,QAAQ,SAAS,KAAK,IAAI;CAChC,IAAI,UAAU,MAAM,OAAO,KAAK;CAChC,MAAM,GAAG,OAAO,IAAI,QAAQ,IAAI,OAAO,MAAM;CAC7C,MAAM,SAAS,KAAK,YAAY;CAChC,QAAQ,UAAR;EACC,KAAK,OAAO,IAAI,OAAO;EACvB,KAAK,OAAO,IAAI,OAAO;EACvB,KAAK,SAAS,IAAI,OAAO,GAAG,QAAQ;EACpC,KAAK,YAAY,IAAI,OAAO,GAAG,KAAK,GAAG;EACvC,KAAK,cAAc,IAAI,OAAO,GAAG,KAAK,GAAG,QAAQ;EACjD,SAAS;CACV;AACD;AACA,MAAM,0BAA0B;AAChC,MAAM,oBAAoB,KAAK,IAAI,KAAK,GAAG,CAAC;;;;AAI5C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EACZ,iBAAiB,CAAC,MAAM,MAAM;CAC/B;CACA,YAAY;EACX,OAAO;EACP,MAAM;EACN,KAAK;EACL,MAAM;EACN,QAAQ;EACR,MAAM;CACP;;CAEA,oBAAoB;CACpB,wBAAwB;EACvB,YAAY;EACZ,YAAY;CACb;CACA;CACA,qBAAqB,EAAE,UAAU,iBAAiB;EACjD,IAAI,aAAa,OAAO,MAAM,aAAa,QAAQ,IAAI,OAAO,EAAE,MAAM,OAAO;EAC7E,MAAM,MAAM,MAAM,QAAQ;EAC1B,IAAI,QAAQ,KAAK,GAAG,OAAO,KAAK;EAChC,IAAI,aAAa,QAAQ,IAAI,OAAO;GACnC,MAAM;GACN;GACA,MAAM;EACP;EACA,IAAI,CAAC,gBAAgB,IAAI,QAAQ,GAAG,OAAO,KAAK;EAChD,OAAO;GACN,MAAM;GACN;GACA,OAAO,SAAS,uBAAuB,MAAM,QAAQ;GACrD,kBAAkB,SAAS;IAC1B,MAAM,aAAa,YAAY,UAAU;IACzC,MAAM,SAAS,sBAAsB,MAAM,UAAU,UAAU;IAC/D,OAAO,WAAW,KAAK,IAAI,KAAK,IAAI;KACnC;KACA;IACD;GACD;EACD;CACD;AACD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c as postgresError } from "./errors-BrhQYgdL-D_lIrddD.mjs";
|
|
2
|
-
import { W as isPostgresOpFactoryCall } from "./op-factory-call-
|
|
2
|
+
import { W as isPostgresOpFactoryCall } from "./op-factory-call-ClvHxHDs-CeVV_tro.mjs";
|
|
3
3
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
4
4
|
import { isThenable } from "@prisma/orm-framework/utils/promise";
|
|
5
|
-
//#region ../../../3-targets/3-targets/postgres/dist/render-ops-
|
|
5
|
+
//#region ../../../3-targets/3-targets/postgres/dist/render-ops-DKPk74iS.mjs
|
|
6
6
|
/**
|
|
7
7
|
* Asserts an op materialised by an `OpFactoryCall` targets postgres. The
|
|
8
8
|
* extension surface lets any contributor emit calls, so this is the
|
|
@@ -38,4 +38,4 @@ function renderOps(calls, lowerer) {
|
|
|
38
38
|
//#endregion
|
|
39
39
|
export { renderOps as t };
|
|
40
40
|
|
|
41
|
-
//# sourceMappingURL=render-ops-
|
|
41
|
+
//# sourceMappingURL=render-ops-DKPk74iS-Cfil02bJ.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-ops-
|
|
1
|
+
{"version":3,"file":"render-ops-DKPk74iS-Cfil02bJ.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/render-ops-DKPk74iS.mjs"],"sourcesContent":["import { c as postgresError } from \"./errors-BrhQYgdL.mjs\";\nimport { V as isPostgresOpFactoryCall } from \"./op-factory-call-ClvHxHDs.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { isThenable } from \"@internal/utils/promise\";\n//#region src/core/migrations/render-ops.ts\n/**\n* Asserts an op materialised by an `OpFactoryCall` targets postgres. The\n* extension surface lets any contributor emit calls, so this is the\n* integration boundary where a stray non-postgres op would otherwise\n* silently flow through to postgres-shaped renderers — exactly the\n* place to fail loudly with op metadata (`id` + `target.id`).\n*/\nfunction assertPostgresOp(op, callFactoryName) {\n\tconst targetId = blindCast(op).target?.id;\n\tif (targetId !== \"postgres\") throw postgresError(\"MIGRATION.TARGET_MISMATCH\", `renderOps: expected postgres op but got target.id=\"${String(targetId)}\" for op.id=\"${op.id}\" (factoryName=\"${callFactoryName}\"). An OpFactoryCall produced an op for a different target on the postgres planner path; check the call's target binding.`, { meta: {\n\t\topId: op.id,\n\t\ttargetId: String(targetId),\n\t\tfactoryName: callFactoryName\n\t} });\n}\nfunction checkedOp(opOrPromise, callFactoryName) {\n\tif (isThenable(opOrPromise)) {\n\t\tconst checked = opOrPromise.then((op) => {\n\t\t\tassertPostgresOp(op, callFactoryName);\n\t\t\treturn op;\n\t\t});\n\t\tchecked.catch(() => void 0);\n\t\treturn checked;\n\t}\n\tassertPostgresOp(opOrPromise, callFactoryName);\n\treturn opOrPromise;\n}\nfunction renderOps(calls, lowerer) {\n\treturn calls.flatMap((c) => {\n\t\treturn (isPostgresOpFactoryCall(c) ? c.toOps(lowerer) : [blindCast(c).toOp(lowerer)]).map((opOrPromise) => checkedOp(opOrPromise, c.factoryName));\n\t});\n}\n//#endregion\nexport { renderOps as t };\n\n//# sourceMappingURL=render-ops-DKPk74iS.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,iBAAiB,IAAI,iBAAiB;CAC9C,MAAM,WAAW,UAAU,EAAE,CAAC,CAAC,QAAQ;CACvC,IAAI,aAAa,YAAY,MAAM,cAAc,6BAA6B,sDAAsD,OAAO,QAAQ,EAAE,eAAe,GAAG,GAAG,kBAAkB,gBAAgB,4HAA4H,EAAE,MAAM;EAC/U,MAAM,GAAG;EACT,UAAU,OAAO,QAAQ;EACzB,aAAa;CACd,EAAE,CAAC;AACJ;AACA,SAAS,UAAU,aAAa,iBAAiB;CAChD,IAAI,WAAW,WAAW,GAAG;EAC5B,MAAM,UAAU,YAAY,MAAM,OAAO;GACxC,iBAAiB,IAAI,eAAe;GACpC,OAAO;EACR,CAAC;EACD,QAAQ,YAAY,KAAK,CAAC;EAC1B,OAAO;CACR;CACA,iBAAiB,aAAa,eAAe;CAC7C,OAAO;AACR;AACA,SAAS,UAAU,OAAO,SAAS;CAClC,OAAO,MAAM,SAAS,MAAM;EAC3B,QAAQ,wBAAwB,CAAC,IAAI,EAAE,MAAM,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,EAAA,CAAG,KAAK,gBAAgB,UAAU,aAAa,EAAE,WAAW,CAAC;CACjJ,CAAC;AACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { i as quoteIdentifier, n as escapeLiteral } from "./sql-utils-Bnw3JbWf-zvWDkyrr.mjs";
|
|
2
|
-
import { D as pgInterval, E as pgInt8, F as pgText, J as pgVarchar, L as pgTime, M as pgNumeric, S as pgFloat8, T as pgInt4, U as pgTimetz, V as pgTimestamptz, d as pgBool, h as pgChar, l as pgBit, q as pgVarbit, w as pgInt2, x as pgFloat4, z as pgTimestamp } from "./data-types-
|
|
2
|
+
import { D as pgInterval, E as pgInt8, F as pgText, J as pgVarchar, L as pgTime, M as pgNumeric, S as pgFloat8, T as pgInt4, U as pgTimetz, V as pgTimestamptz, d as pgBool, h as pgChar, l as pgBit, q as pgVarbit, w as pgInt2, x as pgFloat4, z as pgTimestamp } from "./data-types-Chx0mjTP-Dy6isAwB.mjs";
|
|
3
3
|
import { LiteralExpr, collectOrderedParamRefs, lockOptionCapabilities, lockStrengthCapabilities, missingCapability } from "@prisma/orm-family-sql/relational-core/ast";
|
|
4
|
-
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
5
4
|
import { dataTypeParams } from "@prisma/orm-framework/components/codec";
|
|
5
|
+
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
6
6
|
import { InternalError, assertNever } from "@prisma/orm-framework/utils/internal-error";
|
|
7
7
|
import { nameIsCatalogText, sqlBaseName, sqlDataTypeOfCodec } from "@prisma/orm-family-sql/contract/data-type";
|
|
8
8
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
@@ -558,4 +558,4 @@ function renderRawExpr(node, contract, pim) {
|
|
|
558
558
|
//#endregion
|
|
559
559
|
export { renderLoweredSql as n, adapterError as t };
|
|
560
560
|
|
|
561
|
-
//# sourceMappingURL=sql-renderer-BdWJPa5F-
|
|
561
|
+
//# sourceMappingURL=sql-renderer-BdWJPa5F-Q6M1dydc.mjs.map
|
package/dist/{sql-renderer-BdWJPa5F-u46YBOY7.mjs.map → sql-renderer-BdWJPa5F-Q6M1dydc.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sql-renderer-BdWJPa5F-u46YBOY7.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/sql-renderer-BdWJPa5F.mjs"],"sourcesContent":["import { dataTypeParams } from \"@internal/framework-components/codec\";\nimport { LiteralExpr, collectOrderedParamRefs, lockOptionCapabilities, lockStrengthCapabilities, missingCapability } from \"@internal/sql-relational-core/ast\";\nimport { pgBit, pgBool, pgChar, pgFloat4, pgFloat8, pgInt2, pgInt4, pgInt8, pgInterval, pgNumeric, pgText, pgTime, pgTimestamp, pgTimestamptz, pgTimetz, pgVarbit, pgVarchar } from \"@internal/target-postgres/data-types\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { escapeLiteral, quoteIdentifier } from \"@internal/target-postgres/sql-utils\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError, assertNever } from \"@internal/utils/internal-error\";\nimport { isPlainRecord } from \"@internal/contract/is-plain-record\";\nimport { runtimeError } from \"@internal/framework-components/runtime\";\nimport { nameIsCatalogText, sqlBaseName, sqlDataTypeOfCodec } from \"@internal/sql-contract/data-type\";\n//#region src/core/adapter-errors.ts\nfunction adapterError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/core/sql-renderer.ts\n/**\n* Data types whose unknown-OID parameter inference is reliable in arbitrary expression positions. A parameter whose codec represents one of these is emitted as plain `$N`; everything else (including `pg/json`, `pg/jsonb`, extension types like `pgvector/vector`, and enums) is emitted as `$N::<base name>` so the planner picks an unambiguous overload.\n*\n* `pg/json` / `pg/jsonb` are intentionally excluded: their operator overloads make context inference unreliable in expression positions (e.g. `$1 -> 'key'` is ambiguous between the two).\n*/\nconst POSTGRES_INFERRABLE_DATA_TYPES = /* @__PURE__ */ new Set([\n\tpgInt2.id,\n\tpgInt4.id,\n\tpgInt8.id,\n\tpgFloat4.id,\n\tpgFloat8.id,\n\tpgNumeric.id,\n\tpgBool.id,\n\tpgText.id,\n\tpgChar.id,\n\tpgVarchar.id,\n\tpgTimestamp.id,\n\tpgTimestamptz.id,\n\tpgTime.id,\n\tpgTimetz.id,\n\tpgInterval.id,\n\tpgBit.id,\n\tpgVarbit.id\n]);\n/**\n* A parameter's cast names its data type's base name, which leaves out its parameters: an explicit\n* cast to `varchar(n)` truncates and to `numeric(p,s)` rounds. A data type whose name is its catalog\n* text has no base name, so its parameter is never cast, in any position, and the column's own input\n* function reads the value.\n*/\nfunction renderTypedParam(index, codecId, types, many, typeParams, forceCast = false) {\n\tif (codecId === void 0) return `$${index}`;\n\tif (types.codecDescriptorRegistry.descriptorFor(codecId) === void 0) throw adapterError(\"RUNTIME.PARAM_REF_MISSING_CODEC\", `Postgres lowering: ParamRef carries codecId \"${codecId}\" but the validated PostgreSQL codec registry has no entry for it. This usually indicates a missing extension pack in the runtime stack — register the pack that contributes this codec (e.g. \\`extensions: [pgvectorRuntime]\\`), or use the codec directly from \\`@internal/target-postgres/codecs\\` if it's a builtin.`, { meta: { codecId } });\n\tconst dataType = sqlDataTypeOfCodec(codecId, {\n\t\tcodecLookup: types.codecDescriptorRegistry,\n\t\tdataTypeLookup: types.dataTypeLookup\n\t});\n\tif (nameIsCatalogText(dataType)) return `$${index}`;\n\tconst arraySuffix = many ? \"[]\" : \"\";\n\tif (forceCast || !POSTGRES_INFERRABLE_DATA_TYPES.has(dataType.id) || many) return `$${index}::${sqlBaseName(dataType, dataTypeParams(dataType, isPlainRecord(typeParams) ? typeParams : void 0))}${arraySuffix}`;\n\treturn `$${index}`;\n}\nfunction unreachableKind(value) {\n\tconst candidate = value;\n\tif (typeof candidate === \"object\" && candidate !== null && \"kind\" in candidate && typeof candidate.kind === \"string\") return candidate.kind;\n\treturn \"unknown\";\n}\n/**\n* Render a SQL query AST to a Postgres-flavored `{ sql, params }` payload.\n*\n* Shared between the runtime (`PostgresAdapterImpl.lower`) and control (`PostgresControlAdapter.lower`) entrypoints so emit-time and run-time paths produce byte-identical output for the same AST.\n*/\nfunction renderLoweredSql(ast, contract, codecDescriptorRegistry, dataTypeLookup, capabilities) {\n\tconst orderedRefs = collectOrderedParamRefs(ast);\n\tconst indexMap = /* @__PURE__ */ new Map();\n\tconst params = orderedRefs.map((ref, i) => {\n\t\tindexMap.set(ref, i + 1);\n\t\treturn ref.kind === \"prepared-param-ref\" ? {\n\t\t\tkind: \"bind\",\n\t\t\tname: ref.name\n\t\t} : {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: ref.value\n\t\t};\n\t});\n\tconst pim = {\n\t\tindexMap,\n\t\ttypes: {\n\t\t\tcodecDescriptorRegistry,\n\t\t\tdataTypeLookup\n\t\t},\n\t\tcapabilities\n\t};\n\tconst node = ast;\n\tlet sql;\n\tswitch (node.kind) {\n\t\tcase \"select\":\n\t\t\tsql = renderSelect(node, contract, pim);\n\t\t\tbreak;\n\t\tcase \"insert\":\n\t\t\tsql = renderInsert(node, contract, pim);\n\t\t\tbreak;\n\t\tcase \"update\":\n\t\t\tsql = renderUpdate(node, contract, pim);\n\t\t\tbreak;\n\t\tcase \"delete\":\n\t\t\tsql = renderDelete(node, contract, pim);\n\t\t\tbreak;\n\t\tcase \"raw-query\":\n\t\t\tsql = renderParts(node.parts, contract, pim);\n\t\t\tbreak;\n\t\t// v8 ignore next 4\n\t\tdefault: assertNever(node, `Unsupported AST node kind: ${unreachableKind(node)}`);\n\t}\n\treturn Object.freeze({\n\t\tsql,\n\t\tparams: Object.freeze(params)\n\t});\n}\nfunction renderLimitOffset(keyword, value, contract, pim) {\n\tif (value === void 0) return \"\";\n\tif (typeof value === \"number\") return `${keyword} ${value}`;\n\treturn `${keyword} ${renderExpr(value, contract, pim)}`;\n}\nfunction renderSelect(ast, contract, pim) {\n\treturn [\n\t\t`SELECT ${renderDistinctPrefix(ast.distinct, ast.distinctOn, contract, pim)}${renderProjection(ast.projection, contract, pim)}`,\n\t\tast.from !== void 0 ? `FROM ${renderSource(ast.from, contract, pim)}` : \"\",\n\t\tast.joins?.length ? ast.joins.map((join) => renderJoin(join, contract, pim)).join(\" \") : \"\",\n\t\tast.where ? `WHERE ${renderWhere(ast.where, contract, pim)}` : \"\",\n\t\tast.groupBy?.length ? `GROUP BY ${ast.groupBy.map((expr) => renderExpr(expr, contract, pim)).join(\", \")}` : \"\",\n\t\tast.having ? `HAVING ${renderWhere(ast.having, contract, pim)}` : \"\",\n\t\tast.orderBy?.length ? `ORDER BY ${renderOrderByItems(ast.orderBy, contract, pim)}` : \"\",\n\t\trenderLimitOffset(\"LIMIT\", ast.limit, contract, pim),\n\t\trenderLimitOffset(\"OFFSET\", ast.offset, contract, pim),\n\t\t(ast.locking ?? []).map((clause) => renderLockingClause(clause, pim.capabilities)).join(\" \")\n\t].filter((part) => part.length > 0).join(\" \").trim();\n}\nfunction lockStrengthKeyword(strength) {\n\tswitch (strength) {\n\t\tcase \"forUpdate\": return \"FOR UPDATE\";\n\t\tcase \"forNoKeyUpdate\": return \"FOR NO KEY UPDATE\";\n\t\tcase \"forShare\": return \"FOR SHARE\";\n\t\tcase \"forKeyShare\": return \"FOR KEY SHARE\";\n\t\tdefault: return assertNever(strength, `Unsupported lock strength: ${String(strength)}`);\n\t}\n}\nfunction lockWaitPolicyKeyword(waitPolicy) {\n\tswitch (waitPolicy) {\n\t\tcase \"nowait\": return \"NOWAIT\";\n\t\tcase \"skipLocked\": return \"SKIP LOCKED\";\n\t\tdefault: return assertNever(waitPolicy, `Unsupported lock wait policy: ${String(waitPolicy)}`);\n\t}\n}\nfunction requireCapability(capabilities, requirement) {\n\tconst capability = missingCapability(capabilities, requirement);\n\tif (capability !== void 0) throw adapterError(\"RUNTIME.AST_UNSUPPORTED\", `Postgres adapter does not report capability ${capability}, which this locking clause needs`, { meta: {\n\t\ttarget: \"postgres\",\n\t\tfeature: \"locking-clause\",\n\t\tcapability\n\t} });\n}\nfunction renderLockingClause(clause, capabilities) {\n\trequireCapability(capabilities, lockStrengthCapabilities[clause.strength]);\n\tconst parts = [lockStrengthKeyword(clause.strength)];\n\tif (clause.of !== void 0) {\n\t\trequireCapability(capabilities, lockOptionCapabilities.of);\n\t\tparts.push(`OF ${clause.of.map((name) => quoteIdentifier(name)).join(\", \")}`);\n\t}\n\tif (clause.waitPolicy !== void 0) {\n\t\trequireCapability(capabilities, lockOptionCapabilities[clause.waitPolicy]);\n\t\tparts.push(lockWaitPolicyKeyword(clause.waitPolicy));\n\t}\n\treturn parts.join(\" \");\n}\nfunction renderProjection(projection, contract, pim) {\n\treturn projection.map((item) => {\n\t\tconst alias = quoteIdentifier(item.alias);\n\t\tif (item.expr.kind === \"literal\") return `${renderLiteral(item.expr)} AS ${alias}`;\n\t\tif (item.expr.kind === \"prepared-param-ref\") return `${renderParamRef(item.expr, pim, true)} AS ${alias}`;\n\t\treturn `${renderExpr(item.expr, contract, pim)} AS ${alias}`;\n\t}).join(\", \");\n}\nfunction renderReturning(items, contract, pim) {\n\treturn items.map((item) => {\n\t\tif (item.expr.kind === \"column-ref\") {\n\t\t\tconst rendered = renderColumn(item.expr);\n\t\t\treturn item.expr.column === item.alias ? rendered : `${rendered} AS ${quoteIdentifier(item.alias)}`;\n\t\t}\n\t\tif (item.expr.kind === \"literal\") return `${renderLiteral(item.expr)} AS ${quoteIdentifier(item.alias)}`;\n\t\treturn `${renderExpr(item.expr, contract, pim)} AS ${quoteIdentifier(item.alias)}`;\n\t}).join(\", \");\n}\nfunction renderDistinctPrefix(distinct, distinctOn, contract, pim) {\n\tif (distinctOn && distinctOn.length > 0) return `DISTINCT ON (${distinctOn.map((expr) => renderExpr(expr, contract, pim)).join(\", \")}) `;\n\tif (distinct) return \"DISTINCT \";\n\treturn \"\";\n}\nfunction hasExplicitSchema(table) {\n\treturn \"schema\" in table && typeof table.schema === \"string\";\n}\nfunction qualifyTableFromNamespaceCoordinate(table, contract) {\n\tif (hasExplicitSchema(table)) return `${quoteIdentifier(table.schema)}.${quoteIdentifier(table.name)}`;\n\tif (table.namespaceId === void 0) return quoteIdentifier(table.name);\n\tconst namespace = contract.storage.namespaces[table.namespaceId];\n\tif (namespace === void 0) throw adapterError(\"RUNTIME.NAMESPACE_UNKNOWN\", `Table \"${table.name}\" references namespace \"${table.namespaceId}\" which is not present as a Postgres schema on the contract`, { meta: {\n\t\ttable: table.name,\n\t\tnamespaceId: table.namespaceId,\n\t\treason: \"not-present\"\n\t} });\n\tconst qualifyTable = namespace.qualifyTable;\n\tif (qualifyTable === void 0) throw adapterError(\"RUNTIME.NAMESPACE_UNKNOWN\", `Table \"${table.name}\" references namespace \"${table.namespaceId}\" which is not materialised as a Postgres schema on the contract`, { meta: {\n\t\ttable: table.name,\n\t\tnamespaceId: table.namespaceId,\n\t\treason: \"not-materialised\"\n\t} });\n\treturn qualifyTable.call(namespace, table.name);\n}\nfunction renderTableSource(source, contract) {\n\tconst qualified = qualifyTableFromNamespaceCoordinate(source, contract);\n\tif (!source.alias) return qualified;\n\treturn `${qualified} AS ${quoteIdentifier(source.alias)}`;\n}\nfunction renderSource(source, contract, pim) {\n\tconst node = source;\n\tswitch (node.kind) {\n\t\tcase \"table-source\": return renderTableSource(node, contract);\n\t\tcase \"derived-table-source\": return `(${renderSelect(node.query, contract, pim)}) AS ${quoteIdentifier(node.alias)}`;\n\t\tcase \"function-source\": {\n\t\t\tconst args = node.args.map((arg) => renderExpr(arg, contract, pim)).join(\", \");\n\t\t\treturn `${`${node.fn}(${args})`}${node.ordinality ? \" WITH ORDINALITY\" : \"\"}${node.alias === void 0 ? \"\" : ` AS ${quoteIdentifier(node.alias)}`}${node.columnAliases === void 0 ? \"\" : `(${node.columnAliases.map((column) => quoteIdentifier(column)).join(\", \")})`}`;\n\t\t}\n\t\t// v8 ignore next 4\n\t\tdefault: assertNever(node, `Unsupported source node kind: ${unreachableKind(node)}`);\n\t}\n}\nfunction assertScalarSubquery(query) {\n\tif (query.projection.length !== 1) throw adapterError(\"RUNTIME.AST_INVALID\", \"Subquery expressions must project exactly one column\", { meta: { node: \"subquery-expr\" } });\n}\nfunction renderSubqueryExpr(expr, contract, pim) {\n\tassertScalarSubquery(expr.query);\n\treturn `(${renderSelect(expr.query, contract, pim)})`;\n}\nfunction renderWhere(expr, contract, pim) {\n\treturn renderExpr(expr, contract, pim);\n}\nfunction renderNullCheck(expr, contract, pim) {\n\tconst rendered = renderExpr(expr.expr, contract, pim);\n\tconst renderedExpr = isAtomicExpressionKind(expr.expr.kind) ? rendered : `(${rendered})`;\n\treturn expr.isNull ? `${renderedExpr} IS NULL` : `${renderedExpr} IS NOT NULL`;\n}\n/**\n* Atomic expression kinds whose rendered SQL is already self-delimited (a column reference, parameter, literal, function call, aggregate, etc.) and therefore does not need surrounding parentheses when used as the left operand of a postfix predicate like `IS NULL` or `IS NOT NULL`, or as either operand of a binary infix operator.\n*\n* Anything not in this set is treated as composite (binary, AND/OR/NOT, EXISTS, nested IS NULL, subqueries, operation templates) and gets wrapped to preserve grouping.\n*/\nfunction isAtomicExpressionKind(kind) {\n\tswitch (kind) {\n\t\tcase \"column-ref\":\n\t\tcase \"identifier-ref\":\n\t\tcase \"param-ref\":\n\t\tcase \"prepared-param-ref\":\n\t\tcase \"literal\":\n\t\tcase \"aggregate\":\n\t\tcase \"window-func\":\n\t\tcase \"function-call\":\n\t\tcase \"cast\":\n\t\tcase \"case\":\n\t\tcase \"json-object\":\n\t\tcase \"json-array-agg\":\n\t\tcase \"list\": return true;\n\t\tcase \"subquery\":\n\t\tcase \"operation\":\n\t\tcase \"binary\":\n\t\tcase \"and\":\n\t\tcase \"or\":\n\t\tcase \"exists\":\n\t\tcase \"null-check\":\n\t\tcase \"not\":\n\t\tcase \"raw-expr\": return false;\n\t}\n}\nfunction renderBinary(expr, contract, pim) {\n\tif (expr.right.kind === \"list\" && expr.right.values.length === 0) {\n\t\tif (expr.op === \"in\") return \"FALSE\";\n\t\tif (expr.op === \"notIn\") return \"TRUE\";\n\t}\n\tconst leftExpr = expr.left;\n\tconst left = renderExpr(leftExpr, contract, pim);\n\tconst leftRendered = leftExpr.kind === \"operation\" || leftExpr.kind === \"subquery\" ? `(${left})` : left;\n\tconst rightNode = expr.right;\n\tlet right;\n\tswitch (rightNode.kind) {\n\t\tcase \"list\":\n\t\t\tright = renderListLiteral(rightNode, contract, pim);\n\t\t\tbreak;\n\t\tcase \"literal\":\n\t\t\tright = renderLiteral(rightNode);\n\t\t\tbreak;\n\t\tcase \"column-ref\":\n\t\t\tright = renderColumn(rightNode);\n\t\t\tbreak;\n\t\tcase \"param-ref\":\n\t\tcase \"prepared-param-ref\":\n\t\t\tright = renderParamRef(rightNode, pim);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tright = renderExpr(rightNode, contract, pim);\n\t\t\tbreak;\n\t}\n\treturn `${leftRendered} ${{\n\t\teq: \"=\",\n\t\tneq: \"!=\",\n\t\tisNotDistinctFrom: \"IS NOT DISTINCT FROM\",\n\t\tisDistinctFrom: \"IS DISTINCT FROM\",\n\t\tgt: \">\",\n\t\tlt: \"<\",\n\t\tgte: \">=\",\n\t\tlte: \"<=\",\n\t\tlike: \"LIKE\",\n\t\tin: \"IN\",\n\t\tnotIn: \"NOT IN\"\n\t}[expr.op]} ${right}`;\n}\nfunction renderListLiteral(expr, contract, pim) {\n\tif (expr.values.length === 0) return \"(NULL)\";\n\treturn `(${expr.values.map((v) => {\n\t\tif (v.kind === \"param-ref\" || v.kind === \"prepared-param-ref\") return renderParamRef(v, pim);\n\t\tif (v.kind === \"literal\") return renderLiteral(v);\n\t\treturn renderExpr(v, contract, pim);\n\t}).join(\", \")})`;\n}\nfunction renderColumn(ref) {\n\tif (ref.table === \"excluded\") return `excluded.${quoteIdentifier(ref.column)}`;\n\treturn `${quoteIdentifier(ref.table)}.${quoteIdentifier(ref.column)}`;\n}\nfunction renderAggregateExpr(expr, contract, pim) {\n\tconst fn = expr.fn.toUpperCase();\n\tif (!expr.expr) return `${fn}(*)`;\n\treturn `${fn}(${renderExpr(expr.expr, contract, pim)})`;\n}\nfunction renderWindowFuncExpr(expr, contract, pim) {\n\treturn `${expr.fn.toUpperCase()}(${expr.args.map((arg) => renderExpr(arg, contract, pim)).join(\", \")}) OVER (${[expr.partitionBy && expr.partitionBy.length > 0 ? `PARTITION BY ${expr.partitionBy.map((e) => renderExpr(e, contract, pim)).join(\", \")}` : \"\", expr.orderBy && expr.orderBy.length > 0 ? `ORDER BY ${renderOrderByItems(expr.orderBy, contract, pim)}` : \"\"].filter((part) => part.length > 0).join(\" \")})`;\n}\nfunction renderFunctionCallExpr(expr, contract, pim) {\n\tconst args = expr.args.map((arg) => renderExpr(arg, contract, pim)).join(\", \");\n\treturn `${expr.fn}(${args})`;\n}\nfunction renderCastExpr(expr, contract, pim) {\n\treturn `CAST(${renderExpr(expr.expr, contract, pim)} AS ${expr.targetType})`;\n}\nfunction renderCaseExpr(expr, contract, pim) {\n\treturn `CASE ${expr.branches.map((branch) => `WHEN ${renderExpr(branch.condition, contract, pim)} THEN ${renderExpr(branch.value, contract, pim)}`).join(\" \")}${expr.elseExpr === void 0 ? \"\" : ` ELSE ${renderExpr(expr.elseExpr, contract, pim)}`} END`;\n}\nfunction renderJsonValueProjection(projection, contract, pim) {\n\treturn projection.accept({\n\t\tcodec: ({ value, codec }) => renderExpr(projectJsonThroughCodec(value, codec, pim), contract, pim),\n\t\tnative: ({ value }) => renderExpr(value, contract, pim),\n\t\tdocument: ({ value }) => renderExpr(value, contract, pim)\n\t});\n}\nfunction projectJsonThroughCodec(value, codec, pim) {\n\tconst descriptor = pim.types.codecDescriptorRegistry.descriptorFor(codec.codecId);\n\tif (descriptor === void 0) throw adapterError(\"RUNTIME.PARAM_REF_MISSING_CODEC\", `Postgres lowering: a JSON projection carries codecId \"${codec.codecId}\" but the validated PostgreSQL codec registry has no entry for it. This usually indicates a missing extension pack in the runtime stack — register the pack that contributes this codec (e.g. \\`extensions: [pgvectorRuntime]\\`), or use the codec directly from \\`@internal/target-postgres/codecs\\` if it's a builtin.`, { meta: { codecId: codec.codecId } });\n\treturn descriptor.projectJson(value, codec);\n}\nfunction renderJsonObjectExpr(expr, contract, pim) {\n\treturn `json_build_object(${expr.entries.flatMap((entry) => {\n\t\treturn [`'${escapeLiteral(entry.key)}'`, renderJsonValueProjection(entry.value, contract, pim)];\n\t}).join(\", \")})`;\n}\nfunction renderOrderByItems(items, contract, pim) {\n\treturn items.map((item) => `${renderExpr(item.expr, contract, pim)}${ORDER_DIRECTION_SQL[item.dir]}${renderNullsPlacement(item)}`).join(\", \");\n}\nconst ORDER_DIRECTION_SQL = {\n\tasc: \" ASC\",\n\tdesc: \" DESC\"\n};\nconst ORDER_NULLS_SQL = {\n\tfirst: \" NULLS FIRST\",\n\tlast: \" NULLS LAST\"\n};\nfunction renderNullsPlacement(item) {\n\treturn item.nulls === void 0 ? \"\" : ORDER_NULLS_SQL[item.nulls];\n}\nfunction renderJsonArrayAggExpr(expr, contract, pim) {\n\tconst aggregateOrderBy = expr.orderBy && expr.orderBy.length > 0 ? ` ORDER BY ${renderOrderByItems(expr.orderBy, contract, pim)}` : \"\";\n\tconst aggregated = `json_agg(${renderJsonValueProjection(expr.expr, contract, pim)}${aggregateOrderBy})`;\n\tif (expr.onEmpty === \"emptyArray\") return `coalesce(${aggregated}, json_build_array())`;\n\treturn aggregated;\n}\nfunction renderExpr(expr, contract, pim) {\n\tconst node = expr;\n\tswitch (node.kind) {\n\t\tcase \"column-ref\": return renderColumn(node);\n\t\tcase \"identifier-ref\": return quoteIdentifier(node.name);\n\t\tcase \"operation\": return renderOperation(node, contract, pim);\n\t\tcase \"subquery\": return renderSubqueryExpr(node, contract, pim);\n\t\tcase \"aggregate\": return renderAggregateExpr(node, contract, pim);\n\t\tcase \"window-func\": return renderWindowFuncExpr(node, contract, pim);\n\t\tcase \"function-call\": return renderFunctionCallExpr(node, contract, pim);\n\t\tcase \"cast\": return renderCastExpr(node, contract, pim);\n\t\tcase \"case\": return renderCaseExpr(node, contract, pim);\n\t\tcase \"json-object\": return renderJsonObjectExpr(node, contract, pim);\n\t\tcase \"json-array-agg\": return renderJsonArrayAggExpr(node, contract, pim);\n\t\tcase \"binary\": return renderBinary(node, contract, pim);\n\t\tcase \"and\":\n\t\t\tif (node.exprs.length === 0) return \"TRUE\";\n\t\t\treturn `(${node.exprs.map((part) => renderExpr(part, contract, pim)).join(\" AND \")})`;\n\t\tcase \"or\":\n\t\t\tif (node.exprs.length === 0) return \"FALSE\";\n\t\t\treturn `(${node.exprs.map((part) => renderExpr(part, contract, pim)).join(\" OR \")})`;\n\t\tcase \"exists\": return `${node.notExists ? \"NOT \" : \"\"}EXISTS (${renderSelect(node.subquery, contract, pim)})`;\n\t\tcase \"null-check\": return renderNullCheck(node, contract, pim);\n\t\tcase \"not\": return `NOT (${renderExpr(node.expr, contract, pim)})`;\n\t\tcase \"param-ref\":\n\t\tcase \"prepared-param-ref\": return renderParamRef(node, pim);\n\t\tcase \"literal\": return renderLiteral(node);\n\t\tcase \"list\": return renderListLiteral(node, contract, pim);\n\t\tcase \"raw-expr\": return renderRawExpr(node, contract, pim);\n\t\t// v8 ignore next 4\n\t\tdefault: assertNever(node, `Unsupported expression node kind: ${unreachableKind(node)}`);\n\t}\n}\nfunction renderParamRef(ref, pim, forceCast = false) {\n\tconst index = pim.indexMap.get(ref);\n\tif (index === void 0) throw new InternalError(\"ParamRef not found in index map\");\n\tif (ref.kind === \"prepared-param-ref\") return renderTypedParam(index, ref.codec.codecId, pim.types, ref.codec.many, ref.codec.typeParams, forceCast);\n\tif (ref.codec === void 0) throw runtimeError(\"RUNTIME.PARAM_REF_MISSING_CODEC\", \"Postgres renderer: ParamRef reached lowering without a bound CodecRef. Every column-bound ParamRef must carry a codec under the AST-bound codec contract. This usually indicates a builder path that constructed a ParamRef without threading the column codec.\", {\n\t\tparamIndex: index,\n\t\t...ifDefined(\"name\", ref.name)\n\t});\n\treturn renderTypedParam(index, ref.codec.codecId, pim.types, ref.codec.many, ref.codec.typeParams);\n}\nfunction renderLiteral(expr) {\n\tif (typeof expr.value === \"string\") return `'${escapeLiteral(expr.value)}'`;\n\tif (typeof expr.value === \"number\" || typeof expr.value === \"boolean\") return String(expr.value);\n\tif (typeof expr.value === \"bigint\") return String(expr.value);\n\tif (expr.value === null) return \"NULL\";\n\tif (expr.value === void 0) return \"NULL\";\n\tif (expr.value instanceof Date) return `'${escapeLiteral(expr.value.toISOString())}'`;\n\tif (Array.isArray(expr.value)) return `ARRAY[${expr.value.map((v) => renderLiteral(new LiteralExpr(v))).join(\", \")}]`;\n\tconst json = JSON.stringify(expr.value);\n\tif (json === void 0) return \"NULL\";\n\treturn `'${escapeLiteral(json)}'`;\n}\nfunction renderOperation(expr, contract, pim) {\n\tconst self = renderExpr(expr.self, contract, pim);\n\tconst args = expr.args.map((arg) => {\n\t\treturn renderExpr(arg, contract, pim);\n\t});\n\treturn expr.lowering.template.replace(/\\{\\{self\\}\\}|\\{\\{arg(\\d+)\\}\\}/g, (token, argIndex) => {\n\t\tif (token === \"{{self}}\") return self;\n\t\tconst arg = args[Number(argIndex)];\n\t\tif (arg === void 0) throw adapterError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Operation lowering template for \"${expr.method}\" referenced missing argument {{arg${argIndex}}}; template has ${args.length} arg(s)`, { meta: { method: expr.method } });\n\t\treturn arg;\n\t});\n}\nfunction renderJoin(join, contract, pim) {\n\treturn `${join.joinType.toUpperCase()} JOIN ${join.lateral ? \"LATERAL \" : \"\"}${renderSource(join.source, contract, pim)} ON ${renderJoinOn(join.on, contract, pim)}`;\n}\nfunction renderJoinOn(on, contract, pim) {\n\tif (on.kind === \"eq-col-join-on\") return `${renderColumn(on.left)} = ${renderColumn(on.right)}`;\n\treturn renderWhere(on, contract, pim);\n}\nfunction getInsertColumnOrder(rows, contract, tableRef) {\n\tconst tableName = tableRef.name;\n\tconst orderedColumns = [];\n\tconst seenColumns = /* @__PURE__ */ new Set();\n\tfor (const row of rows) for (const column of Object.keys(row)) {\n\t\tif (seenColumns.has(column)) continue;\n\t\tseenColumns.add(column);\n\t\torderedColumns.push(column);\n\t}\n\tif (orderedColumns.length > 0) return orderedColumns;\n\tlet table;\n\tif (tableRef.namespaceId !== void 0) {\n\t\tconst ns = contract.storage.namespaces[tableRef.namespaceId];\n\t\ttable = ns !== void 0 ? ns.entries.table?.[tableName] : void 0;\n\t}\n\tif (table === void 0) for (const ns of Object.values(contract.storage.namespaces)) {\n\t\tconst found = ns.entries.table?.[tableName];\n\t\tif (found !== void 0) {\n\t\t\ttable = found;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (!table) throw adapterError(\"RUNTIME.AST_INVALID\", `INSERT target table not found in contract storage: ${tableName}`, { meta: {\n\t\tnode: \"insert\",\n\t\ttable: tableName\n\t} });\n\treturn Object.keys(table.columns);\n}\nfunction renderInsertValue(value, contract, pim) {\n\tif (!value || value.kind === \"default-value\") return \"DEFAULT\";\n\tswitch (value.kind) {\n\t\tcase \"param-ref\":\n\t\tcase \"prepared-param-ref\": return renderParamRef(value, pim);\n\t\tcase \"column-ref\": return renderColumn(value);\n\t\tcase \"raw-expr\": return renderExpr(value, contract, pim);\n\t\t// v8 ignore next 4\n\t\tdefault: assertNever(value, `Unsupported value node in INSERT: ${unreachableKind(value)}`);\n\t}\n}\nfunction renderInsert(ast, contract, pim) {\n\tconst table = renderTableSource(ast.table, contract);\n\tconst rows = ast.rows;\n\tif (rows.length === 0) throw adapterError(\"RUNTIME.AST_INVALID\", \"INSERT requires at least one row\", { meta: { node: \"insert\" } });\n\tconst hasExplicitValues = rows.some((row) => Object.keys(row).length > 0);\n\treturn `${(() => {\n\t\tif (!hasExplicitValues) {\n\t\t\tif (rows.length === 1) return `INSERT INTO ${table} DEFAULT VALUES`;\n\t\t\tconst defaultColumns = getInsertColumnOrder(rows, contract, ast.table);\n\t\t\tif (defaultColumns.length === 0) return `INSERT INTO ${table} VALUES ${rows.map(() => \"()\").join(\", \")}`;\n\t\t\tconst quotedColumns = defaultColumns.map((column) => quoteIdentifier(column));\n\t\t\tconst defaultRow = `(${defaultColumns.map(() => \"DEFAULT\").join(\", \")})`;\n\t\t\treturn `INSERT INTO ${table} (${quotedColumns.join(\", \")}) VALUES ${rows.map(() => defaultRow).join(\", \")}`;\n\t\t}\n\t\tconst columnOrder = getInsertColumnOrder(rows, contract, ast.table);\n\t\tconst columns = columnOrder.map((column) => quoteIdentifier(column));\n\t\tconst values = rows.map((row) => {\n\t\t\treturn `(${columnOrder.map((column) => renderInsertValue(row[column], contract, pim)).join(\", \")})`;\n\t\t}).join(\", \");\n\t\treturn `INSERT INTO ${table} (${columns.join(\", \")}) VALUES ${values}`;\n\t})()}${ast.onConflict ? (() => {\n\t\tconst conflictColumns = ast.onConflict.columns.map((col) => quoteIdentifier(col.column));\n\t\tconst target = conflictColumns.length === 0 ? \"\" : ` (${conflictColumns.join(\", \")})`;\n\t\tconst action = ast.onConflict.action;\n\t\tswitch (action.kind) {\n\t\t\tcase \"do-nothing\": return ` ON CONFLICT${target} DO NOTHING`;\n\t\t\tcase \"do-update-set\": {\n\t\t\t\tif (conflictColumns.length === 0) throw adapterError(\"RUNTIME.AST_INVALID\", \"INSERT onConflict requires at least one conflict column\", { meta: { node: \"insert-on-conflict\" } });\n\t\t\t\tconst updateEntries = Object.entries(action.set);\n\t\t\t\tif (updateEntries.length === 0) throw adapterError(\"RUNTIME.AST_INVALID\", \"INSERT onConflict do-update-set requires at least one assignment\", { meta: { node: \"insert-on-conflict\" } });\n\t\t\t\treturn ` ON CONFLICT${target} DO UPDATE SET ${updateEntries.map(([colName, value]) => {\n\t\t\t\t\treturn `${quoteIdentifier(colName)} = ${renderExpr(value, contract, pim)}`;\n\t\t\t\t}).join(\", \")}`;\n\t\t\t}\n\t\t\t// v8 ignore next 4\n\t\t\tdefault: assertNever(action, `Unsupported onConflict action: ${unreachableKind(action)}`);\n\t\t}\n\t})() : \"\"}${ast.returning?.length ? ` RETURNING ${renderReturning(ast.returning, contract, pim)}` : \"\"}`;\n}\nfunction renderUpdate(ast, contract, pim) {\n\tconst table = renderTableSource(ast.table, contract);\n\tconst setEntries = Object.entries(ast.set);\n\tif (setEntries.length === 0) throw adapterError(\"RUNTIME.AST_INVALID\", \"UPDATE requires at least one SET assignment\", { meta: { node: \"update\" } });\n\tconst setClauses = setEntries.map(([col, val]) => {\n\t\treturn `${quoteIdentifier(col)} = ${renderExpr(val, contract, pim)}`;\n\t});\n\tconst whereClause = ast.where ? ` WHERE ${renderWhere(ast.where, contract, pim)}` : \"\";\n\tconst returningClause = ast.returning?.length ? ` RETURNING ${renderReturning(ast.returning, contract, pim)}` : \"\";\n\treturn `UPDATE ${table} SET ${setClauses.join(\", \")}${whereClause}${returningClause}`;\n}\nfunction renderDelete(ast, contract, pim) {\n\treturn `DELETE FROM ${renderTableSource(ast.table, contract)}${ast.where ? ` WHERE ${renderWhere(ast.where, contract, pim)}` : \"\"}${ast.returning?.length ? ` RETURNING ${renderReturning(ast.returning, contract, pim)}` : \"\"}`;\n}\nfunction renderParts(parts, contract, pim) {\n\treturn parts.map((part) => typeof part === \"string\" ? part : renderExpr(part, contract, pim)).join(\"\");\n}\nfunction renderRawExpr(node, contract, pim) {\n\treturn renderParts(node.parts, contract, pim);\n}\n//#endregion\nexport { adapterError as n, renderLoweredSql as t };\n\n//# sourceMappingURL=sql-renderer-BdWJPa5F.mjs.map"],"mappings":";;;;;;;;;;;AAWA,SAAS,aAAa,MAAM,SAAS,SAAS;CAC7C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;;;;;;AAQA,MAAM,iDAAiD,IAAI,IAAI;CAC9D,OAAO;CACP,OAAO;CACP,OAAO;CACP,SAAS;CACT,SAAS;CACT,UAAU;CACV,OAAO;CACP,OAAO;CACP,OAAO;CACP,UAAU;CACV,YAAY;CACZ,cAAc;CACd,OAAO;CACP,SAAS;CACT,WAAW;CACX,MAAM;CACN,SAAS;AACV,CAAC;;;;;;;AAOD,SAAS,iBAAiB,OAAO,SAAS,OAAO,MAAM,YAAY,YAAY,OAAO;CACrF,IAAI,YAAY,KAAK,GAAG,OAAO,IAAI;CACnC,IAAI,MAAM,wBAAwB,cAAc,OAAO,MAAM,KAAK,GAAG,MAAM,aAAa,mCAAmC,gDAAgD,QAAQ,2TAA2T,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;CACngB,MAAM,WAAW,mBAAmB,SAAS;EAC5C,aAAa,MAAM;EACnB,gBAAgB,MAAM;CACvB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K,EAAE;AACtG;AACA,SAAS,cAAc,MAAM,UAAU,KAAK;CAC3C,OAAO,YAAY,KAAK,OAAO,UAAU,GAAG;AAC7C"}
|
|
1
|
+
{"version":3,"file":"sql-renderer-BdWJPa5F-Q6M1dydc.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/sql-renderer-BdWJPa5F.mjs"],"sourcesContent":["import { dataTypeParams } from \"@internal/framework-components/codec\";\nimport { LiteralExpr, collectOrderedParamRefs, lockOptionCapabilities, lockStrengthCapabilities, missingCapability } from \"@internal/sql-relational-core/ast\";\nimport { pgBit, pgBool, pgChar, pgFloat4, pgFloat8, pgInt2, pgInt4, pgInt8, pgInterval, pgNumeric, pgText, pgTime, pgTimestamp, pgTimestamptz, pgTimetz, pgVarbit, pgVarchar } from \"@internal/target-postgres/data-types\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { escapeLiteral, quoteIdentifier } from \"@internal/target-postgres/sql-utils\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError, assertNever } from \"@internal/utils/internal-error\";\nimport { isPlainRecord } from \"@internal/contract/is-plain-record\";\nimport { runtimeError } from \"@internal/framework-components/runtime\";\nimport { nameIsCatalogText, sqlBaseName, sqlDataTypeOfCodec } from \"@internal/sql-contract/data-type\";\n//#region src/core/adapter-errors.ts\nfunction adapterError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/core/sql-renderer.ts\n/**\n* Data types whose unknown-OID parameter inference is reliable in arbitrary expression positions. A parameter whose codec represents one of these is emitted as plain `$N`; everything else (including `pg/json`, `pg/jsonb`, extension types like `pgvector/vector`, and enums) is emitted as `$N::<base name>` so the planner picks an unambiguous overload.\n*\n* `pg/json` / `pg/jsonb` are intentionally excluded: their operator overloads make context inference unreliable in expression positions (e.g. `$1 -> 'key'` is ambiguous between the two).\n*/\nconst POSTGRES_INFERRABLE_DATA_TYPES = /* @__PURE__ */ new Set([\n\tpgInt2.id,\n\tpgInt4.id,\n\tpgInt8.id,\n\tpgFloat4.id,\n\tpgFloat8.id,\n\tpgNumeric.id,\n\tpgBool.id,\n\tpgText.id,\n\tpgChar.id,\n\tpgVarchar.id,\n\tpgTimestamp.id,\n\tpgTimestamptz.id,\n\tpgTime.id,\n\tpgTimetz.id,\n\tpgInterval.id,\n\tpgBit.id,\n\tpgVarbit.id\n]);\n/**\n* A parameter's cast names its data type's base name, which leaves out its parameters: an explicit\n* cast to `varchar(n)` truncates and to `numeric(p,s)` rounds. A data type whose name is its catalog\n* text has no base name, so its parameter is never cast, in any position, and the column's own input\n* function reads the value.\n*/\nfunction renderTypedParam(index, codecId, types, many, typeParams, forceCast = false) {\n\tif (codecId === void 0) return `$${index}`;\n\tif (types.codecDescriptorRegistry.descriptorFor(codecId) === void 0) throw adapterError(\"RUNTIME.PARAM_REF_MISSING_CODEC\", `Postgres lowering: ParamRef carries codecId \"${codecId}\" but the validated PostgreSQL codec registry has no entry for it. This usually indicates a missing extension pack in the runtime stack — register the pack that contributes this codec (e.g. \\`extensions: [pgvectorRuntime]\\`), or use the codec directly from \\`@internal/target-postgres/codecs\\` if it's a builtin.`, { meta: { codecId } });\n\tconst dataType = sqlDataTypeOfCodec(codecId, {\n\t\tcodecLookup: types.codecDescriptorRegistry,\n\t\tdataTypeLookup: types.dataTypeLookup\n\t});\n\tif (nameIsCatalogText(dataType)) return `$${index}`;\n\tconst arraySuffix = many ? \"[]\" : \"\";\n\tif (forceCast || !POSTGRES_INFERRABLE_DATA_TYPES.has(dataType.id) || many) return `$${index}::${sqlBaseName(dataType, dataTypeParams(dataType, isPlainRecord(typeParams) ? typeParams : void 0))}${arraySuffix}`;\n\treturn `$${index}`;\n}\nfunction unreachableKind(value) {\n\tconst candidate = value;\n\tif (typeof candidate === \"object\" && candidate !== null && \"kind\" in candidate && typeof candidate.kind === \"string\") return candidate.kind;\n\treturn \"unknown\";\n}\n/**\n* Render a SQL query AST to a Postgres-flavored `{ sql, params }` payload.\n*\n* Shared between the runtime (`PostgresAdapterImpl.lower`) and control (`PostgresControlAdapter.lower`) entrypoints so emit-time and run-time paths produce byte-identical output for the same AST.\n*/\nfunction renderLoweredSql(ast, contract, codecDescriptorRegistry, dataTypeLookup, capabilities) {\n\tconst orderedRefs = collectOrderedParamRefs(ast);\n\tconst indexMap = /* @__PURE__ */ new Map();\n\tconst params = orderedRefs.map((ref, i) => {\n\t\tindexMap.set(ref, i + 1);\n\t\treturn ref.kind === \"prepared-param-ref\" ? {\n\t\t\tkind: \"bind\",\n\t\t\tname: ref.name\n\t\t} : {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: ref.value\n\t\t};\n\t});\n\tconst pim = {\n\t\tindexMap,\n\t\ttypes: {\n\t\t\tcodecDescriptorRegistry,\n\t\t\tdataTypeLookup\n\t\t},\n\t\tcapabilities\n\t};\n\tconst node = ast;\n\tlet sql;\n\tswitch (node.kind) {\n\t\tcase \"select\":\n\t\t\tsql = renderSelect(node, contract, pim);\n\t\t\tbreak;\n\t\tcase \"insert\":\n\t\t\tsql = renderInsert(node, contract, pim);\n\t\t\tbreak;\n\t\tcase \"update\":\n\t\t\tsql = renderUpdate(node, contract, pim);\n\t\t\tbreak;\n\t\tcase \"delete\":\n\t\t\tsql = renderDelete(node, contract, pim);\n\t\t\tbreak;\n\t\tcase \"raw-query\":\n\t\t\tsql = renderParts(node.parts, contract, pim);\n\t\t\tbreak;\n\t\t// v8 ignore next 4\n\t\tdefault: assertNever(node, `Unsupported AST node kind: ${unreachableKind(node)}`);\n\t}\n\treturn Object.freeze({\n\t\tsql,\n\t\tparams: Object.freeze(params)\n\t});\n}\nfunction renderLimitOffset(keyword, value, contract, pim) {\n\tif (value === void 0) return \"\";\n\tif (typeof value === \"number\") return `${keyword} ${value}`;\n\treturn `${keyword} ${renderExpr(value, contract, pim)}`;\n}\nfunction renderSelect(ast, contract, pim) {\n\treturn [\n\t\t`SELECT ${renderDistinctPrefix(ast.distinct, ast.distinctOn, contract, pim)}${renderProjection(ast.projection, contract, pim)}`,\n\t\tast.from !== void 0 ? `FROM ${renderSource(ast.from, contract, pim)}` : \"\",\n\t\tast.joins?.length ? ast.joins.map((join) => renderJoin(join, contract, pim)).join(\" \") : \"\",\n\t\tast.where ? `WHERE ${renderWhere(ast.where, contract, pim)}` : \"\",\n\t\tast.groupBy?.length ? `GROUP BY ${ast.groupBy.map((expr) => renderExpr(expr, contract, pim)).join(\", \")}` : \"\",\n\t\tast.having ? `HAVING ${renderWhere(ast.having, contract, pim)}` : \"\",\n\t\tast.orderBy?.length ? `ORDER BY ${renderOrderByItems(ast.orderBy, contract, pim)}` : \"\",\n\t\trenderLimitOffset(\"LIMIT\", ast.limit, contract, pim),\n\t\trenderLimitOffset(\"OFFSET\", ast.offset, contract, pim),\n\t\t(ast.locking ?? []).map((clause) => renderLockingClause(clause, pim.capabilities)).join(\" \")\n\t].filter((part) => part.length > 0).join(\" \").trim();\n}\nfunction lockStrengthKeyword(strength) {\n\tswitch (strength) {\n\t\tcase \"forUpdate\": return \"FOR UPDATE\";\n\t\tcase \"forNoKeyUpdate\": return \"FOR NO KEY UPDATE\";\n\t\tcase \"forShare\": return \"FOR SHARE\";\n\t\tcase \"forKeyShare\": return \"FOR KEY SHARE\";\n\t\tdefault: return assertNever(strength, `Unsupported lock strength: ${String(strength)}`);\n\t}\n}\nfunction lockWaitPolicyKeyword(waitPolicy) {\n\tswitch (waitPolicy) {\n\t\tcase \"nowait\": return \"NOWAIT\";\n\t\tcase \"skipLocked\": return \"SKIP LOCKED\";\n\t\tdefault: return assertNever(waitPolicy, `Unsupported lock wait policy: ${String(waitPolicy)}`);\n\t}\n}\nfunction requireCapability(capabilities, requirement) {\n\tconst capability = missingCapability(capabilities, requirement);\n\tif (capability !== void 0) throw adapterError(\"RUNTIME.AST_UNSUPPORTED\", `Postgres adapter does not report capability ${capability}, which this locking clause needs`, { meta: {\n\t\ttarget: \"postgres\",\n\t\tfeature: \"locking-clause\",\n\t\tcapability\n\t} });\n}\nfunction renderLockingClause(clause, capabilities) {\n\trequireCapability(capabilities, lockStrengthCapabilities[clause.strength]);\n\tconst parts = [lockStrengthKeyword(clause.strength)];\n\tif (clause.of !== void 0) {\n\t\trequireCapability(capabilities, lockOptionCapabilities.of);\n\t\tparts.push(`OF ${clause.of.map((name) => quoteIdentifier(name)).join(\", \")}`);\n\t}\n\tif (clause.waitPolicy !== void 0) {\n\t\trequireCapability(capabilities, lockOptionCapabilities[clause.waitPolicy]);\n\t\tparts.push(lockWaitPolicyKeyword(clause.waitPolicy));\n\t}\n\treturn parts.join(\" \");\n}\nfunction renderProjection(projection, contract, pim) {\n\treturn projection.map((item) => {\n\t\tconst alias = quoteIdentifier(item.alias);\n\t\tif (item.expr.kind === \"literal\") return `${renderLiteral(item.expr)} AS ${alias}`;\n\t\tif (item.expr.kind === \"prepared-param-ref\") return `${renderParamRef(item.expr, pim, true)} AS ${alias}`;\n\t\treturn `${renderExpr(item.expr, contract, pim)} AS ${alias}`;\n\t}).join(\", \");\n}\nfunction renderReturning(items, contract, pim) {\n\treturn items.map((item) => {\n\t\tif (item.expr.kind === \"column-ref\") {\n\t\t\tconst rendered = renderColumn(item.expr);\n\t\t\treturn item.expr.column === item.alias ? rendered : `${rendered} AS ${quoteIdentifier(item.alias)}`;\n\t\t}\n\t\tif (item.expr.kind === \"literal\") return `${renderLiteral(item.expr)} AS ${quoteIdentifier(item.alias)}`;\n\t\treturn `${renderExpr(item.expr, contract, pim)} AS ${quoteIdentifier(item.alias)}`;\n\t}).join(\", \");\n}\nfunction renderDistinctPrefix(distinct, distinctOn, contract, pim) {\n\tif (distinctOn && distinctOn.length > 0) return `DISTINCT ON (${distinctOn.map((expr) => renderExpr(expr, contract, pim)).join(\", \")}) `;\n\tif (distinct) return \"DISTINCT \";\n\treturn \"\";\n}\nfunction hasExplicitSchema(table) {\n\treturn \"schema\" in table && typeof table.schema === \"string\";\n}\nfunction qualifyTableFromNamespaceCoordinate(table, contract) {\n\tif (hasExplicitSchema(table)) return `${quoteIdentifier(table.schema)}.${quoteIdentifier(table.name)}`;\n\tif (table.namespaceId === void 0) return quoteIdentifier(table.name);\n\tconst namespace = contract.storage.namespaces[table.namespaceId];\n\tif (namespace === void 0) throw adapterError(\"RUNTIME.NAMESPACE_UNKNOWN\", `Table \"${table.name}\" references namespace \"${table.namespaceId}\" which is not present as a Postgres schema on the contract`, { meta: {\n\t\ttable: table.name,\n\t\tnamespaceId: table.namespaceId,\n\t\treason: \"not-present\"\n\t} });\n\tconst qualifyTable = namespace.qualifyTable;\n\tif (qualifyTable === void 0) throw adapterError(\"RUNTIME.NAMESPACE_UNKNOWN\", `Table \"${table.name}\" references namespace \"${table.namespaceId}\" which is not materialised as a Postgres schema on the contract`, { meta: {\n\t\ttable: table.name,\n\t\tnamespaceId: table.namespaceId,\n\t\treason: \"not-materialised\"\n\t} });\n\treturn qualifyTable.call(namespace, table.name);\n}\nfunction renderTableSource(source, contract) {\n\tconst qualified = qualifyTableFromNamespaceCoordinate(source, contract);\n\tif (!source.alias) return qualified;\n\treturn `${qualified} AS ${quoteIdentifier(source.alias)}`;\n}\nfunction renderSource(source, contract, pim) {\n\tconst node = source;\n\tswitch (node.kind) {\n\t\tcase \"table-source\": return renderTableSource(node, contract);\n\t\tcase \"derived-table-source\": return `(${renderSelect(node.query, contract, pim)}) AS ${quoteIdentifier(node.alias)}`;\n\t\tcase \"function-source\": {\n\t\t\tconst args = node.args.map((arg) => renderExpr(arg, contract, pim)).join(\", \");\n\t\t\treturn `${`${node.fn}(${args})`}${node.ordinality ? \" WITH ORDINALITY\" : \"\"}${node.alias === void 0 ? \"\" : ` AS ${quoteIdentifier(node.alias)}`}${node.columnAliases === void 0 ? \"\" : `(${node.columnAliases.map((column) => quoteIdentifier(column)).join(\", \")})`}`;\n\t\t}\n\t\t// v8 ignore next 4\n\t\tdefault: assertNever(node, `Unsupported source node kind: ${unreachableKind(node)}`);\n\t}\n}\nfunction assertScalarSubquery(query) {\n\tif (query.projection.length !== 1) throw adapterError(\"RUNTIME.AST_INVALID\", \"Subquery expressions must project exactly one column\", { meta: { node: \"subquery-expr\" } });\n}\nfunction renderSubqueryExpr(expr, contract, pim) {\n\tassertScalarSubquery(expr.query);\n\treturn `(${renderSelect(expr.query, contract, pim)})`;\n}\nfunction renderWhere(expr, contract, pim) {\n\treturn renderExpr(expr, contract, pim);\n}\nfunction renderNullCheck(expr, contract, pim) {\n\tconst rendered = renderExpr(expr.expr, contract, pim);\n\tconst renderedExpr = isAtomicExpressionKind(expr.expr.kind) ? rendered : `(${rendered})`;\n\treturn expr.isNull ? `${renderedExpr} IS NULL` : `${renderedExpr} IS NOT NULL`;\n}\n/**\n* Atomic expression kinds whose rendered SQL is already self-delimited (a column reference, parameter, literal, function call, aggregate, etc.) and therefore does not need surrounding parentheses when used as the left operand of a postfix predicate like `IS NULL` or `IS NOT NULL`, or as either operand of a binary infix operator.\n*\n* Anything not in this set is treated as composite (binary, AND/OR/NOT, EXISTS, nested IS NULL, subqueries, operation templates) and gets wrapped to preserve grouping.\n*/\nfunction isAtomicExpressionKind(kind) {\n\tswitch (kind) {\n\t\tcase \"column-ref\":\n\t\tcase \"identifier-ref\":\n\t\tcase \"param-ref\":\n\t\tcase \"prepared-param-ref\":\n\t\tcase \"literal\":\n\t\tcase \"aggregate\":\n\t\tcase \"window-func\":\n\t\tcase \"function-call\":\n\t\tcase \"cast\":\n\t\tcase \"case\":\n\t\tcase \"json-object\":\n\t\tcase \"json-array-agg\":\n\t\tcase \"list\": return true;\n\t\tcase \"subquery\":\n\t\tcase \"operation\":\n\t\tcase \"binary\":\n\t\tcase \"and\":\n\t\tcase \"or\":\n\t\tcase \"exists\":\n\t\tcase \"null-check\":\n\t\tcase \"not\":\n\t\tcase \"raw-expr\": return false;\n\t}\n}\nfunction renderBinary(expr, contract, pim) {\n\tif (expr.right.kind === \"list\" && expr.right.values.length === 0) {\n\t\tif (expr.op === \"in\") return \"FALSE\";\n\t\tif (expr.op === \"notIn\") return \"TRUE\";\n\t}\n\tconst leftExpr = expr.left;\n\tconst left = renderExpr(leftExpr, contract, pim);\n\tconst leftRendered = leftExpr.kind === \"operation\" || leftExpr.kind === \"subquery\" ? `(${left})` : left;\n\tconst rightNode = expr.right;\n\tlet right;\n\tswitch (rightNode.kind) {\n\t\tcase \"list\":\n\t\t\tright = renderListLiteral(rightNode, contract, pim);\n\t\t\tbreak;\n\t\tcase \"literal\":\n\t\t\tright = renderLiteral(rightNode);\n\t\t\tbreak;\n\t\tcase \"column-ref\":\n\t\t\tright = renderColumn(rightNode);\n\t\t\tbreak;\n\t\tcase \"param-ref\":\n\t\tcase \"prepared-param-ref\":\n\t\t\tright = renderParamRef(rightNode, pim);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tright = renderExpr(rightNode, contract, pim);\n\t\t\tbreak;\n\t}\n\treturn `${leftRendered} ${{\n\t\teq: \"=\",\n\t\tneq: \"!=\",\n\t\tisNotDistinctFrom: \"IS NOT DISTINCT FROM\",\n\t\tisDistinctFrom: \"IS DISTINCT FROM\",\n\t\tgt: \">\",\n\t\tlt: \"<\",\n\t\tgte: \">=\",\n\t\tlte: \"<=\",\n\t\tlike: \"LIKE\",\n\t\tin: \"IN\",\n\t\tnotIn: \"NOT IN\"\n\t}[expr.op]} ${right}`;\n}\nfunction renderListLiteral(expr, contract, pim) {\n\tif (expr.values.length === 0) return \"(NULL)\";\n\treturn `(${expr.values.map((v) => {\n\t\tif (v.kind === \"param-ref\" || v.kind === \"prepared-param-ref\") return renderParamRef(v, pim);\n\t\tif (v.kind === \"literal\") return renderLiteral(v);\n\t\treturn renderExpr(v, contract, pim);\n\t}).join(\", \")})`;\n}\nfunction renderColumn(ref) {\n\tif (ref.table === \"excluded\") return `excluded.${quoteIdentifier(ref.column)}`;\n\treturn `${quoteIdentifier(ref.table)}.${quoteIdentifier(ref.column)}`;\n}\nfunction renderAggregateExpr(expr, contract, pim) {\n\tconst fn = expr.fn.toUpperCase();\n\tif (!expr.expr) return `${fn}(*)`;\n\treturn `${fn}(${renderExpr(expr.expr, contract, pim)})`;\n}\nfunction renderWindowFuncExpr(expr, contract, pim) {\n\treturn `${expr.fn.toUpperCase()}(${expr.args.map((arg) => renderExpr(arg, contract, pim)).join(\", \")}) OVER (${[expr.partitionBy && expr.partitionBy.length > 0 ? `PARTITION BY ${expr.partitionBy.map((e) => renderExpr(e, contract, pim)).join(\", \")}` : \"\", expr.orderBy && expr.orderBy.length > 0 ? `ORDER BY ${renderOrderByItems(expr.orderBy, contract, pim)}` : \"\"].filter((part) => part.length > 0).join(\" \")})`;\n}\nfunction renderFunctionCallExpr(expr, contract, pim) {\n\tconst args = expr.args.map((arg) => renderExpr(arg, contract, pim)).join(\", \");\n\treturn `${expr.fn}(${args})`;\n}\nfunction renderCastExpr(expr, contract, pim) {\n\treturn `CAST(${renderExpr(expr.expr, contract, pim)} AS ${expr.targetType})`;\n}\nfunction renderCaseExpr(expr, contract, pim) {\n\treturn `CASE ${expr.branches.map((branch) => `WHEN ${renderExpr(branch.condition, contract, pim)} THEN ${renderExpr(branch.value, contract, pim)}`).join(\" \")}${expr.elseExpr === void 0 ? \"\" : ` ELSE ${renderExpr(expr.elseExpr, contract, pim)}`} END`;\n}\nfunction renderJsonValueProjection(projection, contract, pim) {\n\treturn projection.accept({\n\t\tcodec: ({ value, codec }) => renderExpr(projectJsonThroughCodec(value, codec, pim), contract, pim),\n\t\tnative: ({ value }) => renderExpr(value, contract, pim),\n\t\tdocument: ({ value }) => renderExpr(value, contract, pim)\n\t});\n}\nfunction projectJsonThroughCodec(value, codec, pim) {\n\tconst descriptor = pim.types.codecDescriptorRegistry.descriptorFor(codec.codecId);\n\tif (descriptor === void 0) throw adapterError(\"RUNTIME.PARAM_REF_MISSING_CODEC\", `Postgres lowering: a JSON projection carries codecId \"${codec.codecId}\" but the validated PostgreSQL codec registry has no entry for it. This usually indicates a missing extension pack in the runtime stack — register the pack that contributes this codec (e.g. \\`extensions: [pgvectorRuntime]\\`), or use the codec directly from \\`@internal/target-postgres/codecs\\` if it's a builtin.`, { meta: { codecId: codec.codecId } });\n\treturn descriptor.projectJson(value, codec);\n}\nfunction renderJsonObjectExpr(expr, contract, pim) {\n\treturn `json_build_object(${expr.entries.flatMap((entry) => {\n\t\treturn [`'${escapeLiteral(entry.key)}'`, renderJsonValueProjection(entry.value, contract, pim)];\n\t}).join(\", \")})`;\n}\nfunction renderOrderByItems(items, contract, pim) {\n\treturn items.map((item) => `${renderExpr(item.expr, contract, pim)}${ORDER_DIRECTION_SQL[item.dir]}${renderNullsPlacement(item)}`).join(\", \");\n}\nconst ORDER_DIRECTION_SQL = {\n\tasc: \" ASC\",\n\tdesc: \" DESC\"\n};\nconst ORDER_NULLS_SQL = {\n\tfirst: \" NULLS FIRST\",\n\tlast: \" NULLS LAST\"\n};\nfunction renderNullsPlacement(item) {\n\treturn item.nulls === void 0 ? \"\" : ORDER_NULLS_SQL[item.nulls];\n}\nfunction renderJsonArrayAggExpr(expr, contract, pim) {\n\tconst aggregateOrderBy = expr.orderBy && expr.orderBy.length > 0 ? ` ORDER BY ${renderOrderByItems(expr.orderBy, contract, pim)}` : \"\";\n\tconst aggregated = `json_agg(${renderJsonValueProjection(expr.expr, contract, pim)}${aggregateOrderBy})`;\n\tif (expr.onEmpty === \"emptyArray\") return `coalesce(${aggregated}, json_build_array())`;\n\treturn aggregated;\n}\nfunction renderExpr(expr, contract, pim) {\n\tconst node = expr;\n\tswitch (node.kind) {\n\t\tcase \"column-ref\": return renderColumn(node);\n\t\tcase \"identifier-ref\": return quoteIdentifier(node.name);\n\t\tcase \"operation\": return renderOperation(node, contract, pim);\n\t\tcase \"subquery\": return renderSubqueryExpr(node, contract, pim);\n\t\tcase \"aggregate\": return renderAggregateExpr(node, contract, pim);\n\t\tcase \"window-func\": return renderWindowFuncExpr(node, contract, pim);\n\t\tcase \"function-call\": return renderFunctionCallExpr(node, contract, pim);\n\t\tcase \"cast\": return renderCastExpr(node, contract, pim);\n\t\tcase \"case\": return renderCaseExpr(node, contract, pim);\n\t\tcase \"json-object\": return renderJsonObjectExpr(node, contract, pim);\n\t\tcase \"json-array-agg\": return renderJsonArrayAggExpr(node, contract, pim);\n\t\tcase \"binary\": return renderBinary(node, contract, pim);\n\t\tcase \"and\":\n\t\t\tif (node.exprs.length === 0) return \"TRUE\";\n\t\t\treturn `(${node.exprs.map((part) => renderExpr(part, contract, pim)).join(\" AND \")})`;\n\t\tcase \"or\":\n\t\t\tif (node.exprs.length === 0) return \"FALSE\";\n\t\t\treturn `(${node.exprs.map((part) => renderExpr(part, contract, pim)).join(\" OR \")})`;\n\t\tcase \"exists\": return `${node.notExists ? \"NOT \" : \"\"}EXISTS (${renderSelect(node.subquery, contract, pim)})`;\n\t\tcase \"null-check\": return renderNullCheck(node, contract, pim);\n\t\tcase \"not\": return `NOT (${renderExpr(node.expr, contract, pim)})`;\n\t\tcase \"param-ref\":\n\t\tcase \"prepared-param-ref\": return renderParamRef(node, pim);\n\t\tcase \"literal\": return renderLiteral(node);\n\t\tcase \"list\": return renderListLiteral(node, contract, pim);\n\t\tcase \"raw-expr\": return renderRawExpr(node, contract, pim);\n\t\t// v8 ignore next 4\n\t\tdefault: assertNever(node, `Unsupported expression node kind: ${unreachableKind(node)}`);\n\t}\n}\nfunction renderParamRef(ref, pim, forceCast = false) {\n\tconst index = pim.indexMap.get(ref);\n\tif (index === void 0) throw new InternalError(\"ParamRef not found in index map\");\n\tif (ref.kind === \"prepared-param-ref\") return renderTypedParam(index, ref.codec.codecId, pim.types, ref.codec.many, ref.codec.typeParams, forceCast);\n\tif (ref.codec === void 0) throw runtimeError(\"RUNTIME.PARAM_REF_MISSING_CODEC\", \"Postgres renderer: ParamRef reached lowering without a bound CodecRef. Every column-bound ParamRef must carry a codec under the AST-bound codec contract. This usually indicates a builder path that constructed a ParamRef without threading the column codec.\", {\n\t\tparamIndex: index,\n\t\t...ifDefined(\"name\", ref.name)\n\t});\n\treturn renderTypedParam(index, ref.codec.codecId, pim.types, ref.codec.many, ref.codec.typeParams);\n}\nfunction renderLiteral(expr) {\n\tif (typeof expr.value === \"string\") return `'${escapeLiteral(expr.value)}'`;\n\tif (typeof expr.value === \"number\" || typeof expr.value === \"boolean\") return String(expr.value);\n\tif (typeof expr.value === \"bigint\") return String(expr.value);\n\tif (expr.value === null) return \"NULL\";\n\tif (expr.value === void 0) return \"NULL\";\n\tif (expr.value instanceof Date) return `'${escapeLiteral(expr.value.toISOString())}'`;\n\tif (Array.isArray(expr.value)) return `ARRAY[${expr.value.map((v) => renderLiteral(new LiteralExpr(v))).join(\", \")}]`;\n\tconst json = JSON.stringify(expr.value);\n\tif (json === void 0) return \"NULL\";\n\treturn `'${escapeLiteral(json)}'`;\n}\nfunction renderOperation(expr, contract, pim) {\n\tconst self = renderExpr(expr.self, contract, pim);\n\tconst args = expr.args.map((arg) => {\n\t\treturn renderExpr(arg, contract, pim);\n\t});\n\treturn expr.lowering.template.replace(/\\{\\{self\\}\\}|\\{\\{arg(\\d+)\\}\\}/g, (token, argIndex) => {\n\t\tif (token === \"{{self}}\") return self;\n\t\tconst arg = args[Number(argIndex)];\n\t\tif (arg === void 0) throw adapterError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Operation lowering template for \"${expr.method}\" referenced missing argument {{arg${argIndex}}}; template has ${args.length} arg(s)`, { meta: { method: expr.method } });\n\t\treturn arg;\n\t});\n}\nfunction renderJoin(join, contract, pim) {\n\treturn `${join.joinType.toUpperCase()} JOIN ${join.lateral ? \"LATERAL \" : \"\"}${renderSource(join.source, contract, pim)} ON ${renderJoinOn(join.on, contract, pim)}`;\n}\nfunction renderJoinOn(on, contract, pim) {\n\tif (on.kind === \"eq-col-join-on\") return `${renderColumn(on.left)} = ${renderColumn(on.right)}`;\n\treturn renderWhere(on, contract, pim);\n}\nfunction getInsertColumnOrder(rows, contract, tableRef) {\n\tconst tableName = tableRef.name;\n\tconst orderedColumns = [];\n\tconst seenColumns = /* @__PURE__ */ new Set();\n\tfor (const row of rows) for (const column of Object.keys(row)) {\n\t\tif (seenColumns.has(column)) continue;\n\t\tseenColumns.add(column);\n\t\torderedColumns.push(column);\n\t}\n\tif (orderedColumns.length > 0) return orderedColumns;\n\tlet table;\n\tif (tableRef.namespaceId !== void 0) {\n\t\tconst ns = contract.storage.namespaces[tableRef.namespaceId];\n\t\ttable = ns !== void 0 ? ns.entries.table?.[tableName] : void 0;\n\t}\n\tif (table === void 0) for (const ns of Object.values(contract.storage.namespaces)) {\n\t\tconst found = ns.entries.table?.[tableName];\n\t\tif (found !== void 0) {\n\t\t\ttable = found;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (!table) throw adapterError(\"RUNTIME.AST_INVALID\", `INSERT target table not found in contract storage: ${tableName}`, { meta: {\n\t\tnode: \"insert\",\n\t\ttable: tableName\n\t} });\n\treturn Object.keys(table.columns);\n}\nfunction renderInsertValue(value, contract, pim) {\n\tif (!value || value.kind === \"default-value\") return \"DEFAULT\";\n\tswitch (value.kind) {\n\t\tcase \"param-ref\":\n\t\tcase \"prepared-param-ref\": return renderParamRef(value, pim);\n\t\tcase \"column-ref\": return renderColumn(value);\n\t\tcase \"raw-expr\": return renderExpr(value, contract, pim);\n\t\t// v8 ignore next 4\n\t\tdefault: assertNever(value, `Unsupported value node in INSERT: ${unreachableKind(value)}`);\n\t}\n}\nfunction renderInsert(ast, contract, pim) {\n\tconst table = renderTableSource(ast.table, contract);\n\tconst rows = ast.rows;\n\tif (rows.length === 0) throw adapterError(\"RUNTIME.AST_INVALID\", \"INSERT requires at least one row\", { meta: { node: \"insert\" } });\n\tconst hasExplicitValues = rows.some((row) => Object.keys(row).length > 0);\n\treturn `${(() => {\n\t\tif (!hasExplicitValues) {\n\t\t\tif (rows.length === 1) return `INSERT INTO ${table} DEFAULT VALUES`;\n\t\t\tconst defaultColumns = getInsertColumnOrder(rows, contract, ast.table);\n\t\t\tif (defaultColumns.length === 0) return `INSERT INTO ${table} VALUES ${rows.map(() => \"()\").join(\", \")}`;\n\t\t\tconst quotedColumns = defaultColumns.map((column) => quoteIdentifier(column));\n\t\t\tconst defaultRow = `(${defaultColumns.map(() => \"DEFAULT\").join(\", \")})`;\n\t\t\treturn `INSERT INTO ${table} (${quotedColumns.join(\", \")}) VALUES ${rows.map(() => defaultRow).join(\", \")}`;\n\t\t}\n\t\tconst columnOrder = getInsertColumnOrder(rows, contract, ast.table);\n\t\tconst columns = columnOrder.map((column) => quoteIdentifier(column));\n\t\tconst values = rows.map((row) => {\n\t\t\treturn `(${columnOrder.map((column) => renderInsertValue(row[column], contract, pim)).join(\", \")})`;\n\t\t}).join(\", \");\n\t\treturn `INSERT INTO ${table} (${columns.join(\", \")}) VALUES ${values}`;\n\t})()}${ast.onConflict ? (() => {\n\t\tconst conflictColumns = ast.onConflict.columns.map((col) => quoteIdentifier(col.column));\n\t\tconst target = conflictColumns.length === 0 ? \"\" : ` (${conflictColumns.join(\", \")})`;\n\t\tconst action = ast.onConflict.action;\n\t\tswitch (action.kind) {\n\t\t\tcase \"do-nothing\": return ` ON CONFLICT${target} DO NOTHING`;\n\t\t\tcase \"do-update-set\": {\n\t\t\t\tif (conflictColumns.length === 0) throw adapterError(\"RUNTIME.AST_INVALID\", \"INSERT onConflict requires at least one conflict column\", { meta: { node: \"insert-on-conflict\" } });\n\t\t\t\tconst updateEntries = Object.entries(action.set);\n\t\t\t\tif (updateEntries.length === 0) throw adapterError(\"RUNTIME.AST_INVALID\", \"INSERT onConflict do-update-set requires at least one assignment\", { meta: { node: \"insert-on-conflict\" } });\n\t\t\t\treturn ` ON CONFLICT${target} DO UPDATE SET ${updateEntries.map(([colName, value]) => {\n\t\t\t\t\treturn `${quoteIdentifier(colName)} = ${renderExpr(value, contract, pim)}`;\n\t\t\t\t}).join(\", \")}`;\n\t\t\t}\n\t\t\t// v8 ignore next 4\n\t\t\tdefault: assertNever(action, `Unsupported onConflict action: ${unreachableKind(action)}`);\n\t\t}\n\t})() : \"\"}${ast.returning?.length ? ` RETURNING ${renderReturning(ast.returning, contract, pim)}` : \"\"}`;\n}\nfunction renderUpdate(ast, contract, pim) {\n\tconst table = renderTableSource(ast.table, contract);\n\tconst setEntries = Object.entries(ast.set);\n\tif (setEntries.length === 0) throw adapterError(\"RUNTIME.AST_INVALID\", \"UPDATE requires at least one SET assignment\", { meta: { node: \"update\" } });\n\tconst setClauses = setEntries.map(([col, val]) => {\n\t\treturn `${quoteIdentifier(col)} = ${renderExpr(val, contract, pim)}`;\n\t});\n\tconst whereClause = ast.where ? ` WHERE ${renderWhere(ast.where, contract, pim)}` : \"\";\n\tconst returningClause = ast.returning?.length ? ` RETURNING ${renderReturning(ast.returning, contract, pim)}` : \"\";\n\treturn `UPDATE ${table} SET ${setClauses.join(\", \")}${whereClause}${returningClause}`;\n}\nfunction renderDelete(ast, contract, pim) {\n\treturn `DELETE FROM ${renderTableSource(ast.table, contract)}${ast.where ? ` WHERE ${renderWhere(ast.where, contract, pim)}` : \"\"}${ast.returning?.length ? ` RETURNING ${renderReturning(ast.returning, contract, pim)}` : \"\"}`;\n}\nfunction renderParts(parts, contract, pim) {\n\treturn parts.map((part) => typeof part === \"string\" ? part : renderExpr(part, contract, pim)).join(\"\");\n}\nfunction renderRawExpr(node, contract, pim) {\n\treturn renderParts(node.parts, contract, pim);\n}\n//#endregion\nexport { adapterError as n, renderLoweredSql as t };\n\n//# sourceMappingURL=sql-renderer-BdWJPa5F.mjs.map"],"mappings":";;;;;;;;;;;AAWA,SAAS,aAAa,MAAM,SAAS,SAAS;CAC7C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;;;;;;AAQA,MAAM,iDAAiD,IAAI,IAAI;CAC9D,OAAO;CACP,OAAO;CACP,OAAO;CACP,SAAS;CACT,SAAS;CACT,UAAU;CACV,OAAO;CACP,OAAO;CACP,OAAO;CACP,UAAU;CACV,YAAY;CACZ,cAAc;CACd,OAAO;CACP,SAAS;CACT,WAAW;CACX,MAAM;CACN,SAAS;AACV,CAAC;;;;;;;AAOD,SAAS,iBAAiB,OAAO,SAAS,OAAO,MAAM,YAAY,YAAY,OAAO;CACrF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AAU,YAAY,IAAI,OAAO,UAAU,GAAG,MAAM,KAAK,IAAI,WAAW,SAAS,cAAc,gBAAgB,IAAI,WAAW,UAAU,GAAG,MAAM;AAC7N;AACA,SAAS,YAAY,OAAO,UAAU,KAAK;CAC1C,OAAO,MAAM,KAAK,SAAS,OAAO,SAAS,WAAW,OAAO,WAAW,MAAM,UAAU,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE;AACtG;AACA,SAAS,cAAc,MAAM,UAAU,KAAK;CAC3C,OAAO,YAAY,KAAK,OAAO,UAAU,GAAG;AAC7C"}
|
package/dist/target.mjs
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import { A as PG_TIME_TEMPORAL_CODEC_ID, B as SQL_TEXT_CODEC_ID, C as PG_TIMESTAMPTZ_DATE_CODEC_ID, D as PG_TIMESTAMP_TEMPORAL_CODEC_ID, E as PG_TIMESTAMP_STRING_CODEC_ID, F as PG_VARCHAR_CODEC_ID, I as SQL_CHAR_CODEC_ID, L as SQL_FLOAT_CODEC_ID, M as PG_UNBOUNDED_INT_CODEC_ID, N as PG_UUID_CODEC_ID, O as PG_TIMETZ_CODEC_ID, P as PG_VARBIT_CODEC_ID, R as SQL_INT_CODEC_ID, S as PG_TEXT_CODEC_ID, T as PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, V as SQL_VARCHAR_CODEC_ID, _ as PG_INT_CODEC_ID, a as PG_DATE_STRING_CODEC_ID, b as PG_NUMERIC_CODEC_ID, c as PG_FLOAT4_CODEC_ID, d as PG_INET_CODEC_ID, f as PG_INT2_CODEC_ID, g as PG_INTERVAL_CODEC_ID, h as PG_INT8_NUMBER_CODEC_ID, i as PG_CHAR_CODEC_ID, j as PG_TSQUERY_CODEC_ID, k as PG_TIME_STRING_CODEC_ID, l as PG_FLOAT8_CODEC_ID, m as PG_INT8_CODEC_ID, n as PG_BOOL_CODEC_ID, o as PG_DATE_TEMPORAL_CODEC_ID, p as PG_INT4_CODEC_ID, r as PG_BYTEA_CODEC_ID, s as PG_ENUM_CODEC_ID, t as PG_BIT_CODEC_ID, u as PG_FLOAT_CODEC_ID, v as PG_JSONB_CODEC_ID, w as PG_TIMESTAMPTZ_STRING_CODEC_ID, x as PG_TEXT_ARRAY_CODEC_ID, y as PG_JSON_CODEC_ID, z as SQL_RAW_CODEC_ID } from "./codec-ids-BMhEpFwv-BLIC4g3Y.mjs";
|
|
2
2
|
import { t as postgresAggregateDescriptors } from "./aggregates-C7KEByGU.mjs";
|
|
3
|
-
import { a as postgresCodec, i as isPostgresCodecDescriptor, n as buildPostgresCodecDescriptorRegistry, r as definePostgresCodecs, t as PostgresCodecDescriptor } from "./codec-descriptor-
|
|
3
|
+
import { a as postgresCodec, i as isPostgresCodecDescriptor, n as buildPostgresCodecDescriptorRegistry, r as definePostgresCodecs, t as PostgresCodecDescriptor } from "./codec-descriptor-DoR-cTFZ-DKTk9Oxm.mjs";
|
|
4
4
|
import { c as postgresError, t as errorPostgresMigrationStackMissing } from "./errors-BrhQYgdL-D_lIrddD.mjs";
|
|
5
5
|
import { a as quoteQualifiedName, i as quoteIdentifier, n as escapeLiteral, o as validateEnumValueLength, r as qualifyName } from "./sql-utils-Bnw3JbWf-zvWDkyrr.mjs";
|
|
6
|
-
import { $ as qualifiedEnumName, A as pgJsonb, B as pgTimestampStoredText, C as pgInet, D as pgInterval, E as pgInt8, F as pgText, G as pgTsquery, H as pgTimestamptzStoredText, I as pgTextArray, J as pgVarchar, K as pgUuid, L as pgTime, M as pgNumeric, N as pgNumericParams, P as pgPrecisionParams, R as pgTimeStoredText, S as pgFloat8, T as pgInt4, U as pgTimetz, V as pgTimestamptz, W as pgTimetzStoredText, Y as postgresDataTypes, Z as postgresTextDataTypes, _ as pgDate, b as pgEnumParams, d as pgBool, f as pgBytea, g as pgCharacterLengthParams, h as pgChar, i as createPostgresBuiltinDataTypeLookup, j as pgJsonbEnumRefusal, k as pgJson, l as pgBit, q as pgVarbit, u as pgBitLengthParams, v as pgDateStoredText, w as pgInt2, x as pgFloat4, y as pgEnum, z as pgTimestamp } from "./data-types-
|
|
6
|
+
import { $ as qualifiedEnumName, A as pgJsonb, B as pgTimestampStoredText, C as pgInet, D as pgInterval, E as pgInt8, F as pgText, G as pgTsquery, H as pgTimestamptzStoredText, I as pgTextArray, J as pgVarchar, K as pgUuid, L as pgTime, M as pgNumeric, N as pgNumericParams, P as pgPrecisionParams, R as pgTimeStoredText, S as pgFloat8, T as pgInt4, U as pgTimetz, V as pgTimestamptz, W as pgTimetzStoredText, Y as postgresDataTypes, Z as postgresTextDataTypes, _ as pgDate, b as pgEnumParams, d as pgBool, f as pgBytea, g as pgCharacterLengthParams, h as pgChar, i as createPostgresBuiltinDataTypeLookup, j as pgJsonbEnumRefusal, k as pgJson, l as pgBit, q as pgVarbit, u as pgBitLengthParams, v as pgDateStoredText, w as pgInt2, x as pgFloat4, y as pgEnum, z as pgTimestamp } from "./data-types-Chx0mjTP-Dy6isAwB.mjs";
|
|
7
7
|
import { t as PostgresNativeEnum } from "./postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs";
|
|
8
|
-
import { A as pgVarbitColumn, C as pgNumericColumn, D as pgTimetzColumn, E as pgTimestamptzDateDescriptor, O as pgUnboundedIntColumn, S as pgJsonbColumn, T as pgTimestamptzDateColumn, _ as pgInt8Column, a as isPgEnumParams, b as pgIntervalColumn, c as pgBoolColumn, d as pgFloat4Column, f as pgFloat8Column, g as pgInt4Column, h as pgInt2Column, i as decodePostgresListText, j as pgVarcharColumn, k as pgUuidColumn, l as pgCharColumn, m as pgInetColumn, n as PgTimestamptzDateDescriptor, o as parsePostgresListText, p as pgFloatColumn, s as pgBitColumn, t as PgTimestamptzDateCodec, u as pgEnumDescriptor, v as pgInt8NumberColumn, w as pgTextColumn, x as pgJsonColumn, y as pgIntColumn } from "./codecs-
|
|
9
|
-
import { a as postgresCodecDescriptorRegistry, i as createPostgresCodecRegistryWithBuiltins, n as assemblePostgresCodecRegistryWithBuiltins, o as postgresCodecRegistry, r as createPostgresBuiltinCodecLookup, t as assemblePostgresCodecRegistry } from "./codec-registry-
|
|
8
|
+
import { A as pgVarbitColumn, C as pgNumericColumn, D as pgTimetzColumn, E as pgTimestamptzDateDescriptor, O as pgUnboundedIntColumn, S as pgJsonbColumn, T as pgTimestamptzDateColumn, _ as pgInt8Column, a as isPgEnumParams, b as pgIntervalColumn, c as pgBoolColumn, d as pgFloat4Column, f as pgFloat8Column, g as pgInt4Column, h as pgInt2Column, i as decodePostgresListText, j as pgVarcharColumn, k as pgUuidColumn, l as pgCharColumn, m as pgInetColumn, n as PgTimestamptzDateDescriptor, o as parsePostgresListText, p as pgFloatColumn, s as pgBitColumn, t as PgTimestamptzDateCodec, u as pgEnumDescriptor, v as pgInt8NumberColumn, w as pgTextColumn, x as pgJsonColumn, y as pgIntColumn } from "./codecs-CRl9-i_r-CTWJYxL0.mjs";
|
|
9
|
+
import { a as postgresCodecDescriptorRegistry, i as createPostgresCodecRegistryWithBuiltins, n as assemblePostgresCodecRegistryWithBuiltins, o as postgresCodecRegistry, r as createPostgresBuiltinCodecLookup, t as assemblePostgresCodecRegistry } from "./codec-registry-D7XslgPe-Gg6TMpPg.mjs";
|
|
10
10
|
import { f as weightGroupsOf, l as fullTextIndexProblems, n as FULL_TEXT_INDEX_TYPE, o as describeFullTextIndexProblem, t as DEFAULT_FULL_TEXT_SEARCH_LANGUAGE } from "./full-text-index-definition-BPxQQBuC-BrpDsuJu.mjs";
|
|
11
11
|
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-C6w1rzOF-bzaF5PIS.mjs";
|
|
12
12
|
import { _ as PostgresDropIndex, a as PostgresAlterIndexRename, b as PostgresDropType, c as PostgresAlterTable, d as PostgresCreatePolicy, f as PostgresCreateSchema, g as PostgresDisableRowLevelSecurity, h as PostgresDdlNode, i as DropDefaultAction, l as PostgresAlterTableSetSchema, m as PostgresCreateType, n as AddConstraintAction, o as PostgresAlterPolicyRename, p as PostgresCreateTable, r as AlterColumnTypeAction, s as PostgresAlterSchemaRename, t as AddColumnAction, u as PostgresCreateIndex, v as PostgresDropPolicy, y as PostgresDropSchema } from "./nodes-G8VTh4PM-D5t0nLdZ.mjs";
|
|
13
13
|
import { G as tablePrimaryKeyAst, I as rlsEnabledAst, K as toRegclass, P as noNullValuesAst, R as rlsPolicyExistsAst, U as tableExistsAst, V as sequenceNameAvailableAst, W as tableIsEmptyAst, _ as constraintExistsAst, b as createSchema, d as columnExistsAst, f as columnNullabilityAst, j as indexExistsAst, k as extensionExistsAst, l as columnDefaultAst, m as columnTypeAst, n as addConstraintAction, r as alterColumnTypeAction, s as alterTable, t as addColumnAction, u as columnDefaultSequenceAst, w as dropDefaultAction, x as createTable } from "./ddl-B7Rqlz6D-BcwCMSB7.mjs";
|
|
14
14
|
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-2xXXmS01.mjs";
|
|
15
|
-
import { t as postgresCodecTraitsOf } from "./postgres-codec-traits-
|
|
15
|
+
import { t as postgresCodecTraitsOf } from "./postgres-codec-traits-CnP5Bjxp-C8JED4J1.mjs";
|
|
16
16
|
import { i as policyRoleList, n as POLICY_OPERATION_PREDICATES, r as computeContentHash, t as POLICY_COMMAND_SQL } from "./canonicalize-RdxoUHao-DK_M6HU-.mjs";
|
|
17
|
-
import { c as postgresNativeAuthoringTypes, d as postgresNowGenerators, f as postgresScalarAndNativeTypeConstructors, l as postgresNowGeneratorControlDescriptors, p as postgresScalarAuthoringTypes } from "./authoring-
|
|
17
|
+
import { c as postgresNativeAuthoringTypes, d as postgresNowGenerators, f as postgresScalarAndNativeTypeConstructors, l as postgresNowGeneratorControlDescriptors, p as postgresScalarAuthoringTypes } from "./authoring-SbdvmVJh-CgZp23qA.mjs";
|
|
18
18
|
import { t as postgresRenderCheckExpressions } from "./check-expressions-7uCCP01t-WtUqfqkP.mjs";
|
|
19
|
-
import { t as postgresDataTypeEntries } from "./data-type-entries-
|
|
19
|
+
import { t as postgresDataTypeEntries } from "./data-type-entries-gQW3-KSb-uOS_mZiH.mjs";
|
|
20
20
|
import { n as PostgresSchemaNodeKind, r as PostgresTableSchemaNode, t as PostgresNativeEnumSchemaNode } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
|
|
21
21
|
import { i as PostgresRoleSchemaNode, n as PostgresNamespaceSchemaNode, r as PostgresPolicySchemaNode, t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs";
|
|
22
22
|
import { n as readPostgresDefault, t as postgresResolveDefault } from "./default-normalizer-BqK6XxdC-BAgxt9FF.mjs";
|
|
23
23
|
import { n as renderFullTextIndexDocument } from "./full-text-search-document-Doy5TF7c-DezgYsP-.mjs";
|
|
24
24
|
import { r as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-D3VNPMSm-DVuswLch.mjs";
|
|
25
|
-
import { a as stackDataTypes, i as qualifyTableName, t as alterTypeCheck } from "./planner-sql-checks-
|
|
26
|
-
import { A as RenameColumnCall, C as DropNativeEnumTypeCall, D as DropTableCall, E as DropSchemaCall, F as RenameTableCall, H as createExtension, L as SetDefaultCall, M as RenameIndexCall, N as RenamePostgresRlsPolicyCall, O as EnableRowLevelSecurityCall, P as RenameSchemaCall, R as SetNotNullCall, S as DropIndexCall, T as DropPostgresRlsPolicyCall, _ as DisableRowLevelSecurityCall, a as AddNativeEnumValueCall, b as DropConstraintCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, g as DataTransformCall, h as CreateTableCall, i as AddForeignKeyCall, j as RenameConstraintCall, k as RawSqlCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, o as AddPrimaryKeyCall, p as CreatePostgresRlsPolicyCall, r as AddColumnWithTemporaryDefaultCall, s as AddRequiredColumnToEmptyTableCall, t as AddCheckConstraintCall, u as CreateExtensionCall, v as DropCheckConstraintCall, w as DropNotNullCall, x as DropDefaultCall, y as DropColumnCall, z as SetTableSchemaCall } from "./op-factory-call-
|
|
27
|
-
import { t as buildColumnTypeSql } from "./planner-ddl-builders-
|
|
28
|
-
import { n as resolveIdentityValue, t as buildBuiltinIdentityValue } from "./planner-identity-values-
|
|
29
|
-
import { a as planIssues, t as coalesceSubtreeIssues } from "./control-policy-
|
|
30
|
-
import { n as contractToPostgresDatabaseSchemaNode, t as buildPostgresPlanDiff } from "./diff-database-schema-
|
|
31
|
-
import { n as PostgresContractView, t as PostgresContractSerializer } from "./postgres-contract-view-
|
|
25
|
+
import { a as stackDataTypes, i as qualifyTableName, t as alterTypeCheck } from "./planner-sql-checks-D-K44J19-BgZ15ipJ.mjs";
|
|
26
|
+
import { A as RenameColumnCall, C as DropNativeEnumTypeCall, D as DropTableCall, E as DropSchemaCall, F as RenameTableCall, H as createExtension, L as SetDefaultCall, M as RenameIndexCall, N as RenamePostgresRlsPolicyCall, O as EnableRowLevelSecurityCall, P as RenameSchemaCall, R as SetNotNullCall, S as DropIndexCall, T as DropPostgresRlsPolicyCall, _ as DisableRowLevelSecurityCall, a as AddNativeEnumValueCall, b as DropConstraintCall, c as AddUniqueCall, d as CreateIndexCall, f as CreateNativeEnumTypeCall, g as DataTransformCall, h as CreateTableCall, i as AddForeignKeyCall, j as RenameConstraintCall, k as RawSqlCall, l as AlterColumnTypeCall, m as CreateSchemaCall, n as AddColumnCall, o as AddPrimaryKeyCall, p as CreatePostgresRlsPolicyCall, r as AddColumnWithTemporaryDefaultCall, s as AddRequiredColumnToEmptyTableCall, t as AddCheckConstraintCall, u as CreateExtensionCall, v as DropCheckConstraintCall, w as DropNotNullCall, x as DropDefaultCall, y as DropColumnCall, z as SetTableSchemaCall } from "./op-factory-call-ClvHxHDs-CeVV_tro.mjs";
|
|
27
|
+
import { t as buildColumnTypeSql } from "./planner-ddl-builders-cYnH52gC-DaVKo24n.mjs";
|
|
28
|
+
import { n as resolveIdentityValue, t as buildBuiltinIdentityValue } from "./planner-identity-values-QstrMJ2U-Cb8Fdh_W.mjs";
|
|
29
|
+
import { a as planIssues, t as coalesceSubtreeIssues } from "./control-policy-DzFOPk9n-BmAgBCQb.mjs";
|
|
30
|
+
import { n as contractToPostgresDatabaseSchemaNode, t as buildPostgresPlanDiff } from "./diff-database-schema-B1NfYBTr-DPdFDCpE.mjs";
|
|
31
|
+
import { n as PostgresContractView, t as PostgresContractSerializer } from "./postgres-contract-view-BO2elRMz-K6dYYr20.mjs";
|
|
32
32
|
import { t as dataTransform } from "./data-transform-h9agBu_c-B5dsDs8G.mjs";
|
|
33
|
-
import { t as PostgresMigration } from "./postgres-migration
|
|
34
|
-
import { t as renderOps } from "./render-ops-
|
|
33
|
+
import { t as PostgresMigration } from "./postgres-migration-gIPIgR1z-CvKPHina.mjs";
|
|
34
|
+
import { t as renderOps } from "./render-ops-DKPk74iS-Cfil02bJ.mjs";
|
|
35
35
|
import { t as renderCallsToTypeScript } from "./render-typescript-Dqp1Spgn-B128r1qw.mjs";
|
|
36
|
-
import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-
|
|
37
|
-
import { t as createPostgresMigrationPlanner } from "./planner-
|
|
36
|
+
import { t as TypeScriptRenderablePostgresMigration } from "./planner-produced-postgres-migration-CGnbXiL_-Clhk4Jqj.mjs";
|
|
37
|
+
import { t as createPostgresMigrationPlanner } from "./planner-CvVTpZSI-Dkpd9l81.mjs";
|
|
38
38
|
import { n as MARKER_LOCK_SQL, t as MARKER_LOCK_KEY } from "./marker-lock-DFc1Tfv5-QMJSzMIa.mjs";
|
|
39
39
|
import { c as toTsquery, l as websearchToTsquery, n as fullTextDocument, o as phrasetoTsquery, s as plaintoTsquery, t as FullTextDocument } from "./full-text-parsers-CFFxiOrp-BmiwdZ21.mjs";
|
|
40
40
|
import { t as tsquery } from "./full-text-8PmilGkW.mjs";
|
|
41
41
|
import { a as foreignKey, c as primaryKey, d as unique, i as fn, l as rawSql, n as checkExpression, o as lit, r as col, s as placeholder, t as MigrationCLI, u as sql } from "./migration-CbOh59ZJ.mjs";
|
|
42
|
-
import { t as introspectedTypeText } from "./native-type-normalizer-
|
|
42
|
+
import { t as introspectedTypeText } from "./native-type-normalizer-B7ZQZOCb.mjs";
|
|
43
43
|
import { i as hasUniqueConstraint, n as hasForeignKey, r as hasIndex, t as buildSchemaLookupMap } from "./planner-schema-lookup-CdgWer9s.mjs";
|
|
44
|
-
import { t as prisma7PostgresBinding } from "./prisma7-binding-
|
|
44
|
+
import { t as prisma7PostgresBinding } from "./prisma7-binding-TQ2GIDxX.mjs";
|
|
45
45
|
export { AddCheckConstraintCall, AddColumnAction, AddColumnCall, AddColumnWithTemporaryDefaultCall, AddConstraintAction, AddForeignKeyCall, AddNativeEnumValueCall, AddPrimaryKeyCall, AddRequiredColumnToEmptyTableCall, AddUniqueCall, AlterColumnTypeAction, AlterColumnTypeCall, CreateExtensionCall, CreateIndexCall, CreateNativeEnumTypeCall, CreatePostgresRlsPolicyCall, CreateSchemaCall, CreateTableCall, DEFAULT_FULL_TEXT_SEARCH_LANGUAGE, DataTransformCall, DisableRowLevelSecurityCall, DropCheckConstraintCall, DropColumnCall, DropConstraintCall, DropDefaultAction, DropDefaultCall, DropIndexCall, DropNativeEnumTypeCall, DropNotNullCall, DropPostgresRlsPolicyCall, DropSchemaCall, DropTableCall, EnableRowLevelSecurityCall, FULL_TEXT_INDEX_TYPE, FullTextDocument, MARKER_LOCK_KEY, MARKER_LOCK_SQL, 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_TSQUERY_CODEC_ID, PG_UNBOUNDED_INT_CODEC_ID, PG_UUID_CODEC_ID, PG_VARBIT_CODEC_ID, PG_VARCHAR_CODEC_ID, POLICY_COMMAND_SQL, POLICY_OPERATION_PREDICATES, PgTimestamptzDateCodec, PgTimestamptzDateDescriptor, PostgresAlterIndexRename, PostgresAlterPolicyRename, PostgresAlterSchemaRename, PostgresAlterTable, PostgresAlterTableSetSchema, PostgresCodecDescriptor, PostgresContractSerializer, PostgresContractView, PostgresCreateIndex, PostgresCreatePolicy, PostgresCreateSchema, PostgresCreateTable, PostgresCreateType, PostgresDatabaseSchemaNode, PostgresDdlNode, PostgresDisableRowLevelSecurity, PostgresDropIndex, PostgresDropPolicy, PostgresDropSchema, PostgresDropType, PostgresNamespaceSchemaNode, PostgresNativeEnum, PostgresNativeEnumSchemaNode, PostgresPolicySchemaNode, PostgresRlsEnablement, PostgresRlsPolicy, PostgresRole, PostgresRoleSchemaNode, PostgresSchema, PostgresSchemaNodeKind, PostgresTableSchemaNode, PostgresTableSource, PostgresUnboundSchema, RawSqlCall, RenameColumnCall, RenameConstraintCall, RenameIndexCall, RenamePostgresRlsPolicyCall, RenameSchemaCall, RenameTableCall, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_RAW_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID, SetDefaultCall, SetNotNullCall, SetTableSchemaCall, TypeScriptRenderablePostgresMigration, addColumnAction, addConstraintAction, alterColumnTypeAction, alterTable, alterTypeCheck, assemblePostgresCodecRegistry, assemblePostgresCodecRegistryWithBuiltins, buildBuiltinIdentityValue, buildColumnTypeSql, buildControlTableBootstrapQueries, buildPostgresCodecDescriptorRegistry, buildPostgresPlanDiff, buildSchemaLookupMap, buildSignMarkerBootstrapQueries, checkExpression, coalesceSubtreeIssues, col, columnDefaultAst, columnDefaultSequenceAst, columnExistsAst, columnNullabilityAst, columnTypeAst, computeContentHash, constraintExistsAst, contractToPostgresDatabaseSchemaNode, createExtension, createPostgresBuiltinCodecLookup, createPostgresBuiltinDataTypeLookup, createPostgresCodecRegistryWithBuiltins, createPostgresMigrationPlanner, createSchema, createTable, dataTransform, decodePostgresListText, definePostgresCodecs, describeFullTextIndexProblem, dropDefaultAction, errorPostgresMigrationStackMissing, escapeLiteral, extensionExistsAst, fn, foreignKey, fullTextDocument, fullTextIndexProblems, hasForeignKey, hasIndex, hasUniqueConstraint, indexExistsAst, int4, int8, introspectedTypeText, isPgEnumParams, isPostgresCodecDescriptor, isPostgresSchema, jsonb, lit, noNullValuesAst, parsePostgresListText, pgBit, pgBitColumn, pgBitLengthParams, pgBool, pgBoolColumn, pgBytea, pgChar, pgCharColumn, pgCharacterLengthParams, pgDate, pgDateStoredText, pgEnum, pgEnumDescriptor, pgEnumParams, pgFloat4, pgFloat4Column, pgFloat8, pgFloat8Column, pgFloatColumn, pgInet, pgInetColumn, pgInt2, pgInt2Column, pgInt4, pgInt4Column, pgInt8, pgInt8Column, pgInt8NumberColumn, pgIntColumn, pgInterval, pgIntervalColumn, pgJson, pgJsonColumn, pgJsonb, pgJsonbColumn, pgJsonbEnumRefusal, pgNumeric, pgNumericColumn, pgNumericParams, pgPrecisionParams, pgTable, pgText, pgTextArray, pgTextColumn, pgTime, pgTimeStoredText, pgTimestamp, pgTimestampStoredText, pgTimestamptz, pgTimestamptzDateColumn, pgTimestamptzDateDescriptor, pgTimestamptzStoredText, pgTimetz, pgTimetzColumn, pgTimetzStoredText, pgTsquery, pgUnboundedIntColumn, pgUuid, pgUuidColumn, pgVarbit, pgVarbitColumn, pgVarchar, pgVarcharColumn, phrasetoTsquery, placeholder, plaintoTsquery, planIssues, policyInputFromSerialized, policyRoleList, postgresAggregateDescriptors, postgresCodec, postgresCodecDescriptorRegistry, postgresCodecRegistry, postgresCodecTraitsOf, postgresCreateNamespace, postgresDataTypeEntries, postgresDataTypes, postgresError, postgresNativeAuthoringTypes, postgresNowGeneratorControlDescriptors, postgresNowGenerators, postgresRenderCheckExpressions, postgresResolveDefault, postgresScalarAndNativeTypeConstructors, postgresScalarAuthoringTypes, postgresTextDataTypes, primaryKey, prisma7PostgresBinding, qualifiedEnumName, qualifyName, qualifyTableName, quoteIdentifier, quoteQualifiedName, rawSql, readPostgresDefault, renderCallsToTypeScript, renderFullTextIndexDocument, renderOps, resolveDdlSchemaForNamespaceStorage, resolveIdentityValue, rlsEnabledAst, rlsPolicyExistsAst, sequenceNameAvailableAst, sql, stackDataTypes, tableExistsAst, tableIsEmptyAst, tablePrimaryKeyAst, text, textArray, timestamptz, timestamptzJsDate, toRegclass, toTsquery, tsquery, unique, validateEnumValueLength, websearchToTsquery, weightGroupsOf };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as postgresCodec, i as isPostgresCodecDescriptor, n as buildPostgresCodecDescriptorRegistry, r as definePostgresCodecs, t as PostgresCodecDescriptor } from "./codec-descriptor-
|
|
1
|
+
import { a as postgresCodec, i as isPostgresCodecDescriptor, n as buildPostgresCodecDescriptorRegistry, r as definePostgresCodecs, t as PostgresCodecDescriptor } from "./codec-descriptor-DoR-cTFZ-DKTk9Oxm.mjs";
|
|
2
2
|
export { PostgresCodecDescriptor, buildPostgresCodecDescriptorRegistry, definePostgresCodecs, isPostgresCodecDescriptor, postgresCodec };
|
package/dist/target__codecs.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as pgVarbitColumn, C as pgNumericColumn, D as pgTimetzColumn, E as pgTimestamptzDateDescriptor, O as pgUnboundedIntColumn, S as pgJsonbColumn, T as pgTimestamptzDateColumn, _ as pgInt8Column, a as isPgEnumParams, b as pgIntervalColumn, c as pgBoolColumn, d as pgFloat4Column, f as pgFloat8Column, g as pgInt4Column, h as pgInt2Column, j as pgVarcharColumn, k as pgUuidColumn, l as pgCharColumn, m as pgInetColumn, n as PgTimestamptzDateDescriptor, o as parsePostgresListText, p as pgFloatColumn, s as pgBitColumn, t as PgTimestamptzDateCodec, u as pgEnumDescriptor, v as pgInt8NumberColumn, w as pgTextColumn, x as pgJsonColumn, y as pgIntColumn } from "./codecs-
|
|
2
|
-
import { a as postgresCodecDescriptorRegistry, i as createPostgresCodecRegistryWithBuiltins, n as assemblePostgresCodecRegistryWithBuiltins, o as postgresCodecRegistry, r as createPostgresBuiltinCodecLookup, t as assemblePostgresCodecRegistry } from "./codec-registry-
|
|
1
|
+
import { A as pgVarbitColumn, C as pgNumericColumn, D as pgTimetzColumn, E as pgTimestamptzDateDescriptor, O as pgUnboundedIntColumn, S as pgJsonbColumn, T as pgTimestamptzDateColumn, _ as pgInt8Column, a as isPgEnumParams, b as pgIntervalColumn, c as pgBoolColumn, d as pgFloat4Column, f as pgFloat8Column, g as pgInt4Column, h as pgInt2Column, j as pgVarcharColumn, k as pgUuidColumn, l as pgCharColumn, m as pgInetColumn, n as PgTimestamptzDateDescriptor, o as parsePostgresListText, p as pgFloatColumn, s as pgBitColumn, t as PgTimestamptzDateCodec, u as pgEnumDescriptor, v as pgInt8NumberColumn, w as pgTextColumn, x as pgJsonColumn, y as pgIntColumn } from "./codecs-CRl9-i_r-CTWJYxL0.mjs";
|
|
2
|
+
import { a as postgresCodecDescriptorRegistry, i as createPostgresCodecRegistryWithBuiltins, n as assemblePostgresCodecRegistryWithBuiltins, o as postgresCodecRegistry, r as createPostgresBuiltinCodecLookup, t as assemblePostgresCodecRegistry } from "./codec-registry-D7XslgPe-Gg6TMpPg.mjs";
|
|
3
3
|
export { PgTimestamptzDateCodec, PgTimestamptzDateDescriptor, assemblePostgresCodecRegistry, assemblePostgresCodecRegistryWithBuiltins, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, isPgEnumParams, parsePostgresListText, pgBitColumn, pgBoolColumn, pgCharColumn, pgEnumDescriptor, pgFloat4Column, pgFloat8Column, pgFloatColumn, pgInetColumn, pgInt2Column, pgInt4Column, pgInt8Column, pgInt8NumberColumn, pgIntColumn, pgIntervalColumn, pgJsonColumn, pgJsonbColumn, pgNumericColumn, pgTextColumn, pgTimestamptzDateColumn, pgTimestamptzDateDescriptor, pgTimetzColumn, pgUnboundedIntColumn, pgUuidColumn, pgVarbitColumn, pgVarcharColumn, postgresCodecDescriptorRegistry, postgresCodecRegistry };
|
package/dist/target__control.mjs
CHANGED
|
@@ -3,28 +3,27 @@ import { c as postgresError } from "./errors-BrhQYgdL-D_lIrddD.mjs";
|
|
|
3
3
|
import { i as quoteIdentifier } from "./sql-utils-Bnw3JbWf-zvWDkyrr.mjs";
|
|
4
4
|
import { t as DEFAULT_NAMESPACE_ID } from "./namespace-ids-xtp_ZY86-Cpp8PTxD.mjs";
|
|
5
5
|
import { t as PostgresNativeEnum } from "./postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs";
|
|
6
|
-
import { P as setFallbackTemporal, i as decodePostgresListText, o as parsePostgresListText } from "./codecs-
|
|
6
|
+
import { P as setFallbackTemporal, i as decodePostgresListText, o as parsePostgresListText } from "./codecs-CRl9-i_r-CTWJYxL0.mjs";
|
|
7
7
|
import { s as fullTextIndexDefinitionOf } from "./full-text-index-definition-BPxQQBuC-BrpDsuJu.mjs";
|
|
8
8
|
import { i as PostgresRlsPolicy, n as PostgresRlsEnablement, o as PostgresRole } from "./postgres-schema-C6w1rzOF-bzaF5PIS.mjs";
|
|
9
9
|
import { r as computeContentHash } from "./canonicalize-RdxoUHao-DK_M6HU-.mjs";
|
|
10
|
-
import { c as postgresNativeAuthoringTypes, f as postgresScalarAndNativeTypeConstructors, l as postgresNowGeneratorControlDescriptors, p as postgresScalarAuthoringTypes, t as POLICY_BLOCK_KEYWORDS } from "./authoring-
|
|
10
|
+
import { c as postgresNativeAuthoringTypes, f as postgresScalarAndNativeTypeConstructors, l as postgresNowGeneratorControlDescriptors, p as postgresScalarAuthoringTypes, t as POLICY_BLOCK_KEYWORDS } from "./authoring-SbdvmVJh-CgZp23qA.mjs";
|
|
11
11
|
import { t as postgresRenderCheckExpressions } from "./check-expressions-7uCCP01t-WtUqfqkP.mjs";
|
|
12
|
-
import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-
|
|
12
|
+
import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-DBH6aAIM-Cm1rNZaF.mjs";
|
|
13
13
|
import { a as postgresDiffSubjectGranularity, i as postgresDiffSubjectEntityKind } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
|
|
14
14
|
import { t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs";
|
|
15
|
-
import { i as qualifyTableName } from "./planner-sql-checks-
|
|
16
|
-
import { I as SCHEMA_OBJECTS_SQL, J as schemaContentsOf, Y as schemaObjectsSummary, q as schemaBlockingObjects } from "./op-factory-call-
|
|
17
|
-
import { r as diffPostgresSchema } from "./diff-database-schema-
|
|
18
|
-
import { t as PostgresContractSerializer } from "./postgres-contract-view-
|
|
19
|
-
import { o as postgresContractToSchema } from "./postgres-migration
|
|
20
|
-
import { t as createPostgresMigrationPlanner } from "./planner-
|
|
15
|
+
import { i as qualifyTableName } from "./planner-sql-checks-D-K44J19-BgZ15ipJ.mjs";
|
|
16
|
+
import { I as SCHEMA_OBJECTS_SQL, J as schemaContentsOf, Y as schemaObjectsSummary, q as schemaBlockingObjects } from "./op-factory-call-ClvHxHDs-CeVV_tro.mjs";
|
|
17
|
+
import { r as diffPostgresSchema } from "./diff-database-schema-B1NfYBTr-DPdFDCpE.mjs";
|
|
18
|
+
import { t as PostgresContractSerializer } from "./postgres-contract-view-BO2elRMz-K6dYYr20.mjs";
|
|
19
|
+
import { o as postgresContractToSchema } from "./postgres-migration-gIPIgR1z-CvKPHina.mjs";
|
|
20
|
+
import { t as createPostgresMigrationPlanner } from "./planner-CvVTpZSI-Dkpd9l81.mjs";
|
|
21
21
|
import { n as MARKER_LOCK_SQL, t as MARKER_LOCK_KEY } from "./marker-lock-DFc1Tfv5-QMJSzMIa.mjs";
|
|
22
|
-
import { a as buildIndexAttribute, c as buildNativeEnumBlock, d as inferPostgresPslContract, f as namedArg, g as positionalArg, h as parseDefaultAttributeString, i as buildFullTextIndexAttribute, n as buildAttribute, o as buildMapAttribute, r as buildCheckAttribute, s as buildModelConstraintAttribute, t as SYNTHETIC_SPAN } from "./infer-psl-contract-
|
|
22
|
+
import { a as buildIndexAttribute, c as buildNativeEnumBlock, d as inferPostgresPslContract, f as namedArg, g as positionalArg, h as parseDefaultAttributeString, i as buildFullTextIndexAttribute, n as buildAttribute, o as buildMapAttribute, r as buildCheckAttribute, s as buildModelConstraintAttribute, t as SYNTHETIC_SPAN } from "./infer-psl-contract-BSSHcuRi-DryV3wqN.mjs";
|
|
23
23
|
import { dataTypeParams, requiredParamKeys, validateCodecTypeParams } from "@prisma/orm-framework/components/codec";
|
|
24
24
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
25
25
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
26
26
|
import { isSqlDataType, sqlCodecColumnLength, unquotedSqlBaseName } from "@prisma/orm-family-sql/contract/data-type";
|
|
27
|
-
import { escapePslString } from "@prisma/orm-family-sql/contract/data-type-support";
|
|
28
27
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
29
28
|
import { StorageColumn, nonEmptyTypeParams } from "@prisma/orm-family-sql/contract/types";
|
|
30
29
|
import { APP_SPACE_ID, failedPostcheckWhy, failedPrecheckWhy, schemaCheckWhy, withDatabaseUnchanged, withFailingSpace } from "@prisma/orm-framework/components/control";
|
|
@@ -40,6 +39,7 @@ import { SqlSchemaVerifierBase } from "@prisma/orm-family-sql/family/ir";
|
|
|
40
39
|
import { effectiveControlPolicy } from "@prisma/orm-framework/contract/types";
|
|
41
40
|
import { generatorCallsFor, inferredTypeConstructors, mapDefault, writeDefaultLiteral, writtenTypeArguments } from "@prisma/orm-family-sql/family/psl-build";
|
|
42
41
|
import { UNBOUND_PSL_NAMESPACE_NAME, UNSPECIFIED_PSL_NAMESPACE_ID, makePslNamespace, makePslNamespaceEntries } from "@prisma/orm-framework/components/psl-ast";
|
|
42
|
+
import { escapePslString } from "@prisma/orm-family-sql/contract/data-type-support";
|
|
43
43
|
import { Temporal } from "temporal-polyfill/full/implementation";
|
|
44
44
|
import { SqlQueryError } from "@prisma/orm-family-sql/errors";
|
|
45
45
|
import { canonicalizeJson } from "@prisma/orm-framework/components/utils";
|