@prisma/orm-target-sqlite 8.0.0-rc.2-dev.2 → 8.0.0-rc.20-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -5
- package/dist/{adapter-CUTKlFpX-CW0J0Qs4.mjs → adapter-7m8HU4rt-DN15_Cn8.mjs} +178 -107
- package/dist/adapter-7m8HU4rt-DN15_Cn8.mjs.map +1 -0
- package/dist/adapter-C3hrAasJ.d.mts +197 -0
- package/dist/adapter-C3hrAasJ.d.mts.map +1 -0
- package/dist/{adapter-DEYUC-KO-DO_abhIq.d.mts → adapter-xFPDhkod-BsdLsy9N.d.mts} +12 -9
- package/dist/adapter-xFPDhkod-BsdLsy9N.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 +11 -6
- 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-DWyPO7t6.mjs → aggregates-D5fuFVMC.mjs} +33 -20
- package/dist/aggregates-D5fuFVMC.mjs.map +1 -0
- package/dist/aggregates-UBmpuURb.d.mts +164 -0
- package/dist/aggregates-UBmpuURb.d.mts.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-CMbhYIsa.d.mts +1 -0
- package/dist/{codec-ids-CzeDyMWW-BZAcI50I.d.mts → codec-ids-DuJYssXV-BPKbFNRL.d.mts} +4 -4
- package/dist/codec-ids-DuJYssXV-BPKbFNRL.d.mts.map +1 -0
- package/dist/{codec-ids-KMliSCRp-BhTbmbGr.mjs → codec-ids-wgEvkCkg-WltuexMR.mjs} +4 -4
- package/dist/codec-ids-wgEvkCkg-WltuexMR.mjs.map +1 -0
- package/dist/{codec-types-D7uWRvQ1-DPnvquS8.d.mts → codec-types-COh75Bop-CUehAexc.d.mts} +6 -5
- package/dist/codec-types-COh75Bop-CUehAexc.d.mts.map +1 -0
- package/dist/codec-types-ELHfd82J.d.mts +2 -0
- package/dist/codec-types-PONhVn74.d.mts +1 -0
- package/dist/{codecs-BQWqLgCl-CdB8t7HI.d.mts → codecs-BJYruC-a-BKDGae3k.d.mts} +86 -62
- package/dist/codecs-BJYruC-a-BKDGae3k.d.mts.map +1 -0
- package/dist/codecs-Dn0xoCuf.d.mts +1 -0
- package/dist/codecs-g-YI3BtK.mjs +49 -0
- package/dist/codecs-g-YI3BtK.mjs.map +1 -0
- package/dist/codecs-yZoH21Yj-lQXtGlEq.mjs +618 -0
- package/dist/codecs-yZoH21Yj-lQXtGlEq.mjs.map +1 -0
- package/dist/column-types-DcbNOYVb.mjs +22 -0
- package/dist/column-types-DcbNOYVb.mjs.map +1 -0
- package/dist/column-types-Dxm0BpPv.d.mts +36 -0
- package/dist/column-types-Dxm0BpPv.d.mts.map +1 -0
- package/dist/contract-contributions-wweWdXMK-CN-d35Rj.mjs +24 -0
- package/dist/contract-contributions-wweWdXMK-CN-d35Rj.mjs.map +1 -0
- package/dist/{contract-free-CCLAXZV2.d.mts → contract-free-BJwIJN6x.d.mts} +3 -3
- package/dist/contract-free-BJwIJN6x.d.mts.map +1 -0
- package/dist/{contract-free-D5cZrgNl.mjs → contract-free-DetowcoS.mjs} +8 -7
- package/dist/contract-free-DetowcoS.mjs.map +1 -0
- package/dist/{control-CLirKz11.d.mts → control-BbJiKI2r.d.mts} +24 -29
- package/dist/control-BbJiKI2r.d.mts.map +1 -0
- package/dist/{control-B16T9OoX.mjs → control-BxbKU2xs.mjs} +15 -6
- package/dist/control-BxbKU2xs.mjs.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--wMueaTg.d.mts → control-CmDsxEqb.d.mts} +75 -6
- package/dist/control-CmDsxEqb.d.mts.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-yQ-qYugg-C_NnX5WO.mjs +76 -0
- package/dist/data-type-entries-yQ-qYugg-C_NnX5WO.mjs.map +1 -0
- package/dist/data-types-Dx3rHsbF.d.mts +40 -0
- package/dist/data-types-Dx3rHsbF.d.mts.map +1 -0
- package/dist/data-types-coQrCWfS-yMCe4F52.mjs +140 -0
- package/dist/data-types-coQrCWfS-yMCe4F52.mjs.map +1 -0
- package/dist/datetime-text-Bniwehv--BSQhnrdE.mjs +9 -0
- package/dist/datetime-text-Bniwehv--BSQhnrdE.mjs.map +1 -0
- package/dist/ddl-31OBcTco.d.mts +1 -0
- package/dist/{ddl-CXduXyOT-nlDP6DGx.mjs → ddl-CX4tAZ-y-Bng-4PWC.mjs} +42 -5
- package/dist/ddl-CX4tAZ-y-Bng-4PWC.mjs.map +1 -0
- package/dist/default-normalizer-CkHy3JYk.d.mts +25 -0
- package/dist/default-normalizer-CkHy3JYk.d.mts.map +1 -0
- package/dist/default-normalizer-DGMXypHg-CPf7oyZA.mjs +112 -0
- package/dist/default-normalizer-DGMXypHg-CPf7oyZA.mjs.map +1 -0
- package/dist/descriptor-meta-COSGM3xb-Ct_5RPcm.mjs +110 -0
- package/dist/descriptor-meta-COSGM3xb-Ct_5RPcm.mjs.map +1 -0
- package/dist/descriptor-meta-DrNwC4vO-D7vuA6QK.mjs +26 -0
- package/dist/descriptor-meta-DrNwC4vO-D7vuA6QK.mjs.map +1 -0
- package/dist/{descriptor-meta-vjJkUDsn-Hz3rnAnk.mjs → descriptor-meta-cwy5CXTT-CLOhiryX.mjs} +17 -3
- package/dist/descriptor-meta-cwy5CXTT-CLOhiryX.mjs.map +1 -0
- package/dist/descriptor-meta-runtime-DX2JfHWF-Dbsh5NP8.mjs +15 -0
- package/dist/descriptor-meta-runtime-DX2JfHWF-Dbsh5NP8.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 +5 -8
- package/dist/driver__runtime.mjs.map +1 -1
- package/dist/{errors-DnR-sMHS-KkMLIP2U.mjs → errors-DnR-sMHS-D_gh214a.mjs} +2 -2
- package/dist/errors-DnR-sMHS-D_gh214a.mjs.map +1 -0
- package/dist/{migration-uylRe5MP.d.mts → migration-WJlUQmsn.d.mts} +6 -5
- package/dist/migration-WJlUQmsn.d.mts.map +1 -0
- package/dist/{migration-DOKPHtxn.mjs → migration-nqIDkjRz.mjs} +6 -5
- package/dist/migration-nqIDkjRz.mjs.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-DoHN7Q7L.d.mts → op-factory-call-De6MX7Yp.d.mts} +83 -19
- package/dist/op-factory-call-De6MX7Yp.d.mts.map +1 -0
- package/dist/op-factory-call-emj9Xp05-BFLkxrAK.mjs +1414 -0
- package/dist/op-factory-call-emj9Xp05-BFLkxrAK.mjs.map +1 -0
- package/dist/pack-DR0n9vHJ.d.mts +1179 -0
- package/dist/pack-DR0n9vHJ.d.mts.map +1 -0
- package/dist/planner-BvwYScnt-9H9LIJFn.mjs +362 -0
- package/dist/planner-BvwYScnt-9H9LIJFn.mjs.map +1 -0
- package/dist/{planner-Bxdi7jZF.d.mts → planner-CjMq9oEt.d.mts} +21 -10
- package/dist/planner-CjMq9oEt.d.mts.map +1 -0
- package/dist/{planner-produced-sqlite-migration-C9uVDKrJ-CWbxSANn.mjs → planner-produced-sqlite-migration-D2jtaItv-ZFZhPfGE.mjs} +4 -4
- package/dist/planner-produced-sqlite-migration-D2jtaItv-ZFZhPfGE.mjs.map +1 -0
- package/dist/{planner-produced-sqlite-migration-BuJysRxx-CaDUbNVx.d.mts → planner-produced-sqlite-migration-DuM9c3YI-Dacb6zQZ.d.mts} +4 -4
- package/dist/planner-produced-sqlite-migration-DuM9c3YI-Dacb6zQZ.d.mts.map +1 -0
- package/dist/planner-produced-sqlite-migration-GDP1M36D.d.mts +1 -0
- package/dist/{planner-target-details-CIQ789Gc-C5U4yVY9.mjs → planner-target-details-CIQ789Gc-Cug2V5g5.mjs} +2 -2
- package/dist/planner-target-details-CIQ789Gc-Cug2V5g5.mjs.map +1 -0
- package/dist/{planner-target-details-xR6UfIcz-CMahymzq.d.mts → planner-target-details-xR6UfIcz-BrBPQGOS.d.mts} +2 -2
- package/dist/planner-target-details-xR6UfIcz-BrBPQGOS.d.mts.map +1 -0
- package/dist/render-ops-BPLkHR-y-CPoXG5Ap.mjs +34 -0
- package/dist/render-ops-BPLkHR-y-CPoXG5Ap.mjs.map +1 -0
- package/dist/{render-ops-B10yqmdG.d.mts → render-ops-Ntl2jBJe.d.mts} +3 -3
- package/dist/render-ops-Ntl2jBJe.d.mts.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-B99c4n56.d.mts → runtime-CjIoI3sa.d.mts} +4 -4
- package/dist/runtime-CjIoI3sa.d.mts.map +1 -0
- package/dist/{runtime-C5J9fusd.d.mts → runtime-YfPIbtO6.d.mts} +4 -4
- package/dist/runtime-YfPIbtO6.d.mts.map +1 -0
- package/dist/sql-renderer-brQ96quu.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-XGT5Esi2-Zr2mqJf8.mjs} +31 -4
- package/dist/sql-utils-XGT5Esi2-Zr2mqJf8.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-BYR10usg-BteDAUZr.mjs → sqlite-contract-view-CGfiGvKH-CT-JjNHd.mjs} +9 -6
- package/dist/sqlite-contract-view-CGfiGvKH-CT-JjNHd.mjs.map +1 -0
- package/dist/sqlite-migration-BAdSmooi-iWFVQgGV.mjs +1295 -0
- package/dist/sqlite-migration-BAdSmooi-iWFVQgGV.mjs.map +1 -0
- package/dist/{sqlite-migration-o23JHwzY-CwNJcqwl.d.mts → sqlite-migration-CLIMaHLy-5ZjJDdDP.d.mts} +61 -13
- package/dist/sqlite-migration-CLIMaHLy-5ZjJDdDP.d.mts.map +1 -0
- package/dist/{shared-BYAX0FaQ--VvRXVRC.d.mts → tables-C6oejIsc-CzK00Kwl.d.mts} +38 -10
- package/dist/tables-C6oejIsc-CzK00Kwl.d.mts.map +1 -0
- package/dist/target.d.mts +29 -29
- package/dist/target.mjs +24 -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 +168 -72
- 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 +2 -2
- package/dist/target__runtime.mjs +3 -3
- package/dist/target__runtime.mjs.map +1 -1
- package/dist/target__sql-utils.d.mts +1 -1
- package/dist/target__sql-utils.mjs +1 -1
- 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/dist/types-y5JlAv97.d.mts +2 -0
- package/package.json +12 -12
- package/dist/adapter-CUTKlFpX-CW0J0Qs4.mjs.map +0 -1
- package/dist/adapter-D7zw14p5.d.mts +0 -2
- package/dist/adapter-DEYUC-KO-DO_abhIq.d.mts.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.map +0 -1
- 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.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.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.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-DjKgG4z5-D_0obUB8.mjs +0 -34
- package/dist/descriptor-meta-DjKgG4z5-D_0obUB8.mjs.map +0 -1
- package/dist/descriptor-meta-nORSZfmr-Cw-pzAJr.mjs +0 -33
- package/dist/descriptor-meta-nORSZfmr-Cw-pzAJr.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.map +0 -1
- 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.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-DIbefoZF.d.mts +0 -102
- package/dist/pack-DIbefoZF.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.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.map +0 -1
- package/dist/target__native-type-normalizer.d.mts +0 -2
- package/dist/target__native-type-normalizer.mjs +0 -2
- package/dist/types-B7e2QVEx.d.mts +0 -1
- package/dist/types-C5FSREvo-CwUlKK34.d.mts.map +0 -1
|
@@ -0,0 +1,618 @@
|
|
|
1
|
+
import { a as SQLITE_INTEGER_CODEC_ID, c as SQLITE_TEXT_CODEC_ID, i as SQLITE_DATETIME_CODEC_ID, n as SQLITE_BIGINT_NUMBER_CODEC_ID, o as SQLITE_JSON_CODEC_ID, r as SQLITE_BLOB_CODEC_ID, s as SQLITE_REAL_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID } from "./codec-ids-wgEvkCkg-WltuexMR.mjs";
|
|
2
|
+
import { a as sqliteCodec, r as defineSqliteCodecs, t as SqliteCodecDescriptor } from "./codec-descriptor-DRmF-crq-BALI5Jtz.mjs";
|
|
3
|
+
import { a as sqliteCharacterVarying, d as sqliteReal, f as sqliteText, l as sqliteInteger, r as sqliteCharacter, s as sqliteDatetime, t as sqliteBlob, u as sqliteJson } from "./data-types-coQrCWfS-yMCe4F52.mjs";
|
|
4
|
+
import { n as sqliteError } from "./errors-DnR-sMHS-D_gh214a.mjs";
|
|
5
|
+
import { BinaryExpr, CaseExpr, CastExpr, FunctionCallExpr, LiteralExpr, SqlCharCodec, SqlFloatCodec, SqlIntCodec, SqlRawCodec, SqlVarcharCodec, sqlCharDescriptor, sqlFloatDescriptor, sqlIntDescriptor, sqlRawDescriptor, sqlVarcharDescriptor } from "@prisma/orm-family-sql/relational-core/ast";
|
|
6
|
+
import { CodecImpl, SAFE_INTEGER_BIGINT_RANGE, column, decimalTextBigintLiteral, decimalTextNumberLiteral, floatNumberLiteral, floatToJson, readJsonFloat, readJsonIntegerText, refuseJsonValue, renderTsLiteral } from "@prisma/orm-framework/components/codec";
|
|
7
|
+
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
8
|
+
import { sqlRawDataType } from "@prisma/orm-family-sql/contract/data-type";
|
|
9
|
+
//#region ../../../3-targets/sqlite/1-target/dist/codecs-yZoH21Yj.mjs
|
|
10
|
+
/**
|
|
11
|
+
* Projects the expression unchanged, for codecs whose canonical JSON is what
|
|
12
|
+
* SQLite's own JSON conversion already produces.
|
|
13
|
+
*
|
|
14
|
+
* Identity here is a claim about the target's behaviour, not an absence of one:
|
|
15
|
+
* the codec's conformance cases are what test it, including at the boundaries
|
|
16
|
+
* of the representation where a native conversion would be most likely to
|
|
17
|
+
* diverge.
|
|
18
|
+
*/
|
|
19
|
+
const identityJsonProjection = (expression) => expression;
|
|
20
|
+
/**
|
|
21
|
+
* Projects an integer-valued expression as decimal text.
|
|
22
|
+
*
|
|
23
|
+
* The cast is part of the projected expression, so it applies before the JSON
|
|
24
|
+
* constructor sees the value: handed an INTEGER directly, the constructor emits
|
|
25
|
+
* a JSON number, and SQLite's 64-bit range does not survive being read back as
|
|
26
|
+
* a double. Casting the constructor's result would be too late.
|
|
27
|
+
*/
|
|
28
|
+
const decimalTextJsonProjection = (expression) => CastExpr.as(expression, "TEXT");
|
|
29
|
+
/**
|
|
30
|
+
* Projects a blob as a one-element array of its hexadecimal text.
|
|
31
|
+
*
|
|
32
|
+
* SQLite's JSON functions reject a BLOB argument outright, so the encoding has to replace the native
|
|
33
|
+
* conversion rather than post-process it. `hex()` emits uppercase and never wraps. The array is what
|
|
34
|
+
* tells a blob from text: outside a STRICT table a BLOB column may hold text, which passes through as
|
|
35
|
+
* text, as a row carries it, and so does NULL and any other value.
|
|
36
|
+
*/
|
|
37
|
+
const hexJsonProjection = (expression) => CaseExpr.of([{
|
|
38
|
+
condition: BinaryExpr.eq(FunctionCallExpr.of("typeof", [expression]), LiteralExpr.of("blob")),
|
|
39
|
+
value: FunctionCallExpr.of("json_array", [FunctionCallExpr.of("hex", [expression])])
|
|
40
|
+
}], expression);
|
|
41
|
+
/**
|
|
42
|
+
* Projects a REAL as SQLite writes it in JSON, except an infinity, which SQLite writes as `9.0e+999` and which becomes the text `Infinity` or `-Infinity` that the codec stores. The test is equality with an infinity, so text or a blob that a REAL column holds outside a STRICT table passes through unchanged.
|
|
43
|
+
*/
|
|
44
|
+
const floatJsonProjection = (expression) => CaseExpr.of([{
|
|
45
|
+
condition: BinaryExpr.eq(expression, LiteralExpr.of(Number.POSITIVE_INFINITY)),
|
|
46
|
+
value: LiteralExpr.of("Infinity")
|
|
47
|
+
}, {
|
|
48
|
+
condition: BinaryExpr.eq(expression, LiteralExpr.of(Number.NEGATIVE_INFINITY)),
|
|
49
|
+
value: LiteralExpr.of("-Infinity")
|
|
50
|
+
}], expression);
|
|
51
|
+
const JSON_RETAG_FN = "json";
|
|
52
|
+
/**
|
|
53
|
+
* Re-applies SQLite's JSON subtype to a document-valued expression.
|
|
54
|
+
*
|
|
55
|
+
* SQLite carries "this text is JSON" as a subtype on the value rather than in
|
|
56
|
+
* its type, and the subtype does not survive a derived table: a document that
|
|
57
|
+
* `json_object` produced arrives one level out as plain text, so the enclosing
|
|
58
|
+
* constructor embeds it as a *string containing JSON* rather than as a
|
|
59
|
+
* document. `json()` re-applies the subtype, which is what makes the value nest
|
|
60
|
+
* as a document again.
|
|
61
|
+
*
|
|
62
|
+
* The loss happens at the first derived-table boundary and does not compound, so
|
|
63
|
+
* a retag is needed where the document is consumed rather than at every level it
|
|
64
|
+
* passes through.
|
|
65
|
+
*
|
|
66
|
+
* Applying this twice is a no-op — SQLite's `json()` is idempotent, and the
|
|
67
|
+
* wrapper collapses rather than nesting so the rendered SQL says so too. It is
|
|
68
|
+
* safe on any valid JSON text, including scalars, and on NULL; it raises
|
|
69
|
+
* `malformed JSON` on text that is not JSON, which is the correct failure for a
|
|
70
|
+
* value that was never a document.
|
|
71
|
+
*/
|
|
72
|
+
const jsonDocumentRetag = (expression) => isJsonRetag(expression) ? expression : FunctionCallExpr.of(JSON_RETAG_FN, [expression]);
|
|
73
|
+
/** Whether an expression is already a retag, so applying one again would only nest. */
|
|
74
|
+
const isJsonRetag = (expression) => expression instanceof FunctionCallExpr && expression.fn === JSON_RETAG_FN && expression.args.length === 1;
|
|
75
|
+
const DECIMAL_INTEGER = /^-?\d+$/;
|
|
76
|
+
/** Renders the document a `sqlite/json` value's JSON text holds, when it is a string, number or boolean, and nothing for text that is not JSON. */
|
|
77
|
+
function jsonTextLiteral(value) {
|
|
78
|
+
if (typeof value !== "string") return void 0;
|
|
79
|
+
try {
|
|
80
|
+
return renderTsLiteral(JSON.parse(value));
|
|
81
|
+
} catch {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* SQLite stores an infinity but not NaN, which it turns into NULL, so a float codec on SQLite refuses NaN wherever it writes a value: to a parameter, and to the contract.
|
|
87
|
+
*/
|
|
88
|
+
function refuseNaN(codecId, value) {
|
|
89
|
+
if (Number.isNaN(value)) throw sqliteError("RUNTIME.ENCODE_FAILED", `${codecId} value must be a number other than NaN, which SQLite cannot store`, { meta: {
|
|
90
|
+
codecId,
|
|
91
|
+
received: "NaN"
|
|
92
|
+
} });
|
|
93
|
+
return value;
|
|
94
|
+
}
|
|
95
|
+
/** Reads a float's JSON form, which on SQLite has no NaN. */
|
|
96
|
+
function readJsonFloatWithoutNaN(codecId, json) {
|
|
97
|
+
const value = readJsonFloat(codecId, json);
|
|
98
|
+
if (Number.isNaN(value)) return refuseJsonValue(codecId, "a finite number or the text Infinity or -Infinity; SQLite cannot store NaN", json);
|
|
99
|
+
return value;
|
|
100
|
+
}
|
|
101
|
+
/** `sql/float@1` as SQLite stores it: without NaN. */
|
|
102
|
+
var SqliteFloatCodec = class extends SqlFloatCodec {
|
|
103
|
+
async toWire(value, ctx) {
|
|
104
|
+
return super.toWire(refuseNaN(this.id, value), ctx);
|
|
105
|
+
}
|
|
106
|
+
async fromWire(wire, _ctx) {
|
|
107
|
+
return floatWire(this.id, wire);
|
|
108
|
+
}
|
|
109
|
+
fromDataTypeValue(value) {
|
|
110
|
+
return readJsonFloatWithoutNaN(this.id, value.value);
|
|
111
|
+
}
|
|
112
|
+
toDataTypeValue(input) {
|
|
113
|
+
return super.toDataTypeValue(refuseNaN(this.id, input));
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Requires an application value to be of the JS type the codec reads.
|
|
118
|
+
*
|
|
119
|
+
* A range check reads a value of the wrong type as a value out of range, and
|
|
120
|
+
* reports a number plainly inside the range as outside it — so the type is
|
|
121
|
+
* established first and answered for on its own terms, naming what a caller
|
|
122
|
+
* has to change.
|
|
123
|
+
*/
|
|
124
|
+
const requireJsType = (codecId, expected, value) => {
|
|
125
|
+
if (typeof value === expected) return;
|
|
126
|
+
throw sqliteError("RUNTIME.ENCODE_FAILED", `${codecId} value must be a ${expected}, got ${typeof value} ${String(value)}`, { meta: {
|
|
127
|
+
codecId,
|
|
128
|
+
received: typeof value
|
|
129
|
+
} });
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Writes an application value as the decimal text `sqlite/bigint@1` carries as
|
|
133
|
+
* its canonical JSON.
|
|
134
|
+
*
|
|
135
|
+
* A schema-written literal default (`BigInt @default(0)`) arrives here as a
|
|
136
|
+
* `number`, since a number literal is the only integer a schema language
|
|
137
|
+
* writes, and one that is a safe integer names its value exactly. Past that
|
|
138
|
+
* range the literal was rounded before any of this ran, so the value written is
|
|
139
|
+
* not the value meant — which this refuses rather than minting an exact-looking
|
|
140
|
+
* value from it. A non-integral number is refused on the same terms.
|
|
141
|
+
*/
|
|
142
|
+
const bigintEncodeJson = (codecId, value) => {
|
|
143
|
+
if (typeof value !== "number") {
|
|
144
|
+
requireJsType(codecId, "bigint", value);
|
|
145
|
+
return value.toString();
|
|
146
|
+
}
|
|
147
|
+
if (!Number.isSafeInteger(value)) throw sqliteError("RUNTIME.ENCODE_FAILED", `${codecId} number literal must be an integer within the safe integer range, got ${String(value)}`, { meta: {
|
|
148
|
+
codecId,
|
|
149
|
+
received: String(value)
|
|
150
|
+
} });
|
|
151
|
+
return BigInt(value).toString();
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Requires an integer within ±(2^53 − 1), the range a JS `number` holds
|
|
155
|
+
* exactly. The guard throws rather than rounding: past the boundary a `number`
|
|
156
|
+
* silently loses digits, which is the failure mode these codecs exist to refuse.
|
|
157
|
+
*/
|
|
158
|
+
const safeIntegerNumber = (codecId, value, code) => {
|
|
159
|
+
if (!Number.isSafeInteger(value)) throw sqliteError(code, `${codecId} value must be an integer within the safe integer range, got ${String(value)}`, { meta: {
|
|
160
|
+
codecId,
|
|
161
|
+
received: String(value)
|
|
162
|
+
} });
|
|
163
|
+
if (Object.is(value, -0)) return 0;
|
|
164
|
+
return value;
|
|
165
|
+
};
|
|
166
|
+
/** The application value a number-flavoured integer codec writes: the JS type it reads, within the range that type holds exactly. */
|
|
167
|
+
const encodableSafeInteger = (codecId, value) => {
|
|
168
|
+
requireJsType(codecId, "number", value);
|
|
169
|
+
return safeIntegerNumber(codecId, value, "RUNTIME.ENCODE_FAILED");
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* Converts an exact `bigint` into a safe-range `number`, comparing before any
|
|
173
|
+
* conversion so an out-of-range value throws rather than rounds.
|
|
174
|
+
*/
|
|
175
|
+
const safeIntegerFromBigint = (codecId, value) => {
|
|
176
|
+
if (value < SAFE_INTEGER_BIGINT_RANGE.min || value > SAFE_INTEGER_BIGINT_RANGE.max) throw sqliteError("RUNTIME.DECODE_FAILED", `${codecId} value must be an integer within the safe integer range, got ${value}`, { meta: {
|
|
177
|
+
codecId,
|
|
178
|
+
received: value.toString()
|
|
179
|
+
} });
|
|
180
|
+
return Number(value);
|
|
181
|
+
};
|
|
182
|
+
/** `sqlite/integer`'s stored form, read into a `number`: digit text within the safe integer range. */
|
|
183
|
+
const safeIntegerFromDigitText = (codecId, json) => Number(readJsonIntegerText(codecId, json, SAFE_INTEGER_BIGINT_RANGE));
|
|
184
|
+
/** A `number` written as `sqlite/integer`'s stored form. */
|
|
185
|
+
const digitTextOfSafeInteger = (codecId, value) => String(encodableSafeInteger(codecId, value));
|
|
186
|
+
/**
|
|
187
|
+
* Reads an INTEGER's wire value into a `number`: the number the driver returns for a row, or the decimal text an include carries, because its projection casts the integer to text so that no digit is lost in JSON.
|
|
188
|
+
*/
|
|
189
|
+
function safeIntegerWire(codecId, wire) {
|
|
190
|
+
if (typeof wire === "number") return wire;
|
|
191
|
+
if (!DECIMAL_INTEGER.test(wire)) throw sqliteError("RUNTIME.DECODE_FAILED", `${codecId} wire value must be an integer or its decimal text`, { meta: {
|
|
192
|
+
codecId,
|
|
193
|
+
received: wire
|
|
194
|
+
} });
|
|
195
|
+
return safeIntegerFromBigint(codecId, BigInt(wire));
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Reads a REAL's wire value: the number the driver returns for a row, or the text `Infinity` or `-Infinity` an include carries, because JSON has no infinity.
|
|
199
|
+
*/
|
|
200
|
+
function floatWire(codecId, wire) {
|
|
201
|
+
if (typeof wire === "number") return wire;
|
|
202
|
+
if (wire === "Infinity") return Number.POSITIVE_INFINITY;
|
|
203
|
+
if (wire === "-Infinity") return Number.NEGATIVE_INFINITY;
|
|
204
|
+
throw sqliteError("RUNTIME.DECODE_FAILED", `${codecId} wire value must be a number, or the text Infinity or -Infinity`, { meta: {
|
|
205
|
+
codecId,
|
|
206
|
+
received: wire
|
|
207
|
+
} });
|
|
208
|
+
}
|
|
209
|
+
/** The hex text SQLite's `hex()` writes: two uppercase digits for each byte. */
|
|
210
|
+
const BLOB_HEX_TEXT = /^(?:[0-9A-F]{2})*$/;
|
|
211
|
+
/**
|
|
212
|
+
* Projects a `sql/char@1` value without trailing spaces, as its `decode` reads it on a flat read, so an include reads the same value. SQLite does not pad the value; the rule is the family codec's.
|
|
213
|
+
*/
|
|
214
|
+
const unpaddedCharJsonProjection = (expression) => FunctionCallExpr.of("rtrim", [expression, LiteralExpr.of(" ")]);
|
|
215
|
+
const sqliteSqlCharDescriptor = sqliteCodec(sqlCharDescriptor, {
|
|
216
|
+
dataType: sqliteCharacter,
|
|
217
|
+
renderValueLiteral: renderTsLiteral,
|
|
218
|
+
jsonProjection: unpaddedCharJsonProjection,
|
|
219
|
+
factory: (descriptor, dataType, params) => () => new SqlCharCodec(descriptor, dataType, params)
|
|
220
|
+
});
|
|
221
|
+
const sqliteSqlVarcharDescriptor = sqliteCodec(sqlVarcharDescriptor, {
|
|
222
|
+
dataType: sqliteCharacterVarying,
|
|
223
|
+
renderValueLiteral: renderTsLiteral,
|
|
224
|
+
jsonProjection: identityJsonProjection,
|
|
225
|
+
factory: (descriptor, dataType, params) => () => new SqlVarcharCodec(descriptor, dataType, params)
|
|
226
|
+
});
|
|
227
|
+
/**
|
|
228
|
+
* `sql/raw@1` as SQLite reads it: a value keeps the shape the driver returns for its storage class. An include carries a BLOB as the array of its hex text that the projection writes, because SQLite's JSON functions refuse a blob; a column value never reaches the JSON constructor as an array, so the array is a BLOB.
|
|
229
|
+
*/
|
|
230
|
+
var SqliteSqlRawCodec = class extends SqlRawCodec {
|
|
231
|
+
async fromWire(wire, _ctx) {
|
|
232
|
+
if (!Array.isArray(wire)) return wire;
|
|
233
|
+
const [hex] = wire.length === 1 ? wire : [];
|
|
234
|
+
if (typeof hex !== "string" || !BLOB_HEX_TEXT.test(hex)) throw sqliteError("RUNTIME.DECODE_FAILED", `${this.id} wire value in an include must be the array of a BLOB's hex text`, { meta: {
|
|
235
|
+
codecId: this.id,
|
|
236
|
+
received: String(wire)
|
|
237
|
+
} });
|
|
238
|
+
return new Uint8Array(Buffer.from(hex, "hex"));
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
const sqliteSqlRawDescriptor = sqliteCodec(sqlRawDescriptor, {
|
|
242
|
+
dataType: sqlRawDataType,
|
|
243
|
+
jsonProjection: hexJsonProjection,
|
|
244
|
+
factory: (descriptor, dataType, params) => () => new SqliteSqlRawCodec(descriptor, dataType, params)
|
|
245
|
+
});
|
|
246
|
+
/** `sql/int@1` as SQLite stores it: its stored form is `sqlite/integer`'s digit text. */
|
|
247
|
+
var SqliteSqlIntCodec = class extends SqlIntCodec {
|
|
248
|
+
async fromWire(wire, _ctx) {
|
|
249
|
+
return safeIntegerWire(this.id, wire);
|
|
250
|
+
}
|
|
251
|
+
fromDataTypeValue(value) {
|
|
252
|
+
return safeIntegerFromDigitText(this.id, value.value);
|
|
253
|
+
}
|
|
254
|
+
toDataTypeValue(input) {
|
|
255
|
+
return this.dataTypeValueOf(digitTextOfSafeInteger(this.id, input));
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
const sqliteSqlIntDescriptor = sqliteCodec(sqlIntDescriptor, {
|
|
259
|
+
dataType: sqliteInteger,
|
|
260
|
+
renderValueLiteral: decimalTextNumberLiteral,
|
|
261
|
+
jsonProjection: decimalTextJsonProjection,
|
|
262
|
+
factory: (descriptor, dataType) => () => new SqliteSqlIntCodec(descriptor, dataType)
|
|
263
|
+
});
|
|
264
|
+
const sqliteSqlFloatDescriptor = sqliteCodec(sqlFloatDescriptor, {
|
|
265
|
+
dataType: sqliteReal,
|
|
266
|
+
renderValueLiteral: floatNumberLiteral,
|
|
267
|
+
jsonProjection: floatJsonProjection,
|
|
268
|
+
factory: (descriptor, dataType) => () => new SqliteFloatCodec(descriptor, dataType)
|
|
269
|
+
});
|
|
270
|
+
var SqliteTextCodec = class extends CodecImpl {
|
|
271
|
+
async toWire(value, _ctx) {
|
|
272
|
+
return value;
|
|
273
|
+
}
|
|
274
|
+
async fromWire(wire, _ctx) {
|
|
275
|
+
return wire;
|
|
276
|
+
}
|
|
277
|
+
fromDataTypeValue(value) {
|
|
278
|
+
return value.value;
|
|
279
|
+
}
|
|
280
|
+
toDataTypeValue(input) {
|
|
281
|
+
return this.dataTypeValueOf(input);
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
var SqliteTextDescriptor = class extends SqliteCodecDescriptor {
|
|
285
|
+
jsonProjection(expression) {
|
|
286
|
+
return expression;
|
|
287
|
+
}
|
|
288
|
+
dataType = sqliteText.id;
|
|
289
|
+
codecId = SQLITE_TEXT_CODEC_ID;
|
|
290
|
+
traits = [
|
|
291
|
+
"equality",
|
|
292
|
+
"order",
|
|
293
|
+
"textual"
|
|
294
|
+
];
|
|
295
|
+
paramsSchema = void 0;
|
|
296
|
+
renderValueLiteral(value) {
|
|
297
|
+
return renderTsLiteral(value);
|
|
298
|
+
}
|
|
299
|
+
factory() {
|
|
300
|
+
return () => new SqliteTextCodec(this, sqliteText);
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
const sqliteTextDescriptor = new SqliteTextDescriptor();
|
|
304
|
+
const sqliteTextColumn = () => column(sqliteTextDescriptor.factory(), sqliteTextDescriptor.codecId, void 0);
|
|
305
|
+
var SqliteIntegerCodec = class extends CodecImpl {
|
|
306
|
+
async toWire(value, _ctx) {
|
|
307
|
+
return value;
|
|
308
|
+
}
|
|
309
|
+
async fromWire(wire, _ctx) {
|
|
310
|
+
return safeIntegerWire(SQLITE_INTEGER_CODEC_ID, wire);
|
|
311
|
+
}
|
|
312
|
+
fromDataTypeValue(value) {
|
|
313
|
+
return safeIntegerFromDigitText(SQLITE_INTEGER_CODEC_ID, value.value);
|
|
314
|
+
}
|
|
315
|
+
toDataTypeValue(input) {
|
|
316
|
+
return this.dataTypeValueOf(digitTextOfSafeInteger(SQLITE_INTEGER_CODEC_ID, input));
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
var SqliteIntegerDescriptor = class extends SqliteCodecDescriptor {
|
|
320
|
+
jsonProjection(expression) {
|
|
321
|
+
return decimalTextJsonProjection(expression);
|
|
322
|
+
}
|
|
323
|
+
dataType = sqliteInteger.id;
|
|
324
|
+
codecId = SQLITE_INTEGER_CODEC_ID;
|
|
325
|
+
traits = [
|
|
326
|
+
"equality",
|
|
327
|
+
"order",
|
|
328
|
+
"numeric"
|
|
329
|
+
];
|
|
330
|
+
paramsSchema = void 0;
|
|
331
|
+
renderValueLiteral(value) {
|
|
332
|
+
return decimalTextNumberLiteral(value);
|
|
333
|
+
}
|
|
334
|
+
factory() {
|
|
335
|
+
return () => new SqliteIntegerCodec(this, sqliteInteger);
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
const sqliteIntegerDescriptor = new SqliteIntegerDescriptor();
|
|
339
|
+
const sqliteIntegerColumn = () => column(sqliteIntegerDescriptor.factory(), sqliteIntegerDescriptor.codecId, void 0);
|
|
340
|
+
var SqliteRealCodec = class extends CodecImpl {
|
|
341
|
+
async toWire(value, _ctx) {
|
|
342
|
+
return refuseNaN(SQLITE_REAL_CODEC_ID, value);
|
|
343
|
+
}
|
|
344
|
+
async fromWire(wire, _ctx) {
|
|
345
|
+
return floatWire(SQLITE_REAL_CODEC_ID, wire);
|
|
346
|
+
}
|
|
347
|
+
fromDataTypeValue(value) {
|
|
348
|
+
return readJsonFloatWithoutNaN(SQLITE_REAL_CODEC_ID, value.value);
|
|
349
|
+
}
|
|
350
|
+
toDataTypeValue(input) {
|
|
351
|
+
return this.dataTypeValueOf(floatToJson(refuseNaN(SQLITE_REAL_CODEC_ID, input)));
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
var SqliteRealDescriptor = class extends SqliteCodecDescriptor {
|
|
355
|
+
jsonProjection(expression) {
|
|
356
|
+
return floatJsonProjection(expression);
|
|
357
|
+
}
|
|
358
|
+
dataType = sqliteReal.id;
|
|
359
|
+
codecId = SQLITE_REAL_CODEC_ID;
|
|
360
|
+
traits = [
|
|
361
|
+
"equality",
|
|
362
|
+
"order",
|
|
363
|
+
"numeric"
|
|
364
|
+
];
|
|
365
|
+
paramsSchema = void 0;
|
|
366
|
+
renderValueLiteral(value) {
|
|
367
|
+
return floatNumberLiteral(value);
|
|
368
|
+
}
|
|
369
|
+
factory() {
|
|
370
|
+
return () => new SqliteRealCodec(this, sqliteReal);
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
const sqliteRealDescriptor = new SqliteRealDescriptor();
|
|
374
|
+
const sqliteRealColumn = () => column(sqliteRealDescriptor.factory(), sqliteRealDescriptor.codecId, void 0);
|
|
375
|
+
var SqliteBlobCodec = class extends CodecImpl {
|
|
376
|
+
async toWire(value, _ctx) {
|
|
377
|
+
return value;
|
|
378
|
+
}
|
|
379
|
+
/** A row carries the blob's bytes; an include carries the array of their hex text that its projection writes, because SQLite's JSON functions refuse a blob. Anything else a BLOB column holds is refused. */
|
|
380
|
+
async fromWire(wire, _ctx) {
|
|
381
|
+
if (wire instanceof Uint8Array) return wire;
|
|
382
|
+
const [hex] = Array.isArray(wire) && wire.length === 1 ? wire : [];
|
|
383
|
+
if (typeof hex !== "string" || !BLOB_HEX_TEXT.test(hex)) throw sqliteError("RUNTIME.DECODE_FAILED", "sqlite/blob@1 wire value must be bytes, or the array of their hex text an include carries", { meta: {
|
|
384
|
+
codecId: SQLITE_BLOB_CODEC_ID,
|
|
385
|
+
received: String(wire)
|
|
386
|
+
} });
|
|
387
|
+
return new Uint8Array(Buffer.from(hex, "hex"));
|
|
388
|
+
}
|
|
389
|
+
fromDataTypeValue(value) {
|
|
390
|
+
return new Uint8Array(Buffer.from(value.value, "hex"));
|
|
391
|
+
}
|
|
392
|
+
toDataTypeValue(input) {
|
|
393
|
+
return this.dataTypeValueOf(Buffer.from(input).toString("hex").toUpperCase());
|
|
394
|
+
}
|
|
395
|
+
};
|
|
396
|
+
var SqliteBlobDescriptor = class extends SqliteCodecDescriptor {
|
|
397
|
+
jsonProjection(expression) {
|
|
398
|
+
return hexJsonProjection(expression);
|
|
399
|
+
}
|
|
400
|
+
dataType = sqliteBlob.id;
|
|
401
|
+
codecId = SQLITE_BLOB_CODEC_ID;
|
|
402
|
+
traits = ["equality"];
|
|
403
|
+
paramsSchema = void 0;
|
|
404
|
+
factory() {
|
|
405
|
+
return () => new SqliteBlobCodec(this, sqliteBlob);
|
|
406
|
+
}
|
|
407
|
+
};
|
|
408
|
+
const sqliteBlobDescriptor = new SqliteBlobDescriptor();
|
|
409
|
+
const sqliteBlobColumn = () => column(sqliteBlobDescriptor.factory(), sqliteBlobDescriptor.codecId, void 0);
|
|
410
|
+
/**
|
|
411
|
+
* Reads what SQLite holds for an instant as `Date` reads it, with text without a UTC offset read as UTC, as SQLite's own date and time functions read it, never in the machine's time zone. A number is milliseconds since 1970, as the Prisma ORM query engine wrote a `DateTime`. Digits below a millisecond are cut, as `Date` cuts them.
|
|
412
|
+
*/
|
|
413
|
+
function decodeSqliteDatetime(value) {
|
|
414
|
+
const date = new Date(typeof value === "number" ? value : asUtcWhenUnmarked(value));
|
|
415
|
+
if (Number.isNaN(date.getTime())) throw sqliteError("RUNTIME.DECODE_FAILED", `sqlite/datetime@1 wire value must be a date and time as text, or a number of milliseconds since 1970: ${String(value)}`, { meta: {
|
|
416
|
+
codecId: SQLITE_DATETIME_CODEC_ID,
|
|
417
|
+
received: String(value)
|
|
418
|
+
} });
|
|
419
|
+
return date;
|
|
420
|
+
}
|
|
421
|
+
const DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
|
|
422
|
+
const DATE_TIME_WITHOUT_OFFSET = /^(\d{4}-\d{2}-\d{2})[Tt ](\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)$/;
|
|
423
|
+
/** A date alone as its midnight in UTC, and a date and time without an offset as UTC. */
|
|
424
|
+
function asUtcWhenUnmarked(text) {
|
|
425
|
+
if (DATE_ONLY.test(text)) return `${text}T00:00:00Z`;
|
|
426
|
+
const unmarked = DATE_TIME_WITHOUT_OFFSET.exec(text);
|
|
427
|
+
return unmarked === null ? text : `${unmarked[1]}T${unmarked[2]}Z`;
|
|
428
|
+
}
|
|
429
|
+
/** The text SQLite holds for an instant: what the codec writes for every row, and for a default. */
|
|
430
|
+
function encodeSqliteDatetime(value) {
|
|
431
|
+
return value.toISOString();
|
|
432
|
+
}
|
|
433
|
+
var SqliteDatetimeCodec = class extends CodecImpl {
|
|
434
|
+
async toWire(value, _ctx) {
|
|
435
|
+
return encodeSqliteDatetime(value);
|
|
436
|
+
}
|
|
437
|
+
async fromWire(wire, _ctx) {
|
|
438
|
+
return decodeSqliteDatetime(wire);
|
|
439
|
+
}
|
|
440
|
+
fromDataTypeValue(value) {
|
|
441
|
+
return new Date(value.value);
|
|
442
|
+
}
|
|
443
|
+
toDataTypeValue(input) {
|
|
444
|
+
return this.dataTypeValueOf(input.toISOString());
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
var SqliteDatetimeDescriptor = class extends SqliteCodecDescriptor {
|
|
448
|
+
jsonProjection(expression) {
|
|
449
|
+
return expression;
|
|
450
|
+
}
|
|
451
|
+
dataType = sqliteDatetime.id;
|
|
452
|
+
codecId = SQLITE_DATETIME_CODEC_ID;
|
|
453
|
+
traits = ["equality", "order"];
|
|
454
|
+
paramsSchema = void 0;
|
|
455
|
+
factory() {
|
|
456
|
+
return () => new SqliteDatetimeCodec(this, sqliteDatetime);
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
const sqliteDatetimeDescriptor = new SqliteDatetimeDescriptor();
|
|
460
|
+
const sqliteDatetimeColumn = () => column(sqliteDatetimeDescriptor.factory(), sqliteDatetimeDescriptor.codecId, void 0);
|
|
461
|
+
var SqliteJsonCodec = class extends CodecImpl {
|
|
462
|
+
async toWire(value, _ctx) {
|
|
463
|
+
return JSON.stringify(value);
|
|
464
|
+
}
|
|
465
|
+
async fromWire(wire, _ctx) {
|
|
466
|
+
return typeof wire === "string" ? blindCast(JSON.parse(wire)) : wire;
|
|
467
|
+
}
|
|
468
|
+
fromDataTypeValue(value) {
|
|
469
|
+
return blindCast(JSON.parse(value.value));
|
|
470
|
+
}
|
|
471
|
+
toDataTypeValue(input) {
|
|
472
|
+
return this.dataTypeValueOf(JSON.stringify(input));
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
/**
|
|
476
|
+
* The column stores the document's JSON text and the stored form is that text, so the stored
|
|
477
|
+
* value is projected as it is: a string the enclosing JSON constructor embeds as a string.
|
|
478
|
+
*/
|
|
479
|
+
var SqliteJsonDescriptor = class extends SqliteCodecDescriptor {
|
|
480
|
+
jsonProjection(expression) {
|
|
481
|
+
return expression;
|
|
482
|
+
}
|
|
483
|
+
dataType = sqliteJson.id;
|
|
484
|
+
codecId = SQLITE_JSON_CODEC_ID;
|
|
485
|
+
traits = ["equality"];
|
|
486
|
+
paramsSchema = void 0;
|
|
487
|
+
renderValueLiteral(value) {
|
|
488
|
+
return jsonTextLiteral(value);
|
|
489
|
+
}
|
|
490
|
+
factory() {
|
|
491
|
+
return () => new SqliteJsonCodec(this, sqliteJson);
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
const sqliteJsonDescriptor = new SqliteJsonDescriptor();
|
|
495
|
+
const sqliteJsonColumn = () => column(sqliteJsonDescriptor.factory(), sqliteJsonDescriptor.codecId, void 0);
|
|
496
|
+
var SqliteBigintCodec = class extends CodecImpl {
|
|
497
|
+
async toWire(value, _ctx) {
|
|
498
|
+
requireJsType(SQLITE_BIGINT_CODEC_ID, "bigint", value);
|
|
499
|
+
return value;
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* The wire value is text wherever the value could outrun a JS number: an
|
|
503
|
+
* aggregate SQLite computes leaves the database through the descriptor's cast
|
|
504
|
+
* to text, because the driver reads an integer no number can hold as an error
|
|
505
|
+
* rather than a value. A number-typed wire value must therefore be a safe
|
|
506
|
+
* integer — past ±(2^53 − 1) it has already rounded, and converting it would
|
|
507
|
+
* mint a spuriously-exact `bigint` that need not equal the stored value.
|
|
508
|
+
*/
|
|
509
|
+
async fromWire(wire, _ctx) {
|
|
510
|
+
if (typeof wire === "number" && !Number.isSafeInteger(wire)) throw sqliteError("RUNTIME.DECODE_FAILED", `sqlite/bigint@1 wire number must be an integer within the safe integer range, got ${String(wire)}`, { meta: {
|
|
511
|
+
codecId: SQLITE_BIGINT_CODEC_ID,
|
|
512
|
+
received: String(wire)
|
|
513
|
+
} });
|
|
514
|
+
if (typeof wire === "string" && !DECIMAL_INTEGER.test(wire)) throw sqliteError("RUNTIME.DECODE_FAILED", "sqlite/bigint@1 wire value must be a decimal string", { meta: {
|
|
515
|
+
codecId: SQLITE_BIGINT_CODEC_ID,
|
|
516
|
+
received: wire
|
|
517
|
+
} });
|
|
518
|
+
return BigInt(wire);
|
|
519
|
+
}
|
|
520
|
+
fromDataTypeValue(value) {
|
|
521
|
+
return BigInt(value.value);
|
|
522
|
+
}
|
|
523
|
+
toDataTypeValue(input) {
|
|
524
|
+
return this.dataTypeValueOf(bigintEncodeJson(SQLITE_BIGINT_CODEC_ID, input));
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
var SqliteBigintDescriptor = class extends SqliteCodecDescriptor {
|
|
528
|
+
jsonProjection(expression) {
|
|
529
|
+
return decimalTextJsonProjection(expression);
|
|
530
|
+
}
|
|
531
|
+
dataType = sqliteInteger.id;
|
|
532
|
+
codecId = SQLITE_BIGINT_CODEC_ID;
|
|
533
|
+
traits = [
|
|
534
|
+
"equality",
|
|
535
|
+
"order",
|
|
536
|
+
"numeric"
|
|
537
|
+
];
|
|
538
|
+
paramsSchema = void 0;
|
|
539
|
+
renderValueLiteral(value) {
|
|
540
|
+
return decimalTextBigintLiteral(value);
|
|
541
|
+
}
|
|
542
|
+
factory() {
|
|
543
|
+
return () => new SqliteBigintCodec(this, sqliteInteger);
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
const sqliteBigintDescriptor = new SqliteBigintDescriptor();
|
|
547
|
+
const sqliteBigintColumn = () => column(sqliteBigintDescriptor.factory(), sqliteBigintDescriptor.codecId, void 0);
|
|
548
|
+
/**
|
|
549
|
+
* A SQLite INTEGER decoded as a JS `number`, for columns whose values stay
|
|
550
|
+
* within the safe integer range ±(2^53 − 1). Both directions guard rather than
|
|
551
|
+
* round: decode (wire and JSON) and encode throw a structured error on
|
|
552
|
+
* out-of-range or non-integral input. The canonical JSON is the decimal text
|
|
553
|
+
* `sqlite/integer` carries, which every codec of that data type shares.
|
|
554
|
+
*/
|
|
555
|
+
var SqliteBigintNumberCodec = class extends CodecImpl {
|
|
556
|
+
async toWire(value, _ctx) {
|
|
557
|
+
return encodableSafeInteger(SQLITE_BIGINT_NUMBER_CODEC_ID, value);
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* The driver hands an INTEGER over as a `number` or, in safe-integer mode, a
|
|
561
|
+
* `bigint`; a bigint (or decimal text) is range-checked exactly before any
|
|
562
|
+
* conversion to `number`, so an out-of-range value throws rather than rounds.
|
|
563
|
+
*/
|
|
564
|
+
async fromWire(wire, _ctx) {
|
|
565
|
+
if (typeof wire === "number") return safeIntegerNumber(SQLITE_BIGINT_NUMBER_CODEC_ID, wire, "RUNTIME.DECODE_FAILED");
|
|
566
|
+
if (typeof wire === "string" && !DECIMAL_INTEGER.test(wire)) throw sqliteError("RUNTIME.DECODE_FAILED", "sqlite/bigintnumber@1 wire value must be a decimal string", { meta: {
|
|
567
|
+
codecId: SQLITE_BIGINT_NUMBER_CODEC_ID,
|
|
568
|
+
received: wire
|
|
569
|
+
} });
|
|
570
|
+
return safeIntegerFromBigint(SQLITE_BIGINT_NUMBER_CODEC_ID, BigInt(wire));
|
|
571
|
+
}
|
|
572
|
+
fromDataTypeValue(value) {
|
|
573
|
+
return safeIntegerFromDigitText(SQLITE_BIGINT_NUMBER_CODEC_ID, value.value);
|
|
574
|
+
}
|
|
575
|
+
toDataTypeValue(input) {
|
|
576
|
+
return this.dataTypeValueOf(digitTextOfSafeInteger(SQLITE_BIGINT_NUMBER_CODEC_ID, input));
|
|
577
|
+
}
|
|
578
|
+
};
|
|
579
|
+
var SqliteBigintNumberDescriptor = class extends SqliteCodecDescriptor {
|
|
580
|
+
jsonProjection(expression) {
|
|
581
|
+
return decimalTextJsonProjection(expression);
|
|
582
|
+
}
|
|
583
|
+
dataType = sqliteInteger.id;
|
|
584
|
+
codecId = SQLITE_BIGINT_NUMBER_CODEC_ID;
|
|
585
|
+
traits = [
|
|
586
|
+
"equality",
|
|
587
|
+
"order",
|
|
588
|
+
"numeric"
|
|
589
|
+
];
|
|
590
|
+
paramsSchema = void 0;
|
|
591
|
+
renderValueLiteral(value) {
|
|
592
|
+
return decimalTextNumberLiteral(value);
|
|
593
|
+
}
|
|
594
|
+
factory() {
|
|
595
|
+
return () => new SqliteBigintNumberCodec(this, sqliteInteger);
|
|
596
|
+
}
|
|
597
|
+
};
|
|
598
|
+
const sqliteBigintNumberDescriptor = new SqliteBigintNumberDescriptor();
|
|
599
|
+
const sqliteBigintNumberColumn = () => column(sqliteBigintNumberDescriptor.factory(), sqliteBigintNumberDescriptor.codecId, void 0);
|
|
600
|
+
const codecDescriptors = defineSqliteCodecs([
|
|
601
|
+
sqliteSqlCharDescriptor,
|
|
602
|
+
sqliteSqlVarcharDescriptor,
|
|
603
|
+
sqliteSqlIntDescriptor,
|
|
604
|
+
sqliteSqlFloatDescriptor,
|
|
605
|
+
sqliteSqlRawDescriptor,
|
|
606
|
+
sqliteTextDescriptor,
|
|
607
|
+
sqliteIntegerDescriptor,
|
|
608
|
+
sqliteRealDescriptor,
|
|
609
|
+
sqliteBlobDescriptor,
|
|
610
|
+
sqliteDatetimeDescriptor,
|
|
611
|
+
sqliteJsonDescriptor,
|
|
612
|
+
sqliteBigintDescriptor,
|
|
613
|
+
sqliteBigintNumberDescriptor
|
|
614
|
+
]);
|
|
615
|
+
//#endregion
|
|
616
|
+
export { sqliteBigintNumberColumn as a, sqliteIntegerColumn as c, sqliteTextColumn as d, sqliteBigintColumn as i, sqliteJsonColumn as l, encodeSqliteDatetime as n, sqliteBlobColumn as o, jsonDocumentRetag as r, sqliteDatetimeColumn as s, codecDescriptors as t, sqliteRealColumn as u };
|
|
617
|
+
|
|
618
|
+
//# sourceMappingURL=codecs-yZoH21Yj-lQXtGlEq.mjs.map
|