@prisma/orm-target-postgres 8.0.0-rc.18-dev.18 → 8.0.0-rc.18-dev.19
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-C2XsLnXe-DLYvtWWr.mjs → adapter-C2XsLnXe-BElMJPZi.mjs} +5 -5
- package/dist/{adapter-C2XsLnXe-DLYvtWWr.mjs.map → adapter-C2XsLnXe-BElMJPZi.mjs.map} +1 -1
- package/dist/{adapter-BBw3Q5WW.d.mts → adapter-CA0jY1EK.d.mts} +9 -9
- package/dist/{adapter-BBw3Q5WW.d.mts.map → adapter-CA0jY1EK.d.mts.map} +1 -1
- package/dist/adapter.d.mts +4 -4
- 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 +22 -12
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.mjs +8 -13
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/adapter__types.d.mts +2 -2
- package/dist/{aggregates-D2J3oSFz.d.mts → aggregates-B3lIBjGK.d.mts} +8 -8
- package/dist/{aggregates-D2J3oSFz.d.mts.map → aggregates-B3lIBjGK.d.mts.map} +1 -1
- package/dist/{authoring-DAorKc0L-DpWukVxn.mjs → authoring-mmK5aduF-BltVG_HJ.mjs} +171 -40
- package/dist/authoring-mmK5aduF-BltVG_HJ.mjs.map +1 -0
- package/dist/{autoincrement-widths-BLCRgB3t-BWl20PCZ.mjs → autoincrement-widths-djl9Gw7k-C4Vk6s7I.mjs} +3 -3
- package/dist/{autoincrement-widths-BLCRgB3t-BWl20PCZ.mjs.map → autoincrement-widths-djl9Gw7k-C4Vk6s7I.mjs.map} +1 -1
- package/dist/{check-expressions-CVLs1Cgf-DaMRk-Q4.mjs → check-expressions-DoxKokL1-RVvYRdA6.mjs} +3 -3
- package/dist/{check-expressions-CVLs1Cgf-DaMRk-Q4.mjs.map → check-expressions-DoxKokL1-RVvYRdA6.mjs.map} +1 -1
- package/dist/{codec-registry-pg69n-o5-D8K3p40k.mjs → codec-registry-CvKdYTYj-4xXqgKKs.mjs} +4 -4
- package/dist/{codec-registry-pg69n-o5-D8K3p40k.mjs.map → codec-registry-CvKdYTYj-4xXqgKKs.mjs.map} +1 -1
- package/dist/{codec-type-map-eTeOtvJB-c3tjqXBa.d.mts → codec-type-map-ulrHZjWI-DMkq8jy2.d.mts} +3 -3
- package/dist/{codec-type-map-eTeOtvJB-c3tjqXBa.d.mts.map → codec-type-map-ulrHZjWI-DMkq8jy2.d.mts.map} +1 -1
- package/dist/{codec-types-Cf0IZ0WQ-CMVP-ecb.d.mts → codec-types-DX-72F9v-CORaQjWv.d.mts} +4 -4
- package/dist/{codec-types-Cf0IZ0WQ-CMVP-ecb.d.mts.map → codec-types-DX-72F9v-CORaQjWv.d.mts.map} +1 -1
- package/dist/codec-types-DoxsMXp7.d.mts +2 -0
- package/dist/{codecs-DanVXZ_F-D1_8_x3j.d.mts → codecs-ByHL7NZ0-B_903MRF.d.mts} +4 -6
- package/dist/codecs-ByHL7NZ0-B_903MRF.d.mts.map +1 -0
- package/dist/{codecs-CaWZPjFi-hllqyGdW.mjs → codecs-D183NDmb-DKryvPH2.mjs} +17 -11
- package/dist/codecs-D183NDmb-DKryvPH2.mjs.map +1 -0
- package/dist/{codecs-B-8uGsxq.d.mts → codecs-J4SSxTf4.d.mts} +2 -2
- package/dist/{codecs-B-8uGsxq.d.mts.map → codecs-J4SSxTf4.d.mts.map} +1 -1
- package/dist/{contract-contributions-C8XjOBIq-BuK0mnF9.mjs → contract-contributions-C8XjOBIq-OyqZjJ7a.mjs} +7 -7
- package/dist/{contract-contributions-C8XjOBIq-BuK0mnF9.mjs.map → contract-contributions-C8XjOBIq-OyqZjJ7a.mjs.map} +1 -1
- package/dist/{contract-free-BhaRUqcK.mjs → contract-free-CiUW36L2.mjs} +3 -3
- package/dist/{contract-free-BhaRUqcK.mjs.map → contract-free-CiUW36L2.mjs.map} +1 -1
- package/dist/{control--DStfvkM.mjs → control-CWT2tHUL.mjs} +152 -96
- package/dist/control-CWT2tHUL.mjs.map +1 -0
- package/dist/{control-Mc7bM0Ho.d.mts → control-D6tg3XmI.d.mts} +2 -2
- package/dist/{control-Mc7bM0Ho.d.mts.map → control-D6tg3XmI.d.mts.map} +1 -1
- package/dist/{control-Co7_lX4j.d.mts → control-DmWVxA23.d.mts} +2 -2
- package/dist/{control-Co7_lX4j.d.mts.map → control-DmWVxA23.d.mts.map} +1 -1
- package/dist/{control-policy-DrK_x_Qd-BcT8Z5TM.mjs → control-policy-BdfDPcjX-BueP9PBT.mjs} +9 -9
- package/dist/{control-policy-DrK_x_Qd-BcT8Z5TM.mjs.map → control-policy-BdfDPcjX-BueP9PBT.mjs.map} +1 -1
- package/dist/{data-type-entries-DECnlc43-BYnGiJLy.mjs → data-type-entries-KJ4Mn8C5-DY3rLz33.mjs} +3 -3
- package/dist/{data-type-entries-DECnlc43-BYnGiJLy.mjs.map → data-type-entries-KJ4Mn8C5-DY3rLz33.mjs.map} +1 -1
- package/dist/{data-types-BIvSDTYw-AK5Is74Z.mjs → data-types-CQs1yW4F-CSexn8mK.mjs} +4 -4
- package/dist/{data-types-BIvSDTYw-AK5Is74Z.mjs.map → data-types-CQs1yW4F-CSexn8mK.mjs.map} +1 -1
- package/dist/date-time-now-generators-CMkXVbMG-CYwplAuf.d.mts +45 -0
- package/dist/date-time-now-generators-CMkXVbMG-CYwplAuf.d.mts.map +1 -0
- package/dist/{ddl-CU7p3mkk-mKabtlGh.mjs → ddl-V9Yxnoa6-BcStSw33.mjs} +3 -3
- package/dist/{ddl-CU7p3mkk-mKabtlGh.mjs.map → ddl-V9Yxnoa6-BcStSw33.mjs.map} +1 -1
- package/dist/{descriptor-meta-_qLKFkLd-Cb4H-vZf.mjs → descriptor-meta-_qLKFkLd-B8nEWdKp.mjs} +3 -3
- package/dist/{descriptor-meta-_qLKFkLd-Cb4H-vZf.mjs.map → descriptor-meta-_qLKFkLd-B8nEWdKp.mjs.map} +1 -1
- package/dist/{descriptor-meta-CNFvhRlG-8_vCDF2W.mjs → descriptor-meta-axWY-kHl-Bt2_NjH4.mjs} +9 -9
- package/dist/{descriptor-meta-CNFvhRlG-8_vCDF2W.mjs.map → descriptor-meta-axWY-kHl-Bt2_NjH4.mjs.map} +1 -1
- package/dist/{descriptor-meta-runtime-BKtwKsDm-BirZ12T5.mjs → descriptor-meta-runtime-CMaPJG46-CPYTMJ7t.mjs} +3 -3
- package/dist/{descriptor-meta-runtime-BKtwKsDm-BirZ12T5.mjs.map → descriptor-meta-runtime-CMaPJG46-CPYTMJ7t.mjs.map} +1 -1
- package/dist/{diff-database-schema-C6fmfclD-Dqn9QqOO.mjs → diff-database-schema-DLIpM5BX-DlEJquxk.mjs} +9 -9
- package/dist/{diff-database-schema-C6fmfclD-Dqn9QqOO.mjs.map → diff-database-schema-DLIpM5BX-DlEJquxk.mjs.map} +1 -1
- package/dist/{errors-DYyzTYzE-39CV_aMo.mjs → errors-BrhQYgdL-D_lIrddD.mjs} +14 -3
- package/dist/{errors-DYyzTYzE-39CV_aMo.mjs.map → errors-BrhQYgdL-D_lIrddD.mjs.map} +1 -1
- package/dist/{full-text-DyeP0p9V.mjs → full-text-CSMAiOYz.mjs} +3 -3
- package/dist/{full-text-DyeP0p9V.mjs.map → full-text-CSMAiOYz.mjs.map} +1 -1
- package/dist/{full-text-Ht1M3vH4.d.mts → full-text-OAJrtCtv.d.mts} +3 -3
- package/dist/{full-text-Ht1M3vH4.d.mts.map → full-text-OAJrtCtv.d.mts.map} +1 -1
- package/dist/{full-text-collection-method-Dye6N2u5-DGPEZRTD.d.mts → full-text-collection-method-BIqQH9XN-CkW2x4u2.d.mts} +4 -4
- package/dist/full-text-collection-method-BIqQH9XN-CkW2x4u2.d.mts.map +1 -0
- package/dist/{full-text-index-definition-D-QC3DO2-DXbQitDn.mjs → full-text-index-definition-BPxQQBuC-BrpDsuJu.mjs} +3 -3
- package/dist/{full-text-index-definition-D-QC3DO2-DXbQitDn.mjs.map → full-text-index-definition-BPxQQBuC-BrpDsuJu.mjs.map} +1 -1
- package/dist/{full-text-parsers-DHtcrdrH-DpbFRMEu.mjs → full-text-parsers-CrMjTR2n-CHDNR_vE.mjs} +4 -4
- package/dist/{full-text-parsers-DHtcrdrH-DpbFRMEu.mjs.map → full-text-parsers-CrMjTR2n-CHDNR_vE.mjs.map} +1 -1
- package/dist/{full-text-search-document-DYNz29YC-CfVTPwIL.mjs → full-text-search-document-DbegbX0J-jrbc8kfp.mjs} +5 -5
- package/dist/{full-text-search-document-DYNz29YC-CfVTPwIL.mjs.map → full-text-search-document-DbegbX0J-jrbc8kfp.mjs.map} +1 -1
- package/dist/{index-types-Bdy_UGfY-CqEPukzT.mjs → index-types-BihjrAAq-ktkeKE97.mjs} +3 -3
- package/dist/{index-types-Bdy_UGfY-CqEPukzT.mjs.map → index-types-BihjrAAq-ktkeKE97.mjs.map} +1 -1
- package/dist/{infer-psl-contract-hJUt-dtW-iwec11iw.mjs → infer-psl-contract-CKP3nwjB-x1_ji7Z9.mjs} +8 -8
- package/dist/{infer-psl-contract-hJUt-dtW-iwec11iw.mjs.map → infer-psl-contract-CKP3nwjB-x1_ji7Z9.mjs.map} +1 -1
- package/dist/migration-CbOh59ZJ.mjs.map +1 -1
- package/dist/{op-factory-call-DJz5P0h1-Cs7DC10N.mjs → op-factory-call-B-EoYQIO-BIfzqVX6.mjs} +7 -7
- package/dist/{op-factory-call-DJz5P0h1-Cs7DC10N.mjs.map → op-factory-call-B-EoYQIO-BIfzqVX6.mjs.map} +1 -1
- package/dist/{operation-types--RnlMCZS-qXBhNS1Q.d.mts → operation-types-CK6URXeD-BsCK-mcK.d.mts} +3 -3
- package/dist/{operation-types--RnlMCZS-qXBhNS1Q.d.mts.map → operation-types-CK6URXeD-BsCK-mcK.d.mts.map} +1 -1
- package/dist/operation-types-ECV4mkfb.d.mts +1 -0
- package/dist/{pack-_zBIeh-3.d.mts → pack-CcQNl-gj.d.mts} +251 -15
- package/dist/pack-CcQNl-gj.d.mts.map +1 -0
- package/dist/{planner-ewMcuoHd-DwCCA-Kc.mjs → planner-BNoWx3rb-rkajA65G.mjs} +10 -10
- package/dist/{planner-ewMcuoHd-DwCCA-Kc.mjs.map → planner-BNoWx3rb-rkajA65G.mjs.map} +1 -1
- package/dist/{planner-ddl-builders-D0r6cT4A-D9Wm1myF.mjs → planner-ddl-builders-Bo_8ozOV-AMIs8Og7.mjs} +3 -3
- package/dist/{planner-ddl-builders-D0r6cT4A-D9Wm1myF.mjs.map → planner-ddl-builders-Bo_8ozOV-AMIs8Og7.mjs.map} +1 -1
- package/dist/{planner-identity-values-CWUHmsB9-CBQ00C_3.mjs → planner-identity-values--pbIuAZR-lgKcM-Zu.mjs} +3 -3
- package/dist/{planner-identity-values-CWUHmsB9-CBQ00C_3.mjs.map → planner-identity-values--pbIuAZR-lgKcM-Zu.mjs.map} +1 -1
- package/dist/{planner-produced-postgres-migration-Dy5zHiFB-BDpfjZD5.mjs → planner-produced-postgres-migration-BIKLMKpf-B5h4hpvf.mjs} +4 -4
- package/dist/{planner-produced-postgres-migration-Dy5zHiFB-BDpfjZD5.mjs.map → planner-produced-postgres-migration-BIKLMKpf-B5h4hpvf.mjs.map} +1 -1
- package/dist/{planner-sql-checks-D0w3Kt_G-Bh1Vlz0T.mjs → planner-sql-checks-pAQfWJz_-CosbjrRp.mjs} +6 -6
- package/dist/{planner-sql-checks-D0w3Kt_G-Bh1Vlz0T.mjs.map → planner-sql-checks-pAQfWJz_-CosbjrRp.mjs.map} +1 -1
- package/dist/{postgres-codec-traits-DY-tFVjg-CjMZUKNx.mjs → postgres-codec-traits-Da2UyO_9-BsGjYJHf.mjs} +3 -3
- package/dist/{postgres-codec-traits-DY-tFVjg-CjMZUKNx.mjs.map → postgres-codec-traits-Da2UyO_9-BsGjYJHf.mjs.map} +1 -1
- package/dist/{postgres-contract-view-o6bwzfH6-D4jvq9PJ.mjs → postgres-contract-view-csjnSNLt-M2QaYBn0.mjs} +8 -8
- package/dist/{postgres-contract-view-o6bwzfH6-D4jvq9PJ.mjs.map → postgres-contract-view-csjnSNLt-M2QaYBn0.mjs.map} +1 -1
- package/dist/{postgres-migration-Dtkb6eDn-CrButm3l.mjs → postgres-migration-BGkcs09r-BmUXCs80.mjs} +11 -11
- package/dist/{postgres-migration-Dtkb6eDn-CrButm3l.mjs.map → postgres-migration-BGkcs09r-BmUXCs80.mjs.map} +1 -1
- package/dist/{postgres-schema-Ysxbqkzr-hFRwS-zT.mjs → postgres-schema-BtW3Sw0F-CH3NqoOo.mjs} +4 -4
- package/dist/{postgres-schema-Ysxbqkzr-hFRwS-zT.mjs.map → postgres-schema-BtW3Sw0F-CH3NqoOo.mjs.map} +1 -1
- package/dist/{prisma7-binding-DGp7Ea38.d.mts → prisma7-binding-XSuxkjqy.d.mts} +258 -17
- package/dist/prisma7-binding-XSuxkjqy.d.mts.map +1 -0
- package/dist/{prisma7-binding-BsucflfD.mjs → prisma7-binding-ZUOUC530.mjs} +8 -8
- package/dist/prisma7-binding-ZUOUC530.mjs.map +1 -0
- package/dist/{render-ops-Db7MhDM0-DsIQjmcY.mjs → render-ops-WhXRiDGu-LZMJf0aV.mjs} +4 -4
- package/dist/{render-ops-Db7MhDM0-DsIQjmcY.mjs.map → render-ops-WhXRiDGu-LZMJf0aV.mjs.map} +1 -1
- package/dist/{resolve-ddl-schema-JoXvD4Rv-CzPayApy.mjs → resolve-ddl-schema-B8cX92k0-DzN6Alxy.mjs} +3 -3
- package/dist/{resolve-ddl-schema-JoXvD4Rv-CzPayApy.mjs.map → resolve-ddl-schema-B8cX92k0-DzN6Alxy.mjs.map} +1 -1
- package/dist/{runtime-CmUxJgD8.d.mts → runtime-1ioqDrqf.d.mts} +3 -3
- package/dist/{runtime-CmUxJgD8.d.mts.map → runtime-1ioqDrqf.d.mts.map} +1 -1
- package/dist/{sql-renderer-CD5aYQos-nO-jTG1T.mjs → sql-renderer-CD5aYQos-DZotmt9U.mjs} +3 -3
- package/dist/{sql-renderer-CD5aYQos-nO-jTG1T.mjs.map → sql-renderer-CD5aYQos-DZotmt9U.mjs.map} +1 -1
- package/dist/{sql-utils-Df-nf6eM-Ov1KgjWm.mjs → sql-utils-DxE_vJt4-Dkjw9U45.mjs} +3 -3
- package/dist/{sql-utils-Df-nf6eM-Ov1KgjWm.mjs.map → sql-utils-DxE_vJt4-Dkjw9U45.mjs.map} +1 -1
- package/dist/target.d.mts +15 -15
- package/dist/target.mjs +31 -31
- package/dist/target__aggregates.d.mts +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.d.mts +3 -3
- package/dist/target__control.mjs +4 -4
- package/dist/target__data-types.mjs +2 -2
- package/dist/target__diff-database-schema.mjs +1 -1
- package/dist/target__errors.mjs +1 -1
- package/dist/target__full-text-index-authoring.mjs +2 -2
- package/dist/target__full-text.d.mts +3 -3
- package/dist/target__full-text.mjs +2 -2
- package/dist/target__issue-planner.mjs +1 -1
- package/dist/target__migration.mjs +2 -2
- package/dist/target__op-factory-call.mjs +1 -1
- package/dist/target__operation-types.d.mts +2 -2
- package/dist/target__pack.d.mts +2 -2
- 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.mjs +1 -1
- package/dist/target__planner-sql-checks.mjs +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.d.mts +4 -4
- package/dist/target__runtime.mjs +9 -9
- package/dist/target__runtime.mjs.map +1 -1
- package/dist/target__schema-ir-annotations.mjs +1 -1
- package/dist/target__sql-utils.mjs +3 -3
- package/dist/target__types.mjs +2 -2
- package/dist/{types-xDgmVoc4.d.mts → types-CJNq93fb.d.mts} +1 -1
- package/package.json +9 -9
- package/dist/authoring-DAorKc0L-DpWukVxn.mjs.map +0 -1
- package/dist/codec-types-o-BM2rPP.d.mts +0 -2
- package/dist/codecs-CaWZPjFi-hllqyGdW.mjs.map +0 -1
- package/dist/codecs-DanVXZ_F-D1_8_x3j.d.mts.map +0 -1
- package/dist/control--DStfvkM.mjs.map +0 -1
- package/dist/full-text-collection-method-Dye6N2u5-DGPEZRTD.d.mts.map +0 -1
- package/dist/operation-types-Dfg-5VmM.d.mts +0 -1
- package/dist/pack-_zBIeh-3.d.mts.map +0 -1
- package/dist/plain-date-time-now-generator-BmOTu5Au-BPhXjp4T.d.mts +0 -19
- package/dist/plain-date-time-now-generator-BmOTu5Au-BPhXjp4T.d.mts.map +0 -1
- package/dist/prisma7-binding-BsucflfD.mjs.map +0 -1
- package/dist/prisma7-binding-DGp7Ea38.d.mts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors-
|
|
1
|
+
{"version":3,"file":"errors-BrhQYgdL-D_lIrddD.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/errors-BrhQYgdL.mjs"],"sourcesContent":["import { structuredError } from \"@internal/utils/structured-error\";\nimport { CliStructuredError } from \"@internal/errors/control\";\n//#region src/core/errors.ts\nfunction postgresError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n/**\n* A `PostgresMigration` operation that needs the materialized control adapter\n* — named by `operation` (e.g. `createTable`, `dropColumn`, `dataTransform`) —\n* was invoked, but the migration was constructed without a `ControlStack`.\n* Concrete authoring usage always goes through the migration CLI entrypoint,\n* which assembles a stack from the loaded `prisma.config.ts`; reaching this\n* error means a test fixture or ad-hoc consumer instantiated `PostgresMigration`\n* with the no-arg form (legal for `operations` / `describe` introspection only).\n*\n* The `operation` argument is required so every throw site names the operation\n* that actually failed; a new operation cannot inherit a misattributed message.\n*\n* Distinct from `MIGRATION.UNFILLED_PLACEHOLDER` (placeholder not filled)\n* and `MIGRATION.DATA_TRANSFORM_CONTRACT_MISMATCH` (data-transform query\n* plan against wrong contract) because the missing input is the stack\n* itself, not the per-operation contract.\n*\n* Lives in `@internal/target-postgres/errors` rather than the shared\n* framework migration errors module because the failure is target-specific:\n* the contract it talks about (`PostgresMigration`, the Postgres control\n* adapter, the Postgres-target stack) only exists in this package.\n*/\nfunction errorPostgresMigrationStackMissing(operation) {\n\treturn new CliStructuredError(\"MIGRATION.POSTGRES_CONTROL_STACK_MISSING\", `PostgresMigration.${operation} requires a control adapter`, {\n\t\twhy: `PostgresMigration.${operation} was invoked on an instance constructed without a ControlStack, so the stored controlAdapter is undefined and the operation cannot lower its plan.`,\n\t\tfix: \"Construct the migration via the migration CLI entrypoint (which assembles a ControlStack from the loaded prisma.config.ts), or pass a ControlStack containing a Postgres adapter to the migration constructor in test fixtures.\",\n\t\tmeta: { operation }\n\t});\n}\nfunction errorTemporalUnavailable(codecId, operation) {\n\treturn postgresError(\"RUNTIME.TEMPORAL_UNAVAILABLE\", `Codec '${codecId}' cannot ${operation} a value because this runtime has no global Temporal implementation.`, {\n\t\twhy: \"Temporal-backed codecs read and write their values through the global Temporal API, which this runtime does not provide.\",\n\t\tfix: \"Run on a runtime with Temporal available, install a Temporal polyfill before creating the client, or author the column with its *String type to read and write PostgreSQL's own text instead.\",\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\toperation\n\t\t}\n\t});\n}\nfunction errorTemporalUnavailableForDefault(generatorId) {\n\treturn postgresError(\"RUNTIME.TEMPORAL_UNAVAILABLE\", `Mutation default generator '${generatorId}' cannot produce a value because this runtime has no global Temporal implementation.`, {\n\t\twhy: \"The generator answers a Temporal-backed column, so the value it produces is a Temporal.Instant, which this runtime cannot construct.\",\n\t\tfix: \"Run on a runtime with Temporal available, install a Temporal polyfill before creating the client, or author the column with `temporal.createdAtString()` / `temporal.updatedAtString()` to store PostgreSQL's own text instead.\",\n\t\tmeta: { generatorId }\n\t});\n}\nfunction errorTemporalUnrepresentable(options) {\n\tconst { codecId, operation, stringType, value, detail } = options;\n\treturn postgresError(operation === \"decode\" ? \"RUNTIME.DECODE_FAILED\" : \"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' cannot represent the value ${operation === \"decode\" ? \"PostgreSQL returned\" : \"the application supplied\"}: ${JSON.stringify(value)} — ${detail}. Use ${stringType} to carry this column as PostgreSQL's own text.`, {\n\t\twhy: `${detail}. Temporal is the authoritative parser and range check for this codec, so a value it cannot express has no representation on this column.`,\n\t\tfix: `Author the column as ${stringType} to read and write PostgreSQL's own text for it, which preserves every value the database accepts.`,\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\toperation,\n\t\t\tvalue,\n\t\t\tstringType\n\t\t},\n\t\t...options.cause === void 0 ? {} : { cause: options.cause }\n\t});\n}\nfunction errorTemporalWrongType(codecId, temporalTag, stringType, received) {\n\treturn postgresError(\"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' encodes a ${temporalTag}, but received ${received}.`, {\n\t\twhy: \"The codec serializes through the Temporal value's own toString(). A different type reaches PostgreSQL in a spelling it does not accept, and the resulting error names the column rather than the codec.\",\n\t\tfix: `Pass a ${temporalTag}, or author the column with its ${stringType} type to write PostgreSQL text directly.`,\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\ttemporalTag,\n\t\t\tstringType,\n\t\t\treceived\n\t\t}\n\t});\n}\n/** A string timestamp codec received something other than text, such as a `Date` from a contract emitted before its generator wrote text. */\nfunction errorTimestampTextWrongType(codecId, received) {\n\treturn postgresError(\"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' writes PostgreSQL's text for the value, but received ${received}.`, {\n\t\twhy: \"The codec sends its value to PostgreSQL unchanged. A Date would be sent in the process's local time zone, and a timestamp column without a time zone would store the wrong wall-clock time.\",\n\t\tfix: \"Pass the timestamp as text, such as \\\"2024-01-02 03:04:05.678\\\". If the value came from a generated default, emit the contract again: a contract emitted by an earlier version pairs this column with timestampNow, which generates a Date.\",\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\treceived\n\t\t}\n\t});\n}\nfunction errorTemporalNonIsoCalendar(codecId, calendarId) {\n\treturn postgresError(\"RUNTIME.ENCODE_FAILED\", `Codec '${codecId}' accepts only the iso8601 calendar, but the value carries '${calendarId}'.`, {\n\t\twhy: \"PostgreSQL stores no calendar alongside a date, so a non-ISO calendar would be discarded on write and the value would read back as a different date than the one authored.\",\n\t\tfix: \"Convert the value with .withCalendar(\\\"iso8601\\\") before writing if the ISO projection is what you mean to store.\",\n\t\tmeta: {\n\t\t\tcodecId,\n\t\t\tcalendarId\n\t\t}\n\t});\n}\n//#endregion\nexport { errorTemporalUnrepresentable as a, postgresError as c, errorTemporalUnavailableForDefault as i, errorTemporalNonIsoCalendar as n, errorTemporalWrongType as o, errorTemporalUnavailable as r, errorTimestampTextWrongType as s, errorPostgresMigrationStackMissing as t };\n\n//# sourceMappingURL=errors-BrhQYgdL.mjs.map"],"mappings":";;;AAGA,SAAS,cAAc,MAAM,SAAS,SAAS;CAC9C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAS,mCAAmC,WAAW;CACtD,OAAO,IAAI,mBAAmB,4CAA4C,qBAAqB,UAAU,8BAA8B;EACtI,KAAK,qBAAqB,UAAU;EACpC,KAAK;EACL,MAAM,EAAE,UAAU;CACnB,CAAC;AACF;AACA,SAAS,yBAAyB,SAAS,WAAW;CACrD,OAAO,cAAc,gCAAgC,UAAU,QAAQ,WAAW,UAAU,uEAAuE;EAClK,KAAK;EACL,KAAK;EACL,MAAM;GACL;GACA;EACD;CACD,CAAC;AACF;AACA,SAAS,mCAAmC,aAAa;CACxD,OAAO,cAAc,gCAAgC,+BAA+B,YAAY,uFAAuF;EACtL,KAAK;EACL,KAAK;EACL,MAAM,EAAE,YAAY;CACrB,CAAC;AACF;AACA,SAAS,6BAA6B,SAAS;CAC9C,MAAM,EAAE,SAAS,WAAW,YAAY,OAAO,WAAW;CAC1D,OAAO,cAAc,cAAc,WAAW,0BAA0B,yBAAyB,UAAU,QAAQ,+BAA+B,cAAc,WAAW,wBAAwB,2BAA2B,IAAI,KAAK,UAAU,KAAK,EAAE,KAAK,OAAO,QAAQ,WAAW,kDAAkD;EACxU,KAAK,GAAG,OAAO;EACf,KAAK,wBAAwB,WAAW;EACxC,MAAM;GACL;GACA;GACA;GACA;EACD;EACA,GAAG,QAAQ,UAAU,KAAK,IAAI,CAAC,IAAI,EAAE,OAAO,QAAQ,MAAM;CAC3D,CAAC;AACF;AACA,SAAS,uBAAuB,SAAS,aAAa,YAAY,UAAU;CAC3E,OAAO,cAAc,yBAAyB,UAAU,QAAQ,cAAc,YAAY,iBAAiB,SAAS,IAAI;EACvH,KAAK;EACL,KAAK,UAAU,YAAY,kCAAkC,WAAW;EACxE,MAAM;GACL;GACA;GACA;GACA;EACD;CACD,CAAC;AACF;;AAEA,SAAS,4BAA4B,SAAS,UAAU;CACvD,OAAO,cAAc,yBAAyB,UAAU,QAAQ,yDAAyD,SAAS,IAAI;EACrI,KAAK;EACL,KAAK;EACL,MAAM;GACL;GACA;EACD;CACD,CAAC;AACF;AACA,SAAS,4BAA4B,SAAS,YAAY;CACzD,OAAO,cAAc,yBAAyB,UAAU,QAAQ,8DAA8D,WAAW,KAAK;EAC7I,KAAK;EACL,KAAK;EACL,MAAM;GACL;GACA;EACD;CACD,CAAC;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as toTsquery, i as languageLiteral } from "./full-text-parsers-
|
|
1
|
+
import { c as postgresError } from "./errors-BrhQYgdL-D_lIrddD.mjs";
|
|
2
|
+
import { c as toTsquery, i as languageLiteral } from "./full-text-parsers-CrMjTR2n-CHDNR_vE.mjs";
|
|
3
3
|
//#region ../../../3-targets/3-targets/postgres/dist/full-text.mjs
|
|
4
4
|
/**
|
|
5
5
|
* An empty term, `''`, is a `tsquery` syntax error; a single space parses as a term with no words,
|
|
@@ -36,4 +36,4 @@ function tsquery(first, ...values) {
|
|
|
36
36
|
//#endregion
|
|
37
37
|
export { tsquery as t };
|
|
38
38
|
|
|
39
|
-
//# sourceMappingURL=full-text-
|
|
39
|
+
//# sourceMappingURL=full-text-CSMAiOYz.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"full-text-
|
|
1
|
+
{"version":3,"file":"full-text-CSMAiOYz.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/full-text.mjs"],"sourcesContent":["import { c as postgresError } from \"./errors-BrhQYgdL.mjs\";\nimport \"./full-text-index-definition-BPxQQBuC.mjs\";\nimport { c as FullTextDocument, i as websearchToTsquery, l as fullTextDocument, n as plaintoTsquery, o as languageLiteral, r as toTsquery, t as phrasetoTsquery } from \"./full-text-parsers-CrMjTR2n.mjs\";\n//#region src/core/tsquery-tag.ts\n/**\n* An empty term, `''`, is a `tsquery` syntax error; a single space parses as a term with no words,\n* as a stop word does.\n*/\nfunction quotedTerm(value) {\n\treturn value === \"\" ? \"' '\" : `'${value.replaceAll(\"\\\\\", \"\\\\\\\\\").replaceAll(\"'\", \"''\")}'`;\n}\nfunction literalPart(strings, index) {\n\tconst part = strings[index];\n\tif (part === void 0) throw postgresError(\"RUNTIME.ARGUMENT_INVALID\", `tsquery: literal part ${index} of the template has an invalid escape sequence.`, {\n\t\twhy: \"JavaScript gives a template tag no text for a literal part with an invalid escape such as \\\\u or \\\\x, so the tsquery syntax written there would be lost.\",\n\t\tfix: \"Write a literal backslash as \\\\\\\\, or remove the escape.\",\n\t\tmeta: {\n\t\t\thelper: \"tsquery\",\n\t\t\targument: `literal part ${index}`,\n\t\t\treceived: strings.raw[index]\n\t\t}\n\t});\n\treturn part;\n}\nfunction assemble(strings, values) {\n\treturn values.reduce((text, value, i) => `${text}${quotedTerm(value)}${literalPart(strings, i + 1)}`, literalPart(strings, 0));\n}\nfunction isTemplate(value) {\n\treturn Array.isArray(value);\n}\nfunction tsquery(first, ...values) {\n\tif (isTemplate(first)) return toTsquery(assemble(first, values));\n\tconst language = first.language ?? \"english\";\n\tlanguageLiteral(\"tsquery\", language);\n\treturn (strings, ...templateValues) => toTsquery(assemble(strings, templateValues), { language });\n}\n//#endregion\nexport { FullTextDocument, fullTextDocument, phrasetoTsquery, plaintoTsquery, toTsquery, tsquery, websearchToTsquery };\n\n//# sourceMappingURL=full-text.mjs.map"],"mappings":";;;;;;;AAQA,SAAS,WAAW,OAAO;CAC1B,OAAO,UAAU,KAAK,QAAQ,IAAI,MAAM,WAAW,MAAM,MAAM,CAAC,CAAC,WAAW,KAAK,IAAI,EAAE;AACxF;AACA,SAAS,YAAY,SAAS,OAAO;CACpC,MAAM,OAAO,QAAQ;CACrB,IAAI,SAAS,KAAK,GAAG,MAAM,cAAc,4BAA4B,yBAAyB,MAAM,mDAAmD;EACtJ,KAAK;EACL,KAAK;EACL,MAAM;GACL,QAAQ;GACR,UAAU,gBAAgB;GAC1B,UAAU,QAAQ,IAAI;EACvB;CACD,CAAC;CACD,OAAO;AACR;AACA,SAAS,SAAS,SAAS,QAAQ;CAClC,OAAO,OAAO,QAAQ,MAAM,OAAO,MAAM,GAAG,OAAO,WAAW,KAAK,IAAI,YAAY,SAAS,IAAI,CAAC,KAAK,YAAY,SAAS,CAAC,CAAC;AAC9H;AACA,SAAS,WAAW,OAAO;CAC1B,OAAO,MAAM,QAAQ,KAAK;AAC3B;AACA,SAAS,QAAQ,OAAO,GAAG,QAAQ;CAClC,IAAI,WAAW,KAAK,GAAG,OAAO,UAAU,SAAS,OAAO,MAAM,CAAC;CAC/D,MAAM,WAAW,MAAM,YAAY;CACnC,gBAAgB,WAAW,QAAQ;CACnC,QAAQ,SAAS,GAAG,mBAAmB,UAAU,SAAS,SAAS,cAAc,GAAG,EAAE,SAAS,CAAC;AACjG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as TsqueryExpression, m as TsqueryParserOptions } from "./operation-types
|
|
2
|
-
import "./full-text-collection-method-
|
|
1
|
+
import { f as TsqueryExpression, m as TsqueryParserOptions } from "./operation-types-CK6URXeD-BsCK-mcK.mjs";
|
|
2
|
+
import "./full-text-collection-method-BIqQH9XN-CkW2x4u2.mjs";
|
|
3
3
|
//#region ../../../3-targets/3-targets/postgres/dist/full-text.d.mts
|
|
4
4
|
//#region src/core/tsquery-tag.d.ts
|
|
5
5
|
type TsqueryTag = (strings: TemplateStringsArray, ...values: string[]) => TsqueryExpression;
|
|
@@ -23,4 +23,4 @@ declare function tsquery(options: TsqueryParserOptions): TsqueryTag;
|
|
|
23
23
|
declare function tsquery(strings: TemplateStringsArray, ...values: string[]): TsqueryExpression;
|
|
24
24
|
//#endregion
|
|
25
25
|
export { tsquery as n, TsqueryTag as t };
|
|
26
|
-
//# sourceMappingURL=full-text-
|
|
26
|
+
//# sourceMappingURL=full-text-OAJrtCtv.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"full-text-
|
|
1
|
+
{"version":3,"file":"full-text-OAJrtCtv.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/full-text.d.mts"],"mappings":";;;;KAGK,cAAc,SAAS,yBAAyB,qBAAqB;;;;;;;;;;;;;;;;;iBAiBzD,QAAQ,SAAS,uBAAuB;iBACxC,QAAQ,SAAS,yBAAyB,mBAAmB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as FULL_TEXT_INDEX_TYPE } from "./full-text-index-definition-D5iBWLss-FifKlctQ.mjs";
|
|
2
|
-
import { n as Resolve, t as ExtractedCodecTypes } from "./codec-type-map-
|
|
3
|
-
import { d as TsqueryArgument } from "./operation-types
|
|
2
|
+
import { n as Resolve, t as ExtractedCodecTypes } from "./codec-type-map-ulrHZjWI-DMkq8jy2.mjs";
|
|
3
|
+
import { d as TsqueryArgument } from "./operation-types-CK6URXeD-BsCK-mcK.mjs";
|
|
4
4
|
import { UniqueIndexNamesOfType } from "@prisma/orm-family-sql/relational-core/index-reference";
|
|
5
5
|
import { CollectionMethodContributionType, CollectionMethodModelType } from "@prisma/orm-family-sql/relational-core/collection-methods";
|
|
6
|
-
//#region ../../../3-targets/3-targets/postgres/dist/full-text-collection-method-
|
|
6
|
+
//#region ../../../3-targets/3-targets/postgres/dist/full-text-collection-method-BIqQH9XN.d.mts
|
|
7
7
|
//#region src/core/full-text-collection-method.d.ts
|
|
8
8
|
/** A `tsquery` expression from a parser or the `tsquery` tag, or a `tsquery` value read back from a query. */
|
|
9
9
|
type PostgresTsqueryArgument = TsqueryArgument<Resolve<ExtractedCodecTypes>>;
|
|
@@ -24,4 +24,4 @@ declare module '@prisma/orm-family-sql/relational-core/collection-methods' {
|
|
|
24
24
|
}
|
|
25
25
|
//#endregion
|
|
26
26
|
export { PostgresTsqueryArgument as n, PostgresFullTextMethods as t };
|
|
27
|
-
//# sourceMappingURL=full-text-collection-method-
|
|
27
|
+
//# sourceMappingURL=full-text-collection-method-BIqQH9XN-CkW2x4u2.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"full-text-collection-method-BIqQH9XN-CkW2x4u2.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/full-text-collection-method-BIqQH9XN.d.mts"],"mappings":";;;;;;;;KAOK,0BAA0B,gBAAgB,QAAQ;UAC7C;WACC,sBAAsB,OAAO;WAC7B;WACA;;KAEN,oBAAoB,cAAc,6BAA6B,iDAAiD,QAAQ,uBAAuB,0CAA0C,wBAAwB,6BAA6B;;UAEzO,gCAAgC;WAC/B,SAAS;;;YAGR;aACC,qBAAqB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as postgresError } from "./errors-BrhQYgdL-D_lIrddD.mjs";
|
|
2
2
|
import { type } from "arktype";
|
|
3
3
|
import { invariant } from "@prisma/orm-framework/utils/assertions";
|
|
4
|
-
//#region ../../../3-targets/3-targets/postgres/dist/full-text-index-definition-
|
|
4
|
+
//#region ../../../3-targets/3-targets/postgres/dist/full-text-index-definition-BPxQQBuC.mjs
|
|
5
5
|
/** The weights Postgres's `setweight` takes, strongest first. Each weight group takes the next one. */
|
|
6
6
|
const FULL_TEXT_WEIGHTS = [
|
|
7
7
|
"A",
|
|
@@ -192,4 +192,4 @@ function invalidFullTextIndex(index, message, why) {
|
|
|
192
192
|
//#endregion
|
|
193
193
|
export { assertFullTextIndexes as a, fullTextIndexOptions as c, isFullTextSearchLanguage as d, weightGroupsOf as f, POSTGRES_TEXT_SEARCH_LANGUAGES as i, fullTextIndexProblems as l, FULL_TEXT_INDEX_TYPE as n, describeFullTextIndexProblem as o, FULL_TEXT_WEIGHTS as r, fullTextIndexDefinitionOf as s, DEFAULT_FULL_TEXT_SEARCH_LANGUAGE as t, fullTextIndexType as u };
|
|
194
194
|
|
|
195
|
-
//# sourceMappingURL=full-text-index-definition-
|
|
195
|
+
//# sourceMappingURL=full-text-index-definition-BPxQQBuC-BrpDsuJu.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"full-text-index-definition-D-QC3DO2-DXbQitDn.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/full-text-index-definition-D-QC3DO2.mjs"],"sourcesContent":["import { s as postgresError } from \"./errors-DYyzTYzE.mjs\";\nimport { type } from \"arktype\";\nimport { invariant } from \"@internal/utils/assertions\";\n//#region src/core/full-text-weight-groups.ts\n/** The weights Postgres's `setweight` takes, strongest first. Each weight group takes the next one. */\nconst FULL_TEXT_WEIGHTS = [\n\t\"A\",\n\t\"B\",\n\t\"C\",\n\t\"D\"\n];\nfunction weightGroupsOf(fields, isField) {\n\tif (isField(fields)) return [[fields]];\n\treturn fields.map((item) => isField(item) ? [item] : item);\n}\n//#endregion\n//#region src/core/text-search-languages.ts\n/**\n* The text-search configurations a stock PostgreSQL server ships with. The language reaches SQL as\n* an inline literal rather than a bound parameter, so only names on this list may be used.\n*/\nconst POSTGRES_TEXT_SEARCH_LANGUAGES = [\n\t\"simple\",\n\t\"arabic\",\n\t\"armenian\",\n\t\"basque\",\n\t\"catalan\",\n\t\"danish\",\n\t\"dutch\",\n\t\"english\",\n\t\"finnish\",\n\t\"french\",\n\t\"german\",\n\t\"greek\",\n\t\"hindi\",\n\t\"hungarian\",\n\t\"indonesian\",\n\t\"irish\",\n\t\"italian\",\n\t\"lithuanian\",\n\t\"nepali\",\n\t\"norwegian\",\n\t\"portuguese\",\n\t\"romanian\",\n\t\"russian\",\n\t\"serbian\",\n\t\"spanish\",\n\t\"swedish\",\n\t\"tamil\",\n\t\"turkish\",\n\t\"yiddish\"\n];\nconst DEFAULT_FULL_TEXT_SEARCH_LANGUAGE = \"english\";\nconst KNOWN_LANGUAGES = new Set(POSTGRES_TEXT_SEARCH_LANGUAGES);\nfunction isFullTextSearchLanguage(language) {\n\treturn KNOWN_LANGUAGES.has(language);\n}\n//#endregion\n//#region src/core/full-text-index-definition.ts\n/** The index type a full-text index is registered under. */\nconst FULL_TEXT_INDEX_TYPE = \"fullText\";\n/** The traits the codec of every column a full-text index covers must carry. */\nconst FULL_TEXT_COLUMN_TRAITS = [\"textual\"];\n/**\n* The rules of a full-text index, stated once: one to four weight groups, none empty, each field\n* once, text columns only, and not unique. Every site that checks a full-text index calls this.\n*/\nfunction fullTextIndexProblems(candidate) {\n\tconst { weightGroups } = candidate;\n\tconst problems = [];\n\tif (weightGroups.length === 0) problems.push({ kind: \"no-fields\" });\n\tif (weightGroups.length > FULL_TEXT_WEIGHTS.length) problems.push({\n\t\tkind: \"too-many-groups\",\n\t\tgroupCount: weightGroups.length\n\t});\n\tweightGroups.forEach((group, position) => {\n\t\tif (group.length === 0) problems.push({\n\t\t\tkind: \"empty-group\",\n\t\t\tposition\n\t\t});\n\t});\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const field of weightGroups.flat()) {\n\t\tif (seen.has(field)) problems.push({\n\t\t\tkind: \"duplicate-field\",\n\t\t\tfield\n\t\t});\n\t\tseen.add(field);\n\t}\n\tconst { codecs } = candidate;\n\tif (codecs !== void 0) for (const field of new Set(weightGroups.flat())) {\n\t\tconst codecId = codecs.codecIdOf(field);\n\t\tif (codecId === void 0 || !carriesFullTextTraits(codecs.traitsOf(codecId))) problems.push({\n\t\t\tkind: \"not-text\",\n\t\t\tfield,\n\t\t\tcodecId\n\t\t});\n\t}\n\tif (candidate.unique === true) problems.push({ kind: \"unique\" });\n\treturn problems;\n}\nfunction carriesFullTextTraits(traits) {\n\treturn traits !== void 0 && FULL_TEXT_COLUMN_TRAITS.every((trait) => traits.includes(trait));\n}\nfunction describeFullTextIndexProblem(subject, problem, fieldLabel = (field) => field) {\n\tswitch (problem.kind) {\n\t\tcase \"no-fields\": return `${subject} needs at least one field.`;\n\t\tcase \"too-many-groups\": return `${subject} takes at most ${FULL_TEXT_WEIGHTS.length} weight groups, one for each of the weights ${FULL_TEXT_WEIGHTS.join(\", \")}, but was given ${problem.groupCount}.`;\n\t\tcase \"empty-group\": return `${subject} has an empty weight group at position ${problem.position + 1}.`;\n\t\tcase \"duplicate-field\": return `${subject} names the field \"${fieldLabel(problem.field)}\" more than once.`;\n\t\tcase \"not-text\": return `${subject} indexes text columns, but \"${fieldLabel(problem.field)}\" is ${problem.codecId === void 0 ? \"not a stored scalar field\" : `stored as \\`${problem.codecId}\\``}.`;\n\t\tcase \"unique\": return `${subject} is unique, but Postgres builds no unique gin index.`;\n\t}\n}\n/** The options of a full-text index: its weight groups, as storage column names, and its language. */\nconst fullTextIndexOptions = type({\n\t\"+\": \"reject\",\n\tweightGroups: type(\"string > 0\").array().array().narrow((weightGroups, ctx) => {\n\t\tconst [problem] = fullTextIndexProblems({ weightGroups });\n\t\treturn problem === void 0 || ctx.reject({ message: describeFullTextIndexProblem(\"a full-text index\", problem) });\n\t}),\n\tlanguage: type.enumerated(...POSTGRES_TEXT_SEARCH_LANGUAGES)\n});\n/**\n* The registration of the full-text index type. Its options are the index's definition, not\n* storage parameters, and the target turns them into a `gin` index over the rendered search\n* document.\n*/\nconst fullTextIndexType = {\n\toptions: fullTextIndexOptions,\n\taccessMethod: \"gin\",\n\tcolumnTraits: FULL_TEXT_COLUMN_TRAITS\n};\n/**\n* The definition a full-text index carries, or `undefined` for an index of any other type. It\n* reads an index {@link assertFullTextIndexes} has accepted, as every loaded contract's has been.\n*/\nfunction fullTextIndexDefinitionOf(index) {\n\tif (index.type !== \"fullText\") return void 0;\n\tconst definition = fullTextIndexOptions(index.options ?? {});\n\tinvariant(!(definition instanceof type.errors), \"a full-text index is read only after its contract was checked\");\n\treturn definition;\n}\n/**\n* Refuses a table's full-text index the contract cannot carry: invalid options, a broken rule of\n* {@link fullTextIndexProblems}, `columns` that are not the fields of its weight groups, in order,\n* or a foreign key that names it as its backing index. The text-columns rule is checked only when\n* `traitsOf` is given.\n*/\nfunction assertFullTextIndexes(table, traitsOf) {\n\tconst codecs = traitsOf === void 0 ? void 0 : {\n\t\tcodecIdOf: (column) => table.columns[column]?.codecId,\n\t\ttraitsOf\n\t};\n\tfor (const index of table.indexes) assertFullTextIndex(index, codecs);\n\tfor (const foreignKey of table.foreignKeys) {\n\t\tconst backing = foreignKey.index;\n\t\tif (backing === void 0 || !(\"name\" in backing)) continue;\n\t\tconst index = table.indexes.find((candidate) => candidate.name === backing.name);\n\t\tif (index?.type !== \"fullText\") continue;\n\t\tthrow postgresError(\"CONTRACT.INDEX_INVALID\", `The foreign key on columns (${foreignKey.source.columns.join(\", \")}) is backed by full-text index \"${index.name}\".`, {\n\t\t\twhy: \"A full-text index is a gin index over a search document rendered from its weight groups, not over its columns, so it does not serve the foreign key's lookups.\",\n\t\t\tfix: \"Re-emit the contract from its source, where a relation cannot name a full-text index as its index.\",\n\t\t\tmeta: {\n\t\t\t\tindex: index.name,\n\t\t\t\tcolumns: foreignKey.source.columns\n\t\t\t}\n\t\t});\n\t}\n}\nfunction assertFullTextIndex(index, codecs) {\n\tif (index.type !== \"fullText\") return;\n\tconst definition = fullTextIndexOptions(index.options ?? {});\n\tif (definition instanceof type.errors) throw invalidFullTextIndex(index, `Full-text index \"${index.name}\" has invalid options: ${definition.summary}`, \"The options of a full-text index are its definition: its weight groups and its language.\");\n\tconst [problem] = fullTextIndexProblems({\n\t\tweightGroups: definition.weightGroups,\n\t\tunique: index.unique,\n\t\tcodecs\n\t});\n\tif (problem !== void 0) throw invalidFullTextIndex(index, describeFullTextIndexProblem(`Full-text index \"${index.name}\"`, problem), \"A full-text index is a gin index over text columns, in one to four weight groups that name each column once.\");\n\tconst fields = definition.weightGroups.flat();\n\tconst columns = index.columns ?? [];\n\tif (columns.length !== fields.length || columns.some((column, i) => column !== fields[i])) throw invalidFullTextIndex(index, `Full-text index \"${index.name}\" covers the columns [${columns.join(\", \")}], but its weight groups name [${fields.join(\", \")}].`, \"The columns of a full-text index are the fields of its weight groups, in order. Foreign-key backing and the printer read the columns; the search document is rendered from the groups, so the two must agree.\");\n}\nfunction invalidFullTextIndex(index, message, why) {\n\treturn postgresError(\"CONTRACT.INDEX_INVALID\", message, {\n\t\twhy,\n\t\tfix: \"Re-emit the contract from its `@@fullTextIndex` or `fullTextIndex` source rather than editing the index by hand.\",\n\t\tmeta: {\n\t\t\tindex: index.name,\n\t\t\tcolumns: index.columns,\n\t\t\toptions: index.options\n\t\t}\n\t});\n}\n//#endregion\nexport { fullTextIndexOptions as a, DEFAULT_FULL_TEXT_SEARCH_LANGUAGE as c, FULL_TEXT_WEIGHTS as d, weightGroupsOf as f, fullTextIndexDefinitionOf as i, POSTGRES_TEXT_SEARCH_LANGUAGES as l, assertFullTextIndexes as n, fullTextIndexProblems as o, describeFullTextIndexProblem as r, fullTextIndexType as s, FULL_TEXT_INDEX_TYPE as t, isFullTextSearchLanguage as u };\n\n//# sourceMappingURL=full-text-index-definition-D-QC3DO2.mjs.map"],"mappings":";;;;;AAKA,MAAM,oBAAoB;CACzB;CACA;CACA;CACA;AACD;AACA,SAAS,eAAe,QAAQ,SAAS;C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C,MAAM,UAAU,MAAM,WAAW,CAAC;CAClC,IAAI,QAAQ,WAAW,OAAO,UAAU,QAAQ,MAAM,QAAQ,MAAM,WAAW,OAAO,EAAE,GAAG,MAAM,qBAAqB,OAAO,oBAAoB,MAAM,KAAK,wBAAwB,QAAQ,KAAK,IAAI,EAAE,iCAAiC,OAAO,KAAK,IAAI,EAAE,KAAK,+MAA+M;AAC/c;AACA,SAAS,qBAAqB,OAAO,SAAS,KAAK;CAClD,OAAO,cAAc,0BAA0B,SAAS;EACvD;EACA,KAAK;EACL,MAAM;GACL,OAAO,MAAM;GACb,SAAS,MAAM;GACf,SAAS,MAAM;EAChB;CACD,CAAC;AACF"}
|
|
1
|
+
{"version":3,"file":"full-text-index-definition-BPxQQBuC-BrpDsuJu.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/full-text-index-definition-BPxQQBuC.mjs"],"sourcesContent":["import { c as postgresError } from \"./errors-BrhQYgdL.mjs\";\nimport { type } from \"arktype\";\nimport { invariant } from \"@internal/utils/assertions\";\n//#region src/core/full-text-weight-groups.ts\n/** The weights Postgres's `setweight` takes, strongest first. Each weight group takes the next one. */\nconst FULL_TEXT_WEIGHTS = [\n\t\"A\",\n\t\"B\",\n\t\"C\",\n\t\"D\"\n];\nfunction weightGroupsOf(fields, isField) {\n\tif (isField(fields)) return [[fields]];\n\treturn fields.map((item) => isField(item) ? [item] : item);\n}\n//#endregion\n//#region src/core/text-search-languages.ts\n/**\n* The text-search configurations a stock PostgreSQL server ships with. The language reaches SQL as\n* an inline literal rather than a bound parameter, so only names on this list may be used.\n*/\nconst POSTGRES_TEXT_SEARCH_LANGUAGES = [\n\t\"simple\",\n\t\"arabic\",\n\t\"armenian\",\n\t\"basque\",\n\t\"catalan\",\n\t\"danish\",\n\t\"dutch\",\n\t\"english\",\n\t\"finnish\",\n\t\"french\",\n\t\"german\",\n\t\"greek\",\n\t\"hindi\",\n\t\"hungarian\",\n\t\"indonesian\",\n\t\"irish\",\n\t\"italian\",\n\t\"lithuanian\",\n\t\"nepali\",\n\t\"norwegian\",\n\t\"portuguese\",\n\t\"romanian\",\n\t\"russian\",\n\t\"serbian\",\n\t\"spanish\",\n\t\"swedish\",\n\t\"tamil\",\n\t\"turkish\",\n\t\"yiddish\"\n];\nconst DEFAULT_FULL_TEXT_SEARCH_LANGUAGE = \"english\";\nconst KNOWN_LANGUAGES = new Set(POSTGRES_TEXT_SEARCH_LANGUAGES);\nfunction isFullTextSearchLanguage(language) {\n\treturn KNOWN_LANGUAGES.has(language);\n}\n//#endregion\n//#region src/core/full-text-index-definition.ts\n/** The index type a full-text index is registered under. */\nconst FULL_TEXT_INDEX_TYPE = \"fullText\";\n/** The traits the codec of every column a full-text index covers must carry. */\nconst FULL_TEXT_COLUMN_TRAITS = [\"textual\"];\n/**\n* The rules of a full-text index, stated once: one to four weight groups, none empty, each field\n* once, text columns only, and not unique. Every site that checks a full-text index calls this.\n*/\nfunction fullTextIndexProblems(candidate) {\n\tconst { weightGroups } = candidate;\n\tconst problems = [];\n\tif (weightGroups.length === 0) problems.push({ kind: \"no-fields\" });\n\tif (weightGroups.length > FULL_TEXT_WEIGHTS.length) problems.push({\n\t\tkind: \"too-many-groups\",\n\t\tgroupCount: weightGroups.length\n\t});\n\tweightGroups.forEach((group, position) => {\n\t\tif (group.length === 0) problems.push({\n\t\t\tkind: \"empty-group\",\n\t\t\tposition\n\t\t});\n\t});\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const field of weightGroups.flat()) {\n\t\tif (seen.has(field)) problems.push({\n\t\t\tkind: \"duplicate-field\",\n\t\t\tfield\n\t\t});\n\t\tseen.add(field);\n\t}\n\tconst { codecs } = candidate;\n\tif (codecs !== void 0) for (const field of new Set(weightGroups.flat())) {\n\t\tconst codecId = codecs.codecIdOf(field);\n\t\tif (codecId === void 0 || !carriesFullTextTraits(codecs.traitsOf(codecId))) problems.push({\n\t\t\tkind: \"not-text\",\n\t\t\tfield,\n\t\t\tcodecId\n\t\t});\n\t}\n\tif (candidate.unique === true) problems.push({ kind: \"unique\" });\n\treturn problems;\n}\nfunction carriesFullTextTraits(traits) {\n\treturn traits !== void 0 && FULL_TEXT_COLUMN_TRAITS.every((trait) => traits.includes(trait));\n}\nfunction describeFullTextIndexProblem(subject, problem, fieldLabel = (field) => field) {\n\tswitch (problem.kind) {\n\t\tcase \"no-fields\": return `${subject} needs at least one field.`;\n\t\tcase \"too-many-groups\": return `${subject} takes at most ${FULL_TEXT_WEIGHTS.length} weight groups, one for each of the weights ${FULL_TEXT_WEIGHTS.join(\", \")}, but was given ${problem.groupCount}.`;\n\t\tcase \"empty-group\": return `${subject} has an empty weight group at position ${problem.position + 1}.`;\n\t\tcase \"duplicate-field\": return `${subject} names the field \"${fieldLabel(problem.field)}\" more than once.`;\n\t\tcase \"not-text\": return `${subject} indexes text columns, but \"${fieldLabel(problem.field)}\" is ${problem.codecId === void 0 ? \"not a stored scalar field\" : `stored as \\`${problem.codecId}\\``}.`;\n\t\tcase \"unique\": return `${subject} is unique, but Postgres builds no unique gin index.`;\n\t}\n}\n/** The options of a full-text index: its weight groups, as storage column names, and its language. */\nconst fullTextIndexOptions = type({\n\t\"+\": \"reject\",\n\tweightGroups: type(\"string > 0\").array().array().narrow((weightGroups, ctx) => {\n\t\tconst [problem] = fullTextIndexProblems({ weightGroups });\n\t\treturn problem === void 0 || ctx.reject({ message: describeFullTextIndexProblem(\"a full-text index\", problem) });\n\t}),\n\tlanguage: type.enumerated(...POSTGRES_TEXT_SEARCH_LANGUAGES)\n});\n/**\n* The registration of the full-text index type. Its options are the index's definition, not\n* storage parameters, and the target turns them into a `gin` index over the rendered search\n* document.\n*/\nconst fullTextIndexType = {\n\toptions: fullTextIndexOptions,\n\taccessMethod: \"gin\",\n\tcolumnTraits: FULL_TEXT_COLUMN_TRAITS\n};\n/**\n* The definition a full-text index carries, or `undefined` for an index of any other type. It\n* reads an index {@link assertFullTextIndexes} has accepted, as every loaded contract's has been.\n*/\nfunction fullTextIndexDefinitionOf(index) {\n\tif (index.type !== \"fullText\") return void 0;\n\tconst definition = fullTextIndexOptions(index.options ?? {});\n\tinvariant(!(definition instanceof type.errors), \"a full-text index is read only after its contract was checked\");\n\treturn definition;\n}\n/**\n* Refuses a table's full-text index the contract cannot carry: invalid options, a broken rule of\n* {@link fullTextIndexProblems}, `columns` that are not the fields of its weight groups, in order,\n* or a foreign key that names it as its backing index. The text-columns rule is checked only when\n* `traitsOf` is given.\n*/\nfunction assertFullTextIndexes(table, traitsOf) {\n\tconst codecs = traitsOf === void 0 ? void 0 : {\n\t\tcodecIdOf: (column) => table.columns[column]?.codecId,\n\t\ttraitsOf\n\t};\n\tfor (const index of table.indexes) assertFullTextIndex(index, codecs);\n\tfor (const foreignKey of table.foreignKeys) {\n\t\tconst backing = foreignKey.index;\n\t\tif (backing === void 0 || !(\"name\" in backing)) continue;\n\t\tconst index = table.indexes.find((candidate) => candidate.name === backing.name);\n\t\tif (index?.type !== \"fullText\") continue;\n\t\tthrow postgresError(\"CONTRACT.INDEX_INVALID\", `The foreign key on columns (${foreignKey.source.columns.join(\", \")}) is backed by full-text index \"${index.name}\".`, {\n\t\t\twhy: \"A full-text index is a gin index over a search document rendered from its weight groups, not over its columns, so it does not serve the foreign key's lookups.\",\n\t\t\tfix: \"Re-emit the contract from its source, where a relation cannot name a full-text index as its index.\",\n\t\t\tmeta: {\n\t\t\t\tindex: index.name,\n\t\t\t\tcolumns: foreignKey.source.columns\n\t\t\t}\n\t\t});\n\t}\n}\nfunction assertFullTextIndex(index, codecs) {\n\tif (index.type !== \"fullText\") return;\n\tconst definition = fullTextIndexOptions(index.options ?? {});\n\tif (definition instanceof type.errors) throw invalidFullTextIndex(index, `Full-text index \"${index.name}\" has invalid options: ${definition.summary}`, \"The options of a full-text index are its definition: its weight groups and its language.\");\n\tconst [problem] = fullTextIndexProblems({\n\t\tweightGroups: definition.weightGroups,\n\t\tunique: index.unique,\n\t\tcodecs\n\t});\n\tif (problem !== void 0) throw invalidFullTextIndex(index, describeFullTextIndexProblem(`Full-text index \"${index.name}\"`, problem), \"A full-text index is a gin index over text columns, in one to four weight groups that name each column once.\");\n\tconst fields = definition.weightGroups.flat();\n\tconst columns = index.columns ?? [];\n\tif (columns.length !== fields.length || columns.some((column, i) => column !== fields[i])) throw invalidFullTextIndex(index, `Full-text index \"${index.name}\" covers the columns [${columns.join(\", \")}], but its weight groups name [${fields.join(\", \")}].`, \"The columns of a full-text index are the fields of its weight groups, in order. Foreign-key backing and the printer read the columns; the search document is rendered from the groups, so the two must agree.\");\n}\nfunction invalidFullTextIndex(index, message, why) {\n\treturn postgresError(\"CONTRACT.INDEX_INVALID\", message, {\n\t\twhy,\n\t\tfix: \"Re-emit the contract from its `@@fullTextIndex` or `fullTextIndex` source rather than editing the index by hand.\",\n\t\tmeta: {\n\t\t\tindex: index.name,\n\t\t\tcolumns: index.columns,\n\t\t\toptions: index.options\n\t\t}\n\t});\n}\n//#endregion\nexport { fullTextIndexOptions as a, DEFAULT_FULL_TEXT_SEARCH_LANGUAGE as c, FULL_TEXT_WEIGHTS as d, weightGroupsOf as f, fullTextIndexDefinitionOf as i, POSTGRES_TEXT_SEARCH_LANGUAGES as l, assertFullTextIndexes as n, fullTextIndexProblems as o, describeFullTextIndexProblem as r, fullTextIndexType as s, FULL_TEXT_INDEX_TYPE as t, isFullTextSearchLanguage as u };\n\n//# sourceMappingURL=full-text-index-definition-BPxQQBuC.mjs.map"],"mappings":";;;;;AAKA,MAAM,oBAAoB;CACzB;CACA;CACA;CACA;AACD;AACA,SAAS,eAAe,QAAQ,SAAS;CACxC,IAAI,QAAQ,MAAM,GAAG,OAAO,CAAC,CAAC,MAAM,CAAC;CACrC,OAAO,OAAO,KAAK,SAAS,QAAQ,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI;AAC1D;;;;;AAOA,MAAM,iCAAiC;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAC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BAAqB,OAAO,SAAS,KAAK;CAClD,OAAO,cAAc,0BAA0B,SAAS;EACvD;EACA,KAAK;EACL,MAAM;GACL,OAAO,MAAM;GACb,SAAS,MAAM;GACf,SAAS,MAAM;EAChB;CACD,CAAC;AACF"}
|
package/dist/{full-text-parsers-DHtcrdrH-DpbFRMEu.mjs → full-text-parsers-CrMjTR2n-CHDNR_vE.mjs}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { S as PG_TEXT_CODEC_ID, j as PG_TSQUERY_CODEC_ID } from "./codec-ids-Cb0yO-IS--e0P2rfI.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { d as isFullTextSearchLanguage, f as weightGroupsOf, i as POSTGRES_TEXT_SEARCH_LANGUAGES, l as fullTextIndexProblems, o as describeFullTextIndexProblem, r as FULL_TEXT_WEIGHTS } from "./full-text-index-definition-
|
|
2
|
+
import { c as postgresError } from "./errors-BrhQYgdL-D_lIrddD.mjs";
|
|
3
|
+
import { d as isFullTextSearchLanguage, f as weightGroupsOf, i as POSTGRES_TEXT_SEARCH_LANGUAGES, l as fullTextIndexProblems, o as describeFullTextIndexProblem, r as FULL_TEXT_WEIGHTS } from "./full-text-index-definition-BPxQQBuC-BrpDsuJu.mjs";
|
|
4
4
|
import { LiteralExpr } from "@prisma/orm-family-sql/relational-core/ast";
|
|
5
5
|
import { buildOperation, toExpr } from "@prisma/orm-family-sql/relational-core/expression";
|
|
6
|
-
//#region ../../../3-targets/3-targets/postgres/dist/full-text-parsers-
|
|
6
|
+
//#region ../../../3-targets/3-targets/postgres/dist/full-text-parsers-CrMjTR2n.mjs
|
|
7
7
|
/**
|
|
8
8
|
* A search document built from columns in weight groups, for `fullTextMatches` and `fullTextRank`
|
|
9
9
|
* to search without a full-text index. Postgres uses an index only for a query over the same
|
|
@@ -136,4 +136,4 @@ const phrasetoTsquery = parser("phrasetoTsquery", "phraseto_tsquery");
|
|
|
136
136
|
//#endregion
|
|
137
137
|
export { normalizationLiteral as a, toTsquery as c, languageLiteral as i, websearchToTsquery as l, fullTextDocument as n, phrasetoTsquery as o, headlineOptionsLiteral as r, plaintoTsquery as s, FullTextDocument as t };
|
|
138
138
|
|
|
139
|
-
//# sourceMappingURL=full-text-parsers-
|
|
139
|
+
//# sourceMappingURL=full-text-parsers-CrMjTR2n-CHDNR_vE.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"full-text-parsers-DHtcrdrH-DpbFRMEu.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/full-text-parsers-DHtcrdrH.mjs"],"sourcesContent":["import { S as PG_TEXT_CODEC_ID, j as PG_TSQUERY_CODEC_ID } from \"./codec-ids-Cb0yO-IS.mjs\";\nimport { s as postgresError } from \"./errors-DYyzTYzE.mjs\";\nimport { d as FULL_TEXT_WEIGHTS, f as weightGroupsOf, l as POSTGRES_TEXT_SEARCH_LANGUAGES, o as fullTextIndexProblems, r as describeFullTextIndexProblem, u as isFullTextSearchLanguage } from \"./full-text-index-definition-D-QC3DO2.mjs\";\nimport { LiteralExpr } from \"@internal/sql-relational-core/ast\";\nimport { buildOperation, toExpr } from \"@internal/sql-relational-core/expression\";\n//#region src/core/full-text-document.ts\n/**\n* A search document built from columns in weight groups, for `fullTextMatches` and `fullTextRank`\n* to search without a full-text index. Postgres uses an index only for a query over the same\n* document, so to search an index, pass the index from the table's `indexes` instead.\n*/\nvar FullTextDocument = class FullTextDocument {\n\tweightGroups;\n\tconstructor(weightGroups) {\n\t\tthis.weightGroups = weightGroups;\n\t\tObject.freeze(this);\n\t}\n\tstatic of(groups) {\n\t\tconst weightGroups = weightGroupsOf(groups, (item) => !Array.isArray(item));\n\t\tlet position = 0;\n\t\tconst [problem] = fullTextIndexProblems({ weightGroups: weightGroups.map((group) => group.map(() => String(position++))) });\n\t\tif (problem !== void 0) throw postgresError(\"RUNTIME.ARGUMENT_INVALID\", describeFullTextIndexProblem(\"fullTextDocument: the document\", problem), {\n\t\t\twhy: `Each weight group takes one of the weights Postgres has, ${FULL_TEXT_WEIGHTS.join(\", \")}.`,\n\t\t\tfix: \"Pass one to four weight groups, none of them empty.\",\n\t\t\tmeta: {\n\t\t\t\thelper: \"fullTextDocument\",\n\t\t\t\targument: \"groups\",\n\t\t\t\treceived: weightGroups.length\n\t\t\t}\n\t\t});\n\t\treturn new FullTextDocument(weightGroups);\n\t}\n};\n/**\n* The search document of columns in weight groups, strongest first: `fullTextDocument([[f.title,\n* f.subtitle], [f.body]])`. Each group takes the next weight, `A` to `D`; a column named twice is\n* not refused, because column expressions have no name to compare.\n*/\nfunction fullTextDocument(groups) {\n\treturn FullTextDocument.of(groups);\n}\n//#endregion\n//#region src/core/full-text-options.ts\n/**\n* Options for the Postgres full-text operations, and the checks each one goes through.\n*\n* Every option here reaches the SQL as an inline literal rather than a bound parameter, because\n* Postgres accepts no parameter in these positions. Each is therefore validated before a statement\n* exists; anything unrecognized throws `RUNTIME.ARGUMENT_INVALID`.\n*\n* The headline markers are the only free text among them, and `checkMarker` restricts their\n* characters precisely so that the literal path never carries a quote or a backslash for\n* `escapeLiteral` to have to reason about.\n*/\nfunction invalid(method, argument, received, why, fix) {\n\treturn postgresError(\"RUNTIME.ARGUMENT_INVALID\", `${method}: ${why}`, {\n\t\twhy: \"The option is written into the SQL as an inline literal, not a bound parameter, so it is checked before the statement is built.\",\n\t\tfix,\n\t\tmeta: {\n\t\t\thelper: method,\n\t\t\targument,\n\t\t\treceived\n\t\t}\n\t});\n}\nfunction languageLiteral(method, language) {\n\tif (!isFullTextSearchLanguage(language)) throw invalid(method, \"language\", language, `'${language}' is not a PostgreSQL text-search configuration Prisma recognizes.`, `Pass one of: ${POSTGRES_TEXT_SEARCH_LANGUAGES.join(\", \")}.`);\n\treturn LiteralExpr.of(language);\n}\nfunction normalizationLiteral(method, normalization) {\n\tif (!Number.isInteger(normalization) || normalization < 0 || normalization > 63) throw invalid(method, \"normalization\", normalization, `normalization must be an integer between 0 and 63, received ${normalization}.`, \"Combine the flags documented for ts_rank, e.g. 32 to divide the rank by itself plus one.\");\n\treturn LiteralExpr.of(normalization);\n}\nfunction checkWordCount(method, argument, value) {\n\tif (!Number.isInteger(value) || value < 1) throw invalid(method, argument, value, `${argument} must be a positive integer, received ${value}.`, \"Pass a whole number of words, one or more.\");\n}\n/** Non-empty, and none of `\"` `,` `=` `\\` or whitespace. */\nconst MARKER = /^[^\"=,\\\\\\s]+$/;\nfunction checkMarker(method, argument, value) {\n\tif (!MARKER.test(value)) throw invalid(method, argument, value, `${argument} must be non-empty and free of \" , = \\\\ and whitespace, received ${JSON.stringify(value)}.`, \"ts_headline parses its options as a quoted, comma-separated list of Key=Value pairs, and the whole list reaches SQL as one literal, so a marker carrying those characters cannot survive either step. Use markup such as <mark> or <b>.\");\n}\n/**\n* The fourth `ts_headline` argument: one text literal of `Key=Value` pairs. Returns `undefined` when\n* nothing but the language was given, so the common call keeps rendering the three-argument form.\n*/\nfunction headlineOptionsLiteral(method, options) {\n\tconst pairs = [];\n\tif (options.startSel !== void 0) {\n\t\tcheckMarker(method, \"startSel\", options.startSel);\n\t\tpairs.push(`StartSel=${options.startSel}`);\n\t}\n\tif (options.stopSel !== void 0) {\n\t\tcheckMarker(method, \"stopSel\", options.stopSel);\n\t\tpairs.push(`StopSel=${options.stopSel}`);\n\t}\n\tif (options.maxWords !== void 0) {\n\t\tcheckWordCount(method, \"maxWords\", options.maxWords);\n\t\tpairs.push(`MaxWords=${options.maxWords}`);\n\t}\n\tif (options.minWords !== void 0) {\n\t\tcheckWordCount(method, \"minWords\", options.minWords);\n\t\tif (options.maxWords !== void 0 && options.minWords >= options.maxWords) throw invalid(method, \"minWords\", options.minWords, `minWords (${options.minWords}) must be below maxWords (${options.maxWords}).`, \"Postgres requires MinWords strictly below MaxWords. Lower minWords, or raise maxWords.\");\n\t\tpairs.push(`MinWords=${options.minWords}`);\n\t}\n\tif (options.highlightAll !== void 0) {\n\t\tif (typeof options.highlightAll !== \"boolean\") throw invalid(method, \"highlightAll\", options.highlightAll, `highlightAll must be a boolean, received ${JSON.stringify(options.highlightAll)}.`, \"Pass true to mark up the whole document, or false to extract fragments.\");\n\t\tpairs.push(`HighlightAll=${options.highlightAll}`);\n\t}\n\treturn pairs.length === 0 ? void 0 : LiteralExpr.of(pairs.join(\", \"));\n}\n//#endregion\n//#region src/core/full-text-parsers.ts\nconst TEXT_REF = { codecId: PG_TEXT_CODEC_ID };\nfunction parser(method, fn) {\n\treturn (text, options = {}) => buildOperation({\n\t\tmethod,\n\t\targs: [toExpr(text, TEXT_REF), languageLiteral(method, options.language ?? \"english\")],\n\t\treturns: {\n\t\t\tcodecId: PG_TSQUERY_CODEC_ID,\n\t\t\tnullable: false\n\t\t},\n\t\tlowering: {\n\t\t\ttargetFamily: \"sql\",\n\t\t\ttemplate: `${fn}({{arg0}}, {{self}})`\n\t\t}\n\t});\n}\n/** Postgres `websearch_to_tsquery`: search-box syntax with quotes, `or` and `-`. Never errors. */\nconst websearchToTsquery = parser(\"websearchToTsquery\", \"websearch_to_tsquery\");\n/**\n* Postgres `to_tsquery`: operator syntax (`'zebra' & !'graze'`, `zeb:*`), each word normalized.\n* Malformed input fails at execution, so pass only text the application wrote, never user input;\n* `tsquery` interpolates user input safely.\n*/\nconst toTsquery = parser(\"toTsquery\", \"to_tsquery\");\n/** Postgres `plainto_tsquery`: every word must match. */\nconst plaintoTsquery = parser(\"plaintoTsquery\", \"plainto_tsquery\");\n/** Postgres `phraseto_tsquery`: the words must match in order. */\nconst phrasetoTsquery = parser(\"phrasetoTsquery\", \"phraseto_tsquery\");\n//#endregion\nexport { headlineOptionsLiteral as a, FullTextDocument as c, websearchToTsquery as i, fullTextDocument as l, plaintoTsquery as n, languageLiteral as o, toTsquery as r, normalizationLiteral as s, phrasetoTsquery as t };\n\n//# sourceMappingURL=full-text-parsers-DHtcrdrH.mjs.map"],"mappings":";;;;;;;;;;;AAWA,IAAI,mBAAmB,MAAM,iBAAiB;CAC7C;CACA,YAAY,cAAc;EACzB,KAAK,eA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;CACA,OAAO,MAAM,WAAW,IAAI,KAAK,IAAI,YAAY,GAAG,MAAM,KAAK,IAAI,CAAC;AACrE;AAGA,MAAM,WAAW,EAAE,SAAS,iBAAiB;AAC7C,SAAS,OAAO,QAAQ,IAAI;CAC3B,QAAQ,MAAM,UAAU,CAAC,MAAM,eAAe;EAC7C;EACA,MAAM,CAAC,OAAO,MAAM,QAAQ,GAAG,gBAAgB,QAAQ,QAAQ,YAAY,SAAS,CAAC;EACrF,SAAS;GACR,SAAS;GACT,UAAU;EACX;EACA,UAAU;GACT,cAAc;GACd,UAAU,GAAG,GAAG;EACjB;CACD,CAAC;AACF;;AAEA,MAAM,qBAAqB,OAAO,sBAAsB,sBAAsB;;;;;;AAM9E,MAAM,YAAY,OAAO,aAAa,YAAY;;AAElD,MAAM,iBAAiB,OAAO,kBAAkB,iBAAiB;;AAEjE,MAAM,kBAAkB,OAAO,mBAAmB,kBAAkB"}
|
|
1
|
+
{"version":3,"file":"full-text-parsers-CrMjTR2n-CHDNR_vE.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/full-text-parsers-CrMjTR2n.mjs"],"sourcesContent":["import { S as PG_TEXT_CODEC_ID, j as PG_TSQUERY_CODEC_ID } from \"./codec-ids-Cb0yO-IS.mjs\";\nimport { c as postgresError } from \"./errors-BrhQYgdL.mjs\";\nimport { d as FULL_TEXT_WEIGHTS, f as weightGroupsOf, l as POSTGRES_TEXT_SEARCH_LANGUAGES, o as fullTextIndexProblems, r as describeFullTextIndexProblem, u as isFullTextSearchLanguage } from \"./full-text-index-definition-BPxQQBuC.mjs\";\nimport { LiteralExpr } from \"@internal/sql-relational-core/ast\";\nimport { buildOperation, toExpr } from \"@internal/sql-relational-core/expression\";\n//#region src/core/full-text-document.ts\n/**\n* A search document built from columns in weight groups, for `fullTextMatches` and `fullTextRank`\n* to search without a full-text index. Postgres uses an index only for a query over the same\n* document, so to search an index, pass the index from the table's `indexes` instead.\n*/\nvar FullTextDocument = class FullTextDocument {\n\tweightGroups;\n\tconstructor(weightGroups) {\n\t\tthis.weightGroups = weightGroups;\n\t\tObject.freeze(this);\n\t}\n\tstatic of(groups) {\n\t\tconst weightGroups = weightGroupsOf(groups, (item) => !Array.isArray(item));\n\t\tlet position = 0;\n\t\tconst [problem] = fullTextIndexProblems({ weightGroups: weightGroups.map((group) => group.map(() => String(position++))) });\n\t\tif (problem !== void 0) throw postgresError(\"RUNTIME.ARGUMENT_INVALID\", describeFullTextIndexProblem(\"fullTextDocument: the document\", problem), {\n\t\t\twhy: `Each weight group takes one of the weights Postgres has, ${FULL_TEXT_WEIGHTS.join(\", \")}.`,\n\t\t\tfix: \"Pass one to four weight groups, none of them empty.\",\n\t\t\tmeta: {\n\t\t\t\thelper: \"fullTextDocument\",\n\t\t\t\targument: \"groups\",\n\t\t\t\treceived: weightGroups.length\n\t\t\t}\n\t\t});\n\t\treturn new FullTextDocument(weightGroups);\n\t}\n};\n/**\n* The search document of columns in weight groups, strongest first: `fullTextDocument([[f.title,\n* f.subtitle], [f.body]])`. Each group takes the next weight, `A` to `D`; a column named twice is\n* not refused, because column expressions have no name to compare.\n*/\nfunction fullTextDocument(groups) {\n\treturn FullTextDocument.of(groups);\n}\n//#endregion\n//#region src/core/full-text-options.ts\n/**\n* Options for the Postgres full-text operations, and the checks each one goes through.\n*\n* Every option here reaches the SQL as an inline literal rather than a bound parameter, because\n* Postgres accepts no parameter in these positions. Each is therefore validated before a statement\n* exists; anything unrecognized throws `RUNTIME.ARGUMENT_INVALID`.\n*\n* The headline markers are the only free text among them, and `checkMarker` restricts their\n* characters precisely so that the literal path never carries a quote or a backslash for\n* `escapeLiteral` to have to reason about.\n*/\nfunction invalid(method, argument, received, why, fix) {\n\treturn postgresError(\"RUNTIME.ARGUMENT_INVALID\", `${method}: ${why}`, {\n\t\twhy: \"The option is written into the SQL as an inline literal, not a bound parameter, so it is checked before the statement is built.\",\n\t\tfix,\n\t\tmeta: {\n\t\t\thelper: method,\n\t\t\targument,\n\t\t\treceived\n\t\t}\n\t});\n}\nfunction languageLiteral(method, language) {\n\tif (!isFullTextSearchLanguage(language)) throw invalid(method, \"language\", language, `'${language}' is not a PostgreSQL text-search configuration Prisma recognizes.`, `Pass one of: ${POSTGRES_TEXT_SEARCH_LANGUAGES.join(\", \")}.`);\n\treturn LiteralExpr.of(language);\n}\nfunction normalizationLiteral(method, normalization) {\n\tif (!Number.isInteger(normalization) || normalization < 0 || normalization > 63) throw invalid(method, \"normalization\", normalization, `normalization must be an integer between 0 and 63, received ${normalization}.`, \"Combine the flags documented for ts_rank, e.g. 32 to divide the rank by itself plus one.\");\n\treturn LiteralExpr.of(normalization);\n}\nfunction checkWordCount(method, argument, value) {\n\tif (!Number.isInteger(value) || value < 1) throw invalid(method, argument, value, `${argument} must be a positive integer, received ${value}.`, \"Pass a whole number of words, one or more.\");\n}\n/** Non-empty, and none of `\"` `,` `=` `\\` or whitespace. */\nconst MARKER = /^[^\"=,\\\\\\s]+$/;\nfunction checkMarker(method, argument, value) {\n\tif (!MARKER.test(value)) throw invalid(method, argument, value, `${argument} must be non-empty and free of \" , = \\\\ and whitespace, received ${JSON.stringify(value)}.`, \"ts_headline parses its options as a quoted, comma-separated list of Key=Value pairs, and the whole list reaches SQL as one literal, so a marker carrying those characters cannot survive either step. Use markup such as <mark> or <b>.\");\n}\n/**\n* The fourth `ts_headline` argument: one text literal of `Key=Value` pairs. Returns `undefined` when\n* nothing but the language was given, so the common call keeps rendering the three-argument form.\n*/\nfunction headlineOptionsLiteral(method, options) {\n\tconst pairs = [];\n\tif (options.startSel !== void 0) {\n\t\tcheckMarker(method, \"startSel\", options.startSel);\n\t\tpairs.push(`StartSel=${options.startSel}`);\n\t}\n\tif (options.stopSel !== void 0) {\n\t\tcheckMarker(method, \"stopSel\", options.stopSel);\n\t\tpairs.push(`StopSel=${options.stopSel}`);\n\t}\n\tif (options.maxWords !== void 0) {\n\t\tcheckWordCount(method, \"maxWords\", options.maxWords);\n\t\tpairs.push(`MaxWords=${options.maxWords}`);\n\t}\n\tif (options.minWords !== void 0) {\n\t\tcheckWordCount(method, \"minWords\", options.minWords);\n\t\tif (options.maxWords !== void 0 && options.minWords >= options.maxWords) throw invalid(method, \"minWords\", options.minWords, `minWords (${options.minWords}) must be below maxWords (${options.maxWords}).`, \"Postgres requires MinWords strictly below MaxWords. Lower minWords, or raise maxWords.\");\n\t\tpairs.push(`MinWords=${options.minWords}`);\n\t}\n\tif (options.highlightAll !== void 0) {\n\t\tif (typeof options.highlightAll !== \"boolean\") throw invalid(method, \"highlightAll\", options.highlightAll, `highlightAll must be a boolean, received ${JSON.stringify(options.highlightAll)}.`, \"Pass true to mark up the whole document, or false to extract fragments.\");\n\t\tpairs.push(`HighlightAll=${options.highlightAll}`);\n\t}\n\treturn pairs.length === 0 ? void 0 : LiteralExpr.of(pairs.join(\", \"));\n}\n//#endregion\n//#region src/core/full-text-parsers.ts\nconst TEXT_REF = { codecId: PG_TEXT_CODEC_ID };\nfunction parser(method, fn) {\n\treturn (text, options = {}) => buildOperation({\n\t\tmethod,\n\t\targs: [toExpr(text, TEXT_REF), languageLiteral(method, options.language ?? \"english\")],\n\t\treturns: {\n\t\t\tcodecId: PG_TSQUERY_CODEC_ID,\n\t\t\tnullable: false\n\t\t},\n\t\tlowering: {\n\t\t\ttargetFamily: \"sql\",\n\t\t\ttemplate: `${fn}({{arg0}}, {{self}})`\n\t\t}\n\t});\n}\n/** Postgres `websearch_to_tsquery`: search-box syntax with quotes, `or` and `-`. Never errors. */\nconst websearchToTsquery = parser(\"websearchToTsquery\", \"websearch_to_tsquery\");\n/**\n* Postgres `to_tsquery`: operator syntax (`'zebra' & !'graze'`, `zeb:*`), each word normalized.\n* Malformed input fails at execution, so pass only text the application wrote, never user input;\n* `tsquery` interpolates user input safely.\n*/\nconst toTsquery = parser(\"toTsquery\", \"to_tsquery\");\n/** Postgres `plainto_tsquery`: every word must match. */\nconst plaintoTsquery = parser(\"plaintoTsquery\", \"plainto_tsquery\");\n/** Postgres `phraseto_tsquery`: the words must match in order. */\nconst phrasetoTsquery = parser(\"phrasetoTsquery\", \"phraseto_tsquery\");\n//#endregion\nexport { headlineOptionsLiteral as a, FullTextDocument as c, websearchToTsquery as i, fullTextDocument as l, plaintoTsquery as n, languageLiteral as o, toTsquery as r, normalizationLiteral as s, phrasetoTsquery as t };\n\n//# sourceMappingURL=full-text-parsers-CrMjTR2n.mjs.map"],"mappings":";;;;;;;;;;;AAWA,IAAI,mBAAmB,MAAM,iBAAiB;CAC7C;CACA,YAAY,cAAc;EACzB,KAAK,eAAe;EACpB,OAAO,OAAO,IAAI;CACnB;CACA,OAAO,GAAG,QAAQ;EACjB,MAAM,eAAe,eAAe,SAAS,SAAS,CAAC,MAAM,QAAQ,IAAI,CAAC;EAC1E,IAAI,WAAW;EACf,MAAM,CAAC,WAAW,sBAAsB,EAAE,cAAc,aAAa,KAAK,UAAU,MAAM,UAAU,OAAO,UAAU,CAAC,CAAC,EAAE,CAAC;EAC1H,IAAI,YAAY,KAAK,GAAG,MAAM,cAAc,4BAA4B,6BAA6B,kCAAkC,OAAO,GAAG;GAChJ,KAAK,4DAA4D,kBAAkB,KAAK,IAAI,EAAE;GAC9F,KAAK;GACL,MAAM;IACL,QAAQ;IACR,UAAU;IACV,UAAU,aAAa;GACxB;EACD,CAAC;EACD,OAAO,IAAI,iBAAiB,YAAY;CACzC;AACD;;;;;;AAMA,SAAS,iBAAiB,QAAQ;CACjC,OAAO,iBAAiB,GAAG,MAAM;AAClC;;;;;;;;;;;;AAcA,SAAS,QAAQ,QAAQ,UAAU,UAAU,KAAK,KAAK;CACtD,OAAO,cAAc,4BAA4B,GAAG,OAAO,IAAI,OAAO;EACrE,KAAK;EACL;EACA,MAAM;GACL,QAAQ;GACR;GACA;EACD;CACD,CAAC;AACF;AACA,SAAS,gBAAgB,QAAQ,UAAU;CAC1C,IAAI,CAAC,yBAAyB,QAAQ,GAAG,MAAM,QAAQ,QAAQ,YAAY,UAAU,IAAI,SAAS,qEAAqE,gBAA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YAAY,QAAQ,UAAU,aAAa,QAAQ,SAAS,4BAA4B,QAAQ,SAAS,KAAK,wFAAwF;EACrS,MAAM,KAAK,YAAY,QAAQ,UAAU;CAC1C;CACA,IAAI,QAAQ,iBAAiB,KAAK,GAAG;EACpC,IAAI,OAAO,QAAQ,iBAAiB,WAAW,MAAM,QAAQ,QAAQ,gBAAgB,QAAQ,cAAc,4CAA4C,KAAK,UAAU,QAAQ,YAAY,EAAE,IAAI,yEAAyE;EACzQ,MAAM,KAAK,gBAAgB,QAAQ,cAAc;CAClD;CACA,OAAO,MAAM,WAAW,IAAI,KAAK,IAAI,YAAY,GAAG,MAAM,KAAK,IAAI,CAAC;AACrE;AAGA,MAAM,WAAW,EAAE,SAAS,iBAAiB;AAC7C,SAAS,OAAO,QAAQ,IAAI;CAC3B,QAAQ,MAAM,UAAU,CAAC,MAAM,eAAe;EAC7C;EACA,MAAM,CAAC,OAAO,MAAM,QAAQ,GAAG,gBAAgB,QAAQ,QAAQ,YAAY,SAAS,CAAC;EACrF,SAAS;GACR,SAAS;GACT,UAAU;EACX;EACA,UAAU;GACT,cAAc;GACd,UAAU,GAAG,GAAG;EACjB;CACD,CAAC;AACF;;AAEA,MAAM,qBAAqB,OAAO,sBAAsB,sBAAsB;;;;;;AAM9E,MAAM,YAAY,OAAO,aAAa,YAAY;;AAElD,MAAM,iBAAiB,OAAO,kBAAkB,iBAAiB;;AAEjE,MAAM,kBAAkB,OAAO,mBAAmB,kBAAkB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as quoteIdentifier } from "./sql-utils-
|
|
3
|
-
import { l as fullTextIndexProblems, o as describeFullTextIndexProblem, r as FULL_TEXT_WEIGHTS } from "./full-text-index-definition-
|
|
1
|
+
import { c as postgresError } from "./errors-BrhQYgdL-D_lIrddD.mjs";
|
|
2
|
+
import { i as quoteIdentifier } from "./sql-utils-DxE_vJt4-Dkjw9U45.mjs";
|
|
3
|
+
import { l as fullTextIndexProblems, o as describeFullTextIndexProblem, r as FULL_TEXT_WEIGHTS } from "./full-text-index-definition-BPxQQBuC-BrpDsuJu.mjs";
|
|
4
4
|
import { assertDefined } from "@prisma/orm-framework/utils/assertions";
|
|
5
|
-
//#region ../../../3-targets/3-targets/postgres/dist/full-text-search-document-
|
|
5
|
+
//#region ../../../3-targets/3-targets/postgres/dist/full-text-search-document-DbegbX0J.mjs
|
|
6
6
|
/**
|
|
7
7
|
* The search document of a full-text index: the expression the index is built over and the one
|
|
8
8
|
* `fullTextMatches` and `fullTextRank` search. Postgres uses an expression index only when the
|
|
@@ -51,4 +51,4 @@ function renderFullTextIndexDocument(definition) {
|
|
|
51
51
|
//#endregion
|
|
52
52
|
export { renderFullTextIndexDocument as n, renderFullTextDocument as t };
|
|
53
53
|
|
|
54
|
-
//# sourceMappingURL=full-text-search-document-
|
|
54
|
+
//# sourceMappingURL=full-text-search-document-DbegbX0J-jrbc8kfp.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"full-text-search-document-
|
|
1
|
+
{"version":3,"file":"full-text-search-document-DbegbX0J-jrbc8kfp.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/full-text-search-document-DbegbX0J.mjs"],"sourcesContent":["import { c as postgresError } from \"./errors-BrhQYgdL.mjs\";\nimport { i as quoteIdentifier } from \"./sql-utils-DxE_vJt4.mjs\";\nimport { d as FULL_TEXT_WEIGHTS, o as fullTextIndexProblems, r as describeFullTextIndexProblem } from \"./full-text-index-definition-BPxQQBuC.mjs\";\nimport { assertDefined } from \"@internal/utils/assertions\";\n//#region src/core/full-text-search-document.ts\n/**\n* The search document of a full-text index: the expression the index is built over and the one\n* `fullTextMatches` and `fullTextRank` search. Postgres uses an expression index only when the\n* query carries the same expression, so the index DDL, the schema node and the query operations\n* all render it here, from weight groups their callers have already checked.\n*\n* One field alone is `to_tsvector(language, field)`. With more fields, each gets its own\n* `to_tsvector`, wrapped in `coalesce(field, '')` since one null would make the whole document\n* null, and they are joined with `||`. With more than one group, each field is weighted with its\n* group's weight, `A` for the first. The document depends on the groups and the language only, so\n* a column's nullability never changes it.\n*/\nfunction renderFullTextDocument(groups, writer) {\n\tconst fieldCount = groups.reduce((count, group) => count + group.length, 0);\n\tconst weighted = groups.length > 1;\n\tconst vectors = groups.flatMap((group, position) => group.map((field) => {\n\t\tconst column = writer.column(field);\n\t\tconst text = fieldCount > 1 ? `coalesce(${column}, '')` : column;\n\t\tconst vector = `to_tsvector(${writer.language}, ${text})`;\n\t\tif (!weighted) return vector;\n\t\tconst weight = FULL_TEXT_WEIGHTS[position];\n\t\tassertDefined(weight, `a full-text document has no weight for group ${position + 1}`);\n\t\treturn `setweight(${vector}, '${weight}')`;\n\t}));\n\tconst [only] = vectors;\n\tassertDefined(only, \"a full-text document has at least one field\");\n\treturn vectors.length === 1 ? only : `(${vectors.join(\" || \")})`;\n}\n/**\n* The search document over storage columns, as the index DDL and the schema node carry it. A\n* definition that breaks a rule of a full-text index is refused.\n*/\nfunction renderFullTextIndexDocument(definition) {\n\tconst { weightGroups } = definition;\n\tconst [problem] = fullTextIndexProblems({ weightGroups });\n\tif (problem !== void 0) throw postgresError(\"CONTRACT.INDEX_INVALID\", describeFullTextIndexProblem(\"The full-text index definition\", problem), {\n\t\twhy: \"Each field of a search document is weighted by the position of its group, so the document is rendered only from weight groups that follow the rules of a full-text index.\",\n\t\tfix: \"Pass one to four non-empty weight groups that name each column once.\",\n\t\tmeta: { weightGroups }\n\t});\n\treturn renderFullTextDocument(weightGroups, {\n\t\tcolumn: quoteIdentifier,\n\t\tlanguage: `'${definition.language}'`\n\t});\n}\n//#endregion\nexport { renderFullTextIndexDocument as n, renderFullTextDocument as t };\n\n//# sourceMappingURL=full-text-search-document-DbegbX0J.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,SAAS,uBAAuB,QAAQ,QAAQ;CAC/C,MAAM,aAAa,OAAO,QAAQ,OAAO,UAAU,QAAQ,MAAM,QAAQ,CAAC;CAC1E,MAAM,WAAW,OAAO,SAAS;CACjC,MAAM,UAAU,OAAO,SAAS,OAAO,aAAa,MAAM,KAAK,UAAU;EACxE,MAAM,SAAS,OAAO,OAAO,KAAK;EAClC,MAAM,OAAO,aAAa,IAAI,YAAY,OAAO,SAAS;EAC1D,MAAM,SAAS,eAAe,OAAO,SAAS,IAAI,KAAK;EACvD,IAAI,CAAC,UAAU,OAAO;EACtB,MAAM,SAAS,kBAAkB;EACjC,cAAc,QAAQ,gDAAgD,WAAW,GAAG;EACpF,OAAO,aAAa,OAAO,KAAK,OAAO;CACxC,CAAC,CAAC;CACF,MAAM,CAAC,QAAQ;CACf,cAAc,MAAM,6CAA6C;CACjE,OAAO,QAAQ,WAAW,IAAI,OAAO,IAAI,QAAQ,KAAK,MAAM,EAAE;AAC/D;;;;;AAKA,SAAS,4BAA4B,YAAY;CAChD,MAAM,EAAE,iBAAiB;CACzB,MAAM,CAAC,WAAW,sBAAsB,EAAE,aAAa,CAAC;CACxD,IAAI,YAAY,KAAK,GAAG,MAAM,cAAc,0BAA0B,6BAA6B,kCAAkC,OAAO,GAAG;EAC9I,KAAK;EACL,KAAK;EACL,MAAM,EAAE,aAAa;CACtB,CAAC;CACD,OAAO,uBAAuB,cAAc;EAC3C,QAAQ;EACR,UAAU,IAAI,WAAW,SAAS;CACnC,CAAC;AACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as FULL_TEXT_INDEX_TYPE, u as fullTextIndexType } from "./full-text-index-definition-
|
|
1
|
+
import { n as FULL_TEXT_INDEX_TYPE, u as fullTextIndexType } from "./full-text-index-definition-BPxQQBuC-BrpDsuJu.mjs";
|
|
2
2
|
import { type } from "arktype";
|
|
3
3
|
import { accessMethodOf, defineIndexTypes } from "@prisma/orm-family-sql/contract/index-types";
|
|
4
|
-
//#region ../../../3-targets/3-targets/postgres/dist/index-types-
|
|
4
|
+
//#region ../../../3-targets/3-targets/postgres/dist/index-types-BihjrAAq.mjs
|
|
5
5
|
const postgresIndexTypes = defineIndexTypes().add("btree", { options: type("object") }).add("hash", { options: type("object") }).add("gin", { options: type("object") }).add("gist", { options: type("object") }).add("spgist", { options: type("object") }).add("brin", { options: type("object") }).add(FULL_TEXT_INDEX_TYPE, fullTextIndexType);
|
|
6
6
|
/** The access method an index of this type is created with; a type Postgres does not register is its own. */
|
|
7
7
|
function postgresAccessMethodOf(typeLiteral) {
|
|
@@ -11,4 +11,4 @@ function postgresAccessMethodOf(typeLiteral) {
|
|
|
11
11
|
//#endregion
|
|
12
12
|
export { postgresIndexTypes as n, postgresAccessMethodOf as t };
|
|
13
13
|
|
|
14
|
-
//# sourceMappingURL=index-types-
|
|
14
|
+
//# sourceMappingURL=index-types-BihjrAAq-ktkeKE97.mjs.map
|
package/dist/{index-types-Bdy_UGfY-CqEPukzT.mjs.map → index-types-BihjrAAq-ktkeKE97.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-types-
|
|
1
|
+
{"version":3,"file":"index-types-BihjrAAq-ktkeKE97.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/index-types-BihjrAAq.mjs"],"sourcesContent":["import { s as fullTextIndexType, t as FULL_TEXT_INDEX_TYPE } from \"./full-text-index-definition-BPxQQBuC.mjs\";\nimport { type } from \"arktype\";\nimport { accessMethodOf, defineIndexTypes } from \"@internal/sql-contract/index-types\";\n//#region src/core/index-types.ts\nconst postgresIndexTypes = defineIndexTypes().add(\"btree\", { options: type(\"object\") }).add(\"hash\", { options: type(\"object\") }).add(\"gin\", { options: type(\"object\") }).add(\"gist\", { options: type(\"object\") }).add(\"spgist\", { options: type(\"object\") }).add(\"brin\", { options: type(\"object\") }).add(FULL_TEXT_INDEX_TYPE, fullTextIndexType);\n/** The access method an index of this type is created with; a type Postgres does not register is its own. */\nfunction postgresAccessMethodOf(typeLiteral) {\n\tconst entry = postgresIndexTypes.entries.find((candidate) => candidate.type === typeLiteral);\n\treturn entry === void 0 ? typeLiteral : accessMethodOf(entry);\n}\n//#endregion\nexport { postgresIndexTypes as n, postgresAccessMethodOf as t };\n\n//# sourceMappingURL=index-types-BihjrAAq.mjs.map"],"mappings":";;;;AAIA,MAAM,qBAAqB,iBAAiB,CAAC,CAAC,IAAI,SAAS,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,sBAAsB,iBAAiB;;AAEjV,SAAS,uBAAuB,aAAa;CAC5C,MAAM,QAAQ,mBAAmB,QAAQ,MAAM,cAAc,UAAU,SAAS,WAAW;CAC3F,OAAO,UAAU,KAAK,IAAI,cAAc,eAAe,KAAK;AAC7D"}
|
package/dist/{infer-psl-contract-hJUt-dtW-iwec11iw.mjs → infer-psl-contract-CKP3nwjB-x1_ji7Z9.mjs}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { S as PG_TEXT_CODEC_ID } from "./codec-ids-Cb0yO-IS--e0P2rfI.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { A as pgJsonb, i as createPostgresBuiltinDataTypeLookup, k as pgJson } from "./data-types-
|
|
4
|
-
import { r as createPostgresBuiltinCodecLookup } from "./codec-registry-
|
|
5
|
-
import {
|
|
6
|
-
import { t as postgresRenderCheckExpressions } from "./check-expressions-
|
|
7
|
-
import { t as postgresDataTypeEntries } from "./data-type-entries-
|
|
2
|
+
import { c as postgresError } from "./errors-BrhQYgdL-D_lIrddD.mjs";
|
|
3
|
+
import { A as pgJsonb, i as createPostgresBuiltinDataTypeLookup, k as pgJson } from "./data-types-CQs1yW4F-CSexn8mK.mjs";
|
|
4
|
+
import { r as createPostgresBuiltinCodecLookup } from "./codec-registry-CvKdYTYj-4xXqgKKs.mjs";
|
|
5
|
+
import { t as POLICY_BLOCK_KEYWORDS } from "./authoring-mmK5aduF-BltVG_HJ.mjs";
|
|
6
|
+
import { t as postgresRenderCheckExpressions } from "./check-expressions-DoxKokL1-RVvYRdA6.mjs";
|
|
7
|
+
import { t as postgresDataTypeEntries } from "./data-type-entries-KJ4Mn8C5-DY3rLz33.mjs";
|
|
8
8
|
import { n as readPostgresDefault } from "./default-normalizer-BqFHmlox-CP8ywN-r.mjs";
|
|
9
9
|
import { codecForRef, readContractValue } from "@prisma/orm-framework/components/codec";
|
|
10
10
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
@@ -24,7 +24,7 @@ import { buildChildRelationField, deriveRelationFieldName, inferRelations, toEnu
|
|
|
24
24
|
import { UNSPECIFIED_PSL_NAMESPACE_ID, makePslNamespace, makePslNamespaceEntries } from "@prisma/orm-framework/components/psl-ast";
|
|
25
25
|
import { parsePslPositionalArgs } from "@prisma/orm-framework/psl-parser/interpret";
|
|
26
26
|
import { isColumnDefault } from "@prisma/orm-framework/contract/types";
|
|
27
|
-
//#region ../../../3-targets/3-targets/postgres/dist/infer-psl-contract-
|
|
27
|
+
//#region ../../../3-targets/3-targets/postgres/dist/infer-psl-contract-CKP3nwjB.mjs
|
|
28
28
|
const SYNTHETIC_SPAN = {
|
|
29
29
|
start: {
|
|
30
30
|
offset: 0,
|
|
@@ -1142,4 +1142,4 @@ function buildPslDocumentAst(schemaIR, options, foreignKeyExtras, namespaceName,
|
|
|
1142
1142
|
//#endregion
|
|
1143
1143
|
export { buildIndexAttribute as a, buildNativeEnumBlock as c, inferPostgresPslContract as d, namedArg as f, positionalArg as g, parseDefaultAttributeString as h, buildFullTextIndexAttribute as i, buildPslDocumentAst as l, noInferredDefaults as m, buildAttribute as n, buildMapAttribute as o, noColumnDefaults as p, buildCheckAttribute as r, buildModelConstraintAttribute as s, SYNTHETIC_SPAN as t, createPostgresDefaultMapping as u };
|
|
1144
1144
|
|
|
1145
|
-
//# sourceMappingURL=infer-psl-contract-
|
|
1145
|
+
//# sourceMappingURL=infer-psl-contract-CKP3nwjB-x1_ji7Z9.mjs.map
|