@prisma/orm-target-postgres 8.0.0-rc.14-dev.34 → 8.0.0-rc.14-dev.36
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-BOi8Qpb_.d.mts → adapter-C8gNVyXo.d.mts} +2 -2
- package/dist/{adapter-BOi8Qpb_.d.mts.map → adapter-C8gNVyXo.d.mts.map} +1 -1
- package/dist/{adapter-DwUKamWE-9wPlFOdx.mjs → adapter-PKHOd76H-CLst4hXx.mjs} +6 -6
- package/dist/{adapter-DwUKamWE-9wPlFOdx.mjs.map → adapter-PKHOd76H-CLst4hXx.mjs.map} +1 -1
- package/dist/adapter.d.mts +5 -5
- package/dist/adapter.mjs +6 -6
- package/dist/adapter__adapter.d.mts +1 -1
- package/dist/adapter__adapter.mjs +1 -1
- package/dist/adapter__column-types.d.mts +1 -1
- package/dist/adapter__column-types.mjs +1 -1
- package/dist/adapter__control.d.mts +2 -2
- 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/{authoring-BarDKx1G-BKhOsXKo.mjs → authoring-CfPWv_-P-BHAGgGYI.mjs} +4 -4
- package/dist/{authoring-BarDKx1G-BKhOsXKo.mjs.map → authoring-CfPWv_-P-BHAGgGYI.mjs.map} +1 -1
- package/dist/{codec-helpers-BKrVHgYc-DFnb5u9l.mjs → codec-helpers-D015Pvwa-DR7WMloQ.mjs} +6 -6
- package/dist/codec-helpers-D015Pvwa-DR7WMloQ.mjs.map +1 -0
- package/dist/{codec-registry-CCCOytGc-BFC0dvlt.mjs → codec-registry-CyhMngN6-BlKEiEni.mjs} +4 -4
- package/dist/{codec-registry-CCCOytGc-BFC0dvlt.mjs.map → codec-registry-CyhMngN6-BlKEiEni.mjs.map} +1 -1
- package/dist/{codec-type-map-B9MLL97E-RMa5Y4R4.d.mts → codec-type-map-DftCqvHU-BYkGKRZI.d.mts} +3 -3
- package/dist/{codec-type-map-B9MLL97E-RMa5Y4R4.d.mts.map → codec-type-map-DftCqvHU-BYkGKRZI.d.mts.map} +1 -1
- package/dist/{codec-types-Du6N0o5U-DMAI6jag.d.mts → codec-types-CHtW4cn_-ryYZXjOb.d.mts} +4 -4
- package/dist/{codec-types-Du6N0o5U-DMAI6jag.d.mts.map → codec-types-CHtW4cn_-ryYZXjOb.d.mts.map} +1 -1
- package/dist/codec-types-DQUtpepT.d.mts +2 -0
- package/dist/{codecs-Ckpsj4IT-C7kgMiKv.d.mts → codecs-CvG9lv7r-9RlHwf9Y.d.mts} +8 -10
- package/dist/codecs-CvG9lv7r-9RlHwf9Y.d.mts.map +1 -0
- package/dist/{codecs-C0zx-UlM.d.mts → codecs-Djhvng3f.d.mts} +2 -2
- package/dist/{codecs-C0zx-UlM.d.mts.map → codecs-Djhvng3f.d.mts.map} +1 -1
- package/dist/{codecs-BzCRfsit-BbLlbudt.mjs → codecs-hSJgX8qY-fZSDQFIE.mjs} +41 -45
- package/dist/codecs-hSJgX8qY-fZSDQFIE.mjs.map +1 -0
- package/dist/{column-types-CB_qVLNC.mjs → column-types-Bbc3IVA7.mjs} +18 -78
- package/dist/column-types-Bbc3IVA7.mjs.map +1 -0
- package/dist/{column-types-C_d8NCMy.d.mts → column-types-Dq7mC_dL.d.mts} +1 -18
- package/dist/column-types-Dq7mC_dL.d.mts.map +1 -0
- package/dist/{control-fp7Azf3F.d.mts → control-0nEwuD8F.d.mts} +5 -2
- package/dist/control-0nEwuD8F.d.mts.map +1 -0
- package/dist/{control-aDBKB9hQ.d.mts → control-CHqdVXHC.d.mts} +5 -8
- package/dist/{control-aDBKB9hQ.d.mts.map → control-CHqdVXHC.d.mts.map} +1 -1
- package/dist/{control-C0mAPRzk.mjs → control-CgOBPYS9.mjs} +59 -43
- package/dist/control-CgOBPYS9.mjs.map +1 -0
- package/dist/{control-adapter-cjnLE0mN-BmNP2taw.mjs → control-adapter-C8SVVnV3-BBtxce7g.mjs} +27 -12
- package/dist/control-adapter-C8SVVnV3-BBtxce7g.mjs.map +1 -0
- package/dist/{control-policy-CuJvncMq-C5yshGZP.mjs → control-policy-C16wMazs-O_wlPuFC.mjs} +14 -15
- package/dist/control-policy-C16wMazs-O_wlPuFC.mjs.map +1 -0
- package/dist/{data-type-entries-DYgNhsVx-BWJJHCQR.mjs → data-type-entries-B09zz50n-CpzY4XHp.mjs} +3 -3
- package/dist/{data-type-entries-DYgNhsVx-BWJJHCQR.mjs.map → data-type-entries-B09zz50n-CpzY4XHp.mjs.map} +1 -1
- package/dist/{data-types-DzUVlWeo-CBMHoFoH.mjs → data-types-BRBW3ouc-ZtyZE7nE.mjs} +8 -8
- package/dist/data-types-BRBW3ouc-ZtyZE7nE.mjs.map +1 -0
- package/dist/{default-normalizer-C68YhUBS-BjOeKRhS.mjs → default-normalizer-CrMBHF0W-BaUR4Ec8.mjs} +3 -3
- package/dist/{default-normalizer-C68YhUBS-BjOeKRhS.mjs.map → default-normalizer-CrMBHF0W-BaUR4Ec8.mjs.map} +1 -1
- package/dist/descriptor-meta-DOlH1OBE-BXfgIiSP.mjs +71 -0
- package/dist/descriptor-meta-DOlH1OBE-BXfgIiSP.mjs.map +1 -0
- package/dist/{descriptor-meta-CUmf1G9P-GAdC3zfT.mjs → descriptor-meta-DhVbdKvn-BO0y2Cn-.mjs} +6 -6
- package/dist/{descriptor-meta-CUmf1G9P-GAdC3zfT.mjs.map → descriptor-meta-DhVbdKvn-BO0y2Cn-.mjs.map} +1 -1
- package/dist/{descriptor-meta-runtime-D-ZCTI0a-DVgDk2XT.mjs → descriptor-meta-runtime-BycwK4wx-CuDo_Atu.mjs} +3 -3
- package/dist/{descriptor-meta-runtime-D-ZCTI0a-DVgDk2XT.mjs.map → descriptor-meta-runtime-BycwK4wx-CuDo_Atu.mjs.map} +1 -1
- package/dist/{diff-database-schema-BYHT4ZZp-DHQM3yoO.mjs → diff-database-schema-DRPIV4Ae-BSY-cBm0.mjs} +4 -4
- package/dist/{diff-database-schema-BYHT4ZZp-DHQM3yoO.mjs.map → diff-database-schema-DRPIV4Ae-BSY-cBm0.mjs.map} +1 -1
- package/dist/{full-text-DjD0tAqd.d.mts → full-text-D5pW25-Y.d.mts} +2 -2
- package/dist/{full-text-DjD0tAqd.d.mts.map → full-text-D5pW25-Y.d.mts.map} +1 -1
- package/dist/{full-text-index-expression-DKwm2Z9W-CboCsz4N.mjs → full-text-index-expression-2O1p7zJA--CcXJUdq.mjs} +3 -3
- package/dist/{full-text-index-expression-DKwm2Z9W-CboCsz4N.mjs.map → full-text-index-expression-2O1p7zJA--CcXJUdq.mjs.map} +1 -1
- package/dist/{full-text-parsers-DinPC_86-B2P_FyTG.d.mts → full-text-parsers-BhjgmAe5-CyF7dp_b.d.mts} +3 -3
- package/dist/{full-text-parsers-DinPC_86-B2P_FyTG.d.mts.map → full-text-parsers-BhjgmAe5-CyF7dp_b.d.mts.map} +1 -1
- package/dist/{infer-psl-contract-DBWXA-jx-CmKQgKZJ.mjs → infer-psl-contract-CkUkE2fE-bg9b0E0i.mjs} +12 -12
- package/dist/infer-psl-contract-CkUkE2fE-bg9b0E0i.mjs.map +1 -0
- package/dist/marker-lock-BGBqXaQ4.d.mts +11 -0
- package/dist/marker-lock-BGBqXaQ4.d.mts.map +1 -0
- package/dist/marker-lock-DFc1Tfv5-QMJSzMIa.mjs +11 -0
- package/dist/marker-lock-DFc1Tfv5-QMJSzMIa.mjs.map +1 -0
- package/dist/migration-PTHAY9Cv.mjs.map +1 -1
- package/dist/{op-factory-call-4IafSIKD-D2wO2iyZ.mjs → op-factory-call-B-4nf1jC-DkRw5e1q.mjs} +4 -4
- package/dist/{op-factory-call-4IafSIKD-D2wO2iyZ.mjs.map → op-factory-call-B-4nf1jC-DkRw5e1q.mjs.map} +1 -1
- package/dist/{operation-types-DfPl4yzR.d.mts → operation-types-Be5rdu14.d.mts} +2 -2
- package/dist/{operation-types-DfPl4yzR.d.mts.map → operation-types-Be5rdu14.d.mts.map} +1 -1
- package/dist/{pack-Cx7B1N8w.d.mts → pack-DHV9zslZ.d.mts} +3 -3
- package/dist/{pack-Cx7B1N8w.d.mts.map → pack-DHV9zslZ.d.mts.map} +1 -1
- package/dist/{planner-BWKFZaOu--28k5rC4.mjs → planner-B5wkfdZ_-bckhSgt5.mjs} +7 -7
- package/dist/{planner-BWKFZaOu--28k5rC4.mjs.map → planner-B5wkfdZ_-bckhSgt5.mjs.map} +1 -1
- package/dist/{planner-ddl-builders-Ckcr8Ov1.d.mts → planner-ddl-builders-BBQC5ET6.d.mts} +7 -6
- package/dist/{planner-ddl-builders-Ckcr8Ov1.d.mts.map → planner-ddl-builders-BBQC5ET6.d.mts.map} +1 -1
- package/dist/{planner-ddl-builders-O0JqJIBZ-x7JEHEpU.mjs → planner-ddl-builders-ClaAKDuZ-DpDBj2cs.mjs} +14 -14
- package/dist/planner-ddl-builders-ClaAKDuZ-DpDBj2cs.mjs.map +1 -0
- package/dist/{planner-identity-values-BTYw1D7D-CzpXx1yD.mjs → planner-identity-values-BZpK0CdX-BJo672Ml.mjs} +3 -3
- package/dist/{planner-identity-values-BTYw1D7D-CzpXx1yD.mjs.map → planner-identity-values-BZpK0CdX-BJo672Ml.mjs.map} +1 -1
- package/dist/{planner-identity-values-DvlFit8A.d.mts → planner-identity-values-Dr5FgyF1.d.mts} +2 -2
- package/dist/planner-identity-values-Dr5FgyF1.d.mts.map +1 -0
- package/dist/{planner-produced-postgres-migration-B-gWwByI-Cy8tx4pu.mjs → planner-produced-postgres-migration-B3dM0fTf-XkTUm5wR.mjs} +3 -3
- package/dist/{planner-produced-postgres-migration-B-gWwByI-Cy8tx4pu.mjs.map → planner-produced-postgres-migration-B3dM0fTf-XkTUm5wR.mjs.map} +1 -1
- package/dist/{planner-sql-checks-Cr06nK1--B3gPnC1a.mjs → planner-sql-checks-Bhp0Iq_X-DwwIxJHj.mjs} +2 -3
- package/dist/planner-sql-checks-Bhp0Iq_X-DwwIxJHj.mjs.map +1 -0
- package/dist/{planner-sql-checks-iNLJS1dW.d.mts → planner-sql-checks-CXDdt_9m.d.mts} +2 -2
- package/dist/planner-sql-checks-CXDdt_9m.d.mts.map +1 -0
- package/dist/{postgres-contract-view-D60F8OWK-Bi5oJkOx.mjs → postgres-contract-view-rT0ZLNqw-DThfALEV.mjs} +5 -5
- package/dist/{postgres-contract-view-D60F8OWK-Bi5oJkOx.mjs.map → postgres-contract-view-rT0ZLNqw-DThfALEV.mjs.map} +1 -1
- package/dist/{postgres-migration-PLXsv15e-BruyXuKH.mjs → postgres-migration-CmD95Eh_-DGLByWZD.mjs} +11 -11
- package/dist/postgres-migration-CmD95Eh_-DGLByWZD.mjs.map +1 -0
- package/dist/{prisma7-binding-BgMvnMgz.mjs → prisma7-binding-BlD9U_OI.mjs} +6 -6
- package/dist/{prisma7-binding-BgMvnMgz.mjs.map → prisma7-binding-BlD9U_OI.mjs.map} +1 -1
- package/dist/{prisma7-binding-D2guML1e.d.mts → prisma7-binding-DNckHEx8.d.mts} +3 -3
- package/dist/{prisma7-binding-D2guML1e.d.mts.map → prisma7-binding-DNckHEx8.d.mts.map} +1 -1
- package/dist/{sql-renderer-BjJ3MLnI-DQvfiMO6.mjs → sql-renderer-BjJ3MLnI-BnKVkjzm.mjs} +2 -2
- package/dist/{sql-renderer-BjJ3MLnI-DQvfiMO6.mjs.map → sql-renderer-BjJ3MLnI-BnKVkjzm.mjs.map} +1 -1
- package/dist/target.d.mts +15 -14
- package/dist/target.mjs +21 -20
- 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__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.d.mts +2 -2
- package/dist/target__issue-planner.mjs +1 -1
- package/dist/target__marker-lock.d.mts +2 -0
- package/dist/target__marker-lock.mjs +2 -0
- package/dist/target__migration.mjs +2 -2
- package/dist/target__op-factory-call.mjs +1 -1
- package/dist/target__operation-types.d.mts +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__planner-ddl-builders.d.mts +1 -1
- package/dist/target__planner-ddl-builders.mjs +1 -1
- package/dist/target__planner-identity-values.d.mts +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.d.mts +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__runtime.mjs +3 -3
- package/dist/target__runtime.mjs.map +1 -1
- package/dist/target__sql-utils.mjs +1 -1
- package/dist/{types-LTOC-zv8.d.mts → types-CdJszzhP.d.mts} +1 -1
- package/package.json +10 -9
- package/dist/codec-helpers-BKrVHgYc-DFnb5u9l.mjs.map +0 -1
- package/dist/codec-types-uq3Il6e3.d.mts +0 -2
- package/dist/codecs-BzCRfsit-BbLlbudt.mjs.map +0 -1
- package/dist/codecs-Ckpsj4IT-C7kgMiKv.d.mts.map +0 -1
- package/dist/column-types-CB_qVLNC.mjs.map +0 -1
- package/dist/column-types-C_d8NCMy.d.mts.map +0 -1
- package/dist/control-C0mAPRzk.mjs.map +0 -1
- package/dist/control-adapter-cjnLE0mN-BmNP2taw.mjs.map +0 -1
- package/dist/control-fp7Azf3F.d.mts.map +0 -1
- package/dist/control-policy-CuJvncMq-C5yshGZP.mjs.map +0 -1
- package/dist/data-types-DzUVlWeo-CBMHoFoH.mjs.map +0 -1
- package/dist/descriptor-meta-gq4MiUXl-DqqHHHSj.mjs +0 -284
- package/dist/descriptor-meta-gq4MiUXl-DqqHHHSj.mjs.map +0 -1
- package/dist/infer-psl-contract-DBWXA-jx-CmKQgKZJ.mjs.map +0 -1
- package/dist/planner-ddl-builders-O0JqJIBZ-x7JEHEpU.mjs.map +0 -1
- package/dist/planner-identity-values-DvlFit8A.d.mts.map +0 -1
- package/dist/planner-sql-checks-Cr06nK1--B3gPnC1a.mjs.map +0 -1
- package/dist/planner-sql-checks-iNLJS1dW.d.mts.map +0 -1
- package/dist/postgres-migration-PLXsv15e-BruyXuKH.mjs.map +0 -1
|
@@ -1,47 +1,26 @@
|
|
|
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, I as SQL_CHAR_CODEC_ID, O as PG_TIMETZ_CODEC_ID, P as PG_VARBIT_CODEC_ID, S as PG_TEXT_CODEC_ID, T as PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, a as PG_DATE_STRING_CODEC_ID, b as PG_NUMERIC_CODEC_ID, c as PG_FLOAT4_CODEC_ID, f as PG_INT2_CODEC_ID, g as PG_INTERVAL_CODEC_ID, k as PG_TIME_STRING_CODEC_ID, l as PG_FLOAT8_CODEC_ID, m as PG_INT8_CODEC_ID, n as PG_BOOL_CODEC_ID, o as PG_DATE_TEMPORAL_CODEC_ID, p as PG_INT4_CODEC_ID, r as PG_BYTEA_CODEC_ID, t as PG_BIT_CODEC_ID, v as PG_JSONB_CODEC_ID, w as PG_TIMESTAMPTZ_STRING_CODEC_ID, y as PG_JSON_CODEC_ID } from "./codec-ids-Cb0yO-IS--e0P2rfI.mjs";
|
|
2
2
|
//#region ../../../3-targets/6-adapters/postgres/dist/column-types.mjs
|
|
3
|
-
const textColumn = {
|
|
4
|
-
codecId: PG_TEXT_CODEC_ID,
|
|
5
|
-
nativeType: "text"
|
|
6
|
-
};
|
|
3
|
+
const textColumn = { codecId: PG_TEXT_CODEC_ID };
|
|
7
4
|
function charColumn(length) {
|
|
8
5
|
return {
|
|
9
6
|
codecId: SQL_CHAR_CODEC_ID,
|
|
10
|
-
nativeType: "character",
|
|
11
7
|
typeParams: { length }
|
|
12
8
|
};
|
|
13
9
|
}
|
|
14
10
|
function varcharColumn(length) {
|
|
15
11
|
return {
|
|
16
12
|
codecId: SQL_VARCHAR_CODEC_ID,
|
|
17
|
-
nativeType: "character varying",
|
|
18
13
|
typeParams: { length }
|
|
19
14
|
};
|
|
20
15
|
}
|
|
21
|
-
const int4Column = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
const
|
|
26
|
-
codecId: PG_INT2_CODEC_ID,
|
|
27
|
-
nativeType: "int2"
|
|
28
|
-
};
|
|
29
|
-
const int8Column = {
|
|
30
|
-
codecId: PG_INT8_CODEC_ID,
|
|
31
|
-
nativeType: "int8"
|
|
32
|
-
};
|
|
33
|
-
const float4Column = {
|
|
34
|
-
codecId: PG_FLOAT4_CODEC_ID,
|
|
35
|
-
nativeType: "float4"
|
|
36
|
-
};
|
|
37
|
-
const float8Column = {
|
|
38
|
-
codecId: PG_FLOAT8_CODEC_ID,
|
|
39
|
-
nativeType: "float8"
|
|
40
|
-
};
|
|
16
|
+
const int4Column = { codecId: PG_INT4_CODEC_ID };
|
|
17
|
+
const int2Column = { codecId: PG_INT2_CODEC_ID };
|
|
18
|
+
const int8Column = { codecId: PG_INT8_CODEC_ID };
|
|
19
|
+
const float4Column = { codecId: PG_FLOAT4_CODEC_ID };
|
|
20
|
+
const float8Column = { codecId: PG_FLOAT8_CODEC_ID };
|
|
41
21
|
function numericColumn(precision, scale) {
|
|
42
22
|
return {
|
|
43
23
|
codecId: PG_NUMERIC_CODEC_ID,
|
|
44
|
-
nativeType: "numeric",
|
|
45
24
|
typeParams: scale === void 0 ? { precision } : {
|
|
46
25
|
precision,
|
|
47
26
|
scale
|
|
@@ -52,70 +31,41 @@ function numericColumn(precision, scale) {
|
|
|
52
31
|
* Representation-explicit temporal descriptors share storage types but select different application
|
|
53
32
|
* values: `Temporal.*`, PostgreSQL text, or a JavaScript `Date` for `timestamptz`.
|
|
54
33
|
*/
|
|
55
|
-
const dateTemporalColumn = {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
};
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
};
|
|
63
|
-
const timestampTemporalColumn = {
|
|
64
|
-
codecId: PG_TIMESTAMP_TEMPORAL_CODEC_ID,
|
|
65
|
-
nativeType: "timestamp"
|
|
66
|
-
};
|
|
67
|
-
const timestampStringColumn = {
|
|
68
|
-
codecId: PG_TIMESTAMP_STRING_CODEC_ID,
|
|
69
|
-
nativeType: "timestamp"
|
|
70
|
-
};
|
|
71
|
-
const timestamptzTemporalColumn = {
|
|
72
|
-
codecId: PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID,
|
|
73
|
-
nativeType: "timestamptz"
|
|
74
|
-
};
|
|
75
|
-
const timestamptzJsDateColumn = {
|
|
76
|
-
codecId: PG_TIMESTAMPTZ_DATE_CODEC_ID,
|
|
77
|
-
nativeType: "timestamptz"
|
|
78
|
-
};
|
|
79
|
-
const timestamptzStringColumn = {
|
|
80
|
-
codecId: PG_TIMESTAMPTZ_STRING_CODEC_ID,
|
|
81
|
-
nativeType: "timestamptz"
|
|
82
|
-
};
|
|
34
|
+
const dateTemporalColumn = { codecId: PG_DATE_TEMPORAL_CODEC_ID };
|
|
35
|
+
const dateStringColumn = { codecId: PG_DATE_STRING_CODEC_ID };
|
|
36
|
+
const timestampTemporalColumn = { codecId: PG_TIMESTAMP_TEMPORAL_CODEC_ID };
|
|
37
|
+
const timestampStringColumn = { codecId: PG_TIMESTAMP_STRING_CODEC_ID };
|
|
38
|
+
const timestamptzTemporalColumn = { codecId: PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID };
|
|
39
|
+
const timestamptzJsDateColumn = { codecId: PG_TIMESTAMPTZ_DATE_CODEC_ID };
|
|
40
|
+
const timestamptzStringColumn = { codecId: PG_TIMESTAMPTZ_STRING_CODEC_ID };
|
|
83
41
|
function timeTemporalColumn(precision) {
|
|
84
42
|
return {
|
|
85
43
|
codecId: PG_TIME_TEMPORAL_CODEC_ID,
|
|
86
|
-
nativeType: "time",
|
|
87
44
|
...precision === void 0 ? {} : { typeParams: { precision } }
|
|
88
45
|
};
|
|
89
46
|
}
|
|
90
47
|
function timeStringColumn(precision) {
|
|
91
48
|
return {
|
|
92
49
|
codecId: PG_TIME_STRING_CODEC_ID,
|
|
93
|
-
nativeType: "time",
|
|
94
50
|
...precision === void 0 ? {} : { typeParams: { precision } }
|
|
95
51
|
};
|
|
96
52
|
}
|
|
97
53
|
function timetzColumn(precision) {
|
|
98
54
|
return {
|
|
99
55
|
codecId: PG_TIMETZ_CODEC_ID,
|
|
100
|
-
nativeType: "timetz",
|
|
101
56
|
...precision === void 0 ? {} : { typeParams: { precision } }
|
|
102
57
|
};
|
|
103
58
|
}
|
|
104
|
-
const boolColumn = {
|
|
105
|
-
codecId: PG_BOOL_CODEC_ID,
|
|
106
|
-
nativeType: "bool"
|
|
107
|
-
};
|
|
59
|
+
const boolColumn = { codecId: PG_BOOL_CODEC_ID };
|
|
108
60
|
function bitColumn(length) {
|
|
109
61
|
return {
|
|
110
62
|
codecId: PG_BIT_CODEC_ID,
|
|
111
|
-
nativeType: "bit",
|
|
112
63
|
typeParams: { length }
|
|
113
64
|
};
|
|
114
65
|
}
|
|
115
66
|
function varbitColumn(length) {
|
|
116
67
|
return {
|
|
117
68
|
codecId: PG_VARBIT_CODEC_ID,
|
|
118
|
-
nativeType: "bit varying",
|
|
119
69
|
typeParams: { length }
|
|
120
70
|
};
|
|
121
71
|
}
|
|
@@ -124,14 +74,10 @@ function varbitColumn(length) {
|
|
|
124
74
|
*
|
|
125
75
|
* Round-trips as `Uint8Array` on the JS side. The pg wire-protocol text encoding (`\x` followed by hex-encoded bytes, canonical for Postgres ≥ 9.0) and binary encoding are both handled by the underlying driver; the codec only normalizes the JS-side representation to a plain `Uint8Array` view.
|
|
126
76
|
*/
|
|
127
|
-
const byteaColumn = {
|
|
128
|
-
codecId: PG_BYTEA_CODEC_ID,
|
|
129
|
-
nativeType: "bytea"
|
|
130
|
-
};
|
|
77
|
+
const byteaColumn = { codecId: PG_BYTEA_CODEC_ID };
|
|
131
78
|
function intervalColumn(precision) {
|
|
132
79
|
return {
|
|
133
80
|
codecId: PG_INTERVAL_CODEC_ID,
|
|
134
|
-
nativeType: "interval",
|
|
135
81
|
...precision === void 0 ? {} : { typeParams: { precision } }
|
|
136
82
|
};
|
|
137
83
|
}
|
|
@@ -140,18 +86,12 @@ function intervalColumn(precision) {
|
|
|
140
86
|
*
|
|
141
87
|
* For schema-typed JSON columns, use the per-library extension package (`@internal/extension-arktype-json` ships `arktypeJson(schema)` for arktype). The schema-accepting `json(schema)` / `jsonb(schema)` overloads previously shipped from this module retired in Phase C of the codec-registry-unification project — see spec § AC-7.
|
|
142
88
|
*/
|
|
143
|
-
const jsonColumn = {
|
|
144
|
-
codecId: PG_JSON_CODEC_ID,
|
|
145
|
-
nativeType: "json"
|
|
146
|
-
};
|
|
89
|
+
const jsonColumn = { codecId: PG_JSON_CODEC_ID };
|
|
147
90
|
/**
|
|
148
91
|
* Postgres `jsonb` column descriptor — untyped raw JSONB. Same retirement note as {@link jsonColumn}.
|
|
149
92
|
*/
|
|
150
|
-
const jsonbColumn = {
|
|
151
|
-
codecId: PG_JSONB_CODEC_ID,
|
|
152
|
-
nativeType: "jsonb"
|
|
153
|
-
};
|
|
93
|
+
const jsonbColumn = { codecId: PG_JSONB_CODEC_ID };
|
|
154
94
|
//#endregion
|
|
155
95
|
export { timestamptzTemporalColumn as C, varcharColumn as E, timestamptzStringColumn as S, varbitColumn as T, timeStringColumn as _, dateStringColumn as a, timestampTemporalColumn as b, float8Column as c, int8Column as d, intervalColumn as f, textColumn as g, numericColumn as h, charColumn as i, int2Column as l, jsonbColumn as m, boolColumn as n, dateTemporalColumn as o, jsonColumn as p, byteaColumn as r, float4Column as s, bitColumn as t, int4Column as u, timeTemporalColumn as v, timetzColumn as w, timestamptzJsDateColumn as x, timestampStringColumn as y };
|
|
156
96
|
|
|
157
|
-
//# sourceMappingURL=column-types-
|
|
97
|
+
//# sourceMappingURL=column-types-Bbc3IVA7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"column-types-Bbc3IVA7.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/column-types.mjs"],"sourcesContent":["import { PG_BIT_CODEC_ID, PG_BOOL_CODEC_ID, PG_BYTEA_CODEC_ID, PG_DATE_STRING_CODEC_ID, PG_DATE_TEMPORAL_CODEC_ID, PG_FLOAT4_CODEC_ID, PG_FLOAT8_CODEC_ID, PG_INT2_CODEC_ID, PG_INT4_CODEC_ID, PG_INT8_CODEC_ID, PG_INTERVAL_CODEC_ID, PG_JSONB_CODEC_ID, PG_JSON_CODEC_ID, PG_NUMERIC_CODEC_ID, PG_TEXT_CODEC_ID, PG_TIMESTAMPTZ_DATE_CODEC_ID, PG_TIMESTAMPTZ_STRING_CODEC_ID, PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID, PG_TIMESTAMP_STRING_CODEC_ID, PG_TIMESTAMP_TEMPORAL_CODEC_ID, PG_TIMETZ_CODEC_ID, PG_TIME_STRING_CODEC_ID, PG_TIME_TEMPORAL_CODEC_ID, PG_VARBIT_CODEC_ID, SQL_CHAR_CODEC_ID, SQL_VARCHAR_CODEC_ID } from \"@internal/target-postgres/codec-ids\";\n//#region src/exports/column-types.ts\nconst textColumn = { codecId: PG_TEXT_CODEC_ID };\nfunction charColumn(length) {\n\treturn {\n\t\tcodecId: SQL_CHAR_CODEC_ID,\n\t\ttypeParams: { length }\n\t};\n}\nfunction varcharColumn(length) {\n\treturn {\n\t\tcodecId: SQL_VARCHAR_CODEC_ID,\n\t\ttypeParams: { length }\n\t};\n}\nconst int4Column = { codecId: PG_INT4_CODEC_ID };\nconst int2Column = { codecId: PG_INT2_CODEC_ID };\nconst int8Column = { codecId: PG_INT8_CODEC_ID };\nconst float4Column = { codecId: PG_FLOAT4_CODEC_ID };\nconst float8Column = { codecId: PG_FLOAT8_CODEC_ID };\nfunction numericColumn(precision, scale) {\n\treturn {\n\t\tcodecId: PG_NUMERIC_CODEC_ID,\n\t\ttypeParams: scale === void 0 ? { precision } : {\n\t\t\tprecision,\n\t\t\tscale\n\t\t}\n\t};\n}\n/**\n* Representation-explicit temporal descriptors share storage types but select different application\n* values: `Temporal.*`, PostgreSQL text, or a JavaScript `Date` for `timestamptz`.\n*/\nconst dateTemporalColumn = { codecId: PG_DATE_TEMPORAL_CODEC_ID };\nconst dateStringColumn = { codecId: PG_DATE_STRING_CODEC_ID };\nconst timestampTemporalColumn = { codecId: PG_TIMESTAMP_TEMPORAL_CODEC_ID };\nconst timestampStringColumn = { codecId: PG_TIMESTAMP_STRING_CODEC_ID };\nconst timestamptzTemporalColumn = { codecId: PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID };\nconst timestamptzJsDateColumn = { codecId: PG_TIMESTAMPTZ_DATE_CODEC_ID };\nconst timestamptzStringColumn = { codecId: PG_TIMESTAMPTZ_STRING_CODEC_ID };\nfunction timeTemporalColumn(precision) {\n\treturn {\n\t\tcodecId: PG_TIME_TEMPORAL_CODEC_ID,\n\t\t...precision === void 0 ? {} : { typeParams: { precision } }\n\t};\n}\nfunction timeStringColumn(precision) {\n\treturn {\n\t\tcodecId: PG_TIME_STRING_CODEC_ID,\n\t\t...precision === void 0 ? {} : { typeParams: { precision } }\n\t};\n}\nfunction timetzColumn(precision) {\n\treturn {\n\t\tcodecId: PG_TIMETZ_CODEC_ID,\n\t\t...precision === void 0 ? {} : { typeParams: { precision } }\n\t};\n}\nconst boolColumn = { codecId: PG_BOOL_CODEC_ID };\nfunction bitColumn(length) {\n\treturn {\n\t\tcodecId: PG_BIT_CODEC_ID,\n\t\ttypeParams: { length }\n\t};\n}\nfunction varbitColumn(length) {\n\treturn {\n\t\tcodecId: PG_VARBIT_CODEC_ID,\n\t\ttypeParams: { length }\n\t};\n}\n/**\n* Postgres `bytea` column descriptor — variable-length binary string.\n*\n* Round-trips as `Uint8Array` on the JS side. The pg wire-protocol text encoding (`\\x` followed by hex-encoded bytes, canonical for Postgres ≥ 9.0) and binary encoding are both handled by the underlying driver; the codec only normalizes the JS-side representation to a plain `Uint8Array` view.\n*/\nconst byteaColumn = { codecId: PG_BYTEA_CODEC_ID };\nfunction intervalColumn(precision) {\n\treturn {\n\t\tcodecId: PG_INTERVAL_CODEC_ID,\n\t\t...precision === void 0 ? {} : { typeParams: { precision } }\n\t};\n}\n/**\n* Postgres `json` column descriptor — untyped raw JSON.\n*\n* For schema-typed JSON columns, use the per-library extension package (`@internal/extension-arktype-json` ships `arktypeJson(schema)` for arktype). The schema-accepting `json(schema)` / `jsonb(schema)` overloads previously shipped from this module retired in Phase C of the codec-registry-unification project — see spec § AC-7.\n*/\nconst jsonColumn = { codecId: PG_JSON_CODEC_ID };\n/**\n* Postgres `jsonb` column descriptor — untyped raw JSONB. Same retirement note as {@link jsonColumn}.\n*/\nconst jsonbColumn = { codecId: PG_JSONB_CODEC_ID };\n//#endregion\nexport { bitColumn, boolColumn, byteaColumn, charColumn, dateStringColumn, dateTemporalColumn, float4Column, float8Column, int2Column, int4Column, int8Column, intervalColumn, jsonColumn, jsonbColumn, numericColumn, textColumn, timeStringColumn, timeTemporalColumn, timestampStringColumn, timestampTemporalColumn, timestamptzJsDateColumn, timestamptzStringColumn, timestamptzTemporalColumn, timetzColumn, varbitColumn, varcharColumn };\n\n//# sourceMappingURL=column-types.mjs.map"],"mappings":";;AAEA,MAAM,aAAa,EAAE,SAAS,iBAAiB;AAC/C,SAAS,WAAW,QAAQ;CAC3B,OAAO;EACN,SAAS;EACT,YAAY,EAAE,OAAO;CACtB;AACD;AACA,SAAS,cAAc,QAAQ;CAC9B,OAAO;EACN,SAAS;EACT,YAAY,EAAE,OAAO;CACtB;AACD;AACA,MAAM,aAAa,EAAE,SAAS,iBAAiB;AAC/C,MAAM,aAAa,EAAE,SAAS,iBAAiB;AAC/C,MAAM,aAAa,EAAE,SAAS,iBAAiB;AAC/C,MAAM,eAAe,EAAE,SAAS,mBAAmB;AACnD,MAAM,eAAe,EAAE,SAAS,mBAAmB;AACnD,SAAS,cAAc,WAAW,OAAO;CACxC,OAAO;EACN,SAAS;EACT,YAAY,UAAU,KAAK,IAAI,EAAE,UAAU,IAAI;GAC9C;GACA;EACD;CACD;AACD;;;;;AAKA,MAAM,qBAAqB,EAAE,SAAS,0BAA0B;AAChE,MAAM,mBAAmB,EAAE,SAAS,wBAAwB;AAC5D,MAAM,0BAA0B,EAAE,SAAS,+BAA+B;AAC1E,MAAM,wBAAwB,EAAE,SAAS,6BAA6B;AACtE,MAAM,4BAA4B,EAAE,SAAS,iCAAiC;AAC9E,MAAM,0BAA0B,EAAE,SAAS,6BAA6B;AACxE,MAAM,0BAA0B,EAAE,SAAS,+BAA+B;AAC1E,SAAS,mBAAmB,WAAW;CACtC,OAAO;EACN,SAAS;EACT,GAAG,cAAc,KAAK,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE;CAC5D;AACD;AACA,SAAS,iBAAiB,WAAW;CACpC,OAAO;EACN,SAAS;EACT,GAAG,cAAc,KAAK,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE;CAC5D;AACD;AACA,SAAS,aAAa,WAAW;CAChC,OAAO;EACN,SAAS;EACT,GAAG,cAAc,KAAK,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE;CAC5D;AACD;AACA,MAAM,aAAa,EAAE,SAAS,iBAAiB;AAC/C,SAAS,UAAU,QAAQ;CAC1B,OAAO;EACN,SAAS;EACT,YAAY,EAAE,OAAO;CACtB;AACD;AACA,SAAS,aAAa,QAAQ;CAC7B,OAAO;EACN,SAAS;EACT,YAAY,EAAE,OAAO;CACtB;AACD;;;;;;AAMA,MAAM,cAAc,EAAE,SAAS,kBAAkB;AACjD,SAAS,eAAe,WAAW;CAClC,OAAO;EACN,SAAS;EACT,GAAG,cAAc,KAAK,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE;CAC5D;AACD;;;;;;AAMA,MAAM,aAAa,EAAE,SAAS,iBAAiB;;;;AAI/C,MAAM,cAAc,EAAE,SAAS,kBAAkB"}
|
|
@@ -5,7 +5,6 @@ import { ColumnTypeDescriptor } from "@prisma/orm-framework/components/codec";
|
|
|
5
5
|
//#region src/exports/column-types.d.ts
|
|
6
6
|
declare const textColumn: {
|
|
7
7
|
readonly codecId: "pg/text@1";
|
|
8
|
-
readonly nativeType: "text";
|
|
9
8
|
};
|
|
10
9
|
declare function charColumn(length: number): ColumnTypeDescriptor<typeof SQL_CHAR_CODEC_ID> & {
|
|
11
10
|
readonly typeParams: {
|
|
@@ -19,23 +18,18 @@ declare function varcharColumn(length: number): ColumnTypeDescriptor<typeof SQL_
|
|
|
19
18
|
};
|
|
20
19
|
declare const int4Column: {
|
|
21
20
|
readonly codecId: "pg/int4@1";
|
|
22
|
-
readonly nativeType: "int4";
|
|
23
21
|
};
|
|
24
22
|
declare const int2Column: {
|
|
25
23
|
readonly codecId: "pg/int2@1";
|
|
26
|
-
readonly nativeType: "int2";
|
|
27
24
|
};
|
|
28
25
|
declare const int8Column: {
|
|
29
26
|
readonly codecId: "pg/int8@1";
|
|
30
|
-
readonly nativeType: "int8";
|
|
31
27
|
};
|
|
32
28
|
declare const float4Column: {
|
|
33
29
|
readonly codecId: "pg/float4@1";
|
|
34
|
-
readonly nativeType: "float4";
|
|
35
30
|
};
|
|
36
31
|
declare const float8Column: {
|
|
37
32
|
readonly codecId: "pg/float8@1";
|
|
38
|
-
readonly nativeType: "float8";
|
|
39
33
|
};
|
|
40
34
|
declare function numericColumn(precision: number, scale?: number): ColumnTypeDescriptor<typeof PG_NUMERIC_CODEC_ID> & {
|
|
41
35
|
readonly typeParams: {
|
|
@@ -49,31 +43,24 @@ declare function numericColumn(precision: number, scale?: number): ColumnTypeDes
|
|
|
49
43
|
*/
|
|
50
44
|
declare const dateTemporalColumn: {
|
|
51
45
|
readonly codecId: "pg/date-temporal@1";
|
|
52
|
-
readonly nativeType: "date";
|
|
53
46
|
};
|
|
54
47
|
declare const dateStringColumn: {
|
|
55
48
|
readonly codecId: "pg/date-string@1";
|
|
56
|
-
readonly nativeType: "date";
|
|
57
49
|
};
|
|
58
50
|
declare const timestampTemporalColumn: {
|
|
59
51
|
readonly codecId: "pg/timestamp-temporal@1";
|
|
60
|
-
readonly nativeType: "timestamp";
|
|
61
52
|
};
|
|
62
53
|
declare const timestampStringColumn: {
|
|
63
54
|
readonly codecId: "pg/timestamp-string@1";
|
|
64
|
-
readonly nativeType: "timestamp";
|
|
65
55
|
};
|
|
66
56
|
declare const timestamptzTemporalColumn: {
|
|
67
57
|
readonly codecId: "pg/timestamptz-temporal@1";
|
|
68
|
-
readonly nativeType: "timestamptz";
|
|
69
58
|
};
|
|
70
59
|
declare const timestamptzJsDateColumn: {
|
|
71
60
|
readonly codecId: "pg/timestamptz-date@1";
|
|
72
|
-
readonly nativeType: "timestamptz";
|
|
73
61
|
};
|
|
74
62
|
declare const timestamptzStringColumn: {
|
|
75
63
|
readonly codecId: "pg/timestamptz-string@1";
|
|
76
|
-
readonly nativeType: "timestamptz";
|
|
77
64
|
};
|
|
78
65
|
declare function timeTemporalColumn(precision?: number): ColumnTypeDescriptor<typeof PG_TIME_TEMPORAL_CODEC_ID> & {
|
|
79
66
|
readonly typeParams?: {
|
|
@@ -92,7 +79,6 @@ declare function timetzColumn(precision?: number): ColumnTypeDescriptor<typeof P
|
|
|
92
79
|
};
|
|
93
80
|
declare const boolColumn: {
|
|
94
81
|
readonly codecId: "pg/bool@1";
|
|
95
|
-
readonly nativeType: "bool";
|
|
96
82
|
};
|
|
97
83
|
declare function bitColumn(length: number): ColumnTypeDescriptor<typeof PG_BIT_CODEC_ID> & {
|
|
98
84
|
readonly typeParams: {
|
|
@@ -111,7 +97,6 @@ declare function varbitColumn(length: number): ColumnTypeDescriptor<typeof PG_VA
|
|
|
111
97
|
*/
|
|
112
98
|
declare const byteaColumn: {
|
|
113
99
|
readonly codecId: "pg/bytea@1";
|
|
114
|
-
readonly nativeType: "bytea";
|
|
115
100
|
};
|
|
116
101
|
declare function intervalColumn(precision?: number): ColumnTypeDescriptor<typeof PG_INTERVAL_CODEC_ID> & {
|
|
117
102
|
readonly typeParams?: {
|
|
@@ -125,15 +110,13 @@ declare function intervalColumn(precision?: number): ColumnTypeDescriptor<typeof
|
|
|
125
110
|
*/
|
|
126
111
|
declare const jsonColumn: {
|
|
127
112
|
readonly codecId: "pg/json@1";
|
|
128
|
-
readonly nativeType: "json";
|
|
129
113
|
};
|
|
130
114
|
/**
|
|
131
115
|
* Postgres `jsonb` column descriptor — untyped raw JSONB. Same retirement note as {@link jsonColumn}.
|
|
132
116
|
*/
|
|
133
117
|
declare const jsonbColumn: {
|
|
134
118
|
readonly codecId: "pg/jsonb@1";
|
|
135
|
-
readonly nativeType: "jsonb";
|
|
136
119
|
};
|
|
137
120
|
//#endregion
|
|
138
121
|
export { timestamptzTemporalColumn as C, varcharColumn as E, timestamptzStringColumn as S, varbitColumn as T, timeStringColumn as _, dateStringColumn as a, timestampTemporalColumn as b, float8Column as c, int8Column as d, intervalColumn as f, textColumn as g, numericColumn as h, charColumn as i, int2Column as l, jsonbColumn as m, boolColumn as n, dateTemporalColumn as o, jsonColumn as p, byteaColumn as r, float4Column as s, bitColumn as t, int4Column as u, timeTemporalColumn as v, timetzColumn as w, timestamptzJsDateColumn as x, timestampStringColumn as y };
|
|
139
|
-
//# sourceMappingURL=column-types-
|
|
122
|
+
//# sourceMappingURL=column-types-Dq7mC_dL.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"column-types-Dq7mC_dL.d.mts","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/column-types.d.mts"],"mappings":";;;;;cAGc;WACH;;iBAEM,WAAW,iBAAiB,4BAA4B;WAC9D;aACE;;;iBAGI,cAAc,iBAAiB,4BAA4B;WACjE;aACE;;;cAGC;WACH;;cAEG;WACH;;cAEG;WACH;;cAEG;WACH;;cAEG;WACH;;iBAEM,cAAc,mBAAmB,iBAAiB,4BAA4B;WACpF;aACE;aACA;;;;;;;cAOC;WACH;;cAEG;WACH;;cAEG;WACH;;cAEG;WACH;;cAEG;WACH;;cAEG;WACH;;cAEG;WACH;;iBAEM,mBAAmB,qBAAqB,4BAA4B;WAC1E;aACE;;;iBAGI,iBAAiB,qBAAqB,4BAA4B;WACxE;aACE;;;iBAGI,aAAa,qBAAqB,4BAA4B;WACpE;aACE;;;cAGC;WACH;;iBAEM,UAAU,iBAAiB,4BAA4B;WAC7D;aACE;;;iBAGI,aAAa,iBAAiB,4BAA4B;WAChE;aACE;;;;;;;;cAQC;WACH;;iBAEM,eAAe,qBAAqB,4BAA4B;WACtE;aACE;;;;;;;;cAQC;WACH;;;;;cAKG;WACH"}
|
|
@@ -6,7 +6,10 @@ import { SqlControlTargetDescriptor } from "@prisma/orm-family-sql/family/contro
|
|
|
6
6
|
import { ColumnDefault } from "@prisma/orm-framework/contract/types";
|
|
7
7
|
//#region ../../../3-targets/3-targets/postgres/dist/control.d.mts
|
|
8
8
|
//#region src/core/migrations/postgres-contract-to-schema.d.ts
|
|
9
|
-
declare function postgresRenderDefault(def: ColumnDefault, column: StorageColumn,
|
|
9
|
+
declare function postgresRenderDefault(def: ColumnDefault, column: StorageColumn, type: {
|
|
10
|
+
readonly dataType: string;
|
|
11
|
+
readonly baseTypeName: string;
|
|
12
|
+
}): string;
|
|
10
13
|
//#endregion
|
|
11
14
|
//#region src/core/type-constructors.d.ts
|
|
12
15
|
/**
|
|
@@ -730,4 +733,4 @@ declare const postgresPslTypeConstructors: {
|
|
|
730
733
|
declare const postgresTargetDescriptor: SqlControlTargetDescriptor<"postgres", PostgresPlanTargetDetails, import("@prisma/orm-framework/contract/types").Contract<import("@prisma/orm-family-sql/contract/types").SqlStorage<string>>>;
|
|
731
734
|
//#endregion
|
|
732
735
|
export { postgresTargetDescriptor as a, postgresScalarAuthoringTypes as i, postgresPslTypeConstructors as n, postgresRenderDefault as r, postgresNativeAuthoringTypes as t };
|
|
733
|
-
//# sourceMappingURL=control-
|
|
736
|
+
//# sourceMappingURL=control-0nEwuD8F.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-0nEwuD8F.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/control.d.mts"],"mappings":";;;;;;;;iBASiB,sBAAsB,KAAK,eAAe,QAAQ,eAAe;WACvE;WACA;;;;;;;;;;;cAWG;WACH;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;;;;cAID;WACH;aACE;aACA;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;aACA;eACE;eACA;eACA;eACA;;eAEA;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;iBAEF;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;;;;;cASL;WACH;aACE;aACA;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;aACA;eACE;eACA;eACA;eACA;;eAEA;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;iBAEF;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;aACA;eACE;eACA;eACA;eACA;;aAEF;eACE;eACA;iBACE;mBACE;mBACA;;;;;WAKR;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;;;WAGJ;aACE;aACA;aACA;aACA;eACE;;;;;;cAMD,0BAA0B,uCAAuC,8DAA8D,gDAAgD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as PostgresDatabaseSchemaNode } from "./postgres-database-schema-node-Cv8usVNX-BP4GzjSf.mjs";
|
|
2
2
|
import "./types-D799eppJ.mjs";
|
|
3
|
-
import { t as PostgresCodecRegistry } from "./codecs-
|
|
3
|
+
import { t as PostgresCodecRegistry } from "./codecs-Djhvng3f.mjs";
|
|
4
4
|
import { g as PostgresDdlNode } from "./nodes-C1fPapnK-j0AK7Gcj.mjs";
|
|
5
5
|
import "./ddl-B-WjvCal.mjs";
|
|
6
6
|
import { t as parsePostgresDefault } from "./default-normalizer-ZZ7Y5boE.mjs";
|
|
@@ -97,13 +97,10 @@ declare class PostgresControlAdapter implements SqlControlAdapter<'postgres'> {
|
|
|
97
97
|
readonly profileHash: string;
|
|
98
98
|
readonly invariants?: readonly string[];
|
|
99
99
|
}): Promise<boolean>;
|
|
100
|
+
withTransaction<T>(driver: SqlControlDriverInstance<'postgres'>, fn: () => Promise<T>): Promise<T>;
|
|
101
|
+
lockMarker(driver: SqlControlDriverInstance<'postgres'>): Promise<void>;
|
|
100
102
|
/**
|
|
101
|
-
* Appends a ledger entry for `space`. When the edge carries a
|
|
102
|
-
* destination contract snapshot, the content-addressed
|
|
103
|
-
* `prisma_contract.contract` store is populated first (keyed by the
|
|
104
|
-
* destination hash, DO NOTHING on revisit) so a reader never sees a
|
|
105
|
-
* ledger row whose stored destination contract is missing. See the
|
|
106
|
-
* `SqlControlAdapter.writeLedgerEntry` contract.
|
|
103
|
+
* Appends a ledger entry for `space`. When the edge carries a destination contract snapshot, the content-addressed `prisma_contract.contract` store is populated first (keyed by the destination hash, DO NOTHING on revisit) so a reader never sees a ledger row whose stored destination contract is missing. See the `SqlControlAdapter.writeLedgerEntry` contract.
|
|
107
104
|
*/
|
|
108
105
|
writeLedgerEntry(driver: SqlControlDriverInstance<'postgres'>, space: string, entry: {
|
|
109
106
|
readonly edgeId: string;
|
|
@@ -180,4 +177,4 @@ declare class PostgresControlAdapter implements SqlControlAdapter<'postgres'> {
|
|
|
180
177
|
declare const postgresAdapterDescriptor: SqlControlAdapterDescriptor<'postgres'>;
|
|
181
178
|
//#endregion
|
|
182
179
|
export { postgresAdapterDescriptor as n, PostgresControlAdapter as t };
|
|
183
|
-
//# sourceMappingURL=control-
|
|
180
|
+
//# sourceMappingURL=control-CHqdVXHC.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-
|
|
1
|
+
{"version":3,"file":"control-CHqdVXHC.d.mts","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/control.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;cAiBc,kCAAkC;mBAC7B;mBACA;WACR;WACA;EACT,YAAY,eAAe,uBAAuB,gBAAgB;;;;;WAKzD,yBAAyB;EAClC,yCAAyC;EACzC,uCAAuC;;;;;;;;;EASvC,MAAM,KAAK,cAAc,iBAAiB,SAAS,0BAA0B;EAC7E,oBAAoB,QAAQ,WAAW,gBAAgB;;;;;;;;EAQvD,sBAAsB,KAAK,cAAc,iBAAiB,UAAU,0BAA0B,QAAQ;;;;;;;;;EAStG,WAAW,QAAQ,sCAAsC,gBAAgB,QAAQ;EACjF,wBAAwB,QAAQ,sCAAsC,gBAAgB,QAAQ;;;;;;;EAO9F,eAAe,QAAQ,uCAAuC,QAAQ,oBAAoB;UAClF;;;;;;;EAOR,WAAW,QAAQ,sCAAsC,iBAAiB,iBAAiB;UACnF;;;;;;EAMR,aAAa,QAAQ,sCAAsC,eAAe;aAC/D;aACA;aACA;MACP;EACJ,WAAW,QAAQ,sCAAsC,eAAe;aAC7D;aACA;aACA;MACP;;;;;EAKJ,aAAa,QAAQ,sCAAsC,eAAe,sBAAsB;aACrF;aACA;aACA;MACP;EACJ,gBAAgB,GAAG,QAAQ,sCAAsC,UAAU,QAAQ,KAAK,QAAQ;EAChG,WAAW,QAAQ,uCAAuC;;;;EAI1D,iBAAiB,QAAQ,sCAAsC,eAAe;aACnE;aACA;aACA;aACA;aACA;aACA;aACA;MACP;UACI;UACA;;;;;;;;;;;;;;;;;;;;;;;;;EAyBR,WAAW,QAAQ,sCAAsC,oBAAoB,kBAAkB,QAAQ;;;;;UAK/F;;;;;;;;;UASA;;;;;;;;UAQA;;;;;;;UAOA;;;;UAIA;;;;cAII,2BAA2B"}
|
|
@@ -2,19 +2,20 @@ import { C as PG_TIMESTAMPTZ_DATE_CODEC_ID, D as PG_TIMESTAMP_TEMPORAL_CODEC_ID,
|
|
|
2
2
|
import { s as postgresError } from "./errors-DYyzTYzE-39CV_aMo.mjs";
|
|
3
3
|
import { t as DEFAULT_NAMESPACE_ID } from "./namespace-ids-xtp_ZY86-Cpp8PTxD.mjs";
|
|
4
4
|
import { t as PostgresNativeEnum } from "./postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs";
|
|
5
|
-
import { M as setFallbackTemporal } from "./codecs-
|
|
5
|
+
import { M as setFallbackTemporal } from "./codecs-hSJgX8qY-fZSDQFIE.mjs";
|
|
6
6
|
import { i as PostgresRlsPolicy, n as PostgresRlsEnablement, o as PostgresRole } from "./postgres-schema-DXd0mebY-CExd_GcQ.mjs";
|
|
7
7
|
import { n as computeContentHash } from "./canonicalize-CrN3u_xM-D4MrOqcB.mjs";
|
|
8
|
-
import { m as postgresNowGeneratorIdFor, r as POLICY_BLOCK_KEYWORDS } from "./authoring-
|
|
8
|
+
import { m as postgresNowGeneratorIdFor, r as POLICY_BLOCK_KEYWORDS } from "./authoring-CfPWv_-P-BHAGgGYI.mjs";
|
|
9
9
|
import { t as postgresRenderCheckExpressions } from "./check-expressions-BRuSxJ5d-CC5OFfR1.mjs";
|
|
10
|
-
import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-
|
|
10
|
+
import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-DhVbdKvn-BO0y2Cn-.mjs";
|
|
11
11
|
import { a as postgresDiffSubjectGranularity, i as postgresDiffSubjectEntityKind } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
|
|
12
12
|
import { t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs";
|
|
13
|
-
import { r as diffPostgresSchema } from "./diff-database-schema-
|
|
14
|
-
import { t as PostgresContractSerializer } from "./postgres-contract-view-
|
|
15
|
-
import { a as postgresContractToSchema } from "./postgres-migration-
|
|
16
|
-
import { t as createPostgresMigrationPlanner } from "./planner-
|
|
17
|
-
import {
|
|
13
|
+
import { r as diffPostgresSchema } from "./diff-database-schema-DRPIV4Ae-BSY-cBm0.mjs";
|
|
14
|
+
import { t as PostgresContractSerializer } from "./postgres-contract-view-rT0ZLNqw-DThfALEV.mjs";
|
|
15
|
+
import { a as postgresContractToSchema } from "./postgres-migration-CmD95Eh_-DGLByWZD.mjs";
|
|
16
|
+
import { t as createPostgresMigrationPlanner } from "./planner-B5wkfdZ_-bckhSgt5.mjs";
|
|
17
|
+
import { n as MARKER_LOCK_SQL, t as MARKER_LOCK_KEY } from "./marker-lock-DFc1Tfv5-QMJSzMIa.mjs";
|
|
18
|
+
import { a as buildIndexAttribute, c as buildNativeEnumBlock, d as createPostgresTypeMap, f as inferPostgresPslContract, g as positionalArg, h as parseDefaultAttributeString, i as buildCheckAttribute, n as SYNTHETIC_SPAN, o as buildMapAttribute, p as namedArg, r as buildAttribute, s as buildModelConstraintAttribute } from "./infer-psl-contract-CkUkE2fE-bg9b0E0i.mjs";
|
|
18
19
|
import { requiredParamKeys, validateCodecTypeParams } from "@prisma/orm-framework/components/codec";
|
|
19
20
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
20
21
|
import { dataTypeParams, isSqlDataType, unquotedSqlBaseName } from "@prisma/orm-family-sql/contract/data-type";
|
|
@@ -39,7 +40,6 @@ import { SqlQueryError } from "@prisma/orm-family-sql/errors";
|
|
|
39
40
|
import { canonicalizeJson } from "@prisma/orm-framework/components/utils";
|
|
40
41
|
import { pslFieldMapName, pslModelMapName } from "@prisma/orm-family-sql/contract-psl/map-names";
|
|
41
42
|
//#region ../../../3-targets/3-targets/postgres/dist/control.mjs
|
|
42
|
-
const LOCK_DOMAIN = "prisma_8.contract.marker";
|
|
43
43
|
/**
|
|
44
44
|
* Deep clones and freezes a record object to prevent mutation.
|
|
45
45
|
* Recursively clones nested objects and arrays to ensure complete isolation.
|
|
@@ -66,20 +66,18 @@ var PostgresMigrationRunner = class {
|
|
|
66
66
|
* `BEGIN`/`COMMIT`/`ROLLBACK` lifecycle.
|
|
67
67
|
*/
|
|
68
68
|
async executeOnConnection(options) {
|
|
69
|
-
const schema = options.schemaName ?? Object.keys(options.destinationContract.storage.namespaces).find((id) => id !== UNBOUND_NAMESPACE_ID) ?? UNBOUND_NAMESPACE_ID;
|
|
70
69
|
const driver = options.driver;
|
|
71
70
|
if (options.space !== void 0 && options.space !== options.plan.spaceId) throw postgresError("MIGRATION.CONTRACT_SPACE_VIOLATION", `SqlMigrationRunner: options.space (${options.space}) does not match plan.spaceId (${options.plan.spaceId})`, { meta: {
|
|
72
71
|
space: options.space,
|
|
73
72
|
planSpaceId: options.plan.spaceId
|
|
74
73
|
} });
|
|
75
74
|
const space = options.plan.spaceId;
|
|
76
|
-
const lockKey = `${LOCK_DOMAIN}:${schema}:${space}`;
|
|
77
75
|
const planOps = blindCast(await Promise.all(options.plan.operations));
|
|
78
76
|
const destinationCheck = this.ensurePlanMatchesDestinationContract(options.plan.destination, options.destinationContract);
|
|
79
77
|
if (!destinationCheck.ok) return destinationCheck;
|
|
80
78
|
const policyCheck = this.enforcePolicyCompatibility(options.policy, planOps);
|
|
81
79
|
if (!policyCheck.ok) return policyCheck;
|
|
82
|
-
await this.acquireLock(driver
|
|
80
|
+
await this.acquireLock(driver);
|
|
83
81
|
const ensureResult = await this.ensureControlTables(driver, options.destinationContract);
|
|
84
82
|
if (!ensureResult.ok) return ensureResult;
|
|
85
83
|
const existingMarker = await this.family.readMarker({
|
|
@@ -360,11 +358,18 @@ var PostgresMigrationRunner = class {
|
|
|
360
358
|
space,
|
|
361
359
|
expectedFrom: existingMarker.storageHash,
|
|
362
360
|
destination
|
|
363
|
-
}))
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
361
|
+
})) {
|
|
362
|
+
const found = await this.family.readMarker({
|
|
363
|
+
driver,
|
|
364
|
+
space
|
|
365
|
+
});
|
|
366
|
+
return runnerFailure("MIGRATION.MARKER_CAS_FAILURE", "Marker was modified by another process during migration execution.", { meta: {
|
|
367
|
+
space,
|
|
368
|
+
expectedStorageHash: existingMarker.storageHash,
|
|
369
|
+
foundStorageHash: found?.storageHash ?? null,
|
|
370
|
+
destinationStorageHash: options.plan.destination.storageHash
|
|
371
|
+
} });
|
|
372
|
+
}
|
|
368
373
|
return okVoid();
|
|
369
374
|
}
|
|
370
375
|
async recordLedgerEntries(driver, options, executedOperations, planOpsLength) {
|
|
@@ -391,8 +396,8 @@ var PostgresMigrationRunner = class {
|
|
|
391
396
|
});
|
|
392
397
|
}
|
|
393
398
|
}
|
|
394
|
-
async acquireLock(driver
|
|
395
|
-
await driver.query(
|
|
399
|
+
async acquireLock(driver) {
|
|
400
|
+
await driver.query(MARKER_LOCK_SQL, [MARKER_LOCK_KEY]);
|
|
396
401
|
}
|
|
397
402
|
async beginTransaction(driver) {
|
|
398
403
|
await driver.query("BEGIN");
|
|
@@ -515,9 +520,9 @@ function sameValues$1(left, right) {
|
|
|
515
520
|
return left.length === right.length && left.every((value, index) => value === right[index]);
|
|
516
521
|
}
|
|
517
522
|
function refuseColumnWithoutPslType(column, coordinate) {
|
|
518
|
-
throw unsupported(`column ${coordinate} has
|
|
523
|
+
throw unsupported(`column ${coordinate} has data type "${column.dataType}" with codec "${column.codecId}", and no PSL type in the configured stack produces that pair.`, "A column is written as a PSL type that reads back with its codec and data type, and none of the types the target, adapter and extensions contribute does.", "Add the extension that contributes this type to the config, or keep authoring this contract in its current source.", {
|
|
519
524
|
coordinate,
|
|
520
|
-
|
|
525
|
+
dataType: column.dataType,
|
|
521
526
|
codecId: column.codecId
|
|
522
527
|
});
|
|
523
528
|
}
|
|
@@ -682,13 +687,13 @@ function refuseStorageOfUndeclaredField(input) {
|
|
|
682
687
|
}
|
|
683
688
|
/**
|
|
684
689
|
* Refuses a column typed by a named type when the contract declares no such type, or when the
|
|
685
|
-
* column's
|
|
690
|
+
* column's data type or codec is not the named type's. PSL writes the column as the name of the
|
|
686
691
|
* type, and the PSL source copies both from the named type.
|
|
687
692
|
*/
|
|
688
693
|
function refuseColumnDifferingFromNamedType(input) {
|
|
689
694
|
const { column, typeRef, namedType, coordinate } = input;
|
|
690
|
-
if (namedType?.
|
|
691
|
-
throw unsupported(namedType === void 0 ? `column ${coordinate} is typed by the named type "${typeRef}", which the contract does not declare, so it cannot be written in Prisma 8 PSL.` : `column ${coordinate} is typed by the named type "${typeRef}" but has a different
|
|
695
|
+
if (namedType?.dataType === column.dataType && namedType.codecId === column.codecId) return;
|
|
696
|
+
throw unsupported(namedType === void 0 ? `column ${coordinate} is typed by the named type "${typeRef}", which the contract does not declare, so it cannot be written in Prisma 8 PSL.` : `column ${coordinate} is typed by the named type "${typeRef}" but has a different data type or codec from it, which cannot be written in Prisma 8 PSL.`, "PSL writes such a column as the name of its named type, and the PSL source gives the column the data type and codec of that named type.", "Make the column and its named type agree, or keep authoring this contract in its current source.", {
|
|
692
697
|
coordinate,
|
|
693
698
|
typeRef
|
|
694
699
|
});
|
|
@@ -746,7 +751,7 @@ function refuseUnderivedVariantLink(entry, variant) {
|
|
|
746
751
|
const linkColumnsMatch = variantLinkColumns(entry, variant).every((column) => {
|
|
747
752
|
const base = variant.base.table.columns[column];
|
|
748
753
|
const expected = base === void 0 ? void 0 : new StorageColumn({
|
|
749
|
-
|
|
754
|
+
dataType: base.dataType,
|
|
750
755
|
codecId: base.codecId,
|
|
751
756
|
nullable: false,
|
|
752
757
|
...ifDefined("typeParams", base.typeParams),
|
|
@@ -1124,13 +1129,19 @@ const TYPE_PARAM_ORDER = [
|
|
|
1124
1129
|
"precision",
|
|
1125
1130
|
"scale"
|
|
1126
1131
|
];
|
|
1132
|
+
/** The name of the column's data type without parameters, as the type map knows it. */
|
|
1133
|
+
function baseTypeName(column, dataTypeLookup, coordinate) {
|
|
1134
|
+
const dataType = dataTypeLookup.get(column.dataType);
|
|
1135
|
+
if (dataType === void 0 || !isSqlDataType(dataType)) return refuseColumnWithoutPslType(column, coordinate);
|
|
1136
|
+
return unquotedSqlBaseName(dataType, dataTypeParams(dataType, column.typeParams));
|
|
1137
|
+
}
|
|
1127
1138
|
/**
|
|
1128
1139
|
* Re-composes the parenthesised native type the type map resolves
|
|
1129
|
-
* (`numeric(10,2)`) from a column's
|
|
1140
|
+
* (`numeric(10,2)`) from a column's base type name and its type parameters.
|
|
1130
1141
|
*/
|
|
1131
|
-
function
|
|
1142
|
+
function typeMapText(column, baseName) {
|
|
1132
1143
|
const args = TYPE_PARAM_ORDER.map((key) => column.typeParams?.[key]).filter((value) => typeof value === "number");
|
|
1133
|
-
return args.length === 0 ?
|
|
1144
|
+
return args.length === 0 ? baseName : `${baseName}(${args.join(", ")})`;
|
|
1134
1145
|
}
|
|
1135
1146
|
/** A type argument as PSL writes it: a number as written, a string between quotes. */
|
|
1136
1147
|
function typeArgumentText(value, coordinate) {
|
|
@@ -1157,8 +1168,8 @@ function typeCall(path, args) {
|
|
|
1157
1168
|
* type, when the stack's constructor of that name produces exactly the column's codec, native type
|
|
1158
1169
|
* and type parameters.
|
|
1159
1170
|
*/
|
|
1160
|
-
function typeMapCall(column, typeMap, authoringTypes) {
|
|
1161
|
-
const resolution = typeMap.resolve(
|
|
1171
|
+
function typeMapCall(column, baseName, typeMap, authoringTypes) {
|
|
1172
|
+
const resolution = typeMap.resolve(typeMapText(column, baseName));
|
|
1162
1173
|
if ("unsupported" in resolution) return void 0;
|
|
1163
1174
|
const { name } = resolution.pslType;
|
|
1164
1175
|
const descriptor = authoringTypes[name];
|
|
@@ -1175,7 +1186,8 @@ function typeMapCall(column, typeMap, authoringTypes) {
|
|
|
1175
1186
|
*/
|
|
1176
1187
|
function buildColumnType(input) {
|
|
1177
1188
|
const { column, typeMap, authoringTypes, enumBlockNames, coordinate } = input;
|
|
1178
|
-
const
|
|
1189
|
+
const baseName = baseTypeName(column, input.dataTypeLookup, coordinate);
|
|
1190
|
+
const enumBlockName = column.valueSet?.entityName ?? enumBlockNames.get(baseName);
|
|
1179
1191
|
if (column.codecId === "pg/enum@1" && enumBlockName !== void 0) return {
|
|
1180
1192
|
typeName: enumBlockName,
|
|
1181
1193
|
typeConstructor: {
|
|
@@ -1187,15 +1199,15 @@ function buildColumnType(input) {
|
|
|
1187
1199
|
};
|
|
1188
1200
|
const domainEnumName = column.valueSet?.entityName;
|
|
1189
1201
|
if (domainEnumName !== void 0) return { typeName: domainEnumName };
|
|
1190
|
-
const call = typeMapCall(column, typeMap, authoringTypes) ?? findAuthoringTypeConstructorCall(authoringTypes, column);
|
|
1202
|
+
const call = typeMapCall(column, baseName, typeMap, authoringTypes) ?? findAuthoringTypeConstructorCall(authoringTypes, column);
|
|
1191
1203
|
if (call !== void 0) return typeCall(call.path, call.args.map((value) => typeArgumentText(value, coordinate)));
|
|
1192
1204
|
refuseColumnWithoutPslType(column, coordinate);
|
|
1193
1205
|
}
|
|
1194
1206
|
/**
|
|
1195
|
-
* The type
|
|
1196
|
-
*
|
|
1207
|
+
* The data type a value-object member's codec represents, after checking the member's type
|
|
1208
|
+
* parameters against it. A member has no column of its own.
|
|
1197
1209
|
*/
|
|
1198
|
-
function
|
|
1210
|
+
function dataTypeOfMember(type, coordinate, context) {
|
|
1199
1211
|
const { codecId } = type;
|
|
1200
1212
|
const descriptor = context.codecLookup.descriptorFor(codecId);
|
|
1201
1213
|
if (descriptor === void 0) refuseMemberCodecWithoutNativeType(codecId, coordinate);
|
|
@@ -1204,13 +1216,13 @@ function nativeTypeOfMember(type, coordinate, context) {
|
|
|
1204
1216
|
const typeParams = resolvedTypeParams(type, void 0);
|
|
1205
1217
|
if (typeParams === void 0) {
|
|
1206
1218
|
if (requiredParamKeys(dataType).length > 0) refuseMemberCodecNeedingTypeParameters(codecId, coordinate);
|
|
1207
|
-
return
|
|
1219
|
+
return dataType.id;
|
|
1208
1220
|
}
|
|
1209
1221
|
validateCodecTypeParams(descriptor, {
|
|
1210
1222
|
codecId,
|
|
1211
1223
|
typeParams: blindCast(typeParams)
|
|
1212
1224
|
});
|
|
1213
|
-
return
|
|
1225
|
+
return dataType.id;
|
|
1214
1226
|
}
|
|
1215
1227
|
/** The PSL type position of a value-object member: a value object or an enum by name, or a scalar as a column would print. */
|
|
1216
1228
|
function buildMemberType(input) {
|
|
@@ -1227,7 +1239,7 @@ function buildMemberType(input) {
|
|
|
1227
1239
|
if (field.valueSet !== void 0) return { typeName: field.valueSet.entityName };
|
|
1228
1240
|
return buildColumnType({
|
|
1229
1241
|
column: new StorageColumn({
|
|
1230
|
-
|
|
1242
|
+
dataType: dataTypeOfMember(type, coordinate, input.context),
|
|
1231
1243
|
codecId: type.codecId,
|
|
1232
1244
|
nullable: field.nullable,
|
|
1233
1245
|
...ifDefined("many", field.many),
|
|
@@ -1235,6 +1247,7 @@ function buildMemberType(input) {
|
|
|
1235
1247
|
}),
|
|
1236
1248
|
typeMap: input.typeMap,
|
|
1237
1249
|
authoringTypes: input.context.authoringContributions.type,
|
|
1250
|
+
dataTypeLookup: input.context.dataTypeLookup,
|
|
1238
1251
|
enumBlockNames: input.enumBlockNames,
|
|
1239
1252
|
coordinate
|
|
1240
1253
|
});
|
|
@@ -1282,13 +1295,14 @@ function buildTypesBlock(contract, typeMap, context) {
|
|
|
1282
1295
|
refuseUnwritableName("named type", name);
|
|
1283
1296
|
const { typeName, typeConstructor } = buildColumnType({
|
|
1284
1297
|
column: new StorageColumn({
|
|
1285
|
-
|
|
1298
|
+
dataType: instance.dataType,
|
|
1286
1299
|
codecId: instance.codecId,
|
|
1287
1300
|
nullable: false,
|
|
1288
1301
|
...ifDefined("typeParams", instance.typeParams)
|
|
1289
1302
|
}),
|
|
1290
1303
|
typeMap,
|
|
1291
1304
|
authoringTypes: context.authoringContributions.type,
|
|
1305
|
+
dataTypeLookup: context.dataTypeLookup,
|
|
1292
1306
|
enumBlockNames: /* @__PURE__ */ new Map(),
|
|
1293
1307
|
coordinate: `types.${name}`
|
|
1294
1308
|
});
|
|
@@ -1357,8 +1371,9 @@ function buildNativeEnumBlocksForNamespace(input) {
|
|
|
1357
1371
|
const valueSetNamesByTypeName = /* @__PURE__ */ new Map();
|
|
1358
1372
|
for (const column of input.columns) {
|
|
1359
1373
|
const valueSetName = column.valueSet?.entityName;
|
|
1360
|
-
|
|
1361
|
-
|
|
1374
|
+
const typeName = column.typeParams?.["typeName"];
|
|
1375
|
+
if (valueSetName === void 0 || typeof typeName !== "string") continue;
|
|
1376
|
+
valueSetNamesByTypeName.set(typeName, valueSetName);
|
|
1362
1377
|
}
|
|
1363
1378
|
const claimed = new Set(valueSetNamesByTypeName.values());
|
|
1364
1379
|
const unreferenced = [];
|
|
@@ -1873,7 +1888,7 @@ function buildColumnDefault(input) {
|
|
|
1873
1888
|
const result = mapDefault(columnDefault, {
|
|
1874
1889
|
dataTypeEntries: context.authoringContributions.dataTypes,
|
|
1875
1890
|
dataTypeLookup: context.dataTypeLookup,
|
|
1876
|
-
|
|
1891
|
+
columnCodec: context.codecLookup.descriptorFor(input.isEnum ? PG_TEXT_CODEC_ID : input.column.codecId),
|
|
1877
1892
|
list: input.column.many !== false
|
|
1878
1893
|
});
|
|
1879
1894
|
if (result === void 0) refuseUnwritableLiteralDefault({
|
|
@@ -2026,6 +2041,7 @@ function buildScalarFields(input) {
|
|
|
2026
2041
|
column,
|
|
2027
2042
|
typeMap,
|
|
2028
2043
|
authoringTypes: context.authoringContributions.type,
|
|
2044
|
+
dataTypeLookup: context.dataTypeLookup,
|
|
2029
2045
|
enumBlockNames: enums.blockNamesByTypeName,
|
|
2030
2046
|
coordinate
|
|
2031
2047
|
});
|
|
@@ -2652,4 +2668,4 @@ const postgresTargetDescriptor = createPostgresTargetDescriptor();
|
|
|
2652
2668
|
//#endregion
|
|
2653
2669
|
export { postgresTargetDescriptor as i, postgresPslTypeConstructors as n, postgresScalarAuthoringTypes as r, postgresNativeAuthoringTypes as t };
|
|
2654
2670
|
|
|
2655
|
-
//# sourceMappingURL=control-
|
|
2671
|
+
//# sourceMappingURL=control-CgOBPYS9.mjs.map
|