@prisma/orm-target-sqlite 8.0.0-rc.9-dev.13 → 8.0.1-dev.2
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 +5 -1
- package/dist/adapter-BQZBUROY.d.mts +205 -0
- package/dist/adapter-BQZBUROY.d.mts.map +1 -0
- package/dist/{adapter-jwxys1MM-CmUELyBs.mjs → adapter-CxzIV2_z-DKbo2Ebu.mjs} +347 -137
- package/dist/adapter-CxzIV2_z-DKbo2Ebu.mjs.map +1 -0
- package/dist/{adapter-DEYUC-KO-DO_abhIq.d.mts → adapter-xFPDhkod-Bfb8AQQJ.d.mts} +12 -9
- package/dist/adapter-xFPDhkod-Bfb8AQQJ.d.mts.map +1 -0
- package/dist/adapter.d.mts +14 -15
- package/dist/adapter.mjs +7 -6
- package/dist/adapter__adapter.d.mts +4 -4
- package/dist/adapter__adapter.mjs +3 -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 +5 -5
- package/dist/adapter__control.mjs +12 -247
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.d.mts +1 -1
- package/dist/adapter__runtime.mjs +30 -16
- 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 +3 -2
- package/dist/aggregates--0FaH9Te.d.mts +164 -0
- package/dist/aggregates--0FaH9Te.d.mts.map +1 -0
- package/dist/{aggregates-DWyPO7t6.mjs → aggregates-hLiHPHBG.mjs} +44 -26
- package/dist/aggregates-hLiHPHBG.mjs.map +1 -0
- package/dist/codec-descriptor-3oN7rtrW-Cc_u7U5-.d.mts +1 -0
- package/dist/codec-descriptor-C16gQAdS.d.mts +2 -0
- package/dist/{codec-descriptor-B9ru99aI-DTkdKFU5.mjs → codec-descriptor-DRmF-crq-BALI5Jtz.mjs} +11 -15
- package/dist/codec-descriptor-DRmF-crq-BALI5Jtz.mjs.map +1 -0
- package/dist/codec-descriptor-DuW-d9ef-BBRBN0Ri.d.mts +45 -0
- package/dist/codec-descriptor-DuW-d9ef-BBRBN0Ri.d.mts.map +1 -0
- package/dist/codec-ids-CH8Nqk89-LNT9hksu.d.mts +23 -0
- package/dist/codec-ids-CH8Nqk89-LNT9hksu.d.mts.map +1 -0
- package/dist/codec-ids-CTshXpbg-tcdbf_VC.mjs +23 -0
- 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-Ci-h2uxN-41PNpdNL.d.mts +35 -0
- package/dist/codec-types-Ci-h2uxN-41PNpdNL.d.mts.map +1 -0
- package/dist/codecs-BO3frExA.mjs +49 -0
- package/dist/codecs-BO3frExA.mjs.map +1 -0
- package/dist/codecs-DBQsDiM--Cy-r45H3.d.mts +378 -0
- package/dist/codecs-DBQsDiM--Cy-r45H3.d.mts.map +1 -0
- package/dist/codecs-Dou3fR1K.d.mts +1 -0
- package/dist/codecs-izq9l1NG-Bb2RnXsx.mjs +1081 -0
- package/dist/codecs-izq9l1NG-Bb2RnXsx.mjs.map +1 -0
- package/dist/column-types-D3MMpY3X.d.mts +42 -0
- 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-DEePsuJb-CXE-f6pP.mjs +28 -0
- package/dist/contract-contributions-DEePsuJb-CXE-f6pP.mjs.map +1 -0
- package/dist/{contract-free-D5cZrgNl.mjs → contract-free-B5S1OSEd.mjs} +8 -7
- package/dist/contract-free-B5S1OSEd.mjs.map +1 -0
- package/dist/{contract-free-CCLAXZV2.d.mts → contract-free-IqKgq8Pk.d.mts} +6 -6
- package/dist/contract-free-IqKgq8Pk.d.mts.map +1 -0
- package/dist/{control-D9vMRRgU.d.mts → control-C2TjacST.d.mts} +3 -3
- package/dist/control-C2TjacST.d.mts.map +1 -0
- package/dist/control-CtCvtwJx.d.mts +408 -0
- package/dist/control-CtCvtwJx.d.mts.map +1 -0
- package/dist/{control-CLirKz11.d.mts → control-DfWteXy-.d.mts} +31 -45
- package/dist/control-DfWteXy-.d.mts.map +1 -0
- package/dist/control-V3kPfMTR.mjs +61 -0
- package/dist/control-V3kPfMTR.mjs.map +1 -0
- package/dist/{control-tables-Dua-YcJL.d.mts → control-tables-DKXLHvMU.d.mts} +2 -2
- package/dist/control-tables-DKXLHvMU.d.mts.map +1 -0
- package/dist/{control-tables-D_o8dKRB-BXi43noL.mjs → control-tables-D_o8dKRB-n_QqsXcm.mjs} +2 -2
- package/dist/control-tables-D_o8dKRB-n_QqsXcm.mjs.map +1 -0
- package/dist/data-type-entries-DaT4D2GV-DE0V_N6k.mjs +120 -0
- package/dist/data-type-entries-DaT4D2GV-DE0V_N6k.mjs.map +1 -0
- package/dist/data-types-C1nzwKt7.d.mts +68 -0
- package/dist/data-types-C1nzwKt7.d.mts.map +1 -0
- package/dist/data-types-Djvapurb-BR-Y4NWN.mjs +239 -0
- package/dist/data-types-Djvapurb-BR-Y4NWN.mjs.map +1 -0
- package/dist/date-time-now-generators-DUb3x91B-D0keGG59.mjs +64 -0
- package/dist/date-time-now-generators-DUb3x91B-D0keGG59.mjs.map +1 -0
- package/dist/datetime-text-DPjoF6HJ-se0mLEbc.mjs +32 -0
- package/dist/datetime-text-DPjoF6HJ-se0mLEbc.mjs.map +1 -0
- package/dist/ddl-31OBcTco.d.mts +1 -0
- package/dist/{ddl-CXduXyOT-nlDP6DGx.mjs → ddl-CgkyurGo-B2o4mSIT.mjs} +45 -8
- package/dist/ddl-CgkyurGo-B2o4mSIT.mjs.map +1 -0
- package/dist/default-normalizer-BANdMVGr-BiUHyBX1.mjs +124 -0
- package/dist/default-normalizer-BANdMVGr-BiUHyBX1.mjs.map +1 -0
- package/dist/default-normalizer-CtNsZNRZ.d.mts +25 -0
- package/dist/default-normalizer-CtNsZNRZ.d.mts.map +1 -0
- package/dist/descriptor-meta-CafFMPhN-x3YQXDSX.mjs +26 -0
- package/dist/descriptor-meta-CafFMPhN-x3YQXDSX.mjs.map +1 -0
- package/dist/descriptor-meta-CkiPlqDS-n3hDP01X.mjs +137 -0
- package/dist/descriptor-meta-CkiPlqDS-n3hDP01X.mjs.map +1 -0
- package/dist/descriptor-meta-DEr1ALec-DvT6glGq.mjs +385 -0
- package/dist/descriptor-meta-DEr1ALec-DvT6glGq.mjs.map +1 -0
- package/dist/driver.d.mts +2 -2
- package/dist/driver.mjs +1 -1
- package/dist/driver__control.d.mts +1 -1
- package/dist/driver__control.mjs +1 -1
- package/dist/driver__runtime.d.mts +1 -1
- package/dist/driver__runtime.mjs +58 -20
- package/dist/driver__runtime.mjs.map +1 -1
- package/dist/errors-DxbvEzQp-CeTjoGtL.mjs +146 -0
- package/dist/errors-DxbvEzQp-CeTjoGtL.mjs.map +1 -0
- package/dist/{migration-DOKPHtxn.mjs → migration-BYRMZiPU.mjs} +6 -5
- package/dist/migration-BYRMZiPU.mjs.map +1 -0
- package/dist/{migration-uylRe5MP.d.mts → migration-Dekon_QC.d.mts} +6 -5
- package/dist/migration-Dekon_QC.d.mts.map +1 -0
- package/dist/{nodes-D8EC1yCx-rpfpuJ4T.d.mts → nodes-D8EC1yCx-BS-fKla6.d.mts} +2 -2
- package/dist/nodes-D8EC1yCx-BS-fKla6.d.mts.map +1 -0
- package/dist/{nodes-DUZSdX86-BBEEaxXY.mjs → nodes-DUZSdX86-DWyLY3OW.mjs} +2 -2
- package/dist/nodes-DUZSdX86-DWyLY3OW.mjs.map +1 -0
- package/dist/op-factory-call-DjbjegGT-DsQBI5Ll.mjs +2044 -0
- package/dist/op-factory-call-DjbjegGT-DsQBI5Ll.mjs.map +1 -0
- package/dist/op-factory-call-gQ5ddSys.d.mts +327 -0
- package/dist/op-factory-call-gQ5ddSys.d.mts.map +1 -0
- package/dist/pack-CHESErO8.d.mts +1477 -0
- package/dist/pack-CHESErO8.d.mts.map +1 -0
- package/dist/{planner-Bxdi7jZF.d.mts → planner-Bu5XBkHm.d.mts} +21 -10
- package/dist/planner-Bu5XBkHm.d.mts.map +1 -0
- package/dist/planner-C1OMkqV5-BAv-WPw6.mjs +497 -0
- package/dist/planner-C1OMkqV5-BAv-WPw6.mjs.map +1 -0
- package/dist/{planner-produced-sqlite-migration-BuJysRxx-CaDUbNVx.d.mts → planner-produced-sqlite-migration-CMjzJW5V-dVv0SjJm.d.mts} +5 -6
- package/dist/planner-produced-sqlite-migration-CMjzJW5V-dVv0SjJm.d.mts.map +1 -0
- package/dist/{planner-produced-sqlite-migration-C9uVDKrJ-CWbxSANn.mjs → planner-produced-sqlite-migration-CrbMD1ch-O7Mh_aKY.mjs} +13 -23
- package/dist/planner-produced-sqlite-migration-CrbMD1ch-O7Mh_aKY.mjs.map +1 -0
- package/dist/planner-produced-sqlite-migration-DtytlAAY.d.mts +1 -0
- package/dist/{planner-target-details-xR6UfIcz-CMahymzq.d.mts → planner-target-details-B-qtfkmj-DIGpv7YQ.d.mts} +2 -3
- package/dist/planner-target-details-B-qtfkmj-DIGpv7YQ.d.mts.map +1 -0
- package/dist/{planner-target-details-CIQ789Gc-C5U4yVY9.mjs → planner-target-details-Daaeo8s9-BGAN4JVc.mjs} +2 -4
- package/dist/planner-target-details-Daaeo8s9-BGAN4JVc.mjs.map +1 -0
- package/dist/render-ops-CQ-Kf4P0-DDUU4OFY.mjs +34 -0
- package/dist/render-ops-CQ-Kf4P0-DDUU4OFY.mjs.map +1 -0
- package/dist/{render-ops-B10yqmdG.d.mts → render-ops-Wlf_Pawh.d.mts} +3 -3
- package/dist/render-ops-Wlf_Pawh.d.mts.map +1 -0
- package/dist/require-temporal-CHWqSDF3-ElFTiAh6.mjs +16 -0
- package/dist/require-temporal-CHWqSDF3-ElFTiAh6.mjs.map +1 -0
- package/dist/{runtime-B1coahKC.d.mts → runtime-BvMPuBrJ.d.mts} +3 -3
- package/dist/runtime-BvMPuBrJ.d.mts.map +1 -0
- package/dist/runtime-C43fN_cJ.mjs +32 -0
- package/dist/runtime-C43fN_cJ.mjs.map +1 -0
- package/dist/{runtime-C5J9fusd.d.mts → runtime-CVBk_GlD.d.mts} +4 -4
- package/dist/runtime-CVBk_GlD.d.mts.map +1 -0
- package/dist/runtime-DqzT70C4.d.mts +67 -0
- package/dist/runtime-DqzT70C4.d.mts.map +1 -0
- package/dist/sql-renderer-DlZKtvVf.d.mts +1 -0
- package/dist/{sql-utils-0SJZOd7Q.d.mts → sql-utils-BqHka8P6.d.mts} +2 -2
- package/dist/sql-utils-BqHka8P6.d.mts.map +1 -0
- package/dist/{sql-utils-C2O4zVkP-Dz3Hb85I.mjs → sql-utils-CHBxMmv--Dl7wl7n3.mjs} +31 -4
- package/dist/sql-utils-CHBxMmv--Dl7wl7n3.mjs.map +1 -0
- package/dist/{sqlite-contract-view-BpNMaU2m-COMDaGaq.d.mts → sqlite-contract-view-BDw8T5Cp-BfFajhe4.d.mts} +5 -4
- package/dist/sqlite-contract-view-BDw8T5Cp-BfFajhe4.d.mts.map +1 -0
- package/dist/sqlite-contract-view-c-qO_pKt-DOCoqwrD.mjs +51 -0
- package/dist/sqlite-contract-view-c-qO_pKt-DOCoqwrD.mjs.map +1 -0
- package/dist/sqlite-migration-C_9TPlLD-DtKN8bi9.d.mts +227 -0
- package/dist/sqlite-migration-C_9TPlLD-DtKN8bi9.d.mts.map +1 -0
- package/dist/sqlite-migration-Cmzykasm--GxBXXny.mjs +1363 -0
- package/dist/sqlite-migration-Cmzykasm--GxBXXny.mjs.map +1 -0
- package/dist/{sqlite-contract-view-BYR10usg-BteDAUZr.mjs → sqlite-unbound-database-CfLXSiVo-Dy5VBXGz.mjs} +6 -47
- package/dist/sqlite-unbound-database-CfLXSiVo-Dy5VBXGz.mjs.map +1 -0
- package/dist/{shared-BYAX0FaQ--VvRXVRC.d.mts → tables-BY3u6rl_-Coqqy4JK.d.mts} +46 -10
- package/dist/tables-BY3u6rl_-Coqqy4JK.d.mts.map +1 -0
- package/dist/target.d.mts +30 -29
- package/dist/target.mjs +27 -20
- package/dist/target__aggregates.d.mts +1 -1
- package/dist/target__aggregates.mjs +1 -1
- package/dist/target__codec-descriptor.d.mts +2 -2
- package/dist/target__codec-descriptor.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 -2
- package/dist/target__contract-free.d.mts +1 -1
- package/dist/target__contract-free.mjs +2 -2
- package/dist/target__control-tables.d.mts +1 -1
- package/dist/target__control-tables.mjs +1 -1
- package/dist/target__control.d.mts +3 -3
- package/dist/target__control.mjs +332 -114
- package/dist/target__control.mjs.map +1 -1
- package/dist/target__data-types.d.mts +2 -0
- package/dist/target__data-types.mjs +3 -0
- package/dist/target__ddl.d.mts +2 -2
- package/dist/target__ddl.mjs +1 -1
- package/dist/target__default-normalizer.d.mts +2 -2
- package/dist/target__default-normalizer.mjs +2 -2
- package/dist/target__migration.d.mts +3 -3
- package/dist/target__migration.mjs +3 -3
- package/dist/target__op-factory-call.d.mts +2 -2
- package/dist/target__op-factory-call.mjs +2 -2
- 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-target-details.d.mts +1 -1
- package/dist/target__planner-target-details.mjs +1 -1
- package/dist/target__planner.d.mts +1 -1
- package/dist/target__planner.mjs +1 -1
- package/dist/target__render-ops.d.mts +1 -1
- package/dist/target__render-ops.mjs +1 -1
- package/dist/target__runtime.d.mts +3 -3
- package/dist/target__runtime.mjs +4 -17
- package/dist/target__sql-utils.d.mts +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/{control--wMueaTg.d.mts → types-COqCbSev.d.mts} +3 -8
- package/dist/types-COqCbSev.d.mts.map +1 -0
- package/dist/types-CexPOm8x.d.mts +2 -0
- package/dist/{types-C5FSREvo-CwUlKK34.d.mts → types-RJMd2PlL-BTGAJrBQ.d.mts} +5 -7
- package/dist/types-RJMd2PlL-BTGAJrBQ.d.mts.map +1 -0
- package/package.json +23 -14
- package/dist/adapter-D7zw14p5.d.mts +0 -2
- package/dist/adapter-DEYUC-KO-DO_abhIq.d.mts.map +0 -1
- package/dist/adapter-jwxys1MM-CmUELyBs.mjs.map +0 -1
- package/dist/aggregates-BGuKJwfI.d.mts +0 -10
- package/dist/aggregates-BGuKJwfI.d.mts.map +0 -1
- package/dist/aggregates-DWyPO7t6.mjs.map +0 -1
- package/dist/codec-descriptor-B9ru99aI-DTkdKFU5.mjs.map +0 -1
- package/dist/codec-descriptor-BcgD9f3L-yDi5nh_k.d.mts +0 -31
- package/dist/codec-descriptor-BcgD9f3L-yDi5nh_k.d.mts.map +0 -1
- package/dist/codec-descriptor-rFuZ9DzY-CKRIRxah.d.mts +0 -1
- package/dist/codec-descriptor-vwfD3BMy.d.mts +0 -2
- package/dist/codec-ids-7WqtUuda.d.mts +0 -1
- package/dist/codec-ids-CzeDyMWW-BZAcI50I.d.mts +0 -14
- package/dist/codec-ids-CzeDyMWW-BZAcI50I.d.mts.map +0 -1
- package/dist/codec-ids-KMliSCRp-BhTbmbGr.mjs +0 -14
- package/dist/codec-ids-KMliSCRp-BhTbmbGr.mjs.map +0 -1
- package/dist/codec-types-B-TDcvQc.d.mts +0 -1
- package/dist/codec-types-CS0bD1kX.d.mts +0 -2
- package/dist/codec-types-D7uWRvQ1-DPnvquS8.d.mts +0 -25
- package/dist/codec-types-D7uWRvQ1-DPnvquS8.d.mts.map +0 -1
- package/dist/codecs-BDdR6FbY.mjs +0 -504
- package/dist/codecs-BDdR6FbY.mjs.map +0 -1
- package/dist/codecs-BQWqLgCl-CdB8t7HI.d.mts +0 -193
- package/dist/codecs-BQWqLgCl-CdB8t7HI.d.mts.map +0 -1
- package/dist/codecs-BTv6fRXv.d.mts +0 -1
- package/dist/column-types-NVxgsjFA.mjs +0 -34
- package/dist/column-types-NVxgsjFA.mjs.map +0 -1
- package/dist/column-types-iWGuW-0W.d.mts +0 -33
- package/dist/column-types-iWGuW-0W.d.mts.map +0 -1
- package/dist/contract-free-CCLAXZV2.d.mts.map +0 -1
- package/dist/contract-free-D5cZrgNl.mjs.map +0 -1
- package/dist/control--wMueaTg.d.mts.map +0 -1
- package/dist/control-B16T9OoX.mjs +0 -51
- package/dist/control-B16T9OoX.mjs.map +0 -1
- package/dist/control-CLirKz11.d.mts.map +0 -1
- package/dist/control-D9vMRRgU.d.mts.map +0 -1
- package/dist/control-tables-D_o8dKRB-BXi43noL.mjs.map +0 -1
- package/dist/control-tables-Dua-YcJL.d.mts.map +0 -1
- package/dist/ddl-CXduXyOT-nlDP6DGx.mjs.map +0 -1
- package/dist/ddl-CfSqNT0M.d.mts +0 -1
- package/dist/default-normalizer-B9V7TY5u.d.mts +0 -7
- package/dist/default-normalizer-B9V7TY5u.d.mts.map +0 -1
- package/dist/default-normalizer-DuoHj9-O-DsK7lJZn.mjs +0 -69
- package/dist/default-normalizer-DuoHj9-O-DsK7lJZn.mjs.map +0 -1
- package/dist/descriptor-meta-C0sCVHMY-1P-YUnEW.mjs +0 -34
- package/dist/descriptor-meta-C0sCVHMY-1P-YUnEW.mjs.map +0 -1
- package/dist/descriptor-meta-DjKgG4z5-D_0obUB8.mjs +0 -34
- package/dist/descriptor-meta-DjKgG4z5-D_0obUB8.mjs.map +0 -1
- package/dist/descriptor-meta-runtime-BkXK3OjD-CxZdKHCw.mjs +0 -13
- package/dist/descriptor-meta-runtime-BkXK3OjD-CxZdKHCw.mjs.map +0 -1
- package/dist/descriptor-meta-vjJkUDsn-Hz3rnAnk.mjs +0 -70
- package/dist/descriptor-meta-vjJkUDsn-Hz3rnAnk.mjs.map +0 -1
- package/dist/errors-DnR-sMHS-KkMLIP2U.mjs +0 -38
- package/dist/errors-DnR-sMHS-KkMLIP2U.mjs.map +0 -1
- package/dist/migration-DOKPHtxn.mjs.map +0 -1
- package/dist/migration-uylRe5MP.d.mts.map +0 -1
- package/dist/native-type-normalizer-CO2wKGL6.d.mts +0 -12
- package/dist/native-type-normalizer-CO2wKGL6.d.mts.map +0 -1
- package/dist/native-type-normalizer-GpQMEyN5.mjs +0 -14
- package/dist/native-type-normalizer-GpQMEyN5.mjs.map +0 -1
- package/dist/nodes-D8EC1yCx-rpfpuJ4T.d.mts.map +0 -1
- package/dist/nodes-DUZSdX86-BBEEaxXY.mjs.map +0 -1
- package/dist/op-factory-call-DoHN7Q7L.d.mts +0 -161
- package/dist/op-factory-call-DoHN7Q7L.d.mts.map +0 -1
- package/dist/op-factory-call-gc26GqyA-Db5Fasef.mjs +0 -829
- package/dist/op-factory-call-gc26GqyA-Db5Fasef.mjs.map +0 -1
- package/dist/pack-Cn0GAuEa.d.mts +0 -103
- package/dist/pack-Cn0GAuEa.d.mts.map +0 -1
- package/dist/planner-Bxdi7jZF.d.mts.map +0 -1
- package/dist/planner-Cqjr2usR-4wg3FB78.mjs +0 -824
- package/dist/planner-Cqjr2usR-4wg3FB78.mjs.map +0 -1
- package/dist/planner-produced-sqlite-migration-BuJysRxx-CaDUbNVx.d.mts.map +0 -1
- package/dist/planner-produced-sqlite-migration-C9uVDKrJ-CWbxSANn.mjs.map +0 -1
- package/dist/planner-produced-sqlite-migration-uySoqJO-.d.mts +0 -1
- package/dist/planner-target-details-CIQ789Gc-C5U4yVY9.mjs.map +0 -1
- package/dist/planner-target-details-xR6UfIcz-CMahymzq.d.mts.map +0 -1
- package/dist/render-ops-B10yqmdG.d.mts.map +0 -1
- package/dist/render-ops-KxAmAz6d-W2xyvA5y.mjs +0 -27
- package/dist/render-ops-KxAmAz6d-W2xyvA5y.mjs.map +0 -1
- package/dist/runtime-B1coahKC.d.mts.map +0 -1
- package/dist/runtime-B99c4n56.d.mts +0 -28
- package/dist/runtime-B99c4n56.d.mts.map +0 -1
- package/dist/runtime-C5J9fusd.d.mts.map +0 -1
- package/dist/shared-BYAX0FaQ--VvRXVRC.d.mts.map +0 -1
- package/dist/sql-renderer-KX6hn_tg.d.mts +0 -1
- package/dist/sql-utils-0SJZOd7Q.d.mts.map +0 -1
- package/dist/sql-utils-C2O4zVkP-Dz3Hb85I.mjs.map +0 -1
- package/dist/sqlite-contract-view-BYR10usg-BteDAUZr.mjs.map +0 -1
- package/dist/sqlite-contract-view-BpNMaU2m-COMDaGaq.d.mts.map +0 -1
- package/dist/sqlite-migration-CjMkH4Id-c6dM9w61.mjs +0 -94
- package/dist/sqlite-migration-CjMkH4Id-c6dM9w61.mjs.map +0 -1
- package/dist/sqlite-migration-o23JHwzY-CwNJcqwl.d.mts +0 -105
- package/dist/sqlite-migration-o23JHwzY-CwNJcqwl.d.mts.map +0 -1
- package/dist/target__native-type-normalizer.d.mts +0 -2
- package/dist/target__native-type-normalizer.mjs +0 -2
- package/dist/target__runtime.mjs.map +0 -1
- package/dist/types-B7e2QVEx.d.mts +0 -1
- package/dist/types-C5FSREvo-CwUlKK34.d.mts.map +0 -1
|
@@ -0,0 +1,120 @@
|
|
|
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-Djvapurb-BR-Y4NWN.mjs";
|
|
2
|
+
import { createNumberClassifier, numeralText, parseJsonText, signedRange } from "@prisma/orm-framework/components/codec";
|
|
3
|
+
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
4
|
+
import { canonicalizeJson } from "@prisma/orm-framework/components/utils";
|
|
5
|
+
//#region ../../../3-targets/sqlite/1-target/dist/data-type-entries-DaT4D2GV.mjs
|
|
6
|
+
const classifySqliteNumber = createNumberClassifier({
|
|
7
|
+
integers: [{
|
|
8
|
+
type: sqliteInteger.id,
|
|
9
|
+
form: "text",
|
|
10
|
+
...signedRange(64)
|
|
11
|
+
}],
|
|
12
|
+
fraction: {
|
|
13
|
+
type: sqliteReal.id,
|
|
14
|
+
form: "number"
|
|
15
|
+
},
|
|
16
|
+
words: {
|
|
17
|
+
type: sqliteReal.id,
|
|
18
|
+
form: "text"
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
function printNumber(value) {
|
|
22
|
+
return typeof value === "number" ? numeralText(value) : String(value);
|
|
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
|
+
}
|
|
31
|
+
function sqliteDataTypeEntries() {
|
|
32
|
+
return {
|
|
33
|
+
[sqliteText.id]: {
|
|
34
|
+
written: {
|
|
35
|
+
kind: "plain",
|
|
36
|
+
syntax: "string",
|
|
37
|
+
parse: (text) => text
|
|
38
|
+
},
|
|
39
|
+
print: (value) => String(value),
|
|
40
|
+
documentation: "Text."
|
|
41
|
+
},
|
|
42
|
+
[sqliteReal.id]: {
|
|
43
|
+
written: {
|
|
44
|
+
kind: "plain",
|
|
45
|
+
syntax: "number",
|
|
46
|
+
types: [sqliteInteger.id, sqliteReal.id],
|
|
47
|
+
classify: classifySqliteNumber
|
|
48
|
+
},
|
|
49
|
+
print: printNumber,
|
|
50
|
+
documentation: "A number, whose type comes from its own size and precision."
|
|
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
|
+
},
|
|
61
|
+
[sqliteJson.id]: {
|
|
62
|
+
written: {
|
|
63
|
+
kind: "tag",
|
|
64
|
+
tag: "json",
|
|
65
|
+
parse: (text) => canonicalizeJson(parseJsonText(text))
|
|
66
|
+
},
|
|
67
|
+
print: (value) => String(value),
|
|
68
|
+
documentation: "Reads the text as a JSON document and stores its JSON text as the default value."
|
|
69
|
+
},
|
|
70
|
+
[sqliteBlob.id]: {
|
|
71
|
+
written: {
|
|
72
|
+
kind: "tag",
|
|
73
|
+
tag: "blob",
|
|
74
|
+
parse: sqliteBlobFromHexText
|
|
75
|
+
},
|
|
76
|
+
print: (value) => String(value).toLowerCase(),
|
|
77
|
+
documentation: "Bytes, written as hex text, two digits for each byte, as in blob`68656c6c6f`."
|
|
78
|
+
},
|
|
79
|
+
[sqliteDatetime.id]: {
|
|
80
|
+
written: {
|
|
81
|
+
kind: "tag",
|
|
82
|
+
tag: "datetime",
|
|
83
|
+
parse: sqliteDatetimeText
|
|
84
|
+
},
|
|
85
|
+
print: (value) => String(value),
|
|
86
|
+
documentation: "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."
|
|
87
|
+
},
|
|
88
|
+
[sqliteDate.id]: {
|
|
89
|
+
written: {
|
|
90
|
+
kind: "tag",
|
|
91
|
+
tag: "date",
|
|
92
|
+
parse: sqliteDateText
|
|
93
|
+
},
|
|
94
|
+
print: (value) => String(value),
|
|
95
|
+
documentation: "A calendar date, as in date`2024-02-29`, in the years 0000 to 9999, stored as the text every row holds."
|
|
96
|
+
},
|
|
97
|
+
[sqliteTime.id]: {
|
|
98
|
+
written: {
|
|
99
|
+
kind: "tag",
|
|
100
|
+
tag: "time",
|
|
101
|
+
parse: sqliteTimeText
|
|
102
|
+
},
|
|
103
|
+
print: (value) => String(value),
|
|
104
|
+
documentation: "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."
|
|
105
|
+
},
|
|
106
|
+
[sqliteDuration.id]: {
|
|
107
|
+
written: {
|
|
108
|
+
kind: "tag",
|
|
109
|
+
tag: "duration",
|
|
110
|
+
parse: sqliteDurationText
|
|
111
|
+
},
|
|
112
|
+
print: (value) => String(value),
|
|
113
|
+
documentation: "A length of time, as in duration`PT1H30M`. Reads an ISO 8601 duration and stores it as written."
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
//#endregion
|
|
118
|
+
export { sqliteDataTypeEntries as t };
|
|
119
|
+
|
|
120
|
+
//# sourceMappingURL=data-type-entries-DaT4D2GV-DE0V_N6k.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-type-entries-DaT4D2GV-DE0V_N6k.mjs","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/data-type-entries-DaT4D2GV.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-Djvapurb.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-DaT4D2GV.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"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { DataType, DataTypeId } from "@prisma/orm-framework/components/codec";
|
|
2
|
+
import { DataTypeAuthoringEntry } from "@prisma/orm-framework/components/authoring";
|
|
3
|
+
//#region ../../../3-targets/sqlite/1-target/dist/data-types.d.mts
|
|
4
|
+
//#region src/core/data-type-entries.d.ts
|
|
5
|
+
declare function sqliteDataTypeEntries(): Readonly<Record<string, DataTypeAuthoringEntry>>;
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/core/data-types.d.ts
|
|
8
|
+
declare const sqliteText: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<Readonly<Record<string, unknown>>>;
|
|
9
|
+
/** Digit text, which holds every 64-bit integer exactly; SQLite reads an INTEGER default back as a number. */
|
|
10
|
+
declare const sqliteInteger: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<Readonly<Record<string, unknown>>>;
|
|
11
|
+
/** SQLite cannot store NaN, but a codec refuses it, as ADR 254 places that limit, so the type reads it. */
|
|
12
|
+
declare const sqliteReal: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<Readonly<Record<string, unknown>>>;
|
|
13
|
+
declare const sqliteBlob: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<Readonly<Record<string, unknown>>>;
|
|
14
|
+
/** The upper-case hex `sqlite/blob` stores for the hex text a `blob` tag holds, `68656c6c6f`. */
|
|
15
|
+
declare function sqliteBlobFromHexText(text: string): string;
|
|
16
|
+
/** 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. */
|
|
17
|
+
declare const sqliteCharacterLengthParams: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
18
|
+
length?: number;
|
|
19
|
+
}, {}>;
|
|
20
|
+
declare const sqliteCharacter: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<{
|
|
21
|
+
length?: number;
|
|
22
|
+
}>;
|
|
23
|
+
declare const sqliteCharacterVarying: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<{
|
|
24
|
+
length?: number;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* 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.
|
|
28
|
+
*/
|
|
29
|
+
declare const sqliteDatetimeText: (text: string) => string;
|
|
30
|
+
/**
|
|
31
|
+
* 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.
|
|
32
|
+
*/
|
|
33
|
+
declare function sqliteDateText(text: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* 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.
|
|
36
|
+
*/
|
|
37
|
+
declare function sqliteTimeText(text: string): string;
|
|
38
|
+
/**
|
|
39
|
+
* 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.
|
|
40
|
+
*/
|
|
41
|
+
declare function sqliteDatetimeTextAtMilliseconds(text: string): string;
|
|
42
|
+
/** The value of `sqlite/duration`: an ISO 8601 duration, stored as written. Throws `CONTRACT.CAST_REFUSED` for other text. */
|
|
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;
|
|
48
|
+
/** An instant, stored as text in the form `toISOString()` writes. */
|
|
49
|
+
declare const sqliteDatetime: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<Readonly<Record<string, unknown>>>;
|
|
50
|
+
/** A calendar date, stored as text in the form `2024-02-29`. */
|
|
51
|
+
declare const sqliteDate: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<Readonly<Record<string, unknown>>>;
|
|
52
|
+
/** A time of day, stored as text with three fraction digits, `09:30:00.000`. */
|
|
53
|
+
declare const sqliteTime: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<Readonly<Record<string, unknown>>>;
|
|
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. */
|
|
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>>>;
|
|
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. */
|
|
61
|
+
declare const sqliteJson: import("@prisma/orm-family-sql/contract/data-type").SqlDataType<Readonly<Record<string, unknown>>>;
|
|
62
|
+
/** Every data type this target registers. */
|
|
63
|
+
declare const sqliteDataTypes: readonly DataType[];
|
|
64
|
+
/** SQLite's text data types: `text`, `character(n)` and `character varying(n)`. */
|
|
65
|
+
declare const sqliteTextDataTypes: readonly DataTypeId[];
|
|
66
|
+
//#endregion
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { INT64_RANGE, castUnchanged, dateTimeStoredText, isoDateStringText, readJsonBoolean, readJsonFloat, readJsonIntegerText, readJsonMatching, readJsonString, refuseJsonValue, refuseWrongShape } from "@prisma/orm-framework/components/codec";
|
|
2
|
+
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
3
|
+
import { canonicalizeJson } from "@prisma/orm-framework/components/utils";
|
|
4
|
+
import { sqlDataType, sqlRawDataType } from "@prisma/orm-family-sql/contract/data-type";
|
|
5
|
+
import { withThreeFractionDigits, withoutZerosBelowAMillisecond } from "@prisma/orm-framework/type-implementations/date";
|
|
6
|
+
import { isDecimalText, printedDecimalText } from "@prisma/orm-framework/type-implementations/decimal";
|
|
7
|
+
import { ISO_DURATION_AS_WRITTEN } from "@prisma/orm-framework/type-implementations/duration";
|
|
8
|
+
import { type } from "arktype";
|
|
9
|
+
//#region ../../../3-targets/sqlite/1-target/dist/data-types-Djvapurb.mjs
|
|
10
|
+
/** Digit text as `real` stores it: the nearest double, as SQLite converts an integer to a real. */
|
|
11
|
+
const asReal = (value) => typeof value === "string" ? Number(value) : refuseWrongShape(value, "digit text");
|
|
12
|
+
/** A type written and reported by `name` and nothing else. */
|
|
13
|
+
const storedAs = (id, name, read, casts = {}) => sqlDataType(id, {
|
|
14
|
+
texts: [{
|
|
15
|
+
text: name,
|
|
16
|
+
written: true,
|
|
17
|
+
catalog: true
|
|
18
|
+
}],
|
|
19
|
+
read,
|
|
20
|
+
casts
|
|
21
|
+
});
|
|
22
|
+
const readText = (json) => readJsonString("sqlite/text", json);
|
|
23
|
+
const UPPERCASE_HEX = /^(?:[0-9A-F]{2})*$/;
|
|
24
|
+
const sqliteText = storedAs("sqlite/text", "text", readText);
|
|
25
|
+
/** Digit text, which holds every 64-bit integer exactly; SQLite reads an INTEGER default back as a number. */
|
|
26
|
+
const sqliteInteger = sqlDataType("sqlite/integer", {
|
|
27
|
+
texts: [{
|
|
28
|
+
text: "integer",
|
|
29
|
+
written: true,
|
|
30
|
+
catalog: true
|
|
31
|
+
}],
|
|
32
|
+
read: (json) => {
|
|
33
|
+
readJsonIntegerText("sqlite/integer", json, INT64_RANGE);
|
|
34
|
+
return json;
|
|
35
|
+
},
|
|
36
|
+
casts: {}
|
|
37
|
+
});
|
|
38
|
+
/** SQLite cannot store NaN, but a codec refuses it, as ADR 254 places that limit, so the type reads it. */
|
|
39
|
+
const sqliteReal = storedAs("sqlite/real", "real", (json) => {
|
|
40
|
+
readJsonFloat("sqlite/real", json);
|
|
41
|
+
return json;
|
|
42
|
+
}, { [sqliteInteger.id]: asReal });
|
|
43
|
+
const sqliteBlob = storedAs("sqlite/blob", "blob", (json) => readJsonMatching("sqlite/blob", json, UPPERCASE_HEX, "uppercase hexadecimal text"), {});
|
|
44
|
+
const HEX_TEXT = /^(?:[0-9A-Fa-f]{2})*$/;
|
|
45
|
+
/** The upper-case hex `sqlite/blob` stores for the hex text a `blob` tag holds, `68656c6c6f`. */
|
|
46
|
+
function sqliteBlobFromHexText(text) {
|
|
47
|
+
if (!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\`.`, {
|
|
48
|
+
why: "The blob tag reads bytes as hex text, two digits for each byte.",
|
|
49
|
+
fix: "Write the bytes in hex, as in blob`68656c6c6f`."
|
|
50
|
+
});
|
|
51
|
+
return text.toUpperCase();
|
|
52
|
+
}
|
|
53
|
+
/** 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. */
|
|
54
|
+
const sqliteCharacterLengthParams = type({
|
|
55
|
+
"+": "reject",
|
|
56
|
+
"length?": `number.integer >= 1 & number.integer <= 2147483647`
|
|
57
|
+
});
|
|
58
|
+
/** A character type is written without its length, so its normal form has none. */
|
|
59
|
+
const withoutLength = ({ length: _length, ...rest }) => rest;
|
|
60
|
+
const sqliteCharacter = sqlDataType("sqlite/character", {
|
|
61
|
+
params: sqliteCharacterLengthParams,
|
|
62
|
+
texts: [{
|
|
63
|
+
text: "character",
|
|
64
|
+
written: true,
|
|
65
|
+
catalog: true
|
|
66
|
+
}],
|
|
67
|
+
read: (json) => readJsonString("sqlite/character", json),
|
|
68
|
+
normalize: withoutLength,
|
|
69
|
+
casts: { [sqliteText.id]: castUnchanged }
|
|
70
|
+
});
|
|
71
|
+
const sqliteCharacterVarying = sqlDataType("sqlite/character-varying", {
|
|
72
|
+
params: sqliteCharacterLengthParams,
|
|
73
|
+
texts: [{
|
|
74
|
+
text: "character varying",
|
|
75
|
+
written: true,
|
|
76
|
+
catalog: true
|
|
77
|
+
}],
|
|
78
|
+
read: (json) => readJsonString("sqlite/character-varying", json),
|
|
79
|
+
normalize: withoutLength,
|
|
80
|
+
casts: { [sqliteText.id]: castUnchanged }
|
|
81
|
+
});
|
|
82
|
+
/**
|
|
83
|
+
* 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.
|
|
84
|
+
*/
|
|
85
|
+
const sqliteDatetimeText = (text) => isoDateStringText(text, "sqlite/datetime");
|
|
86
|
+
/** What `sqliteDatetimeText` writes for `text`, or `undefined` when it names no instant the type holds. */
|
|
87
|
+
function storedDatetime(text) {
|
|
88
|
+
try {
|
|
89
|
+
return sqliteDatetimeText(text);
|
|
90
|
+
} catch {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/** Reads an instant in any spelling the `datetime` tag reads; `spellDatetime` gives it the one it stores. */
|
|
95
|
+
const 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);
|
|
96
|
+
/** An instant is stored in UTC with three fraction digits. */
|
|
97
|
+
const spellDatetime = (json) => typeof json === "string" ? storedDatetime(json) ?? json : json;
|
|
98
|
+
/** The years SQLite's date and time functions read, which are also the years whose text sorts in date order. */
|
|
99
|
+
const SQLITE_DATE_RANGE = {
|
|
100
|
+
earliest: "0000-01-01",
|
|
101
|
+
latest: "9999-12-31"
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* 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.
|
|
105
|
+
*/
|
|
106
|
+
function sqliteDateText(text) {
|
|
107
|
+
return dateTimeStoredText(text, {
|
|
108
|
+
shape: "date",
|
|
109
|
+
ownerId: "sqlite/date",
|
|
110
|
+
range: SQLITE_DATE_RANGE
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* 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.
|
|
115
|
+
*/
|
|
116
|
+
function sqliteTimeText(text) {
|
|
117
|
+
return withThreeFractionDigits(dateTimeStoredText(withoutZerosBelowAMillisecond(text), {
|
|
118
|
+
shape: "time",
|
|
119
|
+
ownerId: "sqlite/time",
|
|
120
|
+
maxFractionDigits: 3
|
|
121
|
+
}, text));
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* 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.
|
|
125
|
+
*/
|
|
126
|
+
function sqliteDatetimeTextAtMilliseconds(text) {
|
|
127
|
+
return sqliteDatetimeText(withoutZerosBelowAMillisecond(text));
|
|
128
|
+
}
|
|
129
|
+
/** The value of `sqlite/duration`: an ISO 8601 duration, stored as written. Throws `CONTRACT.CAST_REFUSED` for other text. */
|
|
130
|
+
function sqliteDurationText(text) {
|
|
131
|
+
if (ISO_DURATION_AS_WRITTEN.test(text)) return text;
|
|
132
|
+
throw structuredError("CONTRACT.CAST_REFUSED", `sqlite/duration cannot read "${text}". Write an ISO 8601 duration, as in "PT1H30M".`, {
|
|
133
|
+
why: "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.",
|
|
134
|
+
fix: "Write the duration in ISO 8601, as in \"P1Y2M3DT4H5M6.5S\"."
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* 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.
|
|
139
|
+
*/
|
|
140
|
+
function sqliteDecimalText(text) {
|
|
141
|
+
if (isDecimalText(text)) return printedDecimalText(text);
|
|
142
|
+
throw structuredError("CONTRACT.CAST_REFUSED", `sqlite/decimal cannot read "${text}". Write decimal text, as in "12.50".`, {
|
|
143
|
+
why: "sqlite/decimal holds decimal text: an optional minus sign, digits, and an optional fraction, with no exponent.",
|
|
144
|
+
fix: "Write the decimal as text, as in \"12.50\" or \"-3\"."
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
/** What `read` writes for `text`, or `undefined` when `read` refuses it. */
|
|
148
|
+
function storedOrUndefined(read, text) {
|
|
149
|
+
try {
|
|
150
|
+
return read(text);
|
|
151
|
+
} catch {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/** 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. */
|
|
156
|
+
function storedTextDataType(id, stored, expected, options) {
|
|
157
|
+
const read = (json) => typeof json === "string" && storedOrUndefined(stored, json) !== void 0 ? json : refuseJsonValue(id, expected, json);
|
|
158
|
+
const spell = (json) => typeof json === "string" ? storedOrUndefined(stored, json) ?? json : json;
|
|
159
|
+
return sqlDataType(id, {
|
|
160
|
+
storedAs: sqliteText.id,
|
|
161
|
+
read,
|
|
162
|
+
...options.respell ? { spell } : {}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
/** The document JSON text holds, or `undefined` when the text is not JSON. */
|
|
166
|
+
function documentOf(text) {
|
|
167
|
+
try {
|
|
168
|
+
return { value: JSON.parse(text) };
|
|
169
|
+
} catch {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
/** Reads the JSON text of a document, in any spelling; `spellJson` gives it the one it stores. */
|
|
174
|
+
const readJson = (json) => typeof json === "string" && documentOf(json) !== void 0 ? json : refuseJsonValue("sqlite/json", "the JSON text of a document", json);
|
|
175
|
+
/** A document is stored as its JSON text with sorted keys and no added whitespace. */
|
|
176
|
+
const spellJson = (json) => {
|
|
177
|
+
const document = typeof json === "string" ? documentOf(json) : void 0;
|
|
178
|
+
return document === void 0 ? json : canonicalizeJson(document.value);
|
|
179
|
+
};
|
|
180
|
+
/** An instant, stored as text in the form `toISOString()` writes. */
|
|
181
|
+
const sqliteDatetime = sqlDataType("sqlite/datetime", {
|
|
182
|
+
storedAs: sqliteText.id,
|
|
183
|
+
read: readDatetime,
|
|
184
|
+
spell: spellDatetime
|
|
185
|
+
});
|
|
186
|
+
/** A calendar date, stored as text in the form `2024-02-29`. */
|
|
187
|
+
const sqliteDate = storedTextDataType("sqlite/date", sqliteDateText, "ISO 8601 date text, as in \"2024-02-29\"", { respell: true });
|
|
188
|
+
/** A time of day, stored as text with three fraction digits, `09:30:00.000`. */
|
|
189
|
+
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 });
|
|
190
|
+
/** 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. */
|
|
191
|
+
const sqliteDuration = storedTextDataType("sqlite/duration", sqliteDurationText, "an ISO 8601 duration, as in \"PT1H30M\"", { respell: false });
|
|
192
|
+
/** 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. */
|
|
193
|
+
const sqliteDecimal = sqlDataType("sqlite/decimal", {
|
|
194
|
+
storedAs: sqliteText.id,
|
|
195
|
+
read: (json) => typeof json === "string" && isDecimalText(json) ? json : refuseJsonValue("sqlite/decimal", "decimal text, as in \"12.50\"", json),
|
|
196
|
+
spell: (json) => typeof json === "string" ? printedDecimalText(json) : json,
|
|
197
|
+
casts: {
|
|
198
|
+
[sqliteText.id]: (value) => typeof value === "string" ? sqliteDecimalText(value) : refuseWrongShape(value, "text"),
|
|
199
|
+
[sqliteInteger.id]: castUnchanged
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
/** 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`. */
|
|
203
|
+
const sqliteBoolean = sqlDataType("sqlite/boolean", {
|
|
204
|
+
storedAs: sqliteInteger.id,
|
|
205
|
+
read: (json) => readJsonBoolean("sqlite/boolean", json)
|
|
206
|
+
});
|
|
207
|
+
/** 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. */
|
|
208
|
+
const sqliteJson = sqlDataType("sqlite/json", {
|
|
209
|
+
storedAs: sqliteText.id,
|
|
210
|
+
read: readJson,
|
|
211
|
+
spell: spellJson
|
|
212
|
+
});
|
|
213
|
+
/** Every data type this target registers. */
|
|
214
|
+
const sqliteDataTypes = [
|
|
215
|
+
sqliteText,
|
|
216
|
+
sqliteInteger,
|
|
217
|
+
sqliteReal,
|
|
218
|
+
sqliteBlob,
|
|
219
|
+
sqliteCharacter,
|
|
220
|
+
sqliteCharacterVarying,
|
|
221
|
+
sqliteDatetime,
|
|
222
|
+
sqliteDate,
|
|
223
|
+
sqliteTime,
|
|
224
|
+
sqliteDuration,
|
|
225
|
+
sqliteJson,
|
|
226
|
+
sqliteDecimal,
|
|
227
|
+
sqliteBoolean,
|
|
228
|
+
sqlRawDataType
|
|
229
|
+
];
|
|
230
|
+
/** SQLite's text data types: `text`, `character(n)` and `character varying(n)`. */
|
|
231
|
+
const sqliteTextDataTypes = [
|
|
232
|
+
sqliteText.id,
|
|
233
|
+
sqliteCharacter.id,
|
|
234
|
+
sqliteCharacterVarying.id
|
|
235
|
+
];
|
|
236
|
+
//#endregion
|
|
237
|
+
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 };
|
|
238
|
+
|
|
239
|
+
//# sourceMappingURL=data-types-Djvapurb-BR-Y4NWN.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-types-Djvapurb-BR-Y4NWN.mjs","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/data-types-Djvapurb.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({\n\t\"+\": \"reject\",\n\t\"length?\": `number.integer >= 1 & number.integer <= 2147483647`\n});\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-Djvapurb.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;CACxC,KAAK;CACL,WAAW;AACZ,CAAC;;AAED,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"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { s as sqliteDataTypes } from "./data-types-Djvapurb-BR-Y4NWN.mjs";
|
|
2
|
+
import { t as requireTemporal } from "./require-temporal-CHWqSDF3-ElFTiAh6.mjs";
|
|
3
|
+
import * as nowValues from "@prisma/orm-framework/type-implementations/now";
|
|
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-DUb3x91B.mjs
|
|
6
|
+
const sqliteTargetDescriptorMetaRuntime = {
|
|
7
|
+
kind: "target",
|
|
8
|
+
familyId: "sql",
|
|
9
|
+
targetId: "sqlite",
|
|
10
|
+
id: "sqlite",
|
|
11
|
+
version: "0.0.1",
|
|
12
|
+
capabilities: {},
|
|
13
|
+
dataTypes: sqliteDataTypes
|
|
14
|
+
};
|
|
15
|
+
/** SQLite's date and time types hold milliseconds. */
|
|
16
|
+
const MILLISECOND_DIGITS = 3;
|
|
17
|
+
function instantNow() {
|
|
18
|
+
return nowValues.instantNow(requireTemporal({ generatorId: INSTANT_NOW_GENERATOR_ID }), MILLISECOND_DIGITS);
|
|
19
|
+
}
|
|
20
|
+
function plainDateNow() {
|
|
21
|
+
return nowValues.plainDateNow(requireTemporal({ generatorId: PLAIN_DATE_NOW_GENERATOR_ID }));
|
|
22
|
+
}
|
|
23
|
+
function plainTimeNow() {
|
|
24
|
+
return nowValues.plainTimeNow(requireTemporal({ generatorId: PLAIN_TIME_NOW_GENERATOR_ID }), MILLISECOND_DIGITS);
|
|
25
|
+
}
|
|
26
|
+
function instantStringNow() {
|
|
27
|
+
return nowValues.instantStringNow(MILLISECOND_DIGITS, "fixed");
|
|
28
|
+
}
|
|
29
|
+
function timeStringNow() {
|
|
30
|
+
return nowValues.timeStringNow(MILLISECOND_DIGITS, "fixed");
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 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.
|
|
34
|
+
*/
|
|
35
|
+
const sqliteNowGenerators = [
|
|
36
|
+
{
|
|
37
|
+
id: INSTANT_NOW_GENERATOR_ID,
|
|
38
|
+
generate: instantNow
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: PLAIN_DATE_NOW_GENERATOR_ID,
|
|
42
|
+
generate: plainDateNow
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: PLAIN_TIME_NOW_GENERATOR_ID,
|
|
46
|
+
generate: plainTimeNow
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: INSTANT_STRING_NOW_GENERATOR_ID,
|
|
50
|
+
generate: instantStringNow
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: DATE_STRING_NOW_GENERATOR_ID,
|
|
54
|
+
generate: nowValues.dateStringNow
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: TIME_STRING_NOW_GENERATOR_ID,
|
|
58
|
+
generate: timeStringNow
|
|
59
|
+
}
|
|
60
|
+
];
|
|
61
|
+
//#endregion
|
|
62
|
+
export { sqliteTargetDescriptorMetaRuntime as n, sqliteNowGenerators as t };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=date-time-now-generators-DUb3x91B-D0keGG59.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-time-now-generators-DUb3x91B-D0keGG59.mjs","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/date-time-now-generators-DUb3x91B.mjs"],"sourcesContent":["import { s as sqliteDataTypes } from \"./data-types-Djvapurb.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-DUb3x91B.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"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { S as sqliteTime, b as sqliteText, c as sqliteDate, i as sqliteCharacter, o as sqliteCharacterVarying, u as sqliteDatetime } from "./data-types-Djvapurb-BR-Y4NWN.mjs";
|
|
2
|
+
import { sqlRawDataType } from "@prisma/orm-family-sql/contract/data-type";
|
|
3
|
+
//#region ../../../3-targets/sqlite/1-target/dist/datetime-text-DPjoF6HJ.mjs
|
|
4
|
+
/** The `strftime` format for the text `encodeSqliteDatetime` writes. */
|
|
5
|
+
const SQLITE_DATETIME_TEXT_FORMAT = "%Y-%m-%dT%H:%M:%fZ";
|
|
6
|
+
/** The SQLite expression for the current instant, as the text `encodeSqliteDatetime` writes. */
|
|
7
|
+
const SQLITE_NOW_EXPRESSION = `strftime('${SQLITE_DATETIME_TEXT_FORMAT}','now')`;
|
|
8
|
+
/** The SQLite expression for the current date in UTC, as `sqlite/date` stores it. */
|
|
9
|
+
const SQLITE_DATE_NOW_EXPRESSION = "date('now')";
|
|
10
|
+
/** The `strftime` format for the text `sqlite/time` stores. */
|
|
11
|
+
const SQLITE_TIME_TEXT_FORMAT = "%H:%M:%f";
|
|
12
|
+
/** The SQLite expression for the current time of day in UTC, as `sqlite/time` stores it. */
|
|
13
|
+
const SQLITE_TIME_NOW_EXPRESSION = `strftime('${SQLITE_TIME_TEXT_FORMAT}','now')`;
|
|
14
|
+
const NOW_EXPRESSION_BY_DATA_TYPE = /* @__PURE__ */ new Map([
|
|
15
|
+
[sqliteDatetime.id, SQLITE_NOW_EXPRESSION],
|
|
16
|
+
[sqliteDate.id, SQLITE_DATE_NOW_EXPRESSION],
|
|
17
|
+
[sqliteTime.id, SQLITE_TIME_NOW_EXPRESSION],
|
|
18
|
+
[sqliteText.id, SQLITE_NOW_EXPRESSION],
|
|
19
|
+
[sqliteCharacter.id, SQLITE_NOW_EXPRESSION],
|
|
20
|
+
[sqliteCharacterVarying.id, SQLITE_NOW_EXPRESSION],
|
|
21
|
+
[sqlRawDataType.id, SQLITE_NOW_EXPRESSION]
|
|
22
|
+
]);
|
|
23
|
+
/**
|
|
24
|
+
* 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.
|
|
25
|
+
*/
|
|
26
|
+
function sqliteNowExpressionFor(dataTypeId) {
|
|
27
|
+
return dataTypeId === void 0 ? SQLITE_NOW_EXPRESSION : NOW_EXPRESSION_BY_DATA_TYPE.get(dataTypeId);
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
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
|
+
|
|
32
|
+
//# sourceMappingURL=datetime-text-DPjoF6HJ-se0mLEbc.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datetime-text-DPjoF6HJ-se0mLEbc.mjs","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/datetime-text-DPjoF6HJ.mjs"],"sourcesContent":["import { S as sqliteTime, b as sqliteText, c as sqliteDate, i as sqliteCharacter, o as sqliteCharacterVarying, u as sqliteDatetime } from \"./data-types-Djvapurb.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-DPjoF6HJ.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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./nodes-D8EC1yCx-BS-fKla6.mjs";
|