@prisma/orm-target-postgres 8.0.0-rc.16-dev.5 → 8.0.0-rc.16-dev.7
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-BB0VVFW2.d.mts → adapter-BXHPMNAg.d.mts} +3 -3
- package/dist/{adapter-BB0VVFW2.d.mts.map → adapter-BXHPMNAg.d.mts.map} +1 -1
- package/dist/{adapter-RtS8vD8U-m4U_WTpQ.mjs → adapter-RtS8vD8U-CkJSaICZ.mjs} +5 -5
- package/dist/{adapter-RtS8vD8U-m4U_WTpQ.mjs.map → adapter-RtS8vD8U-CkJSaICZ.mjs.map} +1 -1
- package/dist/adapter.d.mts +7 -7
- package/dist/adapter.mjs +5 -5
- package/dist/adapter__adapter.d.mts +1 -1
- package/dist/adapter__adapter.mjs +2 -2
- package/dist/adapter__control.d.mts +2 -2
- package/dist/adapter__control.mjs +6 -6
- package/dist/adapter__runtime.d.mts +1 -1
- package/dist/adapter__runtime.mjs +4 -4
- 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-vHbPLrW4-BsHR7gUE.mjs → authoring-_2G2lsLt-VmVbrMPn.mjs} +5 -5
- package/dist/{authoring-vHbPLrW4-BsHR7gUE.mjs.map → authoring-_2G2lsLt-VmVbrMPn.mjs.map} +1 -1
- package/dist/{check-expressions-Dlt334zg-CV5Vkh3G.mjs → check-expressions-BaFrBceq-ChgvazEN.mjs} +14 -12
- package/dist/check-expressions-BaFrBceq-ChgvazEN.mjs.map +1 -0
- package/dist/{check-expressions-CBIgoKhV-D7oTR8lp.d.mts → check-expressions-CtTzM58x-CsWFEeul.d.mts} +6 -5
- package/dist/check-expressions-CtTzM58x-CsWFEeul.d.mts.map +1 -0
- package/dist/{codec-descriptor-CZAGhM_O-DK9auM7J.mjs → codec-descriptor-C5Ec_6Mw-CpacG1CL.mjs} +3 -2
- package/dist/codec-descriptor-C5Ec_6Mw-CpacG1CL.mjs.map +1 -0
- package/dist/{codec-helpers-D015Pvwa-DR7WMloQ.mjs → codec-helpers-D0ah5Wb8-wdJJZ_8s.mjs} +244 -3
- package/dist/codec-helpers-D0ah5Wb8-wdJJZ_8s.mjs.map +1 -0
- package/dist/{codec-registry-nSGjxm-H-BeUu5zV2.mjs → codec-registry-CKBDkxX7-Kw84Or3s.mjs} +5 -5
- package/dist/{codec-registry-nSGjxm-H-BeUu5zV2.mjs.map → codec-registry-CKBDkxX7-Kw84Or3s.mjs.map} +1 -1
- package/dist/{codec-type-map-DftCqvHU-BYkGKRZI.d.mts → codec-type-map-DueQFJ3a-DKLtMn3R.d.mts} +3 -3
- package/dist/{codec-type-map-DftCqvHU-BYkGKRZI.d.mts.map → codec-type-map-DueQFJ3a-DKLtMn3R.d.mts.map} +1 -1
- package/dist/codec-types-CY3pawL3.d.mts +2 -0
- package/dist/{codec-types-CHtW4cn_-ryYZXjOb.d.mts → codec-types-CYsrudBM-DcYPKpS1.d.mts} +4 -4
- package/dist/{codec-types-CHtW4cn_-ryYZXjOb.d.mts.map → codec-types-CYsrudBM-DcYPKpS1.d.mts.map} +1 -1
- package/dist/{codecs-DelwJv6h-CFbyTJIJ.mjs → codecs-BK3J4C0n-B8EnUXZf.mjs} +49 -37
- package/dist/codecs-BK3J4C0n-B8EnUXZf.mjs.map +1 -0
- package/dist/{codecs-Djhvng3f.d.mts → codecs-ChjCJY5k.d.mts} +2 -2
- package/dist/{codecs-Djhvng3f.d.mts.map → codecs-ChjCJY5k.d.mts.map} +1 -1
- package/dist/{codecs-CvG9lv7r-9RlHwf9Y.d.mts → codecs-y1gOMMt--DKWhYGN5.d.mts} +8 -2
- package/dist/codecs-y1gOMMt--DKWhYGN5.d.mts.map +1 -0
- package/dist/{contract-free-DaK6wmmo.mjs → contract-free-BMKFjlIG.mjs} +3 -3
- package/dist/{contract-free-DaK6wmmo.mjs.map → contract-free-BMKFjlIG.mjs.map} +1 -1
- package/dist/{control-CHqdVXHC.d.mts → control-D2JNE1Tz.d.mts} +3 -3
- package/dist/{control-CHqdVXHC.d.mts.map → control-D2JNE1Tz.d.mts.map} +1 -1
- package/dist/{control-YKrabf1Q.mjs → control-Ltn8Dzpi.mjs} +11 -11
- package/dist/{control-YKrabf1Q.mjs.map → control-Ltn8Dzpi.mjs.map} +1 -1
- package/dist/{control-adapter-Co30P4lH-B5euUoQ4.mjs → control-adapter-Co30P4lH-CpxXk5cz.mjs} +6 -6
- package/dist/{control-adapter-Co30P4lH-B5euUoQ4.mjs.map → control-adapter-Co30P4lH-CpxXk5cz.mjs.map} +1 -1
- package/dist/{control-policy-bwcdB78Y-DgRaWAzu.mjs → control-policy-DMOu5nnt-DslefUx9.mjs} +11 -10
- package/dist/control-policy-DMOu5nnt-DslefUx9.mjs.map +1 -0
- package/dist/{data-type-entries-DgKLUrqt-TKDikzti.mjs → data-type-entries-DoR61yeO-BB2cY7rI.mjs} +3 -3
- package/dist/{data-type-entries-DgKLUrqt-TKDikzti.mjs.map → data-type-entries-DoR61yeO-BB2cY7rI.mjs.map} +1 -1
- package/dist/{data-types-E1wms1_i.d.mts → data-types-BDkZIUMI.d.mts} +4 -2
- package/dist/{data-types-E1wms1_i.d.mts.map → data-types-BDkZIUMI.d.mts.map} +1 -1
- package/dist/{data-types-k3Ebk3kj-DWk3nh_k.mjs → data-types-DRkmmE9S-C5Q9oH4Q.mjs} +13 -4
- package/dist/data-types-DRkmmE9S-C5Q9oH4Q.mjs.map +1 -0
- package/dist/{ddl-C_vTj7b5-vyGLBKLo.mjs → ddl-D5hYRCTf-DRSajCVT.mjs} +3 -3
- package/dist/{ddl-C_vTj7b5-vyGLBKLo.mjs.map → ddl-D5hYRCTf-DRSajCVT.mjs.map} +1 -1
- package/dist/{default-normalizer-CrMBHF0W-BaUR4Ec8.mjs → default-normalizer-Bf_Fhv4v-CugGfLAe.mjs} +12 -7
- package/dist/default-normalizer-Bf_Fhv4v-CugGfLAe.mjs.map +1 -0
- package/dist/{descriptor-meta-ARufwwWW-DMQsPNAl.mjs → descriptor-meta-ARufwwWW-ChZm5Hg5.mjs} +3 -3
- package/dist/{descriptor-meta-ARufwwWW-DMQsPNAl.mjs.map → descriptor-meta-ARufwwWW-ChZm5Hg5.mjs.map} +1 -1
- package/dist/{descriptor-meta-BgOMP4hF-CfUJsgjc.mjs → descriptor-meta-WHc6Kv-m-BLzsaP0M.mjs} +8 -8
- package/dist/{descriptor-meta-BgOMP4hF-CfUJsgjc.mjs.map → descriptor-meta-WHc6Kv-m-BLzsaP0M.mjs.map} +1 -1
- package/dist/{descriptor-meta-runtime-CG2S236D-CUkzqeCr.mjs → descriptor-meta-runtime-iArZEoCE-GhLNDdg-.mjs} +3 -3
- package/dist/{descriptor-meta-runtime-CG2S236D-CUkzqeCr.mjs.map → descriptor-meta-runtime-iArZEoCE-GhLNDdg-.mjs.map} +1 -1
- package/dist/{diff-database-schema-zc7d2uxC-BVe8D7vG.mjs → diff-database-schema-DgAMDjHF-YATlptWC.mjs} +6 -6
- package/dist/{diff-database-schema-zc7d2uxC-BVe8D7vG.mjs.map → diff-database-schema-DgAMDjHF-YATlptWC.mjs.map} +1 -1
- package/dist/{full-text-D5pW25-Y.d.mts → full-text-CCqTEQ9y.d.mts} +2 -2
- package/dist/{full-text-D5pW25-Y.d.mts.map → full-text-CCqTEQ9y.d.mts.map} +1 -1
- package/dist/{full-text-index-expression-BpUM2Td6-2Q7y7DnO.mjs → full-text-index-expression-Bfp_xWhy-DtbLdkzv.mjs} +3 -3
- package/dist/{full-text-index-expression-BpUM2Td6-2Q7y7DnO.mjs.map → full-text-index-expression-Bfp_xWhy-DtbLdkzv.mjs.map} +1 -1
- package/dist/{full-text-parsers-BhjgmAe5-CyF7dp_b.d.mts → full-text-parsers-DrS_1B-x-BcAnBoQP.d.mts} +3 -3
- package/dist/{full-text-parsers-BhjgmAe5-CyF7dp_b.d.mts.map → full-text-parsers-DrS_1B-x-BcAnBoQP.d.mts.map} +1 -1
- package/dist/{infer-psl-contract-B5yExD61-Cmye68li.mjs → infer-psl-contract-D-3st5lU-DKQhhsut.mjs} +7 -7
- package/dist/{infer-psl-contract-B5yExD61-Cmye68li.mjs.map → infer-psl-contract-D-3st5lU-DKQhhsut.mjs.map} +1 -1
- package/dist/{issue-planner-pmBrIrEN.d.mts → issue-planner-DWRClmiP.d.mts} +2 -2
- package/dist/{issue-planner-pmBrIrEN.d.mts.map → issue-planner-DWRClmiP.d.mts.map} +1 -1
- package/dist/{migration-D189kh3f.d.mts → migration--J8vKZ8z.d.mts} +3 -3
- package/dist/{migration-D189kh3f.d.mts.map → migration--J8vKZ8z.d.mts.map} +1 -1
- package/dist/migration-PTHAY9Cv.mjs.map +1 -1
- package/dist/{op-factory-call-CqKUB1XP-CsEGx4Jd.d.mts → op-factory-call-BFnGNPJD-5vgAjFpd.d.mts} +44 -14
- package/dist/op-factory-call-BFnGNPJD-5vgAjFpd.d.mts.map +1 -0
- package/dist/{op-factory-call-DdXVWQlV-DzfLhTkh.mjs → op-factory-call-BbTtrII--CbCFZfSd.mjs} +124 -28
- package/dist/op-factory-call-BbTtrII--CbCFZfSd.mjs.map +1 -0
- package/dist/op-factory-call-CsuauFRs.d.mts +1 -0
- package/dist/{operation-types-Be5rdu14.d.mts → operation-types-CjJY7prP.d.mts} +2 -2
- package/dist/{operation-types-Be5rdu14.d.mts.map → operation-types-CjJY7prP.d.mts.map} +1 -1
- package/dist/{pack-DHV9zslZ.d.mts → pack-Bq9yq-OS.d.mts} +4 -4
- package/dist/{pack-DHV9zslZ.d.mts.map → pack-Bq9yq-OS.d.mts.map} +1 -1
- package/dist/{planner-CvUO8Zpn.d.mts → planner-B9c5vxQo.d.mts} +15 -8
- package/dist/planner-B9c5vxQo.d.mts.map +1 -0
- package/dist/{planner-ZmK0aNuY-Cak-8zwa.mjs → planner-_mo_t-l3-DPAQVG1x.mjs} +117 -23
- package/dist/planner-_mo_t-l3-DPAQVG1x.mjs.map +1 -0
- package/dist/{planner-ddl-builders-DRProi99-D0K5ZiD0.mjs → planner-ddl-builders-Y0_96xpe-BzugdEDO.mjs} +3 -3
- package/dist/{planner-ddl-builders-DRProi99-D0K5ZiD0.mjs.map → planner-ddl-builders-Y0_96xpe-BzugdEDO.mjs.map} +1 -1
- package/dist/{planner-identity-values-C1eV916m-D0p3EfYc.mjs → planner-identity-values-CRS2cQ6v-DakZeIQj.mjs} +3 -3
- package/dist/{planner-identity-values-C1eV916m-D0p3EfYc.mjs.map → planner-identity-values-CRS2cQ6v-DakZeIQj.mjs.map} +1 -1
- package/dist/{planner-produced-postgres-migration-BAWQ6iqr-C06XurYw.mjs → planner-produced-postgres-migration-BdWg8TP2-QE9uzt2K.mjs} +4 -4
- package/dist/{planner-produced-postgres-migration-BAWQ6iqr-C06XurYw.mjs.map → planner-produced-postgres-migration-BdWg8TP2-QE9uzt2K.mjs.map} +1 -1
- package/dist/planner-produced-postgres-migration-BqcWgPjb.d.mts +1 -0
- package/dist/{planner-produced-postgres-migration-DT3i_p3G-CyQUv3ac.d.mts → planner-produced-postgres-migration-Bw145mJT-qpLKF3Vf.d.mts} +3 -3
- package/dist/planner-produced-postgres-migration-Bw145mJT-qpLKF3Vf.d.mts.map +1 -0
- package/dist/{planner-sql-checks-rqOH8naU-B6xOE5lC.mjs → planner-sql-checks-DCGV2qdu-eaeFLtn8.mjs} +3 -3
- package/dist/{planner-sql-checks-rqOH8naU-B6xOE5lC.mjs.map → planner-sql-checks-DCGV2qdu-eaeFLtn8.mjs.map} +1 -1
- package/dist/{postgres-contract-view-B0KloSYp-Cbbl_pIv.mjs → postgres-contract-view-CL-YTH_3-Diah6i2a.mjs} +6 -6
- package/dist/{postgres-contract-view-B0KloSYp-Cbbl_pIv.mjs.map → postgres-contract-view-CL-YTH_3-Diah6i2a.mjs.map} +1 -1
- package/dist/{postgres-migration-e8UybR1y-C_m4i1jp.d.mts → postgres-migration-DVY2ALDJ-DTWECas_.d.mts} +36 -4
- package/dist/postgres-migration-DVY2ALDJ-DTWECas_.d.mts.map +1 -0
- package/dist/postgres-migration-DmczQSHT-DsWlow8L.mjs +1075 -0
- package/dist/postgres-migration-DmczQSHT-DsWlow8L.mjs.map +1 -0
- package/dist/{postgres-schema-AlEVkXXS-ZfXWYddl.mjs → postgres-schema-COkaqci7-C6JpiSha.mjs} +6 -6
- package/dist/postgres-schema-COkaqci7-C6JpiSha.mjs.map +1 -0
- package/dist/{prisma7-binding-GebhdAGS.mjs → prisma7-binding-CAzQh1rQ.mjs} +7 -7
- package/dist/{prisma7-binding-GebhdAGS.mjs.map → prisma7-binding-CAzQh1rQ.mjs.map} +1 -1
- package/dist/{prisma7-binding-FvF1AZxQ.d.mts → prisma7-binding-Dm34z6Fq.d.mts} +4 -4
- package/dist/{prisma7-binding-FvF1AZxQ.d.mts.map → prisma7-binding-Dm34z6Fq.d.mts.map} +1 -1
- package/dist/{render-ops-D2vJApKB-B281fzmn.mjs → render-ops-DaCy6StH-BgzbTE_9.mjs} +16 -9
- package/dist/render-ops-DaCy6StH-BgzbTE_9.mjs.map +1 -0
- package/dist/{resolve-ddl-schema-BthOWVjF-DuZ9iUh-.mjs → resolve-ddl-schema-DD69Bwve-e-BpAfFa.mjs} +3 -3
- package/dist/{resolve-ddl-schema-BthOWVjF-DuZ9iUh-.mjs.map → resolve-ddl-schema-DD69Bwve-e-BpAfFa.mjs.map} +1 -1
- package/dist/{runtime-aejvKbMy.d.mts → runtime-CNTEAZIz.d.mts} +2 -2
- package/dist/{runtime-aejvKbMy.d.mts.map → runtime-CNTEAZIz.d.mts.map} +1 -1
- package/dist/{sql-renderer-DT4IEOVi-CE0YIu9V.mjs → sql-renderer-DT4IEOVi-CBE8uTub.mjs} +2 -2
- package/dist/{sql-renderer-DT4IEOVi-CE0YIu9V.mjs.map → sql-renderer-DT4IEOVi-CBE8uTub.mjs.map} +1 -1
- package/dist/{sql-renderer-B1ZLRgUw.d.mts → sql-renderer-hQ3HTY-B.d.mts} +2 -2
- package/dist/{sql-renderer-B1ZLRgUw.d.mts.map → sql-renderer-hQ3HTY-B.d.mts.map} +1 -1
- package/dist/target.d.mts +21 -21
- package/dist/target.mjs +27 -27
- package/dist/target__codec-descriptor.mjs +1 -1
- package/dist/target__codec-types.d.mts +3 -3
- package/dist/target__codecs.d.mts +2 -2
- package/dist/target__codecs.mjs +2 -2
- package/dist/target__contract-free.mjs +3 -3
- package/dist/target__control.mjs +3 -3
- package/dist/target__data-types.d.mts +1 -1
- 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__op-factory-call.d.mts +3 -3
- package/dist/target__op-factory-call.mjs +2 -2
- 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.mjs +1 -1
- package/dist/target__planner-identity-values.mjs +1 -1
- 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__render-ops.mjs +1 -1
- package/dist/target__runtime.mjs +3 -3
- package/dist/target__runtime.mjs.map +1 -1
- package/dist/target__schema-ir-annotations.mjs +1 -1
- package/dist/target__sql-utils.mjs +1 -1
- package/dist/target__types.d.mts +2 -2
- package/dist/target__types.mjs +2 -2
- package/dist/{types-D799eppJ.d.mts → types-BP1e5MBV.d.mts} +2 -2
- package/dist/{types-D799eppJ.d.mts.map → types-BP1e5MBV.d.mts.map} +1 -1
- package/dist/{types-D6lgKhE5-Cu48rrw9.d.mts → types-D6lgKhE5-DYkeCAjr.d.mts} +2 -2
- package/dist/{types-D6lgKhE5-Cu48rrw9.d.mts.map → types-D6lgKhE5-DYkeCAjr.d.mts.map} +1 -1
- package/dist/types-Dnrjripb.d.mts +2 -0
- package/package.json +9 -9
- package/dist/check-expressions-CBIgoKhV-D7oTR8lp.d.mts.map +0 -1
- package/dist/check-expressions-Dlt334zg-CV5Vkh3G.mjs.map +0 -1
- package/dist/codec-descriptor-CZAGhM_O-DK9auM7J.mjs.map +0 -1
- package/dist/codec-helpers-D015Pvwa-DR7WMloQ.mjs.map +0 -1
- package/dist/codec-types-DQUtpepT.d.mts +0 -2
- package/dist/codecs-CvG9lv7r-9RlHwf9Y.d.mts.map +0 -1
- package/dist/codecs-DelwJv6h-CFbyTJIJ.mjs.map +0 -1
- package/dist/control-policy-bwcdB78Y-DgRaWAzu.mjs.map +0 -1
- package/dist/data-types-k3Ebk3kj-DWk3nh_k.mjs.map +0 -1
- package/dist/default-normalizer-CrMBHF0W-BaUR4Ec8.mjs.map +0 -1
- package/dist/op-factory-call-CqKUB1XP-CsEGx4Jd.d.mts.map +0 -1
- package/dist/op-factory-call-D5UJ7cDi.d.mts +0 -1
- package/dist/op-factory-call-DdXVWQlV-DzfLhTkh.mjs.map +0 -1
- package/dist/planner-CvUO8Zpn.d.mts.map +0 -1
- package/dist/planner-ZmK0aNuY-Cak-8zwa.mjs.map +0 -1
- package/dist/planner-produced-postgres-migration-BI_aepPp.d.mts +0 -1
- package/dist/planner-produced-postgres-migration-DT3i_p3G-CyQUv3ac.d.mts.map +0 -1
- package/dist/postgres-migration-UVh2xeV0-DW8V_8aj.mjs +0 -596
- package/dist/postgres-migration-UVh2xeV0-DW8V_8aj.mjs.map +0 -1
- package/dist/postgres-migration-e8UybR1y-C_m4i1jp.d.mts.map +0 -1
- package/dist/postgres-schema-AlEVkXXS-ZfXWYddl.mjs.map +0 -1
- package/dist/render-ops-D2vJApKB-B281fzmn.mjs.map +0 -1
- package/dist/types-CdJszzhP.d.mts +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-descriptor-C5Ec_6Mw-CpacG1CL.mjs","names":["#descriptors"],"sources":["../../../../3-targets/3-targets/postgres/dist/codec-descriptor-C5Ec_6Mw.mjs"],"sourcesContent":["import { CaseExpr, ColumnRef, DerivedTableSource, FunctionSource, JsonArrayAggExpr, LiteralExpr, NativeJsonValueProjection, NullCheckExpr, OrderByItem, ProjectionItem, SelectAst, SubqueryExpr } from \"@internal/sql-relational-core/ast\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { CodecDescriptorImpl, validateCodecTypeParams } from \"@internal/framework-components/codec\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/core/codec-descriptor.ts\nconst POSTGRES_CODEC_DESCRIPTOR_KIND = \"postgres-codec\";\nconst ARRAY_INPUT_ALIAS = \"array_input\";\nconst ARRAY_ELEMENT_ALIAS = \"array_element\";\nconst ARRAY_VALUE_COLUMN = \"value\";\nconst ARRAY_ORDINALITY_COLUMN = \"ordinality\";\nvar PostgresCodecDescriptor = class extends CodecDescriptorImpl {\n\tdescriptorKind = POSTGRES_CODEC_DESCRIPTOR_KIND;\n\tjsonArrayProjection(expression, params) {\n\t\tconst boundArray = ColumnRef.of(ARRAY_INPUT_ALIAS, ARRAY_VALUE_COLUMN);\n\t\tconst element = ColumnRef.of(ARRAY_ELEMENT_ALIAS, ARRAY_VALUE_COLUMN);\n\t\tconst ordinality = ColumnRef.of(ARRAY_ELEMENT_ALIAS, ARRAY_ORDINALITY_COLUMN);\n\t\tconst projectedElement = CaseExpr.of([{\n\t\t\tcondition: NullCheckExpr.isNull(element),\n\t\t\tvalue: LiteralExpr.of(null)\n\t\t}], this.jsonProjection(element, params));\n\t\tconst aggregate = JsonArrayAggExpr.of(new NativeJsonValueProjection(projectedElement), \"emptyArray\", [OrderByItem.asc(ordinality)]);\n\t\tconst aggregateQuery = SelectAst.from(FunctionSource.of(\"unnest\", [boundArray], {\n\t\t\talias: ARRAY_ELEMENT_ALIAS,\n\t\t\tcolumnAliases: [ARRAY_VALUE_COLUMN, ARRAY_ORDINALITY_COLUMN]\n\t\t}).withOrdinality()).withProjection([ProjectionItem.of(ARRAY_VALUE_COLUMN, aggregate)]);\n\t\tconst arrayResult = CaseExpr.of([{\n\t\t\tcondition: NullCheckExpr.isNull(boundArray),\n\t\t\tvalue: LiteralExpr.of(null)\n\t\t}], SubqueryExpr.of(aggregateQuery));\n\t\tconst inputBinding = SelectAst.noFrom().withProjection([ProjectionItem.of(ARRAY_VALUE_COLUMN, expression)]);\n\t\treturn SubqueryExpr.of(SelectAst.from(DerivedTableSource.as(ARRAY_INPUT_ALIAS, inputBinding)).withProjection([ProjectionItem.of(ARRAY_VALUE_COLUMN, arrayResult)]));\n\t}\n\tprojectJson(expression, ref) {\n\t\tconst params = this.validateParams(ref);\n\t\treturn ref.many === true ? this.jsonArrayProjection(expression, params) : this.jsonProjection(expression, params);\n\t}\n\tvalidateParams(ref) {\n\t\treturn blindCast(validateCodecTypeParams(this, ref));\n\t}\n};\nvar PostgresCodecDescriptorAdapter = class extends PostgresCodecDescriptor {\n\toptions;\n\tdataType;\n\tcodecId;\n\ttraits;\n\tparamsSchema;\n\trenderOutputType;\n\trenderInputType;\n\trenderValueLiteral;\n\tfactory;\n\tconstructor(descriptor, options) {\n\t\tsuper();\n\t\tthis.options = options;\n\t\tthis.dataType = options.dataType.id;\n\t\tthis.codecId = descriptor.codecId;\n\t\tthis.traits = descriptor.traits;\n\t\tthis.paramsSchema = blindCast(options.dataType.params);\n\t\tconst factory = options.factory;\n\t\tthis.factory = factory === void 0 ? (params) => descriptor.factory(params) : (params) => factory(this, params);\n\t\tconst renderOutputType = descriptor.renderOutputType;\n\t\tif (renderOutputType !== void 0) this.renderOutputType = (params) => renderOutputType.call(descriptor, params);\n\t\tconst renderInputType = descriptor.renderInputType;\n\t\tif (renderInputType !== void 0) this.renderInputType = (params) => renderInputType.call(descriptor, params);\n\t\tconst renderValueLiteral = descriptor.renderValueLiteral;\n\t\tif (renderValueLiteral !== void 0) this.renderValueLiteral = (value, side) => renderValueLiteral.call(descriptor, value, side);\n\t\tif (descriptor.enumRefusal !== void 0) this.enumRefusal = descriptor.enumRefusal;\n\t}\n\tjsonProjection(expression, params) {\n\t\treturn this.options.jsonProjection(expression, params);\n\t}\n\tjsonArrayProjection(expression, params) {\n\t\treturn this.options.jsonArrayProjection === void 0 ? super.jsonArrayProjection(expression, params) : this.options.jsonArrayProjection(expression, params);\n\t}\n};\nfunction postgresCodec(descriptor, options) {\n\treturn blindCast(new PostgresCodecDescriptorAdapter(descriptor, options));\n}\nfunction definePostgresCodecs(descriptors) {\n\treturn descriptors;\n}\nfunction isPostgresCodecDescriptor(value) {\n\treturn typeof value === \"object\" && value !== null && \"descriptorKind\" in value && value.descriptorKind === POSTGRES_CODEC_DESCRIPTOR_KIND && \"codecId\" in value && typeof value.codecId === \"string\" && \"traits\" in value && Array.isArray(value.traits) && \"paramsSchema\" in value && (value.paramsSchema === void 0 || isObjectLike(value.paramsSchema) && \"~standard\" in value.paramsSchema && isObjectLike(value.paramsSchema[\"~standard\"]) && \"validate\" in value.paramsSchema[\"~standard\"] && typeof value.paramsSchema[\"~standard\"].validate === \"function\") && \"isParameterized\" in value && typeof value.isParameterized === \"boolean\" && \"factory\" in value && typeof value.factory === \"function\" && \"projectJson\" in value && typeof value.projectJson === \"function\";\n}\nfunction isObjectLike(value) {\n\treturn typeof value === \"object\" && value !== null || typeof value === \"function\";\n}\nvar PostgresCodecDescriptorRegistryImpl = class {\n\t#descriptors;\n\tconstructor(descriptors) {\n\t\tthis.#descriptors = descriptors;\n\t\tObject.freeze(this);\n\t}\n\tdescriptorFor(codecId) {\n\t\treturn this.#descriptors.get(codecId);\n\t}\n\t*values() {\n\t\tyield* this.#descriptors.values();\n\t}\n};\nfunction buildPostgresCodecDescriptorRegistry(descriptors) {\n\tconst byId = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tif (!isPostgresCodecDescriptor(descriptor)) {\n\t\t\tconst codecId = candidateCodecId(descriptor);\n\t\t\tthrow structuredError(\"RUNTIME.CODEC_DESCRIPTOR_INVALID\", `Codec descriptor '${codecId}' is not a valid PostgreSQL codec descriptor.`, {\n\t\t\t\twhy: \"PostgreSQL codec registries require the postgres-codec discriminant and complete target descriptor methods.\",\n\t\t\t\tfix: \"Extend PostgresCodecDescriptor or adapt a generic descriptor with postgresCodec().\",\n\t\t\t\tmeta: { codecId }\n\t\t\t});\n\t\t}\n\t\tif (byId.has(descriptor.codecId)) throw structuredError(\"RUNTIME.DUPLICATE_CODEC\", `Duplicate PostgreSQL codec descriptor id '${descriptor.codecId}'.`, {\n\t\t\twhy: \"Each codecId must resolve to exactly one PostgreSQL descriptor during registry composition.\",\n\t\t\tfix: \"Remove the duplicate target, adapter, or extension contribution.\",\n\t\t\tmeta: {\n\t\t\t\tcodecId: descriptor.codecId,\n\t\t\t\ttarget: \"postgres\"\n\t\t\t}\n\t\t});\n\t\tbyId.set(descriptor.codecId, descriptor);\n\t}\n\treturn new PostgresCodecDescriptorRegistryImpl(byId);\n}\nfunction candidateCodecId(value) {\n\treturn typeof value === \"object\" && value !== null && \"codecId\" in value && typeof value.codecId === \"string\" ? value.codecId : \"<unknown>\";\n}\n//#endregion\nexport { postgresCodec as a, isPostgresCodecDescriptor as i, buildPostgresCodecDescriptorRegistry as n, definePostgresCodecs as r, PostgresCodecDescriptor as t };\n\n//# sourceMappingURL=codec-descriptor-C5Ec_6Mw.mjs.map"],"mappings":";;;;;AAKA,MAAM,iCAAiC;AACvC,MAAM,oBAAoB;AAC1B,MAAM,sBAAsB;AAC5B,MAAM,qBAAqB;AAC3B,MAAM,0BAA0B;AAChC,IAAI,0BAA0B,cAAc,oBAAoB;CAC/D,iBAAiB;CACjB,oBAAoB,YAAY,QAAQ;EACvC,MAAM,aAAa,UAAU,GAAG,mBAAmB,kBAAkB;EACrE,MAAM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,WAAW,MAAM,UAAU;AACjI"}
|
|
@@ -3,7 +3,246 @@ import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
|
3
3
|
import { SAFE_INTEGER_BIGINT_RANGE, decodeJsonIntegerText, decodeJsonMatching } from "@prisma/orm-framework/components/codec";
|
|
4
4
|
import { numeralText } from "@prisma/orm-family-sql/contract/data-type";
|
|
5
5
|
import { withoutTrailing } from "@prisma/orm-framework/utils/text";
|
|
6
|
-
//#region ../../../3-targets/3-targets/postgres/dist/codec-helpers-
|
|
6
|
+
//#region ../../../3-targets/3-targets/postgres/dist/codec-helpers-D0ah5Wb8.mjs
|
|
7
|
+
const DIGIT = /^[0-9]$/;
|
|
8
|
+
const HEX_DIGIT = /^[0-9a-fA-F]$/;
|
|
9
|
+
const isDigit = (ch) => ch !== void 0 && DIGIT.test(ch);
|
|
10
|
+
/**
|
|
11
|
+
* Text PostgreSQL reads as an `inet` value, written the way PostgreSQL prints it: an IPv4 address in
|
|
12
|
+
* four decimal octets, an IPv6 address in lower-case hex with its longest run of zero groups written
|
|
13
|
+
* `::`, and the prefix length only when it is shorter than the whole address. `undefined` for text
|
|
14
|
+
* PostgreSQL does not read as an `inet` value.
|
|
15
|
+
*/
|
|
16
|
+
function canonicalInet(text) {
|
|
17
|
+
if (text.includes(":")) {
|
|
18
|
+
const value = readIpv6(text);
|
|
19
|
+
return value === void 0 ? void 0 : printIpv6(value);
|
|
20
|
+
}
|
|
21
|
+
const value = readIpv4(text);
|
|
22
|
+
return value === void 0 ? void 0 : printIpv4(value);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* PostgreSQL's `inet_net_pton_ipv4`: one to four decimal octets, each up to 255 and leading zeros
|
|
26
|
+
* allowed, then an optional `/` and prefix length up to 32. Without a prefix length all four octets
|
|
27
|
+
* are required; with one, the octets written must cover it.
|
|
28
|
+
*/
|
|
29
|
+
function readIpv4(text) {
|
|
30
|
+
const octets = [];
|
|
31
|
+
let index = 0;
|
|
32
|
+
let ch = text[index++];
|
|
33
|
+
while (isDigit(ch)) {
|
|
34
|
+
let octet = 0;
|
|
35
|
+
do {
|
|
36
|
+
octet = octet * 10 + Number(ch);
|
|
37
|
+
if (octet > 255) return void 0;
|
|
38
|
+
ch = text[index++];
|
|
39
|
+
} while (isDigit(ch));
|
|
40
|
+
if (octets.length === 4) return void 0;
|
|
41
|
+
octets.push(octet);
|
|
42
|
+
if (ch === void 0 || ch === "/") break;
|
|
43
|
+
if (ch !== ".") return void 0;
|
|
44
|
+
ch = text[index++];
|
|
45
|
+
}
|
|
46
|
+
let bits = -1;
|
|
47
|
+
if (ch === "/" && isDigit(text[index]) && octets.length > 0) {
|
|
48
|
+
ch = text[index++];
|
|
49
|
+
bits = 0;
|
|
50
|
+
do {
|
|
51
|
+
bits = bits * 10 + Number(ch);
|
|
52
|
+
ch = text[index++];
|
|
53
|
+
} while (isDigit(ch));
|
|
54
|
+
if (ch !== void 0 || bits > 32) return void 0;
|
|
55
|
+
}
|
|
56
|
+
if (ch !== void 0) return void 0;
|
|
57
|
+
if (bits === -1) {
|
|
58
|
+
if (octets.length !== 4) return void 0;
|
|
59
|
+
bits = 32;
|
|
60
|
+
}
|
|
61
|
+
if (octets.length === 0 || Math.floor(bits / 8) > octets.length) return void 0;
|
|
62
|
+
return {
|
|
63
|
+
bytes: [
|
|
64
|
+
...octets,
|
|
65
|
+
0,
|
|
66
|
+
0,
|
|
67
|
+
0,
|
|
68
|
+
0
|
|
69
|
+
].slice(0, 4),
|
|
70
|
+
bits
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/** PostgreSQL's `getbits`: a prefix length up to 128, with no leading zero. */
|
|
74
|
+
function readBits(text) {
|
|
75
|
+
let bits = 0;
|
|
76
|
+
let digits = 0;
|
|
77
|
+
for (const ch of text) {
|
|
78
|
+
if (!isDigit(ch)) return void 0;
|
|
79
|
+
if (digits++ !== 0 && bits === 0) return void 0;
|
|
80
|
+
bits = bits * 10 + Number(ch);
|
|
81
|
+
if (bits > 128) return void 0;
|
|
82
|
+
}
|
|
83
|
+
return digits === 0 ? void 0 : bits;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* PostgreSQL's `getv4`, for the IPv4 tail of an IPv6 address: up to four decimal octets with no
|
|
87
|
+
* leading zeros, and an optional prefix length. Octets left out are zero.
|
|
88
|
+
*/
|
|
89
|
+
function readIpv4Tail(text) {
|
|
90
|
+
const octets = [];
|
|
91
|
+
let octet = 0;
|
|
92
|
+
let digits = 0;
|
|
93
|
+
for (const [index, ch] of [...text].entries()) {
|
|
94
|
+
if (isDigit(ch)) {
|
|
95
|
+
if (digits++ !== 0 && octet === 0) return void 0;
|
|
96
|
+
octet = octet * 10 + Number(ch);
|
|
97
|
+
if (octet > 255) return void 0;
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
if (ch !== "." && ch !== "/") return void 0;
|
|
101
|
+
if (octets.length > 3) return void 0;
|
|
102
|
+
octets.push(octet);
|
|
103
|
+
if (ch === "/") {
|
|
104
|
+
const bits = readBits(text.slice(index + 1));
|
|
105
|
+
return bits === void 0 ? void 0 : {
|
|
106
|
+
octets,
|
|
107
|
+
bits
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
octet = 0;
|
|
111
|
+
digits = 0;
|
|
112
|
+
}
|
|
113
|
+
if (digits === 0 || octets.length > 3) return void 0;
|
|
114
|
+
return {
|
|
115
|
+
octets: [...octets, octet],
|
|
116
|
+
bits: void 0
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* PostgreSQL's `inet_cidr_pton_ipv6`: up to eight groups of one to four hex digits in either case,
|
|
121
|
+
* one `::` standing for a run of zero groups, an optional IPv4 tail, and an optional prefix length.
|
|
122
|
+
*/
|
|
123
|
+
function readIpv6(text) {
|
|
124
|
+
const bytes = new Array(16).fill(0);
|
|
125
|
+
let filled = 0;
|
|
126
|
+
let compressedAt;
|
|
127
|
+
let index = 0;
|
|
128
|
+
if (text[0] === ":") {
|
|
129
|
+
if (text[1] !== ":") return void 0;
|
|
130
|
+
index = 1;
|
|
131
|
+
}
|
|
132
|
+
let tokenStart = index;
|
|
133
|
+
let sawHexDigit = false;
|
|
134
|
+
let group = 0;
|
|
135
|
+
let groupDigits = 0;
|
|
136
|
+
let bits = 128;
|
|
137
|
+
while (index < text.length) {
|
|
138
|
+
const ch = text[index++] ?? "";
|
|
139
|
+
if (HEX_DIGIT.test(ch)) {
|
|
140
|
+
group = group << 4 | Number.parseInt(ch, 16);
|
|
141
|
+
if (++groupDigits > 4) return void 0;
|
|
142
|
+
sawHexDigit = true;
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
if (ch === ":") {
|
|
146
|
+
tokenStart = index;
|
|
147
|
+
if (!sawHexDigit) {
|
|
148
|
+
if (compressedAt !== void 0) return void 0;
|
|
149
|
+
compressedAt = filled;
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
if (index >= text.length || filled + 2 > 16) return void 0;
|
|
153
|
+
bytes[filled++] = group >> 8;
|
|
154
|
+
bytes[filled++] = group & 255;
|
|
155
|
+
sawHexDigit = false;
|
|
156
|
+
group = 0;
|
|
157
|
+
groupDigits = 0;
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
if (ch === "." && filled + 4 <= 16) {
|
|
161
|
+
const tail = readIpv4Tail(text.slice(tokenStart));
|
|
162
|
+
if (tail !== void 0) {
|
|
163
|
+
tail.octets.forEach((octet, offset) => {
|
|
164
|
+
bytes[filled + offset] = octet;
|
|
165
|
+
});
|
|
166
|
+
filled += 4;
|
|
167
|
+
sawHexDigit = false;
|
|
168
|
+
bits = tail.bits ?? bits;
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
if (ch === "/") {
|
|
173
|
+
const prefix = readBits(text.slice(index));
|
|
174
|
+
if (prefix !== void 0) {
|
|
175
|
+
bits = prefix;
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if (sawHexDigit) {
|
|
182
|
+
if (filled + 2 > 16) return void 0;
|
|
183
|
+
bytes[filled++] = group >> 8;
|
|
184
|
+
bytes[filled++] = group & 255;
|
|
185
|
+
}
|
|
186
|
+
if (compressedAt !== void 0) {
|
|
187
|
+
if (filled === 16) return void 0;
|
|
188
|
+
const shifted = bytes.slice(compressedAt, filled);
|
|
189
|
+
bytes.fill(0, compressedAt, filled);
|
|
190
|
+
bytes.splice(16 - shifted.length, shifted.length, ...shifted);
|
|
191
|
+
filled = 16;
|
|
192
|
+
}
|
|
193
|
+
return filled === 16 ? {
|
|
194
|
+
bytes,
|
|
195
|
+
bits
|
|
196
|
+
} : void 0;
|
|
197
|
+
}
|
|
198
|
+
function printIpv4({ bytes, bits }) {
|
|
199
|
+
const address = bytes.join(".");
|
|
200
|
+
return bits === 32 ? address : `${address}/${bits}`;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* PostgreSQL's `inet_net_ntop_ipv6`: the first longest run of two or more zero groups is written
|
|
204
|
+
* `::`, and an address whose first five groups are zero followed by `ffff`, or whose first six are
|
|
205
|
+
* zero, ends in dotted IPv4.
|
|
206
|
+
*/
|
|
207
|
+
function printIpv6({ bytes, bits }) {
|
|
208
|
+
const groups = Array.from({ length: 8 }, (_, i) => (bytes[2 * i] ?? 0) << 8 | (bytes[2 * i + 1] ?? 0));
|
|
209
|
+
const zeroRun = longestZeroRun(groups);
|
|
210
|
+
let text = "";
|
|
211
|
+
for (let i = 0; i < 8; i++) {
|
|
212
|
+
if (zeroRun !== void 0 && i >= zeroRun.start && i < zeroRun.start + zeroRun.length) {
|
|
213
|
+
if (i === zeroRun.start) text += ":";
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
if (i !== 0) text += ":";
|
|
217
|
+
if (i === 6 && zeroRun?.start === 0 && (zeroRun.length === 6 || zeroRun.length === 5 && groups[5] === 65535)) {
|
|
218
|
+
text += bytes.slice(12).join(".");
|
|
219
|
+
break;
|
|
220
|
+
}
|
|
221
|
+
text += (groups[i] ?? 0).toString(16);
|
|
222
|
+
}
|
|
223
|
+
if (zeroRun !== void 0 && zeroRun.start + zeroRun.length === 8) text += ":";
|
|
224
|
+
return bits === 128 ? text : `${text}/${bits}`;
|
|
225
|
+
}
|
|
226
|
+
function longestZeroRun(groups) {
|
|
227
|
+
let best;
|
|
228
|
+
let current;
|
|
229
|
+
for (const [i, group] of groups.entries()) {
|
|
230
|
+
if (group === 0) {
|
|
231
|
+
current = current === void 0 ? {
|
|
232
|
+
start: i,
|
|
233
|
+
length: 1
|
|
234
|
+
} : {
|
|
235
|
+
...current,
|
|
236
|
+
length: current.length + 1
|
|
237
|
+
};
|
|
238
|
+
continue;
|
|
239
|
+
}
|
|
240
|
+
if (current !== void 0 && (best === void 0 || current.length > best.length)) best = current;
|
|
241
|
+
current = void 0;
|
|
242
|
+
}
|
|
243
|
+
if (current !== void 0 && (best === void 0 || current.length > best.length)) best = current;
|
|
244
|
+
return best !== void 0 && best.length >= 2 ? best : void 0;
|
|
245
|
+
}
|
|
7
246
|
/**
|
|
8
247
|
* 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.
|
|
9
248
|
*/
|
|
@@ -170,6 +409,8 @@ const pgInt8NumberDecodeJson = (json) => Number(decodeJsonIntegerText("pg/int8nu
|
|
|
170
409
|
* typecheck against the emitted column type.
|
|
171
410
|
*/
|
|
172
411
|
const decimalTextBigintLiteral = (value) => typeof value === "string" && DECIMAL_INTEGER.test(value) ? `${value}n` : void 0;
|
|
412
|
+
/** Renders a float's stored number as a number literal. NaN and the infinities are stored as text and have no literal type, so they render nothing and the value set types as `number`. */
|
|
413
|
+
const floatNumberLiteral = (value) => typeof value === "number" ? String(value) : void 0;
|
|
173
414
|
/** Renders the decimal text of `pg/int8number@1`, whose application type is `number`, as a number literal. */
|
|
174
415
|
const decimalTextNumberLiteral = (value) => typeof value === "string" && DECIMAL_INTEGER.test(value) ? value : void 0;
|
|
175
416
|
const pgNumericRenderOutputType = (typeParams) => {
|
|
@@ -362,6 +603,6 @@ const pgJsonDecode = (wire) => typeof wire === "string" ? parseJsonWire(wire) :
|
|
|
362
603
|
const pgJsonbEncode = (value) => JSON.stringify(value);
|
|
363
604
|
const pgJsonbDecode = (wire) => typeof wire === "string" ? parseJsonWire(wire) : wire;
|
|
364
605
|
//#endregion
|
|
365
|
-
export {
|
|
606
|
+
export { pgJsonbEncode as A, pgIntervalDecode as C, pgJsonDecode as D, pgIntervalToIso as E, renderPrecision as F, pgNumericRenderOutputType as M, pgUnboundedIntDecode as N, pgJsonEncode as O, renderLength as P, pgIntervalCanonical as S, pgIntervalEncodeJson as T, pgInt8Decode as _, decimalTextBigintLiteral as a, pgInt8NumberEncode as b, fitsFloat4 as c, pgBigintEncodeJson as d, pgByteaCanonical as f, pgFloatEncode as g, pgByteaEncodeJson as h, canonicalUuid as i, pgNumericDecode as j, pgJsonbDecode as k, floatNumberLiteral as l, pgByteaDecodeWire as m, FLOAT4_MAX as n, decimalTextNumberLiteral as o, pgByteaDecodeJson as p, canonicalInet as r, fitsCharacterLength as s, CANONICAL_UUID as t, pgBigintEncode as u, pgInt8NumberDecode as v, pgIntervalDecodeJson as w, pgInt8NumberEncodeJson as x, pgInt8NumberDecodeJson as y };
|
|
366
607
|
|
|
367
|
-
//# sourceMappingURL=codec-helpers-
|
|
608
|
+
//# sourceMappingURL=codec-helpers-D0ah5Wb8-wdJJZ_8s.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-helpers-D0ah5Wb8-wdJJZ_8s.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/codec-helpers-D0ah5Wb8.mjs"],"sourcesContent":["import { s as postgresError } from \"./errors-DYyzTYzE.mjs\";\nimport { numeralText } from \"@internal/sql-contract/data-type\";\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\";\n//#region src/core/canonical-inet.ts\nconst DIGIT = /^[0-9]$/;\nconst HEX_DIGIT = /^[0-9a-fA-F]$/;\nconst isDigit = (ch) => ch !== void 0 && DIGIT.test(ch);\n/**\n* Text PostgreSQL reads as an `inet` value, written the way PostgreSQL prints it: an IPv4 address in\n* four decimal octets, an IPv6 address in lower-case hex with its longest run of zero groups written\n* `::`, and the prefix length only when it is shorter than the whole address. `undefined` for text\n* PostgreSQL does not read as an `inet` value.\n*/\nfunction canonicalInet(text) {\n\tif (text.includes(\":\")) {\n\t\tconst value = readIpv6(text);\n\t\treturn value === void 0 ? void 0 : printIpv6(value);\n\t}\n\tconst value = readIpv4(text);\n\treturn value === void 0 ? void 0 : printIpv4(value);\n}\n/**\n* PostgreSQL's `inet_net_pton_ipv4`: one to four decimal octets, each up to 255 and leading zeros\n* allowed, then an optional `/` and prefix length up to 32. Without a prefix length all four octets\n* are required; with one, the octets written must cover it.\n*/\nfunction readIpv4(text) {\n\tconst octets = [];\n\tlet index = 0;\n\tlet ch = text[index++];\n\twhile (isDigit(ch)) {\n\t\tlet octet = 0;\n\t\tdo {\n\t\t\toctet = octet * 10 + Number(ch);\n\t\t\tif (octet > 255) return void 0;\n\t\t\tch = text[index++];\n\t\t} while (isDigit(ch));\n\t\tif (octets.length === 4) return void 0;\n\t\toctets.push(octet);\n\t\tif (ch === void 0 || ch === \"/\") break;\n\t\tif (ch !== \".\") return void 0;\n\t\tch = text[index++];\n\t}\n\tlet bits = -1;\n\tif (ch === \"/\" && isDigit(text[index]) && octets.length > 0) {\n\t\tch = text[index++];\n\t\tbits = 0;\n\t\tdo {\n\t\t\tbits = bits * 10 + Number(ch);\n\t\t\tch = text[index++];\n\t\t} while (isDigit(ch));\n\t\tif (ch !== void 0 || bits > 32) return void 0;\n\t}\n\tif (ch !== void 0) return void 0;\n\tif (bits === -1) {\n\t\tif (octets.length !== 4) return void 0;\n\t\tbits = 32;\n\t}\n\tif (octets.length === 0 || Math.floor(bits / 8) > octets.length) return void 0;\n\treturn {\n\t\tbytes: [\n\t\t\t...octets,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0\n\t\t].slice(0, 4),\n\t\tbits\n\t};\n}\n/** PostgreSQL's `getbits`: a prefix length up to 128, with no leading zero. */\nfunction readBits(text) {\n\tlet bits = 0;\n\tlet digits = 0;\n\tfor (const ch of text) {\n\t\tif (!isDigit(ch)) return void 0;\n\t\tif (digits++ !== 0 && bits === 0) return void 0;\n\t\tbits = bits * 10 + Number(ch);\n\t\tif (bits > 128) return void 0;\n\t}\n\treturn digits === 0 ? void 0 : bits;\n}\n/**\n* PostgreSQL's `getv4`, for the IPv4 tail of an IPv6 address: up to four decimal octets with no\n* leading zeros, and an optional prefix length. Octets left out are zero.\n*/\nfunction readIpv4Tail(text) {\n\tconst octets = [];\n\tlet octet = 0;\n\tlet digits = 0;\n\tfor (const [index, ch] of [...text].entries()) {\n\t\tif (isDigit(ch)) {\n\t\t\tif (digits++ !== 0 && octet === 0) return void 0;\n\t\t\toctet = octet * 10 + Number(ch);\n\t\t\tif (octet > 255) return void 0;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch !== \".\" && ch !== \"/\") return void 0;\n\t\tif (octets.length > 3) return void 0;\n\t\toctets.push(octet);\n\t\tif (ch === \"/\") {\n\t\t\tconst bits = readBits(text.slice(index + 1));\n\t\t\treturn bits === void 0 ? void 0 : {\n\t\t\t\toctets,\n\t\t\t\tbits\n\t\t\t};\n\t\t}\n\t\toctet = 0;\n\t\tdigits = 0;\n\t}\n\tif (digits === 0 || octets.length > 3) return void 0;\n\treturn {\n\t\toctets: [...octets, octet],\n\t\tbits: void 0\n\t};\n}\n/**\n* PostgreSQL's `inet_cidr_pton_ipv6`: up to eight groups of one to four hex digits in either case,\n* one `::` standing for a run of zero groups, an optional IPv4 tail, and an optional prefix length.\n*/\nfunction readIpv6(text) {\n\tconst bytes = new Array(16).fill(0);\n\tlet filled = 0;\n\tlet compressedAt;\n\tlet index = 0;\n\tif (text[0] === \":\") {\n\t\tif (text[1] !== \":\") return void 0;\n\t\tindex = 1;\n\t}\n\tlet tokenStart = index;\n\tlet sawHexDigit = false;\n\tlet group = 0;\n\tlet groupDigits = 0;\n\tlet bits = 128;\n\twhile (index < text.length) {\n\t\tconst ch = text[index++] ?? \"\";\n\t\tif (HEX_DIGIT.test(ch)) {\n\t\t\tgroup = group << 4 | Number.parseInt(ch, 16);\n\t\t\tif (++groupDigits > 4) return void 0;\n\t\t\tsawHexDigit = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === \":\") {\n\t\t\ttokenStart = index;\n\t\t\tif (!sawHexDigit) {\n\t\t\t\tif (compressedAt !== void 0) return void 0;\n\t\t\t\tcompressedAt = filled;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (index >= text.length || filled + 2 > 16) return void 0;\n\t\t\tbytes[filled++] = group >> 8;\n\t\t\tbytes[filled++] = group & 255;\n\t\t\tsawHexDigit = false;\n\t\t\tgroup = 0;\n\t\t\tgroupDigits = 0;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === \".\" && filled + 4 <= 16) {\n\t\t\tconst tail = readIpv4Tail(text.slice(tokenStart));\n\t\t\tif (tail !== void 0) {\n\t\t\t\ttail.octets.forEach((octet, offset) => {\n\t\t\t\t\tbytes[filled + offset] = octet;\n\t\t\t\t});\n\t\t\t\tfilled += 4;\n\t\t\t\tsawHexDigit = false;\n\t\t\t\tbits = tail.bits ?? bits;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (ch === \"/\") {\n\t\t\tconst prefix = readBits(text.slice(index));\n\t\t\tif (prefix !== void 0) {\n\t\t\t\tbits = prefix;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}\n\tif (sawHexDigit) {\n\t\tif (filled + 2 > 16) return void 0;\n\t\tbytes[filled++] = group >> 8;\n\t\tbytes[filled++] = group & 255;\n\t}\n\tif (compressedAt !== void 0) {\n\t\tif (filled === 16) return void 0;\n\t\tconst shifted = bytes.slice(compressedAt, filled);\n\t\tbytes.fill(0, compressedAt, filled);\n\t\tbytes.splice(16 - shifted.length, shifted.length, ...shifted);\n\t\tfilled = 16;\n\t}\n\treturn filled === 16 ? {\n\t\tbytes,\n\t\tbits\n\t} : void 0;\n}\nfunction printIpv4({ bytes, bits }) {\n\tconst address = bytes.join(\".\");\n\treturn bits === 32 ? address : `${address}/${bits}`;\n}\n/**\n* PostgreSQL's `inet_net_ntop_ipv6`: the first longest run of two or more zero groups is written\n* `::`, and an address whose first five groups are zero followed by `ffff`, or whose first six are\n* zero, ends in dotted IPv4.\n*/\nfunction printIpv6({ bytes, bits }) {\n\tconst groups = Array.from({ length: 8 }, (_, i) => (bytes[2 * i] ?? 0) << 8 | (bytes[2 * i + 1] ?? 0));\n\tconst zeroRun = longestZeroRun(groups);\n\tlet text = \"\";\n\tfor (let i = 0; i < 8; i++) {\n\t\tif (zeroRun !== void 0 && i >= zeroRun.start && i < zeroRun.start + zeroRun.length) {\n\t\t\tif (i === zeroRun.start) text += \":\";\n\t\t\tcontinue;\n\t\t}\n\t\tif (i !== 0) text += \":\";\n\t\tif (i === 6 && zeroRun?.start === 0 && (zeroRun.length === 6 || zeroRun.length === 5 && groups[5] === 65535)) {\n\t\t\ttext += bytes.slice(12).join(\".\");\n\t\t\tbreak;\n\t\t}\n\t\ttext += (groups[i] ?? 0).toString(16);\n\t}\n\tif (zeroRun !== void 0 && zeroRun.start + zeroRun.length === 8) text += \":\";\n\treturn bits === 128 ? text : `${text}/${bits}`;\n}\nfunction longestZeroRun(groups) {\n\tlet best;\n\tlet current;\n\tfor (const [i, group] of groups.entries()) {\n\t\tif (group === 0) {\n\t\t\tcurrent = current === void 0 ? {\n\t\t\t\tstart: i,\n\t\t\t\tlength: 1\n\t\t\t} : {\n\t\t\t\t...current,\n\t\t\t\tlength: current.length + 1\n\t\t\t};\n\t\t\tcontinue;\n\t\t}\n\t\tif (current !== void 0 && (best === void 0 || current.length > best.length)) best = current;\n\t\tcurrent = void 0;\n\t}\n\tif (current !== void 0 && (best === void 0 || current.length > best.length)) best = current;\n\treturn best !== void 0 && best.length >= 2 ? best : void 0;\n}\n//#endregion\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}\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\ttypeName,\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\ttypeName,\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 a float's stored number as a number literal. NaN and the infinities are stored as text and have no literal type, so they render nothing and the value set types as `number`. */\nconst floatNumberLiteral = (value) => typeof value === \"number\" ? String(value) : 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\ttypeName: \"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\ttypeName: \"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 + microsFromFraction(fraction, sign === \"-\");\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\"));\nconst intervalTextFields = (text) => {\n\tif (ISO_DURATION.test(text)) return intervalFieldsOf(text);\n\tconst fields = postgresIntervalFields(text);\n\tif (fields === void 0) throw postgresError(\"RUNTIME.DECODE_FAILED\", `pg/interval@1 value must be an ISO-8601 duration or PostgreSQL interval text, got ${text}`, { meta: {\n\t\tcodecId: \"pg/interval@1\",\n\t\treceived: text\n\t} });\n\treturn fields;\n};\nconst pgIntervalDecode = (wire) => {\n\tif (typeof wire === \"string\") return intervalTextFields(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})*$/;\nconst BYTEA_FORMS = String.raw`Write base64, as in \"aGVsbG8=\", or PostgreSQL hex, written \"\\\\x68656c6c6f\" in a PSL string.`;\nfunction byteaRefused(message) {\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", message, {\n\t\twhy: \"pg/bytea stores its bytes as base64 (ADR 254), and reads base64 and the hex text PostgreSQL prints.\",\n\t\tfix: BYTEA_FORMS\n\t});\n}\n/**\n* The canonical form of `pg/bytea` (ADR 254), the base64 its codec writes, from base64 or the hex\n* text PostgreSQL prints under `bytea_output = 'hex'`.\n*/\nfunction pgByteaCanonical(text) {\n\tif (text.startsWith(\"\\\\x\")) {\n\t\tif (!BYTEA_TEXT.test(text)) byteaRefused(`${JSON.stringify(text)} is not PostgreSQL hex, which has two hexadecimal digits for each byte. ${BYTEA_FORMS}`);\n\t\treturn Buffer.from(text.slice(2), \"hex\").toString(\"base64\");\n\t}\n\tif (!BASE64_TEXT.test(text)) byteaRefused(`pg/bytea cannot read ${JSON.stringify(text)}. Write base64 with its padding, as in \"aGVsbG8=\", or PostgreSQL hex, written \"\\\\\\\\x68656c6c6f\" in a PSL string.`);\n\treturn Buffer.from(text, \"base64\").toString(\"base64\");\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 { pgNumericDecode as A, pgIntervalDecodeJson as C, pgJsonEncode as D, pgJsonDecode as E, canonicalInet as F, pgUnboundedIntDecode as M, renderLength as N, pgJsonbDecode as O, renderPrecision as P, pgIntervalDecode as S, pgIntervalToIso as T, pgInt8NumberDecode as _, decimalTextNumberLiteral as a, pgInt8NumberEncodeJson as b, floatNumberLiteral as c, pgByteaCanonical as d, pgByteaDecodeJson as f, pgInt8Decode as g, pgFloatEncode as h, decimalTextBigintLiteral as i, pgNumericRenderOutputType as j, pgJsonbEncode as k, pgBigintEncode as l, pgByteaEncodeJson as m, FLOAT4_MAX as n, fitsCharacterLength as o, pgByteaDecodeWire as p, canonicalUuid as r, fitsFloat4 as s, CANONICAL_UUID as t, pgBigintEncodeJson as u, pgInt8NumberDecodeJson as v, pgIntervalEncodeJson as w, pgIntervalCanonical as x, pgInt8NumberEncode as y };\n\n//# sourceMappingURL=codec-helpers-D0ah5Wb8.mjs.map"],"mappings":";;;;;;AAMA,MAAM,QAAQ;AACd,MAAM,YAAY;AAClB,MAAM,WAAW,OAAO,OAAO,KAAK,KAAK,MAAM,KAAK,EAAE;;;;;;;AAOtD,SAAS,cAAc,MAAM;CAC5B,IAAI,KAAK,SAAS,GAAG,GAAG;EACvB,MAAM,QAAQ,SAAS,IAAI;EAC3B,OAAO,UAAU,KAAK,IAAI,KAAK,IAAI,UAAU,KAAK;CACnD;CACA,MAAM,QAAQ,SAAS,IAAI;CAC3B,OAAO,UAAU,KAAK,IAAI,KAAK,IAAI,UAAU,KAAK;AACnD;;;;;;AAMA,SAAS,SAAS,MAAM;CACvB,MAAM,SAAS,CAAC;CAChB,IAAI,QAAQ;CACZ,IAAI,KAAK,KAAK;CACd,OAAO,QAAQ,EAAE,GAAG;EACnB,IAAI,QAAQ;EACZ,GAAG;GACF,QAAQ,QAAQ,KAAK,OAAO,EAAE;GAC9B,IAAI,QAAQ,KAAK,OAAO,KAAK;GAC7B,KAAK,KAAK;EACX,SAAS,QAAQ,EAAE;EACnB,IAAI,OAAO,WAAW,GAAG,OAAO,KAAK;EACrC,OAAO,KAAK,KAAK;EACjB,IAAI,OAAO,KAAK,KAAK,OAAO,KAAK;EACjC,IAAI,OAAO,KAAK,OAAO,KAAK;EAC5B,KAAK,KAAK;CACX;CACA,IAAI,OAAO;CACX,IAAI,OAAO,OAAO,QAAQ,KAAK,MAAM,KAAK,OAAO,SAAS,GAAG;EAC5D,KAAK,KAAK;EACV,OAAO;EACP,GAAG;GACF,OAAO,OAAO,KAAK,OAAO,EAAE;GAC5B,KAAK,KAAK;EACX,SAAS,QAAQ,EAAE;EACnB,IAAI,OAAO,KAAK,KAAK,OAAO,IAAI,OAAO,KAAK;CAC7C;CACA,IAA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AwB,KAAK,UAAU,IAAI,EAAE,iHAAiH;CACxM,OAAO,OAAO,KAAK,MAAM,QAAQ,CAAC,CAAC,SAAS,QAAQ;AACrD;AACA,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"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { n as buildPostgresCodecDescriptorRegistry } from "./codec-descriptor-
|
|
2
|
-
import { t as createPostgresBuiltinDataTypeLookup } from "./data-types-
|
|
3
|
-
import { r as codecDescriptors } from "./codecs-
|
|
1
|
+
import { n as buildPostgresCodecDescriptorRegistry } from "./codec-descriptor-C5Ec_6Mw-CpacG1CL.mjs";
|
|
2
|
+
import { t as createPostgresBuiltinDataTypeLookup } from "./data-types-DRkmmE9S-C5Q9oH4Q.mjs";
|
|
3
|
+
import { r as codecDescriptors } from "./codecs-BK3J4C0n-B8EnUXZf.mjs";
|
|
4
4
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
5
5
|
import { extractCodecLookup } from "@prisma/orm-framework/components/control";
|
|
6
6
|
import { buildCodecDescriptorRegistry } from "@prisma/orm-family-sql/relational-core/codec-descriptor-registry";
|
|
7
|
-
//#region ../../../3-targets/3-targets/postgres/dist/codec-registry-
|
|
7
|
+
//#region ../../../3-targets/3-targets/postgres/dist/codec-registry-CKBDkxX7.mjs
|
|
8
8
|
/**
|
|
9
9
|
* Registry of every codec descriptor shipped by `@internal/target-postgres`.
|
|
10
10
|
*
|
|
@@ -58,4 +58,4 @@ function createPostgresBuiltinCodecLookup() {
|
|
|
58
58
|
//#endregion
|
|
59
59
|
export { postgresCodecDescriptorRegistry as a, createPostgresCodecRegistryWithBuiltins as i, assemblePostgresCodecRegistryWithBuiltins as n, postgresCodecRegistry as o, createPostgresBuiltinCodecLookup as r, assemblePostgresCodecRegistry as t };
|
|
60
60
|
|
|
61
|
-
//# sourceMappingURL=codec-registry-
|
|
61
|
+
//# sourceMappingURL=codec-registry-CKBDkxX7-Kw84Or3s.mjs.map
|
package/dist/{codec-registry-nSGjxm-H-BeUu5zV2.mjs.map → codec-registry-CKBDkxX7-Kw84Or3s.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec-registry-
|
|
1
|
+
{"version":3,"file":"codec-registry-CKBDkxX7-Kw84Or3s.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/codec-registry-CKBDkxX7.mjs"],"sourcesContent":["import { t as createPostgresBuiltinDataTypeLookup } from \"./data-types-DRkmmE9S.mjs\";\nimport { n as buildPostgresCodecDescriptorRegistry } from \"./codec-descriptor-C5Ec_6Mw.mjs\";\nimport { t as codecDescriptors } from \"./codecs-BK3J4C0n.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { extractCodecLookup } from \"@internal/framework-components/control\";\nimport { buildCodecDescriptorRegistry } from \"@internal/sql-relational-core/codec-descriptor-registry\";\n//#region src/core/registry.ts\n/**\n* Registry of every codec descriptor shipped by `@internal/target-postgres`.\n*\n* Public consumer surface for the postgres codec set: the postgres adapter and any other consumer that needs to enumerate or look up a postgres codec by id consumes this rather than the raw descriptor array. See ADR 208.\n*/\nconst postgresCodecRegistry = buildCodecDescriptorRegistry(codecDescriptors);\nconst postgresCodecDescriptorRegistry = buildPostgresCodecDescriptorRegistry(codecDescriptors);\n//#endregion\n//#region src/core/codec-registry.ts\n/**\n* A registry of `descriptors`, refusing a codec whose data type `dataTypeLookup` does not have: the\n* SQL renderer writes a parameter's cast from the data type its codec represents.\n*/\nfunction buildPostgresCodecRegistry(descriptors, dataTypeLookup) {\n\tconst descriptorRegistry = buildPostgresCodecDescriptorRegistry(descriptors);\n\tconst validatedDescriptors = Array.from(descriptorRegistry.values());\n\tfor (const descriptor of validatedDescriptors) if (!dataTypeLookup.has(descriptor.dataType)) throw structuredError(\"CONTRACT.DATA_TYPE_UNREGISTERED\", `Codec \"${descriptor.codecId}\" represents data type \"${descriptor.dataType}\", which no component registers.`, {\n\t\twhy: \"A parameter of this codec is written with a cast named by its data type.\",\n\t\tfix: \"Pass the data type beside the codec: in `dataTypes` of createPostgresAdapter, or in the `dataTypes` of the extension that contributes the codec.\",\n\t\tmeta: {\n\t\t\tcodecId: descriptor.codecId,\n\t\t\tdataType: descriptor.dataType\n\t\t}\n\t});\n\tconst registry = {\n\t\t...extractCodecLookup([{\n\t\t\tid: \"postgres-codecs\",\n\t\t\ttypes: { codecTypes: { codecDescriptors: validatedDescriptors } }\n\t\t}]),\n\t\tdescriptorFor: (codecId) => descriptorRegistry.descriptorFor(codecId),\n\t\tvalues: () => descriptorRegistry.values()\n\t};\n\treturn Object.freeze(registry);\n}\nfunction assemblePostgresCodecRegistry(components, dataTypeLookup) {\n\treturn buildPostgresCodecRegistry(components.flatMap((component) => component.types?.codecTypes?.codecDescriptors ?? []), dataTypeLookup);\n}\nfunction assemblePostgresCodecRegistryWithBuiltins(extensions, dataTypeLookup) {\n\treturn buildPostgresCodecRegistry([...postgresCodecDescriptorRegistry.values(), ...extensions.flatMap((extension) => extension.types?.codecTypes?.codecDescriptors ?? [])], dataTypeLookup);\n}\n/** A registry of the built-in codecs and `codecDescriptors`, whose data types `dataTypeLookup` has. */\nfunction createPostgresCodecRegistryWithBuiltins(codecDescriptors = [], dataTypeLookup = createPostgresBuiltinDataTypeLookup()) {\n\treturn buildPostgresCodecRegistry([...postgresCodecDescriptorRegistry.values(), ...codecDescriptors], dataTypeLookup);\n}\n/**\n* Build a coherent PostgreSQL codec registry populated with built-in descriptors only.\n*\n* The returned registry supports both ordinary codec materialization and PostgreSQL target behavior. Stack-composed paths build the same combined registry from their complete ordered descriptor contributions.\n*/\nfunction createPostgresBuiltinCodecLookup() {\n\treturn createPostgresCodecRegistryWithBuiltins();\n}\n//#endregion\nexport { postgresCodecDescriptorRegistry as a, createPostgresCodecRegistryWithBuiltins as i, assemblePostgresCodecRegistryWithBuiltins as n, postgresCodecRegistry as o, createPostgresBuiltinCodecLookup as r, assemblePostgresCodecRegistry as t };\n\n//# sourceMappingURL=codec-registry-CKBDkxX7.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,MAAM,wBAAwB,6BAA6B,gBAAgB;AAC3E,MAAM,kCAAkC,qCAAqC,gBAAgB;;;;;AAO7F,SAAS,2BAA2B,aAAa,gBAAgB;CAChE,MAAM,qBAAqB,qCAAqC,WAAW;CAC3E,MAAM,uBAAuB,MAAM,KAAK,mBAAmB,OAAO,CAAC;CACnE,KAAK,MAAM,cAAc,sBAAsB,IAAI,CAAC,eAAe,IAAI,WAAW,QAAQ,GAAG,MAAM,gBAAgB,mCAAmC,UAAU,WAAW,QAAQ,0BAA0B,WAAW,SAAS,mCAAmC;EACnQ,KAAK;EACL,KAAK;EACL,MAAM;GACL,SAAS,WAAW;GACpB,UAAU,WAAW;EACtB;CACD,CAAC;CACD,MAAM,WAAW;EAChB,GAAG,mBAAmB,CAAC;GACtB,IAAI;GACJ,OAAO,EAAE,YAAY,EAAE,kBAAkB,qBAAqB,EAAE;EACjE,CAAC,CAAC;EACF,gBAAgB,YAAY,mBAAmB,cAAc,OAAO;EACpE,cAAc,mBAAmB,OAAO;CACzC;CACA,OAAO,OAAO,OAAO,QAAQ;AAC9B;AACA,SAAS,8BAA8B,YAAY,gBAAgB;CAClE,OAAO,2BAA2B,WAAW,SAAS,cAAc,UAAU,OAAO,YAAY,oBAAoB,CAAC,CAAC,GAAG,cAAc;AACzI;AACA,SAAS,0CAA0C,YAAY,gBAAgB;CAC9E,OAAO,2BAA2B,CAAC,GAAG,gCAAgC,OAAO,GAAG,GAAG,WAAW,SAAS,cAAc,UAAU,OAAO,YAAY,oBAAoB,CAAC,CAAC,CAAC,GAAG,cAAc;AAC3L;;AAEA,SAAS,wCAAwC,mBAAmB,CAAC,GAAG,iBAAiB,oCAAoC,GAAG;CAC/H,OAAO,2BAA2B,CAAC,GAAG,gCAAgC,OAAO,GAAG,GAAG,gBAAgB,GAAG,cAAc;AACrH;;;;;;AAMA,SAAS,mCAAmC;CAC3C,OAAO,wCAAwC;AAChD"}
|
package/dist/{codec-type-map-DftCqvHU-BYkGKRZI.d.mts → codec-type-map-DueQFJ3a-DKLtMn3R.d.mts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as AdaptedPostgresCodecDescriptor } from "./codec-descriptor-DkeVTJ3N-XTfZgDGp.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-
|
|
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-y1gOMMt--DKWhYGN5.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-DueQFJ3a.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-DueQFJ3a-DKLtMn3R.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec-type-map-
|
|
1
|
+
{"version":3,"file":"codec-type-map-DueQFJ3a-DKLtMn3R.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/codec-type-map-DueQFJ3a.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-y1gOMMt--DKWhYGN5.mjs";
|
|
2
|
+
import { n as Resolve, t as ExtractedCodecTypes } from "./codec-type-map-DueQFJ3a-DKLtMn3R.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-CYsrudBM.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-CYsrudBM-DcYPKpS1.d.mts.map
|
package/dist/{codec-types-CHtW4cn_-ryYZXjOb.d.mts.map → codec-types-CYsrudBM-DcYPKpS1.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec-types-
|
|
1
|
+
{"version":3,"file":"codec-types-CYsrudBM-DcYPKpS1.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/codec-types-CYsrudBM.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"}
|