@prisma/orm-target-sqlite 8.0.0-rc.24-dev.28 → 8.0.0-rc.24-dev.30
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-B8OOrks4-CpmcF003.mjs → adapter-B8OOrks4-BKzW_Yc4.mjs} +9 -9
- package/dist/{adapter-B8OOrks4-CpmcF003.mjs.map → adapter-B8OOrks4-BKzW_Yc4.mjs.map} +1 -1
- package/dist/{adapter-NFsNVlif.d.mts → adapter-DrTWv8F7.d.mts} +5 -5
- package/dist/{adapter-NFsNVlif.d.mts.map → adapter-DrTWv8F7.d.mts.map} +1 -1
- package/dist/{adapter-xFPDhkod-DB6XDGgl.d.mts → adapter-xFPDhkod-Bfb8AQQJ.d.mts} +3 -3
- package/dist/{adapter-xFPDhkod-DB6XDGgl.d.mts.map → adapter-xFPDhkod-Bfb8AQQJ.d.mts.map} +1 -1
- package/dist/adapter.d.mts +11 -11
- package/dist/adapter.mjs +7 -7
- 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 +2 -2
- package/dist/adapter__column-types.mjs +2 -2
- package/dist/adapter__control.d.mts +2 -2
- 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 +4 -4
- 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--0FaH9Te.d.mts → aggregates-CA7Idm1d.d.mts} +4 -4
- package/dist/{aggregates--0FaH9Te.d.mts.map → aggregates-CA7Idm1d.d.mts.map} +1 -1
- package/dist/{aggregates-DMvLJFlR.mjs → aggregates-hLiHPHBG.mjs} +6 -7
- package/dist/aggregates-hLiHPHBG.mjs.map +1 -0
- package/dist/{codec-ids-BElbEYb_-CeWfv5bC.d.mts → codec-ids-CH8Nqk89-LNT9hksu.d.mts} +5 -3
- package/dist/codec-ids-CH8Nqk89-LNT9hksu.d.mts.map +1 -0
- package/dist/{codec-ids-BHBFCNsQ-C1Af_LGF.mjs → codec-ids-CTshXpbg-tcdbf_VC.mjs} +5 -3
- package/dist/codec-ids-CTshXpbg-tcdbf_VC.mjs.map +1 -0
- package/dist/codec-ids-Do7Ml2pg.d.mts +1 -0
- package/dist/codec-types-CBLOfyrr.d.mts +2 -0
- package/dist/codec-types-CcuzuROC.d.mts +1 -0
- package/dist/{codec-types-CGtSWeZ5-B5RH39BA.d.mts → codec-types-Ci-h2uxN-41PNpdNL.d.mts} +5 -3
- package/dist/codec-types-Ci-h2uxN-41PNpdNL.d.mts.map +1 -0
- package/dist/{codecs-izBhU4f1-uArTiOxL.mjs → codecs-CE5McdzP-CZ5F4Trz.mjs} +243 -116
- package/dist/codecs-CE5McdzP-CZ5F4Trz.mjs.map +1 -0
- package/dist/{codecs-A0DbaZRE-CMyLhO_K.d.mts → codecs-DBQsDiM--Cy-r45H3.d.mts} +58 -28
- package/dist/codecs-DBQsDiM--Cy-r45H3.d.mts.map +1 -0
- package/dist/codecs-Dou3fR1K.d.mts +1 -0
- package/dist/{codecs-B-paWXdt.mjs → codecs-EhvrdV8v.mjs} +2 -2
- package/dist/codecs-EhvrdV8v.mjs.map +1 -0
- package/dist/{column-types-bTPNfz46.d.mts → column-types-D3MMpY3X.d.mts} +13 -7
- package/dist/column-types-D3MMpY3X.d.mts.map +1 -0
- package/dist/column-types-D_PjRS6w.mjs +24 -0
- package/dist/column-types-D_PjRS6w.mjs.map +1 -0
- package/dist/{contract-contributions-CyHMdkva-2bg6kg_n.mjs → contract-contributions-CyHMdkva-BE5-kJj3.mjs} +2 -2
- package/dist/{contract-contributions-CyHMdkva-2bg6kg_n.mjs.map → contract-contributions-CyHMdkva-BE5-kJj3.mjs.map} +1 -1
- package/dist/{contract-free-DVGNrjWW.mjs → contract-free-CJlg0xGJ.mjs} +4 -4
- package/dist/{contract-free-DVGNrjWW.mjs.map → contract-free-CJlg0xGJ.mjs.map} +1 -1
- package/dist/{control-DGa_C2q6.d.mts → control-CtCvtwJx.d.mts} +183 -17
- package/dist/control-CtCvtwJx.d.mts.map +1 -0
- package/dist/{control-Dp-pU81N.d.mts → control-DfWteXy-.d.mts} +3 -3
- package/dist/{control-Dp-pU81N.d.mts.map → control-DfWteXy-.d.mts.map} +1 -1
- package/dist/{control-BvT30n3D.mjs → control-V3kPfMTR.mjs} +4 -3
- package/dist/control-V3kPfMTR.mjs.map +1 -0
- package/dist/{data-type-entries-B6YmbQDH-RnV5wVv8.mjs → data-type-entries-C0WkKiPF-CKPYj4OT.mjs} +20 -3
- package/dist/data-type-entries-C0WkKiPF-CKPYj4OT.mjs.map +1 -0
- package/dist/{data-types-CwpMoNK4.d.mts → data-types-C1nzwKt7.d.mts} +10 -2
- package/dist/{data-types-CwpMoNK4.d.mts.map → data-types-C1nzwKt7.d.mts.map} +1 -1
- package/dist/{data-types-fYwGTal5-BxuZD5EE.mjs → data-types-C_NKe4Ni-D7r8QkSb.mjs} +32 -4
- package/dist/data-types-C_NKe4Ni-D7r8QkSb.mjs.map +1 -0
- package/dist/{date-time-now-generators-BVQSg28x-DwhOJw5-.mjs → date-time-now-generators-DtRz9c2R-BkrBeLl2.mjs} +4 -4
- package/dist/{date-time-now-generators-BVQSg28x-DwhOJw5-.mjs.map → date-time-now-generators-DtRz9c2R-BkrBeLl2.mjs.map} +1 -1
- package/dist/{datetime-text-BogpvE70-VwTG2rUc.mjs → datetime-text-nkVy_w0q-DZnIEmgr.mjs} +3 -3
- package/dist/{datetime-text-BogpvE70-VwTG2rUc.mjs.map → datetime-text-nkVy_w0q-DZnIEmgr.mjs.map} +1 -1
- package/dist/{ddl-BvD-wVtg-BoEWa8CG.mjs → ddl-CgkyurGo-B2o4mSIT.mjs} +3 -3
- package/dist/{ddl-BvD-wVtg-BoEWa8CG.mjs.map → ddl-CgkyurGo-B2o4mSIT.mjs.map} +1 -1
- package/dist/{default-normalizer-BcGrp77x-CMWxtX1W.mjs → default-normalizer-Xsys5QJm-bPQiHGKp.mjs} +3 -3
- package/dist/{default-normalizer-BcGrp77x-CMWxtX1W.mjs.map → default-normalizer-Xsys5QJm-bPQiHGKp.mjs.map} +1 -1
- package/dist/{descriptor-meta-C2RNdGqi-BzR_I68E.mjs → descriptor-meta-BUMTRa-0-D2bfF0Yr.mjs} +5 -5
- package/dist/descriptor-meta-BUMTRa-0-D2bfF0Yr.mjs.map +1 -0
- package/dist/{descriptor-meta-Drr6Abaf-P67SenMd.mjs → descriptor-meta-CkiPlqDS-n3hDP01X.mjs} +23 -3
- package/dist/descriptor-meta-CkiPlqDS-n3hDP01X.mjs.map +1 -0
- package/dist/{descriptor-meta-CEjGA0WH-CxgiKj3V.mjs → descriptor-meta-uVTby90Y-CUfrzHVW.mjs} +152 -47
- package/dist/descriptor-meta-uVTby90Y-CUfrzHVW.mjs.map +1 -0
- package/dist/driver.mjs +1 -1
- package/dist/driver__control.mjs +1 -1
- package/dist/driver__runtime.mjs +9 -6
- package/dist/driver__runtime.mjs.map +1 -1
- package/dist/{errors-D9vZNPSI-DoNmdfv7.mjs → errors-DxbvEzQp-CeTjoGtL.mjs} +44 -3
- package/dist/errors-DxbvEzQp-CeTjoGtL.mjs.map +1 -0
- package/dist/{migration-C6RAZsCK.mjs → migration-BZoV6EvH.mjs} +2 -2
- package/dist/{migration-C6RAZsCK.mjs.map → migration-BZoV6EvH.mjs.map} +1 -1
- package/dist/{op-factory-call-B3oOyB-T-Bhg17pAj.mjs → op-factory-call-2IWWs4es-CajfeAMX.mjs} +19 -19
- package/dist/op-factory-call-2IWWs4es-CajfeAMX.mjs.map +1 -0
- package/dist/{pack-JeUy8ZB1.d.mts → pack-CHESErO8.d.mts} +183 -24
- package/dist/{pack-JeUy8ZB1.d.mts.map → pack-CHESErO8.d.mts.map} +1 -1
- package/dist/{planner-ccevdpwf.d.mts → planner-Bu5XBkHm.d.mts} +2 -2
- package/dist/{planner-ccevdpwf.d.mts.map → planner-Bu5XBkHm.d.mts.map} +1 -1
- package/dist/{planner-COl0BmJ_-SJuP-72Y.mjs → planner-gq4m2U9I-BBwAFGko.mjs} +8 -9
- package/dist/planner-gq4m2U9I-BBwAFGko.mjs.map +1 -0
- package/dist/{planner-produced-sqlite-migration-CE1q5Uqq-9kjqMR-1.mjs → planner-produced-sqlite-migration-BnKx1gAX-BZMX06Q-.mjs} +13 -23
- package/dist/planner-produced-sqlite-migration-BnKx1gAX-BZMX06Q-.mjs.map +1 -0
- package/dist/{planner-produced-sqlite-migration-BHH_ftCV-CndNmTrH.d.mts → planner-produced-sqlite-migration-CMjzJW5V-dVv0SjJm.d.mts} +3 -4
- package/dist/planner-produced-sqlite-migration-CMjzJW5V-dVv0SjJm.d.mts.map +1 -0
- package/dist/planner-produced-sqlite-migration-DtytlAAY.d.mts +1 -0
- package/dist/{render-ops-B2EHnXIQ-AspapEkF.mjs → render-ops-BdrBMvjY-CyVOYy9i.mjs} +4 -4
- package/dist/{render-ops-B2EHnXIQ-AspapEkF.mjs.map → render-ops-BdrBMvjY-CyVOYy9i.mjs.map} +1 -1
- package/dist/{require-temporal-qbyZfPgl-DGJhYwmE.mjs → require-temporal-CHWqSDF3-ElFTiAh6.mjs} +3 -3
- package/dist/{require-temporal-qbyZfPgl-DGJhYwmE.mjs.map → require-temporal-CHWqSDF3-ElFTiAh6.mjs.map} +1 -1
- package/dist/{runtime-H_OgXoaz.d.mts → runtime-CVBk_GlD.d.mts} +2 -2
- package/dist/{runtime-H_OgXoaz.d.mts.map → runtime-CVBk_GlD.d.mts.map} +1 -1
- package/dist/{runtime-DTjhSsHd.mjs → runtime-DQll1Swl.mjs} +2 -2
- package/dist/{runtime-DTjhSsHd.mjs.map → runtime-DQll1Swl.mjs.map} +1 -1
- package/dist/sql-renderer-DlZKtvVf.d.mts +1 -0
- package/dist/{sql-utils-C9blmi9x-B90QedVA.mjs → sql-utils-CHBxMmv--Dl7wl7n3.mjs} +3 -3
- package/dist/{sql-utils-C9blmi9x-B90QedVA.mjs.map → sql-utils-CHBxMmv--Dl7wl7n3.mjs.map} +1 -1
- package/dist/{sqlite-contract-view-B0oBTJQ0-DGNLlkLM.mjs → sqlite-contract-view-6qHjyMcG-BHZ8iO5v.mjs} +4 -4
- package/dist/{sqlite-contract-view-B0oBTJQ0-DGNLlkLM.mjs.map → sqlite-contract-view-6qHjyMcG-BHZ8iO5v.mjs.map} +1 -1
- package/dist/{sqlite-migration-DvNpo879-DcOagmQ1.mjs → sqlite-migration-1OBxvebH-BNjpjOW4.mjs} +13 -10
- package/dist/sqlite-migration-1OBxvebH-BNjpjOW4.mjs.map +1 -0
- package/dist/{sqlite-unbound-database-Df3Wf5ZA-B1QemRgb.mjs → sqlite-unbound-database-CfLXSiVo-Dy5VBXGz.mjs} +4 -4
- package/dist/{sqlite-unbound-database-Df3Wf5ZA-B1QemRgb.mjs.map → sqlite-unbound-database-CfLXSiVo-Dy5VBXGz.mjs.map} +1 -1
- package/dist/target.d.mts +14 -14
- package/dist/target.mjs +23 -23
- 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 +1 -1
- package/dist/target__control.mjs +8 -7
- 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.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.d.mts +2 -2
- package/dist/target__planner-produced-sqlite-migration.mjs +1 -1
- package/dist/target__planner.d.mts +1 -1
- package/dist/target__planner.mjs +1 -1
- package/dist/target__render-ops.mjs +1 -1
- package/dist/target__runtime.mjs +3 -3
- package/dist/target__sql-utils.mjs +1 -1
- package/dist/target__types.mjs +1 -1
- package/dist/{types-28E593y9.d.mts → types-CexPOm8x.d.mts} +1 -1
- package/package.json +12 -12
- package/dist/aggregates-DMvLJFlR.mjs.map +0 -1
- package/dist/codec-ids-9Fs9p6ST.d.mts +0 -1
- package/dist/codec-ids-BElbEYb_-CeWfv5bC.d.mts.map +0 -1
- package/dist/codec-ids-BHBFCNsQ-C1Af_LGF.mjs.map +0 -1
- package/dist/codec-types-CGtSWeZ5-B5RH39BA.d.mts.map +0 -1
- package/dist/codec-types-Dx9dQe-Y.d.mts +0 -1
- package/dist/codec-types-IproBv-Q.d.mts +0 -2
- package/dist/codecs-A0DbaZRE-CMyLhO_K.d.mts.map +0 -1
- package/dist/codecs-B-paWXdt.mjs.map +0 -1
- package/dist/codecs-CX5BZUdO.d.mts +0 -1
- package/dist/codecs-izBhU4f1-uArTiOxL.mjs.map +0 -1
- package/dist/column-types-bTPNfz46.d.mts.map +0 -1
- package/dist/column-types-toYbR7mn.mjs +0 -22
- package/dist/column-types-toYbR7mn.mjs.map +0 -1
- package/dist/control-BvT30n3D.mjs.map +0 -1
- package/dist/control-DGa_C2q6.d.mts.map +0 -1
- package/dist/data-type-entries-B6YmbQDH-RnV5wVv8.mjs.map +0 -1
- package/dist/data-types-fYwGTal5-BxuZD5EE.mjs.map +0 -1
- package/dist/descriptor-meta-C2RNdGqi-BzR_I68E.mjs.map +0 -1
- package/dist/descriptor-meta-CEjGA0WH-CxgiKj3V.mjs.map +0 -1
- package/dist/descriptor-meta-Drr6Abaf-P67SenMd.mjs.map +0 -1
- package/dist/errors-D9vZNPSI-DoNmdfv7.mjs.map +0 -1
- package/dist/op-factory-call-B3oOyB-T-Bhg17pAj.mjs.map +0 -1
- package/dist/planner-COl0BmJ_-SJuP-72Y.mjs.map +0 -1
- package/dist/planner-produced-sqlite-migration-BHH_ftCV-CndNmTrH.d.mts.map +0 -1
- package/dist/planner-produced-sqlite-migration-CE1q5Uqq-9kjqMR-1.mjs.map +0 -1
- package/dist/planner-produced-sqlite-migration-_n61WaiD.d.mts +0 -1
- package/dist/sql-renderer-_NdIrQuX.d.mts +0 -1
- package/dist/sqlite-migration-DvNpo879-DcOagmQ1.mjs.map +0 -1
|
@@ -8,7 +8,7 @@ declare const sqliteControlTargetDescriptor: SqlControlTargetDescriptor<"sqlite"
|
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/core/type-constructors.d.ts
|
|
10
10
|
/**
|
|
11
|
-
* The
|
|
11
|
+
* The scalar types, the explicit date and time types and the convenience date and time types. The target contributes them, so PSL and the TypeScript builder's `type.*` see the same names.
|
|
12
12
|
*/
|
|
13
13
|
declare const sqliteScalarTypeConstructors: {
|
|
14
14
|
readonly DateTime: {
|
|
@@ -187,56 +187,222 @@ declare const sqliteScalarTypeConstructors: {
|
|
|
187
187
|
readonly codecId: "sqlite/duration-string@1";
|
|
188
188
|
};
|
|
189
189
|
};
|
|
190
|
-
readonly
|
|
190
|
+
readonly BigIntNumber: {
|
|
191
|
+
readonly deprecated: {
|
|
192
|
+
readonly replacement: "IntegerNumber";
|
|
193
|
+
};
|
|
191
194
|
readonly kind: "typeConstructor";
|
|
192
|
-
readonly documentation: "
|
|
195
|
+
readonly documentation: "An integer read as a JavaScript number within its safe integer range, stored as SQLite integer.";
|
|
193
196
|
readonly output: {
|
|
194
|
-
readonly codecId: "sqlite/
|
|
197
|
+
readonly codecId: "sqlite/integer@1";
|
|
195
198
|
};
|
|
196
199
|
};
|
|
197
200
|
readonly Int: {
|
|
201
|
+
readonly kind: "typeChoice";
|
|
202
|
+
readonly documentation: "An integer read as a JavaScript number within its safe integer range, stored as SQLite integer.";
|
|
203
|
+
readonly args: readonly [{
|
|
204
|
+
readonly kind: "option";
|
|
205
|
+
readonly name: "storage";
|
|
206
|
+
readonly values: readonly ["integer"];
|
|
207
|
+
readonly default: "integer";
|
|
208
|
+
readonly optional: true;
|
|
209
|
+
}];
|
|
210
|
+
readonly choices: readonly [{
|
|
211
|
+
readonly when: {
|
|
212
|
+
readonly storage: "integer";
|
|
213
|
+
};
|
|
214
|
+
readonly type: "IntegerNumber";
|
|
215
|
+
}];
|
|
216
|
+
};
|
|
217
|
+
readonly BigInt: {
|
|
218
|
+
readonly kind: "typeChoice";
|
|
219
|
+
readonly documentation: "An integer that may exceed the safe integer range, stored as SQLite integer. `as` is what the application reads: bigint, or number within the safe integer range.";
|
|
220
|
+
readonly args: readonly [{
|
|
221
|
+
readonly kind: "option";
|
|
222
|
+
readonly name: "as";
|
|
223
|
+
readonly values: readonly ["bigint", "number"];
|
|
224
|
+
readonly default: "bigint";
|
|
225
|
+
readonly optional: true;
|
|
226
|
+
}, {
|
|
227
|
+
readonly kind: "option";
|
|
228
|
+
readonly name: "storage";
|
|
229
|
+
readonly values: readonly ["integer"];
|
|
230
|
+
readonly default: "integer";
|
|
231
|
+
readonly optional: true;
|
|
232
|
+
}];
|
|
233
|
+
readonly choices: readonly [{
|
|
234
|
+
readonly when: {
|
|
235
|
+
readonly as: "bigint";
|
|
236
|
+
readonly storage: "integer";
|
|
237
|
+
};
|
|
238
|
+
readonly type: "IntegerBigInt";
|
|
239
|
+
}, {
|
|
240
|
+
readonly when: {
|
|
241
|
+
readonly as: "number";
|
|
242
|
+
readonly storage: "integer";
|
|
243
|
+
};
|
|
244
|
+
readonly type: "IntegerNumber";
|
|
245
|
+
}];
|
|
246
|
+
};
|
|
247
|
+
readonly Float: {
|
|
248
|
+
readonly kind: "typeChoice";
|
|
249
|
+
readonly documentation: "A floating-point number, stored as SQLite real.";
|
|
250
|
+
readonly args: readonly [{
|
|
251
|
+
readonly kind: "option";
|
|
252
|
+
readonly name: "storage";
|
|
253
|
+
readonly values: readonly ["real"];
|
|
254
|
+
readonly default: "real";
|
|
255
|
+
readonly optional: true;
|
|
256
|
+
}];
|
|
257
|
+
readonly choices: readonly [{
|
|
258
|
+
readonly when: {
|
|
259
|
+
readonly storage: "real";
|
|
260
|
+
};
|
|
261
|
+
readonly type: "Real";
|
|
262
|
+
}];
|
|
263
|
+
};
|
|
264
|
+
readonly Decimal: {
|
|
265
|
+
readonly kind: "typeChoice";
|
|
266
|
+
readonly documentation: "An exact decimal number read as decimal text such as \"12.50\", stored as SQLite text. It can be compared for equality but not ordered or summed.";
|
|
267
|
+
readonly args: readonly [{
|
|
268
|
+
readonly kind: "option";
|
|
269
|
+
readonly name: "storage";
|
|
270
|
+
readonly values: readonly ["text"];
|
|
271
|
+
readonly default: "text";
|
|
272
|
+
readonly optional: true;
|
|
273
|
+
}];
|
|
274
|
+
readonly choices: readonly [{
|
|
275
|
+
readonly when: {
|
|
276
|
+
readonly storage: "text";
|
|
277
|
+
};
|
|
278
|
+
readonly type: "DecimalString";
|
|
279
|
+
}];
|
|
280
|
+
};
|
|
281
|
+
readonly String: {
|
|
282
|
+
readonly kind: "typeChoice";
|
|
283
|
+
readonly documentation: "Text, stored as SQLite text.";
|
|
284
|
+
readonly args: readonly [{
|
|
285
|
+
readonly kind: "option";
|
|
286
|
+
readonly name: "storage";
|
|
287
|
+
readonly values: readonly ["text"];
|
|
288
|
+
readonly default: "text";
|
|
289
|
+
readonly optional: true;
|
|
290
|
+
}];
|
|
291
|
+
readonly choices: readonly [{
|
|
292
|
+
readonly when: {
|
|
293
|
+
readonly storage: "text";
|
|
294
|
+
};
|
|
295
|
+
readonly type: "Text";
|
|
296
|
+
}];
|
|
297
|
+
};
|
|
298
|
+
readonly Boolean: {
|
|
299
|
+
readonly kind: "typeChoice";
|
|
300
|
+
readonly documentation: "A boolean, stored as SQLite integer: 0 for false and 1 for true, as SQLite writes FALSE and TRUE.";
|
|
301
|
+
readonly args: readonly [{
|
|
302
|
+
readonly kind: "option";
|
|
303
|
+
readonly name: "storage";
|
|
304
|
+
readonly values: readonly ["integer"];
|
|
305
|
+
readonly default: "integer";
|
|
306
|
+
readonly optional: true;
|
|
307
|
+
}];
|
|
308
|
+
readonly choices: readonly [{
|
|
309
|
+
readonly when: {
|
|
310
|
+
readonly storage: "integer";
|
|
311
|
+
};
|
|
312
|
+
readonly type: "IntegerBoolean";
|
|
313
|
+
}];
|
|
314
|
+
};
|
|
315
|
+
readonly Bytes: {
|
|
316
|
+
readonly kind: "typeChoice";
|
|
317
|
+
readonly documentation: "Binary data read as a Uint8Array, stored as SQLite blob.";
|
|
318
|
+
readonly args: readonly [{
|
|
319
|
+
readonly kind: "option";
|
|
320
|
+
readonly name: "storage";
|
|
321
|
+
readonly values: readonly ["blob"];
|
|
322
|
+
readonly default: "blob";
|
|
323
|
+
readonly optional: true;
|
|
324
|
+
}];
|
|
325
|
+
readonly choices: readonly [{
|
|
326
|
+
readonly when: {
|
|
327
|
+
readonly storage: "blob";
|
|
328
|
+
};
|
|
329
|
+
readonly type: "Blob";
|
|
330
|
+
}];
|
|
331
|
+
};
|
|
332
|
+
readonly Json: {
|
|
333
|
+
readonly kind: "typeChoice";
|
|
334
|
+
readonly documentation: "A JSON value, serialized and stored as SQLite text.";
|
|
335
|
+
readonly args: readonly [{
|
|
336
|
+
readonly kind: "option";
|
|
337
|
+
readonly name: "storage";
|
|
338
|
+
readonly values: readonly ["text"];
|
|
339
|
+
readonly default: "text";
|
|
340
|
+
readonly optional: true;
|
|
341
|
+
}];
|
|
342
|
+
readonly choices: readonly [{
|
|
343
|
+
readonly when: {
|
|
344
|
+
readonly storage: "text";
|
|
345
|
+
};
|
|
346
|
+
readonly type: "PlainJson";
|
|
347
|
+
}];
|
|
348
|
+
};
|
|
349
|
+
readonly IntegerNumber: {
|
|
198
350
|
readonly kind: "typeConstructor";
|
|
199
|
-
readonly documentation: "An integer
|
|
351
|
+
readonly documentation: "An integer read as a JavaScript number within its safe integer range, stored as SQLite integer.";
|
|
200
352
|
readonly output: {
|
|
201
353
|
readonly codecId: "sqlite/integer@1";
|
|
202
354
|
};
|
|
203
355
|
};
|
|
204
|
-
readonly
|
|
356
|
+
readonly IntegerBigInt: {
|
|
205
357
|
readonly kind: "typeConstructor";
|
|
206
|
-
readonly documentation: "An integer
|
|
358
|
+
readonly documentation: "An integer read as a JavaScript bigint, stored as SQLite integer.";
|
|
207
359
|
readonly output: {
|
|
208
360
|
readonly codecId: "sqlite/bigint@1";
|
|
209
361
|
};
|
|
210
362
|
};
|
|
211
|
-
readonly
|
|
363
|
+
readonly Real: {
|
|
212
364
|
readonly kind: "typeConstructor";
|
|
213
|
-
readonly documentation: "A floating-point number stored as SQLite real.";
|
|
365
|
+
readonly documentation: "A floating-point number, stored as SQLite real.";
|
|
214
366
|
readonly output: {
|
|
215
367
|
readonly codecId: "sqlite/real@1";
|
|
216
368
|
};
|
|
217
369
|
};
|
|
218
|
-
readonly
|
|
370
|
+
readonly DecimalString: {
|
|
371
|
+
readonly kind: "typeConstructor";
|
|
372
|
+
readonly documentation: "An exact decimal number read as decimal text such as \"12.50\", stored as SQLite text. Text compares by its characters, so a field of this type can be compared for equality but not ordered or summed.";
|
|
373
|
+
readonly output: {
|
|
374
|
+
readonly codecId: "sqlite/decimal@1";
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
readonly Text: {
|
|
219
378
|
readonly kind: "typeConstructor";
|
|
220
|
-
readonly documentation: "
|
|
379
|
+
readonly documentation: "Text, stored as SQLite text.";
|
|
221
380
|
readonly output: {
|
|
222
381
|
readonly codecId: "sqlite/text@1";
|
|
223
382
|
};
|
|
224
383
|
};
|
|
225
|
-
readonly
|
|
384
|
+
readonly IntegerBoolean: {
|
|
226
385
|
readonly kind: "typeConstructor";
|
|
227
|
-
readonly documentation: "A
|
|
386
|
+
readonly documentation: "A boolean, stored as SQLite integer: 0 for false and 1 for true, as SQLite writes FALSE and TRUE.";
|
|
228
387
|
readonly output: {
|
|
229
|
-
readonly codecId: "sqlite/
|
|
388
|
+
readonly codecId: "sqlite/boolean@1";
|
|
230
389
|
};
|
|
231
390
|
};
|
|
232
|
-
readonly
|
|
391
|
+
readonly Blob: {
|
|
233
392
|
readonly kind: "typeConstructor";
|
|
234
|
-
readonly documentation: "Binary data
|
|
393
|
+
readonly documentation: "Binary data read as a Uint8Array, stored as SQLite blob.";
|
|
235
394
|
readonly output: {
|
|
236
395
|
readonly codecId: "sqlite/blob@1";
|
|
237
396
|
};
|
|
238
397
|
};
|
|
398
|
+
readonly PlainJson: {
|
|
399
|
+
readonly kind: "typeConstructor";
|
|
400
|
+
readonly documentation: "A JSON value, serialized and stored as SQLite text.";
|
|
401
|
+
readonly output: {
|
|
402
|
+
readonly codecId: "sqlite/json@1";
|
|
403
|
+
};
|
|
404
|
+
};
|
|
239
405
|
};
|
|
240
406
|
//#endregion
|
|
241
407
|
export { sqliteScalarTypeConstructors as n, sqliteControlTargetDescriptor as t };
|
|
242
|
-
//# sourceMappingURL=control-
|
|
408
|
+
//# sourceMappingURL=control-CtCvtwJx.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-CtCvtwJx.d.mts","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/control.d.mts"],"mappings":";;;;;;cAKc,+BAA+B,qCAAqC,yBAAyB,SAAS;;;;;;cAMtG;WACH;aACE;aACA;aACA;eACE;eACA;eACA;eACA;eACA;;eAEA;eACA;eACA;eACA;eACA;;aAEF;eACE;iBACE;iBACA;;eAEF;;eAEA;iBACE;iBACA;;eAEF;;eAEA;iBACE;iBACA;;eAEF;;;WAGJ;aACE;aACA;aACA;eACE;eACA;eACA;eACA;eACA;;eAEA;eACA;eACA;eACA;eACA;;aAEF;eACE;iBACE;iBACA;;eAEF;;eAEA;iBACE;iBACA;;eAEF;;;WAGJ;aACE;aACA;aACA;eACE;eACA;eACA;eACA;eACA;;eAEA;eACA;eACA;eACA;eACA;;aAEF;eACE;iBACE;iBACA;;eAEF;;eAEA;iBACE;iBACA;;eAEF;;;WAGJ;aACE;aACA;aACA;eACE;eACA;eACA;eACA;eACA;;eAEA;eACA;eACA;eACA;eACA;;aAEF;eACE;iBACE;iBACA;;eAEF;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;eACE;;aAEF;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;eACA;eACA;eACA;eACA;;aAEF;eACE;iBACE;;eAEF;;;WAGJ;aACE;aACA;aACA;eACE;eACA;eACA;eACA;eACA;;eAEA;eACA;eACA;eACA;eACA;;aAEF;eACE;iBACE;iBACA;;eAEF;;eAEA;iBACE;iBACA;;eAEF;;;WAGJ;aACE;aACA;aACA;eACE;eACA;eACA;eACA;eACA;;aAEF;eACE;iBACE;;eAEF;;;WAGJ;aACE;aACA;aACA;eACE;eACA;eACA;eACA;eACA;;aAEF;eACE;iBACE;;eAEF;;;WAGJ;aACE;aACA;aACA;eACE;eACA;eACA;eACA;eACA;;aAEF;eACE;iBACE;;eAEF;;;WAGJ;aACE;aACA;aACA;eACE;eACA;eACA;eACA;eACA;;aAEF;eACE;iBACE;;eAEF;;;WAGJ;aACE;aACA;aACA;eACE;eACA;eACA;eACA;eACA;;aAEF;eACE;iBACE;;eAEF;;;WAGJ;aACE;aACA;aACA;eACE;eACA;eACA;eACA;eACA;;aAEF;eACE;iBACE;;eAEF;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./codecs-
|
|
1
|
+
import { s as SqliteCodecRegistry } from "./codecs-DBQsDiM--Cy-r45H3.mjs";
|
|
2
|
+
import "./codecs-Dou3fR1K.mjs";
|
|
3
3
|
import { r as SqliteDdlNode } from "./nodes-D8EC1yCx-BS-fKla6.mjs";
|
|
4
4
|
import "./ddl-31OBcTco.mjs";
|
|
5
5
|
import "./default-normalizer-CtNsZNRZ.mjs";
|
|
@@ -100,4 +100,4 @@ declare class SqliteControlAdapter implements SqlControlAdapter<'sqlite'> {
|
|
|
100
100
|
declare const sqliteAdapterDescriptor: SqlControlAdapterDescriptor<'sqlite'>;
|
|
101
101
|
//#endregion
|
|
102
102
|
export { sqliteAdapterDescriptor as n, SqliteControlAdapter as t };
|
|
103
|
-
//# sourceMappingURL=control-
|
|
103
|
+
//# sourceMappingURL=control-DfWteXy-.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-
|
|
1
|
+
{"version":3,"file":"control-DfWteXy-.d.mts","names":[],"sources":["../../../../3-targets/sqlite/2-adapter/dist/control.d.mts"],"mappings":";;;;;;;;;;;;;;;cAac,gCAAgC;WACnC;WACA;WACA;mBACQ;mBACA;;EAEjB,YAAY,eAAe,qBAAqB,4BAA4B;EAC5E,yCAAyC;EACzC,uCAAuC;;;;;;;;;EASvC,MAAM,KAAK,cAAc,eAAe,SAAS,0BAA0B;EAC3E,oBAAoB,QAAQ,WAAW,gBAAgB;;;;;;;;EAQvD,sBAAsB,KAAK,cAAc,eAAe,UAAU,0BAA0B,QAAQ;;;;;;EAMpG,WAAW,QAAQ,oCAAoC,gBAAgB,QAAQ;EAC/E,wBAAwB,QAAQ,oCAAoC,gBAAgB,QAAQ;;;;;;EAM5F,eAAe,QAAQ,qCAAqC,QAAQ,oBAAoB;UAChF;;;;;;EAMR,WAAW,QAAQ,oCAAoC,iBAAiB,iBAAiB;UACjF;;;;;;EAMR,aAAa,QAAQ,oCAAoC,eAAe,aAAa,eAAe;EACpG,WAAW,QAAQ,oCAAoC,eAAe,aAAa,oBAAoB;;;;;EAKvG,aAAa,QAAQ,oCAAoC,eAAe,sBAAsB,aAAa,oBAAoB;UACvH;EACR,gBAAgB,GAAG,QAAQ,oCAAoC,UAAU,QAAQ,KAAK,QAAQ;EAC9F,WAAW,SAAS,qCAAqC;;;;EAIzD,iBAAiB,QAAQ,oCAAoC,eAAe;aACjE;aACA;aACA;aACA;aACA;aACA;MACP;UACI;;;;UAIA;EACR,WAAW,QAAQ,oCAAoC,qBAAqB,QAAQ;;;;cAIxE,yBAAyB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as sqliteDriverDescriptorMeta, i as safeIntegersAsNumbers, n as normalizeSqliteError, o as sqliteParams, r as prepareExact, s as wasClosedByDriver, t as closeDatabase } from "./descriptor-meta-CkiPlqDS-n3hDP01X.mjs";
|
|
2
|
+
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
2
3
|
import { errorRuntime } from "@prisma/orm-framework/errors/execution";
|
|
3
4
|
import { DatabaseSync } from "node:sqlite";
|
|
4
5
|
import { pathToFileURL } from "node:url";
|
|
@@ -15,7 +16,7 @@ var SqliteControlDriver = class {
|
|
|
15
16
|
}
|
|
16
17
|
async query(sql, params) {
|
|
17
18
|
try {
|
|
18
|
-
return { rows: this.db
|
|
19
|
+
return { rows: blindCast(prepareExact(this.db, sql).all(...sqliteParams(params)).map(safeIntegersAsNumbers)) };
|
|
19
20
|
} catch (error) {
|
|
20
21
|
throw normalizeSqliteError(error, wasClosedByDriver(this.db));
|
|
21
22
|
}
|
|
@@ -57,4 +58,4 @@ const sqliteDriverDescriptor = {
|
|
|
57
58
|
//#endregion
|
|
58
59
|
export { sqliteDriverDescriptor as n, SqliteControlDriver as t };
|
|
59
60
|
|
|
60
|
-
//# sourceMappingURL=control-
|
|
61
|
+
//# sourceMappingURL=control-V3kPfMTR.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-V3kPfMTR.mjs","names":[],"sources":["../../../../3-targets/sqlite/3-driver/dist/control.mjs"],"sourcesContent":["import { a as safeIntegersAsNumbers, i as prepareExact, n as sqliteParams, o as closeDatabase, r as normalizeSqliteError, s as wasClosedByDriver, t as sqliteDriverDescriptorMeta } from \"./descriptor-meta-CkiPlqDS.mjs\";\nimport { DatabaseSync } from \"node:sqlite\";\nimport { pathToFileURL } from \"node:url\";\nimport { errorRuntime } from \"@internal/errors/execution\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { basename } from \"pathe\";\n//#region src/core/migrations/control-driver.ts\nvar SqliteControlDriver = class {\n\tdb;\n\tlocation;\n\tfamilyId = \"sql\";\n\ttargetId = \"sqlite\";\n\tconstructor(db, location) {\n\t\tthis.db = db;\n\t\tthis.location = location;\n\t}\n\tasync query(sql, params) {\n\t\ttry {\n\t\t\treturn { rows: blindCast(prepareExact(this.db, sql).all(...sqliteParams(params)).map(safeIntegersAsNumbers)) };\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error, wasClosedByDriver(this.db));\n\t\t}\n\t}\n\tasync databaseName() {\n\t\tif (this.location === \":memory:\" || this.location.length === 0) return;\n\t\tconst name = basename(this.location);\n\t\treturn name.length > 0 ? name : void 0;\n\t}\n\tasync close() {\n\t\tcloseDatabase(this.db);\n\t}\n};\n/** The file as a URI that SQLite opens for reading and writing, failing rather than creating it. */\nfunction existingFileOnly(pathOrMemory) {\n\tif (pathOrMemory === \":memory:\") return pathOrMemory;\n\tconst uri = pathToFileURL(pathOrMemory);\n\turi.searchParams.set(\"mode\", \"rw\");\n\treturn uri;\n}\nconst sqliteDriverDescriptor = {\n\t...sqliteDriverDescriptorMeta,\n\tasync create(pathOrMemory, options) {\n\t\ttry {\n\t\t\tconst db = new DatabaseSync(options?.existingDatabaseOnly === true ? existingFileOnly(pathOrMemory) : pathOrMemory);\n\t\t\tdb.exec(\"PRAGMA foreign_keys = ON\");\n\t\t\tdb.exec(\"PRAGMA busy_timeout = 5000\");\n\t\t\treturn new SqliteControlDriver(db, pathOrMemory);\n\t\t} catch (error) {\n\t\t\tthrow errorRuntime(\"DRIVER.CONNECTION_FAILED\", \"Database connection failed\", {\n\t\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\t\tfix: \"Verify the database file path exists and is accessible\",\n\t\t\t\tmeta: { path: pathOrMemory },\n\t\t\t\tcause: error\n\t\t\t});\n\t\t}\n\t}\n};\n//#endregion\nexport { SqliteControlDriver, sqliteDriverDescriptor as default };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;AAOA,IAAI,sBAAsB,MAAM;CAC/B;CACA;CACA,WAAW;CACX,WAAW;CACX,YAAY,IAAI,UAAU;EACzB,KAAK,KAAK;EACV,KAAK,WAAW;CACjB;CACA,MAAM,MAAM,KAAK,QAAQ;EACxB,IAAI;GACH,OAAO,EAAE,MAAM,UAAU,aAAa,KAAK,IAAI,GAAG,CAAC,CAAC,IAAI,GAAG,aAAa,MAAM,CAAC,CAAC,CAAC,IAAI,qBAAqB,CAAC,EAAE;EAC9G,SAAS,OAAO;GACf,MAAM,qBAAqB,OAAO,kBAAkB,KAAK,EAAE,CAAC;EAC7D;CACD;CACA,MAAM,eAAe;EACpB,IAAI,KAAK,aAAa,cAAc,KAAK,SAAS,WAAW,GAAG;EAChE,MAAM,OAAO,SAAS,KAAK,QAAQ;EACnC,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK;CACtC;CACA,MAAM,QAAQ;EACb,cAAc,KAAK,EAAE;CACtB;AACD;;AAEA,SAAS,iBAAiB,cAAc;CACvC,IAAI,iBAAiB,YAAY,OAAO;CACxC,MAAM,MAAM,cAAc,YAAY;CACtC,IAAI,aAAa,IAAI,QAAQ,IAAI;CACjC,OAAO;AACR;AACA,MAAM,yBAAyB;CAC9B,GAAG;CACH,MAAM,OAAO,cAAc,SAAS;EACnC,IAAI;GACH,MAAM,KAAK,IAAI,aAAa,SAAS,yBAAyB,OAAO,iBAAiB,YAAY,IAAI,YAAY;GAClH,GAAG,KAAK,0BAA0B;GAClC,GAAG,KAAK,4BAA4B;GACpC,OAAO,IAAI,oBAAoB,IAAI,YAAY;EAChD,SAAS,OAAO;GACf,MAAM,aAAa,4BAA4B,8BAA8B;IAC5E,KAAK,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;IAC1D,KAAK;IACL,MAAM,EAAE,MAAM,aAAa;IAC3B,OAAO;GACR,CAAC;EACF;CACD;AACD"}
|
package/dist/{data-type-entries-B6YmbQDH-RnV5wVv8.mjs → data-type-entries-C0WkKiPF-CKPYj4OT.mjs}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as sqliteTimeText, S as sqliteTime, _ as sqliteInteger, b as sqliteText, c as sqliteDate, d as sqliteDatetimeText, g as sqliteDurationText, h as sqliteDuration, l as sqliteDateText, n as sqliteBlobFromHexText, r as sqliteBoolean, t as sqliteBlob, u as sqliteDatetime, v as sqliteJson, y as sqliteReal } from "./data-types-C_NKe4Ni-D7r8QkSb.mjs";
|
|
2
2
|
import { createNumberClassifier, numeralText, parseJsonText, signedRange } from "@prisma/orm-framework/components/codec";
|
|
3
|
+
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
3
4
|
import { canonicalizeJson } from "@prisma/orm-framework/components/utils";
|
|
4
|
-
//#region ../../../3-targets/sqlite/1-target/dist/data-type-entries-
|
|
5
|
+
//#region ../../../3-targets/sqlite/1-target/dist/data-type-entries-C0WkKiPF.mjs
|
|
5
6
|
const classifySqliteNumber = createNumberClassifier({
|
|
6
7
|
integers: [{
|
|
7
8
|
type: sqliteInteger.id,
|
|
@@ -20,6 +21,13 @@ const classifySqliteNumber = createNumberClassifier({
|
|
|
20
21
|
function printNumber(value) {
|
|
21
22
|
return typeof value === "number" ? numeralText(value) : String(value);
|
|
22
23
|
}
|
|
24
|
+
function readBoolean(text) {
|
|
25
|
+
if (text === "true" || text === "false") return text === "true";
|
|
26
|
+
throw structuredError("CONTRACT.CAST_REFUSED", `"${text}" is not a boolean.`, {
|
|
27
|
+
why: "The only text a boolean reads is true or false.",
|
|
28
|
+
fix: "Use true or false."
|
|
29
|
+
});
|
|
30
|
+
}
|
|
23
31
|
function sqliteDataTypeEntries() {
|
|
24
32
|
return {
|
|
25
33
|
[sqliteText.id]: {
|
|
@@ -41,6 +49,15 @@ function sqliteDataTypeEntries() {
|
|
|
41
49
|
print: printNumber,
|
|
42
50
|
documentation: "A number, whose type comes from its own size and precision."
|
|
43
51
|
},
|
|
52
|
+
[sqliteBoolean.id]: {
|
|
53
|
+
written: {
|
|
54
|
+
kind: "plain",
|
|
55
|
+
syntax: "boolean",
|
|
56
|
+
parse: readBoolean
|
|
57
|
+
},
|
|
58
|
+
print: (value) => String(value),
|
|
59
|
+
documentation: "A boolean, written true or false."
|
|
60
|
+
},
|
|
44
61
|
[sqliteJson.id]: {
|
|
45
62
|
written: {
|
|
46
63
|
kind: "tag",
|
|
@@ -100,4 +117,4 @@ function sqliteDataTypeEntries() {
|
|
|
100
117
|
//#endregion
|
|
101
118
|
export { sqliteDataTypeEntries as t };
|
|
102
119
|
|
|
103
|
-
//# sourceMappingURL=data-type-entries-
|
|
120
|
+
//# sourceMappingURL=data-type-entries-C0WkKiPF-CKPYj4OT.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-type-entries-C0WkKiPF-CKPYj4OT.mjs","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/data-type-entries-C0WkKiPF.mjs"],"sourcesContent":["import { C as sqliteTimeText, S as sqliteTime, _ as sqliteInteger, b as sqliteText, c as sqliteDate, d as sqliteDatetimeText, g as sqliteDurationText, h as sqliteDuration, l as sqliteDateText, n as sqliteBlobFromHexText, r as sqliteBoolean, t as sqliteBlob, u as sqliteDatetime, v as sqliteJson, y as sqliteReal } from \"./data-types-C_NKe4Ni.mjs\";\nimport { createNumberClassifier, numeralText, parseJsonText, signedRange } from \"@internal/framework-components/codec\";\nimport { canonicalizeJson } from \"@internal/framework-components/utils\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/core/data-type-entries.ts\nconst classifySqliteNumber = createNumberClassifier({\n\tintegers: [{\n\t\ttype: sqliteInteger.id,\n\t\tform: \"text\",\n\t\t...signedRange(64)\n\t}],\n\tfraction: {\n\t\ttype: sqliteReal.id,\n\t\tform: \"number\"\n\t},\n\twords: {\n\t\ttype: sqliteReal.id,\n\t\tform: \"text\"\n\t}\n});\nfunction printNumber(value) {\n\treturn typeof value === \"number\" ? numeralText(value) : String(value);\n}\nfunction readBoolean(text) {\n\tif (text === \"true\" || text === \"false\") return text === \"true\";\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `\"${text}\" is not a boolean.`, {\n\t\twhy: \"The only text a boolean reads is true or false.\",\n\t\tfix: \"Use true or false.\"\n\t});\n}\nfunction sqliteDataTypeEntries() {\n\treturn {\n\t\t[sqliteText.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"plain\",\n\t\t\t\tsyntax: \"string\",\n\t\t\t\tparse: (text) => text\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"Text.\"\n\t\t},\n\t\t[sqliteReal.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"plain\",\n\t\t\t\tsyntax: \"number\",\n\t\t\t\ttypes: [sqliteInteger.id, sqliteReal.id],\n\t\t\t\tclassify: classifySqliteNumber\n\t\t\t},\n\t\t\tprint: printNumber,\n\t\t\tdocumentation: \"A number, whose type comes from its own size and precision.\"\n\t\t},\n\t\t[sqliteBoolean.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"plain\",\n\t\t\t\tsyntax: \"boolean\",\n\t\t\t\tparse: readBoolean\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"A boolean, written true or false.\"\n\t\t},\n\t\t[sqliteJson.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"tag\",\n\t\t\t\ttag: \"json\",\n\t\t\t\tparse: (text) => canonicalizeJson(parseJsonText(text))\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"Reads the text as a JSON document and stores its JSON text as the default value.\"\n\t\t},\n\t\t[sqliteBlob.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"tag\",\n\t\t\t\ttag: \"blob\",\n\t\t\t\tparse: sqliteBlobFromHexText\n\t\t\t},\n\t\t\tprint: (value) => String(value).toLowerCase(),\n\t\t\tdocumentation: \"Bytes, written as hex text, two digits for each byte, as in blob`68656c6c6f`.\"\n\t\t},\n\t\t[sqliteDatetime.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"tag\",\n\t\t\t\ttag: \"datetime\",\n\t\t\t\tparse: sqliteDatetimeText\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"An instant, as in datetime`2024-01-01T00:00:00Z`. Reads ISO 8601 with a UTC offset and stores the instant in UTC with three fraction digits, the text every row holds.\"\n\t\t},\n\t\t[sqliteDate.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"tag\",\n\t\t\t\ttag: \"date\",\n\t\t\t\tparse: sqliteDateText\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"A calendar date, as in date`2024-02-29`, in the years 0000 to 9999, stored as the text every row holds.\"\n\t\t},\n\t\t[sqliteTime.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"tag\",\n\t\t\t\ttag: \"time\",\n\t\t\t\tparse: sqliteTimeText\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"A time of day without a UTC offset, as in time`09:30:00`. Stores it with three fraction digits, as in 09:30:00.000, the text every row holds.\"\n\t\t},\n\t\t[sqliteDuration.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"tag\",\n\t\t\t\ttag: \"duration\",\n\t\t\t\tparse: sqliteDurationText\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"A length of time, as in duration`PT1H30M`. Reads an ISO 8601 duration and stores it as written.\"\n\t\t}\n\t};\n}\n//#endregion\nexport { sqliteDataTypeEntries as t };\n\n//# sourceMappingURL=data-type-entries-C0WkKiPF.mjs.map"],"mappings":";;;;;AAKA,MAAM,uBAAuB,uBAAuB;CACnD,UAAU,CAAC;EACV,MAAM,cAAc;EACpB,MAAM;EACN,GAAG,YAAY,EAAE;CAClB,CAAC;CACD,UAAU;EACT,MAAM,WAAW;EACjB,MAAM;CACP;CACA,OAAO;EACN,MAAM,WAAW;EACjB,MAAM;CACP;AACD,CAAC;AACD,SAAS,YAAY,OAAO;CAC3B,OAAO,OAAO,UAAU,WAAW,YAAY,KAAK,IAAI,OAAO,KAAK;AACrE;AACA,SAAS,YAAY,MAAM;CAC1B,IAAI,SAAS,UAAU,SAAS,SAAS,OAAO,SAAS;CACzD,MAAM,gBAAgB,yBAAyB,IAAI,KAAK,sBAAsB;EAC7E,KAAK;EACL,KAAK;CACN,CAAC;AACF;AACA,SAAS,wBAAwB;CAChC,OAAO;GACL,WAAW,KAAK;GAChB,SAAS;IACR,MAAM;IACN,QAAQ;IACR,QAAQ,SAAS;GAClB;GACA,QAAQ,UAAU,OAAO,KAAK;GAC9B,eAAe;EAChB;GACC,WAAW,KAAK;GAChB,SAAS;IACR,MAAM;IACN,QAAQ;IACR,OAAO,CAAC,cAAc,IAAI,WAAW,EAAE;IACvC,UAAU;GACX;GACA,OAAO;GACP,eAAe;EAChB;GACC,cAAc,KAAK;GACnB,SAAS;IACR,MAAM;IACN,QAAQ;IACR,OAAO;GACR;GACA,QAAQ,UAAU,OAAO,KAAK;GAC9B,eAAe;EAChB;GACC,WAAW,KAAK;GAChB,SAAS;IACR,MAAM;IACN,KAAK;IACL,QAAQ,SAAS,iBAAiB,cAAc,IAAI,CAAC;GACtD;GACA,QAAQ,UAAU,OAAO,KAAK;GAC9B,eAAe;EAChB;GACC,WAAW,KAAK;GAChB,SAAS;IACR,MAAM;IACN,KAAK;IACL,OAAO;GACR;GACA,QAAQ,UAAU,OAAO,KAAK,CAAC,CAAC,YAAY;GAC5C,eAAe;EAChB;GACC,eAAe,KAAK;GACpB,SAAS;IACR,MAAM;IACN,KAAK;IACL,OAAO;GACR;GACA,QAAQ,UAAU,OAAO,KAAK;GAC9B,eAAe;EAChB;GACC,WAAW,KAAK;GAChB,SAAS;IACR,MAAM;IACN,KAAK;IACL,OAAO;GACR;GACA,QAAQ,UAAU,OAAO,KAAK;GAC9B,eAAe;EAChB;GACC,WAAW,KAAK;GAChB,SAAS;IACR,MAAM;IACN,KAAK;IACL,OAAO;GACR;GACA,QAAQ,UAAU,OAAO,KAAK;GAC9B,eAAe;EAChB;GACC,eAAe,KAAK;GACpB,SAAS;IACR,MAAM;IACN,KAAK;IACL,OAAO;GACR;GACA,QAAQ,UAAU,OAAO,KAAK;GAC9B,eAAe;EAChB;CACD;AACD"}
|
|
@@ -41,6 +41,10 @@ declare function sqliteTimeText(text: string): string;
|
|
|
41
41
|
declare function sqliteDatetimeTextAtMilliseconds(text: string): string;
|
|
42
42
|
/** The value of `sqlite/duration`: an ISO 8601 duration, stored as written. Throws `CONTRACT.CAST_REFUSED` for other text. */
|
|
43
43
|
declare function sqliteDurationText(text: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* The value of `sqlite/decimal`: decimal text without an exponent, as in `-12.50`, stored without leading zeros or a minus sign on zero. Trailing zeros stay, because they are the scale the value was written with. Throws `CONTRACT.CAST_REFUSED` for other text.
|
|
46
|
+
*/
|
|
47
|
+
declare function sqliteDecimalText(text: string): string;
|
|
44
48
|
/** An instant, stored as text in the form `toISOString()` writes. */
|
|
45
49
|
declare const sqliteDatetime: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<Readonly<Record<string, unknown>>>;
|
|
46
50
|
/** A calendar date, stored as text in the form `2024-02-29`. */
|
|
@@ -49,6 +53,10 @@ declare const sqliteDate: import("@prisma/orm-family-sql/contract/data-type").Sq
|
|
|
49
53
|
declare const sqliteTime: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<Readonly<Record<string, unknown>>>;
|
|
50
54
|
/** A length of time, stored as the ISO 8601 duration it was written as, `PT1H30M`. Equal durations can be written differently, `P1D` and `PT24H`, so a duration keeps its spelling. */
|
|
51
55
|
declare const sqliteDuration: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<Readonly<Record<string, unknown>>>;
|
|
56
|
+
/** A decimal, stored as text without leading zeros or a minus sign on zero, `12.50`. Text compares by its characters, so `1.5` and `1.50` are different values. A default is written as text, or as a whole number. */
|
|
57
|
+
declare const sqliteDecimal: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<Readonly<Record<string, unknown>>>;
|
|
58
|
+
/** A boolean, stored as the integer 0 or 1, which is what SQLite's own `FALSE` and `TRUE` are. A default is written `true` or `false`. */
|
|
59
|
+
declare const sqliteBoolean: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<Readonly<Record<string, unknown>>>;
|
|
52
60
|
/** A JSON document, stored as its JSON text with sorted keys and no added whitespace. A column declared `JSON` would have numeric affinity and store the document `"42"` as the integer 42. */
|
|
53
61
|
declare const sqliteJson: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<Readonly<Record<string, unknown>>>;
|
|
54
62
|
/** Every data type this target registers. */
|
|
@@ -56,5 +64,5 @@ declare const sqliteDataTypes: readonly DataType[];
|
|
|
56
64
|
/** SQLite's text data types: `text`, `character(n)` and `character varying(n)`. */
|
|
57
65
|
declare const sqliteTextDataTypes: readonly DataTypeId[];
|
|
58
66
|
//#endregion
|
|
59
|
-
export {
|
|
60
|
-
//# sourceMappingURL=data-types-
|
|
67
|
+
export { sqliteTime as C, sqliteTextDataTypes as S, sqliteDurationText as _, sqliteCharacterLengthParams as a, sqliteReal as b, sqliteDataTypes as c, sqliteDatetime as d, sqliteDatetimeText as f, sqliteDuration as g, sqliteDecimalText as h, sqliteCharacter as i, sqliteDate as l, sqliteDecimal as m, sqliteBlobFromHexText as n, sqliteCharacterVarying as o, sqliteDatetimeTextAtMilliseconds as p, sqliteBoolean as r, sqliteDataTypeEntries as s, sqliteBlob as t, sqliteDateText as u, sqliteInteger as v, sqliteTimeText as w, sqliteText as x, sqliteJson as y };
|
|
68
|
+
//# sourceMappingURL=data-types-C1nzwKt7.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-types-
|
|
1
|
+
{"version":3,"file":"data-types-C1nzwKt7.d.mts","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/data-types.d.mts"],"mappings":";;;;iBAGiB,yBAAyB,SAAS,eAAe;;;cAGpD,uDAAuD,YAAY,SAAS;;cAE5E,0DAA0D,YAAY,SAAS;;cAE/E,uDAAuD,YAAY,SAAS;cAC5E,uDAAuD,YAAY,SAAS;;iBAEzE,sBAAsB;;cAEzB,2EAA2E;EACvF;;cAEY,4DAA4D;EACxE;;cAEY,mEAAmE;EAC/E;;;;;cAKY,qBAAqB;;;;iBAIlB,eAAe;;;;iBAIf,eAAe;;;;iBAIf,iCAAiC;;iBAEjC,mBAAmB;;;;iBAInB,kBAAkB;;cAErB,2DAA2D,YAAY,SAAS;;cAEhF,uDAAuD,YAAY,SAAS;;cAE5E,uDAAuD,YAAY,SAAS;;cAE5E,2DAA2D,YAAY,SAAS;;cAEhF,0DAA0D,YAAY,SAAS;;cAE/E,0DAA0D,YAAY,SAAS;;cAE/E,uDAAuD,YAAY,SAAS;;cAE5E,0BAA0B;;cAE1B,8BAA8B"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { INT64_RANGE, castUnchanged, dateTimeStoredText, isoDateStringText, readJsonFloat, readJsonIntegerText, readJsonMatching, readJsonString, refuseJsonValue, refuseWrongShape } from "@prisma/orm-framework/components/codec";
|
|
1
|
+
import { INT64_RANGE, castUnchanged, dateTimeStoredText, isoDateStringText, readJsonBoolean, readJsonFloat, readJsonIntegerText, readJsonMatching, readJsonString, refuseJsonValue, refuseWrongShape } from "@prisma/orm-framework/components/codec";
|
|
2
2
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
3
3
|
import { canonicalizeJson } from "@prisma/orm-framework/components/utils";
|
|
4
4
|
import { sqlDataType, sqlRawDataType } from "@prisma/orm-family-sql/contract/data-type";
|
|
5
5
|
import { withThreeFractionDigits, withoutZerosBelowAMillisecond } from "@prisma/orm-framework/type-implementations/date";
|
|
6
|
+
import { isDecimalText, printedDecimalText } from "@prisma/orm-framework/type-implementations/decimal";
|
|
6
7
|
import { ISO_DURATION_AS_WRITTEN } from "@prisma/orm-framework/type-implementations/duration";
|
|
7
8
|
import { type } from "arktype";
|
|
8
|
-
//#region ../../../3-targets/sqlite/1-target/dist/data-types-
|
|
9
|
+
//#region ../../../3-targets/sqlite/1-target/dist/data-types-C_NKe4Ni.mjs
|
|
9
10
|
/** Digit text as `real` stores it: the nearest double, as SQLite converts an integer to a real. */
|
|
10
11
|
const asReal = (value) => typeof value === "string" ? Number(value) : refuseWrongShape(value, "digit text");
|
|
11
12
|
/** A type written and reported by `name` and nothing else. */
|
|
@@ -130,6 +131,16 @@ function sqliteDurationText(text) {
|
|
|
130
131
|
fix: "Write the duration in ISO 8601, as in \"P1Y2M3DT4H5M6.5S\"."
|
|
131
132
|
});
|
|
132
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* The value of `sqlite/decimal`: decimal text without an exponent, as in `-12.50`, stored without leading zeros or a minus sign on zero. Trailing zeros stay, because they are the scale the value was written with. Throws `CONTRACT.CAST_REFUSED` for other text.
|
|
136
|
+
*/
|
|
137
|
+
function sqliteDecimalText(text) {
|
|
138
|
+
if (isDecimalText(text)) return printedDecimalText(text);
|
|
139
|
+
throw structuredError("CONTRACT.CAST_REFUSED", `sqlite/decimal cannot read "${text}". Write decimal text, as in "12.50".`, {
|
|
140
|
+
why: "sqlite/decimal holds decimal text: an optional minus sign, digits, and an optional fraction, with no exponent.",
|
|
141
|
+
fix: "Write the decimal as text, as in \"12.50\" or \"-3\"."
|
|
142
|
+
});
|
|
143
|
+
}
|
|
133
144
|
/** What `read` writes for `text`, or `undefined` when `read` refuses it. */
|
|
134
145
|
function storedOrUndefined(read, text) {
|
|
135
146
|
try {
|
|
@@ -175,6 +186,21 @@ const sqliteDate = storedTextDataType("sqlite/date", sqliteDateText, "ISO 8601 d
|
|
|
175
186
|
const sqliteTime = storedTextDataType("sqlite/time", sqliteTimeText, "ISO 8601 time of day text with at most three fraction digits, as in \"09:30:00\"", { respell: true });
|
|
176
187
|
/** A length of time, stored as the ISO 8601 duration it was written as, `PT1H30M`. Equal durations can be written differently, `P1D` and `PT24H`, so a duration keeps its spelling. */
|
|
177
188
|
const sqliteDuration = storedTextDataType("sqlite/duration", sqliteDurationText, "an ISO 8601 duration, as in \"PT1H30M\"", { respell: false });
|
|
189
|
+
/** A decimal, stored as text without leading zeros or a minus sign on zero, `12.50`. Text compares by its characters, so `1.5` and `1.50` are different values. A default is written as text, or as a whole number. */
|
|
190
|
+
const sqliteDecimal = sqlDataType("sqlite/decimal", {
|
|
191
|
+
storedAs: sqliteText.id,
|
|
192
|
+
read: (json) => typeof json === "string" && isDecimalText(json) ? json : refuseJsonValue("sqlite/decimal", "decimal text, as in \"12.50\"", json),
|
|
193
|
+
spell: (json) => typeof json === "string" ? printedDecimalText(json) : json,
|
|
194
|
+
casts: {
|
|
195
|
+
[sqliteText.id]: (value) => typeof value === "string" ? sqliteDecimalText(value) : refuseWrongShape(value, "text"),
|
|
196
|
+
[sqliteInteger.id]: castUnchanged
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
/** A boolean, stored as the integer 0 or 1, which is what SQLite's own `FALSE` and `TRUE` are. A default is written `true` or `false`. */
|
|
200
|
+
const sqliteBoolean = sqlDataType("sqlite/boolean", {
|
|
201
|
+
storedAs: sqliteInteger.id,
|
|
202
|
+
read: (json) => readJsonBoolean("sqlite/boolean", json)
|
|
203
|
+
});
|
|
178
204
|
/** A JSON document, stored as its JSON text with sorted keys and no added whitespace. A column declared `JSON` would have numeric affinity and store the document `"42"` as the integer 42. */
|
|
179
205
|
const sqliteJson = sqlDataType("sqlite/json", {
|
|
180
206
|
storedAs: sqliteText.id,
|
|
@@ -194,6 +220,8 @@ const sqliteDataTypes = [
|
|
|
194
220
|
sqliteTime,
|
|
195
221
|
sqliteDuration,
|
|
196
222
|
sqliteJson,
|
|
223
|
+
sqliteDecimal,
|
|
224
|
+
sqliteBoolean,
|
|
197
225
|
sqlRawDataType
|
|
198
226
|
];
|
|
199
227
|
/** SQLite's text data types: `text`, `character(n)` and `character varying(n)`. */
|
|
@@ -203,6 +231,6 @@ const sqliteTextDataTypes = [
|
|
|
203
231
|
sqliteCharacterVarying.id
|
|
204
232
|
];
|
|
205
233
|
//#endregion
|
|
206
|
-
export {
|
|
234
|
+
export { sqliteTimeText as C, sqliteTime as S, sqliteInteger as _, sqliteCharacterLengthParams as a, sqliteText as b, sqliteDate as c, sqliteDatetimeText as d, sqliteDatetimeTextAtMilliseconds as f, sqliteDurationText as g, sqliteDuration as h, sqliteCharacter as i, sqliteDateText as l, sqliteDecimalText as m, sqliteBlobFromHexText as n, sqliteCharacterVarying as o, sqliteDecimal as p, sqliteBoolean as r, sqliteDataTypes as s, sqliteBlob as t, sqliteDatetime as u, sqliteJson as v, sqliteTextDataTypes as x, sqliteReal as y };
|
|
207
235
|
|
|
208
|
-
//# sourceMappingURL=data-types-
|
|
236
|
+
//# sourceMappingURL=data-types-C_NKe4Ni-D7r8QkSb.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-types-C_NKe4Ni-D7r8QkSb.mjs","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/data-types-C_NKe4Ni.mjs"],"sourcesContent":["import { INT64_RANGE, castUnchanged, dateTimeStoredText, isoDateStringText, readJsonBoolean, readJsonFloat, readJsonIntegerText, readJsonMatching, readJsonString, refuseJsonValue, refuseWrongShape } from \"@internal/framework-components/codec\";\nimport { canonicalizeJson } from \"@internal/framework-components/utils\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { sqlDataType, sqlRawDataType } from \"@internal/sql-contract/data-type\";\nimport { withThreeFractionDigits, withoutZerosBelowAMillisecond } from \"@internal/type-implementations/date\";\nimport { isDecimalText, printedDecimalText } from \"@internal/type-implementations/decimal\";\nimport { ISO_DURATION_AS_WRITTEN } from \"@internal/type-implementations/duration\";\nimport { type } from \"arktype\";\n//#region src/core/data-types.ts\n/** Digit text as `real` stores it: the nearest double, as SQLite converts an integer to a real. */\nconst asReal = (value) => typeof value === \"string\" ? Number(value) : refuseWrongShape(value, \"digit text\");\n/** A type written and reported by `name` and nothing else. */\nconst storedAs = (id, name, read, casts = {}) => sqlDataType(id, {\n\ttexts: [{\n\t\ttext: name,\n\t\twritten: true,\n\t\tcatalog: true\n\t}],\n\tread,\n\tcasts\n});\nconst readText = (json) => readJsonString(\"sqlite/text\", json);\nconst UPPERCASE_HEX = /^(?:[0-9A-F]{2})*$/;\nconst sqliteText = storedAs(\"sqlite/text\", \"text\", readText);\n/** Digit text, which holds every 64-bit integer exactly; SQLite reads an INTEGER default back as a number. */\nconst sqliteInteger = sqlDataType(\"sqlite/integer\", {\n\ttexts: [{\n\t\ttext: \"integer\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}],\n\tread: (json) => {\n\t\treadJsonIntegerText(\"sqlite/integer\", json, INT64_RANGE);\n\t\treturn json;\n\t},\n\tcasts: {}\n});\n/** SQLite cannot store NaN, but a codec refuses it, as ADR 254 places that limit, so the type reads it. */\nconst sqliteReal = storedAs(\"sqlite/real\", \"real\", (json) => {\n\treadJsonFloat(\"sqlite/real\", json);\n\treturn json;\n}, { [sqliteInteger.id]: asReal });\nconst sqliteBlob = storedAs(\"sqlite/blob\", \"blob\", (json) => readJsonMatching(\"sqlite/blob\", json, UPPERCASE_HEX, \"uppercase hexadecimal text\"), {});\nconst HEX_TEXT = /^(?:[0-9A-Fa-f]{2})*$/;\n/** The upper-case hex `sqlite/blob` stores for the hex text a `blob` tag holds, `68656c6c6f`. */\nfunction sqliteBlobFromHexText(text) {\n\tif (!HEX_TEXT.test(text)) throw structuredError(\"CONTRACT.CAST_REFUSED\", `\"${text}\" is not hex text: write two hexadecimal digits for each byte, as in blob\\`68656c6c6f\\`.`, {\n\t\twhy: \"The blob tag reads bytes as hex text, two digits for each byte.\",\n\t\tfix: \"Write the bytes in hex, as in blob`68656c6c6f`.\"\n\t});\n\treturn text.toUpperCase();\n}\n/** The length of `character` and `character varying`, which SQLite accepts and does not enforce, up to SQLite's largest string length, so a double holds every accepted length exactly. */\nconst sqliteCharacterLengthParams = type({ \"length?\": `number.integer >= 1 & number.integer <= 2147483647` });\n/** A character type is written without its length, so its normal form has none. */\nconst withoutLength = ({ length: _length, ...rest }) => rest;\nconst sqliteCharacter = sqlDataType(\"sqlite/character\", {\n\tparams: sqliteCharacterLengthParams,\n\ttexts: [{\n\t\ttext: \"character\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}],\n\tread: (json) => readJsonString(\"sqlite/character\", json),\n\tnormalize: withoutLength,\n\tcasts: { [sqliteText.id]: castUnchanged }\n});\nconst sqliteCharacterVarying = sqlDataType(\"sqlite/character-varying\", {\n\tparams: sqliteCharacterLengthParams,\n\ttexts: [{\n\t\ttext: \"character varying\",\n\t\twritten: true,\n\t\tcatalog: true\n\t}],\n\tread: (json) => readJsonString(\"sqlite/character-varying\", json),\n\tnormalize: withoutLength,\n\tcasts: { [sqliteText.id]: castUnchanged }\n});\n/**\n* The value of `sqlite/datetime` (ADR 254): the text `toISOString()` writes for every row. The range and the millisecond precision are those of a JavaScript `Date`, the codec's value.\n*/\nconst sqliteDatetimeText = (text) => isoDateStringText(text, \"sqlite/datetime\");\n/** What `sqliteDatetimeText` writes for `text`, or `undefined` when it names no instant the type holds. */\nfunction storedDatetime(text) {\n\ttry {\n\t\treturn sqliteDatetimeText(text);\n\t} catch {\n\t\treturn;\n\t}\n}\n/** Reads an instant in any spelling the `datetime` tag reads; `spellDatetime` gives it the one it stores. */\nconst readDatetime = (json) => typeof json === \"string\" && storedDatetime(json) !== void 0 ? json : refuseJsonValue(\"sqlite/datetime\", \"ISO 8601 date and time text with a UTC offset and at most three fraction digits, as in \\\"2024-01-01T00:00:00Z\\\"\", json);\n/** An instant is stored in UTC with three fraction digits. */\nconst spellDatetime = (json) => typeof json === \"string\" ? storedDatetime(json) ?? json : json;\n/** The years SQLite's date and time functions read, which are also the years whose text sorts in date order. */\nconst SQLITE_DATE_RANGE = {\n\tearliest: \"0000-01-01\",\n\tlatest: \"9999-12-31\"\n};\n/**\n* The value of `sqlite/date`: a calendar date as ISO 8601 text, `2024-02-29`, in the years `0000` to `9999` that SQLite's `date()` reads. Throws `CONTRACT.CAST_REFUSED` for text that names no such date.\n*/\nfunction sqliteDateText(text) {\n\treturn dateTimeStoredText(text, {\n\t\tshape: \"date\",\n\t\townerId: \"sqlite/date\",\n\t\trange: SQLITE_DATE_RANGE\n\t});\n}\n/**\n* The value of `sqlite/time`: a time of day with exactly three fraction digits, `09:30:00.000`, as SQLite's `strftime('%H:%M:%f')` writes it, so the text sorts in the order of the times. Zeros past the third fraction digit are dropped; any other digit there is refused. Throws `CONTRACT.CAST_REFUSED` for text that names no such time.\n*/\nfunction sqliteTimeText(text) {\n\treturn withThreeFractionDigits(dateTimeStoredText(withoutZerosBelowAMillisecond(text), {\n\t\tshape: \"time\",\n\t\townerId: \"sqlite/time\",\n\t\tmaxFractionDigits: 3\n\t}, text));\n}\n/**\n* An instant as `sqlite/datetime` stores it, from ISO 8601 text with a UTC offset in which zeros past the third fraction digit are dropped. Throws `CONTRACT.CAST_REFUSED` for text that names no instant the type holds, including text with a digit below a millisecond.\n*/\nfunction sqliteDatetimeTextAtMilliseconds(text) {\n\treturn sqliteDatetimeText(withoutZerosBelowAMillisecond(text));\n}\n/** The value of `sqlite/duration`: an ISO 8601 duration, stored as written. Throws `CONTRACT.CAST_REFUSED` for other text. */\nfunction sqliteDurationText(text) {\n\tif (ISO_DURATION_AS_WRITTEN.test(text)) return text;\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `sqlite/duration cannot read \"${text}\". Write an ISO 8601 duration, as in \"PT1H30M\".`, {\n\t\twhy: \"sqlite/duration holds an ISO 8601 duration as Temporal.Duration writes it: an optional sign, P, then years, months, weeks and days, then T and hours, minutes and seconds. A sign on each component instead is read too.\",\n\t\tfix: \"Write the duration in ISO 8601, as in \\\"P1Y2M3DT4H5M6.5S\\\".\"\n\t});\n}\n/**\n* The value of `sqlite/decimal`: decimal text without an exponent, as in `-12.50`, stored without leading zeros or a minus sign on zero. Trailing zeros stay, because they are the scale the value was written with. Throws `CONTRACT.CAST_REFUSED` for other text.\n*/\nfunction sqliteDecimalText(text) {\n\tif (isDecimalText(text)) return printedDecimalText(text);\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `sqlite/decimal cannot read \"${text}\". Write decimal text, as in \"12.50\".`, {\n\t\twhy: \"sqlite/decimal holds decimal text: an optional minus sign, digits, and an optional fraction, with no exponent.\",\n\t\tfix: \"Write the decimal as text, as in \\\"12.50\\\" or \\\"-3\\\".\"\n\t});\n}\n/** What `read` writes for `text`, or `undefined` when `read` refuses it. */\nfunction storedOrUndefined(read, text) {\n\ttry {\n\t\treturn read(text);\n\t} catch {\n\t\treturn;\n\t}\n}\n/** A text data type stored in one form for each value: it reads any spelling `stored` takes and spells each value in the form `stored` writes. */\nfunction storedTextDataType(id, stored, expected, options) {\n\tconst read = (json) => typeof json === \"string\" && storedOrUndefined(stored, json) !== void 0 ? json : refuseJsonValue(id, expected, json);\n\tconst spell = (json) => typeof json === \"string\" ? storedOrUndefined(stored, json) ?? json : json;\n\treturn sqlDataType(id, {\n\t\tstoredAs: sqliteText.id,\n\t\tread,\n\t\t...options.respell ? { spell } : {}\n\t});\n}\n/** The document JSON text holds, or `undefined` when the text is not JSON. */\nfunction documentOf(text) {\n\ttry {\n\t\treturn { value: JSON.parse(text) };\n\t} catch {\n\t\treturn;\n\t}\n}\n/** Reads the JSON text of a document, in any spelling; `spellJson` gives it the one it stores. */\nconst readJson = (json) => typeof json === \"string\" && documentOf(json) !== void 0 ? json : refuseJsonValue(\"sqlite/json\", \"the JSON text of a document\", json);\n/** A document is stored as its JSON text with sorted keys and no added whitespace. */\nconst spellJson = (json) => {\n\tconst document = typeof json === \"string\" ? documentOf(json) : void 0;\n\treturn document === void 0 ? json : canonicalizeJson(document.value);\n};\n/** An instant, stored as text in the form `toISOString()` writes. */\nconst sqliteDatetime = sqlDataType(\"sqlite/datetime\", {\n\tstoredAs: sqliteText.id,\n\tread: readDatetime,\n\tspell: spellDatetime\n});\n/** A calendar date, stored as text in the form `2024-02-29`. */\nconst sqliteDate = storedTextDataType(\"sqlite/date\", sqliteDateText, \"ISO 8601 date text, as in \\\"2024-02-29\\\"\", { respell: true });\n/** A time of day, stored as text with three fraction digits, `09:30:00.000`. */\nconst sqliteTime = storedTextDataType(\"sqlite/time\", sqliteTimeText, \"ISO 8601 time of day text with at most three fraction digits, as in \\\"09:30:00\\\"\", { respell: true });\n/** A length of time, stored as the ISO 8601 duration it was written as, `PT1H30M`. Equal durations can be written differently, `P1D` and `PT24H`, so a duration keeps its spelling. */\nconst sqliteDuration = storedTextDataType(\"sqlite/duration\", sqliteDurationText, \"an ISO 8601 duration, as in \\\"PT1H30M\\\"\", { respell: false });\n/** A decimal, stored as text without leading zeros or a minus sign on zero, `12.50`. Text compares by its characters, so `1.5` and `1.50` are different values. A default is written as text, or as a whole number. */\nconst sqliteDecimal = sqlDataType(\"sqlite/decimal\", {\n\tstoredAs: sqliteText.id,\n\tread: (json) => typeof json === \"string\" && isDecimalText(json) ? json : refuseJsonValue(\"sqlite/decimal\", \"decimal text, as in \\\"12.50\\\"\", json),\n\tspell: (json) => typeof json === \"string\" ? printedDecimalText(json) : json,\n\tcasts: {\n\t\t[sqliteText.id]: (value) => typeof value === \"string\" ? sqliteDecimalText(value) : refuseWrongShape(value, \"text\"),\n\t\t[sqliteInteger.id]: castUnchanged\n\t}\n});\n/** A boolean, stored as the integer 0 or 1, which is what SQLite's own `FALSE` and `TRUE` are. A default is written `true` or `false`. */\nconst sqliteBoolean = sqlDataType(\"sqlite/boolean\", {\n\tstoredAs: sqliteInteger.id,\n\tread: (json) => readJsonBoolean(\"sqlite/boolean\", json)\n});\n/** A JSON document, stored as its JSON text with sorted keys and no added whitespace. A column declared `JSON` would have numeric affinity and store the document `\"42\"` as the integer 42. */\nconst sqliteJson = sqlDataType(\"sqlite/json\", {\n\tstoredAs: sqliteText.id,\n\tread: readJson,\n\tspell: spellJson\n});\n/** Every data type this target registers. */\nconst sqliteDataTypes = [\n\tsqliteText,\n\tsqliteInteger,\n\tsqliteReal,\n\tsqliteBlob,\n\tsqliteCharacter,\n\tsqliteCharacterVarying,\n\tsqliteDatetime,\n\tsqliteDate,\n\tsqliteTime,\n\tsqliteDuration,\n\tsqliteJson,\n\tsqliteDecimal,\n\tsqliteBoolean,\n\tsqlRawDataType\n];\n/** SQLite's text data types: `text`, `character(n)` and `character varying(n)`. */\nconst sqliteTextDataTypes = [\n\tsqliteText.id,\n\tsqliteCharacter.id,\n\tsqliteCharacterVarying.id\n];\n//#endregion\nexport { sqliteTimeText as C, sqliteTime as S, sqliteInteger as _, sqliteCharacterLengthParams as a, sqliteText as b, sqliteDate as c, sqliteDatetimeText as d, sqliteDatetimeTextAtMilliseconds as f, sqliteDurationText as g, sqliteDuration as h, sqliteCharacter as i, sqliteDateText as l, sqliteDecimalText as m, sqliteBlobFromHexText as n, sqliteCharacterVarying as o, sqliteDecimal as p, sqliteBoolean as r, sqliteDataTypes as s, sqliteBlob as t, sqliteDatetime as u, sqliteJson as v, sqliteTextDataTypes as x, sqliteReal as y };\n\n//# sourceMappingURL=data-types-C_NKe4Ni.mjs.map"],"mappings":";;;;;;;;;;AAUA,MAAM,UAAU,UAAU,OAAO,UAAU,WAAW,OAAO,KAAK,IAAI,iBAAiB,OAAO,YAAY;;AAE1G,MAAM,YAAY,IAAI,MAAM,MAAM,QAAQ,CAAC,MAAM,YAAY,IAAI;CAChE,OAAO,CAAC;EACP,MAAM;EACN,SAAS;EACT,SAAS;CACV,CAAC;CACD;CACA;AACD,CAAC;AACD,MAAM,YAAY,SAAS,eAAe,eAAe,IAAI;AAC7D,MAAM,gBAAgB;AACtB,MAAM,aAAa,SAAS,eAAe,QAAQ,QAAQ;;AAE3D,MAAM,gBAAgB,YAAY,kBAAkB;CACnD,OAAO,CAAC;EACP,MAAM;EACN,SAAS;EACT,SAAS;CACV,CAAC;CACD,OAAO,SAAS;EACf,oBAAoB,kBAAkB,MAAM,WAAW;EACvD,OAAO;CACR;CACA,OAAO,CAAC;AACT,CAAC;;AAED,MAAM,aAAa,SAAS,eAAe,SAAS,SAAS;CAC5D,cAAc,eAAe,IAAI;CACjC,OAAO;AACR,GAAG,GAAG,cAAc,KAAK,OAAO,CAAC;AACjC,MAAM,aAAa,SAAS,eAAe,SAAS,SAAS,iBAAiB,eAAe,MAAM,eAAe,4BAA4B,GAAG,CAAC,CAAC;AACnJ,MAAM,WAAW;;AAEjB,SAAS,sBAAsB,MAAM;CACpC,IAAI,CAAC,SAAS,KAAK,IAAI,GAAG,MAAM,gBAAgB,yBAAyB,IAAI,KAAK,2FAA2F;EAC5K,KAAK;EACL,KAAK;CACN,CAAC;CACD,OAAO,KAAK,YAAY;AACzB;;AAEA,MAAM,8BAA8B,KAAK,EAAE,WAAW,qDAAqD,CAAC;;AAE5G,MAAM,iBAAiB,EAAE,QAAQ,SAAS,GAAG,WAAW;AACxD,MAAM,kBAAkB,YAAY,oBAAoB;CACvD,QAAQ;CACR,OAAO,CAAC;EACP,MAAM;EACN,SAAS;EACT,SAAS;CACV,CAAC;CACD,OAAO,SAAS,eAAe,oBAAoB,IAAI;CACvD,WAAW;CACX,OAAO,GAAG,WAAW,KAAK,cAAc;AACzC,CAAC;AACD,MAAM,yBAAyB,YAAY,4BAA4B;CACtE,QAAQ;CACR,OAAO,CAAC;EACP,MAAM;EACN,SAAS;EACT,SAAS;CACV,CAAC;CACD,OAAO,SAAS,eAAe,4BAA4B,IAAI;CAC/D,WAAW;CACX,OAAO,GAAG,WAAW,KAAK,cAAc;AACzC,CAAC;;;;AAID,MAAM,sBAAsB,SAAS,kBAAkB,MAAM,iBAAiB;;AAE9E,SAAS,eAAe,MAAM;CAC7B,IAAI;EACH,OAAO,mBAAmB,IAAI;CAC/B,QAAQ;EACP;CACD;AACD;;AAEA,MAAM,gBAAgB,SAAS,OAAO,SAAS,YAAY,eAAe,IAAI,MAAM,KAAK,IAAI,OAAO,gBAAgB,mBAAmB,mHAAmH,IAAI;;AAE9P,MAAM,iBAAiB,SAAS,OAAO,SAAS,WAAW,eAAe,IAAI,KAAK,OAAO;;AAE1F,MAAM,oBAAoB;CACzB,UAAU;CACV,QAAQ;AACT;;;;AAIA,SAAS,eAAe,MAAM;CAC7B,OAAO,mBAAmB,MAAM;EAC/B,OAAO;EACP,SAAS;EACT,OAAO;CACR,CAAC;AACF;;;;AAIA,SAAS,eAAe,MAAM;CAC7B,OAAO,wBAAwB,mBAAmB,8BAA8B,IAAI,GAAG;EACtF,OAAO;EACP,SAAS;EACT,mBAAmB;CACpB,GAAG,IAAI,CAAC;AACT;;;;AAIA,SAAS,iCAAiC,MAAM;CAC/C,OAAO,mBAAmB,8BAA8B,IAAI,CAAC;AAC9D;;AAEA,SAAS,mBAAmB,MAAM;CACjC,IAAI,wBAAwB,KAAK,IAAI,GAAG,OAAO;CAC/C,MAAM,gBAAgB,yBAAyB,gCAAgC,KAAK,kDAAkD;EACrI,KAAK;EACL,KAAK;CACN,CAAC;AACF;;;;AAIA,SAAS,kBAAkB,MAAM;CAChC,IAAI,cAAc,IAAI,GAAG,OAAO,mBAAmB,IAAI;CACvD,MAAM,gBAAgB,yBAAyB,+BAA+B,KAAK,wCAAwC;EAC1H,KAAK;EACL,KAAK;CACN,CAAC;AACF;;AAEA,SAAS,kBAAkB,MAAM,MAAM;CACtC,IAAI;EACH,OAAO,KAAK,IAAI;CACjB,QAAQ;EACP;CACD;AACD;;AAEA,SAAS,mBAAmB,IAAI,QAAQ,UAAU,SAAS;CAC1D,MAAM,QAAQ,SAAS,OAAO,SAAS,YAAY,kBAAkB,QAAQ,IAAI,MAAM,KAAK,IAAI,OAAO,gBAAgB,IAAI,UAAU,IAAI;CACzI,MAAM,SAAS,SAAS,OAAO,SAAS,WAAW,kBAAkB,QAAQ,IAAI,KAAK,OAAO;CAC7F,OAAO,YAAY,IAAI;EACtB,UAAU,WAAW;EACrB;EACA,GAAG,QAAQ,UAAU,EAAE,MAAM,IAAI,CAAC;CACnC,CAAC;AACF;;AAEA,SAAS,WAAW,MAAM;CACzB,IAAI;EACH,OAAO,EAAE,OAAO,KAAK,MAAM,IAAI,EAAE;CAClC,QAAQ;EACP;CACD;AACD;;AAEA,MAAM,YAAY,SAAS,OAAO,SAAS,YAAY,WAAW,IAAI,MAAM,KAAK,IAAI,OAAO,gBAAgB,eAAe,+BAA+B,IAAI;;AAE9J,MAAM,aAAa,SAAS;CAC3B,MAAM,WAAW,OAAO,SAAS,WAAW,WAAW,IAAI,IAAI,KAAK;CACpE,OAAO,aAAa,KAAK,IAAI,OAAO,iBAAiB,SAAS,KAAK;AACpE;;AAEA,MAAM,iBAAiB,YAAY,mBAAmB;CACrD,UAAU,WAAW;CACrB,MAAM;CACN,OAAO;AACR,CAAC;;AAED,MAAM,aAAa,mBAAmB,eAAe,gBAAgB,4CAA4C,EAAE,SAAS,KAAK,CAAC;;AAElI,MAAM,aAAa,mBAAmB,eAAe,gBAAgB,oFAAoF,EAAE,SAAS,KAAK,CAAC;;AAE1K,MAAM,iBAAiB,mBAAmB,mBAAmB,oBAAoB,2CAA2C,EAAE,SAAS,MAAM,CAAC;;AAE9I,MAAM,gBAAgB,YAAY,kBAAkB;CACnD,UAAU,WAAW;CACrB,OAAO,SAAS,OAAO,SAAS,YAAY,cAAc,IAAI,IAAI,OAAO,gBAAgB,kBAAkB,iCAAiC,IAAI;CAChJ,QAAQ,SAAS,OAAO,SAAS,WAAW,mBAAmB,IAAI,IAAI;CACvE,OAAO;GACL,WAAW,MAAM,UAAU,OAAO,UAAU,WAAW,kBAAkB,KAAK,IAAI,iBAAiB,OAAO,MAAM;GAChH,cAAc,KAAK;CACrB;AACD,CAAC;;AAED,MAAM,gBAAgB,YAAY,kBAAkB;CACnD,UAAU,cAAc;CACxB,OAAO,SAAS,gBAAgB,kBAAkB,IAAI;AACvD,CAAC;;AAED,MAAM,aAAa,YAAY,eAAe;CAC7C,UAAU,WAAW;CACrB,MAAM;CACN,OAAO;AACR,CAAC;;AAED,MAAM,kBAAkB;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,sBAAsB;CAC3B,WAAW;CACX,gBAAgB;CAChB,uBAAuB;AACxB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as requireTemporal } from "./require-temporal-
|
|
1
|
+
import { s as sqliteDataTypes } from "./data-types-C_NKe4Ni-D7r8QkSb.mjs";
|
|
2
|
+
import { t as requireTemporal } from "./require-temporal-CHWqSDF3-ElFTiAh6.mjs";
|
|
3
3
|
import * as nowValues from "@prisma/orm-framework/type-implementations/now";
|
|
4
4
|
import { DATE_STRING_NOW_GENERATOR_ID, INSTANT_NOW_GENERATOR_ID, INSTANT_STRING_NOW_GENERATOR_ID, PLAIN_DATE_NOW_GENERATOR_ID, PLAIN_TIME_NOW_GENERATOR_ID, TIME_STRING_NOW_GENERATOR_ID } from "@prisma/orm-framework/type-implementations/now";
|
|
5
|
-
//#region ../../../3-targets/sqlite/1-target/dist/date-time-now-generators-
|
|
5
|
+
//#region ../../../3-targets/sqlite/1-target/dist/date-time-now-generators-DtRz9c2R.mjs
|
|
6
6
|
const sqliteTargetDescriptorMetaRuntime = {
|
|
7
7
|
kind: "target",
|
|
8
8
|
familyId: "sql",
|
|
@@ -61,4 +61,4 @@ const sqliteNowGenerators = [
|
|
|
61
61
|
//#endregion
|
|
62
62
|
export { sqliteTargetDescriptorMetaRuntime as n, sqliteNowGenerators as t };
|
|
63
63
|
|
|
64
|
-
//# sourceMappingURL=date-time-now-generators-
|
|
64
|
+
//# sourceMappingURL=date-time-now-generators-DtRz9c2R-BkrBeLl2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-time-now-generators-
|
|
1
|
+
{"version":3,"file":"date-time-now-generators-DtRz9c2R-BkrBeLl2.mjs","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/date-time-now-generators-DtRz9c2R.mjs"],"sourcesContent":["import { s as sqliteDataTypes } from \"./data-types-C_NKe4Ni.mjs\";\nimport { t as requireTemporal } from \"./require-temporal-CHWqSDF3.mjs\";\nimport * as nowValues from \"@internal/type-implementations/now\";\nimport { DATE_STRING_NOW_GENERATOR_ID, INSTANT_NOW_GENERATOR_ID, INSTANT_STRING_NOW_GENERATOR_ID, PLAIN_DATE_NOW_GENERATOR_ID, PLAIN_TIME_NOW_GENERATOR_ID, TIME_STRING_NOW_GENERATOR_ID } from \"@internal/type-implementations/now\";\nconst sqliteTargetDescriptorMetaRuntime = {\n\tkind: \"target\",\n\tfamilyId: \"sql\",\n\ttargetId: \"sqlite\",\n\tid: \"sqlite\",\n\tversion: \"0.0.1\",\n\tcapabilities: {},\n\tdataTypes: sqliteDataTypes\n};\n//#endregion\n//#region src/core/date-time-now-generators.ts\n/** SQLite's date and time types hold milliseconds. */\nconst MILLISECOND_DIGITS = 3;\nfunction instantNow() {\n\treturn nowValues.instantNow(requireTemporal({ generatorId: INSTANT_NOW_GENERATOR_ID }), MILLISECOND_DIGITS);\n}\nfunction plainDateNow() {\n\treturn nowValues.plainDateNow(requireTemporal({ generatorId: PLAIN_DATE_NOW_GENERATOR_ID }));\n}\nfunction plainTimeNow() {\n\treturn nowValues.plainTimeNow(requireTemporal({ generatorId: PLAIN_TIME_NOW_GENERATOR_ID }), MILLISECOND_DIGITS);\n}\nfunction instantStringNow() {\n\treturn nowValues.instantStringNow(MILLISECOND_DIGITS, \"fixed\");\n}\nfunction timeStringNow() {\n\treturn nowValues.timeStringNow(MILLISECOND_DIGITS, \"fixed\");\n}\n/**\n* The SQLite \"now\" generators, one per date and time codec except `sqlite/datetime@1`, which uses the SQL family's `timestampNow`. All read the clock through `Date.now()`, write UTC and keep milliseconds, which every SQLite date and time type holds. The string generators write the text their type stores, with three fraction digits.\n*/\nconst sqliteNowGenerators = [\n\t{\n\t\tid: INSTANT_NOW_GENERATOR_ID,\n\t\tgenerate: instantNow\n\t},\n\t{\n\t\tid: PLAIN_DATE_NOW_GENERATOR_ID,\n\t\tgenerate: plainDateNow\n\t},\n\t{\n\t\tid: PLAIN_TIME_NOW_GENERATOR_ID,\n\t\tgenerate: plainTimeNow\n\t},\n\t{\n\t\tid: INSTANT_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: instantStringNow\n\t},\n\t{\n\t\tid: DATE_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: nowValues.dateStringNow\n\t},\n\t{\n\t\tid: TIME_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: timeStringNow\n\t}\n];\n//#endregion\nexport { sqliteTargetDescriptorMetaRuntime as n, sqliteNowGenerators as t };\n\n//# sourceMappingURL=date-time-now-generators-DtRz9c2R.mjs.map"],"mappings":";;;;;AAIA,MAAM,oCAAoC;CACzC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS;CACT,cAAc,CAAC;CACf,WAAW;AACZ;;AAIA,MAAM,qBAAqB;AAC3B,SAAS,aAAa;CACrB,OAAO,UAAU,WAAW,gBAAgB,EAAE,aAAa,yBAAyB,CAAC,GAAG,kBAAkB;AAC3G;AACA,SAAS,eAAe;CACvB,OAAO,UAAU,aAAa,gBAAgB,EAAE,aAAa,4BAA4B,CAAC,CAAC;AAC5F;AACA,SAAS,eAAe;CACvB,OAAO,UAAU,aAAa,gBAAgB,EAAE,aAAa,4BAA4B,CAAC,GAAG,kBAAkB;AAChH;AACA,SAAS,mBAAmB;CAC3B,OAAO,UAAU,iBAAiB,oBAAoB,OAAO;AAC9D;AACA,SAAS,gBAAgB;CACxB,OAAO,UAAU,cAAc,oBAAoB,OAAO;AAC3D;;;;AAIA,MAAM,sBAAsB;CAC3B;EACC,IAAI;EACJ,UAAU;CACX;CACA;EACC,IAAI;EACJ,UAAU;CACX;CACA;EACC,IAAI;EACJ,UAAU;CACX;CACA;EACC,IAAI;EACJ,UAAU;CACX;CACA;EACC,IAAI;EACJ,UAAU,UAAU;CACrB;CACA;EACC,IAAI;EACJ,UAAU;CACX;AACD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as sqliteTime, b as sqliteText, c as sqliteDate, i as sqliteCharacter, o as sqliteCharacterVarying, u as sqliteDatetime } from "./data-types-C_NKe4Ni-D7r8QkSb.mjs";
|
|
2
2
|
import { sqlRawDataType } from "@prisma/orm-family-sql/contract/data-type";
|
|
3
|
-
//#region ../../../3-targets/sqlite/1-target/dist/datetime-text-
|
|
3
|
+
//#region ../../../3-targets/sqlite/1-target/dist/datetime-text-nkVy_w0q.mjs
|
|
4
4
|
/** The `strftime` format for the text `encodeSqliteDatetime` writes. */
|
|
5
5
|
const SQLITE_DATETIME_TEXT_FORMAT = "%Y-%m-%dT%H:%M:%fZ";
|
|
6
6
|
/** The SQLite expression for the current instant, as the text `encodeSqliteDatetime` writes. */
|
|
@@ -29,4 +29,4 @@ function sqliteNowExpressionFor(dataTypeId) {
|
|
|
29
29
|
//#endregion
|
|
30
30
|
export { SQLITE_TIME_TEXT_FORMAT as a, SQLITE_TIME_NOW_EXPRESSION as i, SQLITE_DATE_NOW_EXPRESSION as n, sqliteNowExpressionFor as o, SQLITE_NOW_EXPRESSION as r, SQLITE_DATETIME_TEXT_FORMAT as t };
|
|
31
31
|
|
|
32
|
-
//# sourceMappingURL=datetime-text-
|
|
32
|
+
//# sourceMappingURL=datetime-text-nkVy_w0q-DZnIEmgr.mjs.map
|
package/dist/{datetime-text-BogpvE70-VwTG2rUc.mjs.map → datetime-text-nkVy_w0q-DZnIEmgr.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datetime-text-
|
|
1
|
+
{"version":3,"file":"datetime-text-nkVy_w0q-DZnIEmgr.mjs","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/datetime-text-nkVy_w0q.mjs"],"sourcesContent":["import { S as sqliteTime, b as sqliteText, c as sqliteDate, i as sqliteCharacter, o as sqliteCharacterVarying, u as sqliteDatetime } from \"./data-types-C_NKe4Ni.mjs\";\nimport { sqlRawDataType } from \"@internal/sql-contract/data-type\";\n//#region src/core/datetime-text.ts\n/** The `strftime` format for the text `encodeSqliteDatetime` writes. */\nconst SQLITE_DATETIME_TEXT_FORMAT = \"%Y-%m-%dT%H:%M:%fZ\";\n/** The SQLite expression for the current instant, as the text `encodeSqliteDatetime` writes. */\nconst SQLITE_NOW_EXPRESSION = `strftime('${SQLITE_DATETIME_TEXT_FORMAT}','now')`;\n/** The SQLite expression for the current date in UTC, as `sqlite/date` stores it. */\nconst SQLITE_DATE_NOW_EXPRESSION = \"date('now')\";\n/** The `strftime` format for the text `sqlite/time` stores. */\nconst SQLITE_TIME_TEXT_FORMAT = \"%H:%M:%f\";\n/** The SQLite expression for the current time of day in UTC, as `sqlite/time` stores it. */\nconst SQLITE_TIME_NOW_EXPRESSION = `strftime('${SQLITE_TIME_TEXT_FORMAT}','now')`;\nconst NOW_EXPRESSION_BY_DATA_TYPE = /* @__PURE__ */ new Map([\n\t[sqliteDatetime.id, SQLITE_NOW_EXPRESSION],\n\t[sqliteDate.id, SQLITE_DATE_NOW_EXPRESSION],\n\t[sqliteTime.id, SQLITE_TIME_NOW_EXPRESSION],\n\t[sqliteText.id, SQLITE_NOW_EXPRESSION],\n\t[sqliteCharacter.id, SQLITE_NOW_EXPRESSION],\n\t[sqliteCharacterVarying.id, SQLITE_NOW_EXPRESSION],\n\t[sqlRawDataType.id, SQLITE_NOW_EXPRESSION]\n]);\n/**\n* The expression a `now()` default is written as on a column of `dataTypeId`: the current date or time of day on `sqlite/date` and `sqlite/time`, the current instant on `sqlite/datetime`, on text, on a raw column, whose values Prisma does not read, and on a column of no known data type. `undefined` on a data type that stores no date or time, such as `sqlite/duration` or `sqlite/integer`, as PostgreSQL refuses `now()` on an `interval` or an `integer` column.\n*/\nfunction sqliteNowExpressionFor(dataTypeId) {\n\treturn dataTypeId === void 0 ? SQLITE_NOW_EXPRESSION : NOW_EXPRESSION_BY_DATA_TYPE.get(dataTypeId);\n}\n//#endregion\nexport { SQLITE_TIME_TEXT_FORMAT as a, SQLITE_TIME_NOW_EXPRESSION as i, SQLITE_DATE_NOW_EXPRESSION as n, sqliteNowExpressionFor as o, SQLITE_NOW_EXPRESSION as r, SQLITE_DATETIME_TEXT_FORMAT as t };\n\n//# sourceMappingURL=datetime-text-nkVy_w0q.mjs.map"],"mappings":";;;;AAIA,MAAM,8BAA8B;;AAEpC,MAAM,wBAAwB,aAAa,4BAA4B;;AAEvE,MAAM,6BAA6B;;AAEnC,MAAM,0BAA0B;;AAEhC,MAAM,6BAA6B,aAAa,wBAAwB;AACxE,MAAM,8CAA8C,IAAI,IAAI;CAC3D,CAAC,eAAe,IAAI,qBAAqB;CACzC,CAAC,WAAW,IAAI,0BAA0B;CAC1C,CAAC,WAAW,IAAI,0BAA0B;CAC1C,CAAC,WAAW,IAAI,qBAAqB;CACrC,CAAC,gBAAgB,IAAI,qBAAqB;CAC1C,CAAC,uBAAuB,IAAI,qBAAqB;CACjD,CAAC,eAAe,IAAI,qBAAqB;AAC1C,CAAC;;;;AAID,SAAS,uBAAuB,YAAY;CAC3C,OAAO,eAAe,KAAK,IAAI,wBAAwB,4BAA4B,IAAI,UAAU;AAClG"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as SQLITE_TEXT_CODEC_ID } from "./codec-ids-CTshXpbg-tcdbf_VC.mjs";
|
|
2
2
|
import { t as SqliteCreateTable } from "./nodes-DUZSdX86-DWyLY3OW.mjs";
|
|
3
3
|
import { FunctionSource } from "@prisma/orm-family-sql/relational-core/ast";
|
|
4
4
|
import { cfExpr, cfTable, exprSelect } from "@prisma/orm-family-sql/relational-core/contract-free";
|
|
5
|
-
//#region ../../../3-targets/sqlite/1-target/dist/ddl-
|
|
5
|
+
//#region ../../../3-targets/sqlite/1-target/dist/ddl-CgkyurGo.mjs
|
|
6
6
|
/**
|
|
7
7
|
* Typed builder for the migration planner's column-existence checks. Produces
|
|
8
8
|
* `SELECT COUNT(*) {=|>} 0 AS "result" FROM pragma_table_info(?1) WHERE "name" = ?2`
|
|
@@ -100,4 +100,4 @@ function createTable(options) {
|
|
|
100
100
|
//#endregion
|
|
101
101
|
export { tableExistsAst as a, indexExistsAst as i, columnNameTakenAst as n, tableNameTakenAst as o, createTable as r, columnExistsAst as t };
|
|
102
102
|
|
|
103
|
-
//# sourceMappingURL=ddl-
|
|
103
|
+
//# sourceMappingURL=ddl-CgkyurGo-B2o4mSIT.mjs.map
|