@prisma/orm-target-postgres 8.0.0-rc.1-dev.46 → 8.0.0-rc.10-dev.1
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/README.md +1 -5
- package/dist/{adapter-B0xsc80z-sYcF0RVF.mjs → adapter-BO4-D_sb-Dv6OpO1E.mjs} +4 -4
- package/dist/{adapter-B0xsc80z-sYcF0RVF.mjs.map → adapter-BO4-D_sb-Dv6OpO1E.mjs.map} +1 -1
- package/dist/{adapter-CPesdzv0.d.mts → adapter-BQrsKoUs.d.mts} +2 -2
- package/dist/{adapter-CPesdzv0.d.mts.map → adapter-BQrsKoUs.d.mts.map} +1 -1
- package/dist/adapter.d.mts +8 -8
- package/dist/adapter.mjs +6 -6
- package/dist/adapter__adapter.d.mts +1 -1
- 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.d.mts +1 -1
- package/dist/adapter__control.mjs +78 -12
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.d.mts +1 -1
- package/dist/adapter__runtime.mjs +23 -14
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/adapter__sql-renderer.d.mts +1 -1
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/adapter__types.d.mts +2 -2
- 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-Dm1jBKhq-i8FD48I-.mjs} +84 -48
- package/dist/authoring-Dm1jBKhq-i8FD48I-.mjs.map +1 -0
- package/dist/{check-expressions-DRgG8RN5-DiA-22aC.d.mts → check-expressions-D4R7JhiZ-q-dFPGT2.d.mts} +7 -9
- package/dist/check-expressions-D4R7JhiZ-q-dFPGT2.d.mts.map +1 -0
- package/dist/{check-expressions-5vhxWaFy-CBcjFeur.mjs → check-expressions-DFTeR0rd-CSxSpyMV.mjs} +14 -11
- package/dist/check-expressions-DFTeR0rd-CSxSpyMV.mjs.map +1 -0
- 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-Drq2rquV.mjs → control-BF220oqr.mjs} +82 -24
- package/dist/control-BF220oqr.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-Y6FxMu3o.mjs → control-DzK5mSLo.mjs} +3 -3
- package/dist/control-DzK5mSLo.mjs.map +1 -0
- package/dist/{control-adapter-DFr4gS-r-DM3KcZdQ.mjs → control-adapter-BM70RkWS-kIC873DD.mjs} +21 -10
- package/dist/control-adapter-BM70RkWS-kIC873DD.mjs.map +1 -0
- package/dist/{control-policy-B53lnBCT-B9K9Cj1x.mjs → control-policy-BN8Ouun3-BtGYeb4f.mjs} +7 -7
- package/dist/control-policy-BN8Ouun3-BtGYeb4f.mjs.map +1 -0
- package/dist/{control-DLTOAEHj.d.mts → control-xdW1bgaP.d.mts} +3 -3
- package/dist/{control-DLTOAEHj.d.mts.map → control-xdW1bgaP.d.mts.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-rilAH3ep-dAmiVLpe.mjs → descriptor-meta-D41CePyY-B0L9RIgT.mjs} +7 -6
- package/dist/descriptor-meta-D41CePyY-B0L9RIgT.mjs.map +1 -0
- package/dist/{descriptor-meta-KVX21fsl-DBDoB4eg.mjs → descriptor-meta-zQNj82MZ-CDwEiYdj.mjs} +50 -21
- package/dist/descriptor-meta-zQNj82MZ-CDwEiYdj.mjs.map +1 -0
- package/dist/{diff-database-schema-DKq76rCk-uehceHYz.mjs → diff-database-schema-C9UxdmYu-BzQjQb1e.mjs} +6 -6
- package/dist/{diff-database-schema-DKq76rCk-uehceHYz.mjs.map → diff-database-schema-C9UxdmYu-BzQjQb1e.mjs.map} +1 -1
- package/dist/driver.d.mts +2 -2
- package/dist/driver.mjs +3 -2
- package/dist/driver__control.mjs +1 -1
- package/dist/driver__runtime.d.mts +2 -2
- package/dist/driver__runtime.mjs +2 -639
- 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-BByvVlUw.d.mts} +177 -13
- package/dist/pack-BByvVlUw.d.mts.map +1 -0
- package/dist/{planner-D0uogzvT-1WyGIC5p.mjs → planner-DtwSy6w3--x0IvtI9.mjs} +8 -8
- package/dist/{planner-D0uogzvT-1WyGIC5p.mjs.map → planner-DtwSy6w3--x0IvtI9.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-BResV739-meZQaWcU.mjs} +4 -4
- package/dist/{planner-produced-postgres-migration-D5m8nK6s-CbZ4hlbv.mjs.map → planner-produced-postgres-migration-BResV739-meZQaWcU.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-dWcpuV6T-CJPsHGox.mjs} +5 -5
- package/dist/{postgres-contract-view-B8ykf2cO-T2LvWVFZ.mjs.map → postgres-contract-view-dWcpuV6T-CJPsHGox.mjs.map} +1 -1
- package/dist/{postgres-migration-Dbq3RGfZ-aMnwfEAb.mjs → postgres-migration-DRKw86P7-C1eWF86n.mjs} +6 -6
- package/dist/{postgres-migration-Dbq3RGfZ-aMnwfEAb.mjs.map → postgres-migration-DRKw86P7-C1eWF86n.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-DOXznQe0.d.mts → runtime-BdRKoWQu.d.mts} +2 -2
- package/dist/{runtime-DOXznQe0.d.mts.map → runtime-BdRKoWQu.d.mts.map} +1 -1
- package/dist/runtime-Di_BFzUC.mjs +685 -0
- package/dist/runtime-Di_BFzUC.mjs.map +1 -0
- package/dist/{runtime-lHBKgjB9.d.mts → runtime-DtoNQntj.d.mts} +3 -2
- package/dist/runtime-DtoNQntj.d.mts.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-BgC0ZgLS.d.mts → sql-renderer-Cshx9dNa.d.mts} +2 -2
- package/dist/{sql-renderer-BgC0ZgLS.d.mts.map → sql-renderer-Cshx9dNa.d.mts.map} +1 -1
- package/dist/{sql-renderer-ComgusFq-BBlqM1fw.mjs → sql-renderer-DMMtw8lD-K9zLsg-g.mjs} +8 -75
- package/dist/sql-renderer-DMMtw8lD-K9zLsg-g.mjs.map +1 -0
- 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 +14 -13
- 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.d.mts +2 -2
- package/dist/target__types.mjs +2 -2
- package/dist/{types-CjGjPLr5.d.mts → types-B4IkFolc.d.mts} +2 -2
- package/dist/{types-CjGjPLr5.d.mts.map → types-B4IkFolc.d.mts.map} +1 -1
- package/dist/types-C7BEZmFD.d.mts +1 -0
- package/dist/{types-CkryN1AS-BcQRGsDn.d.mts → types-CkryN1AS-CZtzRJFZ.d.mts} +2 -2
- package/dist/{types-CkryN1AS-BcQRGsDn.d.mts.map → types-CkryN1AS-CZtzRJFZ.d.mts.map} +1 -1
- package/package.json +13 -12
- package/dist/aggregates-Dh6HPdvC.mjs.map +0 -1
- package/dist/authoring-BOpdZa2N-ClrLFiXw.mjs.map +0 -1
- package/dist/check-expressions-5vhxWaFy-CBcjFeur.mjs.map +0 -1
- package/dist/check-expressions-DRgG8RN5-DiA-22aC.d.mts.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-Drq2rquV.mjs.map +0 -1
- package/dist/control-Y6FxMu3o.mjs.map +0 -1
- package/dist/control-adapter-DFr4gS-r-DM3KcZdQ.mjs.map +0 -1
- package/dist/control-policy-B53lnBCT-B9K9Cj1x.mjs.map +0 -1
- package/dist/descriptor-meta-KVX21fsl-DBDoB4eg.mjs.map +0 -1
- package/dist/descriptor-meta-rilAH3ep-dAmiVLpe.mjs.map +0 -1
- package/dist/driver__runtime.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-_TfO66h5.d.mts.map +0 -1
- package/dist/runtime-lHBKgjB9.d.mts.map +0 -1
- package/dist/sql-renderer-ComgusFq-BBlqM1fw.mjs.map +0 -1
- package/dist/types-B-4d5_4a.d.mts +0 -1
|
@@ -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-DRKw86P7.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
|