@prisma/orm-target-postgres 8.0.0-rc.18-dev.7 → 8.0.0-rc.18-dev.9
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-CC4Hpwbp.d.mts +403 -0
- package/dist/adapter-CC4Hpwbp.d.mts.map +1 -0
- package/dist/{adapter-DXUJlrmB-7Lk8j0kE.mjs → adapter-ofQbK8p5-DdhE9Pbv.mjs} +6 -6
- package/dist/adapter-ofQbK8p5-DdhE9Pbv.mjs.map +1 -0
- package/dist/adapter.d.mts +7 -7
- package/dist/adapter.mjs +6 -6
- package/dist/adapter__adapter.d.mts +2 -2
- package/dist/adapter__adapter.mjs +3 -3
- package/dist/adapter__column-types.d.mts +1 -1
- package/dist/adapter__control.d.mts +3 -3
- package/dist/adapter__control.mjs +6 -6
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.mjs +4 -4
- 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-B6ZQFHFE.mjs → aggregates-Brwk0sYS.mjs} +89 -31
- package/dist/aggregates-Brwk0sYS.mjs.map +1 -0
- package/dist/aggregates-rj1su5Va.d.mts +318 -0
- package/dist/aggregates-rj1su5Va.d.mts.map +1 -0
- package/dist/{authoring-CTn87jlt-VHX7hiNU.mjs → authoring-DOWd8Fpc-BE703X_J.mjs} +4 -4
- package/dist/{authoring-CTn87jlt-VHX7hiNU.mjs.map → authoring-DOWd8Fpc-BE703X_J.mjs.map} +1 -1
- package/dist/{autoincrement-widths-DbyXRo5B-BUVCYb_V.mjs → autoincrement-widths-DuylBJSq-T8e6pnMZ.mjs} +3 -3
- package/dist/{autoincrement-widths-DbyXRo5B-BUVCYb_V.mjs.map → autoincrement-widths-DuylBJSq-T8e6pnMZ.mjs.map} +1 -1
- package/dist/{codec-helpers-D0ah5Wb8-wdJJZ_8s.mjs → codec-helpers-IfGdyCFt-ihgFCc7D.mjs} +3 -40
- package/dist/codec-helpers-IfGdyCFt-ihgFCc7D.mjs.map +1 -0
- package/dist/{codec-registry-BWUY_QLt-CzrMkP9N.mjs → codec-registry-DSRFjaLX-Dwg0yBK7.mjs} +4 -4
- package/dist/{codec-registry-BWUY_QLt-CzrMkP9N.mjs.map → codec-registry-DSRFjaLX-Dwg0yBK7.mjs.map} +1 -1
- package/dist/{codec-type-map-DueQFJ3a-DKLtMn3R.d.mts → codec-type-map-BznmYkRz-QD11Yx27.d.mts} +3 -3
- package/dist/{codec-type-map-DueQFJ3a-DKLtMn3R.d.mts.map → codec-type-map-BznmYkRz-QD11Yx27.d.mts.map} +1 -1
- package/dist/codec-types-BZXuhZ1c-B9YQf_UN.d.mts +84 -0
- package/dist/codec-types-BZXuhZ1c-B9YQf_UN.d.mts.map +1 -0
- package/dist/codec-types-ZfL8TSVm.d.mts +2 -0
- package/dist/{codecs-ChjCJY5k.d.mts → codecs-BChKdFcD.d.mts} +2 -2
- package/dist/{codecs-ChjCJY5k.d.mts.map → codecs-BChKdFcD.d.mts.map} +1 -1
- package/dist/{codecs-y1gOMMt--DKWhYGN5.d.mts → codecs-CCzJelD2-bt89qO8s.d.mts} +2 -13
- package/dist/codecs-CCzJelD2-bt89qO8s.d.mts.map +1 -0
- package/dist/{codecs-Cb5S70Lx-WRSQkpza.mjs → codecs-CQaKsvhH-X9bscCr9.mjs} +4 -37
- package/dist/codecs-CQaKsvhH-X9bscCr9.mjs.map +1 -0
- package/dist/{column-types-Dq7mC_dL.d.mts → column-types-COdejX_b.d.mts} +44 -9
- package/dist/column-types-COdejX_b.d.mts.map +1 -0
- package/dist/{control-adapter-EatqP8Vh-CYWBxnLn.mjs → contract-contributions-RR2DymD_-B0xeL8RT.mjs} +61 -9
- package/dist/contract-contributions-RR2DymD_-B0xeL8RT.mjs.map +1 -0
- package/dist/{control-0nEwuD8F.d.mts → control-B0dyj3WB.d.mts} +121 -1
- package/dist/control-B0dyj3WB.d.mts.map +1 -0
- package/dist/{control-CBG2OxfU.d.mts → control-B2jgQGkQ.d.mts} +2 -2
- package/dist/{control-CBG2OxfU.d.mts.map → control-B2jgQGkQ.d.mts.map} +1 -1
- package/dist/{control-DxX_0Qw4.mjs → control-BeGPfK6d.mjs} +93 -55
- package/dist/control-BeGPfK6d.mjs.map +1 -0
- package/dist/{control-policy-BlVJAbUZ-BjQYqA_a.mjs → control-policy-DVEQWEOE-dVbGW9Xq.mjs} +6 -6
- package/dist/{control-policy-BlVJAbUZ-BjQYqA_a.mjs.map → control-policy-DVEQWEOE-dVbGW9Xq.mjs.map} +1 -1
- package/dist/{data-type-entries-15a-vBdm-vIj5l1u5.mjs → data-type-entries-MxmSzT8p-D8CgbLxS.mjs} +3 -3
- package/dist/{data-type-entries-15a-vBdm-vIj5l1u5.mjs.map → data-type-entries-MxmSzT8p-D8CgbLxS.mjs.map} +1 -1
- package/dist/{data-types-K6tDhu1D-BN--9o1o.mjs → data-types-DnIWGq_1-DTMjYG8M.mjs} +3 -3
- package/dist/{data-types-K6tDhu1D-BN--9o1o.mjs.map → data-types-DnIWGq_1-DTMjYG8M.mjs.map} +1 -1
- package/dist/{default-normalizer-Bf_Fhv4v-CugGfLAe.mjs → default-normalizer-BnxtqsRm-CDjZe4vK.mjs} +3 -3
- package/dist/{default-normalizer-Bf_Fhv4v-CugGfLAe.mjs.map → default-normalizer-BnxtqsRm-CDjZe4vK.mjs.map} +1 -1
- package/dist/{descriptor-meta-D5OipARb-6znWwvjE.mjs → descriptor-meta-642teZF4-CAMY6SnM.mjs} +6 -6
- package/dist/{descriptor-meta-D5OipARb-6znWwvjE.mjs.map → descriptor-meta-642teZF4-CAMY6SnM.mjs.map} +1 -1
- package/dist/{descriptor-meta-runtime-D4a-hsd_-B_YkwgHQ.mjs → descriptor-meta-runtime-CpGl9XzU-CZHs_TNl.mjs} +3 -3
- package/dist/{descriptor-meta-runtime-D4a-hsd_-B_YkwgHQ.mjs.map → descriptor-meta-runtime-CpGl9XzU-CZHs_TNl.mjs.map} +1 -1
- package/dist/descriptor-meta-uNeqfA6R-Rrzkj6Ci.mjs +36 -0
- package/dist/descriptor-meta-uNeqfA6R-Rrzkj6Ci.mjs.map +1 -0
- package/dist/{diff-database-schema-Ce8vWO7g-gdU3XGHC.mjs → diff-database-schema-K7Wr3Cso-BkIytT4i.mjs} +4 -4
- package/dist/{diff-database-schema-Ce8vWO7g-gdU3XGHC.mjs.map → diff-database-schema-K7Wr3Cso-BkIytT4i.mjs.map} +1 -1
- package/dist/{full-text-Li_RyodV.d.mts → full-text-DzMPXaCj.d.mts} +3 -3
- package/dist/{full-text-Li_RyodV.d.mts.map → full-text-DzMPXaCj.d.mts.map} +1 -1
- package/dist/{full-text-collection-method-DtXutLv6-DEBX-ltM.d.mts → full-text-collection-method-B9e_oZFf-dyzLx5i6.d.mts} +5 -5
- package/dist/full-text-collection-method-B9e_oZFf-dyzLx5i6.d.mts.map +1 -0
- package/dist/full-text-index-authoring-Ca6bWXyG.d.mts.map +1 -1
- package/dist/{full-text-index-definition-CwWV12H4-DNafWNux.d.mts → full-text-index-definition-D5iBWLss-FifKlctQ.d.mts} +22 -4
- package/dist/full-text-index-definition-D5iBWLss-FifKlctQ.d.mts.map +1 -0
- package/dist/{infer-psl-contract-B_Bl_RJC-BfJbvDUs.mjs → infer-psl-contract-l55XjKWM-O6kcTBJE.mjs} +91 -194
- package/dist/infer-psl-contract-l55XjKWM-O6kcTBJE.mjs.map +1 -0
- package/dist/migration-CbOh59ZJ.mjs.map +1 -1
- package/dist/{op-factory-call-Bf00O3tt-aQ8OJ00n.mjs → op-factory-call-TVvGnrxe-BYM7yGIk.mjs} +3 -3
- package/dist/{op-factory-call-Bf00O3tt-aQ8OJ00n.mjs.map → op-factory-call-TVvGnrxe-BYM7yGIk.mjs.map} +1 -1
- package/dist/{operation-types-C4VAniFe-D2eX0-ZZ.d.mts → operation-types-BAiYtHkM-BN_YTibJ.d.mts} +22 -17
- package/dist/operation-types-BAiYtHkM-BN_YTibJ.d.mts.map +1 -0
- package/dist/operation-types-CScw-diG.d.mts +1 -0
- package/dist/{pack-BOVET-UW.d.mts → pack-D9gjv6Kw.d.mts} +8 -5
- package/dist/pack-D9gjv6Kw.d.mts.map +1 -0
- package/dist/{planner-ddl-builders-BcJ353Wj-Dfaixf4X.mjs → planner-ddl-builders-DWMjQBmJ-CjtMnGSN.mjs} +4 -4
- package/dist/{planner-ddl-builders-BcJ353Wj-Dfaixf4X.mjs.map → planner-ddl-builders-DWMjQBmJ-CjtMnGSN.mjs.map} +1 -1
- package/dist/{planner-identity-values-BZdomjRU-G521DabU.mjs → planner-identity-values-DwvdO5iZ-C9_lmJx6.mjs} +3 -3
- package/dist/{planner-identity-values-BZdomjRU-G521DabU.mjs.map → planner-identity-values-DwvdO5iZ-C9_lmJx6.mjs.map} +1 -1
- package/dist/{planner-produced-postgres-migration-UY6o1KtK-D8AyKNJX.mjs → planner-produced-postgres-migration-CzGwh41Q-CoO2N7Ka.mjs} +4 -4
- package/dist/{planner-produced-postgres-migration-UY6o1KtK-D8AyKNJX.mjs.map → planner-produced-postgres-migration-CzGwh41Q-CoO2N7Ka.mjs.map} +1 -1
- package/dist/{planner-BnZ7Ma0m-CuFTpofj.mjs → planner-q9c5nQlC-BvjDJEmC.mjs} +7 -7
- package/dist/{planner-BnZ7Ma0m-CuFTpofj.mjs.map → planner-q9c5nQlC-BvjDJEmC.mjs.map} +1 -1
- package/dist/{postgres-codec-traits-BV62PF0L-NuMNArAx.mjs → postgres-codec-traits-DOTVjmpT-B4f6Rkh7.mjs} +3 -3
- package/dist/{postgres-codec-traits-BV62PF0L-NuMNArAx.mjs.map → postgres-codec-traits-DOTVjmpT-B4f6Rkh7.mjs.map} +1 -1
- package/dist/{postgres-contract-view-3yxlqPfK-CRFLsRHu.mjs → postgres-contract-view-D_z_HJ5K-BAzRKiIf.mjs} +6 -6
- package/dist/{postgres-contract-view-3yxlqPfK-CRFLsRHu.mjs.map → postgres-contract-view-D_z_HJ5K-BAzRKiIf.mjs.map} +1 -1
- package/dist/{postgres-migration-DxPGyge8-ChvbfTP4.mjs → postgres-migration-DplG05vQ-Cyy1zJjv.mjs} +8 -8
- package/dist/{postgres-migration-DxPGyge8-ChvbfTP4.mjs.map → postgres-migration-DplG05vQ-Cyy1zJjv.mjs.map} +1 -1
- package/dist/{prisma7-binding-BQ5VOUjh.d.mts → prisma7-binding-Bi4R4axY.d.mts} +8 -5
- package/dist/prisma7-binding-Bi4R4axY.d.mts.map +1 -0
- package/dist/{prisma7-binding-nxvUgQTH.mjs → prisma7-binding-BvuMHLdX.mjs} +18 -7
- package/dist/prisma7-binding-BvuMHLdX.mjs.map +1 -0
- package/dist/{render-ops-Cj_4STo9-hZVcK77c.mjs → render-ops-D7WBk4VN-Ba7n9A9L.mjs} +3 -3
- package/dist/{render-ops-Cj_4STo9-hZVcK77c.mjs.map → render-ops-D7WBk4VN-Ba7n9A9L.mjs.map} +1 -1
- package/dist/{runtime-qn4hL1wO.d.mts → runtime-C1HMiDVY.d.mts} +2 -2
- package/dist/{runtime-qn4hL1wO.d.mts.map → runtime-C1HMiDVY.d.mts.map} +1 -1
- package/dist/{sql-renderer-Q8LMpTcq-twOHNp2T.mjs → sql-renderer-Q8LMpTcq-CliGmy0r.mjs} +2 -2
- package/dist/{sql-renderer-Q8LMpTcq-twOHNp2T.mjs.map → sql-renderer-Q8LMpTcq-CliGmy0r.mjs.map} +1 -1
- package/dist/{sql-utils-CGSJ8fH0.d.mts → sql-utils-B7LfCQCB.d.mts} +2 -2
- package/dist/sql-utils-B7LfCQCB.d.mts.map +1 -0
- package/dist/target.d.mts +16 -17
- package/dist/target.mjs +20 -20
- package/dist/target__aggregates.d.mts +1 -1
- package/dist/target__aggregates.mjs +1 -1
- package/dist/target__codec-types.d.mts +4 -4
- package/dist/target__codecs.d.mts +2 -2
- package/dist/target__codecs.mjs +2 -2
- package/dist/target__control.d.mts +1 -1
- package/dist/target__control.mjs +3 -3
- package/dist/target__data-types.mjs +2 -2
- package/dist/target__default-normalizer.mjs +1 -1
- package/dist/target__diff-database-schema.mjs +1 -1
- package/dist/target__full-text-index-authoring.d.mts +1 -2
- package/dist/target__full-text-index-authoring.mjs +1 -1
- package/dist/target__full-text.d.mts +4 -4
- 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 +4 -4
- package/dist/target__pack.d.mts +3 -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.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 +2 -2
- package/dist/target__runtime.mjs +3 -3
- package/dist/target__runtime.mjs.map +1 -1
- package/dist/target__sql-utils.d.mts +2 -2
- package/dist/{types-Dnrjripb.d.mts → types-DIUPMK41.d.mts} +1 -1
- package/package.json +9 -9
- package/dist/adapter-DXUJlrmB-7Lk8j0kE.mjs.map +0 -1
- package/dist/adapter-giV1nqJs.d.mts +0 -58
- package/dist/adapter-giV1nqJs.d.mts.map +0 -1
- package/dist/aggregates-B6ZQFHFE.mjs.map +0 -1
- package/dist/aggregates-CgqNfj2O.d.mts +0 -10
- package/dist/aggregates-CgqNfj2O.d.mts.map +0 -1
- package/dist/codec-helpers-D0ah5Wb8-wdJJZ_8s.mjs.map +0 -1
- package/dist/codec-types-CY3pawL3.d.mts +0 -2
- package/dist/codec-types-CYsrudBM-DcYPKpS1.d.mts +0 -51
- package/dist/codec-types-CYsrudBM-DcYPKpS1.d.mts.map +0 -1
- package/dist/codecs-Cb5S70Lx-WRSQkpza.mjs.map +0 -1
- package/dist/codecs-y1gOMMt--DKWhYGN5.d.mts.map +0 -1
- package/dist/column-types-Dq7mC_dL.d.mts.map +0 -1
- package/dist/control-0nEwuD8F.d.mts.map +0 -1
- package/dist/control-DxX_0Qw4.mjs.map +0 -1
- package/dist/control-adapter-EatqP8Vh-CYWBxnLn.mjs.map +0 -1
- package/dist/descriptor-meta-DThyh4X8-rA2bozYa.mjs +0 -53
- package/dist/descriptor-meta-DThyh4X8-rA2bozYa.mjs.map +0 -1
- package/dist/full-text-collection-method-DtXutLv6-DEBX-ltM.d.mts.map +0 -1
- package/dist/full-text-index-definition-CwWV12H4-DNafWNux.d.mts.map +0 -1
- package/dist/infer-psl-contract-B_Bl_RJC-BfJbvDUs.mjs.map +0 -1
- package/dist/operation-types-C4VAniFe-D2eX0-ZZ.d.mts.map +0 -1
- package/dist/operation-types-ChXH8kV_.d.mts +0 -1
- package/dist/pack-BOVET-UW.d.mts.map +0 -1
- package/dist/prisma7-binding-BQ5VOUjh.d.mts.map +0 -1
- package/dist/prisma7-binding-nxvUgQTH.mjs.map +0 -1
- package/dist/sql-utils-CGSJ8fH0.d.mts.map +0 -1
- package/dist/text-search-languages-CO6775ih-DMYr9qsC.d.mts +0 -22
- package/dist/text-search-languages-CO6775ih-DMYr9qsC.d.mts.map +0 -1
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { A as PG_TIME_TEMPORAL_CODEC_ID, B as SQL_VARCHAR_CODEC_ID, C as PG_TIMESTAMPTZ_DATE_CODEC_ID, D as PG_TIMESTAMP_TEMPORAL_CODEC_ID, E as PG_TIMESTAMP_STRING_CODEC_ID, F as PG_VARCHAR_CODEC_ID, L as SQL_FLOAT_CODEC_ID, M as PG_UNBOUNDED_INT_CODEC_ID, O as PG_TIMETZ_CODEC_ID, R as SQL_INT_CODEC_ID, S as PG_TEXT_CODEC_ID, T as PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, _ as PG_INT_CODEC_ID, a as PG_DATE_STRING_CODEC_ID, b as PG_NUMERIC_CODEC_ID, c as PG_FLOAT4_CODEC_ID, d as PG_INET_CODEC_ID, f as PG_INT2_CODEC_ID, g as PG_INTERVAL_CODEC_ID, h as PG_INT8_NUMBER_CODEC_ID, k as PG_TIME_STRING_CODEC_ID, l as PG_FLOAT8_CODEC_ID, m as PG_INT8_CODEC_ID, o as PG_DATE_TEMPORAL_CODEC_ID, p as PG_INT4_CODEC_ID, s as PG_ENUM_CODEC_ID, u as PG_FLOAT_CODEC_ID, w as PG_TIMESTAMPTZ_STRING_CODEC_ID, x as PG_TEXT_ARRAY_CODEC_ID } from "./codec-ids-Cb0yO-IS--e0P2rfI.mjs";
|
|
2
2
|
import { AggregateExpr, CastExpr } from "@prisma/orm-family-sql/relational-core/ast";
|
|
3
3
|
//#region ../../../3-targets/3-targets/postgres/dist/aggregates.mjs
|
|
4
|
-
const overCodec = (codecId) => ({
|
|
5
|
-
kind: "codec",
|
|
6
|
-
codecId
|
|
7
|
-
});
|
|
8
|
-
const overTrait = (trait) => ({
|
|
9
|
-
kind: "trait",
|
|
10
|
-
trait
|
|
11
|
-
});
|
|
12
4
|
/**
|
|
13
5
|
* An aggregate whose result is one of the input values, so it carries the input's codec — type parameters included, since a `numeric(10,3)` minimum is still a `numeric(10,3)`.
|
|
14
6
|
*/
|
|
@@ -82,10 +74,22 @@ const MIN_MAX_PRESERVING_CODECS = [
|
|
|
82
74
|
*/
|
|
83
75
|
const MIN_MAX_WIDENS_TO_TEXT = [PG_VARCHAR_CODEC_ID, SQL_VARCHAR_CODEC_ID];
|
|
84
76
|
const orderingDescriptors = (operation) => [
|
|
85
|
-
preservesInput(operation,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
77
|
+
preservesInput(operation, {
|
|
78
|
+
kind: "trait",
|
|
79
|
+
trait: "numeric"
|
|
80
|
+
}),
|
|
81
|
+
preservesInput(operation, {
|
|
82
|
+
kind: "trait",
|
|
83
|
+
trait: "textual"
|
|
84
|
+
}),
|
|
85
|
+
...MIN_MAX_WIDENS_TO_TEXT.map((codecId) => produces(operation, {
|
|
86
|
+
kind: "codec",
|
|
87
|
+
codecId
|
|
88
|
+
}, PG_TEXT_CODEC_ID)),
|
|
89
|
+
...MIN_MAX_PRESERVING_CODECS.map((codecId) => preservesInput(operation, {
|
|
90
|
+
kind: "codec",
|
|
91
|
+
codecId
|
|
92
|
+
}))
|
|
89
93
|
];
|
|
90
94
|
/**
|
|
91
95
|
* Every aggregate overload the PostgreSQL target contributes. The adapter lists these on `types.aggregateDescriptors`, from where emission derives result types and the runtime builds its resolution registry.
|
|
@@ -112,28 +116,82 @@ const postgresAggregateDescriptors = [
|
|
|
112
116
|
emptyResultJson: "0",
|
|
113
117
|
lower: computedWith("count")
|
|
114
118
|
},
|
|
115
|
-
...FIXED_WIDTH_INTEGER_CODECS.map((codecId) => produces("sum",
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
produces("
|
|
132
|
-
|
|
119
|
+
...FIXED_WIDTH_INTEGER_CODECS.map((codecId) => produces("sum", {
|
|
120
|
+
kind: "codec",
|
|
121
|
+
codecId
|
|
122
|
+
}, PG_INT8_NUMBER_CODEC_ID)),
|
|
123
|
+
...SUM_WIDENS_TO_INT8.map((codecId) => producesVia("sumBigInt", {
|
|
124
|
+
kind: "codec",
|
|
125
|
+
codecId
|
|
126
|
+
}, PG_INT8_CODEC_ID, computedWith("sum"))),
|
|
127
|
+
...SUM_WIDENS_TO_NUMERIC.map((codecId) => producesVia("sumBigInt", {
|
|
128
|
+
kind: "codec",
|
|
129
|
+
codecId
|
|
130
|
+
}, PG_UNBOUNDED_INT_CODEC_ID, computedWith("sum"))),
|
|
131
|
+
producesVia("sumBigInt", {
|
|
132
|
+
kind: "codec",
|
|
133
|
+
codecId: PG_UNBOUNDED_INT_CODEC_ID
|
|
134
|
+
}, PG_UNBOUNDED_INT_CODEC_ID, computedWith("sum")),
|
|
135
|
+
produces("sum", {
|
|
136
|
+
kind: "codec",
|
|
137
|
+
codecId: PG_FLOAT4_CODEC_ID
|
|
138
|
+
}, PG_FLOAT4_CODEC_ID),
|
|
139
|
+
...DOUBLE_PRECISION_CODECS.map((codecId) => produces("sum", {
|
|
140
|
+
kind: "codec",
|
|
141
|
+
codecId
|
|
142
|
+
}, PG_FLOAT8_CODEC_ID)),
|
|
143
|
+
produces("sum", {
|
|
144
|
+
kind: "codec",
|
|
145
|
+
codecId: PG_NUMERIC_CODEC_ID
|
|
146
|
+
}, PG_NUMERIC_CODEC_ID),
|
|
147
|
+
produces("sum", {
|
|
148
|
+
kind: "codec",
|
|
149
|
+
codecId: PG_UNBOUNDED_INT_CODEC_ID
|
|
150
|
+
}, PG_UNBOUNDED_INT_CODEC_ID),
|
|
151
|
+
produces("sum", {
|
|
152
|
+
kind: "codec",
|
|
153
|
+
codecId: PG_INTERVAL_CODEC_ID
|
|
154
|
+
}, PG_INTERVAL_CODEC_ID),
|
|
155
|
+
produces("sum", {
|
|
156
|
+
kind: "codec",
|
|
157
|
+
codecId: PG_TIME_STRING_CODEC_ID
|
|
158
|
+
}, PG_INTERVAL_CODEC_ID),
|
|
159
|
+
produces("sum", {
|
|
160
|
+
kind: "codec",
|
|
161
|
+
codecId: PG_TIME_TEMPORAL_CODEC_ID
|
|
162
|
+
}, PG_INTERVAL_CODEC_ID),
|
|
163
|
+
...INTEGER_CODECS.map((codecId) => producesVia("avg", {
|
|
164
|
+
kind: "codec",
|
|
165
|
+
codecId
|
|
166
|
+
}, PG_FLOAT8_CODEC_ID, avgCastToFloat8)),
|
|
167
|
+
...[...INTEGER_CODECS, PG_NUMERIC_CODEC_ID].map((codecId) => producesVia("avgDecimal", {
|
|
168
|
+
kind: "codec",
|
|
169
|
+
codecId
|
|
170
|
+
}, PG_NUMERIC_CODEC_ID, computedWith("avg"))),
|
|
171
|
+
...[PG_FLOAT4_CODEC_ID, ...DOUBLE_PRECISION_CODECS].map((codecId) => produces("avg", {
|
|
172
|
+
kind: "codec",
|
|
173
|
+
codecId
|
|
174
|
+
}, PG_FLOAT8_CODEC_ID)),
|
|
175
|
+
produces("avg", {
|
|
176
|
+
kind: "codec",
|
|
177
|
+
codecId: PG_NUMERIC_CODEC_ID
|
|
178
|
+
}, PG_NUMERIC_CODEC_ID),
|
|
179
|
+
produces("avg", {
|
|
180
|
+
kind: "codec",
|
|
181
|
+
codecId: PG_INTERVAL_CODEC_ID
|
|
182
|
+
}, PG_INTERVAL_CODEC_ID),
|
|
183
|
+
produces("avg", {
|
|
184
|
+
kind: "codec",
|
|
185
|
+
codecId: PG_TIME_STRING_CODEC_ID
|
|
186
|
+
}, PG_INTERVAL_CODEC_ID),
|
|
187
|
+
produces("avg", {
|
|
188
|
+
kind: "codec",
|
|
189
|
+
codecId: PG_TIME_TEMPORAL_CODEC_ID
|
|
190
|
+
}, PG_INTERVAL_CODEC_ID),
|
|
133
191
|
...orderingDescriptors("min"),
|
|
134
192
|
...orderingDescriptors("max")
|
|
135
193
|
];
|
|
136
194
|
//#endregion
|
|
137
195
|
export { postgresAggregateDescriptors as t };
|
|
138
196
|
|
|
139
|
-
//# sourceMappingURL=aggregates-
|
|
197
|
+
//# sourceMappingURL=aggregates-Brwk0sYS.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregates-Brwk0sYS.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/aggregates.mjs"],"sourcesContent":["import { A as PG_TIME_TEMPORAL_CODEC_ID, B as SQL_VARCHAR_CODEC_ID, C as PG_TIMESTAMPTZ_DATE_CODEC_ID, D as PG_TIMESTAMP_TEMPORAL_CODEC_ID, E as PG_TIMESTAMP_STRING_CODEC_ID, F as PG_VARCHAR_CODEC_ID, L as SQL_FLOAT_CODEC_ID, M as PG_UNBOUNDED_INT_CODEC_ID, O as PG_TIMETZ_CODEC_ID, R as SQL_INT_CODEC_ID, S as PG_TEXT_CODEC_ID, T as PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, _ as PG_INT_CODEC_ID, a as PG_DATE_STRING_CODEC_ID, b as PG_NUMERIC_CODEC_ID, c as PG_FLOAT4_CODEC_ID, d as PG_INET_CODEC_ID, f as PG_INT2_CODEC_ID, g as PG_INTERVAL_CODEC_ID, h as PG_INT8_NUMBER_CODEC_ID, k as PG_TIME_STRING_CODEC_ID, l as PG_FLOAT8_CODEC_ID, m as PG_INT8_CODEC_ID, o as PG_DATE_TEMPORAL_CODEC_ID, p as PG_INT4_CODEC_ID, s as PG_ENUM_CODEC_ID, u as PG_FLOAT_CODEC_ID, w as PG_TIMESTAMPTZ_STRING_CODEC_ID, x as PG_TEXT_ARRAY_CODEC_ID } from \"./codec-ids-Cb0yO-IS.mjs\";\nimport { AggregateExpr, CastExpr } from \"@internal/sql-relational-core/ast\";\n//#region src/core/aggregates.ts\n/**\n* An aggregate whose result is one of the input values, so it carries the input's codec — type parameters included, since a `numeric(10,3)` minimum is still a `numeric(10,3)`.\n*/\nconst preservesInput = (operation, input) => ({\n\toperation,\n\tinput,\n\toutput: { kind: \"self\" },\n\tnullable: true\n});\n/**\n* An aggregate whose result is a new value. It names its result codec without type parameters: a sum leaves the input's width behind (a `numeric(10,3)` column sums to an unconstrained `numeric`), so carrying the input's parameters into the result would understate the range.\n*/\nconst produces = (operation, input, codecId) => ({\n\toperation,\n\tinput,\n\toutput: {\n\t\tkind: \"codec\",\n\t\tcodecId\n\t},\n\tnullable: true\n});\n/** The same, for an operation that builds its own expression. */\nconst producesVia = (operation, input, codecId, lower) => ({\n\t...produces(operation, input, codecId),\n\tlower\n});\n/** The SQL aggregate a lossless variant computes with. `sumBigInt` is a `sum` read exactly, `countBigInt` a `count`, `avgDecimal` an `avg`: the variants differ in how the result is read, never in what the database computes. */\nconst computedWith = (fn) => ({ expr }) => new AggregateExpr(fn, expr);\n/** `avg` over an integer column, rounded once. PostgreSQL computes the exact `numeric` mean and the cast turns that one value into the `double precision` the result codec reads; casting the input instead would round every value before it was accumulated. */\nconst avgCastToFloat8 = ({ expr }) => CastExpr.as(new AggregateExpr(\"avg\", expr), \"float8\");\n/** Integer codecs whose `sum` widens to `bigint` — every built-in integer bar the 64-bit ones, whose sum goes to `numeric` instead. */\nconst SUM_WIDENS_TO_INT8 = [\n\tPG_INT2_CODEC_ID,\n\tPG_INT4_CODEC_ID,\n\tPG_INT_CODEC_ID,\n\tSQL_INT_CODEC_ID\n];\n/** The 64-bit integer codecs: PostgreSQL computes their `sum` as a `numeric`, a total free to leave the range an `int8` holds. */\nconst SUM_WIDENS_TO_NUMERIC = [PG_INT8_CODEC_ID, PG_INT8_NUMBER_CODEC_ID];\n/** The integer codecs a `sum` reads back as a `number`: every fixed-width one, whatever its own application type. */\nconst FIXED_WIDTH_INTEGER_CODECS = [...SUM_WIDENS_TO_INT8, ...SUM_WIDENS_TO_NUMERIC];\n/** Every built-in integer codec, the unbounded one included: `avg` over any of them is a `numeric` mean. */\nconst INTEGER_CODECS = [...FIXED_WIDTH_INTEGER_CODECS, PG_UNBOUNDED_INT_CODEC_ID];\n/** Codecs over `double precision`, whose `sum` and `avg` stay there. */\nconst DOUBLE_PRECISION_CODECS = [\n\tPG_FLOAT8_CODEC_ID,\n\tPG_FLOAT_CODEC_ID,\n\tSQL_FLOAT_CODEC_ID\n];\n/**\n* Codecs whose `min`/`max` returns the input type and whose traits do not already say so: the temporal types, `inet`, `text[]`, and native enums advertise `order` or `equality`, which `uuid`, `bit`, `bit varying`, `bool`, `bytea`, `json`, and `jsonb` also advertise while having no `min`/`max` at all. An exact overload per supported codec is therefore the only honest shape — a trait fallback over `order` would claim the unsupported ones too.\n*/\nconst MIN_MAX_PRESERVING_CODECS = [\n\tPG_ENUM_CODEC_ID,\n\tPG_TIMETZ_CODEC_ID,\n\tPG_INTERVAL_CODEC_ID,\n\tPG_INET_CODEC_ID,\n\tPG_TEXT_ARRAY_CODEC_ID,\n\tPG_DATE_STRING_CODEC_ID,\n\tPG_TIMESTAMP_STRING_CODEC_ID,\n\tPG_TIMESTAMPTZ_STRING_CODEC_ID,\n\tPG_TIMESTAMPTZ_DATE_CODEC_ID,\n\tPG_TIME_STRING_CODEC_ID,\n\tPG_DATE_TEMPORAL_CODEC_ID,\n\tPG_TIMESTAMP_TEMPORAL_CODEC_ID,\n\tPG_TIMESTAMPTZ_TEMPORAL_CODEC_ID,\n\tPG_TIME_TEMPORAL_CODEC_ID\n];\n/**\n* `min`/`max` over the character types, where the trait rung does hold: every `textual` codec returns its input type — except the two `varchar` codecs, whose result PostgreSQL widens to `text`, and which therefore claim themselves exactly and shadow the fallback.\n*/\nconst MIN_MAX_WIDENS_TO_TEXT = [PG_VARCHAR_CODEC_ID, SQL_VARCHAR_CODEC_ID];\nconst orderingDescriptors = (operation) => [\n\tpreservesInput(operation, {\n\t\tkind: \"trait\",\n\t\ttrait: \"numeric\"\n\t}),\n\tpreservesInput(operation, {\n\t\tkind: \"trait\",\n\t\ttrait: \"textual\"\n\t}),\n\t...MIN_MAX_WIDENS_TO_TEXT.map((codecId) => produces(operation, {\n\t\tkind: \"codec\",\n\t\tcodecId\n\t}, PG_TEXT_CODEC_ID)),\n\t...MIN_MAX_PRESERVING_CODECS.map((codecId) => preservesInput(operation, {\n\t\tkind: \"codec\",\n\t\tcodecId\n\t}))\n];\n/**\n* Every aggregate overload the PostgreSQL target contributes. The adapter lists these on `types.aggregateDescriptors`, from where emission derives result types and the runtime builds its resolution registry.\n*/\nconst postgresAggregateDescriptors = [\n\t{\n\t\toperation: \"count\",\n\t\tinput: { kind: \"any\" },\n\t\toutput: {\n\t\t\tkind: \"codec\",\n\t\t\tcodecId: PG_INT8_NUMBER_CODEC_ID\n\t\t},\n\t\tnullable: false,\n\t\temptyResultJson: \"0\"\n\t},\n\t{\n\t\toperation: \"countBigInt\",\n\t\tinput: { kind: \"any\" },\n\t\toutput: {\n\t\t\tkind: \"codec\",\n\t\t\tcodecId: PG_INT8_CODEC_ID\n\t\t},\n\t\tnullable: false,\n\t\temptyResultJson: \"0\",\n\t\tlower: computedWith(\"count\")\n\t},\n\t...FIXED_WIDTH_INTEGER_CODECS.map((codecId) => produces(\"sum\", {\n\t\tkind: \"codec\",\n\t\tcodecId\n\t}, PG_INT8_NUMBER_CODEC_ID)),\n\t...SUM_WIDENS_TO_INT8.map((codecId) => producesVia(\"sumBigInt\", {\n\t\tkind: \"codec\",\n\t\tcodecId\n\t}, PG_INT8_CODEC_ID, computedWith(\"sum\"))),\n\t...SUM_WIDENS_TO_NUMERIC.map((codecId) => producesVia(\"sumBigInt\", {\n\t\tkind: \"codec\",\n\t\tcodecId\n\t}, PG_UNBOUNDED_INT_CODEC_ID, computedWith(\"sum\"))),\n\tproducesVia(\"sumBigInt\", {\n\t\tkind: \"codec\",\n\t\tcodecId: PG_UNBOUNDED_INT_CODEC_ID\n\t}, PG_UNBOUNDED_INT_CODEC_ID, computedWith(\"sum\")),\n\tproduces(\"sum\", {\n\t\tkind: \"codec\",\n\t\tcodecId: PG_FLOAT4_CODEC_ID\n\t}, PG_FLOAT4_CODEC_ID),\n\t...DOUBLE_PRECISION_CODECS.map((codecId) => produces(\"sum\", {\n\t\tkind: \"codec\",\n\t\tcodecId\n\t}, PG_FLOAT8_CODEC_ID)),\n\tproduces(\"sum\", {\n\t\tkind: \"codec\",\n\t\tcodecId: PG_NUMERIC_CODEC_ID\n\t}, PG_NUMERIC_CODEC_ID),\n\tproduces(\"sum\", {\n\t\tkind: \"codec\",\n\t\tcodecId: PG_UNBOUNDED_INT_CODEC_ID\n\t}, PG_UNBOUNDED_INT_CODEC_ID),\n\tproduces(\"sum\", {\n\t\tkind: \"codec\",\n\t\tcodecId: PG_INTERVAL_CODEC_ID\n\t}, PG_INTERVAL_CODEC_ID),\n\tproduces(\"sum\", {\n\t\tkind: \"codec\",\n\t\tcodecId: PG_TIME_STRING_CODEC_ID\n\t}, PG_INTERVAL_CODEC_ID),\n\tproduces(\"sum\", {\n\t\tkind: \"codec\",\n\t\tcodecId: PG_TIME_TEMPORAL_CODEC_ID\n\t}, PG_INTERVAL_CODEC_ID),\n\t...INTEGER_CODECS.map((codecId) => producesVia(\"avg\", {\n\t\tkind: \"codec\",\n\t\tcodecId\n\t}, PG_FLOAT8_CODEC_ID, avgCastToFloat8)),\n\t...[...INTEGER_CODECS, PG_NUMERIC_CODEC_ID].map((codecId) => producesVia(\"avgDecimal\", {\n\t\tkind: \"codec\",\n\t\tcodecId\n\t}, PG_NUMERIC_CODEC_ID, computedWith(\"avg\"))),\n\t...[PG_FLOAT4_CODEC_ID, ...DOUBLE_PRECISION_CODECS].map((codecId) => produces(\"avg\", {\n\t\tkind: \"codec\",\n\t\tcodecId\n\t}, PG_FLOAT8_CODEC_ID)),\n\tproduces(\"avg\", {\n\t\tkind: \"codec\",\n\t\tcodecId: PG_NUMERIC_CODEC_ID\n\t}, PG_NUMERIC_CODEC_ID),\n\tproduces(\"avg\", {\n\t\tkind: \"codec\",\n\t\tcodecId: PG_INTERVAL_CODEC_ID\n\t}, PG_INTERVAL_CODEC_ID),\n\tproduces(\"avg\", {\n\t\tkind: \"codec\",\n\t\tcodecId: PG_TIME_STRING_CODEC_ID\n\t}, PG_INTERVAL_CODEC_ID),\n\tproduces(\"avg\", {\n\t\tkind: \"codec\",\n\t\tcodecId: PG_TIME_TEMPORAL_CODEC_ID\n\t}, PG_INTERVAL_CODEC_ID),\n\t...orderingDescriptors(\"min\"),\n\t...orderingDescriptors(\"max\")\n];\n//#endregion\nexport { postgresAggregateDescriptors };\n\n//# sourceMappingURL=aggregates.mjs.map"],"mappings":"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"}
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import { SqlAggregateLowering } from "@prisma/orm-family-sql/relational-core/aggregate-descriptor-registry";
|
|
2
|
+
//#region ../../../3-targets/3-targets/postgres/dist/aggregates.d.mts
|
|
3
|
+
//#region src/core/aggregates.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Every aggregate overload the PostgreSQL target contributes. The adapter lists these on `types.aggregateDescriptors`, from where emission derives result types and the runtime builds its resolution registry.
|
|
6
|
+
*/
|
|
7
|
+
declare const postgresAggregateDescriptors: readonly [{
|
|
8
|
+
readonly operation: "count";
|
|
9
|
+
readonly input: {
|
|
10
|
+
readonly kind: "any";
|
|
11
|
+
};
|
|
12
|
+
readonly output: {
|
|
13
|
+
readonly kind: "codec";
|
|
14
|
+
readonly codecId: "pg/int8number@1";
|
|
15
|
+
};
|
|
16
|
+
readonly nullable: false;
|
|
17
|
+
readonly emptyResultJson: "0";
|
|
18
|
+
}, {
|
|
19
|
+
readonly operation: "countBigInt";
|
|
20
|
+
readonly input: {
|
|
21
|
+
readonly kind: "any";
|
|
22
|
+
};
|
|
23
|
+
readonly output: {
|
|
24
|
+
readonly kind: "codec";
|
|
25
|
+
readonly codecId: "pg/int8@1";
|
|
26
|
+
};
|
|
27
|
+
readonly nullable: false;
|
|
28
|
+
readonly emptyResultJson: "0";
|
|
29
|
+
readonly lower: SqlAggregateLowering;
|
|
30
|
+
}, ...({
|
|
31
|
+
readonly operation: "sum";
|
|
32
|
+
readonly input: {
|
|
33
|
+
readonly kind: "codec";
|
|
34
|
+
readonly codecId: "pg/int8number@1" | "pg/int8@1" | "pg/int2@1" | "pg/int4@1" | "pg/int@1" | "sql/int@1";
|
|
35
|
+
};
|
|
36
|
+
readonly output: {
|
|
37
|
+
readonly kind: "codec";
|
|
38
|
+
readonly codecId: "pg/int8number@1";
|
|
39
|
+
};
|
|
40
|
+
readonly nullable: true;
|
|
41
|
+
} | {
|
|
42
|
+
readonly lower: SqlAggregateLowering;
|
|
43
|
+
readonly operation: "sumBigInt";
|
|
44
|
+
readonly input: {
|
|
45
|
+
readonly kind: "codec";
|
|
46
|
+
readonly codecId: "pg/int2@1" | "pg/int4@1" | "pg/int@1" | "sql/int@1";
|
|
47
|
+
};
|
|
48
|
+
readonly output: {
|
|
49
|
+
readonly kind: "codec";
|
|
50
|
+
readonly codecId: "pg/int8@1";
|
|
51
|
+
};
|
|
52
|
+
readonly nullable: true;
|
|
53
|
+
} | {
|
|
54
|
+
readonly lower: SqlAggregateLowering;
|
|
55
|
+
readonly operation: "sumBigInt";
|
|
56
|
+
readonly input: {
|
|
57
|
+
readonly kind: "codec";
|
|
58
|
+
readonly codecId: "pg/int8number@1" | "pg/int8@1";
|
|
59
|
+
};
|
|
60
|
+
readonly output: {
|
|
61
|
+
readonly kind: "codec";
|
|
62
|
+
readonly codecId: "pg/unboundedint@1";
|
|
63
|
+
};
|
|
64
|
+
readonly nullable: true;
|
|
65
|
+
} | {
|
|
66
|
+
readonly lower: SqlAggregateLowering;
|
|
67
|
+
readonly operation: "sumBigInt";
|
|
68
|
+
readonly input: {
|
|
69
|
+
readonly kind: "codec";
|
|
70
|
+
readonly codecId: "pg/unboundedint@1";
|
|
71
|
+
};
|
|
72
|
+
readonly output: {
|
|
73
|
+
readonly kind: "codec";
|
|
74
|
+
readonly codecId: "pg/unboundedint@1";
|
|
75
|
+
};
|
|
76
|
+
readonly nullable: true;
|
|
77
|
+
} | {
|
|
78
|
+
readonly operation: "sum";
|
|
79
|
+
readonly input: {
|
|
80
|
+
readonly kind: "codec";
|
|
81
|
+
readonly codecId: "pg/float4@1";
|
|
82
|
+
};
|
|
83
|
+
readonly output: {
|
|
84
|
+
readonly kind: "codec";
|
|
85
|
+
readonly codecId: "pg/float4@1";
|
|
86
|
+
};
|
|
87
|
+
readonly nullable: true;
|
|
88
|
+
} | {
|
|
89
|
+
readonly operation: "sum";
|
|
90
|
+
readonly input: {
|
|
91
|
+
readonly kind: "codec";
|
|
92
|
+
readonly codecId: "pg/float8@1" | "pg/float@1" | "sql/float@1";
|
|
93
|
+
};
|
|
94
|
+
readonly output: {
|
|
95
|
+
readonly kind: "codec";
|
|
96
|
+
readonly codecId: "pg/float8@1";
|
|
97
|
+
};
|
|
98
|
+
readonly nullable: true;
|
|
99
|
+
} | {
|
|
100
|
+
readonly operation: "sum";
|
|
101
|
+
readonly input: {
|
|
102
|
+
readonly kind: "codec";
|
|
103
|
+
readonly codecId: "pg/numeric@1";
|
|
104
|
+
};
|
|
105
|
+
readonly output: {
|
|
106
|
+
readonly kind: "codec";
|
|
107
|
+
readonly codecId: "pg/numeric@1";
|
|
108
|
+
};
|
|
109
|
+
readonly nullable: true;
|
|
110
|
+
} | {
|
|
111
|
+
readonly operation: "sum";
|
|
112
|
+
readonly input: {
|
|
113
|
+
readonly kind: "codec";
|
|
114
|
+
readonly codecId: "pg/unboundedint@1";
|
|
115
|
+
};
|
|
116
|
+
readonly output: {
|
|
117
|
+
readonly kind: "codec";
|
|
118
|
+
readonly codecId: "pg/unboundedint@1";
|
|
119
|
+
};
|
|
120
|
+
readonly nullable: true;
|
|
121
|
+
} | {
|
|
122
|
+
readonly operation: "sum";
|
|
123
|
+
readonly input: {
|
|
124
|
+
readonly kind: "codec";
|
|
125
|
+
readonly codecId: "pg/interval@1";
|
|
126
|
+
};
|
|
127
|
+
readonly output: {
|
|
128
|
+
readonly kind: "codec";
|
|
129
|
+
readonly codecId: "pg/interval@1";
|
|
130
|
+
};
|
|
131
|
+
readonly nullable: true;
|
|
132
|
+
} | {
|
|
133
|
+
readonly operation: "sum";
|
|
134
|
+
readonly input: {
|
|
135
|
+
readonly kind: "codec";
|
|
136
|
+
readonly codecId: "pg/time-string@1";
|
|
137
|
+
};
|
|
138
|
+
readonly output: {
|
|
139
|
+
readonly kind: "codec";
|
|
140
|
+
readonly codecId: "pg/interval@1";
|
|
141
|
+
};
|
|
142
|
+
readonly nullable: true;
|
|
143
|
+
} | {
|
|
144
|
+
readonly operation: "sum";
|
|
145
|
+
readonly input: {
|
|
146
|
+
readonly kind: "codec";
|
|
147
|
+
readonly codecId: "pg/time-temporal@1";
|
|
148
|
+
};
|
|
149
|
+
readonly output: {
|
|
150
|
+
readonly kind: "codec";
|
|
151
|
+
readonly codecId: "pg/interval@1";
|
|
152
|
+
};
|
|
153
|
+
readonly nullable: true;
|
|
154
|
+
} | {
|
|
155
|
+
readonly lower: SqlAggregateLowering;
|
|
156
|
+
readonly operation: "avg";
|
|
157
|
+
readonly input: {
|
|
158
|
+
readonly kind: "codec";
|
|
159
|
+
readonly codecId: "pg/int8number@1" | "pg/int8@1" | "pg/int2@1" | "pg/int4@1" | "pg/int@1" | "sql/int@1" | "pg/unboundedint@1";
|
|
160
|
+
};
|
|
161
|
+
readonly output: {
|
|
162
|
+
readonly kind: "codec";
|
|
163
|
+
readonly codecId: "pg/float8@1";
|
|
164
|
+
};
|
|
165
|
+
readonly nullable: true;
|
|
166
|
+
} | {
|
|
167
|
+
readonly lower: SqlAggregateLowering;
|
|
168
|
+
readonly operation: "avgDecimal";
|
|
169
|
+
readonly input: {
|
|
170
|
+
readonly kind: "codec";
|
|
171
|
+
readonly codecId: "pg/int8number@1" | "pg/int8@1" | "pg/int2@1" | "pg/int4@1" | "pg/int@1" | "sql/int@1" | "pg/unboundedint@1" | "pg/numeric@1";
|
|
172
|
+
};
|
|
173
|
+
readonly output: {
|
|
174
|
+
readonly kind: "codec";
|
|
175
|
+
readonly codecId: "pg/numeric@1";
|
|
176
|
+
};
|
|
177
|
+
readonly nullable: true;
|
|
178
|
+
} | {
|
|
179
|
+
readonly operation: "avg";
|
|
180
|
+
readonly input: {
|
|
181
|
+
readonly kind: "codec";
|
|
182
|
+
readonly codecId: "pg/float4@1" | "pg/float8@1" | "pg/float@1" | "sql/float@1";
|
|
183
|
+
};
|
|
184
|
+
readonly output: {
|
|
185
|
+
readonly kind: "codec";
|
|
186
|
+
readonly codecId: "pg/float8@1";
|
|
187
|
+
};
|
|
188
|
+
readonly nullable: true;
|
|
189
|
+
} | {
|
|
190
|
+
readonly operation: "avg";
|
|
191
|
+
readonly input: {
|
|
192
|
+
readonly kind: "codec";
|
|
193
|
+
readonly codecId: "pg/numeric@1";
|
|
194
|
+
};
|
|
195
|
+
readonly output: {
|
|
196
|
+
readonly kind: "codec";
|
|
197
|
+
readonly codecId: "pg/numeric@1";
|
|
198
|
+
};
|
|
199
|
+
readonly nullable: true;
|
|
200
|
+
} | {
|
|
201
|
+
readonly operation: "avg";
|
|
202
|
+
readonly input: {
|
|
203
|
+
readonly kind: "codec";
|
|
204
|
+
readonly codecId: "pg/interval@1";
|
|
205
|
+
};
|
|
206
|
+
readonly output: {
|
|
207
|
+
readonly kind: "codec";
|
|
208
|
+
readonly codecId: "pg/interval@1";
|
|
209
|
+
};
|
|
210
|
+
readonly nullable: true;
|
|
211
|
+
} | {
|
|
212
|
+
readonly operation: "avg";
|
|
213
|
+
readonly input: {
|
|
214
|
+
readonly kind: "codec";
|
|
215
|
+
readonly codecId: "pg/time-string@1";
|
|
216
|
+
};
|
|
217
|
+
readonly output: {
|
|
218
|
+
readonly kind: "codec";
|
|
219
|
+
readonly codecId: "pg/interval@1";
|
|
220
|
+
};
|
|
221
|
+
readonly nullable: true;
|
|
222
|
+
} | {
|
|
223
|
+
readonly operation: "avg";
|
|
224
|
+
readonly input: {
|
|
225
|
+
readonly kind: "codec";
|
|
226
|
+
readonly codecId: "pg/time-temporal@1";
|
|
227
|
+
};
|
|
228
|
+
readonly output: {
|
|
229
|
+
readonly kind: "codec";
|
|
230
|
+
readonly codecId: "pg/interval@1";
|
|
231
|
+
};
|
|
232
|
+
readonly nullable: true;
|
|
233
|
+
} | {
|
|
234
|
+
readonly operation: "min";
|
|
235
|
+
readonly input: {
|
|
236
|
+
readonly kind: "trait";
|
|
237
|
+
readonly trait: "numeric";
|
|
238
|
+
};
|
|
239
|
+
readonly output: {
|
|
240
|
+
readonly kind: "self";
|
|
241
|
+
};
|
|
242
|
+
readonly nullable: true;
|
|
243
|
+
} | {
|
|
244
|
+
readonly operation: "min";
|
|
245
|
+
readonly input: {
|
|
246
|
+
readonly kind: "trait";
|
|
247
|
+
readonly trait: "textual";
|
|
248
|
+
};
|
|
249
|
+
readonly output: {
|
|
250
|
+
readonly kind: "self";
|
|
251
|
+
};
|
|
252
|
+
readonly nullable: true;
|
|
253
|
+
} | {
|
|
254
|
+
readonly operation: "min";
|
|
255
|
+
readonly input: {
|
|
256
|
+
readonly kind: "codec";
|
|
257
|
+
readonly codecId: "pg/varchar@1" | "sql/varchar@1";
|
|
258
|
+
};
|
|
259
|
+
readonly output: {
|
|
260
|
+
readonly kind: "codec";
|
|
261
|
+
readonly codecId: "pg/text@1";
|
|
262
|
+
};
|
|
263
|
+
readonly nullable: true;
|
|
264
|
+
} | {
|
|
265
|
+
readonly operation: "min";
|
|
266
|
+
readonly input: {
|
|
267
|
+
readonly kind: "codec";
|
|
268
|
+
readonly codecId: "pg/interval@1" | "pg/time-string@1" | "pg/time-temporal@1" | "pg/enum@1" | "pg/timetz@1" | "pg/inet@1" | "pg/text-array@1" | "pg/date-string@1" | "pg/timestamp-string@1" | "pg/timestamptz-string@1" | "pg/timestamptz-date@1" | "pg/date-temporal@1" | "pg/timestamp-temporal@1" | "pg/timestamptz-temporal@1";
|
|
269
|
+
};
|
|
270
|
+
readonly output: {
|
|
271
|
+
readonly kind: "self";
|
|
272
|
+
};
|
|
273
|
+
readonly nullable: true;
|
|
274
|
+
} | {
|
|
275
|
+
readonly operation: "max";
|
|
276
|
+
readonly input: {
|
|
277
|
+
readonly kind: "trait";
|
|
278
|
+
readonly trait: "numeric";
|
|
279
|
+
};
|
|
280
|
+
readonly output: {
|
|
281
|
+
readonly kind: "self";
|
|
282
|
+
};
|
|
283
|
+
readonly nullable: true;
|
|
284
|
+
} | {
|
|
285
|
+
readonly operation: "max";
|
|
286
|
+
readonly input: {
|
|
287
|
+
readonly kind: "trait";
|
|
288
|
+
readonly trait: "textual";
|
|
289
|
+
};
|
|
290
|
+
readonly output: {
|
|
291
|
+
readonly kind: "self";
|
|
292
|
+
};
|
|
293
|
+
readonly nullable: true;
|
|
294
|
+
} | {
|
|
295
|
+
readonly operation: "max";
|
|
296
|
+
readonly input: {
|
|
297
|
+
readonly kind: "codec";
|
|
298
|
+
readonly codecId: "pg/varchar@1" | "sql/varchar@1";
|
|
299
|
+
};
|
|
300
|
+
readonly output: {
|
|
301
|
+
readonly kind: "codec";
|
|
302
|
+
readonly codecId: "pg/text@1";
|
|
303
|
+
};
|
|
304
|
+
readonly nullable: true;
|
|
305
|
+
} | {
|
|
306
|
+
readonly operation: "max";
|
|
307
|
+
readonly input: {
|
|
308
|
+
readonly kind: "codec";
|
|
309
|
+
readonly codecId: "pg/interval@1" | "pg/time-string@1" | "pg/time-temporal@1" | "pg/enum@1" | "pg/timetz@1" | "pg/inet@1" | "pg/text-array@1" | "pg/date-string@1" | "pg/timestamp-string@1" | "pg/timestamptz-string@1" | "pg/timestamptz-date@1" | "pg/date-temporal@1" | "pg/timestamp-temporal@1" | "pg/timestamptz-temporal@1";
|
|
310
|
+
};
|
|
311
|
+
readonly output: {
|
|
312
|
+
readonly kind: "self";
|
|
313
|
+
};
|
|
314
|
+
readonly nullable: true;
|
|
315
|
+
})[]];
|
|
316
|
+
//#endregion
|
|
317
|
+
export { postgresAggregateDescriptors as t };
|
|
318
|
+
//# sourceMappingURL=aggregates-rj1su5Va.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregates-rj1su5Va.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/aggregates.d.mts"],"mappings":";;;;;;cAKc;WACH;WACA;aACE;;WAEF;aACE;aACA;;WAEF;WACA;;WAEA;WACA;aACE;;WAEF;aACE;aACA;;WAEF;WACA;WACA,OAAO;;WAEP;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA,OAAO;WACP;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA,OAAO;WACP;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA,OAAO;WACP;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA,OAAO;WACP;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA,OAAO;WACP;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;aACA;;WAEF;;WAEA;WACA;aACE;aACA;;WAEF;aACE;;WAEF"}
|
|
@@ -1,10 +1,10 @@
|
|
|
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-
|
|
4
|
+
import { j as requireTemporal } from "./codecs-CQaKsvhH-X9bscCr9.mjs";
|
|
5
5
|
import { f as weightGroupsOf, i as POSTGRES_TEXT_SEARCH_LANGUAGES, l as fullTextIndexProblems, n as FULL_TEXT_INDEX_TYPE, o as describeFullTextIndexProblem } from "./full-text-index-definition-D-QC3DO2-DXbQitDn.mjs";
|
|
6
6
|
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-Ysxbqkzr-hFRwS-zT.mjs";
|
|
7
|
-
import { t as postgresCodecTraitsOf } from "./postgres-codec-traits-
|
|
7
|
+
import { t as postgresCodecTraitsOf } from "./postgres-codec-traits-DOTVjmpT-B4f6Rkh7.mjs";
|
|
8
8
|
import { n as computeContentHash } from "./canonicalize-CrN3u_xM-D4MrOqcB.mjs";
|
|
9
9
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
10
10
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
@@ -16,7 +16,7 @@ import { TIMESTAMP_NOW_GENERATOR_ID, temporalAuthoringPresets } from "@prisma/or
|
|
|
16
16
|
import { blockAttribute, bool, dataTypeValue, 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
18
|
import { SQL_EXPRESSION_DATA_TYPE_ID, requireSqlExpression, sqlTextFromCanonical } from "@prisma/orm-family-sql/contract/sql-expression";
|
|
19
|
-
//#region ../../../3-targets/3-targets/postgres/dist/authoring-
|
|
19
|
+
//#region ../../../3-targets/3-targets/postgres/dist/authoring-DOWd8Fpc.mjs
|
|
20
20
|
const INSTANT_NOW_GENERATOR_ID = "instantNow";
|
|
21
21
|
function instantNowControlDescriptor() {
|
|
22
22
|
return {
|
|
@@ -829,4 +829,4 @@ function postgresLowerEntityHandles(input) {
|
|
|
829
829
|
//#endregion
|
|
830
830
|
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 };
|
|
831
831
|
|
|
832
|
-
//# sourceMappingURL=authoring-
|
|
832
|
+
//# sourceMappingURL=authoring-DOWd8Fpc-BE703X_J.mjs.map
|