@prisma/orm-target-sqlite 8.0.0-rc.22-dev.4 → 8.0.0-rc.22-dev.5
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 +2 -0
- package/dist/{adapter-BHJEOmT6.d.mts → adapter-etFmhVd4.d.mts} +7 -7
- package/dist/{adapter-BHJEOmT6.d.mts.map → adapter-etFmhVd4.d.mts.map} +1 -1
- package/dist/{adapter-Cff01Cgi-C19Fhc2M.mjs → adapter-gpb0ICA2-DPjB1dMR.mjs} +21 -11
- package/dist/adapter-gpb0ICA2-DPjB1dMR.mjs.map +1 -0
- package/dist/{adapter-xFPDhkod-BsdLsy9N.d.mts → adapter-xFPDhkod-Cio6up_5.d.mts} +3 -3
- package/dist/{adapter-xFPDhkod-BsdLsy9N.d.mts.map → adapter-xFPDhkod-Cio6up_5.d.mts.map} +1 -1
- package/dist/adapter.d.mts +11 -11
- package/dist/adapter.mjs +6 -6
- package/dist/adapter__adapter.d.mts +2 -2
- package/dist/adapter__adapter.mjs +2 -2
- package/dist/adapter__codec-types.d.mts +3 -3
- package/dist/adapter__column-types.d.mts +1 -1
- package/dist/adapter__column-types.mjs +1 -1
- package/dist/adapter__control.d.mts +3 -3
- package/dist/adapter__control.mjs +5 -5
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.d.mts +1 -1
- package/dist/adapter__runtime.mjs +22 -13
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/adapter__sql-renderer.d.mts +2 -2
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/adapter__types.d.mts +2 -2
- package/dist/{aggregates-CDMoiy_Z.d.mts → aggregates-Bee9csBL.d.mts} +6 -6
- package/dist/{aggregates-CDMoiy_Z.d.mts.map → aggregates-Bee9csBL.d.mts.map} +1 -1
- package/dist/{aggregates-D5fuFVMC.mjs → aggregates-DMvLJFlR.mjs} +9 -3
- package/dist/aggregates-DMvLJFlR.mjs.map +1 -0
- package/dist/codec-ids-9Fs9p6ST.d.mts +1 -0
- package/dist/codec-ids-BElbEYb_-CeWfv5bC.d.mts +21 -0
- package/dist/codec-ids-BElbEYb_-CeWfv5bC.d.mts.map +1 -0
- package/dist/codec-ids-BHBFCNsQ-C1Af_LGF.mjs +21 -0
- package/dist/codec-ids-BHBFCNsQ-C1Af_LGF.mjs.map +1 -0
- package/dist/codec-types-BQCSRfvR.d.mts +1 -0
- package/dist/{codec-types-COh75Bop-CUehAexc.d.mts → codec-types-CG5ZkqDU-DCx8ZvBg.d.mts} +10 -3
- package/dist/codec-types-CG5ZkqDU-DCx8ZvBg.d.mts.map +1 -0
- package/dist/codec-types-YpVaNlY0.d.mts +2 -0
- package/dist/{codecs-BJYruC-a-BKDGae3k.d.mts → codecs-BqOj4EKm-BaGeNd2m.d.mts} +127 -4
- package/dist/codecs-BqOj4EKm-BaGeNd2m.d.mts.map +1 -0
- package/dist/codecs-DzkRnjjE.d.mts +1 -0
- package/dist/{codecs-yZoH21Yj-lQXtGlEq.mjs → codecs-My4bmOU6-D4-b5qLd.mjs} +350 -22
- package/dist/codecs-My4bmOU6-D4-b5qLd.mjs.map +1 -0
- package/dist/{codecs-g-YI3BtK.mjs → codecs-R3kGRyq2.mjs} +2 -2
- package/dist/codecs-R3kGRyq2.mjs.map +1 -0
- package/dist/{column-types-Dxm0BpPv.d.mts → column-types-bTPNfz46.d.mts} +3 -3
- package/dist/{column-types-Dxm0BpPv.d.mts.map → column-types-bTPNfz46.d.mts.map} +1 -1
- package/dist/{column-types-DcbNOYVb.mjs → column-types-toYbR7mn.mjs} +2 -2
- package/dist/{column-types-DcbNOYVb.mjs.map → column-types-toYbR7mn.mjs.map} +1 -1
- package/dist/{contract-contributions-wweWdXMK-CN-d35Rj.mjs → contract-contributions-wweWdXMK-CwYZg4jC.mjs} +2 -2
- package/dist/{contract-contributions-wweWdXMK-CN-d35Rj.mjs.map → contract-contributions-wweWdXMK-CwYZg4jC.mjs.map} +1 -1
- package/dist/{contract-free-CYl1uzJ8.mjs → contract-free-BH73BZHy.mjs} +4 -4
- package/dist/{contract-free-CYl1uzJ8.mjs.map → contract-free-BH73BZHy.mjs.map} +1 -1
- package/dist/control-DGa_C2q6.d.mts +242 -0
- package/dist/control-DGa_C2q6.d.mts.map +1 -0
- package/dist/{control-VMpMSXk9.d.mts → control-DXzV_IVS.d.mts} +4 -4
- package/dist/{control-VMpMSXk9.d.mts.map → control-DXzV_IVS.d.mts.map} +1 -1
- package/dist/{data-type-entries-yQ-qYugg-C_NnX5WO.mjs → data-type-entries-Cp4hBeJB-DYer43by.mjs} +30 -3
- package/dist/data-type-entries-Cp4hBeJB-DYer43by.mjs.map +1 -0
- package/dist/{data-types-Dx3rHsbF.d.mts → data-types-CwpMoNK4.d.mts} +22 -2
- package/dist/data-types-CwpMoNK4.d.mts.map +1 -0
- package/dist/{data-types-coQrCWfS-yMCe4F52.mjs → data-types-DXMZNR8j-CWrJOA8C.mjs} +79 -4
- package/dist/data-types-DXMZNR8j-CWrJOA8C.mjs.map +1 -0
- package/dist/date-time-now-generators-T8JO6gR6-DBt5IyH5.mjs +64 -0
- package/dist/date-time-now-generators-T8JO6gR6-DBt5IyH5.mjs.map +1 -0
- package/dist/datetime-text-CbgLX4q3-BKp563Ja.mjs +32 -0
- package/dist/datetime-text-CbgLX4q3-BKp563Ja.mjs.map +1 -0
- package/dist/{ddl-BoTU7bCZ-CXNSFEtj.mjs → ddl-BvD-wVtg-BoEWa8CG.mjs} +3 -3
- package/dist/{ddl-BoTU7bCZ-CXNSFEtj.mjs.map → ddl-BvD-wVtg-BoEWa8CG.mjs.map} +1 -1
- package/dist/{default-normalizer-DGMXypHg-CPf7oyZA.mjs → default-normalizer-CsMhUEOe-CRieDElD.mjs} +23 -11
- package/dist/default-normalizer-CsMhUEOe-CRieDElD.mjs.map +1 -0
- package/dist/{default-normalizer-CkHy3JYk.d.mts → default-normalizer-CtNsZNRZ.d.mts} +3 -3
- package/dist/{default-normalizer-CkHy3JYk.d.mts.map → default-normalizer-CtNsZNRZ.d.mts.map} +1 -1
- package/dist/descriptor-meta-BwJWbIVt-B24ey04f.mjs +280 -0
- package/dist/descriptor-meta-BwJWbIVt-B24ey04f.mjs.map +1 -0
- package/dist/{descriptor-meta-DrNwC4vO-D7vuA6QK.mjs → descriptor-meta-DrNwC4vO-B9xeeDp9.mjs} +3 -3
- package/dist/{descriptor-meta-DrNwC4vO-D7vuA6QK.mjs.map → descriptor-meta-DrNwC4vO-B9xeeDp9.mjs.map} +1 -1
- package/dist/errors-D9vZNPSI-DoNmdfv7.mjs +105 -0
- package/dist/errors-D9vZNPSI-DoNmdfv7.mjs.map +1 -0
- package/dist/{migration-D0UlBTQw.mjs → migration-DYyfcQB_.mjs} +2 -2
- package/dist/{migration-D0UlBTQw.mjs.map → migration-DYyfcQB_.mjs.map} +1 -1
- package/dist/{op-factory-call-DADakw8V-yXzHuXlv.mjs → op-factory-call-BQYECylm-K7S_xgRS.mjs} +6 -6
- package/dist/{op-factory-call-DADakw8V-yXzHuXlv.mjs.map → op-factory-call-BQYECylm-K7S_xgRS.mjs.map} +1 -1
- package/dist/{pack-DqL_HWJX.d.mts → pack-CwFlRihn.d.mts} +179 -10
- package/dist/{pack-DqL_HWJX.d.mts.map → pack-CwFlRihn.d.mts.map} +1 -1
- package/dist/{planner-1zVd0jR2-mkF3bIWw.mjs → planner-DNwf8s8s-BoXZwpVs.mjs} +5 -5
- package/dist/{planner-1zVd0jR2-mkF3bIWw.mjs.map → planner-DNwf8s8s-BoXZwpVs.mjs.map} +1 -1
- package/dist/{planner-produced-sqlite-migration-Dgme3v9a-BzrIbSW_.mjs → planner-produced-sqlite-migration-Z9OWyjQn-DGMHz6I1.mjs} +4 -4
- package/dist/{planner-produced-sqlite-migration-Dgme3v9a-BzrIbSW_.mjs.map → planner-produced-sqlite-migration-Z9OWyjQn-DGMHz6I1.mjs.map} +1 -1
- package/dist/{render-ops-CwuscSzF-D3hoxOT_.mjs → render-ops-CJXrOY63-1y0nLsb8.mjs} +4 -4
- package/dist/{render-ops-CwuscSzF-D3hoxOT_.mjs.map → render-ops-CJXrOY63-1y0nLsb8.mjs.map} +1 -1
- package/dist/require-temporal-qbyZfPgl-DGJhYwmE.mjs +16 -0
- package/dist/require-temporal-qbyZfPgl-DGJhYwmE.mjs.map +1 -0
- package/dist/{runtime-YfPIbtO6.d.mts → runtime-BQKQH94p.d.mts} +2 -2
- package/dist/{runtime-YfPIbtO6.d.mts.map → runtime-BQKQH94p.d.mts.map} +1 -1
- package/dist/{runtime-CjIoI3sa.d.mts → runtime-ZsuC__oX.d.mts} +33 -2
- package/dist/runtime-ZsuC__oX.d.mts.map +1 -0
- package/dist/sql-renderer-CgY2Sghp.d.mts +1 -0
- package/dist/{sql-utils-XGT5Esi2-Zr2mqJf8.mjs → sql-utils-C9blmi9x-B90QedVA.mjs} +3 -3
- package/dist/{sql-utils-XGT5Esi2-Zr2mqJf8.mjs.map → sql-utils-C9blmi9x-B90QedVA.mjs.map} +1 -1
- package/dist/sqlite-contract-view-DJhc7pI7-Db5l4qrA.mjs +51 -0
- package/dist/sqlite-contract-view-DJhc7pI7-Db5l4qrA.mjs.map +1 -0
- package/dist/{sqlite-migration-BLyz5GQr-BMImgGTB.mjs → sqlite-migration-BxQ65pKq-C7siJGuR.mjs} +13 -10
- package/dist/sqlite-migration-BxQ65pKq-C7siJGuR.mjs.map +1 -0
- package/dist/{sqlite-contract-view-CGfiGvKH-CT-JjNHd.mjs → sqlite-unbound-database-Df3Wf5ZA-B1QemRgb.mjs} +5 -49
- package/dist/sqlite-unbound-database-Df3Wf5ZA-B1QemRgb.mjs.map +1 -0
- package/dist/target.d.mts +14 -13
- package/dist/target.mjs +22 -20
- package/dist/target__aggregates.d.mts +1 -1
- 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 +3 -3
- package/dist/target__codecs.d.mts +3 -3
- package/dist/target__codecs.mjs +4 -4
- package/dist/target__contract-free.mjs +2 -2
- package/dist/target__control.d.mts +2 -2
- package/dist/target__control.mjs +42 -36
- package/dist/target__control.mjs.map +1 -1
- package/dist/target__data-types.d.mts +2 -2
- package/dist/target__data-types.mjs +3 -3
- package/dist/target__default-normalizer.d.mts +1 -1
- package/dist/target__default-normalizer.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-produced-sqlite-migration.mjs +1 -1
- package/dist/target__planner.mjs +1 -1
- package/dist/target__render-ops.mjs +1 -1
- package/dist/target__runtime.d.mts +2 -2
- package/dist/target__runtime.mjs +3 -3
- package/dist/target__runtime.mjs.map +1 -1
- package/dist/target__sql-utils.mjs +1 -1
- package/dist/target__types.d.mts +2 -0
- package/dist/target__types.mjs +2 -0
- package/dist/types-COqCbSev.d.mts +56 -0
- package/dist/types-COqCbSev.d.mts.map +1 -0
- package/dist/{types-y5JlAv97.d.mts → types-DpDK9e9U.d.mts} +1 -1
- package/package.json +18 -12
- package/dist/adapter-Cff01Cgi-C19Fhc2M.mjs.map +0 -1
- package/dist/aggregates-D5fuFVMC.mjs.map +0 -1
- package/dist/codec-ids-CMbhYIsa.d.mts +0 -1
- package/dist/codec-ids-DuJYssXV-BPKbFNRL.d.mts +0 -14
- package/dist/codec-ids-DuJYssXV-BPKbFNRL.d.mts.map +0 -1
- package/dist/codec-ids-wgEvkCkg-WltuexMR.mjs +0 -14
- package/dist/codec-ids-wgEvkCkg-WltuexMR.mjs.map +0 -1
- package/dist/codec-types-COh75Bop-CUehAexc.d.mts.map +0 -1
- package/dist/codec-types-ELHfd82J.d.mts +0 -2
- package/dist/codec-types-PONhVn74.d.mts +0 -1
- package/dist/codecs-BJYruC-a-BKDGae3k.d.mts.map +0 -1
- package/dist/codecs-Dn0xoCuf.d.mts +0 -1
- package/dist/codecs-g-YI3BtK.mjs.map +0 -1
- package/dist/codecs-yZoH21Yj-lQXtGlEq.mjs.map +0 -1
- package/dist/control-jYLWcPv2.d.mts +0 -130
- package/dist/control-jYLWcPv2.d.mts.map +0 -1
- package/dist/data-type-entries-yQ-qYugg-C_NnX5WO.mjs.map +0 -1
- package/dist/data-types-Dx3rHsbF.d.mts.map +0 -1
- package/dist/data-types-coQrCWfS-yMCe4F52.mjs.map +0 -1
- package/dist/datetime-text-Bniwehv--BSQhnrdE.mjs +0 -9
- package/dist/datetime-text-Bniwehv--BSQhnrdE.mjs.map +0 -1
- package/dist/default-normalizer-DGMXypHg-CPf7oyZA.mjs.map +0 -1
- package/dist/descriptor-meta-BNuC8mOJ-BfS3KaDU.mjs +0 -105
- package/dist/descriptor-meta-BNuC8mOJ-BfS3KaDU.mjs.map +0 -1
- package/dist/descriptor-meta-runtime-DX2JfHWF-Dbsh5NP8.mjs +0 -15
- package/dist/descriptor-meta-runtime-DX2JfHWF-Dbsh5NP8.mjs.map +0 -1
- package/dist/errors-DnR-sMHS-D_gh214a.mjs +0 -38
- package/dist/errors-DnR-sMHS-D_gh214a.mjs.map +0 -1
- package/dist/runtime-CjIoI3sa.d.mts.map +0 -1
- package/dist/sql-renderer-brQ96quu.d.mts +0 -1
- package/dist/sqlite-contract-view-CGfiGvKH-CT-JjNHd.mjs.map +0 -1
- package/dist/sqlite-migration-BLyz5GQr-BMImgGTB.mjs.map +0 -1
package/dist/{descriptor-meta-DrNwC4vO-D7vuA6QK.mjs.map → descriptor-meta-DrNwC4vO-B9xeeDp9.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor-meta-DrNwC4vO-
|
|
1
|
+
{"version":3,"file":"descriptor-meta-DrNwC4vO-B9xeeDp9.mjs","names":[],"sources":["../../../../3-targets/sqlite/2-adapter/dist/descriptor-meta-DrNwC4vO.mjs"],"sourcesContent":["import { t as sqliteAdapterContractContributions } from \"./contract-contributions-wweWdXMK.mjs\";\nimport { sqliteCodecRegistry } from \"@internal/target-sqlite/codecs\";\n//#region src/core/descriptor-meta.ts\nconst sqliteAdapterDescriptorMeta = {\n\tkind: \"adapter\",\n\tfamilyId: \"sql\",\n\ttargetId: \"sqlite\",\n\tid: \"sqlite\",\n\tversion: \"0.0.1\",\n\tcapabilities: sqliteAdapterContractContributions.capabilities,\n\ttypes: {\n\t\taggregateDescriptors: sqliteAdapterContractContributions.types.aggregateDescriptors,\n\t\tcodecTypes: {\n\t\t\tcodecDescriptors: Array.from(sqliteCodecRegistry.values()),\n\t\t\timport: {\n\t\t\t\tpackage: \"@internal/adapter-sqlite/codec-types\",\n\t\t\t\tnamed: \"CodecTypes\",\n\t\t\t\talias: \"SqliteTypes\"\n\t\t\t}\n\t\t}\n\t}\n};\n//#endregion\nexport { sqliteAdapterDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-DrNwC4vO.mjs.map"],"mappings":";;;AAGA,MAAM,8BAA8B;CACnC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS;CACT,cAAc,mCAAmC;CACjD,OAAO;EACN,sBAAsB,mCAAmC,MAAM;EAC/D,YAAY;GACX,kBAAkB,MAAM,KAAK,oBAAoB,OAAO,CAAC;GACzD,QAAQ;IACP,SAAS;IACT,OAAO;IACP,OAAO;GACR;EACD;CACD;AACD"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
2
|
+
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
3
|
+
import { CliStructuredError } from "@prisma/orm-framework/errors/control";
|
|
4
|
+
//#region ../../../3-targets/sqlite/1-target/dist/errors-D9vZNPSI.mjs
|
|
5
|
+
function sqliteError(code, message, options) {
|
|
6
|
+
return structuredError(code, message, options);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A `SqliteMigration` operation that needs the materialized control adapter
|
|
10
|
+
* — named by `operation` (e.g. `createTable`, `dropColumn`, `recreateTable`) —
|
|
11
|
+
* was invoked, but the migration was constructed without a `ControlStack`.
|
|
12
|
+
* Concrete authoring usage always goes through the migration CLI entrypoint,
|
|
13
|
+
* which assembles a stack from the loaded `prisma.config.ts`; reaching this
|
|
14
|
+
* error means a test fixture or ad-hoc consumer instantiated `SqliteMigration`
|
|
15
|
+
* with the no-arg form (legal for `operations` / `describe` introspection only).
|
|
16
|
+
*
|
|
17
|
+
* The `operation` argument is required so every throw site names the operation
|
|
18
|
+
* that actually failed; a new operation cannot inherit a misattributed message.
|
|
19
|
+
*
|
|
20
|
+
* Distinct from `MIGRATION.UNFILLED_PLACEHOLDER` (placeholder not filled)
|
|
21
|
+
* because the missing input is the stack itself, not the per-operation
|
|
22
|
+
* contract.
|
|
23
|
+
*
|
|
24
|
+
* Lives in `@internal/target-sqlite/errors` rather than the shared
|
|
25
|
+
* framework migration errors module because the failure is target-specific:
|
|
26
|
+
* the contract it talks about (`SqliteMigration`, the SQLite control
|
|
27
|
+
* adapter, the SQLite-target stack) only exists in this package.
|
|
28
|
+
*/
|
|
29
|
+
function errorSqliteMigrationStackMissing(operation) {
|
|
30
|
+
return new CliStructuredError("MIGRATION.SQLITE_CONTROL_STACK_MISSING", `SqliteMigration.${operation} requires a control adapter`, {
|
|
31
|
+
why: `SqliteMigration.${operation} was invoked on an instance constructed without a ControlStack, so the stored controlAdapter is undefined and the operation cannot lower its DDL node.`,
|
|
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 SQLite adapter to the migration constructor in test fixtures.",
|
|
33
|
+
meta: { operation }
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const TEMPORAL_UNAVAILABLE_FIX = "Run on a runtime with Temporal available, install a Temporal polyfill before creating the client, or write the column as a convenience type at its default, which needs no Temporal: `DateTime` reads a JavaScript `Date`, and `Date`, `Time` and `Duration` read ISO 8601 strings.";
|
|
37
|
+
function errorTemporalUnavailable(codecId, operation) {
|
|
38
|
+
return sqliteError("RUNTIME.TEMPORAL_UNAVAILABLE", `Codec '${codecId}' cannot ${operation} a value because this runtime has no global Temporal implementation.`, {
|
|
39
|
+
why: "Temporal-backed codecs read and write their values through the global Temporal API, which this runtime does not provide.",
|
|
40
|
+
fix: TEMPORAL_UNAVAILABLE_FIX,
|
|
41
|
+
meta: {
|
|
42
|
+
codecId,
|
|
43
|
+
operation
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function errorTemporalUnavailableForDefault(generatorId) {
|
|
48
|
+
return sqliteError("RUNTIME.TEMPORAL_UNAVAILABLE", `Mutation default generator '${generatorId}' cannot produce a value because this runtime has no global Temporal implementation.`, {
|
|
49
|
+
why: "The generator answers a Temporal-backed column, so the value it produces is a Temporal value, which this runtime cannot construct.",
|
|
50
|
+
fix: TEMPORAL_UNAVAILABLE_FIX,
|
|
51
|
+
meta: { generatorId }
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function errorTemporalWrongType(codecId, temporalTag, stringType, received) {
|
|
55
|
+
return sqliteError("RUNTIME.ENCODE_FAILED", `Codec '${codecId}' encodes a ${temporalTag}, but received ${received}.`, {
|
|
56
|
+
why: "The codec writes the Temporal value's own ISO 8601 text. A value of another type has no text the column holds.",
|
|
57
|
+
fix: `Pass a ${temporalTag}, or author the column with its ${stringType} type to write ISO 8601 text.`,
|
|
58
|
+
meta: {
|
|
59
|
+
codecId,
|
|
60
|
+
temporalTag,
|
|
61
|
+
stringType,
|
|
62
|
+
received
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function errorTemporalNonIsoCalendar(codecId, calendarId) {
|
|
67
|
+
return sqliteError("RUNTIME.ENCODE_FAILED", `Codec '${codecId}' accepts only the iso8601 calendar, but the value carries '${calendarId}'.`, {
|
|
68
|
+
why: "SQLite 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.",
|
|
69
|
+
fix: "Convert the value with .withCalendar(\"iso8601\") before writing if the ISO projection is what you mean to store.",
|
|
70
|
+
meta: {
|
|
71
|
+
codecId,
|
|
72
|
+
calendarId
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/** A date or time codec read text from SQLite that is not a value of its type, or that `Temporal` cannot hold. */
|
|
77
|
+
function errorDateTimeUnreadable(options) {
|
|
78
|
+
const { codecId, value, detail } = options;
|
|
79
|
+
return sqliteError("RUNTIME.DECODE_FAILED", `Codec '${codecId}' cannot read the value SQLite returned: ${JSON.stringify(value)}. ${detail}`, {
|
|
80
|
+
why: "SQLite stores dates and times as text and checks none of it, so a row written outside Prisma can hold text that is not a value of the column's type.",
|
|
81
|
+
fix: "Rewrite the row in the form the column stores, or read the column with a type that holds its text, such as String.",
|
|
82
|
+
meta: {
|
|
83
|
+
codecId,
|
|
84
|
+
value: value.slice(0, 100)
|
|
85
|
+
},
|
|
86
|
+
...ifDefined("cause", options.cause)
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/** A date or time codec was given a value that names no value its type stores, such as text with a digit below a millisecond. */
|
|
90
|
+
function errorDateTimeUnwritable(options) {
|
|
91
|
+
const { codecId, received, detail } = options;
|
|
92
|
+
return sqliteError("RUNTIME.ENCODE_FAILED", `Codec '${codecId}' cannot write ${received}. ${detail}`, {
|
|
93
|
+
why: "SQLite stores dates and times as text in one form for each value, so the column sorts and compares by the text. A value that form cannot hold is refused rather than changed.",
|
|
94
|
+
fix: "Write a value the column holds, as the message shows.",
|
|
95
|
+
meta: {
|
|
96
|
+
codecId,
|
|
97
|
+
received: received.slice(0, 100)
|
|
98
|
+
},
|
|
99
|
+
...ifDefined("cause", options.cause)
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
103
|
+
export { errorTemporalUnavailable as a, sqliteError as c, errorTemporalNonIsoCalendar as i, errorDateTimeUnwritable as n, errorTemporalUnavailableForDefault as o, errorSqliteMigrationStackMissing as r, errorTemporalWrongType as s, errorDateTimeUnreadable as t };
|
|
104
|
+
|
|
105
|
+
//# sourceMappingURL=errors-D9vZNPSI-DoNmdfv7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors-D9vZNPSI-DoNmdfv7.mjs","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/errors-D9vZNPSI.mjs"],"sourcesContent":["import { ifDefined } from \"@internal/utils/defined\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { CliStructuredError } from \"@internal/errors/control\";\n//#region src/core/errors.ts\nfunction sqliteError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n/**\n* A `SqliteMigration` operation that needs the materialized control adapter\n* — named by `operation` (e.g. `createTable`, `dropColumn`, `recreateTable`) —\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 `SqliteMigration`\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* because the missing input is the stack itself, not the per-operation\n* contract.\n*\n* Lives in `@internal/target-sqlite/errors` rather than the shared\n* framework migration errors module because the failure is target-specific:\n* the contract it talks about (`SqliteMigration`, the SQLite control\n* adapter, the SQLite-target stack) only exists in this package.\n*/\nfunction errorSqliteMigrationStackMissing(operation) {\n\treturn new CliStructuredError(\"MIGRATION.SQLITE_CONTROL_STACK_MISSING\", `SqliteMigration.${operation} requires a control adapter`, {\n\t\twhy: `SqliteMigration.${operation} was invoked on an instance constructed without a ControlStack, so the stored controlAdapter is undefined and the operation cannot lower its DDL node.`,\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 SQLite adapter to the migration constructor in test fixtures.\",\n\t\tmeta: { operation }\n\t});\n}\nconst TEMPORAL_UNAVAILABLE_FIX = \"Run on a runtime with Temporal available, install a Temporal polyfill before creating the client, or write the column as a convenience type at its default, which needs no Temporal: `DateTime` reads a JavaScript `Date`, and `Date`, `Time` and `Duration` read ISO 8601 strings.\";\nfunction errorTemporalUnavailable(codecId, operation) {\n\treturn sqliteError(\"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: TEMPORAL_UNAVAILABLE_FIX,\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\toperation\n\t\t}\n\t});\n}\nfunction errorTemporalUnavailableForDefault(generatorId) {\n\treturn sqliteError(\"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 value, which this runtime cannot construct.\",\n\t\tfix: TEMPORAL_UNAVAILABLE_FIX,\n\t\tmeta: { generatorId }\n\t});\n}\nfunction errorTemporalWrongType(codecId, temporalTag, stringType, received) {\n\treturn sqliteError(\"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' encodes a ${temporalTag}, but received ${received}.`, {\n\t\twhy: \"The codec writes the Temporal value's own ISO 8601 text. A value of another type has no text the column holds.\",\n\t\tfix: `Pass a ${temporalTag}, or author the column with its ${stringType} type to write ISO 8601 text.`,\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 sqliteError(\"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' accepts only the iso8601 calendar, but the value carries '${calendarId}'.`, {\n\t\twhy: \"SQLite 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/** A date or time codec read text from SQLite that is not a value of its type, or that `Temporal` cannot hold. */\nfunction errorDateTimeUnreadable(options) {\n\tconst { codecId, value, detail } = options;\n\treturn sqliteError(\"RUNTIME.DECODE_FAILED\", `Codec '${codecId}' cannot read the value SQLite returned: ${JSON.stringify(value)}. ${detail}`, {\n\t\twhy: \"SQLite stores dates and times as text and checks none of it, so a row written outside Prisma can hold text that is not a value of the column's type.\",\n\t\tfix: \"Rewrite the row in the form the column stores, or read the column with a type that holds its text, such as String.\",\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\tvalue: value.slice(0, 100)\n\t\t},\n\t\t...ifDefined(\"cause\", options.cause)\n\t});\n}\n/** A date or time codec was given a value that names no value its type stores, such as text with a digit below a millisecond. */\nfunction errorDateTimeUnwritable(options) {\n\tconst { codecId, received, detail } = options;\n\treturn sqliteError(\"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' cannot write ${received}. ${detail}`, {\n\t\twhy: \"SQLite stores dates and times as text in one form for each value, so the column sorts and compares by the text. A value that form cannot hold is refused rather than changed.\",\n\t\tfix: \"Write a value the column holds, as the message shows.\",\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\treceived: received.slice(0, 100)\n\t\t},\n\t\t...ifDefined(\"cause\", options.cause)\n\t});\n}\n//#endregion\nexport { errorTemporalUnavailable as a, sqliteError as c, errorTemporalNonIsoCalendar as i, errorDateTimeUnwritable as n, errorTemporalUnavailableForDefault as o, errorSqliteMigrationStackMissing as r, errorTemporalWrongType as s, errorDateTimeUnreadable as t };\n\n//# sourceMappingURL=errors-D9vZNPSI.mjs.map"],"mappings":";;;;AAIA,SAAS,YAAY,MAAM,SAAS,SAAS;CAC5C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAS,iCAAiC,WAAW;CACpD,OAAO,IAAI,mBAAmB,0CAA0C,mBAAmB,UAAU,8BAA8B;EAClI,KAAK,mBAAmB,UAAU;EAClC,KAAK;EACL,MAAM,EAAE,UAAU;CACnB,CAAC;AACF;AACA,MAAM,2BAA2B;AACjC,SAAS,yBAAyB,SAAS,WAAW;CACrD,OAAO,YAAY,gCAAgC,UAAU,QAAQ,WAAW,UAAU,uEAAuE;EAChK,KAAK;EACL,KAAK;EACL,MAAM;GACL;GACA;EACD;CACD,CAAC;AACF;AACA,SAAS,mCAAmC,aAAa;CACxD,OAAO,YAAY,gCAAgC,+BAA+B,YAAY,uFAAuF;EACpL,KAAK;EACL,KAAK;EACL,MAAM,EAAE,YAAY;CACrB,CAAC;AACF;AACA,SAAS,uBAAuB,SAAS,aAAa,YAAY,UAAU;CAC3E,OAAO,YAAY,yBAAyB,UAAU,QAAQ,cAAc,YAAY,iBAAiB,SAAS,IAAI;EACrH,KAAK;EACL,KAAK,UAAU,YAAY,kCAAkC,WAAW;EACxE,MAAM;GACL;GACA;GACA;GACA;EACD;CACD,CAAC;AACF;AACA,SAAS,4BAA4B,SAAS,YAAY;CACzD,OAAO,YAAY,yBAAyB,UAAU,QAAQ,8DAA8D,WAAW,KAAK;EAC3I,KAAK;EACL,KAAK;EACL,MAAM;GACL;GACA;EACD;CACD,CAAC;AACF;;AAEA,SAAS,wBAAwB,SAAS;CACzC,MAAM,EAAE,SAAS,OAAO,WAAW;CACnC,OAAO,YAAY,yBAAyB,UAAU,QAAQ,2CAA2C,KAAK,UAAU,KAAK,EAAE,IAAI,UAAU;EAC5I,KAAK;EACL,KAAK;EACL,MAAM;GACL;GACA,OAAO,MAAM,MAAM,GAAG,GAAG;EAC1B;EACA,GAAG,UAAU,SAAS,QAAQ,KAAK;CACpC,CAAC;AACF;;AAEA,SAAS,wBAAwB,SAAS;CACzC,MAAM,EAAE,SAAS,UAAU,WAAW;CACtC,OAAO,YAAY,yBAAyB,UAAU,QAAQ,iBAAiB,SAAS,IAAI,UAAU;EACrG,KAAK;EACL,KAAK;EACL,MAAM;GACL;GACA,UAAU,SAAS,MAAM,GAAG,GAAG;EAChC;EACA,GAAG,UAAU,SAAS,QAAQ,KAAK;CACpC,CAAC;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as buildTargetDetails } from "./planner-target-details-Daaeo8s9-BGAN4JVc.mjs";
|
|
2
|
-
import { T as step } from "./op-factory-call-
|
|
2
|
+
import { T as step } from "./op-factory-call-BQYECylm-K7S_xgRS.mjs";
|
|
3
3
|
import { col as col$1, fn as fn$1, foreignKey, lit as lit$1, primaryKey, unique } from "@prisma/orm-family-sql/relational-core/contract-free";
|
|
4
4
|
import { placeholder } from "@prisma/orm-framework/errors/migration";
|
|
5
5
|
import { MigrationCLI } from "@prisma/orm-toolchain/cli/migration-cli";
|
|
@@ -45,4 +45,4 @@ function rawSql(op) {
|
|
|
45
45
|
//#endregion
|
|
46
46
|
export { foreignKey as a, primaryKey as c, unique as d, fn$1 as i, rawSql as l, col$1 as n, lit$1 as o, dataTransform as r, placeholder as s, MigrationCLI as t, sql as u };
|
|
47
47
|
|
|
48
|
-
//# sourceMappingURL=migration-
|
|
48
|
+
//# sourceMappingURL=migration-DYyfcQB_.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-
|
|
1
|
+
{"version":3,"file":"migration-DYyfcQB_.mjs","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/migration.mjs"],"sourcesContent":["import { t as SqliteMigration } from \"./sqlite-migration-BxQ65pKq.mjs\";\nimport { w as step } from \"./op-factory-call-BQYECylm.mjs\";\nimport { t as buildTargetDetails } from \"./planner-target-details-Daaeo8s9.mjs\";\nimport { placeholder } from \"@internal/errors/migration\";\nimport { col, fn, foreignKey, lit, primaryKey, unique } from \"@internal/sql-relational-core/contract-free\";\nimport { MigrationCLI } from \"@internal/cli/migration-cli\";\nimport { sql } from \"@internal/sql-contract/sql-expression\";\n//#region src/core/migrations/operations/data-transform.ts\n/**\n* User-facing `dataTransform` factory for the SQLite migration authoring\n* surface. Invoked directly inside a `migration.ts` file to supply a\n* user-authored SQL statement that runs with operation class `'data'`.\n*\n* Typical use: the planner emits a `DataTransformCall` stub when a NOT NULL\n* tightening requires a backfill. The rendered `migration.ts` exposes the\n* backfill as a `placeholder(\"…\")` slot the user fills in with an\n* `UPDATE … WHERE col IS NULL` statement. The filled-in `dataTransform(...)`\n* invocation returns a runnable operation the runner executes before the\n* subsequent recreate-table op copies data into the tightened schema.\n*/\nfunction dataTransform(opts) {\n\treturn {\n\t\tid: opts.id,\n\t\tlabel: opts.label,\n\t\tsummary: opts.description,\n\t\toperationClass: \"data\",\n\t\ttarget: {\n\t\t\tid: \"sqlite\",\n\t\t\tdetails: buildTargetDetails(\"table\", opts.table)\n\t\t},\n\t\tprecheck: [],\n\t\texecute: [step(opts.description, opts.run())],\n\t\tpostcheck: []\n\t};\n}\n//#endregion\n//#region src/core/migrations/operations/raw.ts\n/**\n* Identity factory for an already-materialized\n* `SqlMigrationPlanOperation<SqlitePlanTargetDetails>`. Mirrors the Postgres\n* `rawSql` factory: the planner uses this to carry ops produced by SQL-family\n* paths (codec lifecycle hooks, raw-SQL escape hatches) alongside structured\n* call IR without reverse-engineering their shape.\n*/\nfunction rawSql(op) {\n\treturn op;\n}\n//#endregion\nexport { SqliteMigration as Migration, MigrationCLI, col, dataTransform, fn, foreignKey, lit, placeholder, primaryKey, rawSql, sql, unique };\n\n//# sourceMappingURL=migration.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,SAAS,cAAc,MAAM;CAC5B,OAAO;EACN,IAAI,KAAK;EACT,OAAO,KAAK;EACZ,SAAS,KAAK;EACd,gBAAgB;EAChB,QAAQ;GACP,IAAI;GACJ,SAAS,mBAAmB,SAAS,KAAK,KAAK;EAChD;EACA,UAAU,CAAC;EACX,SAAS,CAAC,KAAK,KAAK,aAAa,KAAK,IAAI,CAAC,CAAC;EAC5C,WAAW,CAAC;CACb;AACD;;;;;;;;AAUA,SAAS,OAAO,IAAI;CACnB,OAAO;AACR"}
|
package/dist/{op-factory-call-DADakw8V-yXzHuXlv.mjs → op-factory-call-BQYECylm-K7S_xgRS.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as tableExistsAst, i as indexExistsAst, n as columnNameTakenAst, o as tableNameTakenAst, r as createTable, t as columnExistsAst } from "./ddl-
|
|
3
|
-
import { n as escapeLiteral, r as quoteIdentifier, t as SQLITE_QUOTING } from "./sql-utils-
|
|
4
|
-
import { r as stripOuterParens } from "./default-normalizer-
|
|
1
|
+
import { c as sqliteError } from "./errors-D9vZNPSI-DoNmdfv7.mjs";
|
|
2
|
+
import { a as tableExistsAst, i as indexExistsAst, n as columnNameTakenAst, o as tableNameTakenAst, r as createTable, t as columnExistsAst } from "./ddl-BvD-wVtg-BoEWa8CG.mjs";
|
|
3
|
+
import { n as escapeLiteral, r as quoteIdentifier, t as SQLITE_QUOTING } from "./sql-utils-C9blmi9x-B90QedVA.mjs";
|
|
4
|
+
import { r as stripOuterParens } from "./default-normalizer-CsMhUEOe-CRieDElD.mjs";
|
|
5
5
|
import { t as buildTargetDetails } from "./planner-target-details-Daaeo8s9-BGAN4JVc.mjs";
|
|
6
6
|
import { DdlColumn, FunctionColumnDefault, LiteralColumnDefault, opaqueSql } from "@prisma/orm-family-sql/relational-core/ast";
|
|
7
7
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
@@ -16,7 +16,7 @@ import { RelationalSchemaNodeKind, sqlColumnTypesEqual } from "@prisma/orm-famil
|
|
|
16
16
|
import { errorMigrationOperationOptionRemoved, unfilledPlaceholderOperation } from "@prisma/orm-framework/errors/migration";
|
|
17
17
|
import { REFERENTIAL_ACTION_SQL } from "@prisma/orm-family-sql/contract/referential-action-sql";
|
|
18
18
|
import { TsExpression, jsonToTsSource, tsArraySource, tsObjectSource, tsQuotedTextSource } from "@prisma/orm-framework/ts-render";
|
|
19
|
-
//#region ../../../3-targets/sqlite/1-target/dist/op-factory-call-
|
|
19
|
+
//#region ../../../3-targets/sqlite/1-target/dist/op-factory-call-BQYECylm.mjs
|
|
20
20
|
function foldAsciiLetters(identifier) {
|
|
21
21
|
return identifier.replace(/[A-Z]/g, (letter) => letter.toLowerCase());
|
|
22
22
|
}
|
|
@@ -1553,4 +1553,4 @@ function renderPostcheck(postcheck) {
|
|
|
1553
1553
|
//#endregion
|
|
1554
1554
|
export { sqliteDefaultToDdlColumnDefault as C, renameTableSteps as S, step as T, buildRecreateSummary as _, DropColumnCall as a, isSqliteOpFactoryCall as b, INLINE_AUTOINCREMENT_PRIMARY_KEY as c, RemoveStoredValueCall as d, RenameColumnCall as f, buildRecreatePostchecks as g, affinityStorageClasses as h, DataTransformCall as i, RawSqlCall as l, ReplaceStoredValueCall as m, CreateIndexCall as n, DropIndexCall as o, RenameTableCall as p, CreateTableCall as r, DropTableCall as s, AddColumnCall as t, RecreateTableCall as u, conversionCopyOf as v, sqliteIdentifiersCollide as w, rebuiltTableName as x, indexReplacementCalls as y };
|
|
1555
1555
|
|
|
1556
|
-
//# sourceMappingURL=op-factory-call-
|
|
1556
|
+
//# sourceMappingURL=op-factory-call-BQYECylm-K7S_xgRS.mjs.map
|