@prisma/orm-target-postgres 8.0.0-rc.14-dev.6 → 8.0.0-rc.14-dev.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-CK9Nv-pg-DiFXST2r.mjs → adapter-Bb_FFDea-O-uPaHCy.mjs} +5 -5
- package/dist/{adapter-CK9Nv-pg-DiFXST2r.mjs.map → adapter-Bb_FFDea-O-uPaHCy.mjs.map} +1 -1
- package/dist/{adapter-DP_SQYED.d.mts → adapter-WLK_P3mT.d.mts} +3 -3
- package/dist/{adapter-DP_SQYED.d.mts.map → adapter-WLK_P3mT.d.mts.map} +1 -1
- package/dist/adapter.d.mts +8 -8
- package/dist/adapter.mjs +6 -6
- package/dist/adapter__adapter.d.mts +1 -1
- package/dist/adapter__adapter.mjs +1 -1
- package/dist/adapter__control.d.mts +3 -3
- package/dist/adapter__control.mjs +8 -369
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.d.mts +1 -1
- package/dist/adapter__runtime.mjs +4 -5
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/adapter__sql-renderer.d.mts +1 -1
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/adapter__types.d.mts +3 -3
- package/dist/{authoring-BmQxOggr-CK871YR4.mjs → authoring-DKN1ccEX-DgmJWx1r.mjs} +4 -4
- package/dist/{authoring-BmQxOggr-CK871YR4.mjs.map → authoring-DKN1ccEX-DgmJWx1r.mjs.map} +1 -1
- package/dist/{codec-descriptor-BfoHQP3R-CMRVT-F6.mjs → codec-descriptor-B61d-k4C-BdWVU6Fu.mjs} +4 -3
- package/dist/codec-descriptor-B61d-k4C-BdWVU6Fu.mjs.map +1 -0
- package/dist/codec-descriptor-D8_e5hpo.d.mts +1 -0
- package/dist/{codec-descriptor-DUUGoeyI-WGLGXEoI.d.mts → codec-descriptor-HYqjI24K-CTO3gTEs.d.mts} +11 -5
- package/dist/codec-descriptor-HYqjI24K-CTO3gTEs.d.mts.map +1 -0
- package/dist/{data-types-Cl18KnNY-5I34Vd6Z.mjs → codec-helpers-D83-1eDB-nqAEMr7N.mjs} +39 -216
- package/dist/codec-helpers-D83-1eDB-nqAEMr7N.mjs.map +1 -0
- package/dist/{codec-type-map-Cp91lhQd-D6zQ14YE.d.mts → codec-type-map-DMKy_xZb-DymgX4w7.d.mts} +4 -4
- package/dist/{codec-type-map-Cp91lhQd-D6zQ14YE.d.mts.map → codec-type-map-DMKy_xZb-DymgX4w7.d.mts.map} +1 -1
- package/dist/{codec-types-BQNq7Y1u-CGfS7PuD.d.mts → codec-types-B4-xhn7m-RQS461us.d.mts} +4 -4
- package/dist/{codec-types-BQNq7Y1u-CGfS7PuD.d.mts.map → codec-types-B4-xhn7m-RQS461us.d.mts.map} +1 -1
- package/dist/codec-types-Ci1nfCYh.d.mts +2 -0
- package/dist/{codecs-DQGmsnk3-H6nVRPCC.mjs → codecs-BHNqtI1J-BSS9sL3H.mjs} +263 -69
- package/dist/codecs-BHNqtI1J-BSS9sL3H.mjs.map +1 -0
- package/dist/{codecs-BKV97Xsa.d.mts → codecs-Ba3gUr67.d.mts} +11 -5
- package/dist/{codecs-BKV97Xsa.d.mts.map → codecs-Ba3gUr67.d.mts.map} +1 -1
- package/dist/{codecs-BZ87E3MY-Bub4t0ma.d.mts → codecs-Bkmbmo_r-Ct7hFY0S.d.mts} +31 -10
- package/dist/{codecs-BZ87E3MY-Bub4t0ma.d.mts.map → codecs-Bkmbmo_r-Ct7hFY0S.d.mts.map} +1 -1
- package/dist/{codecs-C4DVdgQG.mjs → codecs-Cytq8Ymj.mjs} +12 -4
- package/dist/codecs-Cytq8Ymj.mjs.map +1 -0
- package/dist/control-CUzQZfhu.d.mts +399 -0
- package/dist/control-CUzQZfhu.d.mts.map +1 -0
- package/dist/{control-BwOrmTN-.mjs → control-CYQReJto.mjs} +441 -72
- package/dist/control-CYQReJto.mjs.map +1 -0
- package/dist/{control-DhZYlj-u.d.mts → control-DoIm71dz.d.mts} +5 -4
- package/dist/control-DoIm71dz.d.mts.map +1 -0
- package/dist/{control-adapter-BaVlICog-BuVBXKoL.mjs → control-adapter-C6kz--Q4-3C9-f7Uv.mjs} +70 -47
- package/dist/control-adapter-C6kz--Q4-3C9-f7Uv.mjs.map +1 -0
- package/dist/{control-policy-BYo5QPof-BLT07t1y.mjs → control-policy-voGArjr--BeHlQRg0.mjs} +19 -17
- package/dist/control-policy-voGArjr--BeHlQRg0.mjs.map +1 -0
- package/dist/{data-type-entries-CvkBtAG--D-5Wtm9_.mjs → data-type-entries-BDSHvsdE-Bbe1cdbR.mjs} +3 -3
- package/dist/{data-type-entries-CvkBtAG--D-5Wtm9_.mjs.map → data-type-entries-BDSHvsdE-Bbe1cdbR.mjs.map} +1 -1
- package/dist/data-types-BqeC7aZP-CwvA08pH.mjs +200 -0
- package/dist/data-types-BqeC7aZP-CwvA08pH.mjs.map +1 -0
- package/dist/{default-normalizer-DKE2xbCP-EMLD6yNw.mjs → default-normalizer-Cb7nWBUa-DXchlOUk.mjs} +18 -8
- package/dist/default-normalizer-Cb7nWBUa-DXchlOUk.mjs.map +1 -0
- package/dist/{descriptor-meta-F1wsOtt2-D014LIGM.mjs → descriptor-meta-BEigA5Gj-By_dcUjB.mjs} +9 -7
- package/dist/descriptor-meta-BEigA5Gj-By_dcUjB.mjs.map +1 -0
- package/dist/{descriptor-meta-BOx9pvBv-C4TEXck8.mjs → descriptor-meta-DF0hODA0-DnO80XvH.mjs} +4 -4
- package/dist/{descriptor-meta-BOx9pvBv-C4TEXck8.mjs.map → descriptor-meta-DF0hODA0-DnO80XvH.mjs.map} +1 -1
- package/dist/{diff-database-schema-D835UIq8-BVO7jCE4.mjs → diff-database-schema-MYPfxeRf-DdgnOIIl.mjs} +17 -7
- package/dist/diff-database-schema-MYPfxeRf-DdgnOIIl.mjs.map +1 -0
- package/dist/{full-text-jDpkANi7.d.mts → full-text-Cth_mXe_.d.mts} +2 -2
- package/dist/{full-text-jDpkANi7.d.mts.map → full-text-Cth_mXe_.d.mts.map} +1 -1
- package/dist/{full-text-index-expression-PZszha7L-CW7i1TUY.mjs → full-text-index-expression-BM_vGygX-BOuja7X4.mjs} +3 -3
- package/dist/{full-text-index-expression-PZszha7L-CW7i1TUY.mjs.map → full-text-index-expression-BM_vGygX-BOuja7X4.mjs.map} +1 -1
- package/dist/{full-text-parsers-Dp_ANr31-DVxYUNS-.d.mts → full-text-parsers-CLZpb096-BN1xyHeO.d.mts} +3 -3
- package/dist/{full-text-parsers-Dp_ANr31-DVxYUNS-.d.mts.map → full-text-parsers-CLZpb096-BN1xyHeO.d.mts.map} +1 -1
- package/dist/{infer-psl-contract-pxmVP3E9-Bvk8NzS0.mjs → infer-psl-contract-D7XJnfJv-Cd_Mf0UH.mjs} +78 -82
- package/dist/infer-psl-contract-D7XJnfJv-Cd_Mf0UH.mjs.map +1 -0
- package/dist/{issue-planner-D9rRu2pB.d.mts → issue-planner-C4iR-Ik-.d.mts} +2 -2
- package/dist/{issue-planner-D9rRu2pB.d.mts.map → issue-planner-C4iR-Ik-.d.mts.map} +1 -1
- package/dist/{migration-Du89zGmx.d.mts → migration-BTiY0PPC.d.mts} +3 -3
- package/dist/{migration-Du89zGmx.d.mts.map → migration-BTiY0PPC.d.mts.map} +1 -1
- package/dist/migration-PTHAY9Cv.mjs.map +1 -1
- package/dist/{native-type-normalizer-DhbUgdrI.d.mts → native-type-normalizer-BFo5tSyh.d.mts} +2 -5
- package/dist/native-type-normalizer-BFo5tSyh.d.mts.map +1 -0
- package/dist/native-type-normalizer-CW6g9Fut-C5lMRRjS.mjs +102 -0
- package/dist/native-type-normalizer-CW6g9Fut-C5lMRRjS.mjs.map +1 -0
- package/dist/op-factory-call-Bi1XxJEv.d.mts +1 -0
- package/dist/{op-factory-call-t4k8mlRJ-BgtGXlIC.d.mts → op-factory-call-VLJFI-b_-Du23HNYc.d.mts} +5 -5
- package/dist/op-factory-call-VLJFI-b_-Du23HNYc.d.mts.map +1 -0
- package/dist/{op-factory-call-BBkvFvKK-7MkUHWJq.mjs → op-factory-call-y5YADY2E-CnhkIujC.mjs} +39 -26
- package/dist/op-factory-call-y5YADY2E-CnhkIujC.mjs.map +1 -0
- package/dist/{operation-types-DZyRBrnm.d.mts → operation-types-Cj4S6KNP.d.mts} +2 -2
- package/dist/{operation-types-DZyRBrnm.d.mts.map → operation-types-Cj4S6KNP.d.mts.map} +1 -1
- package/dist/{pack-B8SM_MTs.d.mts → pack-DO2bXv9P.d.mts} +3 -3
- package/dist/{pack-B8SM_MTs.d.mts.map → pack-DO2bXv9P.d.mts.map} +1 -1
- package/dist/{planner-CquxMKq_-CZQAaWfK.mjs → planner-DMVaXRSK-DCAGfALs.mjs} +6 -6
- package/dist/{planner-CquxMKq_-CZQAaWfK.mjs.map → planner-DMVaXRSK-DCAGfALs.mjs.map} +1 -1
- package/dist/{planner-o0_69Y9q.d.mts → planner-SLaWpf7q.d.mts} +2 -2
- package/dist/{planner-o0_69Y9q.d.mts.map → planner-SLaWpf7q.d.mts.map} +1 -1
- package/dist/{planner-ddl-builders-BQ_1YXut.d.mts → planner-ddl-builders-DYLyFXrj.d.mts} +2 -5
- package/dist/planner-ddl-builders-DYLyFXrj.d.mts.map +1 -0
- package/dist/{planner-ddl-builders-GTcVPpwb-ClvrXb26.mjs → planner-ddl-builders-iE35pyxA-g7b_clbn.mjs} +6 -27
- package/dist/planner-ddl-builders-iE35pyxA-g7b_clbn.mjs.map +1 -0
- package/dist/planner-produced-postgres-migration-Bi_Otmtx.d.mts +1 -0
- package/dist/{planner-produced-postgres-migration-DEJQPRjI-C9GuvVOY.mjs → planner-produced-postgres-migration-C8TUIl2Z-DHjubKQ-.mjs} +3 -3
- package/dist/{planner-produced-postgres-migration-DEJQPRjI-C9GuvVOY.mjs.map → planner-produced-postgres-migration-C8TUIl2Z-DHjubKQ-.mjs.map} +1 -1
- package/dist/{planner-produced-postgres-migration-Xd83anY_-vp2DJ5fk.d.mts → planner-produced-postgres-migration-CoOcn-b9-8kOq82_P.d.mts} +3 -3
- package/dist/planner-produced-postgres-migration-CoOcn-b9-8kOq82_P.d.mts.map +1 -0
- package/dist/{planner-sql-checks-Bd8nN9P8-Cd98iEee.mjs → planner-sql-checks-ZMXeCK6W-D1VMBywZ.mjs} +55 -15
- package/dist/planner-sql-checks-ZMXeCK6W-D1VMBywZ.mjs.map +1 -0
- package/dist/{postgres-contract-view-DxcRT-qe-LQBHHgaS.mjs → postgres-contract-view-BBMpf_qi-8V4vTm9U.mjs} +3 -3
- package/dist/{postgres-contract-view-DxcRT-qe-LQBHHgaS.mjs.map → postgres-contract-view-BBMpf_qi-8V4vTm9U.mjs.map} +1 -1
- package/dist/{postgres-migration-B7ihBnbW-DOmrgtms.d.mts → postgres-migration-B03W06rR-DTB0R3cj.d.mts} +4 -5
- package/dist/{postgres-migration-B7ihBnbW-DOmrgtms.d.mts.map → postgres-migration-B03W06rR-DTB0R3cj.d.mts.map} +1 -1
- package/dist/{postgres-migration-qwigEUIO-BWxjALsx.mjs → postgres-migration-UzDaU7Or-Dvc0Cdv5.mjs} +22 -5
- package/dist/postgres-migration-UzDaU7Or-Dvc0Cdv5.mjs.map +1 -0
- package/dist/{prisma7-binding-B-JcNfUc.mjs → prisma7-binding-D_Q6ou4j.mjs} +7 -6
- package/dist/prisma7-binding-D_Q6ou4j.mjs.map +1 -0
- package/dist/{prisma7-binding-1CMtcbOk.d.mts → prisma7-binding-c5vWJV6k.d.mts} +3 -3
- package/dist/{prisma7-binding-1CMtcbOk.d.mts.map → prisma7-binding-c5vWJV6k.d.mts.map} +1 -1
- package/dist/{runtime-aN2tMH8u.d.mts → runtime-Bm1hGqOh.d.mts} +2 -2
- package/dist/{runtime-aN2tMH8u.d.mts.map → runtime-Bm1hGqOh.d.mts.map} +1 -1
- package/dist/{sql-renderer-DmJ5aZwd.d.mts → sql-renderer-CfXWPuXU.d.mts} +4 -4
- package/dist/{sql-renderer-DmJ5aZwd.d.mts.map → sql-renderer-CfXWPuXU.d.mts.map} +1 -1
- package/dist/{sql-renderer-CgUgFbU4-CRUChEAY.mjs → sql-renderer-CgUgFbU4-DqTf31OD.mjs} +2 -2
- package/dist/{sql-renderer-CgUgFbU4-CRUChEAY.mjs.map → sql-renderer-CgUgFbU4-DqTf31OD.mjs.map} +1 -1
- package/dist/target.d.mts +23 -23
- package/dist/target.mjs +21 -22
- package/dist/target__codec-descriptor.d.mts +2 -2
- package/dist/target__codec-descriptor.mjs +1 -1
- package/dist/target__codec-types.d.mts +3 -3
- package/dist/target__codecs.d.mts +3 -3
- package/dist/target__codecs.mjs +3 -4
- package/dist/target__control.d.mts +2 -2
- package/dist/target__control.mjs +3 -3
- package/dist/target__data-types.mjs +2 -2
- package/dist/target__default-normalizer.mjs +1 -1
- package/dist/target__diff-database-schema.mjs +1 -1
- package/dist/target__full-text.d.mts +2 -2
- package/dist/target__issue-planner.d.mts +1 -1
- package/dist/target__issue-planner.mjs +1 -1
- package/dist/target__migration.d.mts +2 -2
- package/dist/target__migration.mjs +2 -2
- package/dist/target__native-type-normalizer.d.mts +1 -1
- package/dist/target__native-type-normalizer.mjs +1 -1
- package/dist/target__op-factory-call.d.mts +2 -2
- package/dist/target__op-factory-call.mjs +1 -1
- package/dist/target__operation-types.d.mts +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__planner-ddl-builders.d.mts +2 -2
- package/dist/target__planner-ddl-builders.mjs +2 -2
- package/dist/target__planner-produced-postgres-migration.d.mts +2 -2
- package/dist/target__planner-produced-postgres-migration.mjs +1 -1
- package/dist/target__planner-sql-checks.mjs +1 -1
- package/dist/target__planner.d.mts +1 -1
- package/dist/target__planner.mjs +2 -2
- package/dist/target__prisma7-binding.d.mts +1 -1
- package/dist/target__prisma7-binding.mjs +1 -1
- package/dist/target__runtime.mjs +2 -2
- package/dist/target__runtime.mjs.map +1 -1
- package/dist/target__sql-utils.mjs +1 -1
- package/dist/{types-BPubHbiE-mnhvO20x.d.mts → types-BPubHbiE-SaR3Cngi.d.mts} +3 -3
- package/dist/{types-BPubHbiE-mnhvO20x.d.mts.map → types-BPubHbiE-SaR3Cngi.d.mts.map} +1 -1
- package/dist/types-DvEixgWS.d.mts +2 -0
- package/package.json +9 -9
- package/dist/codec-descriptor-BfoHQP3R-CMRVT-F6.mjs.map +0 -1
- package/dist/codec-descriptor-Cf1qfOwo.d.mts +0 -1
- package/dist/codec-descriptor-DUUGoeyI-WGLGXEoI.d.mts.map +0 -1
- package/dist/codec-types-BXbWuRzS.d.mts +0 -2
- package/dist/codecs-C4DVdgQG.mjs.map +0 -1
- package/dist/codecs-DQGmsnk3-H6nVRPCC.mjs.map +0 -1
- package/dist/control-BwOrmTN-.mjs.map +0 -1
- package/dist/control-CDRHOvkm.d.mts +0 -12
- package/dist/control-CDRHOvkm.d.mts.map +0 -1
- package/dist/control-DhZYlj-u.d.mts.map +0 -1
- package/dist/control-adapter-BaVlICog-BuVBXKoL.mjs.map +0 -1
- package/dist/control-policy-BYo5QPof-BLT07t1y.mjs.map +0 -1
- package/dist/data-types-Cl18KnNY-5I34Vd6Z.mjs.map +0 -1
- package/dist/default-normalizer-DKE2xbCP-EMLD6yNw.mjs.map +0 -1
- package/dist/descriptor-meta-F1wsOtt2-D014LIGM.mjs.map +0 -1
- package/dist/diff-database-schema-D835UIq8-BVO7jCE4.mjs.map +0 -1
- package/dist/infer-psl-contract-pxmVP3E9-Bvk8NzS0.mjs.map +0 -1
- package/dist/native-type-normalizer-DWc6cr5r.mjs +0 -94
- package/dist/native-type-normalizer-DWc6cr5r.mjs.map +0 -1
- package/dist/native-type-normalizer-DhbUgdrI.d.mts.map +0 -1
- package/dist/op-factory-call-7Dtfo3GK.d.mts +0 -1
- package/dist/op-factory-call-BBkvFvKK-7MkUHWJq.mjs.map +0 -1
- package/dist/op-factory-call-t4k8mlRJ-BgtGXlIC.d.mts.map +0 -1
- package/dist/planner-ddl-builders-BQ_1YXut.d.mts.map +0 -1
- package/dist/planner-ddl-builders-GTcVPpwb-ClvrXb26.mjs.map +0 -1
- package/dist/planner-produced-postgres-migration-B0pwyA94.d.mts +0 -1
- package/dist/planner-produced-postgres-migration-Xd83anY_-vp2DJ5fk.d.mts.map +0 -1
- package/dist/planner-sql-checks-Bd8nN9P8-Cd98iEee.mjs.map +0 -1
- package/dist/postgres-migration-qwigEUIO-BWxjALsx.mjs.map +0 -1
- package/dist/prisma7-binding-B-JcNfUc.mjs.map +0 -1
- package/dist/registry-ld2ZUt1j-CH85fY3r.mjs +0 -15
- package/dist/registry-ld2ZUt1j-CH85fY3r.mjs.map +0 -1
- package/dist/types-CS-qi6YZ.d.mts +0 -2
|
@@ -1,9 +1,36 @@
|
|
|
1
1
|
import { s as postgresError } from "./errors-DYyzTYzE-39CV_aMo.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { numeralText } from "@prisma/orm-family-sql/relational-core/ast";
|
|
3
3
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
4
|
-
import {
|
|
4
|
+
import { SAFE_INTEGER_BIGINT_RANGE, decodeJsonIntegerText, decodeJsonMatching } from "@prisma/orm-framework/components/codec";
|
|
5
|
+
import { withoutTrailing } from "@prisma/orm-framework/utils/text";
|
|
5
6
|
import { type } from "arktype";
|
|
6
|
-
//#region ../../../3-targets/3-targets/postgres/dist/
|
|
7
|
+
//#region ../../../3-targets/3-targets/postgres/dist/codec-helpers-D83-1eDB.mjs
|
|
8
|
+
/**
|
|
9
|
+
* Whether text fits `length` characters, counted as PostgreSQL counts them: code points. A `character` value is padded with spaces, and spaces past its length are dropped, so they do not count.
|
|
10
|
+
*/
|
|
11
|
+
function fitsCharacterLength(text, length, blankPadded) {
|
|
12
|
+
const significant = blankPadded ? withoutTrailing(text, " ") : text;
|
|
13
|
+
return significant.length <= length || [...significant].length <= length;
|
|
14
|
+
}
|
|
15
|
+
/** The uuid input PostgreSQL reads: 32 hex digits in either case, a hyphen allowed after any group of four but the last, and the whole optionally in braces. */
|
|
16
|
+
const UUID_INPUT = /^(?:\{[0-9a-f]{4}(?:-?[0-9a-f]{4}){7}\}|[0-9a-f]{4}(?:-?[0-9a-f]{4}){7})$/i;
|
|
17
|
+
/** A UUID as PostgreSQL writes it: lower case, hyphenated 8-4-4-4-12. */
|
|
18
|
+
const CANONICAL_UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
19
|
+
/**
|
|
20
|
+
* Text in any form PostgreSQL reads as a UUID (either case, a hyphen after any group of four digits, optionally in braces), written the way PostgreSQL writes it; `undefined` for text it does not read as one.
|
|
21
|
+
*/
|
|
22
|
+
function canonicalUuid(text) {
|
|
23
|
+
if (!UUID_INPUT.test(text)) return void 0;
|
|
24
|
+
const hex = text.replace(/[{}-]/g, "").toLowerCase();
|
|
25
|
+
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
26
|
+
}
|
|
27
|
+
/** The largest finite float4. */
|
|
28
|
+
const FLOAT4_MAX = 34028234663852886e22;
|
|
29
|
+
/** Whether float4 holds a finite number: it neither overflows to an infinity nor rounds to 0, both of which PostgreSQL refuses. */
|
|
30
|
+
function fitsFloat4(value) {
|
|
31
|
+
const single = Math.fround(value);
|
|
32
|
+
return Number.isFinite(single) && (value === 0 || single !== 0);
|
|
33
|
+
}
|
|
7
34
|
const precisionParamsSchema = type({ "precision?": "number.integer >= 0 & number.integer <= 6" });
|
|
8
35
|
function renderLength(typeName, typeParams) {
|
|
9
36
|
const length = typeParams.length;
|
|
@@ -101,22 +128,11 @@ const pgInt8Decode = (wire) => decimalIntegerDecode("pg/int8@1", wire);
|
|
|
101
128
|
*/
|
|
102
129
|
const pgUnboundedIntDecode = (wire) => decimalIntegerDecode("pg/unboundedint@1", wire);
|
|
103
130
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
131
|
+
* A SQL number literal has no form for `NaN` or the infinities; PostgreSQL reads and writes them as
|
|
132
|
+
* the text `NaN`, `Infinity`, `-Infinity`, so the float codecs carry them as that text on the wire,
|
|
133
|
+
* as `encodeJsonFloat` does in JSON.
|
|
107
134
|
*/
|
|
108
135
|
const pgFloatEncode = (value) => Number.isFinite(value) ? value : String(value);
|
|
109
|
-
const pgFloatEncodeJson = (value) => pgFloatEncode(value);
|
|
110
|
-
const pgFloatDecodeJson = (codecId, json) => {
|
|
111
|
-
if (typeof json === "number") return json;
|
|
112
|
-
if (typeof json === "string" && isNonFiniteText(json)) return Number(json);
|
|
113
|
-
throw postgresError("RUNTIME.DECODE_FAILED", `${codecId} database JSON value must be a number or the text NaN, Infinity or -Infinity`, { meta: {
|
|
114
|
-
codecId,
|
|
115
|
-
received: typeof json
|
|
116
|
-
} });
|
|
117
|
-
};
|
|
118
|
-
const MIN_SAFE_INTEGER_BIGINT = BigInt(Number.MIN_SAFE_INTEGER);
|
|
119
|
-
const MAX_SAFE_INTEGER_BIGINT = BigInt(Number.MAX_SAFE_INTEGER);
|
|
120
136
|
/**
|
|
121
137
|
* Requires an integer within ±(2^53 − 1), the range a JS `number` holds
|
|
122
138
|
* exactly. The guard throws rather than rounding: past the boundary a `number`
|
|
@@ -142,19 +158,13 @@ const pgInt8NumberEncodeJson = (value) => pgInt8NumberEncode(value);
|
|
|
142
158
|
const pgInt8NumberDecode = (wire) => {
|
|
143
159
|
if (typeof wire === "number") return pgInt8NumberGuard("RUNTIME.DECODE_FAILED", wire);
|
|
144
160
|
const value = decimalIntegerDecode("pg/int8number@1", wire);
|
|
145
|
-
if (value <
|
|
161
|
+
if (value < SAFE_INTEGER_BIGINT_RANGE.min || value > SAFE_INTEGER_BIGINT_RANGE.max) throw postgresError("RUNTIME.DECODE_FAILED", `pg/int8number@1 value must be an integer within the safe integer range, got ${value}`, { meta: {
|
|
146
162
|
codecId: "pg/int8number@1",
|
|
147
163
|
received: value.toString()
|
|
148
164
|
} });
|
|
149
165
|
return Number(value);
|
|
150
166
|
};
|
|
151
|
-
const pgInt8NumberDecodeJson = (json) =>
|
|
152
|
-
if (typeof json !== "string") throw postgresError("RUNTIME.DECODE_FAILED", "pg/int8number@1 database JSON value must be decimal text", { meta: {
|
|
153
|
-
codecId: "pg/int8number@1",
|
|
154
|
-
received: typeof json
|
|
155
|
-
} });
|
|
156
|
-
return pgInt8NumberDecode(json);
|
|
157
|
-
};
|
|
167
|
+
const pgInt8NumberDecodeJson = (json) => Number(decodeJsonIntegerText("pg/int8number@1", json, SAFE_INTEGER_BIGINT_RANGE));
|
|
158
168
|
/**
|
|
159
169
|
* Renders a decimal-text default as a `bigint` literal, for the codecs whose
|
|
160
170
|
* canonical JSON is decimal text while the application type is `bigint`
|
|
@@ -294,13 +304,7 @@ function pgIntervalCanonical(text) {
|
|
|
294
304
|
/** Renders the application value as its canonical ISO-8601 duration. */
|
|
295
305
|
const pgIntervalToIso = (value) => formatIsoDuration(value);
|
|
296
306
|
const pgIntervalEncodeJson = (value) => formatIsoDuration(value);
|
|
297
|
-
const pgIntervalDecodeJson = (json) =>
|
|
298
|
-
if (typeof json !== "string") throw postgresError("RUNTIME.DECODE_FAILED", "pg/interval@1 database JSON value must be an ISO-8601 duration string", { meta: {
|
|
299
|
-
codecId: "pg/interval@1",
|
|
300
|
-
received: typeof json
|
|
301
|
-
} });
|
|
302
|
-
return intervalFieldsOf(json);
|
|
303
|
-
};
|
|
307
|
+
const pgIntervalDecodeJson = (json) => intervalFieldsOf(decodeJsonMatching("pg/interval@1", json, ISO_DURATION, "an ISO-8601 duration"));
|
|
304
308
|
/**
|
|
305
309
|
* Reads the driver's wire value into the application value. `pg` parses an
|
|
306
310
|
* interval into a component object, which is the same three fields under other
|
|
@@ -322,10 +326,7 @@ const pgIntervalDecode = (wire) => {
|
|
|
322
326
|
};
|
|
323
327
|
const BASE64_TEXT = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
|
|
324
328
|
const pgByteaEncodeJson = (value) => Buffer.from(value).toString("base64");
|
|
325
|
-
const pgByteaDecodeJson = (
|
|
326
|
-
if (typeof value !== "string" || !BASE64_TEXT.test(value)) throw postgresError("RUNTIME.DECODE_FAILED", "pg/bytea@1 database JSON value must be a base64 string", { meta: { codecId: "pg/bytea@1" } });
|
|
327
|
-
return new Uint8Array(Buffer.from(value, "base64"));
|
|
328
|
-
};
|
|
329
|
+
const pgByteaDecodeJson = (json) => new Uint8Array(Buffer.from(decodeJsonMatching("pg/bytea@1", json, BASE64_TEXT, "a base64 string"), "base64"));
|
|
329
330
|
const BYTEA_TEXT = /^\\x(?:[0-9A-Fa-f]{2})*$/;
|
|
330
331
|
/**
|
|
331
332
|
* Scalar pg bytea values arrive as Uint8Array/Buffer; target-parsed bytea list elements arrive as PostgreSQL hex text.
|
|
@@ -343,185 +344,7 @@ const pgJsonEncode = (value) => JSON.stringify(value);
|
|
|
343
344
|
const pgJsonDecode = (wire) => typeof wire === "string" ? parseJsonWire(wire) : wire;
|
|
344
345
|
const pgJsonbEncode = (value) => JSON.stringify(value);
|
|
345
346
|
const pgJsonbDecode = (wire) => typeof wire === "string" ? parseJsonWire(wire) : wire;
|
|
346
|
-
/** A cast between two types that store the same shape: the value is already the form this type stores. */
|
|
347
|
-
const unchanged = (value) => value;
|
|
348
|
-
function wrongShape(value, expected) {
|
|
349
|
-
throw structuredError("CONTRACT.CAST_REFUSED", `Expected ${expected}, got ${JSON.stringify(value)}.`, {
|
|
350
|
-
why: "A cast reads the canonical form of the type it takes values of.",
|
|
351
|
-
fix: "Hand the cast a value in the shape its source type stores."
|
|
352
|
-
});
|
|
353
|
-
}
|
|
354
|
-
/** A whole number as the digit text `int8` and `numeric` store. */
|
|
355
|
-
const asNumeralText = (value) => typeof value === "number" ? numeralText(value) : wrongShape(value, "a number");
|
|
356
|
-
/**
|
|
357
|
-
* A number as the floating-point types store it: a JSON number, or one of the three words, which
|
|
358
|
-
* those types keep as text. A magnitude past what a double holds is refused rather than rounded to
|
|
359
|
-
* a word: the database refuses it too, and storing `Infinity` would make a written number
|
|
360
|
-
* indistinguishable from a written `Infinity`.
|
|
361
|
-
*/
|
|
362
|
-
const asFloat = (value) => {
|
|
363
|
-
if (typeof value === "number") return value;
|
|
364
|
-
if (typeof value !== "string") return wrongShape(value, "a number or numeral text");
|
|
365
|
-
if (isNonFiniteText(value)) return value;
|
|
366
|
-
const converted = Number(value);
|
|
367
|
-
if (Number.isFinite(converted)) return converted;
|
|
368
|
-
throw structuredError("CONTRACT.CAST_REFUSED", `${value} is out of range: no double holds a number that large.`, {
|
|
369
|
-
why: "The floating-point types store a double, which holds magnitudes up to about 1.8e308.",
|
|
370
|
-
fix: "Use a number a double holds, or a numeric column."
|
|
371
|
-
});
|
|
372
|
-
};
|
|
373
|
-
const pgText = dataType("pg/text", {});
|
|
374
|
-
const pgTextArray = dataType("pg/text-array", {});
|
|
375
|
-
const pgEnum = dataType("pg/enum", {});
|
|
376
|
-
const pgInt2 = dataType("pg/int2", {});
|
|
377
|
-
const pgBool = dataType("pg/bool", {});
|
|
378
|
-
const pgJson = dataType("pg/json", {});
|
|
379
|
-
const pgTsquery = dataType("pg/tsquery", {});
|
|
380
|
-
const pgInt4 = dataType("pg/int4", { casts: { [pgInt2.id]: unchanged } });
|
|
381
|
-
const pgInt8 = dataType("pg/int8", { casts: {
|
|
382
|
-
[pgInt2.id]: asNumeralText,
|
|
383
|
-
[pgInt4.id]: asNumeralText
|
|
384
|
-
} });
|
|
385
|
-
const pgNumeric = dataType("pg/numeric", { casts: {
|
|
386
|
-
[pgInt2.id]: asNumeralText,
|
|
387
|
-
[pgInt4.id]: asNumeralText,
|
|
388
|
-
[pgInt8.id]: unchanged
|
|
389
|
-
} });
|
|
390
|
-
/** `float4` stores a single-precision float, so a magnitude past about 3.4e38 does not fit. */
|
|
391
|
-
const asFloat4 = (value) => {
|
|
392
|
-
const converted = asFloat(value);
|
|
393
|
-
if (typeof converted !== "number" || Number.isFinite(Math.fround(converted))) return converted;
|
|
394
|
-
throw structuredError("CONTRACT.CAST_REFUSED", `${converted} is out of range: no float4 holds a number that large.`, {
|
|
395
|
-
why: "float4 stores a single-precision float, which holds magnitudes up to about 3.4e38.",
|
|
396
|
-
fix: "Use a number float4 holds, or a float8 or numeric column."
|
|
397
|
-
});
|
|
398
|
-
};
|
|
399
|
-
const floatCastsOf = (cast) => ({
|
|
400
|
-
[pgInt2.id]: cast,
|
|
401
|
-
[pgInt4.id]: cast,
|
|
402
|
-
[pgInt8.id]: cast,
|
|
403
|
-
[pgNumeric.id]: cast
|
|
404
|
-
});
|
|
405
|
-
const pgFloat4 = dataType("pg/float4", { casts: floatCastsOf(asFloat4) });
|
|
406
|
-
const pgFloat8 = dataType("pg/float8", { casts: floatCastsOf(asFloat) });
|
|
407
|
-
const pgJsonb = dataType("pg/jsonb", { casts: { [pgJson.id]: unchanged } });
|
|
408
|
-
const fromText = { [pgText.id]: unchanged };
|
|
409
|
-
const pgChar = dataType("pg/char", { casts: fromText });
|
|
410
|
-
const pgVarchar = dataType("pg/varchar", { casts: fromText });
|
|
411
|
-
const pgUuid = dataType("pg/uuid", { casts: fromText });
|
|
412
|
-
const pgInet = dataType("pg/inet", { casts: fromText });
|
|
413
|
-
const pgBit = dataType("pg/bit", { casts: fromText });
|
|
414
|
-
const pgVarbit = dataType("pg/varbit", { casts: fromText });
|
|
415
|
-
const pgBytea = dataType("pg/bytea", { casts: fromText });
|
|
416
|
-
const POSTGRES_YEAR = /^(\d{4,6})(-.*?)( BC)?$/;
|
|
417
|
-
/**
|
|
418
|
-
* Text PostgreSQL prints, in ISO 8601. A year with a ` BC` suffix becomes the ISO year, one higher
|
|
419
|
-
* than its negative, so 1 BC is 0000 and 44 BC is -000043. A year of five or six digits becomes a
|
|
420
|
-
* signed six-digit year. 0 BC does not exist, so it stays as written and the reader refuses it.
|
|
421
|
-
*/
|
|
422
|
-
function isoFromPostgresText(text) {
|
|
423
|
-
const match = POSTGRES_YEAR.exec(text);
|
|
424
|
-
if (match === null) return text;
|
|
425
|
-
const [, digits = "", rest = "", bc] = match;
|
|
426
|
-
const year = Number(digits);
|
|
427
|
-
if (bc !== void 0) {
|
|
428
|
-
if (year === 0) return text;
|
|
429
|
-
const astronomical = 1 - year;
|
|
430
|
-
return astronomical === 0 ? `0000${rest}` : `-${String(-astronomical).padStart(6, "0")}${rest}`;
|
|
431
|
-
}
|
|
432
|
-
return digits.length > 4 ? `+${String(year).padStart(6, "0")}${rest}` : text;
|
|
433
|
-
}
|
|
434
|
-
const INFINITIES = /* @__PURE__ */ new Set(["infinity", "-infinity"]);
|
|
435
|
-
/**
|
|
436
|
-
* The canonical form of a date or time type (ADR 254), from ISO 8601 or the text PostgreSQL prints.
|
|
437
|
-
* `infinity` and `-infinity` are values of the types that hold them.
|
|
438
|
-
*/
|
|
439
|
-
function postgresDateTime(options, holdsInfinity) {
|
|
440
|
-
return (text) => holdsInfinity && INFINITIES.has(text) ? text : canonicalDateTime(isoFromPostgresText(text), options, text);
|
|
441
|
-
}
|
|
442
|
-
/**
|
|
443
|
-
* Each range is what PostgreSQL and every codec of the type hold: PostgreSQL starts at 4714-11-24
|
|
444
|
-
* BC, and the `Temporal` and `Date` codecs end at +275760-09-13.
|
|
445
|
-
*/
|
|
446
|
-
const pgDateCanonical = postgresDateTime({
|
|
447
|
-
shape: "date",
|
|
448
|
-
dataTypeId: "pg/date",
|
|
449
|
-
range: {
|
|
450
|
-
earliest: "-004713-11-24",
|
|
451
|
-
latest: "+275760-09-13"
|
|
452
|
-
}
|
|
453
|
-
}, true);
|
|
454
|
-
const pgTimeCanonical = postgresDateTime({
|
|
455
|
-
shape: "time",
|
|
456
|
-
dataTypeId: "pg/time"
|
|
457
|
-
}, false);
|
|
458
|
-
const pgTimetzCanonical = postgresDateTime({
|
|
459
|
-
shape: "timeWithOffset",
|
|
460
|
-
dataTypeId: "pg/timetz",
|
|
461
|
-
maxOffsetHours: 15
|
|
462
|
-
}, false);
|
|
463
|
-
const pgTimestampCanonical = postgresDateTime({
|
|
464
|
-
shape: "dateTime",
|
|
465
|
-
dataTypeId: "pg/timestamp",
|
|
466
|
-
range: {
|
|
467
|
-
earliest: "-004713-11-24T00:00:00",
|
|
468
|
-
latest: "+275760-09-13T23:59:59.999999"
|
|
469
|
-
}
|
|
470
|
-
}, true);
|
|
471
|
-
const pgTimestamptzCanonical = postgresDateTime({
|
|
472
|
-
shape: "instant",
|
|
473
|
-
dataTypeId: "pg/timestamptz",
|
|
474
|
-
range: {
|
|
475
|
-
earliest: "-004713-11-24T00:00:00Z",
|
|
476
|
-
latest: "+275760-09-13T00:00:00Z"
|
|
477
|
-
}
|
|
478
|
-
}, true);
|
|
479
|
-
/** The canonical-form function of a type whose values are written as text. */
|
|
480
|
-
const canonicalFromText = (canonical) => (value) => typeof value === "string" ? canonical(value) : wrongShape(value, "text");
|
|
481
|
-
/** A date or time type: its canonical form, and a cast from text that gives it. */
|
|
482
|
-
function dateTimeType(id, canonical) {
|
|
483
|
-
const toCanonicalForm = canonicalFromText(canonical);
|
|
484
|
-
return dataType(id, {
|
|
485
|
-
toCanonicalForm,
|
|
486
|
-
casts: { [pgText.id]: toCanonicalForm }
|
|
487
|
-
});
|
|
488
|
-
}
|
|
489
|
-
const pgTimetz = dateTimeType("pg/timetz", pgTimetzCanonical);
|
|
490
|
-
const pgInterval = dateTimeType("pg/interval", pgIntervalCanonical);
|
|
491
|
-
const pgDate = dateTimeType("pg/date", pgDateCanonical);
|
|
492
|
-
const pgTime = dateTimeType("pg/time", pgTimeCanonical);
|
|
493
|
-
const pgTimestamp = dateTimeType("pg/timestamp", pgTimestampCanonical);
|
|
494
|
-
const pgTimestamptz = dateTimeType("pg/timestamptz", pgTimestamptzCanonical);
|
|
495
|
-
/** Every data type this target registers. */
|
|
496
|
-
const postgresDataTypes = [
|
|
497
|
-
pgText,
|
|
498
|
-
pgTextArray,
|
|
499
|
-
pgEnum,
|
|
500
|
-
pgInt2,
|
|
501
|
-
pgBool,
|
|
502
|
-
pgJson,
|
|
503
|
-
pgTsquery,
|
|
504
|
-
pgInt4,
|
|
505
|
-
pgInt8,
|
|
506
|
-
pgNumeric,
|
|
507
|
-
pgFloat4,
|
|
508
|
-
pgFloat8,
|
|
509
|
-
pgJsonb,
|
|
510
|
-
pgChar,
|
|
511
|
-
pgVarchar,
|
|
512
|
-
pgUuid,
|
|
513
|
-
pgInet,
|
|
514
|
-
pgBit,
|
|
515
|
-
pgVarbit,
|
|
516
|
-
pgTimetz,
|
|
517
|
-
pgInterval,
|
|
518
|
-
pgBytea,
|
|
519
|
-
pgDate,
|
|
520
|
-
pgTime,
|
|
521
|
-
pgTimestamp,
|
|
522
|
-
pgTimestamptz
|
|
523
|
-
];
|
|
524
347
|
//#endregion
|
|
525
|
-
export {
|
|
348
|
+
export { pgUnboundedIntDecode as A, pgIntervalToIso as C, pgJsonbEncode as D, pgJsonbDecode as E, renderLength as M, renderPrecision as N, pgNumericDecode as O, pgIntervalEncodeJson as S, pgJsonEncode as T, pgInt8NumberEncode as _, decimalTextNumberLiteral as a, pgIntervalDecode as b, pgBigintEncode as c, pgByteaDecodeWire as d, pgByteaEncodeJson as f, pgInt8NumberDecodeJson as g, pgInt8NumberDecode as h, decimalTextBigintLiteral as i, precisionParamsSchema as j, pgNumericRenderOutputType as k, pgBigintEncodeJson as l, pgInt8Decode as m, FLOAT4_MAX as n, fitsCharacterLength as o, pgFloatEncode as p, canonicalUuid as r, fitsFloat4 as s, CANONICAL_UUID as t, pgByteaDecodeJson as u, pgInt8NumberEncodeJson as v, pgJsonDecode as w, pgIntervalDecodeJson as x, pgIntervalCanonical as y };
|
|
526
349
|
|
|
527
|
-
//# sourceMappingURL=
|
|
350
|
+
//# sourceMappingURL=codec-helpers-D83-1eDB-nqAEMr7N.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-helpers-D83-1eDB-nqAEMr7N.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/codec-helpers-D83-1eDB.mjs"],"sourcesContent":["import { s as postgresError } from \"./errors-DYyzTYzE.mjs\";\nimport { numeralText } from \"@internal/sql-relational-core/ast\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { SAFE_INTEGER_BIGINT_RANGE, decodeJsonIntegerText, decodeJsonMatching } from \"@internal/framework-components/codec\";\nimport { withoutTrailing } from \"@internal/utils/text\";\nimport { type } from \"arktype\";\n//#region src/core/codec-helpers.ts\n/**\n* Whether text fits `length` characters, counted as PostgreSQL counts them: code points. A `character` value is padded with spaces, and spaces past its length are dropped, so they do not count.\n*/\nfunction fitsCharacterLength(text, length, blankPadded) {\n\tconst significant = blankPadded ? withoutTrailing(text, \" \") : text;\n\treturn significant.length <= length || [...significant].length <= length;\n}\n/** The uuid input PostgreSQL reads: 32 hex digits in either case, a hyphen allowed after any group of four but the last, and the whole optionally in braces. */\nconst UUID_INPUT = /^(?:\\{[0-9a-f]{4}(?:-?[0-9a-f]{4}){7}\\}|[0-9a-f]{4}(?:-?[0-9a-f]{4}){7})$/i;\n/** A UUID as PostgreSQL writes it: lower case, hyphenated 8-4-4-4-12. */\nconst CANONICAL_UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;\n/**\n* Text in any form PostgreSQL reads as a UUID (either case, a hyphen after any group of four digits, optionally in braces), written the way PostgreSQL writes it; `undefined` for text it does not read as one.\n*/\nfunction canonicalUuid(text) {\n\tif (!UUID_INPUT.test(text)) return void 0;\n\tconst hex = text.replace(/[{}-]/g, \"\").toLowerCase();\n\treturn `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;\n}\n/** The largest finite float4. */\nconst FLOAT4_MAX = 34028234663852886e22;\n/** Whether float4 holds a finite number: it neither overflows to an infinity nor rounds to 0, both of which PostgreSQL refuses. */\nfunction fitsFloat4(value) {\n\tconst single = Math.fround(value);\n\treturn Number.isFinite(single) && (value === 0 || single !== 0);\n}\nconst precisionParamsSchema = type({ \"precision?\": \"number.integer >= 0 & number.integer <= 6\" });\nfunction renderLength(typeName, typeParams) {\n\tconst length = typeParams.length;\n\tif (length === void 0) return;\n\tif (typeof length !== \"number\" || !Number.isFinite(length) || !Number.isInteger(length)) throw postgresError(\"RUNTIME.TYPE_PARAMS_INVALID\", `renderOutputType: expected integer \"length\" in typeParams for ${typeName}, got ${String(length)}`, { meta: {\n\t\tnativeType: typeName,\n\t\tparam: \"length\",\n\t\treceived: String(length)\n\t} });\n\treturn `${typeName}<${length}>`;\n}\nfunction renderPrecision(typeName, typeParams) {\n\tconst precision = typeParams.precision;\n\tif (precision === void 0) return typeName;\n\tif (typeof precision !== \"number\" || !Number.isFinite(precision) || !Number.isInteger(precision)) throw postgresError(\"RUNTIME.TYPE_PARAMS_INVALID\", `renderOutputType: expected integer \"precision\" in typeParams for ${typeName}, got ${String(precision)}`, { meta: {\n\t\tnativeType: typeName,\n\t\tparam: \"precision\",\n\t\treceived: String(precision)\n\t} });\n\treturn `${typeName}<${precision}>`;\n}\n/**\n* A `numeric` value as its canonical decimal text. A number is written out without an exponent,\n* because `numeric` text has no exponent syntax and `encodeJson` refuses one.\n*/\nconst pgNumericDecode = (wire) => {\n\tif (typeof wire === \"number\") return numeralText(wire);\n\treturn wire;\n};\nconst DECIMAL_INTEGER = /^-?\\d+$/;\n/**\n* Requires an application value to be of the JS type the codec reads.\n*\n* A range check reads a value of the wrong type as a value out of range, and\n* reports a number plainly inside the range as outside it — so the type is\n* established first and answered for on its own terms, naming what a caller\n* has to change.\n*/\nconst requireJsType = (codecId, expected, value) => {\n\tif (typeof value === expected) return;\n\tthrow postgresError(\"RUNTIME.ENCODE_FAILED\", `${codecId} value must be a ${expected}, got ${typeof value} ${String(value)}`, { meta: {\n\t\tcodecId,\n\t\treceived: typeof value\n\t} });\n};\n/** Writes a `bigint` application value as the decimal text the wire form of the exact integer codecs carries. */\nconst pgBigintEncode = (codecId, value) => {\n\trequireJsType(codecId, \"bigint\", value);\n\treturn value.toString();\n};\n/**\n* Writes an application value as the decimal text these codecs carry as their\n* canonical JSON.\n*\n* A schema-written literal default (`BigInt @default(0)`) arrives here as a\n* `number`, since a number literal is the only integer a schema language\n* writes, and one that is a safe integer names its value exactly. Past that\n* range the literal was rounded before any of this ran, so the value written is\n* not the value meant — which this refuses rather than minting an exact-looking\n* total from it. A non-integral number is refused on the same terms.\n*/\nconst pgBigintEncodeJson = (codecId, value) => {\n\tif (typeof value !== \"number\") return pgBigintEncode(codecId, value);\n\tif (!Number.isSafeInteger(value)) throw postgresError(\"RUNTIME.ENCODE_FAILED\", `${codecId} number literal must be an integer within the safe integer range, got ${String(value)}`, { meta: {\n\t\tcodecId,\n\t\treceived: String(value)\n\t} });\n\treturn BigInt(value).toString();\n};\n/**\n* Reads a wire or JSON value as a `bigint`, rejecting anything `BigInt()` would\n* misread. A number-typed wire value must also be a safe integer: past\n* ±(2^53 − 1) the driver's `number` has already rounded, so stringifying it\n* would mint a spuriously-exact `bigint` that need not equal the stored value.\n*/\nconst decimalIntegerDecode = (codecId, wire) => {\n\tif (typeof wire === \"bigint\") return wire;\n\tconst text = String(wire);\n\tif (!DECIMAL_INTEGER.test(text)) throw postgresError(\"RUNTIME.DECODE_FAILED\", `${codecId} value must be a decimal integer`, { meta: {\n\t\tcodecId,\n\t\treceived: text\n\t} });\n\tif (typeof wire === \"number\" && !Number.isSafeInteger(wire)) throw postgresError(\"RUNTIME.DECODE_FAILED\", `${codecId} wire number must be an integer within the safe integer range, got ${text}`, { meta: {\n\t\tcodecId,\n\t\treceived: text\n\t} });\n\treturn BigInt(text);\n};\n/** Reads an `int8` wire or JSON value as a `bigint`, rejecting anything `BigInt()` would misread. */\nconst pgInt8Decode = (wire) => decimalIntegerDecode(\"pg/int8@1\", wire);\n/**\n* Reads an unconstrained-`numeric` wire or JSON value as a `bigint`, rejecting\n* non-integral values — including `NaN` and the infinities, which are `numeric`\n* values but not integers.\n*/\nconst pgUnboundedIntDecode = (wire) => decimalIntegerDecode(\"pg/unboundedint@1\", wire);\n/**\n* A SQL number literal has no form for `NaN` or the infinities; PostgreSQL reads and writes them as\n* the text `NaN`, `Infinity`, `-Infinity`, so the float codecs carry them as that text on the wire,\n* as `encodeJsonFloat` does in JSON.\n*/\nconst pgFloatEncode = (value) => Number.isFinite(value) ? value : String(value);\n/**\n* Requires an integer within ±(2^53 − 1), the range a JS `number` holds\n* exactly. The guard throws rather than rounding: past the boundary a `number`\n* silently loses digits, which is the failure mode this codec exists to refuse.\n*/\nconst pgInt8NumberGuard = (code, value) => {\n\tif (!Number.isSafeInteger(value)) throw postgresError(code, `pg/int8number@1 value must be an integer within the safe integer range, got ${String(value)}`, { meta: {\n\t\tcodecId: \"pg/int8number@1\",\n\t\treceived: String(value)\n\t} });\n\treturn value;\n};\nconst pgInt8NumberEncode = (value) => {\n\trequireJsType(\"pg/int8number@1\", \"number\", value);\n\treturn String(pgInt8NumberGuard(\"RUNTIME.ENCODE_FAILED\", value));\n};\nconst pgInt8NumberEncodeJson = (value) => pgInt8NumberEncode(value);\n/**\n* Reads an `int8` wire value as a `number`, throwing outside ±(2^53 − 1) and on\n* non-integral input. Decimal text goes through `BigInt` before the range check\n* so an out-of-range value is compared exactly rather than after rounding.\n*/\nconst pgInt8NumberDecode = (wire) => {\n\tif (typeof wire === \"number\") return pgInt8NumberGuard(\"RUNTIME.DECODE_FAILED\", wire);\n\tconst value = decimalIntegerDecode(\"pg/int8number@1\", wire);\n\tif (value < SAFE_INTEGER_BIGINT_RANGE.min || value > SAFE_INTEGER_BIGINT_RANGE.max) throw postgresError(\"RUNTIME.DECODE_FAILED\", `pg/int8number@1 value must be an integer within the safe integer range, got ${value}`, { meta: {\n\t\tcodecId: \"pg/int8number@1\",\n\t\treceived: value.toString()\n\t} });\n\treturn Number(value);\n};\nconst pgInt8NumberDecodeJson = (json) => Number(decodeJsonIntegerText(\"pg/int8number@1\", json, SAFE_INTEGER_BIGINT_RANGE));\n/**\n* Renders a decimal-text default as a `bigint` literal, for the codecs whose\n* canonical JSON is decimal text while the application type is `bigint`\n* (`pg/int8@1`, `pg/unboundedint@1`) — a plain string literal would not\n* typecheck against the emitted column type.\n*/\nconst decimalTextBigintLiteral = (value) => typeof value === \"string\" && DECIMAL_INTEGER.test(value) ? `${value}n` : void 0;\n/** Renders the decimal text of `pg/int8number@1`, whose application type is `number`, as a number literal. */\nconst decimalTextNumberLiteral = (value) => typeof value === \"string\" && DECIMAL_INTEGER.test(value) ? value : void 0;\nconst pgNumericRenderOutputType = (typeParams) => {\n\tconst precision = typeParams.precision;\n\tif (precision === void 0) return void 0;\n\tif (typeof precision !== \"number\" || !Number.isFinite(precision) || !Number.isInteger(precision)) throw postgresError(\"RUNTIME.TYPE_PARAMS_INVALID\", `renderOutputType: expected integer \"precision\" in typeParams for Numeric, got ${String(precision)}`, { meta: {\n\t\tnativeType: \"Numeric\",\n\t\tparam: \"precision\",\n\t\treceived: String(precision)\n\t} });\n\tconst scale = typeParams.scale;\n\tif (scale === void 0) return `Numeric<${precision}>`;\n\tif (typeof scale !== \"number\" || !Number.isFinite(scale) || !Number.isInteger(scale)) throw postgresError(\"RUNTIME.TYPE_PARAMS_INVALID\", `renderOutputType: expected integer \"scale\" in typeParams for Numeric, got ${String(scale)}`, { meta: {\n\t\tnativeType: \"Numeric\",\n\t\tparam: \"scale\",\n\t\treceived: String(scale)\n\t} });\n\treturn `Numeric<${precision}, ${scale}>`;\n};\nconst ISO_DURATION = /^P(?!$)(-?\\d+Y)?(-?\\d+M)?(-?\\d+D)?(?:T(?!$)(-?\\d+H)?(-?\\d+M)?(-?\\d+(?:\\.\\d+)?S)?)?$/;\nconst MICROS_PER_SECOND = 1000000n;\n/**\n* Converts a fractional-seconds digit string to microseconds, rounding rather\n* than truncating past the sixth digit.\n*\n* PostgreSQL rounds: `INTERVAL '1.1234567 seconds'` is `1.123457`, and\n* `'1.9999999 seconds'` carries into `2`. Truncating here made the parsed value\n* disagree with the database for any input past microsecond resolution.\n*\n* Ties round toward positive infinity, matching `Math.round` on the sibling path\n* that reads the driver's component object — so the two agree. PostgreSQL's own\n* tie behaviour is unobservable, because it parses the literal into a double\n* first and an exact half never survives that.\n*/\nconst microsFromFraction = (fraction, negative) => {\n\tif (fraction === \"\") return 0n;\n\tconst kept = BigInt(fraction.slice(0, 6).padEnd(6, \"0\"));\n\tconst rest = fraction.slice(6).replace(/0+$/, \"\");\n\tif (rest === \"\") return kept;\n\tconst half = rest[0] === \"5\" && rest.length === 1;\n\treturn rest > \"5\" || half && !negative ? kept + 1n : kept;\n};\nconst intervalFieldsOf = (text) => {\n\tconst match = ISO_DURATION.exec(text);\n\tif (match === null) throw postgresError(\"RUNTIME.DECODE_FAILED\", `pg/interval@1 value must be an ISO-8601 duration, got ${text}`, { meta: {\n\t\tcodecId: \"pg/interval@1\",\n\t\treceived: text\n\t} });\n\tconst [, years, months, days, hours, minutes, seconds] = match;\n\tconst wholeNumber = (part) => part === void 0 ? 0 : Number(part.slice(0, -1));\n\tconst secondsLiteral = seconds === void 0 ? \"0\" : seconds.slice(0, -1);\n\tconst negative = secondsLiteral.startsWith(\"-\");\n\tconst [whole = \"0\", fraction = \"\"] = secondsLiteral.replace(\"-\", \"\").split(\".\");\n\tconst magnitude = BigInt(whole) * MICROS_PER_SECOND + microsFromFraction(fraction, negative);\n\treturn {\n\t\tmonths: wholeNumber(years) * 12 + wholeNumber(months),\n\t\tdays: wholeNumber(days),\n\t\tmicros: BigInt(wholeNumber(hours)) * 3600n * MICROS_PER_SECOND + BigInt(wholeNumber(minutes)) * 60n * MICROS_PER_SECOND + (negative ? -magnitude : magnitude)\n\t};\n};\nconst secondsText = (micros) => {\n\tconst sign = micros < 0n ? \"-\" : \"\";\n\tconst magnitude = micros < 0n ? -micros : micros;\n\tconst whole = magnitude / MICROS_PER_SECOND % 60n;\n\tconst fraction = magnitude % MICROS_PER_SECOND;\n\treturn `${sign}${whole}${fraction === 0n ? \"\" : `.${fraction.toString().padStart(6, \"0\").replace(/0+$/, \"\")}`}`;\n};\n/**\n* Renders {@link PgInterval} the way PostgreSQL spells an interval under\n* `IntervalStyle = 'iso_8601'`: zero components omitted, `T` present only when a\n* time component is, each component carrying its own sign, and an all-zero\n* interval written `PT0S`.\n*/\nconst formatIsoDuration = ({ months, days, micros }) => {\n\tconst years = Math.trunc(months / 12);\n\tconst restMonths = months % 12;\n\tconst sign = micros < 0n ? \"-\" : \"\";\n\tconst magnitude = micros < 0n ? -micros : micros;\n\tconst hours = magnitude / (3600n * MICROS_PER_SECOND);\n\tconst minutes = magnitude / (60n * MICROS_PER_SECOND) % 60n;\n\tconst hasSeconds = magnitude % (60n * MICROS_PER_SECOND) !== 0n;\n\tconst parts = [\n\t\tyears === 0 ? \"\" : `${years}Y`,\n\t\trestMonths === 0 ? \"\" : `${restMonths}M`,\n\t\tdays === 0 ? \"\" : `${days}D`\n\t];\n\tconst time = [\n\t\thours === 0n ? \"\" : `${sign}${hours}H`,\n\t\tminutes === 0n ? \"\" : `${sign}${minutes}M`,\n\t\thasSeconds ? `${secondsText(micros)}S` : \"\"\n\t].join(\"\");\n\tconst rendered = `P${parts.join(\"\")}${time === \"\" ? \"\" : `T${time}`}`;\n\treturn rendered === \"P\" ? \"PT0S\" : rendered;\n};\n/**\n* An interval as PostgreSQL prints it under `IntervalStyle = 'postgres'`: `1 year 2 mons 3 days\n* 04:05:06.5`, `-1 years -2 mons +3 days -04:00:00`, `00:00:00`.\n*/\nconst POSTGRES_INTERVAL = /^(?:([+-]?\\d+) years? ?)?(?:([+-]?\\d+) mons? ?)?(?:([+-]?\\d+) days? ?)?(?:([+-])?(\\d+):(\\d{2}):(\\d{2})(?:\\.(\\d+))?)?$/;\nfunction postgresIntervalFields(text) {\n\tconst match = POSTGRES_INTERVAL.exec(text);\n\tif (match === null || text === \"\" || text.endsWith(\" \")) return void 0;\n\tconst [, years = \"0\", months = \"0\", days = \"0\", sign, hours = \"0\", minutes = \"0\", seconds = \"0\"] = match;\n\tconst fraction = match[8] ?? \"\";\n\tconst magnitude = (BigInt(hours) * 3600n + BigInt(minutes) * 60n + BigInt(seconds)) * MICROS_PER_SECOND + BigInt(fraction.padEnd(6, \"0\") || \"0\");\n\treturn {\n\t\tmonths: Number(years) * 12 + Number(months),\n\t\tdays: Number(days),\n\t\tmicros: sign === \"-\" ? -magnitude : magnitude\n\t};\n}\nfunction intervalRefused(message) {\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", message, {\n\t\twhy: \"pg/interval stores one canonical form for each interval (ADR 254), and reads ISO 8601 durations and the text PostgreSQL prints.\",\n\t\tfix: \"Write an ISO 8601 duration, as the message shows.\"\n\t});\n}\n/**\n* The canonical form of `pg/interval` (ADR 254), from an ISO 8601 duration or the text PostgreSQL\n* prints under `IntervalStyle = 'postgres'`.\n*/\nfunction pgIntervalCanonical(text) {\n\tconst fractionDigits = /\\.(\\d+)/.exec(text)?.[1]?.length ?? 0;\n\tif (fractionDigits > 6) intervalRefused(`\"${text}\" has ${fractionDigits} digits after the decimal point, but pg/interval holds microseconds, so at most 6. Round it, as in \"PT1.123456S\".`);\n\tif (ISO_DURATION.test(text)) return formatIsoDuration(intervalFieldsOf(text));\n\tconst fields = postgresIntervalFields(text);\n\tif (fields === void 0) intervalRefused(`pg/interval cannot read \"${text}\". Write an ISO 8601 duration, as in \"P1Y2M3DT4H5M6S\".`);\n\treturn formatIsoDuration(fields);\n}\n/** Renders the application value as its canonical ISO-8601 duration. */\nconst pgIntervalToIso = (value) => formatIsoDuration(value);\nconst pgIntervalEncodeJson = (value) => formatIsoDuration(value);\nconst pgIntervalDecodeJson = (json) => intervalFieldsOf(decodeJsonMatching(\"pg/interval@1\", json, ISO_DURATION, \"an ISO-8601 duration\"));\n/**\n* Reads the driver's wire value into the application value. `pg` parses an\n* interval into a component object, which is the same three fields under other\n* names; a text wire value is an ISO-8601 duration, because that is what the\n* codec writes.\n*/\nconst pgIntervalDecode = (wire) => {\n\tif (typeof wire === \"string\") return intervalFieldsOf(wire);\n\tconst part = (name) => {\n\t\tconst raw = wire[name];\n\t\treturn typeof raw === \"number\" ? raw : 0;\n\t};\n\tconst seconds = part(\"seconds\") + part(\"milliseconds\") / 1e3;\n\treturn {\n\t\tmonths: part(\"years\") * 12 + part(\"months\"),\n\t\tdays: part(\"days\"),\n\t\tmicros: BigInt(part(\"hours\")) * 3600n * MICROS_PER_SECOND + BigInt(part(\"minutes\")) * 60n * MICROS_PER_SECOND + BigInt(Math.round(seconds * 1e6))\n\t};\n};\nconst BASE64_TEXT = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;\nconst pgByteaEncodeJson = (value) => Buffer.from(value).toString(\"base64\");\nconst pgByteaDecodeJson = (json) => new Uint8Array(Buffer.from(decodeJsonMatching(\"pg/bytea@1\", json, BASE64_TEXT, \"a base64 string\"), \"base64\"));\nconst BYTEA_TEXT = /^\\\\x(?:[0-9A-Fa-f]{2})*$/;\n/**\n* Scalar pg bytea values arrive as Uint8Array/Buffer; target-parsed bytea list elements arrive as PostgreSQL hex text.\n*/\nconst pgByteaDecodeWire = (wire) => {\n\tif (wire instanceof Uint8Array) return wire.constructor === Uint8Array ? wire : new Uint8Array(wire.buffer, wire.byteOffset, wire.byteLength);\n\tif (!BYTEA_TEXT.test(wire)) throw postgresError(\"RUNTIME.DECODE_FAILED\", \"pg/bytea@1 wire value must be a bytea hex string or Uint8Array\", { meta: {\n\t\tcodecId: \"pg/bytea@1\",\n\t\treceived: wire\n\t} });\n\treturn new Uint8Array(Buffer.from(wire.slice(2), \"hex\"));\n};\nconst parseJsonWire = JSON.parse;\nconst pgJsonEncode = (value) => JSON.stringify(value);\nconst pgJsonDecode = (wire) => typeof wire === \"string\" ? parseJsonWire(wire) : wire;\nconst pgJsonbEncode = (value) => JSON.stringify(value);\nconst pgJsonbDecode = (wire) => typeof wire === \"string\" ? parseJsonWire(wire) : wire;\n//#endregion\nexport { pgUnboundedIntDecode as A, pgIntervalToIso as C, pgJsonbEncode as D, pgJsonbDecode as E, renderLength as M, renderPrecision as N, pgNumericDecode as O, pgIntervalEncodeJson as S, pgJsonEncode as T, pgInt8NumberEncode as _, decimalTextNumberLiteral as a, pgIntervalDecode as b, pgBigintEncode as c, pgByteaDecodeWire as d, pgByteaEncodeJson as f, pgInt8NumberDecodeJson as g, pgInt8NumberDecode as h, decimalTextBigintLiteral as i, precisionParamsSchema as j, pgNumericRenderOutputType as k, pgBigintEncodeJson as l, pgInt8Decode as m, FLOAT4_MAX as n, fitsCharacterLength as o, pgFloatEncode as p, canonicalUuid as r, fitsFloat4 as s, CANONICAL_UUID as t, pgByteaDecodeJson as u, pgInt8NumberEncodeJson as v, pgJsonDecode as w, pgIntervalDecodeJson as x, pgIntervalCanonical as y };\n\n//# sourceMappingURL=codec-helpers-D83-1eDB.mjs.map"],"mappings":";;;;;;;;;;AAUA,SAAS,oBAAoB,MAAM,QAAQ,aAAa;CACvD,MAAM,cAAc,cAAc,gBAAgB,MAAM,GAAG,IAAI;CAC/D,OAAO,YAAY,UAAU,UAAU,CAAC,GAAG,WAAW,CAAC,CAAC,UAAU;AACnE;;AAEA,MAAM,aAAa;;AAEnB,MAAM,iBAAiB;;;;AAIvB,SAAS,cAAc,MAAM;CAC5B,IAAI,CAAC,WAAW,KAAK,IAAI,GAAG,OAAO,KAAK;CACxC,MAAM,MAAM,KAAK,QAAQ,UAAU,EAAE,CAAC,CAAC,YAAY;CACnD,OAAO,GAAG,IAAI,MAAM,GAAG,CAAC,EAAE,GAAG,IAAI,MAAM,GAAG,EAAE,EAAE,GAAG,IAAI,MAAM,IAAI,EAAE,EAAE,GAAG,IAAI,MAAM,IAAI,EAAE,EAAE,GAAG,IAAI,MAAM,EAAE;AACxG;;AAEA,MAAM,aAAa;;AAEnB,SAAS,WAAW,OAAO;CAC1B,MAAM,SAAS,KAAK,OAAO,KAAK;CAChC,OAAO,OAAO,SAAS,MAAM,MAAM,UAAU,KAAK,WAAW;AAC9D;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AO;EACN,QAAQ,KAAK,OAAO,IAAI,KAAK,KAAK,QAAQ;EAC1C,MAAM,KAAK,MAAM;EACjB,QAAQ,OAAO,KAAK,OAAO,CAAC,IAAI,QAAQ,oBAAoB,OAAO,KAAK,SAAS,CAAC,IAAI,MAAM,oBAAoB,OAAO,KAAK,MAAM,UAAU,GAAG,CAAC;CACjJ;AACD;AACA,MAAM,cAAc;AACpB,MAAM,qBAAqB,UAAU,OAAO,KAAK,KAAK,CAAC,CAAC,SAAS,QAAQ;AACzE,MAAM,qBAAqB,SAAS,IAAI,WAAW,OAAO,KAAK,mBAAmB,cAAc,MAAM,aAAa,iBAAiB,GAAG,QAAQ,CAAC;AAChJ,MAAM,aAAa;;;;AAInB,MAAM,qBAAqB,SAAS;CACnC,IAAI,gBAAgB,YAAY,OAAO,KAAK,gBAAgB,aAAa,OAAO,IAAI,WAAW,KAAK,QAAQ,KAAK,YAAY,KAAK,UAAU;CAC5I,IAAI,CAAC,WAAW,KAAK,IAAI,GAAG,MAAM,cAAc,yBAAyB,kEAAkE,EAAE,MAAM;EAClJ,SAAS;EACT,UAAU;CACX,EAAE,CAAC;CACH,OAAO,IAAI,WAAW,OAAO,KAAK,KAAK,MAAM,CAAC,GAAG,KAAK,CAAC;AACxD;AACA,MAAM,gBAAgB,KAAK;AAC3B,MAAM,gBAAgB,UAAU,KAAK,UAAU,KAAK;AACpD,MAAM,gBAAgB,SAAS,OAAO,SAAS,WAAW,cAAc,IAAI,IAAI;AAChF,MAAM,iBAAiB,UAAU,KAAK,UAAU,KAAK;AACrD,MAAM,iBAAiB,SAAS,OAAO,SAAS,WAAW,cAAc,IAAI,IAAI"}
|
package/dist/{codec-type-map-Cp91lhQd-D6zQ14YE.d.mts → codec-type-map-DMKy_xZb-DymgX4w7.d.mts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as AdaptedPostgresCodecDescriptor } from "./codec-descriptor-
|
|
2
|
-
import { A as PgTimestamptzDateDescriptor, C as PgNumericDescriptor, D as PgTimestampStringDescriptor, E as PgTimeTemporalDescriptor, F as PgUnboundedIntDescriptor, I as PgUuidDescriptor, L as PgVarbitDescriptor, M as PgTimestamptzTemporalDescriptor, N as PgTimetzDescriptor, O as PgTimestampTemporalDescriptor, P as PgTsqueryDescriptor, R as PgVarcharDescriptor, S as PgJsonbDescriptor, T as PgTimeStringDescriptor, _ as PgInt8NumberDescriptor, a as PgDateStringDescriptor, b as PgIntervalDescriptor, c as PgEnumDescriptor, d as PgFloat8Descriptor, f as PgFloatDescriptor, g as PgInt8Descriptor, h as PgInt4Descriptor, i as PgCharDescriptor, j as PgTimestamptzStringDescriptor, m as PgInt2Descriptor, n as PgBoolDescriptor, o as PgDateTemporalDescriptor, p as PgInetDescriptor, r as PgByteaDescriptor, t as PgBitDescriptor, u as PgFloat4Descriptor, v as PgIntDescriptor, w as PgTextDescriptor, x as PgJsonDescriptor } from "./codecs-
|
|
1
|
+
import { t as AdaptedPostgresCodecDescriptor } from "./codec-descriptor-HYqjI24K-CTO3gTEs.mjs";
|
|
2
|
+
import { A as PgTimestamptzDateDescriptor, C as PgNumericDescriptor, D as PgTimestampStringDescriptor, E as PgTimeTemporalDescriptor, F as PgUnboundedIntDescriptor, I as PgUuidDescriptor, L as PgVarbitDescriptor, M as PgTimestamptzTemporalDescriptor, N as PgTimetzDescriptor, O as PgTimestampTemporalDescriptor, P as PgTsqueryDescriptor, R as PgVarcharDescriptor, S as PgJsonbDescriptor, T as PgTimeStringDescriptor, _ as PgInt8NumberDescriptor, a as PgDateStringDescriptor, b as PgIntervalDescriptor, c as PgEnumDescriptor, d as PgFloat8Descriptor, f as PgFloatDescriptor, g as PgInt8Descriptor, h as PgInt4Descriptor, i as PgCharDescriptor, j as PgTimestamptzStringDescriptor, m as PgInt2Descriptor, n as PgBoolDescriptor, o as PgDateTemporalDescriptor, p as PgInetDescriptor, r as PgByteaDescriptor, t as PgBitDescriptor, u as PgFloat4Descriptor, v as PgIntDescriptor, w as PgTextDescriptor, x as PgJsonDescriptor } from "./codecs-Bkmbmo_r-Ct7hFY0S.mjs";
|
|
3
3
|
import { ExtractCodecTypes } from "@prisma/orm-family-sql/relational-core/ast";
|
|
4
|
-
//#region ../../../3-targets/3-targets/postgres/dist/codec-type-map-
|
|
4
|
+
//#region ../../../3-targets/3-targets/postgres/dist/codec-type-map-DMKy_xZb.d.mts
|
|
5
5
|
//#region src/core/codec-type-map.d.ts
|
|
6
6
|
declare const codecDescriptorMap: {
|
|
7
7
|
readonly char: AdaptedPostgresCodecDescriptor<import("@prisma/orm-family-sql/relational-core/ast").SqlCharDescriptor>;
|
|
@@ -49,4 +49,4 @@ type CodecDescriptorMap = typeof codecDescriptorMap;
|
|
|
49
49
|
type ExtractedCodecTypes = ExtractCodecTypes<CodecDescriptorMap>;
|
|
50
50
|
//#endregion
|
|
51
51
|
export { Resolve as n, ExtractedCodecTypes as t };
|
|
52
|
-
//# sourceMappingURL=codec-type-map-
|
|
52
|
+
//# sourceMappingURL=codec-type-map-DMKy_xZb-DymgX4w7.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec-type-map-
|
|
1
|
+
{"version":3,"file":"codec-type-map-DMKy_xZb-DymgX4w7.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/codec-type-map-DMKy_xZb.d.mts"],"mappings":";;;;;cAIc;WACH,MAAM,2EAA2E;WACjF,SAAS,2EAA2E;WACpF,KAAK,2EAA2E;WAChF,OAAO,2EAA2E;WAClF,YAAY,2EAA2E;WACvF,MAAM;WACN,MAAM;WACN,WAAW;WACX,qBAAqB;WACrB,SAAS;WACT,oBAAoB;WACpB,MAAM;WACN,MAAM;WACN,MAAM;WACN,YAAY;WACZ,QAAQ;WACR,QAAQ;WACR,SAAS;WACT,cAAc;WACd,iBAAiB;WACjB,sBAAsB;WACtB,wBAAwB;WACxB,iBAAiB;WACjB,eAAe;WACf,oBAAoB;WACpB,sBAAsB;WACtB,oBAAoB;WACpB,eAAe;WACf,QAAQ;WACR,MAAM;WACN,KAAK;WACL,eAAe;WACf,OAAO;WACP,MAAM;WACN,MAAM;WACN,UAAU;WACV,MAAM;WACN,OAAO;WACP,SAAS;;KAEf,QAAQ,iBAAiB,WAAW,gBAAgB,WAAW,EAAE,KAAK,EAAE,GAAG;KAC3E,4BAA4B;KAC5B,sBAAsB,kBAAkB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./codecs-
|
|
2
|
-
import { n as Resolve, t as ExtractedCodecTypes } from "./codec-type-map-
|
|
1
|
+
import "./codecs-Bkmbmo_r-Ct7hFY0S.mjs";
|
|
2
|
+
import { n as Resolve, t as ExtractedCodecTypes } from "./codec-type-map-DMKy_xZb-DymgX4w7.mjs";
|
|
3
3
|
import { JsonValue as JsonValue$1 } from "@prisma/orm-framework/contract/types";
|
|
4
|
-
//#region ../../../3-targets/3-targets/postgres/dist/codec-types-
|
|
4
|
+
//#region ../../../3-targets/3-targets/postgres/dist/codec-types-B4-xhn7m.d.mts
|
|
5
5
|
//#region src/exports/codec-types.d.ts
|
|
6
6
|
type CodecTypes = Resolve<ExtractedCodecTypes>;
|
|
7
7
|
type Branded<T, Shape extends Record<string, unknown>> = T & { readonly [K in keyof Shape]: Shape[K]; };
|
|
@@ -48,4 +48,4 @@ type Interval<P extends number | undefined = undefined> = BrandedString<{
|
|
|
48
48
|
}>;
|
|
49
49
|
//#endregion
|
|
50
50
|
export { JsonValue$1 as a, TimeString as c, Timestamptz as d, TimestamptzString as f, Varchar as h, Interval as i, Timestamp as l, VarBit as m, Char as n, Numeric as o, Timetz as p, CodecTypes as r, Time as s, Bit as t, TimestampString as u };
|
|
51
|
-
//# sourceMappingURL=codec-types-
|
|
51
|
+
//# sourceMappingURL=codec-types-B4-xhn7m-RQS461us.d.mts.map
|
package/dist/{codec-types-BQNq7Y1u-CGfS7PuD.d.mts.map → codec-types-B4-xhn7m-RQS461us.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec-types-
|
|
1
|
+
{"version":3,"file":"codec-types-B4-xhn7m-RQS461us.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/codec-types-B4-xhn7m.d.mts"],"mappings":";;;;;KAIK,aAAa,QAAQ;KACrB,QAAQ,GAAG,cAAc,2BAA2B,gBAAgB,WAAW,QAAQ,MAAM;KAC7F,cAAc,cAAc,2BAA2B,gBAAgB;KACvE,KAAK,oBAAoB;EAC5B,cAAc;;KAEX,QAAQ,oBAAoB;EAC/B,iBAAiB;;KAEd,QAAQ,kBAAkB,4CAA4C;EACzE,oBAAoB;EACpB,gBAAgB;;KAEb,IAAI,oBAAoB;EAC3B,aAAa;;KAEV,OAAO,oBAAoB;EAC9B,gBAAgB;;KAEb,UAAU,4CAA4C;EACzD,sBAAsB;;KAEnB,YAAY,4CAA4C;EAC3D,wBAAwB;;KAErB,KAAK,4CAA4C;EACpD,iBAAiB;;KAEd,OAAO,4CAA4C;EACtD,mBAAmB;;KAEhB,gBAAgB,4CAA4C;EAC/D,4BAA4B;;KAEzB,kBAAkB,4CAA4C;EACjE,8BAA8B;;KAE3B,WAAW,4CAA4C;EAC1D,uBAAuB;;KAEpB,SAAS,4CAA4C;EACxD,qBAAqB"}
|