@prisma/orm-target-postgres 8.0.0-rc.18-dev.32 → 8.0.0-rc.18-dev.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-BLduF4bR-LPL0DsEe.mjs → adapter-BLduF4bR-DVxOjMW1.mjs} +5 -5
- package/dist/{adapter-BLduF4bR-LPL0DsEe.mjs.map → adapter-BLduF4bR-DVxOjMW1.mjs.map} +1 -1
- package/dist/{adapter-BAR5FNt5.d.mts → adapter-D_h3CcXJ.d.mts} +10 -10
- package/dist/{adapter-BAR5FNt5.d.mts.map → adapter-D_h3CcXJ.d.mts.map} +1 -1
- package/dist/adapter.d.mts +7 -7
- package/dist/adapter.mjs +4 -4
- package/dist/adapter__adapter.d.mts +1 -1
- package/dist/adapter__adapter.mjs +2 -2
- package/dist/adapter__control.d.mts +2 -2
- package/dist/adapter__control.mjs +4 -4
- package/dist/adapter__runtime.d.mts +1 -1
- package/dist/adapter__runtime.mjs +4 -4
- package/dist/adapter__sql-renderer.d.mts +1 -1
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/adapter__types.d.mts +3 -3
- package/dist/{aggregates-B3lIBjGK.d.mts → aggregates-C2xqsGZ2.d.mts} +8 -8
- package/dist/{aggregates-B3lIBjGK.d.mts.map → aggregates-C2xqsGZ2.d.mts.map} +1 -1
- package/dist/{authoring-CArQ0ZSb-BXqyKMTu.mjs → authoring-CYmxS94I-rwTYrwpM.mjs} +4 -4
- package/dist/{authoring-CArQ0ZSb-BXqyKMTu.mjs.map → authoring-CYmxS94I-rwTYrwpM.mjs.map} +1 -1
- package/dist/{autoincrement-widths-BeDdQuMU-CFDf2ypW.mjs → autoincrement-widths-hljSfPZk-C-izNyPe.mjs} +3 -3
- package/dist/{autoincrement-widths-BeDdQuMU-CFDf2ypW.mjs.map → autoincrement-widths-hljSfPZk-C-izNyPe.mjs.map} +1 -1
- package/dist/codec-descriptor-CzyUKm6m.d.mts +1 -0
- package/dist/{codec-descriptor-Cbz5bbma-dxeoAwS2.d.mts → codec-descriptor-d1ByNBEk-ClDTxfu9.d.mts} +5 -2
- package/dist/codec-descriptor-d1ByNBEk-ClDTxfu9.d.mts.map +1 -0
- package/dist/{codec-descriptor-DSMjoW72-ZoCcTHLX.mjs → codec-descriptor-hKN22hwP-BypvXBN8.mjs} +5 -4
- package/dist/codec-descriptor-hKN22hwP-BypvXBN8.mjs.map +1 -0
- package/dist/{codec-registry-C8ymMRsH-B48NRqXL.mjs → codec-registry-EFFhQhEM-DANMHp-D.mjs} +5 -5
- package/dist/{codec-registry-C8ymMRsH-B48NRqXL.mjs.map → codec-registry-EFFhQhEM-DANMHp-D.mjs.map} +1 -1
- package/dist/{codec-type-map-DiWClTtc-CUWQbVA0.d.mts → codec-type-map-Fj5xCgwT-DwIK_DR3.d.mts} +4 -4
- package/dist/{codec-type-map-DiWClTtc-CUWQbVA0.d.mts.map → codec-type-map-Fj5xCgwT-DwIK_DR3.d.mts.map} +1 -1
- package/dist/codec-types-CVyCyOV-.d.mts +2 -0
- package/dist/{codec-types-yRnVORmz-C5oISm2L.d.mts → codec-types-Ct_4iTVc-4VoGpl4J.d.mts} +4 -4
- package/dist/{codec-types-yRnVORmz-C5oISm2L.d.mts.map → codec-types-Ct_4iTVc-4VoGpl4J.d.mts.map} +1 -1
- package/dist/{codecs-DgslvOOU-eZpfm_fU.d.mts → codecs-CADK7dCR-Cku8S_Im.d.mts} +15 -4
- package/dist/codecs-CADK7dCR-Cku8S_Im.d.mts.map +1 -0
- package/dist/{codecs-DydRFxCt.d.mts → codecs-DEMQ3cMm.d.mts} +3 -3
- package/dist/{codecs-DydRFxCt.d.mts.map → codecs-DEMQ3cMm.d.mts.map} +1 -1
- package/dist/{codecs-DNjF5kIh-BkybYk_D.mjs → codecs-DGvwfB1h-BYcObjvV.mjs} +34 -17
- package/dist/codecs-DGvwfB1h-BYcObjvV.mjs.map +1 -0
- package/dist/{contract-contributions-CRCEK7Dx-Dx2tYlyZ.mjs → contract-contributions-CRCEK7Dx-B0F06bbX.mjs} +6 -6
- package/dist/{contract-contributions-CRCEK7Dx-Dx2tYlyZ.mjs.map → contract-contributions-CRCEK7Dx-B0F06bbX.mjs.map} +1 -1
- package/dist/{control-R69irs57.d.mts → control-kRer3n4t.d.mts} +2 -2
- package/dist/{control-R69irs57.d.mts.map → control-kRer3n4t.d.mts.map} +1 -1
- package/dist/{control-policy-B10lrdMt-CHUsNZat.mjs → control-policy-CifihRKs-B5UzQAd1.mjs} +9 -9
- package/dist/{control-policy-B10lrdMt-CHUsNZat.mjs.map → control-policy-CifihRKs-B5UzQAd1.mjs.map} +1 -1
- package/dist/{data-type-entries-EroSxeag-Ba-K5snn.mjs → data-type-entries-DGSg_Rid-BFK5ZVA0.mjs} +3 -3
- package/dist/{data-type-entries-EroSxeag-Ba-K5snn.mjs.map → data-type-entries-DGSg_Rid-BFK5ZVA0.mjs.map} +1 -1
- package/dist/{data-types-DhBM9bIL-CVDQGAGw.mjs → data-types-BAbkwTt9-C9WMEFNT.mjs} +14 -4
- package/dist/data-types-BAbkwTt9-C9WMEFNT.mjs.map +1 -0
- package/dist/{data-types-BTUMiCZS.d.mts → data-types-BWxZXp8N.d.mts} +4 -2
- package/dist/{data-types-BTUMiCZS.d.mts.map → data-types-BWxZXp8N.d.mts.map} +1 -1
- package/dist/{descriptor-meta-9qCQPbrI-DFEFmwBv.mjs → descriptor-meta-BZczsKUL-L5NrK7J6.mjs} +6 -6
- package/dist/{descriptor-meta-9qCQPbrI-DFEFmwBv.mjs.map → descriptor-meta-BZczsKUL-L5NrK7J6.mjs.map} +1 -1
- package/dist/{descriptor-meta-Cb7RcgEQ-CwwQ6QE8.mjs → descriptor-meta-Cb7RcgEQ-DqOiqB2V.mjs} +3 -3
- package/dist/{descriptor-meta-Cb7RcgEQ-CwwQ6QE8.mjs.map → descriptor-meta-Cb7RcgEQ-DqOiqB2V.mjs.map} +1 -1
- package/dist/{descriptor-meta-runtime-C56qYaOz-hfOBfhVz.mjs → descriptor-meta-runtime-DOxAmbAO-Gv2ogkOw.mjs} +3 -3
- package/dist/{descriptor-meta-runtime-C56qYaOz-hfOBfhVz.mjs.map → descriptor-meta-runtime-DOxAmbAO-Gv2ogkOw.mjs.map} +1 -1
- package/dist/{diff-database-schema-CmWmomi3-PoUser3Y.mjs → diff-database-schema-BHkYz_Ll-DGSW_oEV.mjs} +3 -3
- package/dist/{diff-database-schema-CmWmomi3-PoUser3Y.mjs.map → diff-database-schema-BHkYz_Ll-DGSW_oEV.mjs.map} +1 -1
- package/dist/{full-text-collection-method-DWbpg-Ep-DDs6t_BB.d.mts → full-text-collection-method-BFd2u2cs-DcN_Vf7f.d.mts} +4 -4
- package/dist/full-text-collection-method-BFd2u2cs-DcN_Vf7f.d.mts.map +1 -0
- package/dist/{full-text-OgRqBeQu.d.mts → full-text-r2wMygYZ.d.mts} +3 -3
- package/dist/{full-text-OgRqBeQu.d.mts.map → full-text-r2wMygYZ.d.mts.map} +1 -1
- package/dist/migration-CbOh59ZJ.mjs.map +1 -1
- package/dist/{native-type-normalizer-eX3KyHPA.mjs → native-type-normalizer-BR69E8QO.mjs} +2 -2
- package/dist/{native-type-normalizer-eX3KyHPA.mjs.map → native-type-normalizer-BR69E8QO.mjs.map} +1 -1
- package/dist/{op-factory-call-35RJQ1ME-BFxUakDe.mjs → op-factory-call-BfPsfi0_-DoCb1VbU.mjs} +5 -5
- package/dist/{op-factory-call-35RJQ1ME-BFxUakDe.mjs.map → op-factory-call-BfPsfi0_-DoCb1VbU.mjs.map} +1 -1
- package/dist/{operation-types-RXpAlUCj-9eC1wX5R.d.mts → operation-types--Wa_cv45-jn5HQ8yt.d.mts} +3 -3
- package/dist/{operation-types-RXpAlUCj-9eC1wX5R.d.mts.map → operation-types--Wa_cv45-jn5HQ8yt.d.mts.map} +1 -1
- package/dist/operation-types-BcOviE0b.d.mts +1 -0
- package/dist/{pack-XQaG7LAo.d.mts → pack-CZxVGiB2.d.mts} +5 -5
- package/dist/{pack-XQaG7LAo.d.mts.map → pack-CZxVGiB2.d.mts.map} +1 -1
- package/dist/{planner-olDFDn2v-Bh0e16rN.mjs → planner-DzVQXz7j-Ca88BDTV.mjs} +7 -7
- package/dist/{planner-olDFDn2v-Bh0e16rN.mjs.map → planner-DzVQXz7j-Ca88BDTV.mjs.map} +1 -1
- package/dist/{planner-ddl-builders-DujKuwcn-C0VYScBe.mjs → planner-ddl-builders-D_jr2HYG-BWETLCaT.mjs} +3 -3
- package/dist/{planner-ddl-builders-DujKuwcn-C0VYScBe.mjs.map → planner-ddl-builders-D_jr2HYG-BWETLCaT.mjs.map} +1 -1
- package/dist/{planner-identity-values-Vbk2SkMl-8xDzcTpo.mjs → planner-identity-values-CQXJs34b-BA_lpHh7.mjs} +3 -3
- package/dist/{planner-identity-values-Vbk2SkMl-8xDzcTpo.mjs.map → planner-identity-values-CQXJs34b-BA_lpHh7.mjs.map} +1 -1
- package/dist/{planner-produced-postgres-migration-BVsfYarL-C9BdUXeX.mjs → planner-produced-postgres-migration-BwMf2I5x-B5c5QXkf.mjs} +4 -4
- package/dist/{planner-produced-postgres-migration-BVsfYarL-C9BdUXeX.mjs.map → planner-produced-postgres-migration-BwMf2I5x-B5c5QXkf.mjs.map} +1 -1
- package/dist/{planner-sql-checks-BluJBZmQ-ClqyqOhD.mjs → planner-sql-checks-CiJuuHxl-2xZ6yNhV.mjs} +3 -3
- package/dist/{planner-sql-checks-BluJBZmQ-ClqyqOhD.mjs.map → planner-sql-checks-CiJuuHxl-2xZ6yNhV.mjs.map} +1 -1
- package/dist/{postgres-codec-traits-DM3rkou1-AyAbELmA.mjs → postgres-codec-traits-DVEB3LKn-Cbe9TlTB.mjs} +3 -3
- package/dist/{postgres-codec-traits-DM3rkou1-AyAbELmA.mjs.map → postgres-codec-traits-DVEB3LKn-Cbe9TlTB.mjs.map} +1 -1
- package/dist/{postgres-contract-view-xyfQHZ29-HOrk9af1.mjs → postgres-contract-view-dWC-xWeo-GesLqxrx.mjs} +7 -7
- package/dist/{postgres-contract-view-xyfQHZ29-HOrk9af1.mjs.map → postgres-contract-view-dWC-xWeo-GesLqxrx.mjs.map} +1 -1
- package/dist/{postgres-migration-fZk6Dmud-BjRqdGdm.mjs → postgres-migration-B6Jwrg_c-BhLHpVep.mjs} +8 -8
- package/dist/{postgres-migration-fZk6Dmud-BjRqdGdm.mjs.map → postgres-migration-B6Jwrg_c-BhLHpVep.mjs.map} +1 -1
- package/dist/{prisma7-binding-Dfb3osBy.mjs → prisma7-binding-D4x9fi9T.mjs} +7 -7
- package/dist/{prisma7-binding-Dfb3osBy.mjs.map → prisma7-binding-D4x9fi9T.mjs.map} +1 -1
- package/dist/{prisma7-binding-ChOxdhPc.d.mts → prisma7-binding-DYLmYZT3.d.mts} +5 -5
- package/dist/{prisma7-binding-ChOxdhPc.d.mts.map → prisma7-binding-DYLmYZT3.d.mts.map} +1 -1
- package/dist/{render-ops-DkBRaS0Z-BtGb58iC.mjs → render-ops-BdvroD9D-DkcqXKDU.mjs} +3 -3
- package/dist/{render-ops-DkBRaS0Z-BtGb58iC.mjs.map → render-ops-BdvroD9D-DkcqXKDU.mjs.map} +1 -1
- package/dist/{runtime-ONyptFAN.d.mts → runtime-CQckFo7G.d.mts} +2 -2
- package/dist/{runtime-ONyptFAN.d.mts.map → runtime-CQckFo7G.d.mts.map} +1 -1
- package/dist/{runtime-CXQ7Xh-G.d.mts → runtime-XXYjt_3Q.d.mts} +2 -2
- package/dist/{runtime-CXQ7Xh-G.d.mts.map → runtime-XXYjt_3Q.d.mts.map} +1 -1
- package/dist/{sql-renderer-BdWJPa5F-DqJ5nUgt.mjs → sql-renderer-BdWJPa5F-DagaSmU3.mjs} +3 -3
- package/dist/{sql-renderer-BdWJPa5F-DqJ5nUgt.mjs.map → sql-renderer-BdWJPa5F-DagaSmU3.mjs.map} +1 -1
- package/dist/{sql-renderer-dk7d0cK0.d.mts → sql-renderer-CGc-Ln4u.d.mts} +4 -4
- package/dist/{sql-renderer-dk7d0cK0.d.mts.map → sql-renderer-CGc-Ln4u.d.mts.map} +1 -1
- package/dist/target.d.mts +16 -16
- package/dist/target.mjs +22 -22
- package/dist/target__aggregates.d.mts +1 -1
- package/dist/target__codec-descriptor.d.mts +2 -2
- package/dist/target__codec-descriptor.mjs +1 -1
- package/dist/target__codec-types.d.mts +3 -3
- package/dist/target__codecs.d.mts +2 -2
- package/dist/target__codecs.mjs +2 -2
- package/dist/target__control.mjs +46 -37
- package/dist/target__control.mjs.map +1 -1
- package/dist/target__data-types.d.mts +2 -2
- package/dist/target__data-types.mjs +3 -3
- package/dist/target__diff-database-schema.mjs +1 -1
- package/dist/target__full-text-index-authoring.mjs +1 -1
- package/dist/target__full-text.d.mts +3 -3
- 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__operation-types.d.mts +2 -2
- package/dist/target__pack.d.mts +2 -2
- 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.d.mts +1 -1
- package/dist/target__prisma7-binding.mjs +1 -1
- package/dist/target__render-ops.mjs +1 -1
- package/dist/target__runtime.d.mts +2 -2
- package/dist/target__runtime.mjs +4 -4
- package/dist/target__runtime.mjs.map +1 -1
- package/dist/{type-constructors-DQ7O80xT-DdTGyTSt.mjs → type-constructors-CNT0Zq7_-D8W003jr.mjs} +7 -7
- package/dist/{type-constructors-DQ7O80xT-DdTGyTSt.mjs.map → type-constructors-CNT0Zq7_-D8W003jr.mjs.map} +1 -1
- package/dist/{types-D6lgKhE5-CjLf9QtO.d.mts → types-D6lgKhE5-Fxmh_bQa.d.mts} +3 -3
- package/dist/{types-D6lgKhE5-CjLf9QtO.d.mts.map → types-D6lgKhE5-Fxmh_bQa.d.mts.map} +1 -1
- package/dist/types-DwVVpdFJ.d.mts +2 -0
- package/package.json +9 -9
- package/dist/codec-descriptor-BlMs1rkg.d.mts +0 -1
- package/dist/codec-descriptor-Cbz5bbma-dxeoAwS2.d.mts.map +0 -1
- package/dist/codec-descriptor-DSMjoW72-ZoCcTHLX.mjs.map +0 -1
- package/dist/codec-types-CXL3_pbl.d.mts +0 -2
- package/dist/codecs-DNjF5kIh-BkybYk_D.mjs.map +0 -1
- package/dist/codecs-DgslvOOU-eZpfm_fU.d.mts.map +0 -1
- package/dist/data-types-DhBM9bIL-CVDQGAGw.mjs.map +0 -1
- package/dist/full-text-collection-method-DWbpg-Ep-DDs6t_BB.d.mts.map +0 -1
- package/dist/operation-types-DeGKVV0-.d.mts +0 -1
- package/dist/types-BA-ghQ5q.d.mts +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-types-BAbkwTt9-C9WMEFNT.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/data-types-BAbkwTt9.mjs"],"sourcesContent":["import { c as postgresError } from \"./errors-BrhQYgdL.mjs\";\nimport { i as quoteIdentifier } from \"./sql-utils-Bnw3JbWf.mjs\";\nimport { numeralText, sqlDataType, sqlRawDataType } from \"@internal/sql-contract/data-type\";\nimport { dateTimeStoredText, storedNumeralText } from \"@internal/sql-contract/data-type-support\";\nimport { isStructuredError, structuredError } from \"@internal/utils/structured-error\";\nimport { INT32_RANGE, INT64_RANGE, assembleDataTypes, decimalTextEqualityKey, isNonFiniteText, readJsonBoolean, readJsonFloat, readJsonInteger, readJsonIntegerText, readJsonMatching, readJsonString, refuseJsonValue } from \"@internal/framework-components/codec\";\nimport { counted, withoutTrailing } from \"@internal/utils/text\";\nimport { type } from \"arktype\";\n//#region src/core/data-type-values.ts\n/**\n* Whether text fits `length` characters, counted as PostgreSQL counts them: code points. A `character` value is padded with spaces, and spaces past its length are dropped, so they do not count.\n*/\nfunction fitsCharacterLength(text, length, blankPadded) {\n\tconst significant = blankPadded ? withoutTrailing(text, \" \") : text;\n\treturn significant.length <= length || [...significant].length <= length;\n}\n/** The uuid input PostgreSQL reads: 32 hex digits in either case, a hyphen allowed after any group of four but the last, and the whole optionally in braces. */\nconst UUID_INPUT = /^(?:\\{[0-9a-f]{4}(?:-?[0-9a-f]{4}){7}\\}|[0-9a-f]{4}(?:-?[0-9a-f]{4}){7})$/i;\n/**\n* Text in any form PostgreSQL reads as a UUID (either case, a hyphen after any group of four digits, optionally in braces), written the way PostgreSQL writes it; `undefined` for text it does not read as one.\n*/\nfunction storedUuid(text) {\n\tif (!UUID_INPUT.test(text)) return void 0;\n\tconst hex = text.replace(/[{}-]/g, \"\").toLowerCase();\n\treturn `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;\n}\n/** The largest finite float4. */\nconst FLOAT4_MAX = 34028234663852886e22;\n/** Whether float4 holds a finite number: it neither overflows to an infinity nor rounds to 0, both of which PostgreSQL refuses. */\nfunction fitsFloat4(value) {\n\tconst single = Math.fround(value);\n\treturn Number.isFinite(single) && (value === 0 || single !== 0);\n}\nconst ISO_DURATION = /^P(?!$)(-?\\d+Y)?(-?\\d+M)?(-?\\d+D)?(?:T(?!$)(-?\\d+H)?(-?\\d+M)?(-?\\d+(?:\\.\\d+)?S)?)?$/;\nconst MICROS_PER_SECOND = 1000000n;\n/**\n* Converts a fractional-seconds digit string to microseconds, rounding rather\n* than truncating past the sixth digit.\n*\n* PostgreSQL rounds: `INTERVAL '1.1234567 seconds'` is `1.123457`, and\n* `'1.9999999 seconds'` carries into `2`. Truncating here made the parsed value\n* disagree with the database for any input past microsecond resolution.\n*\n* Ties round toward positive infinity, matching `Math.round` on the sibling path\n* that reads the driver's component object — so the two agree. PostgreSQL's own\n* tie behaviour is unobservable, because it parses the literal into a double\n* first and an exact half never survives that.\n*/\nconst microsFromFraction = (fraction, negative) => {\n\tif (fraction === \"\") return 0n;\n\tconst kept = BigInt(fraction.slice(0, 6).padEnd(6, \"0\"));\n\tconst rest = fraction.slice(6).replace(/0+$/, \"\");\n\tif (rest === \"\") return kept;\n\tconst half = rest[0] === \"5\" && rest.length === 1;\n\treturn rest > \"5\" || half && !negative ? kept + 1n : kept;\n};\nconst MICROS_PER_DAY = 86400n * MICROS_PER_SECOND;\n/** The key two stored intervals share exactly when PostgreSQL holds them equal: their total length in microseconds, a month counting as 30 days and a day as 24 hours. */\nfunction intervalEqualityKey(json) {\n\tconst { months, days, micros } = intervalFieldsOf(String(json));\n\treturn ((BigInt(months) * 30n + BigInt(days)) * MICROS_PER_DAY + micros).toString();\n}\nconst intervalFieldsOf = (text) => {\n\tconst match = ISO_DURATION.exec(text);\n\tif (match === null) throw postgresError(\"RUNTIME.DECODE_FAILED\", `pg/interval@1 value must be an ISO-8601 duration, got ${text}`, { meta: {\n\t\tcodecId: \"pg/interval@1\",\n\t\treceived: text\n\t} });\n\tconst [, years, months, days, hours, minutes, seconds] = match;\n\tconst wholeNumber = (part) => part === void 0 ? 0 : Number(part.slice(0, -1));\n\tconst secondsLiteral = seconds === void 0 ? \"0\" : seconds.slice(0, -1);\n\tconst negative = secondsLiteral.startsWith(\"-\");\n\tconst [whole = \"0\", fraction = \"\"] = secondsLiteral.replace(\"-\", \"\").split(\".\");\n\tconst magnitude = BigInt(whole) * MICROS_PER_SECOND + microsFromFraction(fraction, negative);\n\treturn {\n\t\tmonths: wholeNumber(years) * 12 + wholeNumber(months),\n\t\tdays: wholeNumber(days),\n\t\tmicros: BigInt(wholeNumber(hours)) * 3600n * MICROS_PER_SECOND + BigInt(wholeNumber(minutes)) * 60n * MICROS_PER_SECOND + (negative ? -magnitude : magnitude)\n\t};\n};\nconst secondsText = (micros) => {\n\tconst sign = micros < 0n ? \"-\" : \"\";\n\tconst magnitude = micros < 0n ? -micros : micros;\n\tconst whole = magnitude / MICROS_PER_SECOND % 60n;\n\tconst fraction = magnitude % MICROS_PER_SECOND;\n\treturn `${sign}${whole}${fraction === 0n ? \"\" : `.${fraction.toString().padStart(6, \"0\").replace(/0+$/, \"\")}`}`;\n};\n/**\n* Renders {@link PgInterval} the way PostgreSQL spells an interval under\n* `IntervalStyle = 'iso_8601'`: zero components omitted, `T` present only when a\n* time component is, each component carrying its own sign, and an all-zero\n* interval written `PT0S`.\n*/\nconst formatIsoDuration = ({ months, days, micros }) => {\n\tconst years = Math.trunc(months / 12);\n\tconst restMonths = months % 12;\n\tconst sign = micros < 0n ? \"-\" : \"\";\n\tconst magnitude = micros < 0n ? -micros : micros;\n\tconst hours = magnitude / (3600n * MICROS_PER_SECOND);\n\tconst minutes = magnitude / (60n * MICROS_PER_SECOND) % 60n;\n\tconst hasSeconds = magnitude % (60n * MICROS_PER_SECOND) !== 0n;\n\tconst parts = [\n\t\tyears === 0 ? \"\" : `${years}Y`,\n\t\trestMonths === 0 ? \"\" : `${restMonths}M`,\n\t\tdays === 0 ? \"\" : `${days}D`\n\t];\n\tconst time = [\n\t\thours === 0n ? \"\" : `${sign}${hours}H`,\n\t\tminutes === 0n ? \"\" : `${sign}${minutes}M`,\n\t\thasSeconds ? `${secondsText(micros)}S` : \"\"\n\t].join(\"\");\n\tconst rendered = `P${parts.join(\"\")}${time === \"\" ? \"\" : `T${time}`}`;\n\treturn rendered === \"P\" ? \"PT0S\" : rendered;\n};\n/**\n* An interval as PostgreSQL prints it under `IntervalStyle = 'postgres'`: `1 year 2 mons 3 days\n* 04:05:06.5`, `-1 years -2 mons +3 days -04:00:00`, `00:00:00`.\n*/\nconst POSTGRES_INTERVAL = /^(?:([+-]?\\d+) years? ?)?(?:([+-]?\\d+) mons? ?)?(?:([+-]?\\d+) days? ?)?(?:([+-])?(\\d+):(\\d{2}):(\\d{2})(?:\\.(\\d+))?)?$/;\nfunction postgresIntervalFields(text) {\n\tconst match = POSTGRES_INTERVAL.exec(text);\n\tif (match === null || text === \"\" || text.endsWith(\" \")) return void 0;\n\tconst [, years = \"0\", months = \"0\", days = \"0\", sign, hours = \"0\", minutes = \"0\", seconds = \"0\"] = match;\n\tconst fraction = match[8] ?? \"\";\n\tconst magnitude = (BigInt(hours) * 3600n + BigInt(minutes) * 60n + BigInt(seconds)) * MICROS_PER_SECOND + microsFromFraction(fraction, sign === \"-\");\n\treturn {\n\t\tmonths: Number(years) * 12 + Number(months),\n\t\tdays: Number(days),\n\t\tmicros: sign === \"-\" ? -magnitude : magnitude\n\t};\n}\nfunction intervalRefused(message) {\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", message, {\n\t\twhy: \"pg/interval stores one form for each interval (ADR 254), and reads ISO 8601 durations and the text PostgreSQL prints.\",\n\t\tfix: \"Write an ISO 8601 duration, as the message shows.\"\n\t});\n}\n/**\n* The stored form of `pg/interval` (ADR 254), from an ISO 8601 duration or the text PostgreSQL\n* prints under `IntervalStyle = 'postgres'`.\n*/\nfunction pgIntervalStoredText(text) {\n\tconst fractionDigits = /\\.(\\d+)/.exec(text)?.[1]?.length ?? 0;\n\tif (fractionDigits > 6) intervalRefused(`\"${text}\" has ${fractionDigits} digits after the decimal point, but pg/interval holds microseconds, so at most 6. Round it, as in \"PT1.123456S\".`);\n\tif (ISO_DURATION.test(text)) return formatIsoDuration(intervalFieldsOf(text));\n\tconst fields = postgresIntervalFields(text);\n\tif (fields === void 0) intervalRefused(`pg/interval cannot read \"${text}\". Write an ISO 8601 duration, as in \"P1Y2M3DT4H5M6S\".`);\n\treturn formatIsoDuration(fields);\n}\nconst BASE64_TEXT = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;\n/** Reads base64 with or without padding bits set; {@link spellPgByteaJson} writes the base64 `pg/bytea` stores. */\nconst readPgByteaJson = (owner, json) => readJsonMatching(owner, json, BASE64_TEXT, \"a base64 string\");\n/** The base64 of the same bytes with padding bits zero, as `Buffer` writes it. */\nconst spellPgByteaJson = (json) => typeof json === \"string\" ? Buffer.from(json, \"base64\").toString(\"base64\") : json;\nconst BYTEA_TEXT = /^\\\\x(?:[0-9A-Fa-f]{2})*$/;\n/** The base64 `pg/bytea` stores for the hex text PostgreSQL prints, `\\x68656c6c6f`. The `bytea` tag reads its body with this. */\nfunction pgByteaFromHexText(text) {\n\tif (!BYTEA_TEXT.test(text)) throw structuredError(\"CONTRACT.CAST_REFUSED\", `\"${text}\" is not the hex text PostgreSQL prints for bytea, which is \\\\x followed by two hexadecimal digits for each byte, as in \\\\x68656c6c6f.`, {\n\t\twhy: \"The bytea tag reads bytes as the hex text PostgreSQL prints under bytea_output = hex.\",\n\t\tfix: \"Write the bytes in hex after \\\\x, as in bytea`\\\\x68656c6c6f`.\"\n\t});\n\treturn Buffer.from(text.slice(2), \"hex\").toString(\"base64\");\n}\n/** The hex text PostgreSQL prints for the base64 `pg/bytea` stores. */\nfunction pgByteaHexText(base64) {\n\treturn `\\\\x${Buffer.from(base64, \"base64\").toString(\"hex\")}`;\n}\n//#endregion\n//#region src/core/postgres-year-text.ts\n/**\n* PostgreSQL's year text (ADR 254, \"Date and time types\"). PostgreSQL reads and prints no signed year: a year after 9999 is written without its sign and leading zeros, `10000-01-01`, and a year at or before ISO year 0000 with a ` BC` suffix and PostgreSQL's year number, which has no year 0, so ISO year 0000 is `0001 BC` and -000043 is `0044 BC`. Every Postgres date and time codec and tag converts years through these two functions.\n*/\nconst POSTGRES_YEAR = /^(\\d{4,6})(-.*?)( BC)?$/;\nconst ISO_YEAR = /^([+-]\\d{6}|\\d{4})(-.*)$/;\nconst BC_SUFFIX = \" BC\";\n/** ISO 8601 text, with a four-digit or signed six-digit year, from text PostgreSQL prints. Text with no year, ISO text and `0000 BC`, which does not exist, stay as they are. */\nfunction isoYearText(text) {\n\tconst match = POSTGRES_YEAR.exec(text);\n\tif (match === null) return text;\n\tconst [, digits = \"\", rest = \"\", bc] = match;\n\tconst year = Number(digits);\n\tif (bc !== void 0) {\n\t\tif (year === 0) return text;\n\t\treturn `${isoYear(1 - year)}${rest}`;\n\t}\n\treturn digits.length > 4 ? `${isoYear(year)}${rest}` : text;\n}\n/** The text PostgreSQL reads for ISO 8601 text with a four-digit or signed six-digit year. Text with no year stays as it is. */\nfunction postgresYearText(text) {\n\tconst match = ISO_YEAR.exec(text);\n\tif (match === null) return text;\n\tconst [, yearDigits = \"\", rest = \"\"] = match;\n\tconst year = Number(yearDigits);\n\tif (year > 9999) return `${year}${rest}`;\n\tif (year >= 1) return `${String(year).padStart(4, \"0\")}${rest}`;\n\treturn `${String(1 - year).padStart(4, \"0\")}${rest}${BC_SUFFIX}`;\n}\nfunction isoYear(year) {\n\tif (year >= 0 && year <= 9999) return String(year).padStart(4, \"0\");\n\treturn `${year < 0 ? \"-\" : \"+\"}${String(Math.abs(year)).padStart(6, \"0\")}`;\n}\n//#endregion\n//#region src/core/stored-inet.ts\nconst DIGIT = /^[0-9]$/;\nconst HEX_DIGIT = /^[0-9a-fA-F]$/;\nconst isDigit = (ch) => ch !== void 0 && DIGIT.test(ch);\n/**\n* Text PostgreSQL reads as an `inet` value, written the way PostgreSQL prints it: an IPv4 address in\n* four decimal octets, an IPv6 address in lower-case hex with its longest run of zero groups written\n* `::`, and the prefix length only when it is shorter than the whole address. `undefined` for text\n* PostgreSQL does not read as an `inet` value.\n*/\nfunction storedInet(text) {\n\tif (text.includes(\":\")) {\n\t\tconst value = readIpv6(text);\n\t\treturn value === void 0 ? void 0 : printIpv6(value);\n\t}\n\tconst value = readIpv4(text);\n\treturn value === void 0 ? void 0 : printIpv4(value);\n}\n/**\n* PostgreSQL's `inet_net_pton_ipv4`: one to four decimal octets, each up to 255 and leading zeros\n* allowed, then an optional `/` and prefix length up to 32. Without a prefix length all four octets\n* are required; with one, the octets written must cover it.\n*/\nfunction readIpv4(text) {\n\tconst octets = [];\n\tlet index = 0;\n\tlet ch = text[index++];\n\twhile (isDigit(ch)) {\n\t\tlet octet = 0;\n\t\tdo {\n\t\t\toctet = octet * 10 + Number(ch);\n\t\t\tif (octet > 255) return void 0;\n\t\t\tch = text[index++];\n\t\t} while (isDigit(ch));\n\t\tif (octets.length === 4) return void 0;\n\t\toctets.push(octet);\n\t\tif (ch === void 0 || ch === \"/\") break;\n\t\tif (ch !== \".\") return void 0;\n\t\tch = text[index++];\n\t}\n\tlet bits = -1;\n\tif (ch === \"/\" && isDigit(text[index]) && octets.length > 0) {\n\t\tch = text[index++];\n\t\tbits = 0;\n\t\tdo {\n\t\t\tbits = bits * 10 + Number(ch);\n\t\t\tch = text[index++];\n\t\t} while (isDigit(ch));\n\t\tif (ch !== void 0 || bits > 32) return void 0;\n\t}\n\tif (ch !== void 0) return void 0;\n\tif (bits === -1) {\n\t\tif (octets.length !== 4) return void 0;\n\t\tbits = 32;\n\t}\n\tif (octets.length === 0 || Math.floor(bits / 8) > octets.length) return void 0;\n\treturn {\n\t\tbytes: [\n\t\t\t...octets,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0\n\t\t].slice(0, 4),\n\t\tbits\n\t};\n}\n/** PostgreSQL's `getbits`: a prefix length up to 128, with no leading zero. */\nfunction readBits(text) {\n\tlet bits = 0;\n\tlet digits = 0;\n\tfor (const ch of text) {\n\t\tif (!isDigit(ch)) return void 0;\n\t\tif (digits++ !== 0 && bits === 0) return void 0;\n\t\tbits = bits * 10 + Number(ch);\n\t\tif (bits > 128) return void 0;\n\t}\n\treturn digits === 0 ? void 0 : bits;\n}\n/**\n* PostgreSQL's `getv4`, for the IPv4 tail of an IPv6 address: up to four decimal octets with no\n* leading zeros, and an optional prefix length. Octets left out are zero.\n*/\nfunction readIpv4Tail(text) {\n\tconst octets = [];\n\tlet octet = 0;\n\tlet digits = 0;\n\tfor (const [index, ch] of [...text].entries()) {\n\t\tif (isDigit(ch)) {\n\t\t\tif (digits++ !== 0 && octet === 0) return void 0;\n\t\t\toctet = octet * 10 + Number(ch);\n\t\t\tif (octet > 255) return void 0;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch !== \".\" && ch !== \"/\") return void 0;\n\t\tif (octets.length > 3) return void 0;\n\t\toctets.push(octet);\n\t\tif (ch === \"/\") {\n\t\t\tconst bits = readBits(text.slice(index + 1));\n\t\t\treturn bits === void 0 ? void 0 : {\n\t\t\t\toctets,\n\t\t\t\tbits\n\t\t\t};\n\t\t}\n\t\toctet = 0;\n\t\tdigits = 0;\n\t}\n\tif (digits === 0 || octets.length > 3) return void 0;\n\treturn {\n\t\toctets: [...octets, octet],\n\t\tbits: void 0\n\t};\n}\n/**\n* PostgreSQL's `inet_cidr_pton_ipv6`: up to eight groups of one to four hex digits in either case,\n* one `::` standing for a run of zero groups, an optional IPv4 tail, and an optional prefix length.\n*/\nfunction readIpv6(text) {\n\tconst bytes = new Array(16).fill(0);\n\tlet filled = 0;\n\tlet compressedAt;\n\tlet index = 0;\n\tif (text[0] === \":\") {\n\t\tif (text[1] !== \":\") return void 0;\n\t\tindex = 1;\n\t}\n\tlet tokenStart = index;\n\tlet sawHexDigit = false;\n\tlet group = 0;\n\tlet groupDigits = 0;\n\tlet bits = 128;\n\twhile (index < text.length) {\n\t\tconst ch = text[index++] ?? \"\";\n\t\tif (HEX_DIGIT.test(ch)) {\n\t\t\tgroup = group << 4 | Number.parseInt(ch, 16);\n\t\t\tif (++groupDigits > 4) return void 0;\n\t\t\tsawHexDigit = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === \":\") {\n\t\t\ttokenStart = index;\n\t\t\tif (!sawHexDigit) {\n\t\t\t\tif (compressedAt !== void 0) return void 0;\n\t\t\t\tcompressedAt = filled;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (index >= text.length || filled + 2 > 16) return void 0;\n\t\t\tbytes[filled++] = group >> 8;\n\t\t\tbytes[filled++] = group & 255;\n\t\t\tsawHexDigit = false;\n\t\t\tgroup = 0;\n\t\t\tgroupDigits = 0;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === \".\" && filled + 4 <= 16) {\n\t\t\tconst tail = readIpv4Tail(text.slice(tokenStart));\n\t\t\tif (tail !== void 0) {\n\t\t\t\ttail.octets.forEach((octet, offset) => {\n\t\t\t\t\tbytes[filled + offset] = octet;\n\t\t\t\t});\n\t\t\t\tfilled += 4;\n\t\t\t\tsawHexDigit = false;\n\t\t\t\tbits = tail.bits ?? bits;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (ch === \"/\") {\n\t\t\tconst prefix = readBits(text.slice(index));\n\t\t\tif (prefix !== void 0) {\n\t\t\t\tbits = prefix;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}\n\tif (sawHexDigit) {\n\t\tif (filled + 2 > 16) return void 0;\n\t\tbytes[filled++] = group >> 8;\n\t\tbytes[filled++] = group & 255;\n\t}\n\tif (compressedAt !== void 0) {\n\t\tif (filled === 16) return void 0;\n\t\tconst shifted = bytes.slice(compressedAt, filled);\n\t\tbytes.fill(0, compressedAt, filled);\n\t\tbytes.splice(16 - shifted.length, shifted.length, ...shifted);\n\t\tfilled = 16;\n\t}\n\treturn filled === 16 ? {\n\t\tbytes,\n\t\tbits\n\t} : void 0;\n}\nfunction printIpv4({ bytes, bits }) {\n\tconst address = bytes.join(\".\");\n\treturn bits === 32 ? address : `${address}/${bits}`;\n}\n/**\n* PostgreSQL's `inet_net_ntop_ipv6`: the first longest run of two or more zero groups is written\n* `::`, and an address whose first five groups are zero followed by `ffff`, or whose first six are\n* zero, ends in dotted IPv4.\n*/\nfunction printIpv6({ bytes, bits }) {\n\tconst groups = Array.from({ length: 8 }, (_, i) => (bytes[2 * i] ?? 0) << 8 | (bytes[2 * i + 1] ?? 0));\n\tconst zeroRun = longestZeroRun(groups);\n\tlet text = \"\";\n\tfor (let i = 0; i < 8; i++) {\n\t\tif (zeroRun !== void 0 && i >= zeroRun.start && i < zeroRun.start + zeroRun.length) {\n\t\t\tif (i === zeroRun.start) text += \":\";\n\t\t\tcontinue;\n\t\t}\n\t\tif (i !== 0) text += \":\";\n\t\tif (i === 6 && zeroRun?.start === 0 && (zeroRun.length === 6 || zeroRun.length === 5 && groups[5] === 65535)) {\n\t\t\ttext += bytes.slice(12).join(\".\");\n\t\t\tbreak;\n\t\t}\n\t\ttext += (groups[i] ?? 0).toString(16);\n\t}\n\tif (zeroRun !== void 0 && zeroRun.start + zeroRun.length === 8) text += \":\";\n\treturn bits === 128 ? text : `${text}/${bits}`;\n}\nfunction longestZeroRun(groups) {\n\tlet best;\n\tlet current;\n\tfor (const [i, group] of groups.entries()) {\n\t\tif (group === 0) {\n\t\t\tcurrent = current === void 0 ? {\n\t\t\t\tstart: i,\n\t\t\t\tlength: 1\n\t\t\t} : {\n\t\t\t\t...current,\n\t\t\t\tlength: current.length + 1\n\t\t\t};\n\t\t\tcontinue;\n\t\t}\n\t\tif (current !== void 0 && (best === void 0 || current.length > best.length)) best = current;\n\t\tcurrent = void 0;\n\t}\n\tif (current !== void 0 && (best === void 0 || current.length > best.length)) best = current;\n\treturn best !== void 0 && best.length >= 2 ? best : void 0;\n}\n//#endregion\n//#region src/core/data-types.ts\n/** A cast between two types that store the same shape: the value is already the form this type stores. */\nconst unchanged = (value) => value;\nfunction wrongShape(value, expected) {\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `Expected ${expected}, got ${JSON.stringify(value)}.`, {\n\t\twhy: \"A cast reads the stored form of the type it takes values of.\",\n\t\tfix: \"Hand the cast a value in the shape its source type stores.\"\n\t});\n}\n/** A whole number as the digit text `int8` and `numeric` store. */\nconst asNumeralText = (value) => typeof value === \"number\" ? numeralText(value) : wrongShape(value, \"a number\");\n/**\n* A number as the floating-point types store it: a JSON number, or one of the three words, which\n* those types keep as text. A magnitude past what a double holds is refused rather than rounded to\n* a word: the database refuses it too, and storing `Infinity` would make a written number\n* indistinguishable from a written `Infinity`.\n*/\nconst asFloat = (value) => {\n\tif (typeof value === \"number\") return value;\n\tif (typeof value !== \"string\") return wrongShape(value, \"a number or numeral text\");\n\tif (isNonFiniteText(value)) return value;\n\tconst converted = Number(value);\n\tif (Number.isFinite(converted)) return converted;\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `${value} is out of range: no double holds a number that large.`, {\n\t\twhy: \"The floating-point types store a double, which holds magnitudes up to about 1.8e308.\",\n\t\tfix: \"Use a number a double holds, or a numeric column.\"\n\t});\n};\nconst written = (text) => ({\n\ttext,\n\twritten: true\n});\nconst catalog = (text) => ({\n\ttext,\n\tcatalog: true\n});\nconst writtenAndCatalog = (text) => ({\n\ttext,\n\twritten: true,\n\tcatalog: true\n});\nconst claimsOnly = (text) => ({ text });\nconst anyJson = (json) => json;\nconst readString = (id) => (json) => readJsonString(id, json);\n/** A parameter a type declares as a whole number, or undefined when the column does not set it. */\nfunction integerParam(params, name) {\n\tconst value = params[name];\n\treturn typeof value === \"number\" ? value : void 0;\n}\n/** A decimal numeral: an optional minus sign, digits, and an optional fraction. */\nconst DECIMAL_NUMERAL_TEXT = /^-?\\d+(?:\\.\\d+)?$/;\n/**\n* Numeric text in the form PostgreSQL *prints*, which is narrower than the form it accepts.\n*\n* `numeric` reads `+123`, `.5`, `1.`, `1e5`, `0x1f`, `1_000`, `007`, `-0` and whitespace-padded input, but prints every one of them in a single normalised form — `123`, `0.5`, `1`, `100000`, `31`, `1000`, `7`, `0`. A value in any other form is one the database never returns: `1e5` reads back as `100000`.\n*\n* `NaN`, `Infinity` and `-Infinity` are genuine `numeric` values, which PostgreSQL emits into JSON as strings.\n*/\nconst STORED_NUMERIC_TEXT = /^(?:(?!-0(?:\\.0+)?$)-?(?:0|[1-9]\\d*)(?:\\.\\d+)?|NaN|-?Infinity)$/;\n/**\n* Whether stored numeric text is a value `numeric(precision, scale)` stores without rounding: a whole number of units of 10^-scale, and at most `precision` digits once counted in those units. A negative scale rounds to tens, hundreds and so on, and a scale above the precision allows only values below 1. NaN fits; an infinity does not.\n*/\nfunction fitsNumeric(text, precision, scale) {\n\tif (text === \"NaN\") return true;\n\tif (text.endsWith(\"Infinity\")) return false;\n\tconst [whole = \"\", fraction = \"\"] = text.replace(/^-/, \"\").split(\".\");\n\tconst significantFraction = withoutTrailing(fraction, \"0\");\n\tconst digits = `${whole}${significantFraction}`.replace(/^0+/, \"\");\n\tif (digits === \"\") return true;\n\tconst shift = scale - significantFraction.length;\n\tif (shift >= 0) return digits.length + shift <= precision;\n\tconst units = withoutTrailing(digits, \"0\");\n\tif (digits.length - units.length < -shift) return false;\n\treturn digits.length + shift <= precision;\n}\nconst readNumeric = (json, params) => {\n\tif (typeof json !== \"string\" || !STORED_NUMERIC_TEXT.test(json)) {\n\t\tconst printed = typeof json === \"string\" && DECIMAL_NUMERAL_TEXT.test(json) ? storedNumeralText(json) : void 0;\n\t\treturn refuseJsonValue(\"pg/numeric\", printed === void 0 ? \"a decimal string\" : `\"${printed}\", as PostgreSQL writes this value`, json);\n\t}\n\tconst precision = integerParam(params, \"precision\");\n\tif (precision === void 0) return json;\n\tconst scale = integerParam(params, \"scale\") ?? 0;\n\tif (!fitsNumeric(json, precision, scale)) return refuseJsonValue(\"pg/numeric\", `a decimal string that numeric(${precision}, ${scale}) stores without rounding`, json);\n\treturn json;\n};\n/** A value of `numeric(precision, scale)` is written as PostgreSQL prints it: with exactly `scale` fraction digits, none for a scale of 0 or below. */\nconst spellNumeric = (json, params) => {\n\tif (integerParam(params, \"precision\") === void 0 || typeof json !== \"string\" || json === \"NaN\") return json;\n\tconst scale = integerParam(params, \"scale\") ?? 0;\n\tconst [whole = \"\", fraction = \"\"] = json.split(\".\");\n\treturn scale <= 0 ? whole : `${whole}.${fraction.slice(0, scale).padEnd(scale, \"0\")}`;\n};\nconst readFloat4 = (json) => {\n\tconst value = readJsonFloat(\"pg/float4\", json);\n\tif (Number.isFinite(value) && !fitsFloat4(value)) return refuseJsonValue(\"pg/float4\", `a number float4 holds, at most ${FLOAT4_MAX} in magnitude and not so small that it becomes 0, or the text NaN, Infinity or -Infinity`, json);\n\treturn json;\n};\n/** A `character` value is spelled without the spaces that pad it to its length, as the application reads it. */\nconst spellCharacter = (json) => typeof json === \"string\" ? withoutTrailing(json, \" \") : json;\n/** A `character` column holds its length in characters, and one with no length is `character(1)`; the spaces that pad a value to its length do not count. */\nconst readCharacter = (json, params) => {\n\tconst length = integerParam(params, \"length\") ?? 1;\n\tif (!fitsCharacterLength(readJsonString(\"pg/char\", json), length, true)) return refuseJsonValue(\"pg/char\", `a string of at most ${counted(length, \"character\")} before any trailing spaces`, json);\n\treturn json;\n};\n/** A `character varying` column with a length holds at most that many characters. */\nconst readCharacterVarying = (json, params) => {\n\tconst length = integerParam(params, \"length\");\n\tconst text = readJsonString(\"pg/varchar\", json);\n\tif (length !== void 0 && !fitsCharacterLength(text, length, false)) return refuseJsonValue(\"pg/varchar\", `a string of at most ${counted(length, \"character\")}`, json);\n\treturn json;\n};\nconst BIT_STRING = /^[01]*$/;\n/** A `bit` column holds exactly its length in bits, and one with no length is `bit(1)`. */\nconst readBit = (json, params) => {\n\tconst length = integerParam(params, \"length\") ?? 1;\n\tif (readJsonMatching(\"pg/bit\", json, BIT_STRING, \"a string of 0 and 1 digits\").length !== length) return refuseJsonValue(\"pg/bit\", `a string of exactly ${counted(length, \"bit\")}`, json);\n\treturn json;\n};\n/** A `bit varying` column with a length holds at most that many bits. */\nconst readBitVarying = (json, params) => {\n\tconst length = integerParam(params, \"length\");\n\tconst bits = readJsonMatching(\"pg/varbit\", json, BIT_STRING, \"a string of 0 and 1 digits\");\n\tif (length !== void 0 && bits.length > length) return refuseJsonValue(\"pg/varbit\", `a string of at most ${counted(length, \"bit\")}`, json);\n\treturn json;\n};\n/** A `text[]` may hold NULL elements, which PostgreSQL writes as JSON `null`. */\nconst readTextArray = (json) => {\n\tconst expected = \"an array of strings and nulls\";\n\tif (!Array.isArray(json)) return refuseJsonValue(\"pg/text-array\", expected, json);\n\tfor (const entry of json) if (entry !== null && typeof entry !== \"string\") return refuseJsonValue(\"pg/text-array\", expected, entry);\n\treturn json;\n};\n/** Reads a UUID in any spelling PostgreSQL reads; `spellUuid` gives it the one it stores. */\nconst readUuid = (json) => typeof json === \"string\" && storedUuid(json) !== void 0 ? json : refuseJsonValue(\"pg/uuid\", \"a UUID in a spelling PostgreSQL reads: 32 hexadecimal digits in either case, with or without a hyphen after any group of four, optionally in braces\", json);\n/** A UUID is stored as PostgreSQL prints it: lower case, hyphenated 8-4-4-4-12. */\nconst spellUuid = (json) => typeof json === \"string\" ? storedUuid(json) ?? json : json;\n/** Reads an address in any spelling PostgreSQL reads; `spellInet` gives it the one it stores. */\nconst readInet = (json) => typeof json === \"string\" && storedInet(json) !== void 0 ? json : refuseJsonValue(\"pg/inet\", \"an IP address or network in a spelling PostgreSQL reads, as in 10.0.0.1 or 2001:db8::/32\", json);\n/** An address is stored as PostgreSQL prints it. */\nconst spellInet = (json) => typeof json === \"string\" ? storedInet(json) ?? json : json;\n/** The fraction digits of a second the date, time and interval types hold when a column sets no precision: microseconds. */\nconst MICROSECOND_DIGITS = 6;\n/**\n* A value with more fraction digits of a second than the column's `precision`, or than microseconds when it sets none, which PostgreSQL would round, is refused rather than rounded. Trailing zeros of a fraction are not digits of the value.\n*/\nfunction refuseFinerThanPrecision(typeId, json, fraction, params) {\n\tconst precision = integerParam(params, \"precision\") ?? MICROSECOND_DIGITS;\n\tif (withoutTrailing(fraction ?? \"\", \"0\").length <= precision) return json;\n\treturn refuseJsonValue(typeId, `a value with at most ${counted(precision, \"fraction digit\")} of a second, which precision ${precision} holds without rounding`, json);\n}\n/** What `storedText` writes for `text`, or why it cannot read it. */\nfunction storedSpelling(storedText, text) {\n\ttry {\n\t\treturn { stored: storedText(text) };\n\t} catch (error) {\n\t\tif (isStructuredError(error) && error.code === \"CONTRACT.CAST_REFUSED\") return { reason: error.message };\n\t\tthrow error;\n\t}\n}\n/**\n* Reads a value of a date or time type (ADR 254, \"Date and time types\") in any spelling its tag reads, and refuses other text. A value with more fraction digits than the column's precision is refused rather than rounded. `spellStoredDateTime` gives the value its one stored spelling.\n*/\nconst readStoredDateTime = (typeId, storedText, description, fraction) => (json, params) => {\n\tif (typeof json !== \"string\") return refuseJsonValue(typeId, description, json);\n\tconst spelling = storedSpelling(storedText, json);\n\tif (\"reason\" in spelling) return refuseJsonValue(typeId, `${description}: ${spelling.reason}`, json);\n\trefuseFinerThanPrecision(typeId, json, fraction.exec(spelling.stored)?.[1], params);\n\treturn json;\n};\n/** The stored spelling of a date or time value: what `storedText` writes. */\nconst spellStoredDateTime = (storedText) => (json) => {\n\tif (typeof json !== \"string\") return json;\n\tconst spelling = storedSpelling(storedText, json);\n\treturn \"stored\" in spelling ? spelling.stored : json;\n};\nconst SECONDS_FRACTION = /:\\d{2}\\.(\\d+)/;\nconst INTERVAL_SECONDS_FRACTION = /\\d\\.(\\d+)S$/;\n/** The precision and scale of `numeric`. PostgreSQL 15 and later take a negative scale and one above the precision. */\nconst pgNumericParams = type({\n\t\"precision?\": \"number.integer >= 1 & number.integer <= 1000\",\n\t\"scale?\": \"number.integer >= -1000 & number.integer <= 1000\"\n}).narrow((params, ctx) => params.scale === void 0 || params.precision !== void 0 || ctx.reject({\n\tpath: [\"scale\"],\n\tmessage: \"scale requires a precision\"\n}));\n/** The length of `char` and `varchar`. */\nconst pgCharacterLengthParams = type({ \"length?\": \"number.integer >= 1 & number.integer <= 10485760\" });\n/** The length of `bit` and `bit varying`. */\nconst pgBitLengthParams = type({ \"length?\": \"number.integer >= 1 & number.integer <= 83886080\" });\n/** The fractional-second precision of the time, timestamp and interval types. */\nconst pgPrecisionParams = type({ \"precision?\": \"number.integer >= 0 & number.integer <= 6\" });\nconst pgEnumParams = type({ typeName: \"string > 0\" });\n/** A type with no parameters that is written and reported by its own name. */\nconst namedOnly = (id, name, read, casts = {}) => sqlDataType(id, {\n\ttexts: [writtenAndCatalog(name)],\n\tread,\n\tcasts\n});\nconst withDefaultLength = (params) => params.length === void 0 ? {\n\t...params,\n\tlength: 1\n} : params;\nconst pgText = namedOnly(\"pg/text\", \"text\", readString(\"pg/text\"));\nconst pgTextArray = sqlDataType(\"pg/text-array\", { read: readTextArray });\n/** The enum's `typeName`: its name in `public` or with no schema, its schema-qualified name elsewhere. */\nfunction qualifiedEnumName(reported) {\n\tconst name = reported.name ?? \"\";\n\treturn reported.schema === void 0 || reported.schema === \"public\" ? name : `${reported.schema}.${name}`;\n}\nconst pgEnum = sqlDataType(\"pg/enum\", {\n\tparams: pgEnumParams,\n\tread: readString(\"pg/enum\"),\n\tclaimsKind: \"enum\",\n\trender: ({ typeName }) => {\n\t\tconst dot = typeName.indexOf(\".\");\n\t\treturn dot === -1 ? quoteIdentifier(typeName) : `${quoteIdentifier(typeName.slice(0, dot))}.${quoteIdentifier(typeName.slice(dot + 1))}`;\n\t},\n\tfromReported: (reported) => ({ typeName: qualifiedEnumName(reported) })\n});\nconst pgInt2 = sqlDataType(\"pg/int2\", {\n\ttexts: [written(\"int2\"), catalog(\"smallint\")],\n\tread: (json) => readJsonInteger(\"pg/int2\", json, {\n\t\tmin: -32768,\n\t\tmax: 32767\n\t})\n});\nconst pgBool = sqlDataType(\"pg/bool\", {\n\ttexts: [written(\"bool\"), catalog(\"boolean\")],\n\tread: (json) => readJsonBoolean(\"pg/bool\", json)\n});\nconst pgJson = namedOnly(\"pg/json\", \"json\", anyJson);\nconst pgTsquery = namedOnly(\"pg/tsquery\", \"tsquery\", readString(\"pg/tsquery\"));\nconst pgInt4 = sqlDataType(\"pg/int4\", {\n\ttexts: [\n\t\twritten(\"int4\"),\n\t\tcatalog(\"integer\"),\n\t\tclaimsOnly(\"int\")\n\t],\n\tread: (json) => readJsonInteger(\"pg/int4\", json, INT32_RANGE),\n\tcasts: { [pgInt2.id]: unchanged }\n});\nconst pgInt8 = sqlDataType(\"pg/int8\", {\n\ttexts: [written(\"int8\"), catalog(\"bigint\")],\n\tread: (json) => {\n\t\treadJsonIntegerText(\"pg/int8\", json, INT64_RANGE);\n\t\treturn json;\n\t},\n\tcasts: {\n\t\t[pgInt2.id]: asNumeralText,\n\t\t[pgInt4.id]: asNumeralText\n\t}\n});\nconst pgNumeric = sqlDataType(\"pg/numeric\", {\n\tparams: pgNumericParams,\n\ttexts: [\n\t\twrittenAndCatalog(\"numeric\"),\n\t\twritten(\"numeric({precision})\"),\n\t\twrittenAndCatalog(\"numeric({precision},{scale})\"),\n\t\tclaimsOnly(\"decimal\"),\n\t\tclaimsOnly(\"decimal({precision})\"),\n\t\tclaimsOnly(\"decimal({precision},{scale})\")\n\t],\n\tread: readNumeric,\n\tspell: spellNumeric,\n\tequalityKey: decimalTextEqualityKey,\n\tnormalize: (params) => params.precision !== void 0 && params.scale === void 0 ? {\n\t\t...params,\n\t\tscale: 0\n\t} : params,\n\tcasts: {\n\t\t[pgInt2.id]: asNumeralText,\n\t\t[pgInt4.id]: asNumeralText,\n\t\t[pgInt8.id]: unchanged\n\t}\n});\n/** `float4` stores a single-precision float, so a magnitude past about 3.4e38, or one it would round to 0, does not fit. */\nconst asFloat4 = (value) => {\n\tconst converted = asFloat(value);\n\tif (typeof converted !== \"number\" || fitsFloat4(converted)) return converted;\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `${converted} is out of range: float4 holds a nonzero magnitude from about 1.4e-45 to 3.4e38.`, {\n\t\twhy: \"float4 stores a single-precision float, which overflows past about 3.4e38 and rounds a magnitude below about 1.4e-45 to 0.\",\n\t\tfix: \"Use a number float4 holds, or a float8 or numeric column.\"\n\t});\n};\nconst floatCastsOf = (cast) => ({\n\t[pgInt2.id]: cast,\n\t[pgInt4.id]: cast,\n\t[pgInt8.id]: cast,\n\t[pgNumeric.id]: cast\n});\nconst pgFloat4 = sqlDataType(\"pg/float4\", {\n\ttexts: [written(\"float4\"), catalog(\"real\")],\n\tread: readFloat4,\n\tcasts: floatCastsOf(asFloat4)\n});\nconst pgFloat8 = sqlDataType(\"pg/float8\", {\n\ttexts: [\n\t\twritten(\"float8\"),\n\t\tcatalog(\"double precision\"),\n\t\tclaimsOnly(\"float\")\n\t],\n\tread: (json) => {\n\t\treadJsonFloat(\"pg/float8\", json);\n\t\treturn json;\n\t},\n\tcasts: floatCastsOf(asFloat)\n});\nconst pgJsonb = namedOnly(\"pg/jsonb\", \"jsonb\", anyJson, { [pgJson.id]: unchanged });\n/** Why no enum can use a codec of `pg/jsonb`, which every such codec gives as its `enumRefusal`. */\nconst pgJsonbEnumRefusal = \"A CHECK lists a string member as SQL text, which PostgreSQL reads as the JSON text of a document rather than as a string, and a number member as a number, which PostgreSQL cannot compare with jsonb, so no CHECK can compare a value with the members. No enum can use a jsonb codec; use a text enum instead.\";\nconst fromText = { [pgText.id]: unchanged };\nconst pgChar = sqlDataType(\"pg/char\", {\n\tparams: pgCharacterLengthParams,\n\ttexts: [\n\t\twritten(\"character\"),\n\t\twrittenAndCatalog(\"character({length})\"),\n\t\tclaimsOnly(\"char\"),\n\t\tclaimsOnly(\"char({length})\")\n\t],\n\tread: readCharacter,\n\tspell: spellCharacter,\n\tnormalize: withDefaultLength,\n\tcasts: fromText\n});\nconst pgVarchar = sqlDataType(\"pg/varchar\", {\n\tparams: pgCharacterLengthParams,\n\ttexts: [\n\t\twrittenAndCatalog(\"character varying\"),\n\t\twrittenAndCatalog(\"character varying({length})\"),\n\t\tclaimsOnly(\"varchar\"),\n\t\tclaimsOnly(\"varchar({length})\")\n\t],\n\tread: readCharacterVarying,\n\tcasts: fromText\n});\n/** Text in any form PostgreSQL reads as a UUID, written the way PostgreSQL writes it, so the contract holds the value the database reports. */\nconst asUuid = (value) => {\n\tif (typeof value !== \"string\") return wrongShape(value, \"text\");\n\tconst uuid = storedUuid(value);\n\tif (uuid !== void 0) return uuid;\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `${JSON.stringify(value)} is not a UUID: PostgreSQL reads 32 hexadecimal digits, with a hyphen after any group of four and optionally in braces.`, {\n\t\twhy: \"A uuid column takes only text PostgreSQL reads as a UUID.\",\n\t\tfix: \"Write a UUID such as a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11.\"\n\t});\n};\nconst pgUuid = sqlDataType(\"pg/uuid\", {\n\ttexts: [writtenAndCatalog(\"uuid\")],\n\tread: readUuid,\n\tspell: spellUuid,\n\tcasts: { [pgText.id]: asUuid }\n});\nconst pgBit = sqlDataType(\"pg/bit\", {\n\tparams: pgBitLengthParams,\n\ttexts: [written(\"bit\"), writtenAndCatalog(\"bit({length})\")],\n\tread: readBit,\n\tnormalize: withDefaultLength,\n\tcasts: fromText\n});\nconst pgVarbit = sqlDataType(\"pg/varbit\", {\n\tparams: pgBitLengthParams,\n\ttexts: [\n\t\twrittenAndCatalog(\"bit varying\"),\n\t\twrittenAndCatalog(\"bit varying({length})\"),\n\t\tclaimsOnly(\"varbit\"),\n\t\tclaimsOnly(\"varbit({length})\")\n\t],\n\tread: readBitVarying,\n\tcasts: fromText\n});\nconst INFINITIES = /* @__PURE__ */ new Set([\"infinity\", \"-infinity\"]);\n/**\n* The stored form of a date or time type (ADR 254), from ISO 8601 or the text PostgreSQL prints.\n* `infinity` and `-infinity` are values of the types that hold them.\n*/\nfunction postgresDateTime(options, holdsInfinity) {\n\treturn (text) => holdsInfinity && INFINITIES.has(text) ? text : dateTimeStoredText(isoYearText(text), options, text);\n}\n/**\n* Each range is what PostgreSQL and every codec of the type hold: PostgreSQL starts at 4714-11-24\n* BC, and the `Temporal` and `Date` codecs end at +275760-09-13.\n*/\nconst pgDateStoredText = postgresDateTime({\n\tshape: \"date\",\n\townerId: \"pg/date\",\n\trange: {\n\t\tearliest: \"-004713-11-24\",\n\t\tlatest: \"+275760-09-13\"\n\t}\n}, true);\nconst pgTimeStoredText = postgresDateTime({\n\tshape: \"time\",\n\townerId: \"pg/time\"\n}, false);\nconst pgTimetzStoredText = postgresDateTime({\n\tshape: \"timeWithOffset\",\n\townerId: \"pg/timetz\",\n\tmaxOffsetHours: 15\n}, false);\nconst pgTimestampStoredText = postgresDateTime({\n\tshape: \"dateTime\",\n\townerId: \"pg/timestamp\",\n\trange: {\n\t\tearliest: \"-004713-11-24T00:00:00\",\n\t\tlatest: \"+275760-09-13T23:59:59.999999\"\n\t}\n}, true);\nconst pgTimestamptzStoredText = postgresDateTime({\n\tshape: \"instant\",\n\townerId: \"pg/timestamptz\",\n\trange: {\n\t\tearliest: \"-004713-11-24T00:00:00Z\",\n\t\tlatest: \"+275760-09-13T00:00:00Z\"\n\t}\n}, true);\n/** A cast that takes text and gives the value `read` makes of it. */\nconst castFromText = (read) => (value) => typeof value === \"string\" ? read(value) : wrongShape(value, \"text\");\nconst pgTimetz = sqlDataType(\"pg/timetz\", {\n\tread: readStoredDateTime(\"pg/timetz\", pgTimetzStoredText, \"a time of day with its UTC offset, as in \\\"12:34:56+02:00\\\" or \\\"12:34:56Z\\\"\", SECONDS_FRACTION),\n\tspell: spellStoredDateTime(pgTimetzStoredText),\n\tparams: pgPrecisionParams,\n\ttexts: [\n\t\twritten(\"timetz\"),\n\t\twritten(\"timetz({precision})\"),\n\t\tcatalog(\"time with time zone\"),\n\t\tcatalog(\"time({precision}) with time zone\")\n\t]\n});\nconst pgInterval = sqlDataType(\"pg/interval\", {\n\tread: readStoredDateTime(\"pg/interval\", pgIntervalStoredText, \"an ISO 8601 duration, as in \\\"P1Y2M3DT4H5M6.5S\\\"\", INTERVAL_SECONDS_FRACTION),\n\tspell: spellStoredDateTime(pgIntervalStoredText),\n\tequalityKey: intervalEqualityKey,\n\tparams: pgPrecisionParams,\n\ttexts: [writtenAndCatalog(\"interval\"), writtenAndCatalog(\"interval({precision})\")]\n});\nconst pgBytea = sqlDataType(\"pg/bytea\", {\n\tread: (json) => readPgByteaJson(\"pg/bytea\", json),\n\tspell: spellPgByteaJson,\n\ttexts: [writtenAndCatalog(\"bytea\")]\n});\n/** Text PostgreSQL reads as an IP address, written the way PostgreSQL writes it, so the contract holds the value the database reports. */\nfunction pgInetStoredText(text) {\n\tconst inet = storedInet(text);\n\tif (inet !== void 0) return inet;\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `${JSON.stringify(text)} is not an IP address: PostgreSQL reads an IPv4 address in decimal octets or an IPv6 address in hexadecimal groups, either optionally followed by / and a prefix length.`, {\n\t\twhy: \"An inet column takes only text PostgreSQL reads as an IP address.\",\n\t\tfix: \"Write an address such as 192.168.0.1 or 2001:db8::1/64.\"\n\t});\n}\nconst pgInet = sqlDataType(\"pg/inet\", {\n\tread: readInet,\n\tspell: spellInet,\n\ttexts: [writtenAndCatalog(\"inet\")],\n\tcasts: { [pgText.id]: castFromText(pgInetStoredText) }\n});\nconst pgDate = sqlDataType(\"pg/date\", {\n\tread: readStoredDateTime(\"pg/date\", pgDateStoredText, \"a date, as in \\\"2024-01-01\\\", or infinity or -infinity\", SECONDS_FRACTION),\n\tspell: spellStoredDateTime(pgDateStoredText),\n\ttexts: [writtenAndCatalog(\"date\")]\n});\nconst pgTime = sqlDataType(\"pg/time\", {\n\tread: readStoredDateTime(\"pg/time\", pgTimeStoredText, \"a time of day, as in \\\"12:34:56\\\"\", SECONDS_FRACTION),\n\tspell: spellStoredDateTime(pgTimeStoredText),\n\tparams: pgPrecisionParams,\n\ttexts: [\n\t\twritten(\"time\"),\n\t\twritten(\"time({precision})\"),\n\t\tcatalog(\"time without time zone\"),\n\t\tcatalog(\"time({precision}) without time zone\")\n\t]\n});\nconst pgTimestamp = sqlDataType(\"pg/timestamp\", {\n\tread: readStoredDateTime(\"pg/timestamp\", pgTimestampStoredText, \"a date and time of day, as in \\\"2024-01-01T12:34:56\\\", or infinity or -infinity\", SECONDS_FRACTION),\n\tspell: spellStoredDateTime(pgTimestampStoredText),\n\tparams: pgPrecisionParams,\n\ttexts: [\n\t\twritten(\"timestamp\"),\n\t\twritten(\"timestamp({precision})\"),\n\t\tcatalog(\"timestamp without time zone\"),\n\t\tcatalog(\"timestamp({precision}) without time zone\")\n\t]\n});\nconst pgTimestamptz = sqlDataType(\"pg/timestamptz\", {\n\tread: readStoredDateTime(\"pg/timestamptz\", pgTimestamptzStoredText, \"an instant in UTC, as in \\\"2024-01-01T00:00:00Z\\\", or infinity or -infinity\", SECONDS_FRACTION),\n\tspell: spellStoredDateTime(pgTimestamptzStoredText),\n\tparams: pgPrecisionParams,\n\ttexts: [\n\t\twritten(\"timestamptz\"),\n\t\twritten(\"timestamptz({precision})\"),\n\t\tcatalog(\"timestamp with time zone\"),\n\t\tcatalog(\"timestamp({precision}) with time zone\")\n\t]\n});\n/** Every data type this target registers. */\nconst postgresDataTypes = [\n\tpgText,\n\tpgTextArray,\n\tpgEnum,\n\tpgInt2,\n\tpgBool,\n\tpgJson,\n\tpgTsquery,\n\tpgInt4,\n\tpgInt8,\n\tpgNumeric,\n\tpgFloat4,\n\tpgFloat8,\n\tpgJsonb,\n\tpgChar,\n\tpgVarchar,\n\tpgUuid,\n\tpgInet,\n\tpgBit,\n\tpgVarbit,\n\tpgTimetz,\n\tpgInterval,\n\tpgBytea,\n\tpgDate,\n\tpgTime,\n\tpgTimestamp,\n\tpgTimestamptz,\n\tsqlRawDataType\n];\n/** A lookup of the data types this target registers. */\nfunction createPostgresBuiltinDataTypeLookup() {\n\treturn assembleDataTypes([{\n\t\tid: \"postgres\",\n\t\tdataTypes: postgresDataTypes\n\t}]).lookup;\n}\n//#endregion\nexport { pgTimestampStoredText as A, qualifiedEnumName as B, pgNumericParams as C, pgTime as D, pgTextArray as E, pgTsquery as F, MICROS_PER_SECOND as G, postgresYearText as H, pgUuid as I, microsFromFraction as J, formatIsoDuration as K, pgVarbit as L, pgTimestamptzStoredText as M, pgTimetz as N, pgTimeStoredText as O, pgTimetzStoredText as P, postgresIntervalFields as Q, pgVarchar as R, pgNumeric as S, pgText as T, BYTEA_TEXT as U, isoYearText as V, ISO_DURATION as W, pgByteaHexText as X, pgByteaFromHexText as Y, pgIntervalStoredText as Z, pgInt8 as _, pgBytea as a, pgJsonb as b, pgDate as c, pgEnumParams as d, pgFloat4 as f, pgInt4 as g, pgInt2 as h, pgBool as i, pgTimestamptz as j, pgTimestamp as k, pgDateStoredText as l, pgInet as m, pgBit as n, pgChar as o, pgFloat8 as p, intervalFieldsOf as q, pgBitLengthParams as r, pgCharacterLengthParams as s, createPostgresBuiltinDataTypeLookup as t, pgEnum as u, pgInterval as v, pgPrecisionParams as w, pgJsonbEnumRefusal as x, pgJson as y, postgresDataTypes as z };\n\n//# sourceMappingURL=data-types-BAbkwTt9.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,oBAAoB,MAAM,QAAQ,aAAa;CACvD,MAAM,cAAc,cAAc,gBAAgB,MAAM,GAAG,IAAI;CAC/D,OAAO,YAAY,UAAU,UAAU,CAAC,GAAG,WAAW,CAAC,CAAC,UAAU;AACnE;;AAEA,MAAM,aAAa;;;;AAInB,SAAS,WAAW,MAAM;CACzB,IAAI,CAAC,WAAW,KAAK,IAAI,GAAG,OAAO,KAAK;CACxC,MAAM,MAAM,KAAK,QAAQ,UAAU,EAAE,CAAC,CAAC,YAAY;CACnD,OAAO,GAAG,IAAI,MAAM,GAAG,CAAC,EAAE,GAAG,IAAI,MAAM,GAAG,EAAE,EAAE,GAAG,IAAI,MAAM,IAAI,EAAE,EAAE,GAAG,IAAI,MAAM,IAAI,EAAE,EAAE,GAAG,IAAI,MAAM,EAAE;AACxG;;AAEA,MAAM,aAAa;;AAEnB,SAAS,WAAW,OAAO;CAC1B,MAAM,SAAS,KAAK,OAAO,KAAK;CAChC,OAAO,OAAO,SAAS,MAAM,MAAM,UAAU,KAAK,WAAW;AAC9D;AACA,MAAM,eAAe;AACrB,MAAM,oBAAoB;;;;;;;;;;;;;;AAc1B,MAAM,sBAAsB,UAAU,aAAa;CAClD,IAAI,aAAa,IAAI,OAAO;CAC5B,MAAM,OAAO,OAAO,SAAS,MAAM,GAAG,CAAC,CAAC,CAAC,OAAO,GAAG,GAAG,CAAC;CACvD,MAAM,OAAO,SAAS,MAAM,CAAC,CAAC,CAAC,QAAQ,OAAO,EAAE;CAChD,IAAI,SAAS,IAAI,OAAO;CACxB,MAAM,OAAO,KAAK,OAAO,OAAO,KAAK,WAAW;CAChD,OAAO,OAAO,OAAO,QAAQ,CAAC,WAAW,OAAO,KAAK;AACtD;AACA,MAAM,iB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,QAAQ,0BAA0B;EAClC,QAAQ,uCAAuC;CAChD;AACD,CAAC;;AAED,MAAM,oBAAoB;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,SAAS,sCAAsC;CAC9C,OAAO,kBAAkB,CAAC;EACzB,IAAI;EACJ,WAAW;CACZ,CAAC,CAAC,CAAC,CAAC;AACL"}
|
|
@@ -46,6 +46,8 @@ declare const pgNumeric: import("@prisma/orm-family-sql/contract/data-type").Sql
|
|
|
46
46
|
declare const pgFloat4: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<Readonly<Record<string, unknown>>>;
|
|
47
47
|
declare const pgFloat8: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<Readonly<Record<string, unknown>>>;
|
|
48
48
|
declare const pgJsonb: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<Readonly<Record<string, unknown>>>;
|
|
49
|
+
/** Why no enum can use a codec of `pg/jsonb`, which every such codec gives as its `enumRefusal`. */
|
|
50
|
+
declare const pgJsonbEnumRefusal = "A CHECK lists a string member as SQL text, which PostgreSQL reads as the JSON text of a document rather than as a string, and a number member as a number, which PostgreSQL cannot compare with jsonb, so no CHECK can compare a value with the members. No enum can use a jsonb codec; use a text enum instead.";
|
|
49
51
|
declare const pgChar: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<{
|
|
50
52
|
length?: number;
|
|
51
53
|
}>;
|
|
@@ -91,5 +93,5 @@ declare const postgresDataTypes: readonly DataType[];
|
|
|
91
93
|
/** A lookup of the data types this target registers. */
|
|
92
94
|
declare function createPostgresBuiltinDataTypeLookup(): DataTypeLookup;
|
|
93
95
|
//#endregion
|
|
94
|
-
export {
|
|
95
|
-
//# sourceMappingURL=data-types-
|
|
96
|
+
export { pgTimestampStoredText as A, postgresDataTypes as B, pgNumericParams as C, pgTime as D, pgTextArray as E, pgTsquery as F, pgUuid as I, pgVarbit as L, pgTimestamptzStoredText as M, pgTimetz as N, pgTimeStoredText as O, pgTimetzStoredText as P, pgVarchar as R, pgNumeric as S, pgText as T, qualifiedEnumName as V, pgInt8 as _, pgBytea as a, pgJsonb as b, pgDate as c, pgEnumParams as d, pgFloat4 as f, pgInt4 as g, pgInt2 as h, pgBool as i, pgTimestamptz as j, pgTimestamp as k, pgDateStoredText as l, pgInet as m, pgBit as n, pgChar as o, pgFloat8 as p, pgBitLengthParams as r, pgCharacterLengthParams as s, createPostgresBuiltinDataTypeLookup as t, pgEnum as u, pgInterval as v, pgPrecisionParams as w, pgJsonbEnumRefusal as x, pgJson as y, postgresDataTypeEntries as z };
|
|
97
|
+
//# sourceMappingURL=data-types-BWxZXp8N.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-types-
|
|
1
|
+
{"version":3,"file":"data-types-BWxZXp8N.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/data-types.d.mts"],"mappings":";;;;;iBAIiB,2BAA2B,SAAS,eAAe;;;;cAItD,+DAA+D;EAC3E;EACA;;;cAGY,uEAAuE;EACnF;;;cAGY,iEAAiE;EAC7E;;;cAGY,iEAAiE;EAC7E;;cAEY,4DAA4D;EACxE;;cAEY,mDAAmD,YAAY,SAAS;cACxE,wDAAwD,YAAY,SAAS;;iBAE1E,kBAAkB,UAAU,KAAK;cACpC,mDAAmD;EAC/D;;cAEY,mDAAmD,YAAY,SAAS;cACxE,mDAAmD,YAAY,SAAS;cACxE,mDAAmD,YAAY,SAAS;cACxE,sDAAsD,YAAY,SAAS;cAC3E,mDAAmD,YAAY,SAAS;cACxE,mDAAmD,YAAY,SAAS;cACxE,sDAAsD;EAClE;EACA;;cAEY,qDAAqD,YAAY,SAAS;cAC1E,qDAAqD,YAAY,SAAS;cAC1E,oDAAoD,YAAY,SAAS;;cAEzE;cACA,mDAAmD;EAC/D;;cAEY,sDAAsD;EAClE;;cAEY,mDAAmD,YAAY,SAAS;cACxE,kDAAkD;EAC9D;;cAEY,qDAAqD;EACjE;;;;;;cAMY,mBAAmB;cACnB,mBAAmB;cACnB,qBAAqB;cACrB,wBAAwB;cACxB,0BAA0B;cAC1B,qDAAqD;EACjE;;cAEY,uDAAuD;EACnE;;cAEY,oDAAoD,YAAY,SAAS;cACzE,mDAAmD,YAAY,SAAS;cACxE,mDAAmD,YAAY,SAAS;cACxE,mDAAmD;EAC/D;;cAEY,wDAAwD;EACpE;;cAEY,0DAA0D;EACtE;;;cAGY,4BAA4B;;iBAEzB,uCAAuC"}
|
package/dist/{descriptor-meta-9qCQPbrI-DFEFmwBv.mjs → descriptor-meta-BZczsKUL-L5NrK7J6.mjs}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { F as PG_VARCHAR_CODEC_ID, N as PG_UUID_CODEC_ID, S as PG_TEXT_CODEC_ID, i as PG_CHAR_CODEC_ID } from "./codec-ids-BMhEpFwv-BLIC4g3Y.mjs";
|
|
2
2
|
import { t as DEFAULT_NAMESPACE_ID } from "./namespace-ids-xtp_ZY86-Cpp8PTxD.mjs";
|
|
3
|
-
import { M as postgresQualifyColumnType } from "./codecs-
|
|
3
|
+
import { M as postgresQualifyColumnType } from "./codecs-DGvwfB1h-BYcObjvV.mjs";
|
|
4
4
|
import { h as postgresCreateNamespace } from "./postgres-schema-C6w1rzOF-bzaF5PIS.mjs";
|
|
5
|
-
import { a as postgresAuthoringPslBlockDescriptors, c as postgresNowGeneratorControlDescriptors, i as postgresAuthoringModelAttributes, l as postgresNowGeneratorFunction, n as postgresAuthoringEntityTypes, o as postgresAuthoringTypes, r as postgresAuthoringFieldPresets, s as postgresLowerEntityHandles } from "./authoring-
|
|
5
|
+
import { a as postgresAuthoringPslBlockDescriptors, c as postgresNowGeneratorControlDescriptors, i as postgresAuthoringModelAttributes, l as postgresNowGeneratorFunction, n as postgresAuthoringEntityTypes, o as postgresAuthoringTypes, r as postgresAuthoringFieldPresets, s as postgresLowerEntityHandles } from "./authoring-CYmxS94I-rwTYrwpM.mjs";
|
|
6
6
|
import { t as postgresRenderCheckExpressions } from "./check-expressions-7uCCP01t-WtUqfqkP.mjs";
|
|
7
|
-
import { t as postgresDataTypeEntries } from "./data-type-entries-
|
|
8
|
-
import { t as postgresTargetDescriptorMetaRuntime } from "./descriptor-meta-runtime-
|
|
7
|
+
import { t as postgresDataTypeEntries } from "./data-type-entries-DGSg_Rid-BFK5ZVA0.mjs";
|
|
8
|
+
import { t as postgresTargetDescriptorMetaRuntime } from "./descriptor-meta-runtime-DOxAmbAO-Gv2ogkOw.mjs";
|
|
9
9
|
import { n as postgresIndexTypes } from "./index-types-BihjrAAq-ktkeKE97.mjs";
|
|
10
10
|
import { TIMESTAMP_NOW_GENERATOR_ID } from "@prisma/orm-framework/components/authoring";
|
|
11
11
|
import { idGeneratorFunctionBindings } from "@prisma/orm-family-sql/family/pack";
|
|
12
|
-
//#region ../../../3-targets/3-targets/postgres/dist/descriptor-meta-
|
|
12
|
+
//#region ../../../3-targets/3-targets/postgres/dist/descriptor-meta-BZczsKUL.mjs
|
|
13
13
|
const postgresGeneratorFunctions = [postgresNowGeneratorFunction, ...idGeneratorFunctionBindings({
|
|
14
14
|
text: [
|
|
15
15
|
PG_CHAR_CODEC_ID,
|
|
@@ -51,4 +51,4 @@ const postgresTargetDescriptorMeta = {
|
|
|
51
51
|
//#endregion
|
|
52
52
|
export { postgresTargetDescriptorMeta as t };
|
|
53
53
|
|
|
54
|
-
//# sourceMappingURL=descriptor-meta-
|
|
54
|
+
//# sourceMappingURL=descriptor-meta-BZczsKUL-L5NrK7J6.mjs.map
|
package/dist/{descriptor-meta-9qCQPbrI-DFEFmwBv.mjs.map → descriptor-meta-BZczsKUL-L5NrK7J6.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor-meta-
|
|
1
|
+
{"version":3,"file":"descriptor-meta-BZczsKUL-L5NrK7J6.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/descriptor-meta-BZczsKUL.mjs"],"sourcesContent":["import { F as PG_VARCHAR_CODEC_ID, N as PG_UUID_CODEC_ID, S as PG_TEXT_CODEC_ID, i as PG_CHAR_CODEC_ID } from \"./codec-ids-BMhEpFwv.mjs\";\nimport { t as postgresDataTypeEntries } from \"./data-type-entries-DGSg_Rid.mjs\";\nimport { E as postgresQualifyColumnType } from \"./codecs-DGvwfB1h.mjs\";\nimport { t as DEFAULT_NAMESPACE_ID } from \"./namespace-ids-xtp_ZY86.mjs\";\nimport { a as postgresAuthoringPslBlockDescriptors, c as postgresNowGeneratorFunction, i as postgresAuthoringModelAttributes, l as postgresNowGeneratorControlDescriptors, n as postgresAuthoringEntityTypes, o as postgresAuthoringTypes, r as postgresAuthoringFieldPresets, s as postgresLowerEntityHandles } from \"./authoring-CYmxS94I.mjs\";\nimport { i as postgresCreateNamespace } from \"./postgres-schema-C6w1rzOF.mjs\";\nimport { t as postgresRenderCheckExpressions } from \"./check-expressions-7uCCP01t.mjs\";\nimport { t as postgresTargetDescriptorMetaRuntime } from \"./descriptor-meta-runtime-DOxAmbAO.mjs\";\nimport { n as postgresIndexTypes } from \"./index-types-BihjrAAq.mjs\";\nimport { TIMESTAMP_NOW_GENERATOR_ID } from \"@internal/framework-components/authoring\";\nimport { idGeneratorFunctionBindings } from \"@internal/family-sql/pack\";\n//#region src/core/generator-functions.ts\nconst postgresGeneratorFunctions = [postgresNowGeneratorFunction, ...idGeneratorFunctionBindings({\n\ttext: [\n\t\tPG_CHAR_CODEC_ID,\n\t\tPG_VARCHAR_CODEC_ID,\n\t\tPG_TEXT_CODEC_ID\n\t],\n\tuuid: [PG_UUID_CODEC_ID]\n})];\n/** The `now` generators Postgres binds. The SQL family registers the identifier generators. */\nconst postgresGeneratorDescriptors = [{ id: TIMESTAMP_NOW_GENERATOR_ID }, ...postgresNowGeneratorControlDescriptors()];\nconst postgresTargetDescriptorMeta = {\n\t...postgresTargetDescriptorMetaRuntime,\n\tdefaultNamespaceId: DEFAULT_NAMESPACE_ID,\n\tsupportsNamespaces: true,\n\tindexTypes: postgresIndexTypes,\n\tauthoring: {\n\t\ttype: postgresAuthoringTypes,\n\t\tfield: postgresAuthoringFieldPresets,\n\t\tdataTypes: postgresDataTypeEntries(),\n\t\tentityTypes: postgresAuthoringEntityTypes,\n\t\tpslBlockDescriptors: postgresAuthoringPslBlockDescriptors,\n\t\tmodelAttributes: postgresAuthoringModelAttributes,\n\t\tcreateNamespace: postgresCreateNamespace,\n\t\tqualifyColumnType: postgresQualifyColumnType,\n\t\trenderCheckExpressions: postgresRenderCheckExpressions,\n\t\tlowerEntityHandles: postgresLowerEntityHandles\n\t},\n\tgeneratorFunctions: postgresGeneratorFunctions,\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: /* @__PURE__ */ new Map(),\n\t\tgeneratorDescriptors: postgresGeneratorDescriptors\n\t},\n\ttypes: { queryOperationTypes: { import: {\n\t\tpackage: \"@internal/target-postgres/operation-types\",\n\t\tnamed: \"QueryOperationTypes\",\n\t\talias: \"PgTargetQueryOps\"\n\t} } }\n};\n//#endregion\nexport { postgresTargetDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-BZczsKUL.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,MAAM,6BAA6B,CAAC,8BAA8B,GAAG,4BAA4B;CAChG,MAAM;EACL;EACA;EACA;CACD;CACA,MAAM,CAAC,gBAAgB;AACxB,CAAC,CAAC;;AAEF,MAAM,+BAA+B,CAAC,EAAE,IAAI,2BAA2B,GAAG,GAAG,uCAAuC,CAAC;AACrH,MAAM,+BAA+B;CACpC,GAAG;CACH,oBAAoB;CACpB,oBAAoB;CACpB,YAAY;CACZ,WAAW;EACV,MAAM;EACN,OAAO;EACP,WAAW,wBAAwB;EACnC,aAAa;EACb,qBAAqB;EACrB,iBAAiB;EACjB,iBAAiB;EACjB,mBAAmB;EACnB,wBAAwB;EACxB,oBAAoB;CACrB;CACA,oBAAoB;CACpB,yBAAyB;EACxB,yCAAyC,IAAI,IAAI;EACjD,sBAAsB;CACvB;CACA,OAAO,EAAE,qBAAqB,EAAE,QAAQ;EACvC,SAAS;EACT,OAAO;EACP,OAAO;CACR,EAAE,EAAE;AACL"}
|
package/dist/{descriptor-meta-Cb7RcgEQ-CwwQ6QE8.mjs → descriptor-meta-Cb7RcgEQ-DqOiqB2V.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as postgresCodecRegistry } from "./codec-registry-
|
|
2
|
-
import { r as postgresAdapterContractContributions } from "./contract-contributions-CRCEK7Dx-
|
|
1
|
+
import { o as postgresCodecRegistry } from "./codec-registry-EFFhQhEM-DANMHp-D.mjs";
|
|
2
|
+
import { r as postgresAdapterContractContributions } from "./contract-contributions-CRCEK7Dx-B0F06bbX.mjs";
|
|
3
3
|
//#region ../../../3-targets/6-adapters/postgres/dist/descriptor-meta-Cb7RcgEQ.mjs
|
|
4
4
|
const postgresAdapterDescriptorMeta = {
|
|
5
5
|
kind: "adapter",
|
|
@@ -33,4 +33,4 @@ const postgresAdapterDescriptorMeta = {
|
|
|
33
33
|
//#endregion
|
|
34
34
|
export { postgresAdapterDescriptorMeta as t };
|
|
35
35
|
|
|
36
|
-
//# sourceMappingURL=descriptor-meta-Cb7RcgEQ-
|
|
36
|
+
//# sourceMappingURL=descriptor-meta-Cb7RcgEQ-DqOiqB2V.mjs.map
|
package/dist/{descriptor-meta-Cb7RcgEQ-CwwQ6QE8.mjs.map → descriptor-meta-Cb7RcgEQ-DqOiqB2V.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor-meta-Cb7RcgEQ-
|
|
1
|
+
{"version":3,"file":"descriptor-meta-Cb7RcgEQ-DqOiqB2V.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/descriptor-meta-Cb7RcgEQ.mjs"],"sourcesContent":["import { t as postgresAdapterContractContributions } from \"./contract-contributions-CRCEK7Dx.mjs\";\nimport { postgresCodecRegistry } from \"@internal/target-postgres/codecs\";\n//#region src/core/descriptor-meta.ts\nconst postgresAdapterDescriptorMeta = {\n\tkind: \"adapter\",\n\tfamilyId: \"sql\",\n\ttargetId: \"postgres\",\n\tid: \"postgres\",\n\tversion: \"0.0.1\",\n\tcapabilities: postgresAdapterContractContributions.capabilities,\n\ttypes: {\n\t\taggregateDescriptors: postgresAdapterContractContributions.types.aggregateDescriptors,\n\t\tcodecTypes: {\n\t\t\tcodecDescriptors: Array.from(postgresCodecRegistry.values()),\n\t\t\timport: {\n\t\t\t\tpackage: \"@internal/target-postgres/codec-types\",\n\t\t\t\tnamed: \"CodecTypes\",\n\t\t\t\talias: \"PgTypes\"\n\t\t\t},\n\t\t\ttypeImports: [{\n\t\t\t\tpackage: \"@internal/target-postgres/codec-types\",\n\t\t\t\tnamed: \"JsonValue\",\n\t\t\t\talias: \"JsonValue\"\n\t\t\t}],\n\t\t\tparameterizedOutputTypes: {\n\t\t\t\tpackage: \"@internal/target-postgres/codec-types\",\n\t\t\t\tnamed: \"ParameterizedOutputTypesForTypeParams\",\n\t\t\t\talias: \"PgParameterizedOutputTypes\"\n\t\t\t}\n\t\t}\n\t}\n};\n//#endregion\nexport { postgresAdapterDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-Cb7RcgEQ.mjs.map"],"mappings":";;;AAGA,MAAM,gCAAgC;CACrC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS;CACT,cAAc,qCAAqC;CACnD,OAAO;EACN,sBAAsB,qCAAqC,MAAM;EACjE,YAAY;GACX,kBAAkB,MAAM,KAAK,sBAAsB,OAAO,CAAC;GAC3D,QAAQ;IACP,SAAS;IACT,OAAO;IACP,OAAO;GACR;GACA,aAAa,CAAC;IACb,SAAS;IACT,OAAO;IACP,OAAO;GACR,CAAC;GACD,0BAA0B;IACzB,SAAS;IACT,OAAO;IACP,OAAO;GACR;EACD;CACD;AACD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region ../../../3-targets/3-targets/postgres/dist/descriptor-meta-runtime-
|
|
1
|
+
import { Y as postgresDataTypes } from "./data-types-BAbkwTt9-C9WMEFNT.mjs";
|
|
2
|
+
//#region ../../../3-targets/3-targets/postgres/dist/descriptor-meta-runtime-DOxAmbAO.mjs
|
|
3
3
|
const postgresTargetDescriptorMetaRuntime = {
|
|
4
4
|
kind: "target",
|
|
5
5
|
familyId: "sql",
|
|
@@ -12,4 +12,4 @@ const postgresTargetDescriptorMetaRuntime = {
|
|
|
12
12
|
//#endregion
|
|
13
13
|
export { postgresTargetDescriptorMetaRuntime as t };
|
|
14
14
|
|
|
15
|
-
//# sourceMappingURL=descriptor-meta-runtime-
|
|
15
|
+
//# sourceMappingURL=descriptor-meta-runtime-DOxAmbAO-Gv2ogkOw.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor-meta-runtime-
|
|
1
|
+
{"version":3,"file":"descriptor-meta-runtime-DOxAmbAO-Gv2ogkOw.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/descriptor-meta-runtime-DOxAmbAO.mjs"],"sourcesContent":["import { z as postgresDataTypes } from \"./data-types-BAbkwTt9.mjs\";\nconst postgresTargetDescriptorMetaRuntime = {\n\tkind: \"target\",\n\tfamilyId: \"sql\",\n\ttargetId: \"postgres\",\n\tid: \"postgres\",\n\tversion: \"0.0.1\",\n\tcapabilities: {},\n\tdataTypes: postgresDataTypes\n};\n//#endregion\nexport { postgresTargetDescriptorMetaRuntime as t };\n\n//# sourceMappingURL=descriptor-meta-runtime-DOxAmbAO.mjs.map"],"mappings":";;AACA,MAAM,sCAAsC;CAC3C,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS;CACT,cAAc,CAAC;CACf,WAAW;AACZ"}
|
|
@@ -7,7 +7,7 @@ import { i as PostgresRoleSchemaNode, n as PostgresNamespaceSchemaNode, r as Pos
|
|
|
7
7
|
import { t as postgresResolveDefault } from "./default-normalizer-BqK6XxdC-BAgxt9FF.mjs";
|
|
8
8
|
import { n as renderFullTextIndexDocument } from "./full-text-search-document-Doy5TF7c-DezgYsP-.mjs";
|
|
9
9
|
import { r as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-D3VNPMSm-DVuswLch.mjs";
|
|
10
|
-
import { d as resolvePostgresNodeIssueControlPolicySubject } from "./control-policy-
|
|
10
|
+
import { d as resolvePostgresNodeIssueControlPolicySubject } from "./control-policy-CifihRKs-B5UzQAd1.mjs";
|
|
11
11
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
12
12
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
13
13
|
import { diffSchemas, issueOutcome } from "@prisma/orm-framework/components/control";
|
|
@@ -16,7 +16,7 @@ import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
|
16
16
|
import { contractNamespaceToSchemaIR, sqlTypeLookupsOf } from "@prisma/orm-family-sql/family/control";
|
|
17
17
|
import { PrimaryKey, RelationalSchemaNodeKind, SqlForeignKeyIR, SqlIndexIR, SqlUniqueIR } from "@prisma/orm-family-sql/schema-ir/types";
|
|
18
18
|
import { classifyDiffSubjectGranularity } from "@prisma/orm-family-sql/family/diff";
|
|
19
|
-
//#region ../../../3-targets/3-targets/postgres/dist/diff-database-schema-
|
|
19
|
+
//#region ../../../3-targets/3-targets/postgres/dist/diff-database-schema-BHkYz_Ll.mjs
|
|
20
20
|
/** The database root's fixed sentinel id (`PostgresDatabaseSchemaNode#id`). */
|
|
21
21
|
function databaseStep() {
|
|
22
22
|
return {
|
|
@@ -406,4 +406,4 @@ function buildPostgresPlanDiff(input) {
|
|
|
406
406
|
//#endregion
|
|
407
407
|
export { contractToPostgresDatabaseSchemaNode as n, diffPostgresSchema as r, buildPostgresPlanDiff as t };
|
|
408
408
|
|
|
409
|
-
//# sourceMappingURL=diff-database-schema-
|
|
409
|
+
//# sourceMappingURL=diff-database-schema-BHkYz_Ll-DGSW_oEV.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff-database-schema-CmWmomi3-PoUser3Y.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/diff-database-schema-CmWmomi3.mjs"],"sourcesContent":["import { c as postgresError } from \"./errors-BrhQYgdL.mjs\";\nimport { i as fullTextIndexDefinitionOf, t as FULL_TEXT_INDEX_TYPE } from \"./full-text-index-definition-BPxQQBuC.mjs\";\nimport { r as isPostgresSchema } from \"./postgres-schema-C6w1rzOF.mjs\";\nimport { t as postgresAccessMethodOf } from \"./index-types-BihjrAAq.mjs\";\nimport { t as postgresResolveDefault } from \"./default-normalizer-BqK6XxdC.mjs\";\nimport { a as postgresDiffSubjectGranularity, n as PostgresNativeEnumSchemaNode, r as PostgresSchemaNodeKind, t as PostgresTableSchemaNode } from \"./postgres-table-schema-node-BBkitBQh.mjs\";\nimport { i as PostgresDatabaseSchemaNode, n as PostgresPolicySchemaNode, r as PostgresNamespaceSchemaNode, t as PostgresRoleSchemaNode } from \"./postgres-role-schema-node-B8Z5i5D-.mjs\";\nimport { n as renderFullTextIndexDocument } from \"./full-text-search-document-Doy5TF7c.mjs\";\nimport { r as resolveDdlSchemaForNamespaceStorage } from \"./resolve-ddl-schema-D3VNPMSm.mjs\";\nimport { i as resolvePostgresNodeIssueControlPolicySubject } from \"./control-policy-B10lrdMt.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { diffSchemas, issueOutcome } from \"@internal/framework-components/control\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { contractNamespaceToSchemaIR, sqlTypeLookupsOf } from \"@internal/family-sql/control\";\nimport { namingOf } from \"@internal/sql-schema-ir/naming\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { classifyDiffSubjectGranularity } from \"@internal/family-sql/diff\";\nimport { PrimaryKey, RelationalSchemaNodeKind, SqlForeignKeyIR, SqlIndexIR, SqlUniqueIR } from \"@internal/sql-schema-ir/types\";\n//#region src/core/migrations/contract-to-postgres-database-schema-node.ts\n/** The database root's fixed sentinel id (`PostgresDatabaseSchemaNode#id`). */\nfunction databaseStep() {\n\treturn {\n\t\tnodeKind: PostgresSchemaNodeKind.database,\n\t\tid: \"database\"\n\t};\n}\nfunction tableDependsOn(namespaceId, tableName) {\n\treturn [\n\t\tdatabaseStep(),\n\t\t{\n\t\t\tnodeKind: PostgresSchemaNodeKind.namespace,\n\t\t\tid: namespaceId\n\t\t},\n\t\t{\n\t\t\tnodeKind: PostgresSchemaNodeKind.table,\n\t\t\tid: tableName\n\t\t}\n\t];\n}\nfunction roleDependsOn(role) {\n\treturn [databaseStep(), {\n\t\tnodeKind: PostgresSchemaNodeKind.role,\n\t\tid: role\n\t}];\n}\n/**\n* The chains from a table-child object (foreign key, index, unique, primary\n* key) to each of the own columns it is built on, in the Postgres tree.\n* Dropping a covered column auto-drops the object, so the object's drop must\n* precede the column's; the graph derives that direction from these edges.\n*/\nfunction columnDependsOn(namespaceId, tableName, columns) {\n\treturn columns.map((column) => [...tableDependsOn(namespaceId, tableName), {\n\t\tnodeKind: RelationalSchemaNodeKind.column,\n\t\tid: `column:${column}`\n\t}]);\n}\nfunction toPolicyNode(policy, namespaceId) {\n\treturn new PostgresPolicySchemaNode({\n\t\tnaming: namingOf(policy.name, policy.prefix),\n\t\ttableName: policy.tableName,\n\t\tnamespaceId,\n\t\toperation: policy.operation,\n\t\troles: [...policy.roles],\n\t\tusing: policy.using,\n\t\twithCheck: policy.withCheck,\n\t\tpermissive: policy.permissive,\n\t\tdependsOn: [tableDependsOn(namespaceId, policy.tableName), ...policy.roles.map(roleDependsOn)]\n\t});\n}\n/**\n* Projects a Postgres contract into the expected schema-diff tree: a\n* `PostgresDatabaseSchemaNode` root holding one `PostgresNamespaceSchemaNode`\n* per Postgres namespace, each holding its `PostgresTableSchemaNode`s with\n* their `PostgresPolicySchemaNode`s, plus the database roles on the root.\n*\n* Not a duplicate of the family's `contractToSchemaIR`: that builds a flat,\n* single `{ tables }` map (and throws on cross-namespace name collisions, with\n* no RLS/role concept) for SQLite's single-schema world. This is the\n* Postgres-specific *tree* shape — multi-schema, RLS-policy-aware, role-aware.\n* It reuses the family's per-namespace table conversion (`contractNamespaceToSchemaIR`)\n* for column/FK/index building and only adds the Postgres tree/policy/role shape.\n*\n* Tables are grouped by their owning namespace (resolved DDL schema name) so\n* the tree mirrors Postgres's object hierarchy. The DDL schema name is\n* resolved once per namespace.\n*\n* A policy that references a table absent from its namespace is a malformed\n* contract — the loop throws rather than fabricating a stub table.\n*/\nfunction contractToPostgresDatabaseSchemaNode(contract, options) {\n\tif (contract === null) return new PostgresDatabaseSchemaNode({\n\t\tnamespaces: {},\n\t\troles: [],\n\t\texistingSchemas: [],\n\t\tpgVersion: \"\"\n\t});\n\tconst namespaces = {};\n\tconst roles = [];\n\tconst ownedSchemas = [];\n\tfor (const ns of Object.values(contract.storage.namespaces)) {\n\t\tif (!isPostgresSchema(ns)) continue;\n\t\tfor (const role of Object.values(ns.role)) roles.push(new PostgresRoleSchemaNode({\n\t\t\tname: role.name,\n\t\t\tnamespaceId: role.namespaceId\n\t\t}));\n\t\tif (ns.id === UNBOUND_NAMESPACE_ID) {\n\t\t\tif (!Object.entries(ns.entries).some(([entriesKey, slot]) => entriesKey !== \"role\" && Object.keys(slot).length > 0)) continue;\n\t\t}\n\t\tconst ddlSchema = resolveDdlSchemaForNamespaceStorage(contract.storage, ns.id);\n\t\townedSchemas.push(ddlSchema);\n\t\tconst sqlTables = contractNamespaceToSchemaIR(contract.storage, ns.id, options).tables;\n\t\tconst policiesByTable = /* @__PURE__ */ new Map();\n\t\tfor (const policy of Object.values(ns.policy)) {\n\t\t\tconst list = policiesByTable.get(policy.tableName) ?? [];\n\t\t\tlist.push(toPolicyNode(policy, ddlSchema));\n\t\t\tpoliciesByTable.set(policy.tableName, list);\n\t\t}\n\t\tconst tables = {};\n\t\tfor (const tableName of Object.keys(ns.table)) {\n\t\t\tconst sqlTable = sqlTables[tableName];\n\t\t\tif (sqlTable === void 0) continue;\n\t\t\tconst foreignKeys = sqlTable.foreignKeys.map((fk) => {\n\t\t\t\tconst resolvedReferencedNamespace = resolveDdlSchemaForNamespaceStorage(contract.storage, fk.referencedSchema ?? UNBOUND_NAMESPACE_ID);\n\t\t\t\treturn new SqlForeignKeyIR({\n\t\t\t\t\tcolumns: fk.columns,\n\t\t\t\t\treferencedTable: fk.referencedTable,\n\t\t\t\t\treferencedColumns: fk.referencedColumns,\n\t\t\t\t\treferencedSchema: fk.referencedSchema ?? UNBOUND_NAMESPACE_ID,\n\t\t\t\t\t...ifDefined(\"name\", fk.name),\n\t\t\t\t\t...ifDefined(\"onDelete\", fk.onDelete),\n\t\t\t\t\t...ifDefined(\"onUpdate\", fk.onUpdate),\n\t\t\t\t\t...ifDefined(\"annotations\", fk.annotations),\n\t\t\t\t\tresolvedReferencedNamespace,\n\t\t\t\t\tdependsOn: [tableDependsOn(resolvedReferencedNamespace, fk.referencedTable), ...columnDependsOn(ddlSchema, tableName, fk.columns)]\n\t\t\t\t});\n\t\t\t});\n\t\t\tconst uniques = sqlTable.uniques.map((u) => new SqlUniqueIR({\n\t\t\t\tcolumns: u.columns,\n\t\t\t\t...ifDefined(\"name\", u.name),\n\t\t\t\t...ifDefined(\"annotations\", u.annotations),\n\t\t\t\tdependsOn: columnDependsOn(ddlSchema, tableName, u.columns)\n\t\t\t}));\n\t\t\tconst indexes = sqlTable.indexes.map((i) => {\n\t\t\t\tconst fullText = fullTextIndexDefinitionOf(i);\n\t\t\t\tif (fullText !== void 0) return new SqlIndexIR({\n\t\t\t\t\tnaming: namingOf(i.name, i.prefix),\n\t\t\t\t\twhere: i.where,\n\t\t\t\t\tunique: i.unique,\n\t\t\t\t\tpartial: i.partial,\n\t\t\t\t\ttype: postgresAccessMethodOf(FULL_TEXT_INDEX_TYPE),\n\t\t\t\t\toptions: void 0,\n\t\t\t\t\tannotations: i.annotations,\n\t\t\t\t\texpression: renderFullTextIndexDocument(fullText),\n\t\t\t\t\tdependsOn: columnDependsOn(ddlSchema, tableName, fullText.weightGroups.flat())\n\t\t\t\t});\n\t\t\t\tconst base = {\n\t\t\t\t\tnaming: namingOf(i.name, i.prefix),\n\t\t\t\t\twhere: i.where,\n\t\t\t\t\tunique: i.unique,\n\t\t\t\t\tpartial: i.partial,\n\t\t\t\t\ttype: i.type,\n\t\t\t\t\toptions: i.options,\n\t\t\t\t\tannotations: i.annotations,\n\t\t\t\t\tdependsOn: columnDependsOn(ddlSchema, tableName, i.columns ?? Object.keys(sqlTable.columns))\n\t\t\t\t};\n\t\t\t\treturn new SqlIndexIR(i.expression !== void 0 ? {\n\t\t\t\t\t...base,\n\t\t\t\t\texpression: i.expression\n\t\t\t\t} : {\n\t\t\t\t\t...base,\n\t\t\t\t\tcolumns: i.columns ?? []\n\t\t\t\t});\n\t\t\t});\n\t\t\tconst primaryKey = sqlTable.primaryKey !== void 0 ? new PrimaryKey({\n\t\t\t\tcolumns: sqlTable.primaryKey.columns,\n\t\t\t\t...ifDefined(\"name\", sqlTable.primaryKey.name),\n\t\t\t\tdependsOn: columnDependsOn(ddlSchema, tableName, sqlTable.primaryKey.columns)\n\t\t\t}) : void 0;\n\t\t\ttables[tableName] = new PostgresTableSchemaNode({\n\t\t\t\tname: sqlTable.name,\n\t\t\t\tcolumns: sqlTable.columns,\n\t\t\t\tforeignKeys,\n\t\t\t\tuniques,\n\t\t\t\tindexes,\n\t\t\t\t...ifDefined(\"primaryKey\", primaryKey),\n\t\t\t\t...ifDefined(\"annotations\", sqlTable.annotations),\n\t\t\t\t...ifDefined(\"checks\", sqlTable.checks),\n\t\t\t\tpolicies: policiesByTable.get(tableName) ?? [],\n\t\t\t\trlsEnabled: Object.hasOwn(ns.rls, tableName)\n\t\t\t});\n\t\t}\n\t\tfor (const [tableName, tablePolicies] of policiesByTable) {\n\t\t\tif (!(tableName in tables)) {\n\t\t\t\tconst policyName = tablePolicies[0]?.name ?? \"(unknown)\";\n\t\t\t\tthrow postgresError(\"CONTRACT.POLICY_INVALID\", `contract-to-postgres-database-schema-node: policy \"${policyName}\" references table \"${tableName}\" not present in namespace \"${ddlSchema}\"`, { meta: {\n\t\t\t\t\tpolicyName,\n\t\t\t\t\ttableName,\n\t\t\t\t\tnamespaceId: ddlSchema,\n\t\t\t\t\treason: \"table-missing\"\n\t\t\t\t} });\n\t\t\t}\n\t\t\tif (!Object.hasOwn(ns.rls, tableName)) {\n\t\t\t\tconst policyLabel = tablePolicies[0]?.prefix ?? tablePolicies[0]?.name ?? \"(unknown)\";\n\t\t\t\tthrow postgresError(\"CONTRACT.POLICY_INVALID\", `contract-to-postgres-database-schema-node: policy \"${policyLabel}\" targets table \"${tableName}\" in namespace \"${ddlSchema}\", which is not RLS-controlled. Mark the model with @@rls (entries.rls[\"${tableName}\"]) or remove the policy.`, { meta: {\n\t\t\t\t\tpolicyName: policyLabel,\n\t\t\t\t\ttableName,\n\t\t\t\t\tnamespaceId: ddlSchema,\n\t\t\t\t\treason: \"table-not-rls-controlled\"\n\t\t\t\t} });\n\t\t\t}\n\t\t}\n\t\tnamespaces[ddlSchema] = new PostgresNamespaceSchemaNode({\n\t\t\tschemaName: ddlSchema,\n\t\t\ttables,\n\t\t\tnativeEnums: Object.values(ns.entries.native_enum ?? {}).map((entity) => new PostgresNativeEnumSchemaNode({\n\t\t\t\ttypeName: entity.typeName,\n\t\t\t\tnamespaceId: ddlSchema,\n\t\t\t\tmembers: entity.members,\n\t\t\t\t...ifDefined(\"control\", entity.control)\n\t\t\t}))\n\t\t});\n\t}\n\treturn new PostgresDatabaseSchemaNode({\n\t\tnamespaces,\n\t\troles,\n\t\texistingSchemas: ownedSchemas,\n\t\tpgVersion: \"\"\n\t});\n}\n//#endregion\n//#region src/core/migrations/diff-database-schema.ts\n/**\n* Whether a diff issue's subject node is cluster-scoped — it carries its own\n* `namespaceId` field (only role and policy diff nodes do) and that\n* coordinate is the unbound sentinel, meaning the node is not owned by any\n* schema/namespace. A role node is always cluster-scoped (roles are\n* cluster-level objects); a policy node's `namespaceId` is always its\n* table's resolved DDL schema, never the sentinel. Namespace-ownership\n* scoping (which compares `issue.path[1]` against the set of DDL schemas\n* the contract owns) makes no sense for a cluster-scoped subject — its path\n* segment at that index is the object's own name, not a schema name — so\n* such an issue bypasses that scoping entirely.\n*/\nfunction isClusterScopedIssue(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\treturn node !== void 0 && nodeNamespaceId(node) === UNBOUND_NAMESPACE_ID;\n}\nfunction nodeNamespaceId(node) {\n\tif (!Object.hasOwn(node, \"namespaceId\")) return void 0;\n\treturn blindCast(node).namespaceId;\n}\nfunction ownedSchemaNames(expected) {\n\tconst policyNamespaces = Object.values(expected.namespaces).flatMap((ns) => Object.values(ns.tables).flatMap((t) => t.policies.map((p) => p.namespaceId)));\n\treturn /* @__PURE__ */ new Set([...policyNamespaces, ...expected.existingSchemas]);\n}\n/**\n* Drops contract namespaces that declare no tables from the verdict-diff\n* expected tree and the relational owned-schema set. The legacy relational\n* walk skipped a table-less namespace (e.g. an enums-only schema) before\n* pairing, so neither its DDL schema's absence nor that schema's live\n* relational contents ever reached the verdict — the pruned tree\n* reproduces that. The prune loses no expected policies: policies attach\n* to tables, so a table-less namespace carries none (the projection\n* throws on a policy referencing an absent table). Live policies in a\n* pruned schema remain governed via the full owned set (see\n* {@link diffPostgresSchema}).\n*/\nfunction pruneTableLessNamespaces(expected) {\n\tconst namespaces = Object.fromEntries(Object.entries(expected.namespaces).filter(([, ns]) => Object.keys(ns.tables).length > 0));\n\treturn new PostgresDatabaseSchemaNode({\n\t\tnamespaces,\n\t\troles: [...expected.roles],\n\t\texistingSchemas: expected.existingSchemas.filter((s) => namespaces[s] !== void 0),\n\t\tpgVersion: expected.pgVersion\n\t});\n}\n/**\n* Resolves a verdict-diff issue's subject's declared control policy directly\n* from the contract, by delegating to the same node-typed resolver\n* ({@link resolvePostgresNodeIssueControlPolicySubject}) the planner uses to\n* gate DDL calls. `undefined` when the issue resolves to no contract subject.\n*\n* A role issue resolves through that same resolver to `external`\n* unconditionally (see its role branch), regardless of the contract's own\n* default policy: a role is referenced by the contract but not owned, and\n* `external`'s existing semantics — a missing declared subject still fails,\n* every extra is suppressed — are exactly the wanted asymmetric grading for\n* a cluster object the framework does not own.\n*/\nfunction resolveControlPolicy(issue, contract) {\n\treturn resolvePostgresNodeIssueControlPolicySubject(blindCast(issue), contract)?.explicitNodeControlPolicy;\n}\n/**\n* The Postgres full-tree node diff for the family verify verdict: derive\n* the expected tree (resolved leaf values, FK schemas\n* resolved, table-less namespaces pruned), run the generic\n* differ over the trees as derived, and scope out `not-expected` findings under namespaces the\n* contract does not own. Ownership scoping bypasses cluster-scoped subjects\n* (roles today), mirroring the legacy decomposition: relational extras check\n* the PRUNED owned set (the legacy\n* per-namespace walk never visited a table-less namespace, so its live\n* relational contents are invisible), while `structural` extras (RLS\n* policies) check the FULL owned set (the legacy policy diff governed\n* every contract schema regardless of tables — RLS governance does not\n* shrink because a namespace declares no tables). The codec `verifyType`\n* hooks run once per contract namespace with tables against that\n* namespace's paired actual node (the hooks read namespace-scoped state\n* such as `nativeEnums`).\n*/\nfunction diffPostgresSchema(input) {\n\tconst postgresContract = blindCast(input.contract);\n\tPostgresDatabaseSchemaNode.assert(input.schema);\n\tconst actual = input.schema;\n\tconst types = sqlTypeLookupsOf(input.frameworkComponents);\n\tconst fullExpected = contractToPostgresDatabaseSchemaNode(postgresContract, {\n\t\tannotationNamespace: \"pg\",\n\t\tdataTypeLookup: types.dataTypeLookup,\n\t\tcodecLookup: types.codecLookup,\n\t\tresolveDefault: postgresResolveDefault\n\t});\n\tconst expected = pruneTableLessNamespaces(fullExpected);\n\tconst relationalOwned = ownedSchemaNames(expected);\n\tconst structuralOwned = ownedSchemaNames(fullExpected);\n\treturn {\n\t\tissues: diffSchemas(expected, actual).filter((issue) => {\n\t\t\tif (issueOutcome(issue) !== \"not-expected\") return true;\n\t\t\tif (isClusterScopedIssue(issue)) return true;\n\t\t\tconst granularity = classifyDiffSubjectGranularity(issue, postgresDiffSubjectGranularity);\n\t\t\tconst namespaceSegment = issue.path[1];\n\t\t\tif (namespaceSegment === void 0) return true;\n\t\t\treturn (granularity === \"structural\" ? structuralOwned : relationalOwned).has(namespaceSegment);\n\t\t}),\n\t\tresolveControlPolicy: (issue) => resolveControlPolicy(issue, postgresContract),\n\t\tnamespacePairs: Object.values(expected.namespaces).map((ns) => ({ actual: actual.namespaces[ns.schemaName] }))\n\t};\n}\n/**\n* Adds an empty namespace node to the actual tree for every expected namespace\n* absent from it. The relational plan diff pairs on namespace: a contract\n* namespace whose live schema does not exist yet must surface each of its\n* tables as `not-found` (→ `CREATE TABLE`), NOT as a single namespace\n* `not-found` that subtree-coalescing would collapse (leaving `CREATE SCHEMA`\n* with no tables). Padding makes the namespaces pair, so only table/column/\n* policy drift surfaces; `CREATE SCHEMA` comes separately from the synthesized\n* namespace-presence stitch (`verifyPostgresNamespacePresence`), never from the\n* tree diff — matching the retired per-namespace-paired relational walk, which\n* paired a missing schema against an empty namespace node.\n*/\nfunction padActualNamespaces(expected, actual) {\n\tconst namespaces = { ...actual.namespaces };\n\tlet padded = false;\n\tfor (const schemaName of Object.keys(expected.namespaces)) if (namespaces[schemaName] === void 0) {\n\t\tnamespaces[schemaName] = new PostgresNamespaceSchemaNode({\n\t\t\tschemaName,\n\t\t\ttables: {}\n\t\t});\n\t\tpadded = true;\n\t}\n\tif (!padded) return actual;\n\treturn new PostgresDatabaseSchemaNode({\n\t\tnamespaces,\n\t\troles: [...actual.roles],\n\t\texistingSchemas: [...actual.existingSchemas],\n\t\tpgVersion: actual.pgVersion\n\t});\n}\n/**\n* The Postgres planner's diff input: the SAME tree-building\n* `diffPostgresSchema` uses (FK schemas resolved,\n* table-less namespaces pruned, cluster-scope-aware ownership filter) plus\n* actual namespace padding (so a missing\n* schema's tables surface as `not-found` instead of a swallowed namespace\n* `not-found`). One differ drives both verify and plan; this is the\n* plan-side derivation. The single issue list covers tables / columns /\n* constraints / indexes / defaults AND policies — the caller splits it\n* (relational → `mapNodeIssueToCall`; policy → RLS ops) and stitches in\n* `CREATE SCHEMA` separately.\n*/\nfunction buildPostgresPlanDiff(input) {\n\tconst postgresContract = blindCast(input.contract);\n\tPostgresDatabaseSchemaNode.assert(input.actualSchema);\n\tconst actual = input.actualSchema;\n\tconst types = sqlTypeLookupsOf(input.frameworkComponents);\n\tconst fullExpected = contractToPostgresDatabaseSchemaNode(postgresContract, {\n\t\tannotationNamespace: \"pg\",\n\t\tdataTypeLookup: types.dataTypeLookup,\n\t\tcodecLookup: types.codecLookup,\n\t\tresolveDefault: postgresResolveDefault\n\t});\n\tconst expected = pruneTableLessNamespaces(fullExpected);\n\tconst paddedActual = padActualNamespaces(expected, actual);\n\tconst relationalOwned = ownedSchemaNames(expected);\n\tconst structuralOwned = ownedSchemaNames(fullExpected);\n\treturn {\n\t\texpected,\n\t\tactual: paddedActual,\n\t\tissues: blindCast(diffSchemas(expected, paddedActual)).filter((issue) => {\n\t\t\tif (issueOutcome(issue) !== \"not-expected\") return true;\n\t\t\tif (isClusterScopedIssue(issue)) return true;\n\t\t\tconst granularity = classifyDiffSubjectGranularity(issue, postgresDiffSubjectGranularity);\n\t\t\tconst namespaceSegment = issue.path[1];\n\t\t\tif (namespaceSegment === void 0) return true;\n\t\t\treturn (granularity === \"structural\" ? structuralOwned : relationalOwned).has(namespaceSegment);\n\t\t})\n\t};\n}\n//#endregion\nexport { diffPostgresSchema as n, contractToPostgresDatabaseSchemaNode as r, buildPostgresPlanDiff as t };\n\n//# sourceMappingURL=diff-database-schema-CmWmomi3.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,SAAS,eAAe;CACvB,OAAO;EACN,UAAU,uBAAuB;EACjC,IAAI;CACL;AACD;AACA,SAAS,eAAe,aAAa,WAAW;CAC/C,OAAO;EACN,aAAa;EACb;GACC,UAAU,uBAAuB;GACjC,IAAI;EACL;EACA;GAC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e,oBAAoB,UAAU,MAAM;CACzD,MAAM,kBAAkB,iBAAiB,QAAQ;CACjD,MAAM,kBAAkB,iBAAiB,YAAY;CACrD,OAAO;EACN;EACA,QAAQ;EACR,QAAQ,UAAU,YAAY,UAAU,YAAY,CAAC,CAAC,CAAC,QAAQ,UAAU;GACxE,IAAI,aAAa,KAAK,MAAM,gBAAgB,OAAO;GACnD,IAAI,qBAAqB,KAAK,GAAG,OAAO;GACxC,MAAM,cAAc,+BAA+B,OAAO,8BAA8B;GACxF,MAAM,mBAAmB,MAAM,KAAK;GACpC,IAAI,qBAAqB,KAAK,GAAG,OAAO;GACxC,QAAQ,gBAAgB,eAAe,kBAAkB,gBAAA,CAAiB,IAAI,gBAAgB;EAC/F,CAAC;CACF;AACD"}
|
|
1
|
+
{"version":3,"file":"diff-database-schema-BHkYz_Ll-DGSW_oEV.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/diff-database-schema-BHkYz_Ll.mjs"],"sourcesContent":["import { c as postgresError } from \"./errors-BrhQYgdL.mjs\";\nimport { i as fullTextIndexDefinitionOf, t as FULL_TEXT_INDEX_TYPE } from \"./full-text-index-definition-BPxQQBuC.mjs\";\nimport { r as isPostgresSchema } from \"./postgres-schema-C6w1rzOF.mjs\";\nimport { t as postgresAccessMethodOf } from \"./index-types-BihjrAAq.mjs\";\nimport { t as postgresResolveDefault } from \"./default-normalizer-BqK6XxdC.mjs\";\nimport { a as postgresDiffSubjectGranularity, n as PostgresNativeEnumSchemaNode, r as PostgresSchemaNodeKind, t as PostgresTableSchemaNode } from \"./postgres-table-schema-node-BBkitBQh.mjs\";\nimport { i as PostgresDatabaseSchemaNode, n as PostgresPolicySchemaNode, r as PostgresNamespaceSchemaNode, t as PostgresRoleSchemaNode } from \"./postgres-role-schema-node-B8Z5i5D-.mjs\";\nimport { n as renderFullTextIndexDocument } from \"./full-text-search-document-Doy5TF7c.mjs\";\nimport { r as resolveDdlSchemaForNamespaceStorage } from \"./resolve-ddl-schema-D3VNPMSm.mjs\";\nimport { i as resolvePostgresNodeIssueControlPolicySubject } from \"./control-policy-CifihRKs.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { diffSchemas, issueOutcome } from \"@internal/framework-components/control\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { contractNamespaceToSchemaIR, sqlTypeLookupsOf } from \"@internal/family-sql/control\";\nimport { namingOf } from \"@internal/sql-schema-ir/naming\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { classifyDiffSubjectGranularity } from \"@internal/family-sql/diff\";\nimport { PrimaryKey, RelationalSchemaNodeKind, SqlForeignKeyIR, SqlIndexIR, SqlUniqueIR } from \"@internal/sql-schema-ir/types\";\n//#region src/core/migrations/contract-to-postgres-database-schema-node.ts\n/** The database root's fixed sentinel id (`PostgresDatabaseSchemaNode#id`). */\nfunction databaseStep() {\n\treturn {\n\t\tnodeKind: PostgresSchemaNodeKind.database,\n\t\tid: \"database\"\n\t};\n}\nfunction tableDependsOn(namespaceId, tableName) {\n\treturn [\n\t\tdatabaseStep(),\n\t\t{\n\t\t\tnodeKind: PostgresSchemaNodeKind.namespace,\n\t\t\tid: namespaceId\n\t\t},\n\t\t{\n\t\t\tnodeKind: PostgresSchemaNodeKind.table,\n\t\t\tid: tableName\n\t\t}\n\t];\n}\nfunction roleDependsOn(role) {\n\treturn [databaseStep(), {\n\t\tnodeKind: PostgresSchemaNodeKind.role,\n\t\tid: role\n\t}];\n}\n/**\n* The chains from a table-child object (foreign key, index, unique, primary\n* key) to each of the own columns it is built on, in the Postgres tree.\n* Dropping a covered column auto-drops the object, so the object's drop must\n* precede the column's; the graph derives that direction from these edges.\n*/\nfunction columnDependsOn(namespaceId, tableName, columns) {\n\treturn columns.map((column) => [...tableDependsOn(namespaceId, tableName), {\n\t\tnodeKind: RelationalSchemaNodeKind.column,\n\t\tid: `column:${column}`\n\t}]);\n}\nfunction toPolicyNode(policy, namespaceId) {\n\treturn new PostgresPolicySchemaNode({\n\t\tnaming: namingOf(policy.name, policy.prefix),\n\t\ttableName: policy.tableName,\n\t\tnamespaceId,\n\t\toperation: policy.operation,\n\t\troles: [...policy.roles],\n\t\tusing: policy.using,\n\t\twithCheck: policy.withCheck,\n\t\tpermissive: policy.permissive,\n\t\tdependsOn: [tableDependsOn(namespaceId, policy.tableName), ...policy.roles.map(roleDependsOn)]\n\t});\n}\n/**\n* Projects a Postgres contract into the expected schema-diff tree: a\n* `PostgresDatabaseSchemaNode` root holding one `PostgresNamespaceSchemaNode`\n* per Postgres namespace, each holding its `PostgresTableSchemaNode`s with\n* their `PostgresPolicySchemaNode`s, plus the database roles on the root.\n*\n* Not a duplicate of the family's `contractToSchemaIR`: that builds a flat,\n* single `{ tables }` map (and throws on cross-namespace name collisions, with\n* no RLS/role concept) for SQLite's single-schema world. This is the\n* Postgres-specific *tree* shape — multi-schema, RLS-policy-aware, role-aware.\n* It reuses the family's per-namespace table conversion (`contractNamespaceToSchemaIR`)\n* for column/FK/index building and only adds the Postgres tree/policy/role shape.\n*\n* Tables are grouped by their owning namespace (resolved DDL schema name) so\n* the tree mirrors Postgres's object hierarchy. The DDL schema name is\n* resolved once per namespace.\n*\n* A policy that references a table absent from its namespace is a malformed\n* contract — the loop throws rather than fabricating a stub table.\n*/\nfunction contractToPostgresDatabaseSchemaNode(contract, options) {\n\tif (contract === null) return new PostgresDatabaseSchemaNode({\n\t\tnamespaces: {},\n\t\troles: [],\n\t\texistingSchemas: [],\n\t\tpgVersion: \"\"\n\t});\n\tconst namespaces = {};\n\tconst roles = [];\n\tconst ownedSchemas = [];\n\tfor (const ns of Object.values(contract.storage.namespaces)) {\n\t\tif (!isPostgresSchema(ns)) continue;\n\t\tfor (const role of Object.values(ns.role)) roles.push(new PostgresRoleSchemaNode({\n\t\t\tname: role.name,\n\t\t\tnamespaceId: role.namespaceId\n\t\t}));\n\t\tif (ns.id === UNBOUND_NAMESPACE_ID) {\n\t\t\tif (!Object.entries(ns.entries).some(([entriesKey, slot]) => entriesKey !== \"role\" && Object.keys(slot).length > 0)) continue;\n\t\t}\n\t\tconst ddlSchema = resolveDdlSchemaForNamespaceStorage(contract.storage, ns.id);\n\t\townedSchemas.push(ddlSchema);\n\t\tconst sqlTables = contractNamespaceToSchemaIR(contract.storage, ns.id, options).tables;\n\t\tconst policiesByTable = /* @__PURE__ */ new Map();\n\t\tfor (const policy of Object.values(ns.policy)) {\n\t\t\tconst list = policiesByTable.get(policy.tableName) ?? [];\n\t\t\tlist.push(toPolicyNode(policy, ddlSchema));\n\t\t\tpoliciesByTable.set(policy.tableName, list);\n\t\t}\n\t\tconst tables = {};\n\t\tfor (const tableName of Object.keys(ns.table)) {\n\t\t\tconst sqlTable = sqlTables[tableName];\n\t\t\tif (sqlTable === void 0) continue;\n\t\t\tconst foreignKeys = sqlTable.foreignKeys.map((fk) => {\n\t\t\t\tconst resolvedReferencedNamespace = resolveDdlSchemaForNamespaceStorage(contract.storage, fk.referencedSchema ?? UNBOUND_NAMESPACE_ID);\n\t\t\t\treturn new SqlForeignKeyIR({\n\t\t\t\t\tcolumns: fk.columns,\n\t\t\t\t\treferencedTable: fk.referencedTable,\n\t\t\t\t\treferencedColumns: fk.referencedColumns,\n\t\t\t\t\treferencedSchema: fk.referencedSchema ?? UNBOUND_NAMESPACE_ID,\n\t\t\t\t\t...ifDefined(\"name\", fk.name),\n\t\t\t\t\t...ifDefined(\"onDelete\", fk.onDelete),\n\t\t\t\t\t...ifDefined(\"onUpdate\", fk.onUpdate),\n\t\t\t\t\t...ifDefined(\"annotations\", fk.annotations),\n\t\t\t\t\tresolvedReferencedNamespace,\n\t\t\t\t\tdependsOn: [tableDependsOn(resolvedReferencedNamespace, fk.referencedTable), ...columnDependsOn(ddlSchema, tableName, fk.columns)]\n\t\t\t\t});\n\t\t\t});\n\t\t\tconst uniques = sqlTable.uniques.map((u) => new SqlUniqueIR({\n\t\t\t\tcolumns: u.columns,\n\t\t\t\t...ifDefined(\"name\", u.name),\n\t\t\t\t...ifDefined(\"annotations\", u.annotations),\n\t\t\t\tdependsOn: columnDependsOn(ddlSchema, tableName, u.columns)\n\t\t\t}));\n\t\t\tconst indexes = sqlTable.indexes.map((i) => {\n\t\t\t\tconst fullText = fullTextIndexDefinitionOf(i);\n\t\t\t\tif (fullText !== void 0) return new SqlIndexIR({\n\t\t\t\t\tnaming: namingOf(i.name, i.prefix),\n\t\t\t\t\twhere: i.where,\n\t\t\t\t\tunique: i.unique,\n\t\t\t\t\tpartial: i.partial,\n\t\t\t\t\ttype: postgresAccessMethodOf(FULL_TEXT_INDEX_TYPE),\n\t\t\t\t\toptions: void 0,\n\t\t\t\t\tannotations: i.annotations,\n\t\t\t\t\texpression: renderFullTextIndexDocument(fullText),\n\t\t\t\t\tdependsOn: columnDependsOn(ddlSchema, tableName, fullText.weightGroups.flat())\n\t\t\t\t});\n\t\t\t\tconst base = {\n\t\t\t\t\tnaming: namingOf(i.name, i.prefix),\n\t\t\t\t\twhere: i.where,\n\t\t\t\t\tunique: i.unique,\n\t\t\t\t\tpartial: i.partial,\n\t\t\t\t\ttype: i.type,\n\t\t\t\t\toptions: i.options,\n\t\t\t\t\tannotations: i.annotations,\n\t\t\t\t\tdependsOn: columnDependsOn(ddlSchema, tableName, i.columns ?? Object.keys(sqlTable.columns))\n\t\t\t\t};\n\t\t\t\treturn new SqlIndexIR(i.expression !== void 0 ? {\n\t\t\t\t\t...base,\n\t\t\t\t\texpression: i.expression\n\t\t\t\t} : {\n\t\t\t\t\t...base,\n\t\t\t\t\tcolumns: i.columns ?? []\n\t\t\t\t});\n\t\t\t});\n\t\t\tconst primaryKey = sqlTable.primaryKey !== void 0 ? new PrimaryKey({\n\t\t\t\tcolumns: sqlTable.primaryKey.columns,\n\t\t\t\t...ifDefined(\"name\", sqlTable.primaryKey.name),\n\t\t\t\tdependsOn: columnDependsOn(ddlSchema, tableName, sqlTable.primaryKey.columns)\n\t\t\t}) : void 0;\n\t\t\ttables[tableName] = new PostgresTableSchemaNode({\n\t\t\t\tname: sqlTable.name,\n\t\t\t\tcolumns: sqlTable.columns,\n\t\t\t\tforeignKeys,\n\t\t\t\tuniques,\n\t\t\t\tindexes,\n\t\t\t\t...ifDefined(\"primaryKey\", primaryKey),\n\t\t\t\t...ifDefined(\"annotations\", sqlTable.annotations),\n\t\t\t\t...ifDefined(\"checks\", sqlTable.checks),\n\t\t\t\tpolicies: policiesByTable.get(tableName) ?? [],\n\t\t\t\trlsEnabled: Object.hasOwn(ns.rls, tableName)\n\t\t\t});\n\t\t}\n\t\tfor (const [tableName, tablePolicies] of policiesByTable) {\n\t\t\tif (!(tableName in tables)) {\n\t\t\t\tconst policyName = tablePolicies[0]?.name ?? \"(unknown)\";\n\t\t\t\tthrow postgresError(\"CONTRACT.POLICY_INVALID\", `contract-to-postgres-database-schema-node: policy \"${policyName}\" references table \"${tableName}\" not present in namespace \"${ddlSchema}\"`, { meta: {\n\t\t\t\t\tpolicyName,\n\t\t\t\t\ttableName,\n\t\t\t\t\tnamespaceId: ddlSchema,\n\t\t\t\t\treason: \"table-missing\"\n\t\t\t\t} });\n\t\t\t}\n\t\t\tif (!Object.hasOwn(ns.rls, tableName)) {\n\t\t\t\tconst policyLabel = tablePolicies[0]?.prefix ?? tablePolicies[0]?.name ?? \"(unknown)\";\n\t\t\t\tthrow postgresError(\"CONTRACT.POLICY_INVALID\", `contract-to-postgres-database-schema-node: policy \"${policyLabel}\" targets table \"${tableName}\" in namespace \"${ddlSchema}\", which is not RLS-controlled. Mark the model with @@rls (entries.rls[\"${tableName}\"]) or remove the policy.`, { meta: {\n\t\t\t\t\tpolicyName: policyLabel,\n\t\t\t\t\ttableName,\n\t\t\t\t\tnamespaceId: ddlSchema,\n\t\t\t\t\treason: \"table-not-rls-controlled\"\n\t\t\t\t} });\n\t\t\t}\n\t\t}\n\t\tnamespaces[ddlSchema] = new PostgresNamespaceSchemaNode({\n\t\t\tschemaName: ddlSchema,\n\t\t\ttables,\n\t\t\tnativeEnums: Object.values(ns.entries.native_enum ?? {}).map((entity) => new PostgresNativeEnumSchemaNode({\n\t\t\t\ttypeName: entity.typeName,\n\t\t\t\tnamespaceId: ddlSchema,\n\t\t\t\tmembers: entity.members,\n\t\t\t\t...ifDefined(\"control\", entity.control)\n\t\t\t}))\n\t\t});\n\t}\n\treturn new PostgresDatabaseSchemaNode({\n\t\tnamespaces,\n\t\troles,\n\t\texistingSchemas: ownedSchemas,\n\t\tpgVersion: \"\"\n\t});\n}\n//#endregion\n//#region src/core/migrations/diff-database-schema.ts\n/**\n* Whether a diff issue's subject node is cluster-scoped — it carries its own\n* `namespaceId` field (only role and policy diff nodes do) and that\n* coordinate is the unbound sentinel, meaning the node is not owned by any\n* schema/namespace. A role node is always cluster-scoped (roles are\n* cluster-level objects); a policy node's `namespaceId` is always its\n* table's resolved DDL schema, never the sentinel. Namespace-ownership\n* scoping (which compares `issue.path[1]` against the set of DDL schemas\n* the contract owns) makes no sense for a cluster-scoped subject — its path\n* segment at that index is the object's own name, not a schema name — so\n* such an issue bypasses that scoping entirely.\n*/\nfunction isClusterScopedIssue(issue) {\n\tconst node = issue.expected ?? issue.actual;\n\treturn node !== void 0 && nodeNamespaceId(node) === UNBOUND_NAMESPACE_ID;\n}\nfunction nodeNamespaceId(node) {\n\tif (!Object.hasOwn(node, \"namespaceId\")) return void 0;\n\treturn blindCast(node).namespaceId;\n}\nfunction ownedSchemaNames(expected) {\n\tconst policyNamespaces = Object.values(expected.namespaces).flatMap((ns) => Object.values(ns.tables).flatMap((t) => t.policies.map((p) => p.namespaceId)));\n\treturn /* @__PURE__ */ new Set([...policyNamespaces, ...expected.existingSchemas]);\n}\n/**\n* Drops contract namespaces that declare no tables from the verdict-diff\n* expected tree and the relational owned-schema set. The legacy relational\n* walk skipped a table-less namespace (e.g. an enums-only schema) before\n* pairing, so neither its DDL schema's absence nor that schema's live\n* relational contents ever reached the verdict — the pruned tree\n* reproduces that. The prune loses no expected policies: policies attach\n* to tables, so a table-less namespace carries none (the projection\n* throws on a policy referencing an absent table). Live policies in a\n* pruned schema remain governed via the full owned set (see\n* {@link diffPostgresSchema}).\n*/\nfunction pruneTableLessNamespaces(expected) {\n\tconst namespaces = Object.fromEntries(Object.entries(expected.namespaces).filter(([, ns]) => Object.keys(ns.tables).length > 0));\n\treturn new PostgresDatabaseSchemaNode({\n\t\tnamespaces,\n\t\troles: [...expected.roles],\n\t\texistingSchemas: expected.existingSchemas.filter((s) => namespaces[s] !== void 0),\n\t\tpgVersion: expected.pgVersion\n\t});\n}\n/**\n* Resolves a verdict-diff issue's subject's declared control policy directly\n* from the contract, by delegating to the same node-typed resolver\n* ({@link resolvePostgresNodeIssueControlPolicySubject}) the planner uses to\n* gate DDL calls. `undefined` when the issue resolves to no contract subject.\n*\n* A role issue resolves through that same resolver to `external`\n* unconditionally (see its role branch), regardless of the contract's own\n* default policy: a role is referenced by the contract but not owned, and\n* `external`'s existing semantics — a missing declared subject still fails,\n* every extra is suppressed — are exactly the wanted asymmetric grading for\n* a cluster object the framework does not own.\n*/\nfunction resolveControlPolicy(issue, contract) {\n\treturn resolvePostgresNodeIssueControlPolicySubject(blindCast(issue), contract)?.explicitNodeControlPolicy;\n}\n/**\n* The Postgres full-tree node diff for the family verify verdict: derive\n* the expected tree (resolved leaf values, FK schemas\n* resolved, table-less namespaces pruned), run the generic\n* differ over the trees as derived, and scope out `not-expected` findings under namespaces the\n* contract does not own. Ownership scoping bypasses cluster-scoped subjects\n* (roles today), mirroring the legacy decomposition: relational extras check\n* the PRUNED owned set (the legacy\n* per-namespace walk never visited a table-less namespace, so its live\n* relational contents are invisible), while `structural` extras (RLS\n* policies) check the FULL owned set (the legacy policy diff governed\n* every contract schema regardless of tables — RLS governance does not\n* shrink because a namespace declares no tables). The codec `verifyType`\n* hooks run once per contract namespace with tables against that\n* namespace's paired actual node (the hooks read namespace-scoped state\n* such as `nativeEnums`).\n*/\nfunction diffPostgresSchema(input) {\n\tconst postgresContract = blindCast(input.contract);\n\tPostgresDatabaseSchemaNode.assert(input.schema);\n\tconst actual = input.schema;\n\tconst types = sqlTypeLookupsOf(input.frameworkComponents);\n\tconst fullExpected = contractToPostgresDatabaseSchemaNode(postgresContract, {\n\t\tannotationNamespace: \"pg\",\n\t\tdataTypeLookup: types.dataTypeLookup,\n\t\tcodecLookup: types.codecLookup,\n\t\tresolveDefault: postgresResolveDefault\n\t});\n\tconst expected = pruneTableLessNamespaces(fullExpected);\n\tconst relationalOwned = ownedSchemaNames(expected);\n\tconst structuralOwned = ownedSchemaNames(fullExpected);\n\treturn {\n\t\tissues: diffSchemas(expected, actual).filter((issue) => {\n\t\t\tif (issueOutcome(issue) !== \"not-expected\") return true;\n\t\t\tif (isClusterScopedIssue(issue)) return true;\n\t\t\tconst granularity = classifyDiffSubjectGranularity(issue, postgresDiffSubjectGranularity);\n\t\t\tconst namespaceSegment = issue.path[1];\n\t\t\tif (namespaceSegment === void 0) return true;\n\t\t\treturn (granularity === \"structural\" ? structuralOwned : relationalOwned).has(namespaceSegment);\n\t\t}),\n\t\tresolveControlPolicy: (issue) => resolveControlPolicy(issue, postgresContract),\n\t\tnamespacePairs: Object.values(expected.namespaces).map((ns) => ({ actual: actual.namespaces[ns.schemaName] }))\n\t};\n}\n/**\n* Adds an empty namespace node to the actual tree for every expected namespace\n* absent from it. The relational plan diff pairs on namespace: a contract\n* namespace whose live schema does not exist yet must surface each of its\n* tables as `not-found` (→ `CREATE TABLE`), NOT as a single namespace\n* `not-found` that subtree-coalescing would collapse (leaving `CREATE SCHEMA`\n* with no tables). Padding makes the namespaces pair, so only table/column/\n* policy drift surfaces; `CREATE SCHEMA` comes separately from the synthesized\n* namespace-presence stitch (`verifyPostgresNamespacePresence`), never from the\n* tree diff — matching the retired per-namespace-paired relational walk, which\n* paired a missing schema against an empty namespace node.\n*/\nfunction padActualNamespaces(expected, actual) {\n\tconst namespaces = { ...actual.namespaces };\n\tlet padded = false;\n\tfor (const schemaName of Object.keys(expected.namespaces)) if (namespaces[schemaName] === void 0) {\n\t\tnamespaces[schemaName] = new PostgresNamespaceSchemaNode({\n\t\t\tschemaName,\n\t\t\ttables: {}\n\t\t});\n\t\tpadded = true;\n\t}\n\tif (!padded) return actual;\n\treturn new PostgresDatabaseSchemaNode({\n\t\tnamespaces,\n\t\troles: [...actual.roles],\n\t\texistingSchemas: [...actual.existingSchemas],\n\t\tpgVersion: actual.pgVersion\n\t});\n}\n/**\n* The Postgres planner's diff input: the SAME tree-building\n* `diffPostgresSchema` uses (FK schemas resolved,\n* table-less namespaces pruned, cluster-scope-aware ownership filter) plus\n* actual namespace padding (so a missing\n* schema's tables surface as `not-found` instead of a swallowed namespace\n* `not-found`). One differ drives both verify and plan; this is the\n* plan-side derivation. The single issue list covers tables / columns /\n* constraints / indexes / defaults AND policies — the caller splits it\n* (relational → `mapNodeIssueToCall`; policy → RLS ops) and stitches in\n* `CREATE SCHEMA` separately.\n*/\nfunction buildPostgresPlanDiff(input) {\n\tconst postgresContract = blindCast(input.contract);\n\tPostgresDatabaseSchemaNode.assert(input.actualSchema);\n\tconst actual = input.actualSchema;\n\tconst types = sqlTypeLookupsOf(input.frameworkComponents);\n\tconst fullExpected = contractToPostgresDatabaseSchemaNode(postgresContract, {\n\t\tannotationNamespace: \"pg\",\n\t\tdataTypeLookup: types.dataTypeLookup,\n\t\tcodecLookup: types.codecLookup,\n\t\tresolveDefault: postgresResolveDefault\n\t});\n\tconst expected = pruneTableLessNamespaces(fullExpected);\n\tconst paddedActual = padActualNamespaces(expected, actual);\n\tconst relationalOwned = ownedSchemaNames(expected);\n\tconst structuralOwned = ownedSchemaNames(fullExpected);\n\treturn {\n\t\texpected,\n\t\tactual: paddedActual,\n\t\tissues: blindCast(diffSchemas(expected, paddedActual)).filter((issue) => {\n\t\t\tif (issueOutcome(issue) !== \"not-expected\") return true;\n\t\t\tif (isClusterScopedIssue(issue)) return true;\n\t\t\tconst granularity = classifyDiffSubjectGranularity(issue, postgresDiffSubjectGranularity);\n\t\t\tconst namespaceSegment = issue.path[1];\n\t\t\tif (namespaceSegment === void 0) return true;\n\t\t\treturn (granularity === \"structural\" ? structuralOwned : relationalOwned).has(namespaceSegment);\n\t\t})\n\t};\n}\n//#endregion\nexport { diffPostgresSchema as n, contractToPostgresDatabaseSchemaNode as r, buildPostgresPlanDiff as t };\n\n//# sourceMappingURL=diff-database-schema-BHkYz_Ll.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,SAAS,eAAe;CACvB,OAAO;EACN,UAAU,uBAAuB;EACjC,IAAI;CACL;AACD;AACA,SAAS,eAAe,aAAa,WAAW;CAC/C,OAAO;EACN,aAAa;EACb;GACC,UAAU,uBAAuB;GACjC,IAAI;EACL;EACA;GACC,UAAU,uBAAuB;GACjC,IAAI;EACL;CACD;AACD;AACA,SAAS,cAAc,MAAM;CAC5B,OAAO,CAAC,aAAa,GAAG;EACvB,UAAU,uBAAuB;EACjC,IAAI;CACL,CAAC;AACF;;;;;;;AAOA,SAAS,gBAAgB,aAAa,WAAW,SAAS;CACzD,OAAO,QAAQ,KAAK,WAAW,CAAC,GAAG,eAAe,aAAa,SAAS,GAAG;EAC1E,UAAU,yBAAyB;EACnC,IAAI,UAAU;CACf,CAAC,CAAC;AACH;AACA,SAAS,aAAa,QAAQ,aAAa;CAC1C,OAAO,IAAI,yBAAyB;EACnC,QAAQ,SAAS,OAAO,MAAM,OAAO,MAAM;EAC3C,WAAW,OAAO;EAClB;EACA,WAAW,OAAO;EAClB,OAAO,CAAC,GAAG,OAAO,KAAK;EACvB,OAAO,OAAO;EACd,WAAW,OAAO;EAClB,YAAY,OAAO;EACnB,WAAW,CAAC,eAAe,aAAa,OAAO,SAAS,GAAG,GAAG,OAAO,MAAM,IAAI,aAAa,CAAC;CAC9F,CAAC;AACF;;;;;;;;;;;;;;;;;;;;;AAqBA,SAAS,qCAAqC,UAAU,SAAS;CAChE,IAAI,aAAa,MAAM,OAAO,IAAI,2BAA2B;EAC5D,YAAY,CAAC;EACb,OAAO,CAAC;EACR,iBAAiB,CAAC;EAClB,WAA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iBAAiB,CAAC,GAAG,OAAO,eAAe;EAC3C,WAAW,OAAO;CACnB,CAAC;AACF;;;;;;;;;;;;;AAaA,SAAS,sBAAsB,OAAO;CACrC,MAAM,mBAAmB,UAAU,MAAM,QAAQ;CACjD,2BAA2B,OAAO,MAAM,YAAY;CACpD,MAAM,SAAS,MAAM;CACrB,MAAM,QAAQ,iBAAiB,MAAM,mBAAmB;CACxD,MAAM,eAAe,qCAAqC,kBAAkB;EAC3E,qBAAqB;EACrB,gBAAgB,MAAM;EACtB,aAAa,MAAM;EACnB,gBAAgB;CACjB,CAAC;CACD,MAAM,WAAW,yBAAyB,YAAY;CACtD,MAAM,eAAe,oBAAoB,UAAU,MAAM;CACzD,MAAM,kBAAkB,iBAAiB,QAAQ;CACjD,MAAM,kBAAkB,iBAAiB,YAAY;CACrD,OAAO;EACN;EACA,QAAQ;EACR,QAAQ,UAAU,YAAY,UAAU,YAAY,CAAC,CAAC,CAAC,QAAQ,UAAU;GACxE,IAAI,aAAa,KAAK,MAAM,gBAAgB,OAAO;GACnD,IAAI,qBAAqB,KAAK,GAAG,OAAO;GACxC,MAAM,cAAc,+BAA+B,OAAO,8BAA8B;GACxF,MAAM,mBAAmB,MAAM,KAAK;GACpC,IAAI,qBAAqB,KAAK,GAAG,OAAO;GACxC,QAAQ,gBAAgB,eAAe,kBAAkB,gBAAA,CAAiB,IAAI,gBAAgB;EAC/F,CAAC;CACF;AACD"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as FULL_TEXT_INDEX_TYPE } from "./full-text-index-definition-D5iBWLss-FifKlctQ.mjs";
|
|
2
|
-
import { n as Resolve, t as ExtractedCodecTypes } from "./codec-type-map-
|
|
3
|
-
import { d as TsqueryArgument } from "./operation-types-
|
|
2
|
+
import { n as Resolve, t as ExtractedCodecTypes } from "./codec-type-map-Fj5xCgwT-DwIK_DR3.mjs";
|
|
3
|
+
import { d as TsqueryArgument } from "./operation-types--Wa_cv45-jn5HQ8yt.mjs";
|
|
4
4
|
import { UniqueIndexNamesOfType } from "@prisma/orm-family-sql/relational-core/index-reference";
|
|
5
5
|
import { CollectionMethodContributionType, CollectionMethodModelType } from "@prisma/orm-family-sql/relational-core/collection-methods";
|
|
6
|
-
//#region ../../../3-targets/3-targets/postgres/dist/full-text-collection-method-
|
|
6
|
+
//#region ../../../3-targets/3-targets/postgres/dist/full-text-collection-method-BFd2u2cs.d.mts
|
|
7
7
|
//#region src/core/full-text-collection-method.d.ts
|
|
8
8
|
/** A `tsquery` expression from a parser or the `tsquery` tag, or a `tsquery` value read back from a query. */
|
|
9
9
|
type PostgresTsqueryArgument = TsqueryArgument<Resolve<ExtractedCodecTypes>>;
|
|
@@ -24,4 +24,4 @@ declare module '@prisma/orm-family-sql/relational-core/collection-methods' {
|
|
|
24
24
|
}
|
|
25
25
|
//#endregion
|
|
26
26
|
export { PostgresTsqueryArgument as n, PostgresFullTextMethods as t };
|
|
27
|
-
//# sourceMappingURL=full-text-collection-method-
|
|
27
|
+
//# sourceMappingURL=full-text-collection-method-BFd2u2cs-DcN_Vf7f.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"full-text-collection-method-BFd2u2cs-DcN_Vf7f.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/full-text-collection-method-BFd2u2cs.d.mts"],"mappings":";;;;;;;;KAOK,0BAA0B,gBAAgB,QAAQ;UAC7C;WACC,sBAAsB,OAAO;WAC7B;WACA;;KAEN,oBAAoB,cAAc,6BAA6B,iDAAiD,QAAQ,uBAAuB,0CAA0C,wBAAwB,6BAA6B;;UAEzO,gCAAgC;WAC/B,SAAS;;;YAGR;aACC,qBAAqB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as TsqueryExpression, m as TsqueryParserOptions } from "./operation-types-
|
|
2
|
-
import "./full-text-collection-method-
|
|
1
|
+
import { f as TsqueryExpression, m as TsqueryParserOptions } from "./operation-types--Wa_cv45-jn5HQ8yt.mjs";
|
|
2
|
+
import "./full-text-collection-method-BFd2u2cs-DcN_Vf7f.mjs";
|
|
3
3
|
//#region ../../../3-targets/3-targets/postgres/dist/full-text.d.mts
|
|
4
4
|
//#region src/core/tsquery-tag.d.ts
|
|
5
5
|
type TsqueryTag = (strings: TemplateStringsArray, ...values: string[]) => TsqueryExpression;
|
|
@@ -23,4 +23,4 @@ declare function tsquery(options: TsqueryParserOptions): TsqueryTag;
|
|
|
23
23
|
declare function tsquery(strings: TemplateStringsArray, ...values: string[]): TsqueryExpression;
|
|
24
24
|
//#endregion
|
|
25
25
|
export { tsquery as n, TsqueryTag as t };
|
|
26
|
-
//# sourceMappingURL=full-text-
|
|
26
|
+
//# sourceMappingURL=full-text-r2wMygYZ.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"full-text-
|
|
1
|
+
{"version":3,"file":"full-text-r2wMygYZ.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/full-text.d.mts"],"mappings":";;;;KAGK,cAAc,SAAS,yBAAyB,qBAAqB;;;;;;;;;;;;;;;;;iBAiBzD,QAAQ,SAAS,uBAAuB;iBACxC,QAAQ,SAAS,yBAAyB,mBAAmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-CbOh59ZJ.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/migration.mjs"],"sourcesContent":["import { V as createExtension } from \"./op-factory-call-
|
|
1
|
+
{"version":3,"file":"migration-CbOh59ZJ.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/migration.mjs"],"sourcesContent":["import { V as createExtension } from \"./op-factory-call-BfPsfi0_.mjs\";\nimport { t as PostgresMigration } from \"./postgres-migration-B6Jwrg_c.mjs\";\nimport { t as dataTransform } from \"./data-transform-CtHnNYhF.mjs\";\nimport { sql } from \"@internal/sql-contract/sql-expression\";\nimport { checkExpression, col, fn, foreignKey, lit, primaryKey, unique } from \"@internal/sql-relational-core/contract-free\";\nimport { placeholder } from \"@internal/errors/migration\";\nimport { MigrationCLI } from \"@internal/cli/migration-cli\";\n//#region src/core/migrations/operations/raw.ts\n/**\n* Identity factory for an already-materialized `SqlMigrationPlanOperation`.\n*\n* The planner uses this via `liftOpToCall` to carry ops produced by SQL\n* family methods, codec control hooks, and component database dependencies\n* alongside migration IR without reverse-engineering them. Users writing\n* raw migrations can pass a full op shape directly — typically built by\n* composing SQL family helpers — to author a migration that bypasses the\n* structured call classes.\n*/\nfunction rawSql(op) {\n\treturn op;\n}\n//#endregion\nexport { PostgresMigration as Migration, MigrationCLI, checkExpression, col, createExtension, dataTransform, fn, foreignKey, lit, placeholder, primaryKey, rawSql, sql, unique };\n\n//# sourceMappingURL=migration.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAkBA,SAAS,OAAO,IAAI;CACnB,OAAO;AACR"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Q as qualifiedEnumName } from "./data-types-BAbkwTt9-C9WMEFNT.mjs";
|
|
2
2
|
//#region ../../../3-targets/3-targets/postgres/dist/native-type-normalizer.mjs
|
|
3
3
|
/** The type introspection reports for a column, from its catalog type columns. */
|
|
4
4
|
function introspectedTypeText(column) {
|
|
@@ -21,4 +21,4 @@ function reportedTypeText(column) {
|
|
|
21
21
|
//#endregion
|
|
22
22
|
export { introspectedTypeText as t };
|
|
23
23
|
|
|
24
|
-
//# sourceMappingURL=native-type-normalizer-
|
|
24
|
+
//# sourceMappingURL=native-type-normalizer-BR69E8QO.mjs.map
|
package/dist/{native-type-normalizer-eX3KyHPA.mjs.map → native-type-normalizer-BR69E8QO.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-type-normalizer-
|
|
1
|
+
{"version":3,"file":"native-type-normalizer-BR69E8QO.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/native-type-normalizer.mjs"],"sourcesContent":["import { B as qualifiedEnumName } from \"./data-types-BAbkwTt9.mjs\";\n//#region src/core/native-type-normalizer.ts\n/** The type introspection reports for a column, from its catalog type columns. */\nfunction introspectedTypeText(column) {\n\tconst reported = reportedTypeText(column);\n\tconst many = reported.endsWith(\"[]\") ? true : void 0;\n\treturn {\n\t\ttypeText: column.enumType !== void 0 ? qualifiedEnumName(column.enumType) : many ? reported.slice(0, -2) : reported,\n\t\tmany\n\t};\n}\nfunction reportedTypeText(column) {\n\tif (column.formattedType) return column.formattedType;\n\tif (column.informationSchemaType === \"character varying\" || column.informationSchemaType === \"character\") return column.characterMaximumLength ? `${column.informationSchemaType}(${column.characterMaximumLength})` : column.informationSchemaType;\n\tif (column.informationSchemaType === \"numeric\" || column.informationSchemaType === \"decimal\") {\n\t\tif (column.numericPrecision && column.numericScale !== null) return `${column.informationSchemaType}(${column.numericPrecision},${column.numericScale})`;\n\t\treturn column.numericPrecision ? `${column.informationSchemaType}(${column.numericPrecision})` : column.informationSchemaType;\n\t}\n\treturn column.udtName || column.informationSchemaType;\n}\n//#endregion\nexport { introspectedTypeText };\n\n//# sourceMappingURL=native-type-normalizer.mjs.map"],"mappings":";;;AAGA,SAAS,qBAAqB,QAAQ;CACrC,MAAM,WAAW,iBAAiB,MAAM;CACxC,MAAM,OAAO,SAAS,SAAS,IAAI,IAAI,OAAO,KAAK;CACnD,OAAO;EACN,UAAU,OAAO,aAAa,KAAK,IAAI,kBAAkB,OAAO,QAAQ,IAAI,OAAO,SAAS,MAAM,GAAG,EAAE,IAAI;EAC3G;CACD;AACD;AACA,SAAS,iBAAiB,QAAQ;CACjC,IAAI,OAAO,eAAe,OAAO,OAAO;CACxC,IAAI,OAAO,0BAA0B,uBAAuB,OAAO,0BAA0B,aAAa,OAAO,OAAO,yBAAyB,GAAG,OAAO,sBAAsB,GAAG,OAAO,uBAAuB,KAAK,OAAO;CAC9N,IAAI,OAAO,0BAA0B,aAAa,OAAO,0BAA0B,WAAW;EAC7F,IAAI,OAAO,oBAAoB,OAAO,iBAAiB,MAAM,OAAO,GAAG,OAAO,sBAAsB,GAAG,OAAO,iBAAiB,GAAG,OAAO,aAAa;EACtJ,OAAO,OAAO,mBAAmB,GAAG,OAAO,sBAAsB,GAAG,OAAO,iBAAiB,KAAK,OAAO;CACzG;CACA,OAAO,OAAO,WAAW,OAAO;AACjC"}
|
package/dist/{op-factory-call-35RJQ1ME-BFxUakDe.mjs → op-factory-call-BfPsfi0_-DoCb1VbU.mjs}
RENAMED
|
@@ -3,22 +3,22 @@ import { a as quoteQualifiedName, i as quoteIdentifier, n as escapeLiteral, o as
|
|
|
3
3
|
import { t as DEFAULT_NAMESPACE_ID } from "./namespace-ids-xtp_ZY86-Cpp8PTxD.mjs";
|
|
4
4
|
import { A as nativeEnumValueExistsAst, C as dropIndex$1, D as indexDefinitionAst, E as extensionExistsAst, F as rlsPolicyExistsAst, I as sequenceNameAvailableAst, L as sequenceValuesFitAst, M as relationKindAst, N as rlsEnabledAst, O as indexExistsAst, P as rlsPolicyDefinitionAst, R as tableExistsAst, S as dropDefaultAction, T as dropType, _ as createPolicy, a as alterPolicyRename, b as createType, c as columnDefaultSequenceAst, d as columnOwnsSequenceAst, f as columnTypeAst, g as createIndex$1, h as constraintExistsAst, i as alterIndexRename, j as noNullValuesAst, k as nativeEnumTypeExistsAst, l as columnExistsAst, m as constraintDefinitionAst, n as addConstraintAction, o as alterTable, p as columnTypeOidAst, r as alterColumnTypeAction, s as columnDefaultAst, t as addColumnAction, u as columnNullabilityAst, v as createSchema, w as dropPolicy, x as disableRowLevelSecurity$1, y as createTable, z as tableIsEmptyAst } from "./ddl-BrIDeRCe-ojLIc02T.mjs";
|
|
5
5
|
import { i as policyRoleList, t as POLICY_COMMAND_SQL } from "./canonicalize-RdxoUHao-DK_M6HU-.mjs";
|
|
6
|
-
import { r as autoincrementWidthOfPseudoType, t as autoincrementWidth } from "./autoincrement-widths-
|
|
6
|
+
import { r as autoincrementWidthOfPseudoType, t as autoincrementWidth } from "./autoincrement-widths-hljSfPZk-C-izNyPe.mjs";
|
|
7
7
|
import { t as postgresObjectName } from "./postgres-object-name-FPikIvOw-BNs44hTu.mjs";
|
|
8
|
-
import { i as qualifyTableName, n as columnTypeCheckIfReadable, r as columnTypeCheckText, t as alterTypeCheck } from "./planner-sql-checks-
|
|
8
|
+
import { i as qualifyTableName, n as columnTypeCheckIfReadable, r as columnTypeCheckText, t as alterTypeCheck } from "./planner-sql-checks-CiJuuHxl-2xZ6yNhV.mjs";
|
|
9
9
|
import { t as buildTargetDetails } from "./planner-target-details-CUEF0s90-COTks5yz.mjs";
|
|
10
10
|
import { DdlColumn, FunctionColumnDefault, LiteralColumnDefault, opaqueSql } from "@prisma/orm-family-sql/relational-core/ast";
|
|
11
11
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
12
|
+
import { InternalError, assertNever } from "@prisma/orm-framework/utils/internal-error";
|
|
12
13
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
13
14
|
import { namingOf } from "@prisma/orm-family-sql/schema-ir/naming";
|
|
14
15
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
15
16
|
import { checkExpression, col } from "@prisma/orm-family-sql/relational-core/contract-free";
|
|
16
17
|
import { checkSqlDefaultText, checkSqlExpressionText, convertedColumnMeta, createSqlTextSources, isUnfilledSlot, requiredColumnMeta, slotSource, sqlOfSlot } from "@prisma/orm-family-sql/family/control";
|
|
17
|
-
import { InternalError, assertNever } from "@prisma/orm-framework/utils/internal-error";
|
|
18
18
|
import { unfilledPlaceholderOperation } from "@prisma/orm-framework/errors/migration";
|
|
19
19
|
import { TsExpression, jsonToTsSource, tsObjectSource } from "@prisma/orm-framework/ts-render";
|
|
20
20
|
import { REFERENTIAL_ACTION_SQL } from "@prisma/orm-family-sql/contract/referential-action-sql";
|
|
21
|
-
//#region ../../../3-targets/3-targets/postgres/dist/op-factory-call-
|
|
21
|
+
//#region ../../../3-targets/3-targets/postgres/dist/op-factory-call-BfPsfi0_.mjs
|
|
22
22
|
/**
|
|
23
23
|
* Maps a planner schema name to the contract-free DDL builder's optional
|
|
24
24
|
* `schema` field: the unbound sentinel becomes `undefined` (the builder omits
|
|
@@ -2612,4 +2612,4 @@ function columnNameOfCall(call) {
|
|
|
2612
2612
|
//#endregion
|
|
2613
2613
|
export { RenameConstraintCall as A, isPostgresOpFactoryCall as B, DropNativeEnumTypeCall as C, EnableRowLevelSecurityCall as D, DropTableCall as E, SetNotNullCall as F, renameTableStatement as H, alterColumnTypeCallText as I, columnNameOfCall as L, RenamePostgresRlsPolicyCall as M, RenameTableCall as N, RawSqlCall as O, SetDefaultCall as P, createExtension as R, DropIndexCall as S, DropPostgresRlsPolicyCall as T, postgresDefaultToDdlColumnDefault as V, DisableRowLevelSecurityCall as _, AddNativeEnumValueCall as a, DropConstraintCall as b, AddUniqueCall as c, CreateIndexCall as d, CreateNativeEnumTypeCall as f, DataTransformCall as g, CreateTableCall as h, AddForeignKeyCall as i, RenameIndexCall as j, RenameColumnCall as k, AlterColumnTypeCall as l, CreateSchemaCall as m, AddColumnCall as n, AddPrimaryKeyCall as o, CreatePostgresRlsPolicyCall as p, AddColumnWithTemporaryDefaultCall as r, AddRequiredColumnToEmptyTableCall as s, AddCheckConstraintCall as t, CreateExtensionCall as u, DropCheckConstraintCall as v, DropNotNullCall as w, DropDefaultCall as x, DropColumnCall as y, installExtension as z };
|
|
2614
2614
|
|
|
2615
|
-
//# sourceMappingURL=op-factory-call-
|
|
2615
|
+
//# sourceMappingURL=op-factory-call-BfPsfi0_-DoCb1VbU.mjs.map
|