@prisma/orm-target-postgres 8.0.0-rc.5-dev.1 → 8.0.0-rc.5-dev.3
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-CEEGgfaS-4MeZ7odP.mjs → adapter-fu5NLR5q-BGMHGbUv.mjs} +4 -4
- package/dist/{adapter-CEEGgfaS-4MeZ7odP.mjs.map → adapter-fu5NLR5q-BGMHGbUv.mjs.map} +1 -1
- package/dist/adapter.d.mts +2 -2
- package/dist/adapter.mjs +6 -6
- package/dist/adapter__adapter.mjs +1 -1
- package/dist/adapter__column-types.d.mts +2 -2
- package/dist/adapter__column-types.mjs +2 -2
- package/dist/adapter__control.mjs +78 -12
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.mjs +23 -14
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/{aggregates-Dh6HPdvC.mjs → aggregates-Ckjhz1o7.mjs} +15 -10
- package/dist/aggregates-Ckjhz1o7.mjs.map +1 -0
- package/dist/{authoring-BOpdZa2N-ClrLFiXw.mjs → authoring-DayoLvZs-BZzesJbW.mjs} +47 -12
- package/dist/authoring-DayoLvZs-BZzesJbW.mjs.map +1 -0
- package/dist/{check-expressions-5vhxWaFy-CBcjFeur.mjs → check-expressions-B3Xp6IFg-BzCFYrC9.mjs} +3 -3
- package/dist/{check-expressions-5vhxWaFy-CBcjFeur.mjs.map → check-expressions-B3Xp6IFg-BzCFYrC9.mjs.map} +1 -1
- package/dist/codec-ids-CmcC76hX-C0JIyoua.d.mts +39 -0
- package/dist/codec-ids-CmcC76hX-C0JIyoua.d.mts.map +1 -0
- package/dist/codec-ids-D3ZEAmt2-DjoKUAas.mjs +39 -0
- package/dist/codec-ids-D3ZEAmt2-DjoKUAas.mjs.map +1 -0
- package/dist/codec-ids-cWPqrkcF.d.mts +1 -0
- package/dist/{codec-types-BRU4F-7t-BaJbKF_i.d.mts → codec-types-X0ENu4sQ-C6GS_WDR.d.mts} +21 -9
- package/dist/codec-types-X0ENu4sQ-C6GS_WDR.d.mts.map +1 -0
- package/dist/codec-types-Zel4Dk7S.d.mts +2 -0
- package/dist/{codecs-BmPCJWqb-DveZGJvm.mjs → codecs-CxWg7WrX-DtVAuuXA.mjs} +351 -255
- package/dist/codecs-CxWg7WrX-DtVAuuXA.mjs.map +1 -0
- package/dist/{codecs-B1HgsJZ2.mjs → codecs-DZMfLjGe.mjs} +2 -2
- package/dist/codecs-DZMfLjGe.mjs.map +1 -0
- package/dist/{codecs-D8tLswBi-_nbo-Z8x.d.mts → codecs-bwX5JaME-ByuPNLC5.d.mts} +146 -86
- package/dist/codecs-bwX5JaME-ByuPNLC5.d.mts.map +1 -0
- package/dist/{codecs-DmCKO7dg.d.mts → codecs-ePpDWH7z.d.mts} +2 -2
- package/dist/codecs-ePpDWH7z.d.mts.map +1 -0
- package/dist/{column-types-BH-MU6uU.d.mts → column-types-CwjYfNCi.d.mts} +33 -7
- package/dist/column-types-CwjYfNCi.d.mts.map +1 -0
- package/dist/{column-types-Bh92dNjD.mjs → column-types-DU7C_gwa.mjs} +37 -9
- package/dist/column-types-DU7C_gwa.mjs.map +1 -0
- package/dist/{contract-free-aQ4nT-_R.mjs → contract-free-CzTZEwpt.mjs} +5 -5
- package/dist/contract-free-CzTZEwpt.mjs.map +1 -0
- package/dist/{control-2F195jJk.d.mts → control-ByalKcpe.d.mts} +2 -1
- package/dist/control-ByalKcpe.d.mts.map +1 -0
- package/dist/{control-V7OkAC55.mjs → control-CwOI5ZH9.mjs} +8 -8
- package/dist/control-CwOI5ZH9.mjs.map +1 -0
- package/dist/{control-adapter-DGLvLCp7-DaglJOfk.mjs → control-adapter-BvycZgCj-DH90lxuD.mjs} +9 -9
- package/dist/control-adapter-BvycZgCj-DH90lxuD.mjs.map +1 -0
- package/dist/{control-policy-B53lnBCT-B9K9Cj1x.mjs → control-policy-HgW6zNnz-Ds9U3rSS.mjs} +6 -6
- package/dist/{control-policy-B53lnBCT-B9K9Cj1x.mjs.map → control-policy-HgW6zNnz-Ds9U3rSS.mjs.map} +1 -1
- package/dist/{ddl-CNQJds-C-WfZ3y4y8.mjs → ddl-GXbCrKp_-CBKFkq1r.mjs} +4 -4
- package/dist/{ddl-CNQJds-C-WfZ3y4y8.mjs.map → ddl-GXbCrKp_-CBKFkq1r.mjs.map} +1 -1
- package/dist/{descriptor-meta-KVX21fsl-DBDoB4eg.mjs → descriptor-meta-BJvQzm-A-BdYGq2QU.mjs} +50 -21
- package/dist/descriptor-meta-BJvQzm-A-BdYGq2QU.mjs.map +1 -0
- package/dist/{descriptor-meta-rilAH3ep-dAmiVLpe.mjs → descriptor-meta-DInZZgUC-Cq-SJvwE.mjs} +6 -6
- package/dist/{descriptor-meta-rilAH3ep-dAmiVLpe.mjs.map → descriptor-meta-DInZZgUC-Cq-SJvwE.mjs.map} +1 -1
- package/dist/{diff-database-schema-DKq76rCk-uehceHYz.mjs → diff-database-schema-B27W13mM-DmRNUFyg.mjs} +6 -6
- package/dist/{diff-database-schema-DKq76rCk-uehceHYz.mjs.map → diff-database-schema-B27W13mM-DmRNUFyg.mjs.map} +1 -1
- package/dist/driver.mjs +1 -1
- package/dist/driver__runtime.mjs +1 -1
- package/dist/{errors-CU4xIwwk.d.mts → errors-5fMq0U66.d.mts} +2 -2
- package/dist/{errors-CU4xIwwk.d.mts.map → errors-5fMq0U66.d.mts.map} +1 -1
- package/dist/errors-DYyzTYzE-39CV_aMo.mjs +92 -0
- package/dist/errors-DYyzTYzE-39CV_aMo.mjs.map +1 -0
- package/dist/instant-now-generator-lJQqn_8K-JOzseqXI.d.mts +9 -0
- package/dist/instant-now-generator-lJQqn_8K-JOzseqXI.d.mts.map +1 -0
- package/dist/migration-PTHAY9Cv.mjs.map +1 -1
- package/dist/{op-factory-call-H6zeDGLe-_1pAftJk.mjs → op-factory-call-CSkQdszU-C43tr0rP.mjs} +7 -7
- package/dist/{op-factory-call-H6zeDGLe-_1pAftJk.mjs.map → op-factory-call-CSkQdszU-C43tr0rP.mjs.map} +1 -1
- package/dist/{pack-CySS3DQU.d.mts → pack-DaQJIP6O.d.mts} +143 -11
- package/dist/pack-DaQJIP6O.d.mts.map +1 -0
- package/dist/{planner-D0uogzvT-1WyGIC5p.mjs → planner-CqeT-P2q-DVglsvwu.mjs} +8 -8
- package/dist/{planner-D0uogzvT-1WyGIC5p.mjs.map → planner-CqeT-P2q-DVglsvwu.mjs.map} +1 -1
- package/dist/{planner-ddl-builders-Chxh-LEQ-DXvwOeeA.mjs → planner-ddl-builders-CsfmnnKR-CNn0fLyx.mjs} +5 -5
- package/dist/{planner-ddl-builders-Chxh-LEQ-DXvwOeeA.mjs.map → planner-ddl-builders-CsfmnnKR-CNn0fLyx.mjs.map} +1 -1
- package/dist/{planner-produced-postgres-migration-D5m8nK6s-CbZ4hlbv.mjs → planner-produced-postgres-migration-Dsri3SjC-DZynrNO-.mjs} +4 -4
- package/dist/{planner-produced-postgres-migration-D5m8nK6s-CbZ4hlbv.mjs.map → planner-produced-postgres-migration-Dsri3SjC-DZynrNO-.mjs.map} +1 -1
- package/dist/{planner-sql-checks-ftgzvIO9-BTtBg2Vz.mjs → planner-sql-checks-Bcngv5YZ-Dnp05hSM.mjs} +4 -4
- package/dist/{planner-sql-checks-ftgzvIO9-BTtBg2Vz.mjs.map → planner-sql-checks-Bcngv5YZ-Dnp05hSM.mjs.map} +1 -1
- package/dist/{postgres-contract-view-B8ykf2cO-T2LvWVFZ.mjs → postgres-contract-view-CzWRnkxb-BpyBv1vn.mjs} +5 -5
- package/dist/{postgres-contract-view-B8ykf2cO-T2LvWVFZ.mjs.map → postgres-contract-view-CzWRnkxb-BpyBv1vn.mjs.map} +1 -1
- package/dist/{postgres-migration-Dbq3RGfZ-aMnwfEAb.mjs → postgres-migration-DHvU3Jkt-Eah72PD4.mjs} +6 -6
- package/dist/{postgres-migration-Dbq3RGfZ-aMnwfEAb.mjs.map → postgres-migration-DHvU3Jkt-Eah72PD4.mjs.map} +1 -1
- package/dist/{postgres-schema-CF0yHESb-D7n2X21R.mjs → postgres-schema-B3t7Zr52-CMlY9aGw.mjs} +4 -4
- package/dist/{postgres-schema-CF0yHESb-D7n2X21R.mjs.map → postgres-schema-B3t7Zr52-CMlY9aGw.mjs.map} +1 -1
- package/dist/{render-ops-DOsRP0Po-BKn_c_Ia.mjs → render-ops-D2vJApKB-B281fzmn.mjs} +3 -3
- package/dist/{render-ops-DOsRP0Po-BKn_c_Ia.mjs.map → render-ops-D2vJApKB-B281fzmn.mjs.map} +1 -1
- package/dist/{resolve-ddl-schema-CoaeNP35-C-UZldpj.mjs → resolve-ddl-schema-Cab6g5MC-SRco-A7L.mjs} +3 -3
- package/dist/{resolve-ddl-schema-CoaeNP35-C-UZldpj.mjs.map → resolve-ddl-schema-Cab6g5MC-SRco-A7L.mjs.map} +1 -1
- package/dist/{runtime-C-Hh2m1R.mjs → runtime-BJrfP1e8.mjs} +43 -5
- package/dist/runtime-BJrfP1e8.mjs.map +1 -0
- package/dist/{runtime-_TfO66h5.d.mts → runtime-bbCw9Omq.d.mts} +2 -1
- package/dist/runtime-bbCw9Omq.d.mts.map +1 -0
- package/dist/{sql-renderer-ComgusFq-BBlqM1fw.mjs → sql-renderer-ComgusFq-DfvXlBce.mjs} +3 -3
- package/dist/{sql-renderer-ComgusFq-BBlqM1fw.mjs.map → sql-renderer-ComgusFq-DfvXlBce.mjs.map} +1 -1
- package/dist/{sql-utils-DuzN3JZg-DiXy4Vah.mjs → sql-utils-6j9YTLpr-BCyCBPBg.mjs} +3 -3
- package/dist/{sql-utils-DuzN3JZg-DiXy4Vah.mjs.map → sql-utils-6j9YTLpr-BCyCBPBg.mjs.map} +1 -1
- package/dist/target.d.mts +12 -11
- package/dist/target.mjs +24 -23
- package/dist/target__aggregates.mjs +1 -1
- package/dist/target__codec-ids.d.mts +3 -3
- package/dist/target__codec-ids.mjs +2 -2
- package/dist/target__codec-types.d.mts +4 -4
- package/dist/target__codecs.d.mts +3 -3
- package/dist/target__codecs.mjs +3 -3
- package/dist/target__contract-free.mjs +3 -3
- package/dist/target__control.d.mts +3 -2
- package/dist/target__control.mjs +3 -2
- package/dist/target__diff-database-schema.mjs +1 -1
- package/dist/target__errors.d.mts +1 -1
- package/dist/target__errors.mjs +1 -1
- package/dist/target__issue-planner.mjs +1 -1
- package/dist/target__migration.mjs +2 -2
- package/dist/target__op-factory-call.mjs +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__planner-ddl-builders.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__render-ops.mjs +1 -1
- package/dist/target__runtime.d.mts +3 -2
- package/dist/target__runtime.mjs +3 -2
- package/dist/target__runtime.mjs.map +1 -1
- package/dist/target__schema-ir-annotations.mjs +1 -1
- package/dist/target__sql-utils.mjs +1 -1
- package/dist/target__types.mjs +2 -2
- package/package.json +9 -9
- package/dist/aggregates-Dh6HPdvC.mjs.map +0 -1
- package/dist/authoring-BOpdZa2N-ClrLFiXw.mjs.map +0 -1
- package/dist/codec-ids-Bqu_IwO0-DKOdPizQ.d.mts +0 -35
- package/dist/codec-ids-Bqu_IwO0-DKOdPizQ.d.mts.map +0 -1
- package/dist/codec-ids-C5Rkltkw-DMf87l9s.mjs +0 -35
- package/dist/codec-ids-C5Rkltkw-DMf87l9s.mjs.map +0 -1
- package/dist/codec-ids-DJ6j6pZc.d.mts +0 -1
- package/dist/codec-types-BRU4F-7t-BaJbKF_i.d.mts.map +0 -1
- package/dist/codec-types-bX63JRLf.d.mts +0 -2
- package/dist/codecs-B1HgsJZ2.mjs.map +0 -1
- package/dist/codecs-BmPCJWqb-DveZGJvm.mjs.map +0 -1
- package/dist/codecs-D8tLswBi-_nbo-Z8x.d.mts.map +0 -1
- package/dist/codecs-DmCKO7dg.d.mts.map +0 -1
- package/dist/column-types-BH-MU6uU.d.mts.map +0 -1
- package/dist/column-types-Bh92dNjD.mjs.map +0 -1
- package/dist/contract-free-aQ4nT-_R.mjs.map +0 -1
- package/dist/control-2F195jJk.d.mts.map +0 -1
- package/dist/control-V7OkAC55.mjs.map +0 -1
- package/dist/control-adapter-DGLvLCp7-DaglJOfk.mjs.map +0 -1
- package/dist/descriptor-meta-KVX21fsl-DBDoB4eg.mjs.map +0 -1
- package/dist/errors-DKjQzNaN-DFcF1thx.mjs +0 -39
- package/dist/errors-DKjQzNaN-DFcF1thx.mjs.map +0 -1
- package/dist/pack-CySS3DQU.d.mts.map +0 -1
- package/dist/runtime-C-Hh2m1R.mjs.map +0 -1
- package/dist/runtime-_TfO66h5.d.mts.map +0 -1
package/dist/{descriptor-meta-KVX21fsl-DBDoB4eg.mjs → descriptor-meta-BJvQzm-A-BdYGq2QU.mjs}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as postgresAggregateDescriptors } from "./aggregates-
|
|
3
|
-
import { n as postgresCodecRegistry } from "./codecs-
|
|
4
|
-
import { t as adapterError } from "./sql-renderer-ComgusFq-
|
|
1
|
+
import { C as PG_TIMESTAMPTZ_STRING_CODEC_ID, D as PG_TIMETZ_CODEC_ID, E as PG_TIMESTAMP_TEMPORAL_CODEC_ID, F as SQL_FLOAT_CODEC_ID, I as SQL_INT_CODEC_ID, L as SQL_TEXT_CODEC_ID, M as PG_VARBIT_CODEC_ID, N as PG_VARCHAR_CODEC_ID, O as PG_TIME_STRING_CODEC_ID, P as SQL_CHAR_CODEC_ID, R as SQL_VARCHAR_CODEC_ID, S as PG_TEXT_CODEC_ID, T as PG_TIMESTAMP_STRING_CODEC_ID, _ as PG_INT_CODEC_ID, a as PG_DATE_STRING_CODEC_ID, b as PG_NUMERIC_CODEC_ID, c as PG_FLOAT4_CODEC_ID, d as PG_INET_CODEC_ID, f as PG_INT2_CODEC_ID, g as PG_INTERVAL_CODEC_ID, i as PG_CHAR_CODEC_ID, j as PG_UUID_CODEC_ID, k as PG_TIME_TEMPORAL_CODEC_ID, l as PG_FLOAT8_CODEC_ID, m as PG_INT8_CODEC_ID, n as PG_BOOL_CODEC_ID, o as PG_DATE_TEMPORAL_CODEC_ID, p as PG_INT4_CODEC_ID, r as PG_BYTEA_CODEC_ID, t as PG_BIT_CODEC_ID, u as PG_FLOAT_CODEC_ID, v as PG_JSONB_CODEC_ID, w as PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, y as PG_JSON_CODEC_ID } from "./codec-ids-D3ZEAmt2-DjoKUAas.mjs";
|
|
2
|
+
import { t as postgresAggregateDescriptors } from "./aggregates-Ckjhz1o7.mjs";
|
|
3
|
+
import { n as postgresCodecRegistry } from "./codecs-DZMfLjGe.mjs";
|
|
4
|
+
import { t as adapterError } from "./sql-renderer-ComgusFq-DfvXlBce.mjs";
|
|
5
5
|
import { buildOperation, toExpr } from "@prisma/orm-family-sql/relational-core/expression";
|
|
6
|
-
//#region ../../../3-targets/6-adapters/postgres/dist/descriptor-meta-
|
|
6
|
+
//#region ../../../3-targets/6-adapters/postgres/dist/descriptor-meta-BJvQzm-A.mjs
|
|
7
7
|
/** Creates a type import spec for codec types */
|
|
8
8
|
const codecTypeImport = (named) => ({
|
|
9
9
|
package: "@internal/target-postgres/codec-types",
|
|
@@ -29,7 +29,7 @@ function expandLength({ nativeType, typeParams }) {
|
|
|
29
29
|
function expandPrecision({ nativeType, typeParams }) {
|
|
30
30
|
if (!typeParams || !("precision" in typeParams)) return nativeType;
|
|
31
31
|
const precision = typeParams["precision"];
|
|
32
|
-
if (!
|
|
32
|
+
if (!isNonNegativeInteger(precision)) throw adapterError("RUNTIME.TYPE_PARAMS_INVALID", `Invalid "precision" type parameter for "${nativeType}": expected a non-negative integer, got ${JSON.stringify(precision)}`, { meta: {
|
|
33
33
|
nativeType,
|
|
34
34
|
param: "precision",
|
|
35
35
|
received: precision
|
|
@@ -136,20 +136,25 @@ const postgresAdapterDescriptorMeta = {
|
|
|
136
136
|
codecTypeImport("Timestamptz"),
|
|
137
137
|
codecTypeImport("Time"),
|
|
138
138
|
codecTypeImport("Timetz"),
|
|
139
|
-
codecTypeImport("Interval")
|
|
139
|
+
codecTypeImport("Interval"),
|
|
140
|
+
codecTypeImport("TimestampString"),
|
|
141
|
+
codecTypeImport("TimestamptzString"),
|
|
142
|
+
codecTypeImport("TimeString")
|
|
140
143
|
],
|
|
141
144
|
controlPlaneHooks: {
|
|
142
145
|
[SQL_CHAR_CODEC_ID]: lengthHooks,
|
|
143
146
|
[SQL_VARCHAR_CODEC_ID]: lengthHooks,
|
|
144
|
-
[SQL_TIMESTAMP_CODEC_ID]: precisionHooks,
|
|
145
147
|
[PG_CHAR_CODEC_ID]: lengthHooks,
|
|
146
148
|
[PG_VARCHAR_CODEC_ID]: lengthHooks,
|
|
147
149
|
[PG_NUMERIC_CODEC_ID]: numericHooks,
|
|
148
150
|
[PG_BIT_CODEC_ID]: lengthHooks,
|
|
149
151
|
[PG_VARBIT_CODEC_ID]: lengthHooks,
|
|
150
|
-
[
|
|
151
|
-
[
|
|
152
|
-
[
|
|
152
|
+
[PG_TIMESTAMP_TEMPORAL_CODEC_ID]: precisionHooks,
|
|
153
|
+
[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]: precisionHooks,
|
|
154
|
+
[PG_TIME_TEMPORAL_CODEC_ID]: precisionHooks,
|
|
155
|
+
[PG_TIMESTAMP_STRING_CODEC_ID]: precisionHooks,
|
|
156
|
+
[PG_TIMESTAMPTZ_STRING_CODEC_ID]: precisionHooks,
|
|
157
|
+
[PG_TIME_STRING_CODEC_ID]: precisionHooks,
|
|
153
158
|
[PG_TIMETZ_CODEC_ID]: precisionHooks,
|
|
154
159
|
[PG_INTERVAL_CODEC_ID]: precisionHooks,
|
|
155
160
|
[PG_JSON_CODEC_ID]: identityHooks,
|
|
@@ -196,12 +201,6 @@ const postgresAdapterDescriptorMeta = {
|
|
|
196
201
|
targetId: "postgres",
|
|
197
202
|
nativeType: "float8"
|
|
198
203
|
},
|
|
199
|
-
{
|
|
200
|
-
typeId: SQL_TIMESTAMP_CODEC_ID,
|
|
201
|
-
familyId: "sql",
|
|
202
|
-
targetId: "postgres",
|
|
203
|
-
nativeType: "timestamp"
|
|
204
|
-
},
|
|
205
204
|
{
|
|
206
205
|
typeId: PG_CHAR_CODEC_ID,
|
|
207
206
|
familyId: "sql",
|
|
@@ -263,19 +262,49 @@ const postgresAdapterDescriptorMeta = {
|
|
|
263
262
|
nativeType: "numeric"
|
|
264
263
|
},
|
|
265
264
|
{
|
|
266
|
-
typeId:
|
|
265
|
+
typeId: PG_DATE_TEMPORAL_CODEC_ID,
|
|
266
|
+
familyId: "sql",
|
|
267
|
+
targetId: "postgres",
|
|
268
|
+
nativeType: "date"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
typeId: PG_TIMESTAMP_TEMPORAL_CODEC_ID,
|
|
272
|
+
familyId: "sql",
|
|
273
|
+
targetId: "postgres",
|
|
274
|
+
nativeType: "timestamp"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
typeId: PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID,
|
|
278
|
+
familyId: "sql",
|
|
279
|
+
targetId: "postgres",
|
|
280
|
+
nativeType: "timestamptz"
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
typeId: PG_TIME_TEMPORAL_CODEC_ID,
|
|
284
|
+
familyId: "sql",
|
|
285
|
+
targetId: "postgres",
|
|
286
|
+
nativeType: "time"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
typeId: PG_DATE_STRING_CODEC_ID,
|
|
290
|
+
familyId: "sql",
|
|
291
|
+
targetId: "postgres",
|
|
292
|
+
nativeType: "date"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
typeId: PG_TIMESTAMP_STRING_CODEC_ID,
|
|
267
296
|
familyId: "sql",
|
|
268
297
|
targetId: "postgres",
|
|
269
298
|
nativeType: "timestamp"
|
|
270
299
|
},
|
|
271
300
|
{
|
|
272
|
-
typeId:
|
|
301
|
+
typeId: PG_TIMESTAMPTZ_STRING_CODEC_ID,
|
|
273
302
|
familyId: "sql",
|
|
274
303
|
targetId: "postgres",
|
|
275
304
|
nativeType: "timestamptz"
|
|
276
305
|
},
|
|
277
306
|
{
|
|
278
|
-
typeId:
|
|
307
|
+
typeId: PG_TIME_STRING_CODEC_ID,
|
|
279
308
|
familyId: "sql",
|
|
280
309
|
targetId: "postgres",
|
|
281
310
|
nativeType: "time"
|
|
@@ -351,4 +380,4 @@ const postgresAdapterDescriptorMeta = {
|
|
|
351
380
|
//#endregion
|
|
352
381
|
export { postgresQueryOperations as n, postgresAdapterDescriptorMeta as t };
|
|
353
382
|
|
|
354
|
-
//# sourceMappingURL=descriptor-meta-
|
|
383
|
+
//# sourceMappingURL=descriptor-meta-BJvQzm-A-BdYGq2QU.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptor-meta-BJvQzm-A-BdYGq2QU.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/descriptor-meta-BJvQzm-A.mjs"],"sourcesContent":["import { n as adapterError } from \"./sql-renderer-ComgusFq.mjs\";\nimport { postgresCodecRegistry } from \"@internal/target-postgres/codecs\";\nimport { PG_BIT_CODEC_ID, PG_BOOL_CODEC_ID, PG_BYTEA_CODEC_ID, PG_CHAR_CODEC_ID, PG_DATE_STRING_CODEC_ID, PG_DATE_TEMPORAL_CODEC_ID, PG_FLOAT4_CODEC_ID, PG_FLOAT8_CODEC_ID, PG_FLOAT_CODEC_ID, PG_INET_CODEC_ID, PG_INT2_CODEC_ID, PG_INT4_CODEC_ID, PG_INT8_CODEC_ID, PG_INTERVAL_CODEC_ID, PG_INT_CODEC_ID, PG_JSONB_CODEC_ID, PG_JSON_CODEC_ID, PG_NUMERIC_CODEC_ID, PG_TEXT_CODEC_ID, PG_TIMESTAMPTZ_STRING_CODEC_ID, PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, PG_TIMESTAMP_STRING_CODEC_ID, PG_TIMESTAMP_TEMPORAL_CODEC_ID, PG_TIMETZ_CODEC_ID, PG_TIME_STRING_CODEC_ID, PG_TIME_TEMPORAL_CODEC_ID, PG_UUID_CODEC_ID, PG_VARBIT_CODEC_ID, PG_VARCHAR_CODEC_ID, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID } from \"@internal/target-postgres/codec-ids\";\nimport { buildOperation, toExpr } from \"@internal/sql-relational-core/expression\";\nimport { postgresAggregateDescriptors } from \"@internal/target-postgres/aggregates\";\n//#region src/core/descriptor-meta.ts\n/** Creates a type import spec for codec types */\nconst codecTypeImport = (named) => ({\n\tpackage: \"@internal/target-postgres/codec-types\",\n\tnamed,\n\talias: named\n});\nfunction isPositiveInteger(value) {\n\treturn typeof value === \"number\" && Number.isFinite(value) && Number.isInteger(value) && value > 0;\n}\nfunction isNonNegativeInteger(value) {\n\treturn typeof value === \"number\" && Number.isFinite(value) && Number.isInteger(value) && value >= 0;\n}\nfunction expandLength({ nativeType, typeParams }) {\n\tif (!typeParams || !(\"length\" in typeParams)) return nativeType;\n\tconst length = typeParams[\"length\"];\n\tif (!isPositiveInteger(length)) throw adapterError(\"RUNTIME.TYPE_PARAMS_INVALID\", `Invalid \"length\" type parameter for \"${nativeType}\": expected a positive integer, got ${JSON.stringify(length)}`, { meta: {\n\t\tnativeType,\n\t\tparam: \"length\",\n\t\treceived: length\n\t} });\n\treturn `${nativeType}(${length})`;\n}\nfunction expandPrecision({ nativeType, typeParams }) {\n\tif (!typeParams || !(\"precision\" in typeParams)) return nativeType;\n\tconst precision = typeParams[\"precision\"];\n\tif (!isNonNegativeInteger(precision)) throw adapterError(\"RUNTIME.TYPE_PARAMS_INVALID\", `Invalid \"precision\" type parameter for \"${nativeType}\": expected a non-negative integer, got ${JSON.stringify(precision)}`, { meta: {\n\t\tnativeType,\n\t\tparam: \"precision\",\n\t\treceived: precision\n\t} });\n\treturn `${nativeType}(${precision})`;\n}\nfunction expandNumeric({ nativeType, typeParams }) {\n\tconst hasPrecision = typeParams && \"precision\" in typeParams;\n\tconst hasScale = typeParams && \"scale\" in typeParams;\n\tif (!hasPrecision && !hasScale) return nativeType;\n\tif (!hasPrecision && hasScale) throw adapterError(\"RUNTIME.TYPE_PARAMS_INVALID\", `Invalid type parameters for \"${nativeType}\": \"scale\" requires \"precision\" to be specified`, { meta: {\n\t\tnativeType,\n\t\tparam: \"scale\"\n\t} });\n\tif (hasPrecision) {\n\t\tconst precision = typeParams[\"precision\"];\n\t\tif (!isPositiveInteger(precision)) throw adapterError(\"RUNTIME.TYPE_PARAMS_INVALID\", `Invalid \"precision\" type parameter for \"${nativeType}\": expected a positive integer, got ${JSON.stringify(precision)}`, { meta: {\n\t\t\tnativeType,\n\t\t\tparam: \"precision\",\n\t\t\treceived: precision\n\t\t} });\n\t\tif (hasScale) {\n\t\t\tconst scale = typeParams[\"scale\"];\n\t\t\tif (!isNonNegativeInteger(scale)) throw adapterError(\"RUNTIME.TYPE_PARAMS_INVALID\", `Invalid \"scale\" type parameter for \"${nativeType}\": expected a non-negative integer, got ${JSON.stringify(scale)}`, { meta: {\n\t\t\t\tnativeType,\n\t\t\t\tparam: \"scale\",\n\t\t\t\treceived: scale\n\t\t\t} });\n\t\t\treturn `${nativeType}(${precision},${scale})`;\n\t\t}\n\t\treturn `${nativeType}(${precision})`;\n\t}\n\treturn nativeType;\n}\nconst lengthHooks = { expandNativeType: expandLength };\nconst precisionHooks = { expandNativeType: expandPrecision };\nconst numericHooks = { expandNativeType: expandNumeric };\nconst identityHooks = { expandNativeType: ({ nativeType }) => nativeType };\nfunction postgresQueryOperations() {\n\treturn { ilike: {\n\t\tself: { traits: [\"textual\"] },\n\t\timpl: (self, pattern) => {\n\t\t\treturn buildOperation({\n\t\t\t\tmethod: \"ilike\",\n\t\t\t\targs: [toExpr(self), toExpr(pattern, { codecId: PG_TEXT_CODEC_ID })],\n\t\t\t\treturns: {\n\t\t\t\t\tcodecId: PG_BOOL_CODEC_ID,\n\t\t\t\t\tnullable: false\n\t\t\t\t},\n\t\t\t\tlowering: {\n\t\t\t\t\ttargetFamily: \"sql\",\n\t\t\t\t\tstrategy: \"infix\",\n\t\t\t\t\ttemplate: \"{{self}} ILIKE {{arg0}}\"\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t} };\n}\nconst postgresAdapterDescriptorMeta = {\n\tkind: \"adapter\",\n\tfamilyId: \"sql\",\n\ttargetId: \"postgres\",\n\tid: \"postgres\",\n\tversion: \"0.0.1\",\n\tcapabilities: {\n\t\tpostgres: {\n\t\t\torderBy: true,\n\t\t\tlimit: true,\n\t\t\tlateral: true,\n\t\t\tjsonAgg: true,\n\t\t\treturning: true,\n\t\t\tdistinctOn: true\n\t\t},\n\t\tsql: {\n\t\t\tenums: true,\n\t\t\treturning: true,\n\t\t\tdefaultInInsert: true,\n\t\t\tlateral: true,\n\t\t\tscalarList: true,\n\t\t\tcheckConstraint: true\n\t\t}\n\t},\n\ttypes: {\n\t\taggregateDescriptors: postgresAggregateDescriptors,\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\t{\n\t\t\t\t\tpackage: \"@internal/target-postgres/codec-types\",\n\t\t\t\t\tnamed: \"JsonValue\",\n\t\t\t\t\talias: \"JsonValue\"\n\t\t\t\t},\n\t\t\t\tcodecTypeImport(\"Char\"),\n\t\t\t\tcodecTypeImport(\"Varchar\"),\n\t\t\t\tcodecTypeImport(\"Numeric\"),\n\t\t\t\tcodecTypeImport(\"Bit\"),\n\t\t\t\tcodecTypeImport(\"VarBit\"),\n\t\t\t\tcodecTypeImport(\"Timestamp\"),\n\t\t\t\tcodecTypeImport(\"Timestamptz\"),\n\t\t\t\tcodecTypeImport(\"Time\"),\n\t\t\t\tcodecTypeImport(\"Timetz\"),\n\t\t\t\tcodecTypeImport(\"Interval\"),\n\t\t\t\tcodecTypeImport(\"TimestampString\"),\n\t\t\t\tcodecTypeImport(\"TimestamptzString\"),\n\t\t\t\tcodecTypeImport(\"TimeString\")\n\t\t\t],\n\t\t\tcontrolPlaneHooks: {\n\t\t\t\t[SQL_CHAR_CODEC_ID]: lengthHooks,\n\t\t\t\t[SQL_VARCHAR_CODEC_ID]: lengthHooks,\n\t\t\t\t[PG_CHAR_CODEC_ID]: lengthHooks,\n\t\t\t\t[PG_VARCHAR_CODEC_ID]: lengthHooks,\n\t\t\t\t[PG_NUMERIC_CODEC_ID]: numericHooks,\n\t\t\t\t[PG_BIT_CODEC_ID]: lengthHooks,\n\t\t\t\t[PG_VARBIT_CODEC_ID]: lengthHooks,\n\t\t\t\t[PG_TIMESTAMP_TEMPORAL_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_TIME_TEMPORAL_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_TIMESTAMP_STRING_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_TIMESTAMPTZ_STRING_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_TIME_STRING_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_TIMETZ_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_INTERVAL_CODEC_ID]: precisionHooks,\n\t\t\t\t[PG_JSON_CODEC_ID]: identityHooks,\n\t\t\t\t[PG_JSONB_CODEC_ID]: identityHooks,\n\t\t\t\t[PG_BYTEA_CODEC_ID]: identityHooks,\n\t\t\t\t[PG_UUID_CODEC_ID]: identityHooks,\n\t\t\t\t[PG_INET_CODEC_ID]: identityHooks\n\t\t\t}\n\t\t},\n\t\tstorage: [\n\t\t\t{\n\t\t\t\ttypeId: PG_TEXT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"text\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: SQL_TEXT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"text\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: SQL_CHAR_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"character\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: SQL_VARCHAR_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"character varying\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: SQL_INT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"int4\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: SQL_FLOAT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"float8\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_CHAR_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"character\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_VARCHAR_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"character varying\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"int4\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_FLOAT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"float8\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INT4_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"int4\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INT2_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"int2\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INT8_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"int8\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_FLOAT4_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"float4\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_FLOAT8_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"float8\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_NUMERIC_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"numeric\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_DATE_TEMPORAL_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"date\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIMESTAMP_TEMPORAL_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"timestamp\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"timestamptz\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIME_TEMPORAL_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"time\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_DATE_STRING_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"date\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIMESTAMP_STRING_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"timestamp\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIMESTAMPTZ_STRING_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"timestamptz\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIME_STRING_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"time\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_TIMETZ_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"timetz\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_BOOL_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"bool\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_BIT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"bit\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_VARBIT_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"bit varying\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INTERVAL_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"interval\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_JSON_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"json\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_JSONB_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"jsonb\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_BYTEA_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"bytea\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_UUID_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"uuid\"\n\t\t\t},\n\t\t\t{\n\t\t\t\ttypeId: PG_INET_CODEC_ID,\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tnativeType: \"inet\"\n\t\t\t}\n\t\t],\n\t\tqueryOperationTypes: { import: {\n\t\t\tpackage: \"@internal/adapter-postgres/operation-types\",\n\t\t\tnamed: \"QueryOperationTypes\",\n\t\t\talias: \"PgAdapterQueryOps\"\n\t\t} }\n\t}\n};\n//#endregion\nexport { postgresQueryOperations as n, postgresAdapterDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-BJvQzm-A.mjs.map"],"mappings":";;;;;;;AAOA,MAAM,mBAAmB,WAAW;CACnC,SAAS;CACT;CACA,OAAO;AACR;AACA,SAAS,kBAAkB,OAAO;CACjC,OAAO,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,KAAK,OAAO,UAAU,KAAK,KAAK,QAAQ;AAClG;AACA,SAAS,qBAAqB,OAAO;CACpC,OAAO,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,KAAK,OAAO,UAAU,KAAK,KAAK,SAAS;AACnG;AACA,SAAS,aAAa,EAAE,YAAY,cAAc;CACjD,IAAI,CAAC,cAAc,EAAE,YAAY,aAAa,OAAO;CACrD,MAAM,SAAS,WAAW;CAC1B,IAAI,CAAC,kBAAkB,MAAM,GAAG,MAAM,aAAa,+BAA+B,wCAAwC,WAAW,sCAAsC,KAAK,UAAU,MAAM,KAAK,EAAE,MAAM;EAC5M;EACA,OAAO;EACP,UAAU;CACX,EAAE,CAAC;CACH,OAAO,GAAG,WAAW,GAAG,OAAO;AAChC;AACA,SAAS,gBAAgB,EAAE,YAAY,cAAc;CACpD,IAAI,CAAC,cAAc,EAAE,eAAe,aAAa,OAAO;CACxD,MAAM,YAAY,WAAW;CAC7B,IAAI,CAAC,qBAAqB,SAAS,GAAG,MAAM,aAAa,+BAA+B,2CAA2C,WAAW,0CAA0C,KAAK,UAAU,SAAS,KAAK,EAAE,MAAM;EAC5N;EACA,OAAO;EACP,UAAU;CACX,EAAE,CAAC;CACH,OAAO,GAAG,WAAW,GAAG,UAAU;AACnC;AACA,SAAS,cAAc,EAAE,YAAY,cAAc;CAClD,MAAM,eAAe,cAAc,eAAe;CAClD,MAAM,WAAW,cAAc,WAAW;CAC1C,IAAI,CAAC,gBAAgB,CAAC,UAAU,OAAO;CACvC,IAAI,CAAC,gBAAgB,UAAU,MAAM,aAAa,+BAA+B,gCA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AAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;GACA;IACC,QAAQ;IACR,UAAU;IACV,UAAU;IACV,YAAY;GACb;EACD;EACA,qBAAqB,EAAE,QAAQ;GAC9B,SAAS;GACT,OAAO;GACP,OAAO;EACR,EAAE;CACH;AACD"}
|
package/dist/{descriptor-meta-rilAH3ep-dAmiVLpe.mjs → descriptor-meta-DInZZgUC-Cq-SJvwE.mjs}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as DEFAULT_NAMESPACE_ID } from "./namespace-ids-xtp_ZY86-Cpp8PTxD.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { h as postgresCreateNamespace } from "./postgres-schema-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { E as postgresQualifyColumnType } from "./codecs-CxWg7WrX-DtVAuuXA.mjs";
|
|
3
|
+
import { h as postgresCreateNamespace } from "./postgres-schema-B3t7Zr52-CMlY9aGw.mjs";
|
|
4
|
+
import { a as postgresAuthoringFieldPresets, c as postgresAuthoringTypes, i as postgresAuthoringEntityTypes, l as postgresLowerEntityHandles, o as postgresAuthoringModelAttributes, s as postgresAuthoringPslBlockDescriptors } from "./authoring-DayoLvZs-BZzesJbW.mjs";
|
|
5
|
+
import { t as postgresRenderCheckExpressions } from "./check-expressions-B3Xp6IFg-BzCFYrC9.mjs";
|
|
6
6
|
import { t as postgresTargetDescriptorMetaRuntime } from "./descriptor-meta-runtime-UwYdV8fD-B_m_Ha8r.mjs";
|
|
7
7
|
import { type } from "arktype";
|
|
8
8
|
import { defineIndexTypes } from "@prisma/orm-family-sql/contract/index-types";
|
|
9
|
-
//#region ../../../3-targets/3-targets/postgres/dist/descriptor-meta-
|
|
9
|
+
//#region ../../../3-targets/3-targets/postgres/dist/descriptor-meta-DInZZgUC.mjs
|
|
10
10
|
const postgresIndexTypes = defineIndexTypes().add("btree", { options: type("object") }).add("hash", { options: type("object") }).add("gin", { options: type("object") }).add("gist", { options: type("object") }).add("spgist", { options: type("object") }).add("brin", { options: type("object") });
|
|
11
11
|
const postgresTargetDescriptorMeta = {
|
|
12
12
|
...postgresTargetDescriptorMetaRuntime,
|
|
@@ -27,4 +27,4 @@ const postgresTargetDescriptorMeta = {
|
|
|
27
27
|
//#endregion
|
|
28
28
|
export { postgresTargetDescriptorMeta as t };
|
|
29
29
|
|
|
30
|
-
//# sourceMappingURL=descriptor-meta-
|
|
30
|
+
//# sourceMappingURL=descriptor-meta-DInZZgUC-Cq-SJvwE.mjs.map
|
package/dist/{descriptor-meta-rilAH3ep-dAmiVLpe.mjs.map → descriptor-meta-DInZZgUC-Cq-SJvwE.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor-meta-
|
|
1
|
+
{"version":3,"file":"descriptor-meta-DInZZgUC-Cq-SJvwE.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/descriptor-meta-DInZZgUC.mjs"],"sourcesContent":["import { E as postgresQualifyColumnType } from \"./codecs-CxWg7WrX.mjs\";\nimport { t as DEFAULT_NAMESPACE_ID } from \"./namespace-ids-xtp_ZY86.mjs\";\nimport { a as postgresAuthoringTypes, i as postgresAuthoringPslBlockDescriptors, n as postgresAuthoringFieldPresets, o as postgresLowerEntityHandles, r as postgresAuthoringModelAttributes, t as postgresAuthoringEntityTypes } from \"./authoring-DayoLvZs.mjs\";\nimport { i as postgresCreateNamespace } from \"./postgres-schema-B3t7Zr52.mjs\";\nimport { t as postgresRenderCheckExpressions } from \"./check-expressions-B3Xp6IFg.mjs\";\nimport { t as postgresTargetDescriptorMetaRuntime } from \"./descriptor-meta-runtime-UwYdV8fD.mjs\";\nimport { type } from \"arktype\";\nimport { defineIndexTypes } from \"@internal/sql-contract/index-types\";\n//#region src/core/index-types.ts\nconst postgresIndexTypes = defineIndexTypes().add(\"btree\", { options: type(\"object\") }).add(\"hash\", { options: type(\"object\") }).add(\"gin\", { options: type(\"object\") }).add(\"gist\", { options: type(\"object\") }).add(\"spgist\", { options: type(\"object\") }).add(\"brin\", { options: type(\"object\") });\nconst postgresTargetDescriptorMeta = {\n\t...postgresTargetDescriptorMetaRuntime,\n\tdefaultNamespaceId: DEFAULT_NAMESPACE_ID,\n\tindexTypes: postgresIndexTypes,\n\tauthoring: {\n\t\ttype: postgresAuthoringTypes,\n\t\tfield: postgresAuthoringFieldPresets,\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};\n//#endregion\nexport { postgresTargetDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-DInZZgUC.mjs.map"],"mappings":";;;;;;;;;AASA,MAAM,qBAAqB,iBAAiB,CAAC,CAAC,IAAI,SAAS,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC;AACpS,MAAM,+BAA+B;CACpC,GAAG;CACH,oBAAoB;CACpB,YAAY;CACZ,WAAW;EACV,MAAM;EACN,OAAO;EACP,aAAa;EACb,qBAAqB;EACrB,iBAAiB;EACjB,iBAAiB;EACjB,mBAAmB;EACnB,wBAAwB;EACxB,oBAAoB;CACrB;AACD"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as isPostgresSchema } from "./postgres-schema-
|
|
1
|
+
import { s as postgresError } from "./errors-DYyzTYzE-39CV_aMo.mjs";
|
|
2
|
+
import { d as isPostgresSchema } from "./postgres-schema-B3t7Zr52-CMlY9aGw.mjs";
|
|
3
3
|
import { n as postgresResolveDefault } from "./default-normalizer-Ba5ZebHM-isV86rjy.mjs";
|
|
4
4
|
import { a as postgresDiffSubjectGranularity, n as PostgresSchemaNodeKind, r as PostgresTableSchemaNode, t as PostgresNativeEnumSchemaNode } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
|
|
5
5
|
import { i as PostgresRoleSchemaNode, n as PostgresNamespaceSchemaNode, r as PostgresPolicySchemaNode, t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs";
|
|
6
|
-
import { t as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-
|
|
7
|
-
import { d as resolvePostgresNodeIssueControlPolicySubject } from "./control-policy-
|
|
6
|
+
import { t as resolveDdlSchemaForNamespaceStorage } from "./resolve-ddl-schema-Cab6g5MC-SRco-A7L.mjs";
|
|
7
|
+
import { d as resolvePostgresNodeIssueControlPolicySubject } from "./control-policy-HgW6zNnz-Ds9U3rSS.mjs";
|
|
8
8
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
9
9
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
10
10
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
@@ -13,7 +13,7 @@ import { diffSchemas, issueOutcome } from "@prisma/orm-framework/components/cont
|
|
|
13
13
|
import { buildNativeTypeExpander, contractNamespaceToSchemaIR } from "@prisma/orm-family-sql/family/control";
|
|
14
14
|
import { PrimaryKey, RelationalSchemaNodeKind, SqlForeignKeyIR, SqlIndexIR, SqlUniqueIR } from "@prisma/orm-family-sql/schema-ir/types";
|
|
15
15
|
import { classifyDiffSubjectGranularity } from "@prisma/orm-family-sql/family/diff";
|
|
16
|
-
//#region ../../../3-targets/3-targets/postgres/dist/diff-database-schema-
|
|
16
|
+
//#region ../../../3-targets/3-targets/postgres/dist/diff-database-schema-B27W13mM.mjs
|
|
17
17
|
/** The database root's fixed sentinel id (`PostgresDatabaseSchemaNode#id`). */
|
|
18
18
|
function databaseStep() {
|
|
19
19
|
return {
|
|
@@ -387,4 +387,4 @@ function buildPostgresPlanDiff(input) {
|
|
|
387
387
|
//#endregion
|
|
388
388
|
export { contractToPostgresDatabaseSchemaNode as n, diffPostgresSchema as r, buildPostgresPlanDiff as t };
|
|
389
389
|
|
|
390
|
-
//# sourceMappingURL=diff-database-schema-
|
|
390
|
+
//# sourceMappingURL=diff-database-schema-B27W13mM-DmRNUFyg.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff-database-schema-DKq76rCk-uehceHYz.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/diff-database-schema-DKq76rCk.mjs"],"sourcesContent":["import { n as postgresError } from \"./errors-DKjQzNaN.mjs\";\nimport { n as postgresResolveDefault } from \"./default-normalizer-Ba5ZebHM.mjs\";\nimport { r as isPostgresSchema } from \"./postgres-schema-CF0yHESb.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 { t as resolveDdlSchemaForNamespaceStorage } from \"./resolve-ddl-schema-CoaeNP35.mjs\";\nimport { i as resolvePostgresNodeIssueControlPolicySubject } from \"./control-policy-B53lnBCT.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { buildNativeTypeExpander, contractNamespaceToSchemaIR } from \"@internal/family-sql/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { namingOf } from \"@internal/sql-schema-ir/naming\";\nimport { PrimaryKey, RelationalSchemaNodeKind, SqlForeignKeyIR, SqlIndexIR, SqlUniqueIR } from \"@internal/sql-schema-ir/types\";\nimport { classifyDiffSubjectGranularity } from \"@internal/family-sql/diff\";\nimport { diffSchemas, issueOutcome } from \"@internal/framework-components/control\";\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 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, expander threaded, 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 fullExpected = contractToPostgresDatabaseSchemaNode(postgresContract, {\n\t\tannotationNamespace: \"pg\",\n\t\t...ifDefined(\"expandNativeType\", buildNativeTypeExpander(input.frameworkComponents)),\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 (expander threaded, 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 fullExpected = contractToPostgresDatabaseSchemaNode(postgresContract, {\n\t\tannotationNamespace: \"pg\",\n\t\t...ifDefined(\"expandNativeType\", buildNativeTypeExpander(input.frameworkComponents)),\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-DKq76rCk.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,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;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A,CAAiB,IAAI,gBAAgB;EAC/F,CAAC;CACF;AACD"}
|
|
1
|
+
{"version":3,"file":"diff-database-schema-B27W13mM-DmRNUFyg.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/diff-database-schema-B27W13mM.mjs"],"sourcesContent":["import { s as postgresError } from \"./errors-DYyzTYzE.mjs\";\nimport { n as postgresResolveDefault } from \"./default-normalizer-Ba5ZebHM.mjs\";\nimport { r as isPostgresSchema } from \"./postgres-schema-B3t7Zr52.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 { t as resolveDdlSchemaForNamespaceStorage } from \"./resolve-ddl-schema-Cab6g5MC.mjs\";\nimport { i as resolvePostgresNodeIssueControlPolicySubject } from \"./control-policy-HgW6zNnz.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { buildNativeTypeExpander, contractNamespaceToSchemaIR } from \"@internal/family-sql/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { namingOf } from \"@internal/sql-schema-ir/naming\";\nimport { PrimaryKey, RelationalSchemaNodeKind, SqlForeignKeyIR, SqlIndexIR, SqlUniqueIR } from \"@internal/sql-schema-ir/types\";\nimport { classifyDiffSubjectGranularity } from \"@internal/family-sql/diff\";\nimport { diffSchemas, issueOutcome } from \"@internal/framework-components/control\";\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 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, expander threaded, 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 fullExpected = contractToPostgresDatabaseSchemaNode(postgresContract, {\n\t\tannotationNamespace: \"pg\",\n\t\t...ifDefined(\"expandNativeType\", buildNativeTypeExpander(input.frameworkComponents)),\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 (expander threaded, 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 fullExpected = contractToPostgresDatabaseSchemaNode(postgresContract, {\n\t\tannotationNamespace: \"pg\",\n\t\t...ifDefined(\"expandNativeType\", buildNativeTypeExpander(input.frameworkComponents)),\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-B27W13mM.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,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;;;;;;;;;;;;;;;;;;;;;AAq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,qCAAqC,kBAAkB;EAC3E,qBAAqB;EACrB,GAAG,UAAU,oBAAoB,wBAAwB,MAAM,mBAAmB,CAAC;EACnF,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"}
|
package/dist/driver.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { t as PostgresControlDriver } from "./control-DzK5mSLo.mjs";
|
|
2
|
-
import { n as suppressIdleConnectionErrors } from "./runtime-
|
|
2
|
+
import { n as suppressIdleConnectionErrors } from "./runtime-BJrfP1e8.mjs";
|
|
3
3
|
export { PostgresControlDriver, suppressIdleConnectionErrors };
|
package/dist/driver__runtime.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as suppressIdleConnectionErrors, t as postgresRuntimeDriverDescriptor } from "./runtime-
|
|
1
|
+
import { n as suppressIdleConnectionErrors, t as postgresRuntimeDriverDescriptor } from "./runtime-BJrfP1e8.mjs";
|
|
2
2
|
export { postgresRuntimeDriverDescriptor as default, suppressIdleConnectionErrors };
|
|
@@ -2,7 +2,7 @@ import { StructuredError, StructuredErrorOptions } from "@prisma/orm-framework/u
|
|
|
2
2
|
import { CliStructuredError } from "@prisma/orm-framework/errors/control";
|
|
3
3
|
//#region ../../../3-targets/3-targets/postgres/dist/errors.d.mts
|
|
4
4
|
//#region src/core/errors.d.ts
|
|
5
|
-
type PostgresTargetErrorCode = 'CONTRACT.CODEC_DESCRIPTOR_MISSING' | 'CONTRACT.DEFAULT_INVALID' | 'CONTRACT.ENTITY_KIND_INVALID' | 'CONTRACT.IDENTIFIER_INVALID' | 'CONTRACT.INDEX_INVALID' | 'CONTRACT.INFER_UNSUPPORTED' | 'CONTRACT.MODEL_UNKNOWN' | 'CONTRACT.NAME_DUPLICATE' | 'CONTRACT.NATIVE_TYPE_INVALID' | 'CONTRACT.PACK_CONTRIBUTION_INVALID' | 'CONTRACT.POLICY_INVALID' | 'CONTRACT.ROLE_INVALID' | 'MIGRATION.CONTRACT_SPACE_VIOLATION' | 'MIGRATION.POSTGRES_CONTROL_STACK_MISSING' | 'MIGRATION.TARGET_MISMATCH' | 'RUNTIME.DECODE_FAILED' | 'RUNTIME.ENCODE_FAILED' | 'RUNTIME.TYPE_PARAMS_INVALID';
|
|
5
|
+
type PostgresTargetErrorCode = 'CONTRACT.CODEC_DESCRIPTOR_MISSING' | 'CONTRACT.DEFAULT_INVALID' | 'CONTRACT.ENTITY_KIND_INVALID' | 'CONTRACT.IDENTIFIER_INVALID' | 'CONTRACT.INDEX_INVALID' | 'CONTRACT.INFER_UNSUPPORTED' | 'CONTRACT.MODEL_UNKNOWN' | 'CONTRACT.NAME_DUPLICATE' | 'CONTRACT.NATIVE_TYPE_INVALID' | 'CONTRACT.PACK_CONTRIBUTION_INVALID' | 'CONTRACT.POLICY_INVALID' | 'CONTRACT.ROLE_INVALID' | 'MIGRATION.CONTRACT_SPACE_VIOLATION' | 'MIGRATION.POSTGRES_CONTROL_STACK_MISSING' | 'MIGRATION.TARGET_MISMATCH' | 'RUNTIME.DECODE_FAILED' | 'RUNTIME.ENCODE_FAILED' | 'RUNTIME.TEMPORAL_UNAVAILABLE' | 'RUNTIME.TYPE_PARAMS_INVALID';
|
|
6
6
|
declare function postgresError(code: PostgresTargetErrorCode, message: string, options?: StructuredErrorOptions): StructuredError;
|
|
7
7
|
/**
|
|
8
8
|
* A `PostgresMigration` operation that needs the materialized control adapter
|
|
@@ -29,4 +29,4 @@ declare function postgresError(code: PostgresTargetErrorCode, message: string, o
|
|
|
29
29
|
declare function errorPostgresMigrationStackMissing(operation: string): CliStructuredError;
|
|
30
30
|
//#endregion
|
|
31
31
|
export { postgresError as n, errorPostgresMigrationStackMissing as t };
|
|
32
|
-
//# sourceMappingURL=errors-
|
|
32
|
+
//# sourceMappingURL=errors-5fMq0U66.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors-
|
|
1
|
+
{"version":3,"file":"errors-5fMq0U66.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/errors.d.mts"],"mappings":";;;;KAGK;iBACY,cAAc,MAAM,yBAAyB,iBAAiB,UAAU,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;iBAuBjG,mCAAmC,oBAAoB"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
2
|
+
import { CliStructuredError } from "@prisma/orm-framework/errors/control";
|
|
3
|
+
//#region ../../../3-targets/3-targets/postgres/dist/errors-DYyzTYzE.mjs
|
|
4
|
+
function postgresError(code, message, options) {
|
|
5
|
+
return structuredError(code, message, options);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A `PostgresMigration` operation that needs the materialized control adapter
|
|
9
|
+
* — named by `operation` (e.g. `createTable`, `dropColumn`, `dataTransform`) —
|
|
10
|
+
* was invoked, but the migration was constructed without a `ControlStack`.
|
|
11
|
+
* Concrete authoring usage always goes through the migration CLI entrypoint,
|
|
12
|
+
* which assembles a stack from the loaded `prisma.config.ts`; reaching this
|
|
13
|
+
* error means a test fixture or ad-hoc consumer instantiated `PostgresMigration`
|
|
14
|
+
* with the no-arg form (legal for `operations` / `describe` introspection only).
|
|
15
|
+
*
|
|
16
|
+
* The `operation` argument is required so every throw site names the operation
|
|
17
|
+
* that actually failed; a new operation cannot inherit a misattributed message.
|
|
18
|
+
*
|
|
19
|
+
* Distinct from `MIGRATION.UNFILLED_PLACEHOLDER` (placeholder not filled)
|
|
20
|
+
* and `MIGRATION.DATA_TRANSFORM_CONTRACT_MISMATCH` (data-transform query
|
|
21
|
+
* plan against wrong contract) because the missing input is the stack
|
|
22
|
+
* itself, not the per-operation contract.
|
|
23
|
+
*
|
|
24
|
+
* Lives in `@internal/target-postgres/errors` rather than the shared
|
|
25
|
+
* framework migration errors module because the failure is target-specific:
|
|
26
|
+
* the contract it talks about (`PostgresMigration`, the Postgres control
|
|
27
|
+
* adapter, the Postgres-target stack) only exists in this package.
|
|
28
|
+
*/
|
|
29
|
+
function errorPostgresMigrationStackMissing(operation) {
|
|
30
|
+
return new CliStructuredError("MIGRATION.POSTGRES_CONTROL_STACK_MISSING", `PostgresMigration.${operation} requires a control adapter`, {
|
|
31
|
+
why: `PostgresMigration.${operation} was invoked on an instance constructed without a ControlStack, so the stored controlAdapter is undefined and the operation cannot lower its plan.`,
|
|
32
|
+
fix: "Construct the migration via the migration CLI entrypoint (which assembles a ControlStack from the loaded prisma.config.ts), or pass a ControlStack containing a Postgres adapter to the migration constructor in test fixtures.",
|
|
33
|
+
meta: { operation }
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function errorTemporalUnavailable(codecId, operation) {
|
|
37
|
+
return postgresError("RUNTIME.TEMPORAL_UNAVAILABLE", `Codec '${codecId}' cannot ${operation} a value because this runtime has no global Temporal implementation.`, {
|
|
38
|
+
why: "Temporal-backed codecs read and write their values through the global Temporal API, which this runtime does not provide.",
|
|
39
|
+
fix: "Run on a runtime with Temporal available, install a Temporal polyfill before creating the client, or author the column with its *String type to read and write PostgreSQL's own text instead.",
|
|
40
|
+
meta: {
|
|
41
|
+
codecId,
|
|
42
|
+
operation
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function errorTemporalUnavailableForDefault(generatorId) {
|
|
47
|
+
return postgresError("RUNTIME.TEMPORAL_UNAVAILABLE", `Mutation default generator '${generatorId}' cannot produce a value because this runtime has no global Temporal implementation.`, {
|
|
48
|
+
why: "The generator answers a Temporal-backed column, so the value it produces is a Temporal.Instant, which this runtime cannot construct.",
|
|
49
|
+
fix: "Run on a runtime with Temporal available, install a Temporal polyfill before creating the client, or author the column with `temporal.createdAtString()` / `temporal.updatedAtString()` to store PostgreSQL's own text instead.",
|
|
50
|
+
meta: { generatorId }
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function errorTemporalUnrepresentable(options) {
|
|
54
|
+
const { codecId, operation, stringType, value, detail } = options;
|
|
55
|
+
return postgresError(operation === "decode" ? "RUNTIME.DECODE_FAILED" : "RUNTIME.ENCODE_FAILED", `Codec '${codecId}' cannot represent the value ${operation === "decode" ? "PostgreSQL returned" : "the application supplied"}: ${JSON.stringify(value)} — ${detail}. Use ${stringType} to carry this column as PostgreSQL's own text.`, {
|
|
56
|
+
why: `${detail}. Temporal is the authoritative parser and range check for this codec, so a value it cannot express has no representation on this column.`,
|
|
57
|
+
fix: `Author the column as ${stringType} to read and write PostgreSQL's own text for it, which preserves every value the database accepts.`,
|
|
58
|
+
meta: {
|
|
59
|
+
codecId,
|
|
60
|
+
operation,
|
|
61
|
+
value,
|
|
62
|
+
stringType
|
|
63
|
+
},
|
|
64
|
+
...options.cause === void 0 ? {} : { cause: options.cause }
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function errorTemporalWrongType(codecId, temporalTag, stringType, received) {
|
|
68
|
+
return postgresError("RUNTIME.ENCODE_FAILED", `Codec '${codecId}' encodes a ${temporalTag}, but received ${received}.`, {
|
|
69
|
+
why: "The codec serializes through the Temporal value's own toString(). A different type reaches PostgreSQL in a spelling it does not accept, and the resulting error names the column rather than the codec.",
|
|
70
|
+
fix: `Pass a ${temporalTag}, or author the column with its ${stringType} type to write PostgreSQL text directly.`,
|
|
71
|
+
meta: {
|
|
72
|
+
codecId,
|
|
73
|
+
temporalTag,
|
|
74
|
+
stringType,
|
|
75
|
+
received
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function errorTemporalNonIsoCalendar(codecId, calendarId) {
|
|
80
|
+
return postgresError("RUNTIME.ENCODE_FAILED", `Codec '${codecId}' accepts only the iso8601 calendar, but the value carries '${calendarId}'.`, {
|
|
81
|
+
why: "PostgreSQL stores no calendar alongside a date, so a non-ISO calendar would be discarded on write and the value would read back as a different date than the one authored.",
|
|
82
|
+
fix: "Convert the value with .withCalendar(\"iso8601\") before writing if the ISO projection is what you mean to store.",
|
|
83
|
+
meta: {
|
|
84
|
+
codecId,
|
|
85
|
+
calendarId
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
export { errorTemporalUnrepresentable as a, errorTemporalUnavailableForDefault as i, errorTemporalNonIsoCalendar as n, errorTemporalWrongType as o, errorTemporalUnavailable as r, postgresError as s, errorPostgresMigrationStackMissing as t };
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=errors-DYyzTYzE-39CV_aMo.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors-DYyzTYzE-39CV_aMo.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/errors-DYyzTYzE.mjs"],"sourcesContent":["import { structuredError } from \"@internal/utils/structured-error\";\nimport { CliStructuredError } from \"@internal/errors/control\";\n//#region src/core/errors.ts\nfunction postgresError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n/**\n* A `PostgresMigration` operation that needs the materialized control adapter\n* — named by `operation` (e.g. `createTable`, `dropColumn`, `dataTransform`) —\n* was invoked, but the migration was constructed without a `ControlStack`.\n* Concrete authoring usage always goes through the migration CLI entrypoint,\n* which assembles a stack from the loaded `prisma.config.ts`; reaching this\n* error means a test fixture or ad-hoc consumer instantiated `PostgresMigration`\n* with the no-arg form (legal for `operations` / `describe` introspection only).\n*\n* The `operation` argument is required so every throw site names the operation\n* that actually failed; a new operation cannot inherit a misattributed message.\n*\n* Distinct from `MIGRATION.UNFILLED_PLACEHOLDER` (placeholder not filled)\n* and `MIGRATION.DATA_TRANSFORM_CONTRACT_MISMATCH` (data-transform query\n* plan against wrong contract) because the missing input is the stack\n* itself, not the per-operation contract.\n*\n* Lives in `@internal/target-postgres/errors` rather than the shared\n* framework migration errors module because the failure is target-specific:\n* the contract it talks about (`PostgresMigration`, the Postgres control\n* adapter, the Postgres-target stack) only exists in this package.\n*/\nfunction errorPostgresMigrationStackMissing(operation) {\n\treturn new CliStructuredError(\"MIGRATION.POSTGRES_CONTROL_STACK_MISSING\", `PostgresMigration.${operation} requires a control adapter`, {\n\t\twhy: `PostgresMigration.${operation} was invoked on an instance constructed without a ControlStack, so the stored controlAdapter is undefined and the operation cannot lower its plan.`,\n\t\tfix: \"Construct the migration via the migration CLI entrypoint (which assembles a ControlStack from the loaded prisma.config.ts), or pass a ControlStack containing a Postgres adapter to the migration constructor in test fixtures.\",\n\t\tmeta: { operation }\n\t});\n}\nfunction errorTemporalUnavailable(codecId, operation) {\n\treturn postgresError(\"RUNTIME.TEMPORAL_UNAVAILABLE\", `Codec '${codecId}' cannot ${operation} a value because this runtime has no global Temporal implementation.`, {\n\t\twhy: \"Temporal-backed codecs read and write their values through the global Temporal API, which this runtime does not provide.\",\n\t\tfix: \"Run on a runtime with Temporal available, install a Temporal polyfill before creating the client, or author the column with its *String type to read and write PostgreSQL's own text instead.\",\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\toperation\n\t\t}\n\t});\n}\nfunction errorTemporalUnavailableForDefault(generatorId) {\n\treturn postgresError(\"RUNTIME.TEMPORAL_UNAVAILABLE\", `Mutation default generator '${generatorId}' cannot produce a value because this runtime has no global Temporal implementation.`, {\n\t\twhy: \"The generator answers a Temporal-backed column, so the value it produces is a Temporal.Instant, which this runtime cannot construct.\",\n\t\tfix: \"Run on a runtime with Temporal available, install a Temporal polyfill before creating the client, or author the column with `temporal.createdAtString()` / `temporal.updatedAtString()` to store PostgreSQL's own text instead.\",\n\t\tmeta: { generatorId }\n\t});\n}\nfunction errorTemporalUnrepresentable(options) {\n\tconst { codecId, operation, stringType, value, detail } = options;\n\treturn postgresError(operation === \"decode\" ? \"RUNTIME.DECODE_FAILED\" : \"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' cannot represent the value ${operation === \"decode\" ? \"PostgreSQL returned\" : \"the application supplied\"}: ${JSON.stringify(value)} — ${detail}. Use ${stringType} to carry this column as PostgreSQL's own text.`, {\n\t\twhy: `${detail}. Temporal is the authoritative parser and range check for this codec, so a value it cannot express has no representation on this column.`,\n\t\tfix: `Author the column as ${stringType} to read and write PostgreSQL's own text for it, which preserves every value the database accepts.`,\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\toperation,\n\t\t\tvalue,\n\t\t\tstringType\n\t\t},\n\t\t...options.cause === void 0 ? {} : { cause: options.cause }\n\t});\n}\nfunction errorTemporalWrongType(codecId, temporalTag, stringType, received) {\n\treturn postgresError(\"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' encodes a ${temporalTag}, but received ${received}.`, {\n\t\twhy: \"The codec serializes through the Temporal value's own toString(). A different type reaches PostgreSQL in a spelling it does not accept, and the resulting error names the column rather than the codec.\",\n\t\tfix: `Pass a ${temporalTag}, or author the column with its ${stringType} type to write PostgreSQL text directly.`,\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\ttemporalTag,\n\t\t\tstringType,\n\t\t\treceived\n\t\t}\n\t});\n}\nfunction errorTemporalNonIsoCalendar(codecId, calendarId) {\n\treturn postgresError(\"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' accepts only the iso8601 calendar, but the value carries '${calendarId}'.`, {\n\t\twhy: \"PostgreSQL stores no calendar alongside a date, so a non-ISO calendar would be discarded on write and the value would read back as a different date than the one authored.\",\n\t\tfix: \"Convert the value with .withCalendar(\\\"iso8601\\\") before writing if the ISO projection is what you mean to store.\",\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\tcalendarId\n\t\t}\n\t});\n}\n//#endregion\nexport { errorTemporalUnrepresentable as a, errorTemporalUnavailableForDefault as i, errorTemporalNonIsoCalendar as n, errorTemporalWrongType as o, errorTemporalUnavailable as r, postgresError as s, errorPostgresMigrationStackMissing as t };\n\n//# sourceMappingURL=errors-DYyzTYzE.mjs.map"],"mappings":";;;AAGA,SAAS,cAAc,MAAM,SAAS,SAAS;CAC9C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAS,mCAAmC,WAAW;CACtD,OAAO,IAAI,mBAAmB,4CAA4C,qBAAqB,UAAU,8BAA8B;EACtI,KAAK,qBAAqB,UAAU;EACpC,KAAK;EACL,MAAM,EAAE,UAAU;CACnB,CAAC;AACF;AACA,SAAS,yBAAyB,SAAS,WAAW;CACrD,OAAO,cAAc,gCAAgC,UAAU,QAAQ,WAAW,UAAU,uEAAuE;EAClK,KAAK;EACL,KAAK;EACL,MAAM;GACL;GACA;EACD;CACD,CAAC;AACF;AACA,SAAS,mCAAmC,aAAa;CACxD,OAAO,cAAc,gCAAgC,+BAA+B,YAAY,uFAAuF;EACtL,KAAK;EACL,KAAK;EACL,MAAM,EAAE,YAAY;CACrB,CAAC;AACF;AACA,SAAS,6BAA6B,SAAS;CAC9C,MAAM,EAAE,SAAS,WAAW,YAAY,OAAO,WAAW;CAC1D,OAAO,cAAc,cAAc,WAAW,0BAA0B,yBAAyB,UAAU,QAAQ,+BAA+B,cAAc,WAAW,wBAAwB,2BAA2B,IAAI,KAAK,UAAU,KAAK,EAAE,KAAK,OAAO,QAAQ,WAAW,kDAAkD;EACxU,KAAK,GAAG,OAAO;EACf,KAAK,wBAAwB,WAAW;EACxC,MAAM;GACL;GACA;GACA;GACA;EACD;EACA,GAAG,QAAQ,UAAU,KAAK,IAAI,CAAC,IAAI,EAAE,OAAO,QAAQ,MAAM;CAC3D,CAAC;AACF;AACA,SAAS,uBAAuB,SAAS,aAAa,YAAY,UAAU;CAC3E,OAAO,cAAc,yBAAyB,UAAU,QAAQ,cAAc,YAAY,iBAAiB,SAAS,IAAI;EACvH,KAAK;EACL,KAAK,UAAU,YAAY,kCAAkC,WAAW;EACxE,MAAM;GACL;GACA;GACA;GACA;EACD;CACD,CAAC;AACF;AACA,SAAS,4BAA4B,SAAS,YAAY;CACzD,OAAO,cAAc,yBAAyB,UAAU,QAAQ,8DAA8D,WAAW,KAAK;EAC7I,KAAK;EACL,KAAK;EACL,MAAM;GACL;GACA;EACD;CACD,CAAC;AACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MutationDefaultGeneratorDescriptor } from "@prisma/orm-framework/components/control";
|
|
2
|
+
//#region ../../../3-targets/3-targets/postgres/dist/instant-now-generator-lJQqn_8K.d.mts
|
|
3
|
+
//#region src/core/instant-now-generator.d.ts
|
|
4
|
+
declare const INSTANT_NOW_GENERATOR_ID: "instantNow";
|
|
5
|
+
declare function instantNowControlDescriptor(): MutationDefaultGeneratorDescriptor;
|
|
6
|
+
declare function instantNow(): Temporal.Instant;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { instantNow as n, instantNowControlDescriptor as r, INSTANT_NOW_GENERATOR_ID as t };
|
|
9
|
+
//# sourceMappingURL=instant-now-generator-lJQqn_8K-JOzseqXI.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instant-now-generator-lJQqn_8K-JOzseqXI.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/instant-now-generator-lJQqn_8K.d.mts"],"mappings":";;;cAEc;iBACG,+BAA+B;iBAC/B,cAAc,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-PTHAY9Cv.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/migration.mjs"],"sourcesContent":["import { I as createExtension } from \"./op-factory-call-
|
|
1
|
+
{"version":3,"file":"migration-PTHAY9Cv.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/migration.mjs"],"sourcesContent":["import { I as createExtension } from \"./op-factory-call-CSkQdszU.mjs\";\nimport { t as dataTransform } from \"./data-transform-ChZzy2dP.mjs\";\nimport { t as PostgresMigration } from \"./postgres-migration-DHvU3Jkt.mjs\";\nimport { checkExpression, col, fn, foreignKey, lit, primaryKey, unique } from \"@internal/sql-relational-core/contract-free\";\nimport { placeholder } from \"@internal/errors/migration\";\nimport { MigrationCLI } from \"@internal/cli/migration-cli\";\n//#region src/core/migrations/operations/raw.ts\n/**\n* Identity factory for an already-materialized `SqlMigrationPlanOperation`.\n*\n* The planner uses this via `liftOpToCall` to carry ops produced by SQL\n* family methods, codec control hooks, and component database dependencies\n* alongside migration IR without reverse-engineering them. Users writing\n* raw migrations can pass a full op shape directly — typically built by\n* composing SQL family helpers — to author a migration that bypasses the\n* structured call classes.\n*/\nfunction rawSql(op) {\n\treturn op;\n}\n//#endregion\nexport { PostgresMigration as Migration, MigrationCLI, checkExpression, col, createExtension, dataTransform, fn, foreignKey, lit, placeholder, primaryKey, rawSql, unique };\n\n//# sourceMappingURL=migration.mjs.map"],"mappings":";;;;;;;;;;;;;;AAiBA,SAAS,OAAO,IAAI;CACnB,OAAO;AACR"}
|
package/dist/{op-factory-call-H6zeDGLe-_1pAftJk.mjs → op-factory-call-CSkQdszU-C43tr0rP.mjs}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as postgresError } from "./errors-DYyzTYzE-39CV_aMo.mjs";
|
|
2
2
|
import { t as DEFAULT_NAMESPACE_ID } from "./namespace-ids-xtp_ZY86-Cpp8PTxD.mjs";
|
|
3
|
-
import { a as validateEnumValueLength, i as quoteQualifiedName, r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-
|
|
4
|
-
import { C as nativeEnumValueExistsAst, D as tableExistsAst, E as rlsPolicyExistsAst, O as tableIsEmptyAst, S as nativeEnumTypeExistsAst, T as rlsEnabledAst, _ as dropIndex$1, a as columnDefaultAst, b as extensionExistsAst, c as columnTypeAst, d as createPolicy, f as createSchema, g as dropDefaultAction, h as disableRowLevelSecurity$1, i as alterTable, l as constraintExistsAst, m as createType, n as alterIndexRename, o as columnExistsAst, p as createTable, r as alterPolicyRename, s as columnNullabilityAst, t as addColumnAction, u as createIndex$1, v as dropPolicy, w as noNullValuesAst, x as indexExistsAst, y as dropType } from "./ddl-
|
|
5
|
-
import { n as qualifyTableName } from "./planner-sql-checks-
|
|
6
|
-
import { n as buildColumnTypeSql } from "./planner-ddl-builders-
|
|
3
|
+
import { a as validateEnumValueLength, i as quoteQualifiedName, r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-6j9YTLpr-BCyCBPBg.mjs";
|
|
4
|
+
import { C as nativeEnumValueExistsAst, D as tableExistsAst, E as rlsPolicyExistsAst, O as tableIsEmptyAst, S as nativeEnumTypeExistsAst, T as rlsEnabledAst, _ as dropIndex$1, a as columnDefaultAst, b as extensionExistsAst, c as columnTypeAst, d as createPolicy, f as createSchema, g as dropDefaultAction, h as disableRowLevelSecurity$1, i as alterTable, l as constraintExistsAst, m as createType, n as alterIndexRename, o as columnExistsAst, p as createTable, r as alterPolicyRename, s as columnNullabilityAst, t as addColumnAction, u as createIndex$1, v as dropPolicy, w as noNullValuesAst, x as indexExistsAst, y as dropType } from "./ddl-GXbCrKp_-CBKFkq1r.mjs";
|
|
5
|
+
import { n as qualifyTableName } from "./planner-sql-checks-Bcngv5YZ-Dnp05hSM.mjs";
|
|
6
|
+
import { n as buildColumnTypeSql } from "./planner-ddl-builders-CsfmnnKR-CNn0fLyx.mjs";
|
|
7
7
|
import { FunctionColumnDefault, LiteralColumnDefault } from "@prisma/orm-family-sql/relational-core/ast";
|
|
8
8
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
9
9
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
@@ -14,7 +14,7 @@ import { InternalError, assertNever } from "@prisma/orm-framework/utils/internal
|
|
|
14
14
|
import { errorUnfilledPlaceholder } from "@prisma/orm-framework/errors/migration";
|
|
15
15
|
import { TsExpression, jsonToTsSource } from "@prisma/orm-framework/ts-render";
|
|
16
16
|
import { REFERENTIAL_ACTION_SQL } from "@prisma/orm-family-sql/contract/referential-action-sql";
|
|
17
|
-
//#region ../../../3-targets/3-targets/postgres/dist/op-factory-call-
|
|
17
|
+
//#region ../../../3-targets/3-targets/postgres/dist/op-factory-call-CSkQdszU.mjs
|
|
18
18
|
/**
|
|
19
19
|
* Maps a planner schema name to the contract-free DDL builder's optional
|
|
20
20
|
* `schema` field: the unbound sentinel becomes `undefined` (the builder omits
|
|
@@ -2059,4 +2059,4 @@ var RenamePostgresRlsPolicyCall = class extends PostgresOpFactoryCallNode {
|
|
|
2059
2059
|
//#endregion
|
|
2060
2060
|
export { RenameIndexCall as A, DropNativeEnumTypeCall as C, EnableRowLevelSecurityCall as D, DropTableCall as E, createExtension as F, installExtension as I, postgresDefaultToDdlColumnDefault as L, SetDefaultCall as M, SetNotNullCall as N, RawSqlCall as O, buildTargetDetails as P, DropIndexCall as S, DropPostgresRlsPolicyCall as T, DisableRowLevelSecurityCall as _, AddNotNullColumnDirectCall as a, DropConstraintCall as b, AddUniqueCall as c, CreateIndexCall as d, CreateNativeEnumTypeCall as f, DataTransformCall as g, CreateTableCall as h, AddNativeEnumValueCall as i, RenamePostgresRlsPolicyCall as j, RenameCheckConstraintCall as k, AlterColumnTypeCall as l, CreateSchemaCall as m, AddColumnCall as n, AddNotNullColumnWithTempDefaultCall as o, CreatePostgresRlsPolicyCall as p, AddForeignKeyCall as r, AddPrimaryKeyCall as s, AddCheckConstraintCall as t, CreateExtensionCall as u, DropCheckConstraintCall as v, DropNotNullCall as w, DropDefaultCall as x, DropColumnCall as y };
|
|
2061
2061
|
|
|
2062
|
-
//# sourceMappingURL=op-factory-call-
|
|
2062
|
+
//# sourceMappingURL=op-factory-call-CSkQdszU-C43tr0rP.mjs.map
|