@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as PostgresContract } from "./postgres-schema-Xsjt3RKO-Buv2X8ai.mjs";
|
|
2
|
-
import { c as PostgresLoweredStatement, s as PostgresAdapterOptions } from "./types-D6lgKhE5-
|
|
3
|
-
import { t as PostgresCodecRegistry } from "./codecs-
|
|
2
|
+
import { c as PostgresLoweredStatement, s as PostgresAdapterOptions } from "./types-D6lgKhE5-DYkeCAjr.mjs";
|
|
3
|
+
import { t as PostgresCodecRegistry } from "./codecs-ChjCJY5k.mjs";
|
|
4
4
|
import { g as PostgresDdlNode } from "./nodes-C1fPapnK-j0AK7Gcj.mjs";
|
|
5
5
|
import "./ddl-B-WjvCal.mjs";
|
|
6
6
|
import { Adapter, AdapterProfile, AnyQueryAst, LowererContext } from "@prisma/orm-family-sql/relational-core/ast";
|
|
@@ -55,4 +55,4 @@ declare const postgresAdapterCapabilities: Readonly<{
|
|
|
55
55
|
}>;
|
|
56
56
|
//#endregion
|
|
57
57
|
export { postgresAdapterCapabilities as n, postgresRawCodecInferer as r, createPostgresAdapter as t };
|
|
58
|
-
//# sourceMappingURL=adapter-
|
|
58
|
+
//# sourceMappingURL=adapter-BXHPMNAg.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-
|
|
1
|
+
{"version":3,"file":"adapter-BXHPMNAg.d.mts","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/adapter.d.mts"],"mappings":";;;;;;;;;;cAOc,+BAA+B,QAAQ,aAAa,kBAAkB;WACzE;WACA;WACA,SAAS;mBACD;mBACA;EACjB,YAAY,eAAe,uBAAuB,gBAAgB,gBAAgB;EAClF,MAAM,KAAK,cAAc,iBAAiB,SAAS,eAAe,oBAAoB;;;;;;;cAO1E,yBAAyB;iBACtB,sBAAsB,UAAU,yBAAyB,SAAS;;;cAGrE,6BAA6B;WAChC;aACE;aACA;aACA;aACA;aACA;aACA;aACA;aACA;;WAEF;aACE;aACA;aACA;aACA;aACA;aACA;aACA;aACA;aACA;aACA;aACA;aACA;aACA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { R as postgresDataTypes } from "./data-types-
|
|
2
|
-
import { i as createPostgresCodecRegistryWithBuiltins } from "./codec-registry-
|
|
3
|
-
import { n as renderLoweredSql, t as adapterError } from "./sql-renderer-DT4IEOVi-
|
|
4
|
-
import { n as postgresAdapterCapabilities, t as PostgresControlAdapter } from "./control-adapter-Co30P4lH-
|
|
1
|
+
import { R as postgresDataTypes } from "./data-types-DRkmmE9S-C5Q9oH4Q.mjs";
|
|
2
|
+
import { i as createPostgresCodecRegistryWithBuiltins } from "./codec-registry-CKBDkxX7-Kw84Or3s.mjs";
|
|
3
|
+
import { n as renderLoweredSql, t as adapterError } from "./sql-renderer-DT4IEOVi-CBE8uTub.mjs";
|
|
4
|
+
import { n as postgresAdapterCapabilities, t as PostgresControlAdapter } from "./control-adapter-Co30P4lH-CpxXk5cz.mjs";
|
|
5
5
|
import { isDdlNode } from "@prisma/orm-family-sql/relational-core/ast";
|
|
6
6
|
import { assembleDataTypes } from "@prisma/orm-framework/components/codec";
|
|
7
7
|
import { APP_SPACE_ID } from "@prisma/orm-framework/components/control";
|
|
@@ -86,4 +86,4 @@ function createPostgresAdapterWithCodecRegistry(codecRegistry, dataTypeLookup) {
|
|
|
86
86
|
//#endregion
|
|
87
87
|
export { createPostgresAdapterWithCodecRegistry as n, postgresRawCodecInferer as r, createPostgresAdapter as t };
|
|
88
88
|
|
|
89
|
-
//# sourceMappingURL=adapter-RtS8vD8U-
|
|
89
|
+
//# sourceMappingURL=adapter-RtS8vD8U-CkJSaICZ.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-RtS8vD8U-
|
|
1
|
+
{"version":3,"file":"adapter-RtS8vD8U-CkJSaICZ.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/adapter-RtS8vD8U.mjs"],"sourcesContent":["import { n as adapterError, t as renderLoweredSql } from \"./sql-renderer-DT4IEOVi.mjs\";\nimport { n as postgresAdapterCapabilities, t as PostgresControlAdapter } from \"./control-adapter-Co30P4lH.mjs\";\nimport { assembleDataTypes } from \"@internal/framework-components/codec\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { isDdlNode } from \"@internal/sql-relational-core/ast\";\nimport { createPostgresCodecRegistryWithBuiltins } from \"@internal/target-postgres/codecs\";\nimport { postgresDataTypes } from \"@internal/target-postgres/data-types\";\n//#region src/core/adapter.ts\nvar PostgresAdapterImpl = class {\n\tfamilyId = \"sql\";\n\ttargetId = \"postgres\";\n\tprofile;\n\tcodecRegistry;\n\tdataTypeLookup;\n\tconstructor(codecRegistry, dataTypeLookup, profileId) {\n\t\tthis.codecRegistry = codecRegistry;\n\t\tthis.dataTypeLookup = dataTypeLookup;\n\t\tconst controlAdapter = new PostgresControlAdapter(codecRegistry, dataTypeLookup);\n\t\tthis.profile = Object.freeze({\n\t\t\tid: profileId ?? \"postgres/default@1\",\n\t\t\ttarget: \"postgres\",\n\t\t\tcapabilities: postgresAdapterCapabilities,\n\t\t\treadMarker: (queryable) => controlAdapter.readMarkerDiscriminated({\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tquery: async (sql, params) => {\n\t\t\t\t\tconst rows = [];\n\t\t\t\t\tfor await (const row of queryable.query({\n\t\t\t\t\t\tsql,\n\t\t\t\t\t\t...params === void 0 ? {} : { params }\n\t\t\t\t\t})) rows.push(row);\n\t\t\t\t\treturn { rows };\n\t\t\t\t},\n\t\t\t\tclose: async () => {}\n\t\t\t}, APP_SPACE_ID)\n\t\t});\n\t}\n\tlower(ast, context) {\n\t\tif (isDdlNode(ast)) throw adapterError(\"RUNTIME.DDL_UNSUPPORTED\", \"lower() does not lower DDL on the runtime adapter — DDL lowering is a control-plane concern handled by the control adapter.\", { meta: { surface: \"runtime-adapter\" } });\n\t\treturn renderLoweredSql(ast, context.contract, this.codecRegistry, this.dataTypeLookup, postgresAdapterCapabilities);\n\t}\n};\nconst INT4_MIN = -2147483648;\nconst INT4_MAX = 2147483647;\n/**\n* The codec a bare JS number is bound through.\n*\n* An integer picks the narrowest column type that holds it: `int4` while it\n* fits the signed 32-bit range, `int8` (number-valued) up to the safe-integer\n* limit. Past that limit a JS number is no longer an exact integer, so it\n* binds as `float8` rather than pretending to a precision it does not have.\n*/\nfunction inferNumberCodecId(value) {\n\tif (!Number.isSafeInteger(value)) return \"pg/float8@1\";\n\treturn value >= INT4_MIN && value <= INT4_MAX ? \"pg/int4@1\" : \"pg/int8number@1\";\n}\n/**\n* Codec-id lookup for bare-literal interpolations used by `fns.raw` on a postgres client. Contributed as the descriptor's static `rawCodecInferer` slot.\n*\n* The ids are versioned because that is how the codec registry keys them: lowering resolves an interpolated value's codec by exact id through `descriptorFor`.\n*/\nconst postgresRawCodecInferer = { inferCodec(value) {\n\tswitch (typeof value) {\n\t\tcase \"number\": return inferNumberCodecId(value);\n\t\tcase \"bigint\": return \"pg/int8@1\";\n\t\tcase \"string\": return \"pg/text@1\";\n\t\tcase \"boolean\": return \"pg/bool@1\";\n\t\tcase \"object\": if (value instanceof Uint8Array) return \"pg/bytea@1\";\n\t}\n\tthrow adapterError(\"RUNTIME.RAW_SQL_UNSUPPORTED_INTERPOLATION\", \"unsupported JS value type for raw-SQL interpolation: wrap this value in `param(...)` with an explicit codec\", { meta: { valueType: typeof value } });\n} };\nfunction createPostgresAdapter(options) {\n\tconst dataTypeLookup = assembleDataTypes([{\n\t\tid: \"postgres\",\n\t\tdataTypes: postgresDataTypes\n\t}, {\n\t\tid: \"createPostgresAdapter\",\n\t\tdataTypes: options?.dataTypes ?? []\n\t}]).lookup;\n\tconst codecRegistry = createPostgresCodecRegistryWithBuiltins(options?.codecDescriptors, dataTypeLookup);\n\treturn Object.freeze(new PostgresAdapterImpl(codecRegistry, dataTypeLookup, options?.profileId));\n}\nfunction createPostgresAdapterWithCodecRegistry(codecRegistry, dataTypeLookup) {\n\treturn Object.freeze(new PostgresAdapterImpl(codecRegistry, dataTypeLookup));\n}\n//#endregion\nexport { createPostgresAdapterWithCodecRegistry as n, postgresRawCodecInferer as r, createPostgresAdapter as t };\n\n//# sourceMappingURL=adapter-RtS8vD8U.mjs.map"],"mappings":";;;;;;;;AAQA,IAAI,sBAAsB,MAAM;CAC/B,WAAW;CACX,WAAW;CACX;CACA;CACA;CACA,YAAY,eAAe,gBAAgB,WAAW;EACrD,KAAK,gBAAgB;EACrB,KAAK,iBAAiB;EACtB,MAAM,iBAAiB,IAAI,uBAAuB,eAAe,cAAc;EAC/E,KAAK,UAAU,OAAO,OAAO;GAC5B,IAAI,aAAa;GACjB,QAAQ;GACR,cAAc;GACd,aAAa,cAAc,eAAe,wBAAwB;IACjE,UAAU;IACV,UAAU;IACV,OAAO,OAAO,KAAK,WAAW;KAC7B,MAAM,OAAO,CAAC;KACd,WAAW,MAAM,OAAO,UAAU,MAAM;MACvC;MACA,GAAG,WAAW,KAAK,IAAI,CAAC,IAAI,EAAE,OAAO;KACtC,CAAC,GAAG,KAAK,KAAK,GAAG;KACjB,OAAO,EAAE,KAAK;IACf;IACA,OAAO,YAAY,CAAC;GACrB,GAAG,YAAY;EAChB,CAAC;CACF;CACA,MAAM,KAAK,SAAS;EACnB,IAAI,UAAU,GAAG,GAAG,MAAM,aAAa,2BAA2B,+HAA+H,EAAE,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAC;EACzO,OAAO,iBAAiB,KAAK,QAAQ,UAAU,KAAK,eAAe,KAAK,gBAAgB,2BAA2B;CACpH;AACD;AACA,MAAM,WAAW;AACjB,MAAM,WAAW;;;;;;;;;AASjB,SAAS,mBAAmB,OAAO;CAClC,IAAI,CAAC,OAAO,cAAc,KAAK,GAAG,OAAO;CACzC,OAAO,SAAS,YAAY,SAAS,WAAW,cAAc;AAC/D;;;;;;AAMA,MAAM,0BAA0B,EAAE,WAAW,OAAO;CACnD,QAAQ,OAAO,OAAf;EACC,KAAK,UAAU,OAAO,mBAAmB,KAAK;EAC9C,KAAK,UAAU,OAAO;EACtB,KAAK,UAAU,OAAO;EACtB,KAAK,WAAW,OAAO;EACvB,KAAK,UAAU,IAAI,iBAAiB,YAAY,OAAO;CACxD;CACA,MAAM,aAAa,6CAA6C,+GAA+G,EAAE,MAAM,EAAE,WAAW,OAAO,MAAM,EAAE,CAAC;AACrN,EAAE;AACF,SAAS,sBAAsB,SAAS;CACvC,MAAM,iBAAiB,kBAAkB,CAAC;EACzC,IAAI;EACJ,WAAW;CACZ,GAAG;EACF,IAAI;EACJ,WAAW,SAAS,aAAa,CAAC;CACnC,CAAC,CAAC,CAAC,CAAC;CACJ,MAAM,gBAAgB,wCAAwC,SAAS,kBAAkB,cAAc;CACvG,OAAO,OAAO,OAAO,IAAI,oBAAoB,eAAe,gBAAgB,SAAS,SAAS,CAAC;AAChG;AACA,SAAS,uCAAuC,eAAe,gBAAgB;CAC9E,OAAO,OAAO,OAAO,IAAI,oBAAoB,eAAe,cAAc,CAAC;AAC5E"}
|
package/dist/adapter.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as PostgresContract } from "./postgres-schema-Xsjt3RKO-Buv2X8ai.mjs";
|
|
2
|
-
import { a as OrderClause, c as PostgresLoweredStatement, d as StorageTable, i as Expr, l as SelectAst, n as ColumnRef, o as ParamRef, r as Direction, s as PostgresAdapterOptions, t as BinaryExpr, u as StorageColumn } from "./types-D6lgKhE5-
|
|
3
|
-
import { a as createPostgresCodecRegistryWithBuiltins, i as createPostgresBuiltinCodecLookup, t as PostgresCodecRegistry } from "./codecs-
|
|
4
|
-
import { n as postgresAdapterCapabilities, r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-
|
|
2
|
+
import { a as OrderClause, c as PostgresLoweredStatement, d as StorageTable, i as Expr, l as SelectAst, n as ColumnRef, o as ParamRef, r as Direction, s as PostgresAdapterOptions, t as BinaryExpr, u as StorageColumn } from "./types-D6lgKhE5-DYkeCAjr.mjs";
|
|
3
|
+
import { a as createPostgresCodecRegistryWithBuiltins, i as createPostgresBuiltinCodecLookup, t as PostgresCodecRegistry } from "./codecs-ChjCJY5k.mjs";
|
|
4
|
+
import { n as postgresAdapterCapabilities, r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-BXHPMNAg.mjs";
|
|
5
5
|
import { C as timestamptzTemporalColumn, E as varcharColumn, S as timestamptzStringColumn, T as varbitColumn, _ as timeStringColumn, a as dateStringColumn, b as timestampTemporalColumn, c as float8Column, d as int8Column, f as intervalColumn, g as textColumn, h as numericColumn, i as charColumn, l as int2Column, m as jsonbColumn, n as boolColumn, o as dateTemporalColumn, p as jsonColumn, r as byteaColumn, s as float4Column, t as bitColumn, u as int4Column, v as timeTemporalColumn, w as timetzColumn, x as timestamptzJsDateColumn, y as timestampStringColumn } from "./column-types-Dq7mC_dL.mjs";
|
|
6
6
|
import { t as parsePostgresDefault } from "./default-normalizer-ZZ7Y5boE.mjs";
|
|
7
7
|
import { i as normalizeSchemaNativeType } from "./native-type-normalizer-BFo5tSyh.mjs";
|
|
8
8
|
import { i as quoteIdentifier, r as qualifyName, t as escapeLiteral } from "./sql-utils-DqFxskY6.mjs";
|
|
9
|
-
import { t as PostgresControlAdapter } from "./control-
|
|
10
|
-
import { t as SqlRuntimeAdapter } from "./runtime-
|
|
11
|
-
import { t as renderLoweredSql } from "./sql-renderer-
|
|
12
|
-
import "./types-
|
|
9
|
+
import { t as PostgresControlAdapter } from "./control-D2JNE1Tz.mjs";
|
|
10
|
+
import { t as SqlRuntimeAdapter } from "./runtime-CNTEAZIz.mjs";
|
|
11
|
+
import { t as renderLoweredSql } from "./sql-renderer-hQ3HTY-B.mjs";
|
|
12
|
+
import "./types-Dnrjripb.mjs";
|
|
13
13
|
export { type BinaryExpr, type ColumnRef, type Direction, type Expr, type OrderClause, type ParamRef, type PostgresAdapterOptions, type PostgresCodecRegistry, type PostgresContract, PostgresControlAdapter, type PostgresLoweredStatement, type SelectAst, SqlRuntimeAdapter, type StorageColumn, type StorageTable, bitColumn, boolColumn, byteaColumn, charColumn, createPostgresAdapter, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, dateStringColumn, dateTemporalColumn, escapeLiteral, float4Column, float8Column, int2Column, int4Column, int8Column, intervalColumn, jsonColumn, jsonbColumn, normalizeSchemaNativeType, numericColumn, parsePostgresDefault, postgresAdapterCapabilities, postgresRawCodecInferer, qualifyName, quoteIdentifier, renderLoweredSql, textColumn, timeStringColumn, timeTemporalColumn, timestampStringColumn, timestampTemporalColumn, timestamptzJsDateColumn, timestamptzStringColumn, timestamptzTemporalColumn, timetzColumn, varbitColumn, varcharColumn };
|
package/dist/adapter.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as qualifyName, r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-CVsvXiX4-C7xD0Bgv.mjs";
|
|
2
|
-
import { i as createPostgresCodecRegistryWithBuiltins, r as createPostgresBuiltinCodecLookup } from "./codec-registry-
|
|
3
|
-
import { t as parsePostgresDefault } from "./default-normalizer-
|
|
2
|
+
import { i as createPostgresCodecRegistryWithBuiltins, r as createPostgresBuiltinCodecLookup } from "./codec-registry-CKBDkxX7-Kw84Or3s.mjs";
|
|
3
|
+
import { t as parsePostgresDefault } from "./default-normalizer-Bf_Fhv4v-CugGfLAe.mjs";
|
|
4
4
|
import { n as normalizeSchemaNativeType } from "./native-type-normalizer-CwyVR7xB.mjs";
|
|
5
|
-
import { n as renderLoweredSql } from "./sql-renderer-DT4IEOVi-
|
|
6
|
-
import { n as postgresAdapterCapabilities, t as PostgresControlAdapter } from "./control-adapter-Co30P4lH-
|
|
7
|
-
import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-RtS8vD8U-
|
|
5
|
+
import { n as renderLoweredSql } from "./sql-renderer-DT4IEOVi-CBE8uTub.mjs";
|
|
6
|
+
import { n as postgresAdapterCapabilities, t as PostgresControlAdapter } from "./control-adapter-Co30P4lH-CpxXk5cz.mjs";
|
|
7
|
+
import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-RtS8vD8U-CkJSaICZ.mjs";
|
|
8
8
|
import { C as timestamptzTemporalColumn, E as varcharColumn, S as timestamptzStringColumn, T as varbitColumn, _ as timeStringColumn, a as dateStringColumn, b as timestampTemporalColumn, c as float8Column, d as int8Column, f as intervalColumn, g as textColumn, h as numericColumn, i as charColumn, l as int2Column, m as jsonbColumn, n as boolColumn, o as dateTemporalColumn, p as jsonColumn, r as byteaColumn, s as float4Column, t as bitColumn, u as int4Column, v as timeTemporalColumn, w as timetzColumn, x as timestamptzJsDateColumn, y as timestampStringColumn } from "./column-types-Bbc3IVA7.mjs";
|
|
9
9
|
export { PostgresControlAdapter, bitColumn, boolColumn, byteaColumn, charColumn, createPostgresAdapter, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, dateStringColumn, dateTemporalColumn, escapeLiteral, float4Column, float8Column, int2Column, int4Column, int8Column, intervalColumn, jsonColumn, jsonbColumn, normalizeSchemaNativeType, numericColumn, parsePostgresDefault, postgresAdapterCapabilities, postgresRawCodecInferer, qualifyName, quoteIdentifier, renderLoweredSql, textColumn, timeStringColumn, timeTemporalColumn, timestampStringColumn, timestampTemporalColumn, timestamptzJsDateColumn, timestamptzStringColumn, timestamptzTemporalColumn, timetzColumn, varbitColumn, varcharColumn };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as postgresAdapterCapabilities, r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-
|
|
1
|
+
import { n as postgresAdapterCapabilities, r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-BXHPMNAg.mjs";
|
|
2
2
|
export { createPostgresAdapter, postgresAdapterCapabilities, postgresRawCodecInferer };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as postgresAdapterCapabilities } from "./control-adapter-Co30P4lH-
|
|
2
|
-
import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-RtS8vD8U-
|
|
1
|
+
import { n as postgresAdapterCapabilities } from "./control-adapter-Co30P4lH-CpxXk5cz.mjs";
|
|
2
|
+
import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-RtS8vD8U-CkJSaICZ.mjs";
|
|
3
3
|
export { createPostgresAdapter, postgresAdapterCapabilities, postgresRawCodecInferer };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as createPostgresCodecRegistryWithBuiltins, i as createPostgresBuiltinCodecLookup } from "./codecs-
|
|
1
|
+
import { a as createPostgresCodecRegistryWithBuiltins, i as createPostgresBuiltinCodecLookup } from "./codecs-ChjCJY5k.mjs";
|
|
2
2
|
import { t as parsePostgresDefault } from "./default-normalizer-ZZ7Y5boE.mjs";
|
|
3
3
|
import { i as normalizeSchemaNativeType } from "./native-type-normalizer-BFo5tSyh.mjs";
|
|
4
4
|
import { i as quoteIdentifier, r as qualifyName, t as escapeLiteral } from "./sql-utils-DqFxskY6.mjs";
|
|
5
|
-
import { n as postgresAdapterDescriptor, t as PostgresControlAdapter } from "./control-
|
|
5
|
+
import { n as postgresAdapterDescriptor, t as PostgresControlAdapter } from "./control-D2JNE1Tz.mjs";
|
|
6
6
|
export { PostgresControlAdapter, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, postgresAdapterDescriptor as default, escapeLiteral, normalizeSchemaNativeType, parsePostgresDefault, qualifyName, quoteIdentifier };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { n as qualifyName, r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-CVsvXiX4-C7xD0Bgv.mjs";
|
|
2
|
-
import { i as createPostgresCodecRegistryWithBuiltins, r as createPostgresBuiltinCodecLookup, t as assemblePostgresCodecRegistry } from "./codec-registry-
|
|
3
|
-
import { a as instantNowControlDescriptor, s as plainDateTimeNowControlDescriptor } from "./authoring-
|
|
4
|
-
import { t as parsePostgresDefault } from "./default-normalizer-
|
|
5
|
-
import { n as postgresPslTypeConstructors } from "./control-
|
|
2
|
+
import { i as createPostgresCodecRegistryWithBuiltins, r as createPostgresBuiltinCodecLookup, t as assemblePostgresCodecRegistry } from "./codec-registry-CKBDkxX7-Kw84Or3s.mjs";
|
|
3
|
+
import { a as instantNowControlDescriptor, s as plainDateTimeNowControlDescriptor } from "./authoring-_2G2lsLt-VmVbrMPn.mjs";
|
|
4
|
+
import { t as parsePostgresDefault } from "./default-normalizer-Bf_Fhv4v-CugGfLAe.mjs";
|
|
5
|
+
import { n as postgresPslTypeConstructors } from "./control-Ltn8Dzpi.mjs";
|
|
6
6
|
import { n as normalizeSchemaNativeType } from "./native-type-normalizer-CwyVR7xB.mjs";
|
|
7
|
-
import { t as PostgresControlAdapter } from "./control-adapter-Co30P4lH-
|
|
8
|
-
import { t as postgresAdapterDescriptorMeta } from "./descriptor-meta-ARufwwWW-
|
|
7
|
+
import { t as PostgresControlAdapter } from "./control-adapter-Co30P4lH-CpxXk5cz.mjs";
|
|
8
|
+
import { t as postgresAdapterDescriptorMeta } from "./descriptor-meta-ARufwwWW-ChZm5Hg5.mjs";
|
|
9
9
|
import { timestampNowControlDescriptor } from "@prisma/orm-framework/components/control";
|
|
10
10
|
import { int, num, oneOf, optional } from "@prisma/orm-framework/psl-parser";
|
|
11
11
|
import { builtinGeneratorRegistryMetadata } from "@prisma/orm-framework/ids";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as postgresRuntimeAdapterDescriptor, t as SqlRuntimeAdapter } from "./runtime-
|
|
1
|
+
import { n as postgresRuntimeAdapterDescriptor, t as SqlRuntimeAdapter } from "./runtime-CNTEAZIz.mjs";
|
|
2
2
|
export { SqlRuntimeAdapter, postgresRuntimeAdapterDescriptor as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { o as postgresCodecRegistry, t as assemblePostgresCodecRegistry } from "./codec-registry-
|
|
2
|
-
import { i as instantNow, n as PLAIN_DATE_TIME_NOW_GENERATOR_ID, o as plainDateTimeNow, t as INSTANT_NOW_GENERATOR_ID } from "./authoring-
|
|
3
|
-
import { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from "./adapter-RtS8vD8U-
|
|
4
|
-
import { t as postgresAdapterDescriptorMeta } from "./descriptor-meta-ARufwwWW-
|
|
1
|
+
import { o as postgresCodecRegistry, t as assemblePostgresCodecRegistry } from "./codec-registry-CKBDkxX7-Kw84Or3s.mjs";
|
|
2
|
+
import { i as instantNow, n as PLAIN_DATE_TIME_NOW_GENERATOR_ID, o as plainDateTimeNow, t as INSTANT_NOW_GENERATOR_ID } from "./authoring-_2G2lsLt-VmVbrMPn.mjs";
|
|
3
|
+
import { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from "./adapter-RtS8vD8U-CkJSaICZ.mjs";
|
|
4
|
+
import { t as postgresAdapterDescriptorMeta } from "./descriptor-meta-ARufwwWW-ChZm5Hg5.mjs";
|
|
5
5
|
import { assembleDataTypes } from "@prisma/orm-framework/components/codec";
|
|
6
6
|
import { builtinGeneratorIds } from "@prisma/orm-framework/ids";
|
|
7
7
|
import { timestampNowRuntimeGenerator } from "@prisma/orm-family-sql/family/runtime";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as renderLoweredSql } from "./sql-renderer-
|
|
1
|
+
import { t as renderLoweredSql } from "./sql-renderer-hQ3HTY-B.mjs";
|
|
2
2
|
export { renderLoweredSql };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as renderLoweredSql } from "./sql-renderer-DT4IEOVi-
|
|
1
|
+
import { n as renderLoweredSql } from "./sql-renderer-DT4IEOVi-CBE8uTub.mjs";
|
|
2
2
|
export { renderLoweredSql };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as PostgresContract } from "./postgres-schema-Xsjt3RKO-Buv2X8ai.mjs";
|
|
2
|
-
import { a as OrderClause, c as PostgresLoweredStatement, d as StorageTable, i as Expr, l as SelectAst, n as ColumnRef, o as ParamRef, r as Direction, s as PostgresAdapterOptions, t as BinaryExpr, u as StorageColumn } from "./types-D6lgKhE5-
|
|
3
|
-
import { t as PostgresCodecRegistry } from "./codecs-
|
|
4
|
-
import "./types-
|
|
2
|
+
import { a as OrderClause, c as PostgresLoweredStatement, d as StorageTable, i as Expr, l as SelectAst, n as ColumnRef, o as ParamRef, r as Direction, s as PostgresAdapterOptions, t as BinaryExpr, u as StorageColumn } from "./types-D6lgKhE5-DYkeCAjr.mjs";
|
|
3
|
+
import { t as PostgresCodecRegistry } from "./codecs-ChjCJY5k.mjs";
|
|
4
|
+
import "./types-Dnrjripb.mjs";
|
|
5
5
|
export type { BinaryExpr, ColumnRef, Direction, Expr, OrderClause, ParamRef, PostgresAdapterOptions, PostgresCodecRegistry, PostgresContract, PostgresLoweredStatement, SelectAst, StorageColumn, StorageTable };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { C as PG_TIMESTAMPTZ_DATE_CODEC_ID, D as PG_TIMESTAMP_TEMPORAL_CODEC_ID, E as PG_TIMESTAMP_STRING_CODEC_ID, T as PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, s as PG_ENUM_CODEC_ID, w as PG_TIMESTAMPTZ_STRING_CODEC_ID } from "./codec-ids-Cb0yO-IS--e0P2rfI.mjs";
|
|
2
2
|
import { s as postgresError } from "./errors-DYyzTYzE-39CV_aMo.mjs";
|
|
3
3
|
import { t as PostgresNativeEnum } from "./postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs";
|
|
4
|
-
import { j as requireTemporal } from "./codecs-
|
|
5
|
-
import { a as PostgresRlsPolicySchema, i as PostgresRlsPolicy, n as PostgresRlsEnablement, o as PostgresRole, r as PostgresRlsEnablementSchema, s as PostgresRoleSchema, t as PostgresNativeEnumSchema } from "./postgres-schema-
|
|
6
|
-
import { n as renderFullTextIndexExpression, t as isFullTextIndexableCodec } from "./full-text-index-expression-
|
|
4
|
+
import { j as requireTemporal } from "./codecs-BK3J4C0n-B8EnUXZf.mjs";
|
|
5
|
+
import { a as PostgresRlsPolicySchema, i as PostgresRlsPolicy, n as PostgresRlsEnablement, o as PostgresRole, r as PostgresRlsEnablementSchema, s as PostgresRoleSchema, t as PostgresNativeEnumSchema } from "./postgres-schema-COkaqci7-C6JpiSha.mjs";
|
|
6
|
+
import { n as renderFullTextIndexExpression, t as isFullTextIndexableCodec } from "./full-text-index-expression-Bfp_xWhy-DtbLdkzv.mjs";
|
|
7
7
|
import { n as computeContentHash } from "./canonicalize-CrN3u_xM-D4MrOqcB.mjs";
|
|
8
8
|
import { n as POSTGRES_TEXT_SEARCH_LANGUAGES } from "./text-search-languages-RO0HiUDm-CeJ7P8gS.mjs";
|
|
9
9
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
@@ -15,7 +15,7 @@ import { temporalCodecPresetWithPrecision, temporalStringAuthoringPresets } from
|
|
|
15
15
|
import { TIMESTAMP_NOW_GENERATOR_ID, temporalAuthoringPresets } from "@prisma/orm-framework/components/authoring";
|
|
16
16
|
import { blockAttribute, bool, entityRef, fieldRef, identifier, leafDiagnostic, list, mapBlock, modelAttribute, oneOf, optional, str, structBlock } from "@prisma/orm-framework/psl-parser";
|
|
17
17
|
import { exactNameBodyWarning } from "@prisma/orm-family-sql/contract/index-naming";
|
|
18
|
-
//#region ../../../3-targets/3-targets/postgres/dist/authoring-
|
|
18
|
+
//#region ../../../3-targets/3-targets/postgres/dist/authoring-_2G2lsLt.mjs
|
|
19
19
|
const INSTANT_NOW_GENERATOR_ID = "instantNow";
|
|
20
20
|
function instantNowControlDescriptor() {
|
|
21
21
|
return {
|
|
@@ -794,4 +794,4 @@ function postgresLowerEntityHandles(input) {
|
|
|
794
794
|
//#endregion
|
|
795
795
|
export { instantNowControlDescriptor as a, postgresAuthoringEntityTypes as c, postgresAuthoringPslBlockDescriptors as d, postgresAuthoringTypes as f, instantNow as i, postgresAuthoringFieldPresets as l, postgresNowGeneratorIdFor as m, PLAIN_DATE_TIME_NOW_GENERATOR_ID as n, plainDateTimeNow as o, postgresLowerEntityHandles as p, POLICY_BLOCK_KEYWORDS as r, plainDateTimeNowControlDescriptor as s, INSTANT_NOW_GENERATOR_ID as t, postgresAuthoringModelAttributes as u };
|
|
796
796
|
|
|
797
|
-
//# sourceMappingURL=authoring-
|
|
797
|
+
//# sourceMappingURL=authoring-_2G2lsLt-VmVbrMPn.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring-vHbPLrW4-BsHR7gUE.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/authoring-vHbPLrW4.mjs"],"sourcesContent":["import { C as PG_TIMESTAMPTZ_DATE_CODEC_ID, D as PG_TIMESTAMP_TEMPORAL_CODEC_ID, E as PG_TIMESTAMP_STRING_CODEC_ID, T as PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, s as PG_ENUM_CODEC_ID, w as PG_TIMESTAMPTZ_STRING_CODEC_ID } from \"./codec-ids-Cb0yO-IS.mjs\";\nimport { s as postgresError } from \"./errors-DYyzTYzE.mjs\";\nimport { j as requireTemporal } from \"./codecs-DelwJv6h.mjs\";\nimport { t as PostgresNativeEnum } from \"./postgres-native-enum-CdP3b_-R.mjs\";\nimport { n as renderFullTextIndexExpression, t as isFullTextIndexableCodec } from \"./full-text-index-expression-BpUM2Td6.mjs\";\nimport { _ as PostgresRlsPolicy, d as PostgresNativeEnumSchema, f as PostgresRlsEnablementSchema, h as PostgresRole, m as PostgresRoleSchema, p as PostgresRlsPolicySchema, v as PostgresRlsEnablement } from \"./postgres-schema-AlEVkXXS.mjs\";\nimport { n as computeContentHash } from \"./canonicalize-CrN3u_xM.mjs\";\nimport { n as POSTGRES_TEXT_SEARCH_LANGUAGES } from \"./text-search-languages-RO0HiUDm.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { temporalCodecPresetWithPrecision, temporalStringAuthoringPresets } from \"@internal/family-sql/control\";\nimport { TIMESTAMP_NOW_GENERATOR_ID, temporalAuthoringPresets } from \"@internal/framework-components/authoring\";\nimport { blockAttribute, bool, entityRef, fieldRef, identifier, leafDiagnostic, list, mapBlock, modelAttribute, oneOf, optional, str, structBlock } from \"@internal/psl-parser\";\nimport { exactNameBodyWarning } from \"@internal/sql-contract/index-naming\";\nimport { assertWireNamePrefixLength, normalizeSqlBody } from \"@internal/sql-schema-ir/naming\";\nimport { assertDefined, invariant } from \"@internal/utils/assertions\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/core/instant-now-generator.ts\nconst INSTANT_NOW_GENERATOR_ID = \"instantNow\";\nfunction instantNowControlDescriptor() {\n\treturn {\n\t\tid: INSTANT_NOW_GENERATOR_ID,\n\t\tbuildPhases: () => ({\n\t\t\tonCreate: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid: INSTANT_NOW_GENERATOR_ID\n\t\t\t},\n\t\t\tonUpdate: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid: INSTANT_NOW_GENERATOR_ID\n\t\t\t}\n\t\t})\n\t};\n}\nfunction instantNow() {\n\treturn requireTemporal({ generatorId: INSTANT_NOW_GENERATOR_ID }).Now.instant();\n}\n//#endregion\n//#region src/core/plain-date-time-now-generator.ts\n/**\n* The \"now\" generator for `timestamp` (without time zone) columns: the current\n* moment as a UTC wall-clock `Temporal.PlainDateTime`, the representation\n* `pg/timestamp-temporal@1` encodes. `timestamptz` columns use `instantNow`.\n*/\nconst PLAIN_DATE_TIME_NOW_GENERATOR_ID = \"plainDateTimeNow\";\nfunction plainDateTimeNowControlDescriptor() {\n\treturn {\n\t\tid: PLAIN_DATE_TIME_NOW_GENERATOR_ID,\n\t\tbuildPhases: () => ({\n\t\t\tonCreate: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid: PLAIN_DATE_TIME_NOW_GENERATOR_ID\n\t\t\t},\n\t\t\tonUpdate: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid: PLAIN_DATE_TIME_NOW_GENERATOR_ID\n\t\t\t}\n\t\t})\n\t};\n}\nfunction plainDateTimeNow() {\n\treturn requireTemporal({ generatorId: PLAIN_DATE_TIME_NOW_GENERATOR_ID }).Now.plainDateTimeISO(\"UTC\");\n}\n//#endregion\n//#region src/core/now-generators.ts\n/** The \"now\" generator for each codec that has one. The `temporal` field presets read it. */\nconst postgresNowGeneratorIds = {\n\t[PG_TIMESTAMP_TEMPORAL_CODEC_ID]: PLAIN_DATE_TIME_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]: INSTANT_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_DATE_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMP_STRING_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_STRING_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID\n};\nconst nowGeneratorIdByCodecId = new Map(Object.entries(postgresNowGeneratorIds));\nfunction postgresNowGeneratorIdFor(codecId) {\n\treturn nowGeneratorIdByCodecId.get(codecId);\n}\n//#endregion\n//#region src/core/authoring.ts\nconst PSL_POLICY_INVALID_MAP = \"PSL_POLICY_INVALID_MAP\";\nconst PSL_FULL_TEXT_INDEX_ONE_FIELD = \"PSL_FULL_TEXT_INDEX_ONE_FIELD\";\nconst PSL_FULL_TEXT_INDEX_REQUIRES_NAME = \"PSL_FULL_TEXT_INDEX_REQUIRES_NAME\";\nconst PSL_FULL_TEXT_INDEX_NAME_XOR_MAP = \"PSL_FULL_TEXT_INDEX_NAME_XOR_MAP\";\nconst PSL_FULL_TEXT_INDEX_TEXT_FIELD = \"PSL_FULL_TEXT_INDEX_TEXT_FIELD\";\nconst PSL_NATIVE_ENUM_DUPLICATE_MEMBER_VALUE = \"PSL_NATIVE_ENUM_DUPLICATE_MEMBER_VALUE\";\nconst PSL_NATIVE_ENUM_MISSING_MEMBERS = \"PSL_NATIVE_ENUM_MISSING_MEMBERS\";\nconst PSL_ROLE_BLOCK_OUTSIDE_UNBOUND_NAMESPACE = \"PSL_ROLE_BLOCK_OUTSIDE_UNBOUND_NAMESPACE\";\n/**\n* `pg.enum(<ref>)` registers as an ordinary type constructor whose sole\n* positional argument names a `native_enum` entity instead of carrying a\n* literal value. The interpreter resolves the ref to the `native_enum`\n* entity generically (driven by `entityRefArg`); the `pg/enum@1` codec\n* descriptor's `columnFromEntity` hook (see `codecs.ts`) converts that\n* entity into the column's `typeParams`. The column's type name comes from the\n* `pg/enum` data type, which renders `typeParams.typeName`.\n*/\nconst postgresAuthoringTypes = {\n\tBigIntNumber: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A PostgreSQL 64-bit integer represented as a JavaScript number within its safe integer range.\",\n\t\toutput: { codecId: \"pg/int8number@1\" }\n\t},\n\tUnboundedInt: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An arbitrary-precision integer stored as PostgreSQL numeric and represented as bigint.\",\n\t\toutput: { codecId: \"pg/unboundedint@1\" }\n\t},\n\tpg: { enum: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tentityRefArg: {\n\t\t\tindex: 0,\n\t\t\tentityKind: \"native_enum\"\n\t\t},\n\t\toutput: { codecId: PG_ENUM_CODEC_ID }\n\t} }\n};\nconst policyTargetParam = {\n\ttype: entityRef({ kind: \"model\" }),\n\tdocumentation: \"The model protected by this policy; it must declare @@rls.\"\n};\nconst policyRolesParam = {\n\ttype: optional(list(oneOf(entityRef({\n\t\tkind: \"block\",\n\t\tkeyword: \"role\"\n\t}), identifier()))),\n\tdocumentation: \"The database roles to which this policy applies.\"\n};\nconst policyUsingParam = {\n\ttype: optional(str()),\n\tdocumentation: \"A SQL predicate controlling which rows this policy permits.\"\n};\nconst policyWithCheckParam = {\n\ttype: optional(str()),\n\tdocumentation: \"A SQL predicate checking rows being written by this policy.\"\n};\nconst policyPermissiveParam = {\n\ttype: optional(bool()),\n\tdocumentation: \"Whether the policy is permissive (combined with OR) rather than restrictive (combined with AND).\"\n};\nfunction policyUsingOnlySpec() {\n\treturn structBlock({ parameters: {\n\t\ttarget: policyTargetParam,\n\t\troles: policyRolesParam,\n\t\tusing: policyUsingParam,\n\t\tpermissive: policyPermissiveParam\n\t} });\n}\nfunction policyWithCheckOnlySpec() {\n\treturn structBlock({ parameters: {\n\t\ttarget: policyTargetParam,\n\t\troles: policyRolesParam,\n\t\twithCheck: policyWithCheckParam,\n\t\tpermissive: policyPermissiveParam\n\t} });\n}\nfunction policyBothPredicatesSpec() {\n\treturn structBlock({ parameters: {\n\t\ttarget: policyTargetParam,\n\t\troles: policyRolesParam,\n\t\tusing: policyUsingParam,\n\t\twithCheck: policyWithCheckParam,\n\t\tpermissive: policyPermissiveParam\n\t} });\n}\nfunction roleSpec() {\n\treturn structBlock({ parameters: {} });\n}\nfunction nativeEnumSpec() {\n\treturn mapBlock({ value: {\n\t\ttype: str(),\n\t\tdocumentation: \"The member value stored in the database enum type.\"\n\t} });\n}\n/**\n* The block keyword that authors each row-level security operation. The keyword is the operation, so\n* a policy block has no `operation` parameter. The reader looks a block's operation up here, and\n* `contract infer` and `contract print` look up the keyword to write.\n*/\nconst POLICY_BLOCK_KEYWORDS = {\n\tselect: \"policy_select\",\n\tinsert: \"policy_insert\",\n\tupdate: \"policy_update\",\n\tdelete: \"policy_delete\",\n\tall: \"policy_all\"\n};\nfunction isRlsPolicyOperation(value) {\n\treturn Object.hasOwn(POLICY_BLOCK_KEYWORDS, value);\n}\n/** The operation a `policy_<operation>` block keyword authors, or `undefined` for another keyword. */\nfunction policyOperationOfKeyword(keyword) {\n\treturn Object.keys(POLICY_BLOCK_KEYWORDS).filter(isRlsPolicyOperation).find((operation) => POLICY_BLOCK_KEYWORDS[operation] === keyword);\n}\n/**\n* Assembles a {@link PostgresRlsPolicy} from lowered inputs: normalizes the\n* predicates, computes the content-hash wire name, and constructs the frozen\n* entity. The single hash-assembly body shared by the PSL block lowering\n* ({@link lowerRlsPolicyFromBlock}) and the TS entity-handle lowering\n* ({@link postgresLowerEntityHandles}) so the two surfaces cannot drift.\n*/\nfunction buildRlsPolicyEntity(input) {\n\tconst permissive = input.permissive ?? true;\n\tconst wireHash = computeContentHash({\n\t\t...ifDefined(\"using\", input.using !== void 0 ? normalizeSqlBody(input.using) : void 0),\n\t\t...ifDefined(\"withCheck\", input.withCheck !== void 0 ? normalizeSqlBody(input.withCheck) : void 0),\n\t\troles: input.roles,\n\t\toperation: input.operation,\n\t\tpermissive\n\t});\n\treturn new PostgresRlsPolicy({\n\t\tnaming: {\n\t\t\tkind: \"wire\",\n\t\t\tprefix: input.prefix,\n\t\t\thash: wireHash\n\t\t},\n\t\ttableName: input.tableName,\n\t\tnamespaceId: input.namespaceId,\n\t\toperation: input.operation,\n\t\troles: input.roles,\n\t\tusing: input.using,\n\t\twithCheck: input.withCheck,\n\t\tpermissive\n\t});\n}\nfunction lowerRlsPolicyFromBlock(block, ctx) {\n\tconst prefix = block.name;\n\tconst operation = policyOperationOfKeyword(block.keyword) ?? \"select\";\n\tconst target = block.resolvedModelRefs?.[\"target\"];\n\tassertDefined(target, `lowerRlsPolicyFromBlock: policy \"${block.name}\" reached the factory without a projected \\`target\\` coordinate; the interpreter projects checked model references before invoking entity factories.`);\n\tconst roles = block.values.roles === void 0 ? [] : block.values.roles.map((role) => typeof role === \"string\" ? role : role.declaration.name).sort();\n\tconst using = block.values.using;\n\tconst withCheck = block.values.withCheck;\n\tconst permissive = block.values.permissive ?? true;\n\tconst mapAttr = block.attributes[\"map\"];\n\tif (mapAttr !== void 0) {\n\t\tconst exactName = mapAttr.args[\"name\"];\n\t\tinvariant(typeof exactName === \"string\", \"@@map on a policy block parses one string argument\");\n\t\tctx.warnings?.push(exactNameBodyWarning(\"policy\", exactName));\n\t\treturn new PostgresRlsPolicy({\n\t\t\tnaming: {\n\t\t\t\tkind: \"exact\",\n\t\t\t\tname: exactName\n\t\t\t},\n\t\t\ttableName: target.tableName,\n\t\t\tnamespaceId: target.namespaceId,\n\t\t\toperation,\n\t\t\troles,\n\t\t\tusing,\n\t\t\twithCheck,\n\t\t\tpermissive\n\t\t});\n\t}\n\treturn buildRlsPolicyEntity({\n\t\tprefix,\n\t\ttableName: target.tableName,\n\t\tnamespaceId: target.namespaceId,\n\t\toperation,\n\t\troles,\n\t\t...ifDefined(\"using\", using),\n\t\t...ifDefined(\"withCheck\", withCheck),\n\t\tpermissive\n\t});\n}\nconst policyEntityTypeOutput = {\n\tfactory: lowerRlsPolicyFromBlock,\n\tpslPlacement: (entity) => ({ namespaceId: entity.namespaceId })\n};\nfunction lowerNativeEnumFromBlock(block, ctx) {\n\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\tconst diagnostics = ctx.diagnostics;\n\tconst mapAttr = block.attributes[\"map\"];\n\tlet typeName = block.name;\n\tif (mapAttr !== void 0) {\n\t\tconst mapped = mapAttr.args[\"name\"];\n\t\tinvariant(typeof mapped === \"string\", \"@@map on a native_enum block parses one string argument\");\n\t\ttypeName = mapped;\n\t}\n\tlet memberError = false;\n\tconst seenValues = /* @__PURE__ */ new Set();\n\tconst members = [];\n\tfor (const [memberName, value] of Object.entries(block.values)) {\n\t\tif (seenValues.has(value)) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: PSL_NATIVE_ENUM_DUPLICATE_MEMBER_VALUE,\n\t\t\t\tmessage: `native_enum \"${block.name}\": duplicate member value \"${value}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: block.parameterSpans[memberName] ?? block.span\n\t\t\t});\n\t\t\tmemberError = true;\n\t\t\tcontinue;\n\t\t}\n\t\tseenValues.add(value);\n\t\tmembers.push(value);\n\t}\n\tif (memberError) return void 0;\n\tif (members.length === 0) {\n\t\tdiagnostics?.push({\n\t\t\tcode: PSL_NATIVE_ENUM_MISSING_MEMBERS,\n\t\t\tmessage: `native_enum \"${block.name}\" must have at least one member`,\n\t\t\tsourceId,\n\t\t\tspan: block.span\n\t\t});\n\t\treturn;\n\t}\n\treturn new PostgresNativeEnum({\n\t\ttypeName,\n\t\tmembers\n\t});\n}\n/**\n* `native_enum`'s entity-type factory output, checked separately from the assembled\n* `postgresAuthoringEntityTypes` map below: `deriveValueSet` is SQL-family surface\n* ({@link SqlValueSetDerivingEntityTypeOutput}), not part of the framework\n* `AuthoringEntityTypeFactoryOutput` shape, so folding it directly into the map's single\n* `satisfies AuthoringEntityTypeNamespace` check would trip an excess-property error. Checking it\n* here against the intersection of both shapes keeps it structurally valid against each without\n* widening the map's own check.\n*/\nconst nativeEnumEntityTypeOutput = {\n\tfactory: lowerNativeEnumFromBlock,\n\tderiveValueSet: (entity) => ({\n\t\tkind: \"valueSet\",\n\t\tvalues: [...entity.members]\n\t})\n};\n/**\n* Lowers a `role <name> {}` block into a {@link PostgresRole}. Roles are\n* cluster-scoped in Postgres, so the block must be declared inside\n* `namespace unbound { … }` — any other lexical namespace (a named schema,\n* or the default bucket top-level declarations resolve to) is a load-time\n* diagnostic. The lowered entity carries the unbound coordinate.\n*/\nfunction lowerRoleFromBlock(block, ctx) {\n\tif (block.namespaceId !== UNBOUND_NAMESPACE_ID) {\n\t\tctx.diagnostics?.push({\n\t\t\tcode: PSL_ROLE_BLOCK_OUTSIDE_UNBOUND_NAMESPACE,\n\t\t\tmessage: `\\`role\\` block \"${block.name}\" must be declared inside \\`namespace unbound { }\\`, not in namespace \"${block.namespaceId}\"`,\n\t\t\tsourceId: ctx.sourceId ?? \"unknown\",\n\t\t\tspan: block.span\n\t\t});\n\t\treturn;\n\t}\n\treturn new PostgresRole({\n\t\tname: block.name,\n\t\tnamespaceId: UNBOUND_NAMESPACE_ID\n\t});\n}\nconst postgresAuthoringEntityTypes = {\n\trole: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"role\",\n\t\tvalidatorSchema: PostgresRoleSchema,\n\t\toutput: { factory: lowerRoleFromBlock }\n\t},\n\trls: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"rls\",\n\t\tvalidatorSchema: PostgresRlsEnablementSchema,\n\t\toutput: { factory: (input) => new PostgresRlsEnablement(input) }\n\t},\n\tpolicy: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"policy\",\n\t\tvalidatorSchema: PostgresRlsPolicySchema,\n\t\toutput: policyEntityTypeOutput\n\t},\n\tnative_enum: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"native_enum\",\n\t\tvalidatorSchema: PostgresNativeEnumSchema,\n\t\toutput: nativeEnumEntityTypeOutput\n\t}\n};\n/**\n* Field presets contributed by the Postgres target pack.\n*\n* These mirror the PSL scalar-to-codec mapping used by the Postgres adapter\n* (see `createPostgresPslScalarTypeDescriptors`), so that authoring a field\n* via the TS callback surface (e.g. `field.int()`) and via the PSL scalar\n* surface (e.g. `Int`) lowers to byte-identical contracts.\n*\n* The `uuidNative` / `id.uuidv4Native` / `id.uuidv7Native` presets use the\n* native Postgres `uuid` type (codecId `pg/uuid@1`). For cross-target\n* portability use `uuidString` / `id.uuidv4String` / `id.uuidv7String` from\n* the family pack instead.\n*/\nconst policyRequiresRls = {\n\tparameter: \"target\",\n\tattribute: \"rls\"\n};\nconst policyMapAttribute = blockAttribute(\"map\", {\n\tdocumentation: \"Maps this row-level security policy to its PostgreSQL policy name.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: str(),\n\t\tdocumentation: \"The nonempty PostgreSQL policy name.\"\n\t}],\n\trefine: (parsed, ctx, attributeNode) => parsed.name === \"\" ? [leafDiagnostic(ctx, attributeNode, \"@@map policy name must be a non-empty string\", PSL_POLICY_INVALID_MAP)] : []\n});\nconst policyBlockAttributes = { map: () => policyMapAttribute };\nconst nativeEnumMapAttribute = blockAttribute(\"map\", {\n\tdocumentation: \"Maps this native enum to its PostgreSQL type name.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: str(),\n\t\tdocumentation: \"The PostgreSQL enum type name.\"\n\t}]\n});\nconst postgresAuthoringPslBlockDescriptors = {\n\t[POLICY_BLOCK_KEYWORDS.select]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.select,\n\t\tdocumentation: \"Defines a row-level security policy controlling which rows can be selected.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tspec: policyUsingOnlySpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\t[POLICY_BLOCK_KEYWORDS.delete]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.delete,\n\t\tdocumentation: \"Defines a row-level security policy controlling which rows can be deleted.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tspec: policyUsingOnlySpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\t[POLICY_BLOCK_KEYWORDS.insert]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.insert,\n\t\tdocumentation: \"Defines a row-level security policy checking rows being inserted.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tspec: policyWithCheckOnlySpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\t[POLICY_BLOCK_KEYWORDS.update]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.update,\n\t\tdocumentation: \"Defines a row-level security policy controlling row visibility and checks for updates.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tspec: policyBothPredicatesSpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\t[POLICY_BLOCK_KEYWORDS.all]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.all,\n\t\tdocumentation: \"Defines a row-level security policy applying to all operations.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tspec: policyBothPredicatesSpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\tnative_enum: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: \"native_enum\",\n\t\tdocumentation: \"Defines a PostgreSQL enum type with named string-valued members.\",\n\t\tdiscriminator: \"native_enum\",\n\t\tname: { required: true },\n\t\tspec: nativeEnumSpec,\n\t\tattributes: { map: () => nativeEnumMapAttribute }\n\t},\n\t/**\n\t* PSL block descriptor for `role` (e.g. `role anon {}`). Name-only, no\n\t* parameters and no body content. Declared inside `namespace unbound { }`\n\t* — see {@link lowerRoleFromBlock} for the placement check and the\n\t* coordinate the lowered entity carries.\n\t*/\n\trole: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: \"role\",\n\t\tdocumentation: \"Declares an existing database role in namespace unbound for use in security policies.\",\n\t\tdiscriminator: \"role\",\n\t\tname: { required: true },\n\t\tspec: roleSpec\n\t}\n};\nconst postgresRlsSpec = modelAttribute(\"rls\", { documentation: \"Enables PostgreSQL row-level security on this model’s table.\" });\nconst postgresRlsSpecFactory = () => postgresRlsSpec;\nconst [firstLanguage, ...remainingLanguages] = POSTGRES_TEXT_SEARCH_LANGUAGES;\nconst postgresFullTextIndexSpec = modelAttribute(\"fullTextIndex\", {\n\tdocumentation: \"Indexes one text column for full-text search, rendering the expression `fullTextMatches`, `fullTextRank` and `fullTextHeadline` lower to.\",\n\tpositional: [{\n\t\tkey: \"fields\",\n\t\ttype: list(fieldRef(), {\n\t\t\tallowEmpty: false,\n\t\t\tunique: true\n\t\t}),\n\t\tdocumentation: \"The single field to index.\"\n\t}],\n\tnamed: {\n\t\tlanguage: {\n\t\t\ttype: optional(oneOf(str(firstLanguage), ...remainingLanguages.map((language) => str(language)))),\n\t\t\tdocumentation: \"The text-search configuration. Defaults to `english`, and must match the language the query operations are given.\"\n\t\t},\n\t\tname: {\n\t\t\ttype: optional(str()),\n\t\t\tdocumentation: \"The index name. Mutually exclusive with `map`.\"\n\t\t},\n\t\tmap: {\n\t\t\ttype: optional(str()),\n\t\t\tdocumentation: \"The database index name. Mutually exclusive with `name`.\"\n\t\t},\n\t\twhere: {\n\t\t\ttype: optional(str()),\n\t\t\tdocumentation: \"The SQL predicate restricting rows included in a partial index.\"\n\t\t}\n\t},\n\trefine: (value, ctx, attributeNode) => {\n\t\tconst diagnostics = [];\n\t\tif (value.fields.length !== 1) diagnostics.push(leafDiagnostic(ctx, attributeNode, \"The full-text operations work on one column; declare one `@@fullTextIndex` per column\", PSL_FULL_TEXT_INDEX_ONE_FIELD));\n\t\tif (value.name === void 0 && value.map === void 0) diagnostics.push(leafDiagnostic(ctx, attributeNode, \"`@@fullTextIndex` requires a `name` or `map` argument (a default name cannot be derived from an expression)\", PSL_FULL_TEXT_INDEX_REQUIRES_NAME));\n\t\tif (value.name !== void 0 && value.map !== void 0) diagnostics.push(leafDiagnostic(ctx, attributeNode, \"`@@fullTextIndex` takes at most one of `name` and `map`\", PSL_FULL_TEXT_INDEX_NAME_XOR_MAP));\n\t\treturn diagnostics;\n\t}\n});\nconst postgresFullTextIndexSpecFactory = () => postgresFullTextIndexSpec;\n/**\n* `@@` model attributes contributed by the Postgres target pack.\n*\n* `@@rls` is argument-less: presence marks the model's table\n* RLS-controlled. It lowers to a {@link PostgresRlsEnablement} marker in\n* the namespace's `entries.rls`, keyed by the model's table name — the\n* marker (never the policy set) is what drives\n* `ENABLE`/`DISABLE ROW LEVEL SECURITY` planning.\n*/\nconst postgresAuthoringModelAttributes = {\n\trls: {\n\t\tkind: \"modelAttribute\",\n\t\tattribute: \"rls\",\n\t\tspec: postgresRlsSpecFactory,\n\t\tlower: (_parsed, ctx) => ({\n\t\t\tkey: ctx.storageName,\n\t\t\tentity: new PostgresRlsEnablement({\n\t\t\t\ttableName: ctx.storageName,\n\t\t\t\tnamespaceId: ctx.namespaceId\n\t\t\t})\n\t\t})\n\t},\n\tfullTextIndex: {\n\t\tkind: \"modelAttribute\",\n\t\tattribute: \"fullTextIndex\",\n\t\tspec: postgresFullTextIndexSpecFactory,\n\t\trepeatable: true,\n\t\tlower: (parsed, ctx) => {\n\t\t\tconst fieldName = parsed.fields[0];\n\t\t\tinvariant(fieldName !== void 0 && parsed.fields.length === 1, `@@fullTextIndex on \"${ctx.modelName}\" lowered with ${parsed.fields.length} fields`);\n\t\t\tconst columnName = ctx.fieldStorageName(fieldName);\n\t\t\tconst codecId = ctx.fieldCodecId(fieldName);\n\t\t\tif (columnName === void 0 || codecId === void 0 || !isFullTextIndexableCodec(codecId)) {\n\t\t\t\tctx.diagnostics?.push({\n\t\t\t\t\tcode: PSL_FULL_TEXT_INDEX_TEXT_FIELD,\n\t\t\t\t\tmessage: `\\`@@fullTextIndex\\` indexes a text column, but \"${ctx.modelName}.${fieldName}\" is ${codecId === void 0 ? \"not a stored scalar field\" : `stored as \\`${codecId}\\``}.`,\n\t\t\t\t\tsourceId: ctx.sourceId ?? \"unknown\"\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn { index: {\n\t\t\t\texpression: renderFullTextIndexExpression(parsed.language ?? \"english\", columnName),\n\t\t\t\ttype: \"gin\",\n\t\t\t\toptions: void 0,\n\t\t\t\twhere: parsed.where,\n\t\t\t\tunique: void 0,\n\t\t\t\tname: parsed.name,\n\t\t\t\tmap: parsed.map\n\t\t\t} };\n\t\t}\n\t}\n};\nconst postgresAuthoringFieldPresets = {\n\ttext: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/text@1\" }\n\t},\n\tint: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/int4@1\" }\n\t},\n\tbigint: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/int8@1\" }\n\t},\n\tfloat: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/float8@1\" }\n\t},\n\tdecimal: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/numeric@1\" }\n\t},\n\tboolean: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/bool@1\" }\n\t},\n\tjson: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/jsonb@1\" }\n\t},\n\tbytes: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/bytea@1\" }\n\t},\n\tdateTime: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/timestamptz-temporal@1\" }\n\t},\n\ttemporal: {\n\t\tcreatedAtJsDate: (/* @__PURE__ */ temporalAuthoringPresets({\n\t\t\tcodecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_DATE_CODEC_ID]\n\t\t})).createdAt,\n\t\tupdatedAtJsDate: (/* @__PURE__ */ temporalAuthoringPresets({\n\t\t\tcodecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_DATE_CODEC_ID]\n\t\t})).updatedAt,\n\t\ttimestamptzJsDate: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_DATE_CODEC_ID]\n\t\t}),\n\t\t.../* @__PURE__ */ temporalAuthoringPresets({\n\t\t\tcodecId: PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\t.../* @__PURE__ */ temporalStringAuthoringPresets({\n\t\t\tcodecId: PG_TIMESTAMPTZ_STRING_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_STRING_CODEC_ID]\n\t\t}),\n\t\ttimestamp: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMP_TEMPORAL_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMP_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\ttimestamptz: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\ttimestampString: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMP_STRING_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMP_STRING_CODEC_ID]\n\t\t}),\n\t\ttimestamptzString: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMPTZ_STRING_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_STRING_CODEC_ID]\n\t\t})\n\t},\n\tuuidNative: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/uuid@1\" }\n\t},\n\tid: {\n\t\tuuidv4Native: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: \"pg/uuid@1\",\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv4\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tuuidv7Native: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: \"pg/uuid@1\",\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv7\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t}\n\t}\n};\n/**\n* Resolves an entity handle's `target` ref to a table coordinate of this\n* contract, or throws the load-time diagnostic naming the handle: a\n* cross-space target is rejected (you cannot CREATE POLICY on a table\n* another space owns) and an unresolved target names the model.\n*/\nfunction requireLocalTarget(refs, subject) {\n\tconst target = refs[\"target\"];\n\tif (target !== void 0 && target.kind === \"resolved\") return {\n\t\tnamespaceId: target.namespaceId,\n\t\ttableName: target.tableName\n\t};\n\tif (target !== void 0 && target.kind === \"cross-space\") throw postgresError(\"CONTRACT.POLICY_INVALID\", `defineContract: ${subject} targets model \"${target.modelName ?? target.tableName}\", which lives in another contract space. Policies and rlsEnabled entries must target a model declared in this contract.`, { meta: {\n\t\tmodel: target.modelName ?? target.tableName,\n\t\treason: \"cross-space-target\"\n\t} });\n\tthrow postgresError(\"CONTRACT.MODEL_UNKNOWN\", `defineContract: ${subject} targets model \"${target?.modelName ?? \"<anonymous>\"}\", which is not in the contract's models. Add the model to \\`models\\`.`, { meta: { model: target?.modelName ?? \"<anonymous>\" } });\n}\n/**\n* The SQL-family entity-handle batch lowering hook for the Postgres pack\n* (`SqlEntityHandleLoweringContribution`). Receives every `entities` handle\n* whose kind this pack registered — batch, so the cross-entity diagnostics\n* (duplicate prefix, policy without rlsEnabled, duplicate role) can see\n* sibling handles — and lowers them with the same keying and hash assembly\n* as the PSL path: `policy` keyed by prefix (wire name via\n* {@link buildRlsPolicyEntity}), `rls` keyed by table name, `role` keyed by\n* name and filed under the default namespace (roles are declared\n* contract-wide; PSL has no role block to set a precedent).\n*/\nfunction postgresLowerEntityHandles(input) {\n\tconst enablements = /* @__PURE__ */ new Map();\n\tconst roles = /* @__PURE__ */ new Map();\n\tconst policies = [];\n\tconst coordinateKey = (coordinate) => `${coordinate.namespaceId} ${coordinate.tableName}`;\n\tfor (const { handle, refs } of input.handles) switch (handle.entityKind) {\n\t\tcase \"rls\": {\n\t\t\tconst coordinate = requireLocalTarget(refs, \"an rlsEnabled entry\");\n\t\t\tconst key = coordinateKey(coordinate);\n\t\t\tif (!enablements.has(key)) enablements.set(key, {\n\t\t\t\tcoordinate,\n\t\t\t\tentity: new PostgresRlsEnablement({\n\t\t\t\t\ttableName: coordinate.tableName,\n\t\t\t\t\tnamespaceId: coordinate.namespaceId\n\t\t\t\t})\n\t\t\t});\n\t\t\tbreak;\n\t\t}\n\t\tcase \"role\": {\n\t\t\tconst roleHandle = blindCast(handle);\n\t\t\tif (roles.has(roleHandle.name)) throw postgresError(\"CONTRACT.ROLE_INVALID\", `defineContract: role \"${roleHandle.name}\" is declared more than once in the entities list.`, { meta: {\n\t\t\t\trole: roleHandle.name,\n\t\t\t\treason: \"duplicate\"\n\t\t\t} });\n\t\t\troles.set(roleHandle.name, new PostgresRole({\n\t\t\t\tname: roleHandle.name,\n\t\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID\n\t\t\t}));\n\t\t\tbreak;\n\t\t}\n\t\tcase \"policy\": {\n\t\t\tconst policyHandle = blindCast(handle);\n\t\t\tpolicies.push({\n\t\t\t\thandle: policyHandle,\n\t\t\t\trefs\n\t\t\t});\n\t\t\tbreak;\n\t\t}\n\t\tdefault: throw postgresError(\"CONTRACT.ENTITY_KIND_INVALID\", `defineContract: the postgres pack does not lower \"${handle.entityKind}\" handles from the entities list.`, { meta: { entityKind: handle.entityKind } });\n\t}\n\tconst rows = [];\n\tconst seenPrefixes = /* @__PURE__ */ new Set();\n\tfor (const { handle: policy, refs } of policies) {\n\t\tconst prefix = policy.name;\n\t\tassertWireNamePrefixLength(prefix, \"defineContract: policy prefix\");\n\t\tconst coordinate = requireLocalTarget(refs, `policy \"${prefix}\"`);\n\t\tif (!enablements.has(coordinateKey(coordinate))) {\n\t\t\tconst target = refs[\"target\"];\n\t\t\tthrow postgresError(\"CONTRACT.POLICY_INVALID\", `defineContract: policy \"${prefix}\" targets model \"${target?.modelName ?? coordinate.tableName}\", whose table is not RLS-enabled. Add rlsEnabled(<model>) to the entities list.`, { meta: {\n\t\t\t\tprefix,\n\t\t\t\tmodel: target?.modelName ?? coordinate.tableName,\n\t\t\t\treason: \"target-not-rls-enabled\"\n\t\t\t} });\n\t\t}\n\t\tconst prefixKey = `${coordinate.namespaceId} ${prefix}`;\n\t\tif (seenPrefixes.has(prefixKey)) throw postgresError(\"CONTRACT.POLICY_INVALID\", `defineContract: policy prefix \"${prefix}\" is declared more than once in namespace \"${coordinate.namespaceId}\". Policy prefixes must be unique per namespace.`, { meta: {\n\t\t\tprefix,\n\t\t\tnamespaceId: coordinate.namespaceId,\n\t\t\treason: \"duplicate-prefix\"\n\t\t} });\n\t\tseenPrefixes.add(prefixKey);\n\t\tconst roleNames = [...new Set(policy.roles.map((roleHandle) => roleHandle.name))].sort();\n\t\trows.push({\n\t\t\tnamespaceId: coordinate.namespaceId,\n\t\t\tentityKind: \"policy\",\n\t\t\tkey: prefix,\n\t\t\tentity: buildRlsPolicyEntity({\n\t\t\t\tprefix,\n\t\t\t\ttableName: coordinate.tableName,\n\t\t\t\tnamespaceId: coordinate.namespaceId,\n\t\t\t\toperation: policy.operation,\n\t\t\t\troles: roleNames,\n\t\t\t\t...ifDefined(\"using\", policy.using),\n\t\t\t\t...ifDefined(\"withCheck\", policy.withCheck)\n\t\t\t})\n\t\t});\n\t}\n\tfor (const { coordinate, entity } of enablements.values()) rows.push({\n\t\tnamespaceId: coordinate.namespaceId,\n\t\tentityKind: \"rls\",\n\t\tkey: coordinate.tableName,\n\t\tentity\n\t});\n\tfor (const [name, entity] of roles) rows.push({\n\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\tentityKind: \"role\",\n\t\tkey: name,\n\t\tentity\n\t});\n\treturn rows;\n}\n//#endregion\nexport { postgresAuthoringPslBlockDescriptors as a, postgresNowGeneratorIdFor as c, plainDateTimeNowControlDescriptor as d, INSTANT_NOW_GENERATOR_ID as f, postgresAuthoringModelAttributes as i, PLAIN_DATE_TIME_NOW_GENERATOR_ID as l, instantNowControlDescriptor as m, postgresAuthoringEntityTypes as n, postgresAuthoringTypes as o, instantNow as p, postgresAuthoringFieldPresets as r, postgresLowerEntityHandles as s, POLICY_BLOCK_KEYW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ring-_2G2lsLt-VmVbrMPn.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/authoring-_2G2lsLt.mjs"],"sourcesContent":["import { C as PG_TIMESTAMPTZ_DATE_CODEC_ID, D as PG_TIMESTAMP_TEMPORAL_CODEC_ID, E as PG_TIMESTAMP_STRING_CODEC_ID, T as PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, s as PG_ENUM_CODEC_ID, w as PG_TIMESTAMPTZ_STRING_CODEC_ID } from \"./codec-ids-Cb0yO-IS.mjs\";\nimport { s as postgresError } from \"./errors-DYyzTYzE.mjs\";\nimport { j as requireTemporal } from \"./codecs-BK3J4C0n.mjs\";\nimport { t as PostgresNativeEnum } from \"./postgres-native-enum-CdP3b_-R.mjs\";\nimport { n as renderFullTextIndexExpression, t as isFullTextIndexableCodec } from \"./full-text-index-expression-Bfp_xWhy.mjs\";\nimport { _ as PostgresRlsPolicy, d as PostgresNativeEnumSchema, f as PostgresRlsEnablementSchema, h as PostgresRole, m as PostgresRoleSchema, p as PostgresRlsPolicySchema, v as PostgresRlsEnablement } from \"./postgres-schema-COkaqci7.mjs\";\nimport { n as computeContentHash } from \"./canonicalize-CrN3u_xM.mjs\";\nimport { n as POSTGRES_TEXT_SEARCH_LANGUAGES } from \"./text-search-languages-RO0HiUDm.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { temporalCodecPresetWithPrecision, temporalStringAuthoringPresets } from \"@internal/family-sql/control\";\nimport { TIMESTAMP_NOW_GENERATOR_ID, temporalAuthoringPresets } from \"@internal/framework-components/authoring\";\nimport { blockAttribute, bool, entityRef, fieldRef, identifier, leafDiagnostic, list, mapBlock, modelAttribute, oneOf, optional, str, structBlock } from \"@internal/psl-parser\";\nimport { exactNameBodyWarning } from \"@internal/sql-contract/index-naming\";\nimport { assertWireNamePrefixLength, normalizeSqlBody } from \"@internal/sql-schema-ir/naming\";\nimport { assertDefined, invariant } from \"@internal/utils/assertions\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/core/instant-now-generator.ts\nconst INSTANT_NOW_GENERATOR_ID = \"instantNow\";\nfunction instantNowControlDescriptor() {\n\treturn {\n\t\tid: INSTANT_NOW_GENERATOR_ID,\n\t\tbuildPhases: () => ({\n\t\t\tonCreate: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid: INSTANT_NOW_GENERATOR_ID\n\t\t\t},\n\t\t\tonUpdate: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid: INSTANT_NOW_GENERATOR_ID\n\t\t\t}\n\t\t})\n\t};\n}\nfunction instantNow() {\n\treturn requireTemporal({ generatorId: INSTANT_NOW_GENERATOR_ID }).Now.instant();\n}\n//#endregion\n//#region src/core/plain-date-time-now-generator.ts\n/**\n* The \"now\" generator for `timestamp` (without time zone) columns: the current\n* moment as a UTC wall-clock `Temporal.PlainDateTime`, the representation\n* `pg/timestamp-temporal@1` encodes. `timestamptz` columns use `instantNow`.\n*/\nconst PLAIN_DATE_TIME_NOW_GENERATOR_ID = \"plainDateTimeNow\";\nfunction plainDateTimeNowControlDescriptor() {\n\treturn {\n\t\tid: PLAIN_DATE_TIME_NOW_GENERATOR_ID,\n\t\tbuildPhases: () => ({\n\t\t\tonCreate: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid: PLAIN_DATE_TIME_NOW_GENERATOR_ID\n\t\t\t},\n\t\t\tonUpdate: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid: PLAIN_DATE_TIME_NOW_GENERATOR_ID\n\t\t\t}\n\t\t})\n\t};\n}\nfunction plainDateTimeNow() {\n\treturn requireTemporal({ generatorId: PLAIN_DATE_TIME_NOW_GENERATOR_ID }).Now.plainDateTimeISO(\"UTC\");\n}\n//#endregion\n//#region src/core/now-generators.ts\n/** The \"now\" generator for each codec that has one. The `temporal` field presets read it. */\nconst postgresNowGeneratorIds = {\n\t[PG_TIMESTAMP_TEMPORAL_CODEC_ID]: PLAIN_DATE_TIME_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]: INSTANT_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_DATE_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMP_STRING_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID,\n\t[PG_TIMESTAMPTZ_STRING_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID\n};\nconst nowGeneratorIdByCodecId = new Map(Object.entries(postgresNowGeneratorIds));\nfunction postgresNowGeneratorIdFor(codecId) {\n\treturn nowGeneratorIdByCodecId.get(codecId);\n}\n//#endregion\n//#region src/core/authoring.ts\nconst PSL_POLICY_INVALID_MAP = \"PSL_POLICY_INVALID_MAP\";\nconst PSL_FULL_TEXT_INDEX_ONE_FIELD = \"PSL_FULL_TEXT_INDEX_ONE_FIELD\";\nconst PSL_FULL_TEXT_INDEX_REQUIRES_NAME = \"PSL_FULL_TEXT_INDEX_REQUIRES_NAME\";\nconst PSL_FULL_TEXT_INDEX_NAME_XOR_MAP = \"PSL_FULL_TEXT_INDEX_NAME_XOR_MAP\";\nconst PSL_FULL_TEXT_INDEX_TEXT_FIELD = \"PSL_FULL_TEXT_INDEX_TEXT_FIELD\";\nconst PSL_NATIVE_ENUM_DUPLICATE_MEMBER_VALUE = \"PSL_NATIVE_ENUM_DUPLICATE_MEMBER_VALUE\";\nconst PSL_NATIVE_ENUM_MISSING_MEMBERS = \"PSL_NATIVE_ENUM_MISSING_MEMBERS\";\nconst PSL_ROLE_BLOCK_OUTSIDE_UNBOUND_NAMESPACE = \"PSL_ROLE_BLOCK_OUTSIDE_UNBOUND_NAMESPACE\";\n/**\n* `pg.enum(<ref>)` registers as an ordinary type constructor whose sole\n* positional argument names a `native_enum` entity instead of carrying a\n* literal value. The interpreter resolves the ref to the `native_enum`\n* entity generically (driven by `entityRefArg`); the `pg/enum@1` codec\n* descriptor's `columnFromEntity` hook (see `codecs.ts`) converts that\n* entity into the column's `typeParams`. The column's type name comes from the\n* `pg/enum` data type, which renders `typeParams.typeName`.\n*/\nconst postgresAuthoringTypes = {\n\tBigIntNumber: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A PostgreSQL 64-bit integer represented as a JavaScript number within its safe integer range.\",\n\t\toutput: { codecId: \"pg/int8number@1\" }\n\t},\n\tUnboundedInt: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An arbitrary-precision integer stored as PostgreSQL numeric and represented as bigint.\",\n\t\toutput: { codecId: \"pg/unboundedint@1\" }\n\t},\n\tpg: { enum: {\n\t\tkind: \"typeConstructor\",\n\t\tinferred: true,\n\t\tentityRefArg: {\n\t\t\tindex: 0,\n\t\t\tentityKind: \"native_enum\"\n\t\t},\n\t\toutput: { codecId: PG_ENUM_CODEC_ID }\n\t} }\n};\nconst policyTargetParam = {\n\ttype: entityRef({ kind: \"model\" }),\n\tdocumentation: \"The model protected by this policy; it must declare @@rls.\"\n};\nconst policyRolesParam = {\n\ttype: optional(list(oneOf(entityRef({\n\t\tkind: \"block\",\n\t\tkeyword: \"role\"\n\t}), identifier()))),\n\tdocumentation: \"The database roles to which this policy applies.\"\n};\nconst policyUsingParam = {\n\ttype: optional(str()),\n\tdocumentation: \"A SQL predicate controlling which rows this policy permits.\"\n};\nconst policyWithCheckParam = {\n\ttype: optional(str()),\n\tdocumentation: \"A SQL predicate checking rows being written by this policy.\"\n};\nconst policyPermissiveParam = {\n\ttype: optional(bool()),\n\tdocumentation: \"Whether the policy is permissive (combined with OR) rather than restrictive (combined with AND).\"\n};\nfunction policyUsingOnlySpec() {\n\treturn structBlock({ parameters: {\n\t\ttarget: policyTargetParam,\n\t\troles: policyRolesParam,\n\t\tusing: policyUsingParam,\n\t\tpermissive: policyPermissiveParam\n\t} });\n}\nfunction policyWithCheckOnlySpec() {\n\treturn structBlock({ parameters: {\n\t\ttarget: policyTargetParam,\n\t\troles: policyRolesParam,\n\t\twithCheck: policyWithCheckParam,\n\t\tpermissive: policyPermissiveParam\n\t} });\n}\nfunction policyBothPredicatesSpec() {\n\treturn structBlock({ parameters: {\n\t\ttarget: policyTargetParam,\n\t\troles: policyRolesParam,\n\t\tusing: policyUsingParam,\n\t\twithCheck: policyWithCheckParam,\n\t\tpermissive: policyPermissiveParam\n\t} });\n}\nfunction roleSpec() {\n\treturn structBlock({ parameters: {} });\n}\nfunction nativeEnumSpec() {\n\treturn mapBlock({ value: {\n\t\ttype: str(),\n\t\tdocumentation: \"The member value stored in the database enum type.\"\n\t} });\n}\n/**\n* The block keyword that authors each row-level security operation. The keyword is the operation, so\n* a policy block has no `operation` parameter. The reader looks a block's operation up here, and\n* `contract infer` and `contract print` look up the keyword to write.\n*/\nconst POLICY_BLOCK_KEYWORDS = {\n\tselect: \"policy_select\",\n\tinsert: \"policy_insert\",\n\tupdate: \"policy_update\",\n\tdelete: \"policy_delete\",\n\tall: \"policy_all\"\n};\nfunction isRlsPolicyOperation(value) {\n\treturn Object.hasOwn(POLICY_BLOCK_KEYWORDS, value);\n}\n/** The operation a `policy_<operation>` block keyword authors, or `undefined` for another keyword. */\nfunction policyOperationOfKeyword(keyword) {\n\treturn Object.keys(POLICY_BLOCK_KEYWORDS).filter(isRlsPolicyOperation).find((operation) => POLICY_BLOCK_KEYWORDS[operation] === keyword);\n}\n/**\n* Assembles a {@link PostgresRlsPolicy} from lowered inputs: normalizes the\n* predicates, computes the content-hash wire name, and constructs the frozen\n* entity. The single hash-assembly body shared by the PSL block lowering\n* ({@link lowerRlsPolicyFromBlock}) and the TS entity-handle lowering\n* ({@link postgresLowerEntityHandles}) so the two surfaces cannot drift.\n*/\nfunction buildRlsPolicyEntity(input) {\n\tconst permissive = input.permissive ?? true;\n\tconst wireHash = computeContentHash({\n\t\t...ifDefined(\"using\", input.using !== void 0 ? normalizeSqlBody(input.using) : void 0),\n\t\t...ifDefined(\"withCheck\", input.withCheck !== void 0 ? normalizeSqlBody(input.withCheck) : void 0),\n\t\troles: input.roles,\n\t\toperation: input.operation,\n\t\tpermissive\n\t});\n\treturn new PostgresRlsPolicy({\n\t\tnaming: {\n\t\t\tkind: \"wire\",\n\t\t\tprefix: input.prefix,\n\t\t\thash: wireHash\n\t\t},\n\t\ttableName: input.tableName,\n\t\tnamespaceId: input.namespaceId,\n\t\toperation: input.operation,\n\t\troles: input.roles,\n\t\tusing: input.using,\n\t\twithCheck: input.withCheck,\n\t\tpermissive\n\t});\n}\nfunction lowerRlsPolicyFromBlock(block, ctx) {\n\tconst prefix = block.name;\n\tconst operation = policyOperationOfKeyword(block.keyword) ?? \"select\";\n\tconst target = block.resolvedModelRefs?.[\"target\"];\n\tassertDefined(target, `lowerRlsPolicyFromBlock: policy \"${block.name}\" reached the factory without a projected \\`target\\` coordinate; the interpreter projects checked model references before invoking entity factories.`);\n\tconst roles = block.values.roles === void 0 ? [] : block.values.roles.map((role) => typeof role === \"string\" ? role : role.declaration.name).sort();\n\tconst using = block.values.using;\n\tconst withCheck = block.values.withCheck;\n\tconst permissive = block.values.permissive ?? true;\n\tconst mapAttr = block.attributes[\"map\"];\n\tif (mapAttr !== void 0) {\n\t\tconst exactName = mapAttr.args[\"name\"];\n\t\tinvariant(typeof exactName === \"string\", \"@@map on a policy block parses one string argument\");\n\t\tctx.warnings?.push(exactNameBodyWarning(\"policy\", exactName));\n\t\treturn new PostgresRlsPolicy({\n\t\t\tnaming: {\n\t\t\t\tkind: \"exact\",\n\t\t\t\tname: exactName\n\t\t\t},\n\t\t\ttableName: target.tableName,\n\t\t\tnamespaceId: target.namespaceId,\n\t\t\toperation,\n\t\t\troles,\n\t\t\tusing,\n\t\t\twithCheck,\n\t\t\tpermissive\n\t\t});\n\t}\n\treturn buildRlsPolicyEntity({\n\t\tprefix,\n\t\ttableName: target.tableName,\n\t\tnamespaceId: target.namespaceId,\n\t\toperation,\n\t\troles,\n\t\t...ifDefined(\"using\", using),\n\t\t...ifDefined(\"withCheck\", withCheck),\n\t\tpermissive\n\t});\n}\nconst policyEntityTypeOutput = {\n\tfactory: lowerRlsPolicyFromBlock,\n\tpslPlacement: (entity) => ({ namespaceId: entity.namespaceId })\n};\nfunction lowerNativeEnumFromBlock(block, ctx) {\n\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\tconst diagnostics = ctx.diagnostics;\n\tconst mapAttr = block.attributes[\"map\"];\n\tlet typeName = block.name;\n\tif (mapAttr !== void 0) {\n\t\tconst mapped = mapAttr.args[\"name\"];\n\t\tinvariant(typeof mapped === \"string\", \"@@map on a native_enum block parses one string argument\");\n\t\ttypeName = mapped;\n\t}\n\tlet memberError = false;\n\tconst seenValues = /* @__PURE__ */ new Set();\n\tconst members = [];\n\tfor (const [memberName, value] of Object.entries(block.values)) {\n\t\tif (seenValues.has(value)) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: PSL_NATIVE_ENUM_DUPLICATE_MEMBER_VALUE,\n\t\t\t\tmessage: `native_enum \"${block.name}\": duplicate member value \"${value}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: block.parameterSpans[memberName] ?? block.span\n\t\t\t});\n\t\t\tmemberError = true;\n\t\t\tcontinue;\n\t\t}\n\t\tseenValues.add(value);\n\t\tmembers.push(value);\n\t}\n\tif (memberError) return void 0;\n\tif (members.length === 0) {\n\t\tdiagnostics?.push({\n\t\t\tcode: PSL_NATIVE_ENUM_MISSING_MEMBERS,\n\t\t\tmessage: `native_enum \"${block.name}\" must have at least one member`,\n\t\t\tsourceId,\n\t\t\tspan: block.span\n\t\t});\n\t\treturn;\n\t}\n\treturn new PostgresNativeEnum({\n\t\ttypeName,\n\t\tmembers\n\t});\n}\n/**\n* `native_enum`'s entity-type factory output, checked separately from the assembled\n* `postgresAuthoringEntityTypes` map below: `deriveValueSet` is SQL-family surface\n* ({@link SqlValueSetDerivingEntityTypeOutput}), not part of the framework\n* `AuthoringEntityTypeFactoryOutput` shape, so folding it directly into the map's single\n* `satisfies AuthoringEntityTypeNamespace` check would trip an excess-property error. Checking it\n* here against the intersection of both shapes keeps it structurally valid against each without\n* widening the map's own check.\n*/\nconst nativeEnumEntityTypeOutput = {\n\tfactory: lowerNativeEnumFromBlock,\n\tderiveValueSet: (entity) => ({\n\t\tkind: \"valueSet\",\n\t\tvalues: [...entity.members]\n\t})\n};\n/**\n* Lowers a `role <name> {}` block into a {@link PostgresRole}. Roles are\n* cluster-scoped in Postgres, so the block must be declared inside\n* `namespace unbound { … }` — any other lexical namespace (a named schema,\n* or the default bucket top-level declarations resolve to) is a load-time\n* diagnostic. The lowered entity carries the unbound coordinate.\n*/\nfunction lowerRoleFromBlock(block, ctx) {\n\tif (block.namespaceId !== UNBOUND_NAMESPACE_ID) {\n\t\tctx.diagnostics?.push({\n\t\t\tcode: PSL_ROLE_BLOCK_OUTSIDE_UNBOUND_NAMESPACE,\n\t\t\tmessage: `\\`role\\` block \"${block.name}\" must be declared inside \\`namespace unbound { }\\`, not in namespace \"${block.namespaceId}\"`,\n\t\t\tsourceId: ctx.sourceId ?? \"unknown\",\n\t\t\tspan: block.span\n\t\t});\n\t\treturn;\n\t}\n\treturn new PostgresRole({\n\t\tname: block.name,\n\t\tnamespaceId: UNBOUND_NAMESPACE_ID\n\t});\n}\nconst postgresAuthoringEntityTypes = {\n\trole: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"role\",\n\t\tvalidatorSchema: PostgresRoleSchema,\n\t\toutput: { factory: lowerRoleFromBlock }\n\t},\n\trls: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"rls\",\n\t\tvalidatorSchema: PostgresRlsEnablementSchema,\n\t\toutput: { factory: (input) => new PostgresRlsEnablement(input) }\n\t},\n\tpolicy: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"policy\",\n\t\tvalidatorSchema: PostgresRlsPolicySchema,\n\t\toutput: policyEntityTypeOutput\n\t},\n\tnative_enum: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"native_enum\",\n\t\tvalidatorSchema: PostgresNativeEnumSchema,\n\t\toutput: nativeEnumEntityTypeOutput\n\t}\n};\n/**\n* Field presets contributed by the Postgres target pack.\n*\n* These mirror the PSL scalar-to-codec mapping used by the Postgres adapter\n* (see `createPostgresPslScalarTypeDescriptors`), so that authoring a field\n* via the TS callback surface (e.g. `field.int()`) and via the PSL scalar\n* surface (e.g. `Int`) lowers to byte-identical contracts.\n*\n* The `uuidNative` / `id.uuidv4Native` / `id.uuidv7Native` presets use the\n* native Postgres `uuid` type (codecId `pg/uuid@1`). For cross-target\n* portability use `uuidString` / `id.uuidv4String` / `id.uuidv7String` from\n* the family pack instead.\n*/\nconst policyRequiresRls = {\n\tparameter: \"target\",\n\tattribute: \"rls\"\n};\nconst policyMapAttribute = blockAttribute(\"map\", {\n\tdocumentation: \"Maps this row-level security policy to its PostgreSQL policy name.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: str(),\n\t\tdocumentation: \"The nonempty PostgreSQL policy name.\"\n\t}],\n\trefine: (parsed, ctx, attributeNode) => parsed.name === \"\" ? [leafDiagnostic(ctx, attributeNode, \"@@map policy name must be a non-empty string\", PSL_POLICY_INVALID_MAP)] : []\n});\nconst policyBlockAttributes = { map: () => policyMapAttribute };\nconst nativeEnumMapAttribute = blockAttribute(\"map\", {\n\tdocumentation: \"Maps this native enum to its PostgreSQL type name.\",\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: str(),\n\t\tdocumentation: \"The PostgreSQL enum type name.\"\n\t}]\n});\nconst postgresAuthoringPslBlockDescriptors = {\n\t[POLICY_BLOCK_KEYWORDS.select]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.select,\n\t\tdocumentation: \"Defines a row-level security policy controlling which rows can be selected.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tspec: policyUsingOnlySpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\t[POLICY_BLOCK_KEYWORDS.delete]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.delete,\n\t\tdocumentation: \"Defines a row-level security policy controlling which rows can be deleted.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tspec: policyUsingOnlySpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\t[POLICY_BLOCK_KEYWORDS.insert]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.insert,\n\t\tdocumentation: \"Defines a row-level security policy checking rows being inserted.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tspec: policyWithCheckOnlySpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\t[POLICY_BLOCK_KEYWORDS.update]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.update,\n\t\tdocumentation: \"Defines a row-level security policy controlling row visibility and checks for updates.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tspec: policyBothPredicatesSpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\t[POLICY_BLOCK_KEYWORDS.all]: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: POLICY_BLOCK_KEYWORDS.all,\n\t\tdocumentation: \"Defines a row-level security policy applying to all operations.\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tspec: policyBothPredicatesSpec,\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\tnative_enum: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: \"native_enum\",\n\t\tdocumentation: \"Defines a PostgreSQL enum type with named string-valued members.\",\n\t\tdiscriminator: \"native_enum\",\n\t\tname: { required: true },\n\t\tspec: nativeEnumSpec,\n\t\tattributes: { map: () => nativeEnumMapAttribute }\n\t},\n\t/**\n\t* PSL block descriptor for `role` (e.g. `role anon {}`). Name-only, no\n\t* parameters and no body content. Declared inside `namespace unbound { }`\n\t* — see {@link lowerRoleFromBlock} for the placement check and the\n\t* coordinate the lowered entity carries.\n\t*/\n\trole: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: \"role\",\n\t\tdocumentation: \"Declares an existing database role in namespace unbound for use in security policies.\",\n\t\tdiscriminator: \"role\",\n\t\tname: { required: true },\n\t\tspec: roleSpec\n\t}\n};\nconst postgresRlsSpec = modelAttribute(\"rls\", { documentation: \"Enables PostgreSQL row-level security on this model’s table.\" });\nconst postgresRlsSpecFactory = () => postgresRlsSpec;\nconst [firstLanguage, ...remainingLanguages] = POSTGRES_TEXT_SEARCH_LANGUAGES;\nconst postgresFullTextIndexSpec = modelAttribute(\"fullTextIndex\", {\n\tdocumentation: \"Indexes one text column for full-text search, rendering the expression `fullTextMatches`, `fullTextRank` and `fullTextHeadline` lower to.\",\n\tpositional: [{\n\t\tkey: \"fields\",\n\t\ttype: list(fieldRef(), {\n\t\t\tallowEmpty: false,\n\t\t\tunique: true\n\t\t}),\n\t\tdocumentation: \"The single field to index.\"\n\t}],\n\tnamed: {\n\t\tlanguage: {\n\t\t\ttype: optional(oneOf(str(firstLanguage), ...remainingLanguages.map((language) => str(language)))),\n\t\t\tdocumentation: \"The text-search configuration. Defaults to `english`, and must match the language the query operations are given.\"\n\t\t},\n\t\tname: {\n\t\t\ttype: optional(str()),\n\t\t\tdocumentation: \"The index name. Mutually exclusive with `map`.\"\n\t\t},\n\t\tmap: {\n\t\t\ttype: optional(str()),\n\t\t\tdocumentation: \"The database index name. Mutually exclusive with `name`.\"\n\t\t},\n\t\twhere: {\n\t\t\ttype: optional(str()),\n\t\t\tdocumentation: \"The SQL predicate restricting rows included in a partial index.\"\n\t\t}\n\t},\n\trefine: (value, ctx, attributeNode) => {\n\t\tconst diagnostics = [];\n\t\tif (value.fields.length !== 1) diagnostics.push(leafDiagnostic(ctx, attributeNode, \"The full-text operations work on one column; declare one `@@fullTextIndex` per column\", PSL_FULL_TEXT_INDEX_ONE_FIELD));\n\t\tif (value.name === void 0 && value.map === void 0) diagnostics.push(leafDiagnostic(ctx, attributeNode, \"`@@fullTextIndex` requires a `name` or `map` argument (a default name cannot be derived from an expression)\", PSL_FULL_TEXT_INDEX_REQUIRES_NAME));\n\t\tif (value.name !== void 0 && value.map !== void 0) diagnostics.push(leafDiagnostic(ctx, attributeNode, \"`@@fullTextIndex` takes at most one of `name` and `map`\", PSL_FULL_TEXT_INDEX_NAME_XOR_MAP));\n\t\treturn diagnostics;\n\t}\n});\nconst postgresFullTextIndexSpecFactory = () => postgresFullTextIndexSpec;\n/**\n* `@@` model attributes contributed by the Postgres target pack.\n*\n* `@@rls` is argument-less: presence marks the model's table\n* RLS-controlled. It lowers to a {@link PostgresRlsEnablement} marker in\n* the namespace's `entries.rls`, keyed by the model's table name — the\n* marker (never the policy set) is what drives\n* `ENABLE`/`DISABLE ROW LEVEL SECURITY` planning.\n*/\nconst postgresAuthoringModelAttributes = {\n\trls: {\n\t\tkind: \"modelAttribute\",\n\t\tattribute: \"rls\",\n\t\tspec: postgresRlsSpecFactory,\n\t\tlower: (_parsed, ctx) => ({\n\t\t\tkey: ctx.storageName,\n\t\t\tentity: new PostgresRlsEnablement({\n\t\t\t\ttableName: ctx.storageName,\n\t\t\t\tnamespaceId: ctx.namespaceId\n\t\t\t})\n\t\t})\n\t},\n\tfullTextIndex: {\n\t\tkind: \"modelAttribute\",\n\t\tattribute: \"fullTextIndex\",\n\t\tspec: postgresFullTextIndexSpecFactory,\n\t\trepeatable: true,\n\t\tlower: (parsed, ctx) => {\n\t\t\tconst fieldName = parsed.fields[0];\n\t\t\tinvariant(fieldName !== void 0 && parsed.fields.length === 1, `@@fullTextIndex on \"${ctx.modelName}\" lowered with ${parsed.fields.length} fields`);\n\t\t\tconst columnName = ctx.fieldStorageName(fieldName);\n\t\t\tconst codecId = ctx.fieldCodecId(fieldName);\n\t\t\tif (columnName === void 0 || codecId === void 0 || !isFullTextIndexableCodec(codecId)) {\n\t\t\t\tctx.diagnostics?.push({\n\t\t\t\t\tcode: PSL_FULL_TEXT_INDEX_TEXT_FIELD,\n\t\t\t\t\tmessage: `\\`@@fullTextIndex\\` indexes a text column, but \"${ctx.modelName}.${fieldName}\" is ${codecId === void 0 ? \"not a stored scalar field\" : `stored as \\`${codecId}\\``}.`,\n\t\t\t\t\tsourceId: ctx.sourceId ?? \"unknown\"\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn { index: {\n\t\t\t\texpression: renderFullTextIndexExpression(parsed.language ?? \"english\", columnName),\n\t\t\t\ttype: \"gin\",\n\t\t\t\toptions: void 0,\n\t\t\t\twhere: parsed.where,\n\t\t\t\tunique: void 0,\n\t\t\t\tname: parsed.name,\n\t\t\t\tmap: parsed.map\n\t\t\t} };\n\t\t}\n\t}\n};\nconst postgresAuthoringFieldPresets = {\n\ttext: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/text@1\" }\n\t},\n\tint: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/int4@1\" }\n\t},\n\tbigint: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/int8@1\" }\n\t},\n\tfloat: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/float8@1\" }\n\t},\n\tdecimal: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/numeric@1\" }\n\t},\n\tboolean: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/bool@1\" }\n\t},\n\tjson: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/jsonb@1\" }\n\t},\n\tbytes: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/bytea@1\" }\n\t},\n\tdateTime: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/timestamptz-temporal@1\" }\n\t},\n\ttemporal: {\n\t\tcreatedAtJsDate: (/* @__PURE__ */ temporalAuthoringPresets({\n\t\t\tcodecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_DATE_CODEC_ID]\n\t\t})).createdAt,\n\t\tupdatedAtJsDate: (/* @__PURE__ */ temporalAuthoringPresets({\n\t\t\tcodecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_DATE_CODEC_ID]\n\t\t})).updatedAt,\n\t\ttimestamptzJsDate: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_DATE_CODEC_ID]\n\t\t}),\n\t\t.../* @__PURE__ */ temporalAuthoringPresets({\n\t\t\tcodecId: PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\t.../* @__PURE__ */ temporalStringAuthoringPresets({\n\t\t\tcodecId: PG_TIMESTAMPTZ_STRING_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_STRING_CODEC_ID]\n\t\t}),\n\t\ttimestamp: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMP_TEMPORAL_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMP_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\ttimestamptz: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID]\n\t\t}),\n\t\ttimestampString: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMP_STRING_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMP_STRING_CODEC_ID]\n\t\t}),\n\t\ttimestamptzString: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: PG_TIMESTAMPTZ_STRING_CODEC_ID,\n\t\t\tgeneratorId: postgresNowGeneratorIds[PG_TIMESTAMPTZ_STRING_CODEC_ID]\n\t\t})\n\t},\n\tuuidNative: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: { codecId: \"pg/uuid@1\" }\n\t},\n\tid: {\n\t\tuuidv4Native: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: \"pg/uuid@1\",\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv4\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tuuidv7Native: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: \"pg/uuid@1\",\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv7\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t}\n\t}\n};\n/**\n* Resolves an entity handle's `target` ref to a table coordinate of this\n* contract, or throws the load-time diagnostic naming the handle: a\n* cross-space target is rejected (you cannot CREATE POLICY on a table\n* another space owns) and an unresolved target names the model.\n*/\nfunction requireLocalTarget(refs, subject) {\n\tconst target = refs[\"target\"];\n\tif (target !== void 0 && target.kind === \"resolved\") return {\n\t\tnamespaceId: target.namespaceId,\n\t\ttableName: target.tableName\n\t};\n\tif (target !== void 0 && target.kind === \"cross-space\") throw postgresError(\"CONTRACT.POLICY_INVALID\", `defineContract: ${subject} targets model \"${target.modelName ?? target.tableName}\", which lives in another contract space. Policies and rlsEnabled entries must target a model declared in this contract.`, { meta: {\n\t\tmodel: target.modelName ?? target.tableName,\n\t\treason: \"cross-space-target\"\n\t} });\n\tthrow postgresError(\"CONTRACT.MODEL_UNKNOWN\", `defineContract: ${subject} targets model \"${target?.modelName ?? \"<anonymous>\"}\", which is not in the contract's models. Add the model to \\`models\\`.`, { meta: { model: target?.modelName ?? \"<anonymous>\" } });\n}\n/**\n* The SQL-family entity-handle batch lowering hook for the Postgres pack\n* (`SqlEntityHandleLoweringContribution`). Receives every `entities` handle\n* whose kind this pack registered — batch, so the cross-entity diagnostics\n* (duplicate prefix, policy without rlsEnabled, duplicate role) can see\n* sibling handles — and lowers them with the same keying and hash assembly\n* as the PSL path: `policy` keyed by prefix (wire name via\n* {@link buildRlsPolicyEntity}), `rls` keyed by table name, `role` keyed by\n* name and filed under the default namespace (roles are declared\n* contract-wide; PSL has no role block to set a precedent).\n*/\nfunction postgresLowerEntityHandles(input) {\n\tconst enablements = /* @__PURE__ */ new Map();\n\tconst roles = /* @__PURE__ */ new Map();\n\tconst policies = [];\n\tconst coordinateKey = (coordinate) => `${coordinate.namespaceId} ${coordinate.tableName}`;\n\tfor (const { handle, refs } of input.handles) switch (handle.entityKind) {\n\t\tcase \"rls\": {\n\t\t\tconst coordinate = requireLocalTarget(refs, \"an rlsEnabled entry\");\n\t\t\tconst key = coordinateKey(coordinate);\n\t\t\tif (!enablements.has(key)) enablements.set(key, {\n\t\t\t\tcoordinate,\n\t\t\t\tentity: new PostgresRlsEnablement({\n\t\t\t\t\ttableName: coordinate.tableName,\n\t\t\t\t\tnamespaceId: coordinate.namespaceId\n\t\t\t\t})\n\t\t\t});\n\t\t\tbreak;\n\t\t}\n\t\tcase \"role\": {\n\t\t\tconst roleHandle = blindCast(handle);\n\t\t\tif (roles.has(roleHandle.name)) throw postgresError(\"CONTRACT.ROLE_INVALID\", `defineContract: role \"${roleHandle.name}\" is declared more than once in the entities list.`, { meta: {\n\t\t\t\trole: roleHandle.name,\n\t\t\t\treason: \"duplicate\"\n\t\t\t} });\n\t\t\troles.set(roleHandle.name, new PostgresRole({\n\t\t\t\tname: roleHandle.name,\n\t\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID\n\t\t\t}));\n\t\t\tbreak;\n\t\t}\n\t\tcase \"policy\": {\n\t\t\tconst policyHandle = blindCast(handle);\n\t\t\tpolicies.push({\n\t\t\t\thandle: policyHandle,\n\t\t\t\trefs\n\t\t\t});\n\t\t\tbreak;\n\t\t}\n\t\tdefault: throw postgresError(\"CONTRACT.ENTITY_KIND_INVALID\", `defineContract: the postgres pack does not lower \"${handle.entityKind}\" handles from the entities list.`, { meta: { entityKind: handle.entityKind } });\n\t}\n\tconst rows = [];\n\tconst seenPrefixes = /* @__PURE__ */ new Set();\n\tfor (const { handle: policy, refs } of policies) {\n\t\tconst prefix = policy.name;\n\t\tassertWireNamePrefixLength(prefix, \"defineContract: policy prefix\");\n\t\tconst coordinate = requireLocalTarget(refs, `policy \"${prefix}\"`);\n\t\tif (!enablements.has(coordinateKey(coordinate))) {\n\t\t\tconst target = refs[\"target\"];\n\t\t\tthrow postgresError(\"CONTRACT.POLICY_INVALID\", `defineContract: policy \"${prefix}\" targets model \"${target?.modelName ?? coordinate.tableName}\", whose table is not RLS-enabled. Add rlsEnabled(<model>) to the entities list.`, { meta: {\n\t\t\t\tprefix,\n\t\t\t\tmodel: target?.modelName ?? coordinate.tableName,\n\t\t\t\treason: \"target-not-rls-enabled\"\n\t\t\t} });\n\t\t}\n\t\tconst prefixKey = `${coordinate.namespaceId} ${prefix}`;\n\t\tif (seenPrefixes.has(prefixKey)) throw postgresError(\"CONTRACT.POLICY_INVALID\", `defineContract: policy prefix \"${prefix}\" is declared more than once in namespace \"${coordinate.namespaceId}\". Policy prefixes must be unique per namespace.`, { meta: {\n\t\t\tprefix,\n\t\t\tnamespaceId: coordinate.namespaceId,\n\t\t\treason: \"duplicate-prefix\"\n\t\t} });\n\t\tseenPrefixes.add(prefixKey);\n\t\tconst roleNames = [...new Set(policy.roles.map((roleHandle) => roleHandle.name))].sort();\n\t\trows.push({\n\t\t\tnamespaceId: coordinate.namespaceId,\n\t\t\tentityKind: \"policy\",\n\t\t\tkey: prefix,\n\t\t\tentity: buildRlsPolicyEntity({\n\t\t\t\tprefix,\n\t\t\t\ttableName: coordinate.tableName,\n\t\t\t\tnamespaceId: coordinate.namespaceId,\n\t\t\t\toperation: policy.operation,\n\t\t\t\troles: roleNames,\n\t\t\t\t...ifDefined(\"using\", policy.using),\n\t\t\t\t...ifDefined(\"withCheck\", policy.withCheck)\n\t\t\t})\n\t\t});\n\t}\n\tfor (const { coordinate, entity } of enablements.values()) rows.push({\n\t\tnamespaceId: coordinate.namespaceId,\n\t\tentityKind: \"rls\",\n\t\tkey: coordinate.tableName,\n\t\tentity\n\t});\n\tfor (const [name, entity] of roles) rows.push({\n\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\tentityKind: \"role\",\n\t\tkey: name,\n\t\tentity\n\t});\n\treturn rows;\n}\n//#endregion\nexport { postgresAuthoringPslBlockDescriptors as a, postgresNowGeneratorIdFor as c, plainDateTimeNowControlDescriptor as d, INSTANT_NOW_GENERATOR_ID as f, postgresAuthoringModelAttributes as i, PLAIN_DATE_TIME_NOW_GENERATOR_ID as l, instantNowControlDescriptor as m, postgresAuthoringEntityTypes as n, postgresAuthoringTypes as o, instantNow as p, postgresAuthoringFieldPresets as r, postgresLowerEntityHandles as s, POLICY_BLOCK_KEYWORDS as t, plainDateTimeNow as u };\n\n//# sourceMappingURL=authoring-_2G2lsLt.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,MAAM,2BAA2B;AACjC,SAAS,8BAA8B;CACtC,OAAO;EACN,IAAI;EACJ,oBAAoB;GACnB,UAAU;IACT,MAAM;IACN,IAAI;GACL;GACA,UAAU;IACT,MAAM;IACN,IAAI;GACL;EACD;CACD;AACD;AACA,SAAS,aAAa;CACrB,OAAO,gBAAgB,EAAE,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O,QAAQ,aAAa,WAAW;IACvC,QAAQ;GACT,EAAE,CAAC;EACJ;EACA,MAAM,YAAY,GAAG,WAAW,YAAY,GAAG;EAC/C,IAAI,aAAa,IAAI,SAAS,GAAG,MAAM,cAAc,2BAA2B,kCAAkC,OAAO,6CAA6C,WAAW,YAAY,mDAAmD,EAAE,MAAM;GACvP;GACA,aAAa,WAAW;GACxB,QAAQ;EACT,EAAE,CAAC;EACH,aAAa,IAAI,SAAS;EAC1B,MAAM,YAAY,CAAC,GAAG,IAAI,IAAI,OAAO,MAAM,KAAK,eAAe,WAAW,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK;EACvF,KAAK,KAAK;GACT,aAAa,WAAW;GACxB,YAAY;GACZ,KAAK;GACL,QAAQ,qBAAqB;IAC5B;IACA,WAAW,WAAW;IACtB,aAAa,WAAW;IACxB,WAAW,OAAO;IAClB,OAAO;IACP,GAAG,UAAU,SAAS,OAAO,KAAK;IAClC,GAAG,UAAU,aAAa,OAAO,SAAS;GAC3C,CAAC;EACF,CAAC;CACF;CACA,KAAK,MAAM,EAAE,YAAY,YAAY,YAAY,OAAO,GAAG,KAAK,KAAK;EACpE,aAAa,WAAW;EACxB,YAAY;EACZ,KAAK,WAAW;EAChB;CACD,CAAC;CACD,KAAK,MAAM,CAAC,MAAM,WAAW,OAAO,KAAK,KAAK;EAC7C,aAAa;EACb,YAAY;EACZ,KAAK;EACL;CACD,CAAC;CACD,OAAO;AACR"}
|
package/dist/{check-expressions-Dlt334zg-CV5Vkh3G.mjs → check-expressions-BaFrBceq-ChgvazEN.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-CVsvXiX4-C7xD0Bgv.mjs";
|
|
2
2
|
import { invariant } from "@prisma/orm-framework/utils/assertions";
|
|
3
|
-
//#region ../../../3-targets/3-targets/postgres/dist/check-expressions-
|
|
3
|
+
//#region ../../../3-targets/3-targets/postgres/dist/check-expressions-BaFrBceq.mjs
|
|
4
4
|
/**
|
|
5
5
|
* Renders the checks a Postgres column needs, as opaque predicate text.
|
|
6
6
|
*
|
|
@@ -10,9 +10,10 @@ import { invariant } from "@prisma/orm-framework/utils/assertions";
|
|
|
10
10
|
* Array membership strips NULL elements first, leaving element nullability to
|
|
11
11
|
* the separate element-non-null check emitted for semantically strict lists.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* Both forms compare members in the column's own type: the `IN` list and
|
|
14
|
+
* the `<@` array literal are untyped, so Postgres reads each member as the
|
|
15
|
+
* column (or element) type. A cast to `text` would compare the type's text
|
|
16
|
+
* output instead, which for `inet` always carries the prefix length.
|
|
16
17
|
*/
|
|
17
18
|
function postgresRenderCheckExpressions(input) {
|
|
18
19
|
const candidates = [];
|
|
@@ -21,16 +22,11 @@ function postgresRenderCheckExpressions(input) {
|
|
|
21
22
|
const elementNullable = typeof input.many === "object" && input.many.elementNullable || "elementNullable" in input && input.elementNullable === true;
|
|
22
23
|
if (input.memberValues !== void 0) {
|
|
23
24
|
invariant(input.memberValues.length > 0, `check for "${input.tableName}"."${input.columnName}": empty member set; both authoring surfaces reject a member-less enum before rendering`);
|
|
24
|
-
const
|
|
25
|
-
if (typeof value === "string") return `'${escapeLiteral(value)}'`;
|
|
26
|
-
invariant(Number.isFinite(value), `check for "${input.tableName}"."${input.columnName}": non-finite numeric member`);
|
|
27
|
-
return String(value);
|
|
28
|
-
}).join(", ");
|
|
29
|
-
const arrayType = input.memberValues.every((value) => typeof value === "number") ? "numeric[]" : "text[]";
|
|
25
|
+
for (const value of input.memberValues) invariant(typeof value === "string" || Number.isFinite(value), `check for "${input.tableName}"."${input.columnName}": non-finite numeric member`);
|
|
30
26
|
candidates.push({
|
|
31
27
|
kind: "membership",
|
|
32
28
|
columnName: input.columnName,
|
|
33
|
-
expression: isMany ? `array_remove(${column}
|
|
29
|
+
expression: isMany ? `array_remove(${column}, NULL) <@ '${escapeLiteral(arrayLiteral(input.memberValues))}'` : `${column} IN (${input.memberValues.map(sqlLiteral).join(", ")})`
|
|
34
30
|
});
|
|
35
31
|
}
|
|
36
32
|
if (isMany && !elementNullable) candidates.push({
|
|
@@ -40,7 +36,13 @@ function postgresRenderCheckExpressions(input) {
|
|
|
40
36
|
});
|
|
41
37
|
return candidates;
|
|
42
38
|
}
|
|
39
|
+
function sqlLiteral(value) {
|
|
40
|
+
return typeof value === "string" ? `'${escapeLiteral(value)}'` : String(value);
|
|
41
|
+
}
|
|
42
|
+
function arrayLiteral(values) {
|
|
43
|
+
return `{${values.map((value) => typeof value === "string" ? `"${value.replace(/["\\]/g, "\\$&")}"` : String(value)).join(",")}}`;
|
|
44
|
+
}
|
|
43
45
|
//#endregion
|
|
44
46
|
export { postgresRenderCheckExpressions as t };
|
|
45
47
|
|
|
46
|
-
//# sourceMappingURL=check-expressions-
|
|
48
|
+
//# sourceMappingURL=check-expressions-BaFrBceq-ChgvazEN.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-expressions-BaFrBceq-ChgvazEN.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/check-expressions-BaFrBceq.mjs"],"sourcesContent":["import { r as quoteIdentifier, t as escapeLiteral } from \"./sql-utils-CVsvXiX4.mjs\";\nimport { invariant } from \"@internal/utils/assertions\";\n//#region src/core/check-expressions.ts\n/**\n* Renders the checks a Postgres column needs, as opaque predicate text.\n*\n* A domain enum has no type-level enforcement, so membership is a\n* predicate: `IN` for a scalar, and `<@` containment for an array — an array\n* column cannot use `IN` at all (`operator does not exist: text[] = text`).\n* Array membership strips NULL elements first, leaving element nullability to\n* the separate element-non-null check emitted for semantically strict lists.\n*\n* Both forms compare members in the column's own type: the `IN` list and\n* the `<@` array literal are untyped, so Postgres reads each member as the\n* column (or element) type. A cast to `text` would compare the type's text\n* output instead, which for `inet` always carries the prefix length.\n*/\nfunction postgresRenderCheckExpressions(input) {\n\tconst candidates = [];\n\tconst column = quoteIdentifier(input.columnName);\n\tconst isMany = input.many !== false;\n\tconst elementNullable = typeof input.many === \"object\" && input.many.elementNullable || \"elementNullable\" in input && input.elementNullable === true;\n\tif (input.memberValues !== void 0) {\n\t\tinvariant(input.memberValues.length > 0, `check for \"${input.tableName}\".\"${input.columnName}\": empty member set; both authoring surfaces reject a member-less enum before rendering`);\n\t\tfor (const value of input.memberValues) invariant(typeof value === \"string\" || Number.isFinite(value), `check for \"${input.tableName}\".\"${input.columnName}\": non-finite numeric member`);\n\t\tcandidates.push({\n\t\t\tkind: \"membership\",\n\t\t\tcolumnName: input.columnName,\n\t\t\texpression: isMany ? `array_remove(${column}, NULL) <@ '${escapeLiteral(arrayLiteral(input.memberValues))}'` : `${column} IN (${input.memberValues.map(sqlLiteral).join(\", \")})`\n\t\t});\n\t}\n\tif (isMany && !elementNullable) candidates.push({\n\t\tkind: \"elementNotNull\",\n\t\tcolumnName: input.columnName,\n\t\texpression: `array_position(${column}, NULL) IS NULL`\n\t});\n\treturn candidates;\n}\nfunction sqlLiteral(value) {\n\treturn typeof value === \"string\" ? `'${escapeLiteral(value)}'` : String(value);\n}\nfunction arrayLiteral(values) {\n\treturn `{${values.map((value) => typeof value === \"string\" ? `\"${value.replace(/[\"\\\\]/g, \"\\\\$&\")}\"` : String(value)).join(\",\")}}`;\n}\n//#endregion\nexport { postgresRenderCheckExpressions as t };\n\n//# sourceMappingURL=check-expressions-BaFrBceq.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,SAAS,+BAA+B,OAAO;CAC9C,MAAM,aAAa,CAAC;CACpB,MAAM,SAAS,gBAAgB,MAAM,UAAU;CAC/C,MAAM,SAAS,MAAM,SAAS;CAC9B,MAAM,kBAAkB,OAAO,MAAM,SAAS,YAAY,MAAM,KAAK,mBAAmB,qBAAqB,SAAS,MAAM,oBAAoB;CAChJ,IAAI,MAAM,iBAAiB,KAAK,GAAG;EAClC,UAAU,MAAM,aAAa,SAAS,GAAG,cAAc,MAAM,UAAU,KAAK,MAAM,WAAW,wFAAwF;EACrL,KAAK,MAAM,SAAS,MAAM,cAAc,UAAU,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,GAAG,cAAc,MAAM,UAAU,KAAK,MAAM,WAAW,6BAA6B;EACxL,WAAW,KAAK;GACf,MAAM;GACN,YAAY,MAAM;GAClB,YAAY,SAAS,gBAAgB,OAAO,cAAc,cAAc,aAAa,MAAM,YAAY,CAAC,EAAE,KAAK,GAAG,OAAO,OAAO,MAAM,aAAa,IAAI,UAAU,CAAC,CAAC,KAAK,IAAI,EAAE;EAC/K,CAAC;CACF;CACA,IAAI,UAAU,CAAC,iBAAiB,WAAW,KAAK;EAC/C,MAAM;EACN,YAAY,MAAM;EAClB,YAAY,kBAAkB,OAAO;CACtC,CAAC;CACD,OAAO;AACR;AACA,SAAS,WAAW,OAAO;CAC1B,OAAO,OAAO,UAAU,WAAW,IAAI,cAAc,KAAK,EAAE,KAAK,OAAO,KAAK;AAC9E;AACA,SAAS,aAAa,QAAQ;CAC7B,OAAO,IAAI,OAAO,KAAK,UAAU,OAAO,UAAU,WAAW,IAAI,MAAM,QAAQ,UAAU,MAAM,EAAE,KAAK,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;AAChI"}
|
package/dist/{check-expressions-CBIgoKhV-D7oTR8lp.d.mts → check-expressions-CtTzM58x-CsWFEeul.d.mts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CheckKind } from "@prisma/orm-family-sql/schema-ir/naming";
|
|
2
|
-
//#region ../../../3-targets/3-targets/postgres/dist/check-expressions-
|
|
2
|
+
//#region ../../../3-targets/3-targets/postgres/dist/check-expressions-CtTzM58x.d.mts
|
|
3
3
|
//#region src/core/check-expressions.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* What a rendered check enforces. The contract builder turns this into the
|
|
@@ -44,11 +44,12 @@ interface PostgresCheckExpressionCandidate {
|
|
|
44
44
|
* Array membership strips NULL elements first, leaving element nullability to
|
|
45
45
|
* the separate element-non-null check emitted for semantically strict lists.
|
|
46
46
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
47
|
+
* Both forms compare members in the column's own type: the `IN` list and
|
|
48
|
+
* the `<@` array literal are untyped, so Postgres reads each member as the
|
|
49
|
+
* column (or element) type. A cast to `text` would compare the type's text
|
|
50
|
+
* output instead, which for `inet` always carries the prefix length.
|
|
50
51
|
*/
|
|
51
52
|
declare function postgresRenderCheckExpressions(input: PostgresCheckExpressionInput): readonly PostgresCheckExpressionCandidate[];
|
|
52
53
|
//#endregion
|
|
53
54
|
export { postgresRenderCheckExpressions as i, PostgresCheckExpressionInput as n, PostgresCheckKind as r, PostgresCheckExpressionCandidate as t };
|
|
54
|
-
//# sourceMappingURL=check-expressions-
|
|
55
|
+
//# sourceMappingURL=check-expressions-CtTzM58x-CsWFEeul.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-expressions-CtTzM58x-CsWFEeul.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/check-expressions-CtTzM58x.d.mts"],"mappings":";;;;;;;;;KAQK,oBAAoB;;;;;;;UAOf;WACC;WACA;WACA;aACE;;WAEF;;;;;;;;UAQD;WACC,MAAM;;WAEN;;WAEA;;;;;;;;;;;;;;;;iBAgBM,+BAA+B,OAAO,wCAAwC"}
|
package/dist/{codec-descriptor-CZAGhM_O-DK9auM7J.mjs → codec-descriptor-C5Ec_6Mw-CpacG1CL.mjs}
RENAMED
|
@@ -2,7 +2,7 @@ import { CaseExpr, ColumnRef, DerivedTableSource, FunctionSource, JsonArrayAggEx
|
|
|
2
2
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
3
3
|
import { CodecDescriptorImpl, validateCodecTypeParams } from "@prisma/orm-framework/components/codec";
|
|
4
4
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
5
|
-
//#region ../../../3-targets/3-targets/postgres/dist/codec-descriptor-
|
|
5
|
+
//#region ../../../3-targets/3-targets/postgres/dist/codec-descriptor-C5Ec_6Mw.mjs
|
|
6
6
|
const POSTGRES_CODEC_DESCRIPTOR_KIND = "postgres-codec";
|
|
7
7
|
const ARRAY_INPUT_ALIAS = "array_input";
|
|
8
8
|
const ARRAY_ELEMENT_ALIAS = "array_element";
|
|
@@ -63,6 +63,7 @@ var PostgresCodecDescriptorAdapter = class extends PostgresCodecDescriptor {
|
|
|
63
63
|
if (renderInputType !== void 0) this.renderInputType = (params) => renderInputType.call(descriptor, params);
|
|
64
64
|
const renderValueLiteral = descriptor.renderValueLiteral;
|
|
65
65
|
if (renderValueLiteral !== void 0) this.renderValueLiteral = (value, side) => renderValueLiteral.call(descriptor, value, side);
|
|
66
|
+
if (descriptor.enumRefusal !== void 0) this.enumRefusal = descriptor.enumRefusal;
|
|
66
67
|
}
|
|
67
68
|
jsonProjection(expression, params) {
|
|
68
69
|
return this.options.jsonProjection(expression, params);
|
|
@@ -125,4 +126,4 @@ function candidateCodecId(value) {
|
|
|
125
126
|
//#endregion
|
|
126
127
|
export { postgresCodec as a, isPostgresCodecDescriptor as i, buildPostgresCodecDescriptorRegistry as n, definePostgresCodecs as r, PostgresCodecDescriptor as t };
|
|
127
128
|
|
|
128
|
-
//# sourceMappingURL=codec-descriptor-
|
|
129
|
+
//# sourceMappingURL=codec-descriptor-C5Ec_6Mw-CpacG1CL.mjs.map
|