@prisma/orm-target-postgres 0.16.0-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/LICENSE +201 -0
- package/README.md +23 -0
- package/dist/adapter-CWvVo0PV.d.mts +22 -0
- package/dist/adapter-CWvVo0PV.d.mts.map +1 -0
- package/dist/adapter-DhqcO3YO-jzwDVcCv.mjs +70 -0
- package/dist/adapter-DhqcO3YO-jzwDVcCv.mjs.map +1 -0
- package/dist/adapter.d.mts +12 -0
- package/dist/adapter.mjs +7 -0
- package/dist/adapter__adapter.d.mts +2 -0
- package/dist/adapter__adapter.mjs +2 -0
- package/dist/adapter__column-types.d.mts +2 -0
- package/dist/adapter__column-types.mjs +2 -0
- package/dist/adapter__control.d.mts +5 -0
- package/dist/adapter__control.mjs +441 -0
- package/dist/adapter__control.mjs.map +1 -0
- package/dist/adapter__operation-types.d.mts +2 -0
- package/dist/adapter__operation-types.mjs +1 -0
- package/dist/adapter__runtime.d.mts +2 -0
- package/dist/adapter__runtime.mjs +38 -0
- package/dist/adapter__runtime.mjs.map +1 -0
- package/dist/adapter__types.d.mts +4 -0
- package/dist/adapter__types.mjs +1 -0
- package/dist/authoring-03FwIL2k-kPjZAp3s.mjs +757 -0
- package/dist/authoring-03FwIL2k-kPjZAp3s.mjs.map +1 -0
- package/dist/canonicalize-CQlxSR4D-MnrT5gtW.d.mts +34 -0
- package/dist/canonicalize-CQlxSR4D-MnrT5gtW.d.mts.map +1 -0
- package/dist/canonicalize-CrN3u_xM-D4MrOqcB.mjs +59 -0
- package/dist/canonicalize-CrN3u_xM-D4MrOqcB.mjs.map +1 -0
- package/dist/codec-descriptor-Bec_zukr-BfvtUqhm.d.mts +37 -0
- package/dist/codec-descriptor-Bec_zukr-BfvtUqhm.d.mts.map +1 -0
- package/dist/codec-descriptor-Bg-_412t.d.mts +1 -0
- package/dist/codec-descriptor-CB6x0xEu-C-Zn2IEz.mjs +135 -0
- package/dist/codec-descriptor-CB6x0xEu-C-Zn2IEz.mjs.map +1 -0
- package/dist/codec-ids-CsOU3xDv-mPI0INiF.d.mts +33 -0
- package/dist/codec-ids-CsOU3xDv-mPI0INiF.d.mts.map +1 -0
- package/dist/codec-ids-fgafMLR7.d.mts +1 -0
- package/dist/codec-ids-tX7Svtz--BuOfRaVU.mjs +33 -0
- package/dist/codec-ids-tX7Svtz--BuOfRaVU.mjs.map +1 -0
- package/dist/codec-types-BHwY9Ff-.d.mts +2 -0
- package/dist/codec-types-mWhnDEAf-CAQzGFnF.d.mts +82 -0
- package/dist/codec-types-mWhnDEAf-CAQzGFnF.d.mts.map +1 -0
- package/dist/codecs-CBl0nD44-CaWPc1bd.mjs +1486 -0
- package/dist/codecs-CBl0nD44-CaWPc1bd.mjs.map +1 -0
- package/dist/codecs-CHIVTNZs.mjs +15 -0
- package/dist/codecs-CHIVTNZs.mjs.map +1 -0
- package/dist/codecs-Cvqvb9pV-Cdc51FKY.d.mts +589 -0
- package/dist/codecs-Cvqvb9pV-Cdc51FKY.d.mts.map +1 -0
- package/dist/codecs-DBn-uIv-.d.mts +15 -0
- package/dist/codecs-DBn-uIv-.d.mts.map +1 -0
- package/dist/column-types-BH-MU6uU.d.mts +108 -0
- package/dist/column-types-BH-MU6uU.d.mts.map +1 -0
- package/dist/column-types-CwAyCgp2.mjs +126 -0
- package/dist/column-types-CwAyCgp2.mjs.map +1 -0
- package/dist/contract-free-BZUS18FU.mjs +118 -0
- package/dist/contract-free-BZUS18FU.mjs.map +1 -0
- package/dist/contract-free-DzpGxLfb.d.mts +258 -0
- package/dist/contract-free-DzpGxLfb.d.mts.map +1 -0
- package/dist/control-2F195jJk.d.mts +11 -0
- package/dist/control-2F195jJk.d.mts.map +1 -0
- package/dist/control-6WFTtLAM.mjs +60 -0
- package/dist/control-6WFTtLAM.mjs.map +1 -0
- package/dist/control-B-FTbEnE.d.mts +22 -0
- package/dist/control-B-FTbEnE.d.mts.map +1 -0
- package/dist/control-D85zv_aY.d.mts +199 -0
- package/dist/control-D85zv_aY.d.mts.map +1 -0
- package/dist/control-DRMWptiJ.mjs +1355 -0
- package/dist/control-DRMWptiJ.mjs.map +1 -0
- package/dist/control-adapter-B9t0g7Pf-HrCxlM65.mjs +1901 -0
- package/dist/control-adapter-B9t0g7Pf-HrCxlM65.mjs.map +1 -0
- package/dist/control-policy-Cl3RRSPg-CT3QGpR3.mjs +1257 -0
- package/dist/control-policy-Cl3RRSPg-CT3QGpR3.mjs.map +1 -0
- package/dist/data-transform-BSM7TQpE.d.mts +1 -0
- package/dist/data-transform-ChZzy2dP-CxVCat_8.mjs +53 -0
- package/dist/data-transform-ChZzy2dP-CxVCat_8.mjs.map +1 -0
- package/dist/data-transform-Ck5FbyNO-BNE7QlAo.d.mts +38 -0
- package/dist/data-transform-Ck5FbyNO-BNE7QlAo.d.mts.map +1 -0
- package/dist/ddl-B4Rh8ntj.d.mts +1 -0
- package/dist/ddl-BdP4q3KY-Duef4uHw.mjs +395 -0
- package/dist/ddl-BdP4q3KY-Duef4uHw.mjs.map +1 -0
- package/dist/default-normalizer-B36TOul4.d.mts +31 -0
- package/dist/default-normalizer-B36TOul4.d.mts.map +1 -0
- package/dist/default-normalizer-Ba5ZebHM-isV86rjy.mjs +253 -0
- package/dist/default-normalizer-Ba5ZebHM-isV86rjy.mjs.map +1 -0
- package/dist/descriptor-meta-2IlVC6_d-DnV00Qd_.mjs +351 -0
- package/dist/descriptor-meta-2IlVC6_d-DnV00Qd_.mjs.map +1 -0
- package/dist/descriptor-meta-DnHabAS3-C53XXPQw.mjs +28 -0
- package/dist/descriptor-meta-DnHabAS3-C53XXPQw.mjs.map +1 -0
- package/dist/descriptor-meta-runtime-UwYdV8fD-B_m_Ha8r.mjs +13 -0
- package/dist/descriptor-meta-runtime-UwYdV8fD-B_m_Ha8r.mjs.map +1 -0
- package/dist/diff-database-schema-BfRs2vrG-D2o4KII0.mjs +390 -0
- package/dist/diff-database-schema-BfRs2vrG-D2o4KII0.mjs.map +1 -0
- package/dist/diff-database-schema-DsoNznGC.d.mts +38 -0
- package/dist/diff-database-schema-DsoNznGC.d.mts.map +1 -0
- package/dist/driver.d.mts +3 -0
- package/dist/driver.mjs +2 -0
- package/dist/driver__control.d.mts +2 -0
- package/dist/driver__control.mjs +2 -0
- package/dist/driver__runtime.d.mts +2 -0
- package/dist/driver__runtime.mjs +597 -0
- package/dist/driver__runtime.mjs.map +1 -0
- package/dist/errors-DCcVX4j1.d.mts +32 -0
- package/dist/errors-DCcVX4j1.d.mts.map +1 -0
- package/dist/errors-kYxOQjdD-D4T3rbVp.mjs +39 -0
- package/dist/errors-kYxOQjdD-D4T3rbVp.mjs.map +1 -0
- package/dist/issue-planner-jkY6p-Ca.d.mts +105 -0
- package/dist/issue-planner-jkY6p-Ca.d.mts.map +1 -0
- package/dist/migration-CBSAPE8S.d.mts +25 -0
- package/dist/migration-CBSAPE8S.d.mts.map +1 -0
- package/dist/migration-PTHAY9Cv.mjs +21 -0
- package/dist/migration-PTHAY9Cv.mjs.map +1 -0
- package/dist/namespace-ids-xtp_ZY86-Cpp8PTxD.mjs +7 -0
- package/dist/namespace-ids-xtp_ZY86-Cpp8PTxD.mjs.map +1 -0
- package/dist/native-type-normalizer-DqJlOTeX.d.mts +19 -0
- package/dist/native-type-normalizer-DqJlOTeX.d.mts.map +1 -0
- package/dist/native-type-normalizer-yvd3tqv-.mjs +38 -0
- package/dist/native-type-normalizer-yvd3tqv-.mjs.map +1 -0
- package/dist/nodes-BU-V-aZA-RqwPH68u.d.mts +235 -0
- package/dist/nodes-BU-V-aZA-RqwPH68u.d.mts.map +1 -0
- package/dist/nodes-DAvDJLvJ-BBdvFXNa.mjs +255 -0
- package/dist/nodes-DAvDJLvJ-BBdvFXNa.mjs.map +1 -0
- package/dist/normalize-error-CNjgVO71-CLlZ3CuJ.mjs +121 -0
- package/dist/normalize-error-CNjgVO71-CLlZ3CuJ.mjs.map +1 -0
- package/dist/op-factory-call-DifL68KT-Bo6pxs-R.mjs +2009 -0
- package/dist/op-factory-call-DifL68KT-Bo6pxs-R.mjs.map +1 -0
- package/dist/op-factory-call-FEA5mnWH.d.mts +1 -0
- package/dist/op-factory-call-jd4cgfjA-CyNT4YVn.d.mts +521 -0
- package/dist/op-factory-call-jd4cgfjA-CyNT4YVn.d.mts.map +1 -0
- package/dist/operation-types-BfRocNI8.d.mts +22 -0
- package/dist/operation-types-BfRocNI8.d.mts.map +1 -0
- package/dist/pack-DFM4tmob.d.mts +610 -0
- package/dist/pack-DFM4tmob.d.mts.map +1 -0
- package/dist/planner-Bmje9ii8-B99fEsNM.mjs +588 -0
- package/dist/planner-Bmje9ii8-B99fEsNM.mjs.map +1 -0
- package/dist/planner-DL4Bh5Nk.d.mts +163 -0
- package/dist/planner-DL4Bh5Nk.d.mts.map +1 -0
- package/dist/planner-ddl-builders-CbfICQfm-CxYiLrhX.mjs +102 -0
- package/dist/planner-ddl-builders-CbfICQfm-CxYiLrhX.mjs.map +1 -0
- package/dist/planner-ddl-builders-ijp60-JO.d.mts +19 -0
- package/dist/planner-ddl-builders-ijp60-JO.d.mts.map +1 -0
- package/dist/planner-identity-values-BmHn5C6U-BYBbUAyR.mjs +90 -0
- package/dist/planner-identity-values-BmHn5C6U-BYBbUAyR.mjs.map +1 -0
- package/dist/planner-identity-values-TfEhnoWa.d.mts +25 -0
- package/dist/planner-identity-values-TfEhnoWa.d.mts.map +1 -0
- package/dist/planner-produced-postgres-migration-B0PQLLUb-qsS6cQqX.d.mts +25 -0
- package/dist/planner-produced-postgres-migration-B0PQLLUb-qsS6cQqX.d.mts.map +1 -0
- package/dist/planner-produced-postgres-migration-C3GPZWeC.d.mts +1 -0
- package/dist/planner-produced-postgres-migration-Cicg2sXg-Ck9iDxGI.mjs +47 -0
- package/dist/planner-produced-postgres-migration-Cicg2sXg-Ck9iDxGI.mjs.map +1 -0
- package/dist/planner-schema-lookup-C4DHAddq.d.mts +21 -0
- package/dist/planner-schema-lookup-C4DHAddq.d.mts.map +1 -0
- package/dist/planner-schema-lookup-kMIVP2y--CdO4VlnF.mjs +57 -0
- package/dist/planner-schema-lookup-kMIVP2y--CdO4VlnF.mjs.map +1 -0
- package/dist/planner-sql-checks-CFgbRTJw.d.mts +20 -0
- package/dist/planner-sql-checks-CFgbRTJw.d.mts.map +1 -0
- package/dist/planner-sql-checks-DRc_78n8-C9nHOrvU.mjs +152 -0
- package/dist/planner-sql-checks-DRc_78n8-C9nHOrvU.mjs.map +1 -0
- package/dist/planner-target-details-HkP4RrRO-_xPQVPF0.d.mts +12 -0
- package/dist/planner-target-details-HkP4RrRO-_xPQVPF0.d.mts.map +1 -0
- package/dist/planner-type-resolution-Bt2f_q-F-C4T6YTae.mjs +15 -0
- package/dist/planner-type-resolution-Bt2f_q-F-C4T6YTae.mjs.map +1 -0
- package/dist/postgres-contract-view-2OP5JnXl-D2fpy4-8.d.mts +36 -0
- package/dist/postgres-contract-view-2OP5JnXl-D2fpy4-8.d.mts.map +1 -0
- package/dist/postgres-contract-view-FdLX7dV9-Cat1VKV9.mjs +144 -0
- package/dist/postgres-contract-view-FdLX7dV9-Cat1VKV9.mjs.map +1 -0
- package/dist/postgres-database-schema-node-CyfpHXDr-BqyozkQE.d.mts +285 -0
- package/dist/postgres-database-schema-node-CyfpHXDr-BqyozkQE.d.mts.map +1 -0
- package/dist/postgres-migration-CDJj7CvD-Bsqs_fVo.d.mts +260 -0
- package/dist/postgres-migration-CDJj7CvD-Bsqs_fVo.d.mts.map +1 -0
- package/dist/postgres-migration-CJshdIZn-DYYjgdD0.mjs +201 -0
- package/dist/postgres-migration-CJshdIZn-DYYjgdD0.mjs.map +1 -0
- package/dist/postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs +45 -0
- package/dist/postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs.map +1 -0
- package/dist/postgres-rls-policy-CnDxf3z9-C3LIHAIG.d.mts +61 -0
- package/dist/postgres-rls-policy-CnDxf3z9-C3LIHAIG.d.mts.map +1 -0
- package/dist/postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs +204 -0
- package/dist/postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs.map +1 -0
- package/dist/postgres-schema-KSzLDONj-CsXGoY8b.mjs +421 -0
- package/dist/postgres-schema-KSzLDONj-CsXGoY8b.mjs.map +1 -0
- package/dist/postgres-schema-Xsjt3RKO-Buv2X8ai.d.mts +269 -0
- package/dist/postgres-schema-Xsjt3RKO-Buv2X8ai.d.mts.map +1 -0
- package/dist/postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs +212 -0
- package/dist/postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs.map +1 -0
- package/dist/render-ops-DPwhZt2W.d.mts +11 -0
- package/dist/render-ops-DPwhZt2W.d.mts.map +1 -0
- package/dist/render-ops-DxzTxSsv-Bz85uUHk.mjs +34 -0
- package/dist/render-ops-DxzTxSsv-Bz85uUHk.mjs.map +1 -0
- package/dist/render-typescript-6sCFvMBh.d.mts +21 -0
- package/dist/render-typescript-6sCFvMBh.d.mts.map +1 -0
- package/dist/render-typescript-Cw3lFO28-Cx0lXWmv.mjs +117 -0
- package/dist/render-typescript-Cw3lFO28-Cx0lXWmv.mjs.map +1 -0
- package/dist/resolve-ddl-schema-CxqlLW47-0GiHRziS.mjs +22 -0
- package/dist/resolve-ddl-schema-CxqlLW47-0GiHRziS.mjs.map +1 -0
- package/dist/runtime-BbSRVwdd.d.mts +12 -0
- package/dist/runtime-BbSRVwdd.d.mts.map +1 -0
- package/dist/runtime-CDewySU9.d.mts +55 -0
- package/dist/runtime-CDewySU9.d.mts.map +1 -0
- package/dist/runtime-_TfO66h5.d.mts +32 -0
- package/dist/runtime-_TfO66h5.d.mts.map +1 -0
- package/dist/schema-ir-annotations-DuuYh0gl.d.mts +15 -0
- package/dist/schema-ir-annotations-DuuYh0gl.d.mts.map +1 -0
- package/dist/schema-node-kinds-qlnURWJy-Bo30pwTM.d.mts +30 -0
- package/dist/schema-node-kinds-qlnURWJy-Bo30pwTM.d.mts.map +1 -0
- package/dist/sql-utils-BnBlQxyh-DaX9Nb7Z.mjs +90 -0
- package/dist/sql-utils-BnBlQxyh-DaX9Nb7Z.mjs.map +1 -0
- package/dist/sql-utils-DW6fkczF.d.mts +62 -0
- package/dist/sql-utils-DW6fkczF.d.mts.map +1 -0
- package/dist/table-source-ikHOZmhD-DriY1Lcr.d.mts +15 -0
- package/dist/table-source-ikHOZmhD-DriY1Lcr.d.mts.map +1 -0
- package/dist/target.d.mts +47 -0
- package/dist/target.mjs +34 -0
- package/dist/target__codec-descriptor.d.mts +3 -0
- package/dist/target__codec-descriptor.mjs +2 -0
- package/dist/target__codec-ids.d.mts +3 -0
- package/dist/target__codec-ids.mjs +2 -0
- package/dist/target__codec-types.d.mts +4 -0
- package/dist/target__codec-types.mjs +1 -0
- package/dist/target__codecs.d.mts +3 -0
- package/dist/target__codecs.mjs +3 -0
- package/dist/target__contract-free.d.mts +3 -0
- package/dist/target__contract-free.mjs +4 -0
- package/dist/target__control.d.mts +2 -0
- package/dist/target__control.mjs +2 -0
- package/dist/target__data-transform.d.mts +3 -0
- package/dist/target__data-transform.mjs +2 -0
- package/dist/target__ddl.d.mts +4 -0
- package/dist/target__ddl.mjs +2 -0
- package/dist/target__default-normalizer.d.mts +2 -0
- package/dist/target__default-normalizer.mjs +2 -0
- package/dist/target__diff-database-schema.d.mts +2 -0
- package/dist/target__diff-database-schema.mjs +2 -0
- package/dist/target__errors.d.mts +2 -0
- package/dist/target__errors.mjs +2 -0
- package/dist/target__issue-planner.d.mts +2 -0
- package/dist/target__issue-planner.mjs +2 -0
- package/dist/target__migration.d.mts +4 -0
- package/dist/target__migration.mjs +5 -0
- package/dist/target__native-type-normalizer.d.mts +2 -0
- package/dist/target__native-type-normalizer.mjs +2 -0
- package/dist/target__op-factory-call.d.mts +3 -0
- package/dist/target__op-factory-call.mjs +2 -0
- package/dist/target__pack.d.mts +2 -0
- package/dist/target__pack.mjs +2 -0
- package/dist/target__planner-ddl-builders.d.mts +2 -0
- package/dist/target__planner-ddl-builders.mjs +2 -0
- package/dist/target__planner-identity-values.d.mts +2 -0
- package/dist/target__planner-identity-values.mjs +2 -0
- package/dist/target__planner-produced-postgres-migration.d.mts +3 -0
- package/dist/target__planner-produced-postgres-migration.mjs +2 -0
- package/dist/target__planner-schema-lookup.d.mts +2 -0
- package/dist/target__planner-schema-lookup.mjs +2 -0
- package/dist/target__planner-sql-checks.d.mts +2 -0
- package/dist/target__planner-sql-checks.mjs +2 -0
- package/dist/target__planner-target-details.d.mts +2 -0
- package/dist/target__planner-target-details.mjs +1 -0
- package/dist/target__planner.d.mts +2 -0
- package/dist/target__planner.mjs +3 -0
- package/dist/target__render-ops.d.mts +2 -0
- package/dist/target__render-ops.mjs +2 -0
- package/dist/target__render-typescript.d.mts +2 -0
- package/dist/target__render-typescript.mjs +2 -0
- package/dist/target__rls-canonicalize.d.mts +2 -0
- package/dist/target__rls-canonicalize.mjs +2 -0
- package/dist/target__runtime.d.mts +3 -0
- package/dist/target__runtime.mjs +23 -0
- package/dist/target__runtime.mjs.map +1 -0
- package/dist/target__schema-ir-annotations.d.mts +2 -0
- package/dist/target__schema-ir-annotations.mjs +2 -0
- package/dist/target__sql-utils.d.mts +2 -0
- package/dist/target__sql-utils.mjs +2 -0
- package/dist/target__types.d.mts +7 -0
- package/dist/target__types.mjs +5 -0
- package/dist/types-CkryN1AS-6MNZLjLY.d.mts +27 -0
- package/dist/types-CkryN1AS-6MNZLjLY.d.mts.map +1 -0
- package/dist/types-Cp_Jf2tk.d.mts +1 -0
- package/dist/types-ue6jkJyF-BQJzjx1P.d.mts +10 -0
- package/dist/types-ue6jkJyF-BQJzjx1P.d.mts.map +1 -0
- package/dist/types-xa86TkcV.d.mts +32 -0
- package/dist/types-xa86TkcV.d.mts.map +1 -0
- package/package.json +95 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { ColumnTypeDescriptor } from "@prisma/orm-framework/components/codec";
|
|
2
|
+
//#region ../../../3-targets/6-adapters/postgres/dist/column-types.d.mts
|
|
3
|
+
//#region src/exports/column-types.d.ts
|
|
4
|
+
declare const textColumn: {
|
|
5
|
+
readonly codecId: "pg/text@1";
|
|
6
|
+
readonly nativeType: "text";
|
|
7
|
+
};
|
|
8
|
+
declare function charColumn(length: number): ColumnTypeDescriptor & {
|
|
9
|
+
readonly typeParams: {
|
|
10
|
+
readonly length: number;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
declare function varcharColumn(length: number): ColumnTypeDescriptor & {
|
|
14
|
+
readonly typeParams: {
|
|
15
|
+
readonly length: number;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
declare const int4Column: {
|
|
19
|
+
readonly codecId: "pg/int4@1";
|
|
20
|
+
readonly nativeType: "int4";
|
|
21
|
+
};
|
|
22
|
+
declare const int2Column: {
|
|
23
|
+
readonly codecId: "pg/int2@1";
|
|
24
|
+
readonly nativeType: "int2";
|
|
25
|
+
};
|
|
26
|
+
declare const int8Column: {
|
|
27
|
+
readonly codecId: "pg/int8@1";
|
|
28
|
+
readonly nativeType: "int8";
|
|
29
|
+
};
|
|
30
|
+
declare const float4Column: {
|
|
31
|
+
readonly codecId: "pg/float4@1";
|
|
32
|
+
readonly nativeType: "float4";
|
|
33
|
+
};
|
|
34
|
+
declare const float8Column: {
|
|
35
|
+
readonly codecId: "pg/float8@1";
|
|
36
|
+
readonly nativeType: "float8";
|
|
37
|
+
};
|
|
38
|
+
declare function numericColumn(precision: number, scale?: number): ColumnTypeDescriptor & {
|
|
39
|
+
readonly typeParams: {
|
|
40
|
+
readonly precision: number;
|
|
41
|
+
readonly scale?: number;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
declare const timestampColumn: {
|
|
45
|
+
readonly codecId: "pg/timestamp@1";
|
|
46
|
+
readonly nativeType: "timestamp";
|
|
47
|
+
};
|
|
48
|
+
declare const timestamptzColumn: {
|
|
49
|
+
readonly codecId: "pg/timestamptz@1";
|
|
50
|
+
readonly nativeType: "timestamptz";
|
|
51
|
+
};
|
|
52
|
+
declare function timeColumn(precision?: number): ColumnTypeDescriptor & {
|
|
53
|
+
readonly typeParams?: {
|
|
54
|
+
readonly precision: number;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
declare function timetzColumn(precision?: number): ColumnTypeDescriptor & {
|
|
58
|
+
readonly typeParams?: {
|
|
59
|
+
readonly precision: number;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
declare const boolColumn: {
|
|
63
|
+
readonly codecId: "pg/bool@1";
|
|
64
|
+
readonly nativeType: "bool";
|
|
65
|
+
};
|
|
66
|
+
declare function bitColumn(length: number): ColumnTypeDescriptor & {
|
|
67
|
+
readonly typeParams: {
|
|
68
|
+
readonly length: number;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
declare function varbitColumn(length: number): ColumnTypeDescriptor & {
|
|
72
|
+
readonly typeParams: {
|
|
73
|
+
readonly length: number;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Postgres `bytea` column descriptor — variable-length binary string.
|
|
78
|
+
*
|
|
79
|
+
* 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.
|
|
80
|
+
*/
|
|
81
|
+
declare const byteaColumn: {
|
|
82
|
+
readonly codecId: "pg/bytea@1";
|
|
83
|
+
readonly nativeType: "bytea";
|
|
84
|
+
};
|
|
85
|
+
declare function intervalColumn(precision?: number): ColumnTypeDescriptor & {
|
|
86
|
+
readonly typeParams?: {
|
|
87
|
+
readonly precision: number;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Postgres `json` column descriptor — untyped raw JSON.
|
|
92
|
+
*
|
|
93
|
+
* 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.
|
|
94
|
+
*/
|
|
95
|
+
declare const jsonColumn: {
|
|
96
|
+
readonly codecId: "pg/json@1";
|
|
97
|
+
readonly nativeType: "json";
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Postgres `jsonb` column descriptor — untyped raw JSONB. Same retirement note as {@link jsonColumn}.
|
|
101
|
+
*/
|
|
102
|
+
declare const jsonbColumn: {
|
|
103
|
+
readonly codecId: "pg/jsonb@1";
|
|
104
|
+
readonly nativeType: "jsonb";
|
|
105
|
+
};
|
|
106
|
+
//#endregion
|
|
107
|
+
export { timestamptzColumn as _, float4Column as a, varcharColumn as b, int4Column as c, jsonColumn as d, jsonbColumn as f, timestampColumn as g, timeColumn as h, charColumn as i, int8Column as l, textColumn as m, boolColumn as n, float8Column as o, numericColumn as p, byteaColumn as r, int2Column as s, bitColumn as t, intervalColumn as u, timetzColumn as v, varbitColumn as y };
|
|
108
|
+
//# sourceMappingURL=column-types-BH-MU6uU.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"column-types-BH-MU6uU.d.mts","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/column-types.d.mts"],"mappings":";;;cAEc;WACH;WACA;;iBAEM,WAAW,iBAAiB;WAClC;aACE;;;iBAGI,cAAc,iBAAiB;WACrC;aACE;;;cAGC;WACH;WACA;;cAEG;WACH;WACA;;cAEG;WACH;WACA;;cAEG;WACH;WACA;;cAEG;WACH;WACA;;iBAEM,cAAc,mBAAmB,iBAAiB;WACxD;aACE;aACA;;;cAGC;WACH;WACA;;cAEG;WACH;WACA;;iBAEM,WAAW,qBAAqB;WACtC;aACE;;;iBAGI,aAAa,qBAAqB;WACxC;aACE;;;cAGC;WACH;WACA;;iBAEM,UAAU,iBAAiB;WACjC;aACE;;;iBAGI,aAAa,iBAAiB;WACpC;aACE;;;;;;;;cAQC;WACH;WACA;;iBAEM,eAAe,qBAAqB;WAC1C;aACE;;;;;;;;cAQC;WACH;WACA;;;;;cAKG;WACH;WACA"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { C as PG_TIMETZ_CODEC_ID, E as PG_VARBIT_CODEC_ID, N as SQL_VARCHAR_CODEC_ID, O as SQL_CHAR_CODEC_ID, S as PG_TIMESTAMP_CODEC_ID, _ as PG_JSON_CODEC_ID, b as PG_TEXT_CODEC_ID, c as PG_FLOAT8_CODEC_ID, d as PG_INT2_CODEC_ID, f as PG_INT4_CODEC_ID, g as PG_JSONB_CODEC_ID, m as PG_INTERVAL_CODEC_ID, n as PG_BOOL_CODEC_ID, p as PG_INT8_CODEC_ID, r as PG_BYTEA_CODEC_ID, s as PG_FLOAT4_CODEC_ID, t as PG_BIT_CODEC_ID, v as PG_NUMERIC_CODEC_ID, w as PG_TIME_CODEC_ID, x as PG_TIMESTAMPTZ_CODEC_ID } from "./codec-ids-tX7Svtz--BuOfRaVU.mjs";
|
|
2
|
+
//#region ../../../3-targets/6-adapters/postgres/dist/column-types.mjs
|
|
3
|
+
const textColumn = {
|
|
4
|
+
codecId: PG_TEXT_CODEC_ID,
|
|
5
|
+
nativeType: "text"
|
|
6
|
+
};
|
|
7
|
+
function charColumn(length) {
|
|
8
|
+
return {
|
|
9
|
+
codecId: SQL_CHAR_CODEC_ID,
|
|
10
|
+
nativeType: "character",
|
|
11
|
+
typeParams: { length }
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function varcharColumn(length) {
|
|
15
|
+
return {
|
|
16
|
+
codecId: SQL_VARCHAR_CODEC_ID,
|
|
17
|
+
nativeType: "character varying",
|
|
18
|
+
typeParams: { length }
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const int4Column = {
|
|
22
|
+
codecId: PG_INT4_CODEC_ID,
|
|
23
|
+
nativeType: "int4"
|
|
24
|
+
};
|
|
25
|
+
const int2Column = {
|
|
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
|
+
};
|
|
41
|
+
function numericColumn(precision, scale) {
|
|
42
|
+
return {
|
|
43
|
+
codecId: PG_NUMERIC_CODEC_ID,
|
|
44
|
+
nativeType: "numeric",
|
|
45
|
+
typeParams: scale === void 0 ? { precision } : {
|
|
46
|
+
precision,
|
|
47
|
+
scale
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
const timestampColumn = {
|
|
52
|
+
codecId: PG_TIMESTAMP_CODEC_ID,
|
|
53
|
+
nativeType: "timestamp"
|
|
54
|
+
};
|
|
55
|
+
const timestamptzColumn = {
|
|
56
|
+
codecId: PG_TIMESTAMPTZ_CODEC_ID,
|
|
57
|
+
nativeType: "timestamptz"
|
|
58
|
+
};
|
|
59
|
+
function timeColumn(precision) {
|
|
60
|
+
return {
|
|
61
|
+
codecId: PG_TIME_CODEC_ID,
|
|
62
|
+
nativeType: "time",
|
|
63
|
+
...precision === void 0 ? {} : { typeParams: { precision } }
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function timetzColumn(precision) {
|
|
67
|
+
return {
|
|
68
|
+
codecId: PG_TIMETZ_CODEC_ID,
|
|
69
|
+
nativeType: "timetz",
|
|
70
|
+
...precision === void 0 ? {} : { typeParams: { precision } }
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
const boolColumn = {
|
|
74
|
+
codecId: PG_BOOL_CODEC_ID,
|
|
75
|
+
nativeType: "bool"
|
|
76
|
+
};
|
|
77
|
+
function bitColumn(length) {
|
|
78
|
+
return {
|
|
79
|
+
codecId: PG_BIT_CODEC_ID,
|
|
80
|
+
nativeType: "bit",
|
|
81
|
+
typeParams: { length }
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function varbitColumn(length) {
|
|
85
|
+
return {
|
|
86
|
+
codecId: PG_VARBIT_CODEC_ID,
|
|
87
|
+
nativeType: "bit varying",
|
|
88
|
+
typeParams: { length }
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Postgres `bytea` column descriptor — variable-length binary string.
|
|
93
|
+
*
|
|
94
|
+
* 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.
|
|
95
|
+
*/
|
|
96
|
+
const byteaColumn = {
|
|
97
|
+
codecId: PG_BYTEA_CODEC_ID,
|
|
98
|
+
nativeType: "bytea"
|
|
99
|
+
};
|
|
100
|
+
function intervalColumn(precision) {
|
|
101
|
+
return {
|
|
102
|
+
codecId: PG_INTERVAL_CODEC_ID,
|
|
103
|
+
nativeType: "interval",
|
|
104
|
+
...precision === void 0 ? {} : { typeParams: { precision } }
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Postgres `json` column descriptor — untyped raw JSON.
|
|
109
|
+
*
|
|
110
|
+
* 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.
|
|
111
|
+
*/
|
|
112
|
+
const jsonColumn = {
|
|
113
|
+
codecId: PG_JSON_CODEC_ID,
|
|
114
|
+
nativeType: "json"
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Postgres `jsonb` column descriptor — untyped raw JSONB. Same retirement note as {@link jsonColumn}.
|
|
118
|
+
*/
|
|
119
|
+
const jsonbColumn = {
|
|
120
|
+
codecId: PG_JSONB_CODEC_ID,
|
|
121
|
+
nativeType: "jsonb"
|
|
122
|
+
};
|
|
123
|
+
//#endregion
|
|
124
|
+
export { timestamptzColumn as _, float4Column as a, varcharColumn as b, int4Column as c, jsonColumn as d, jsonbColumn as f, timestampColumn as g, timeColumn as h, charColumn as i, int8Column as l, textColumn as m, boolColumn as n, float8Column as o, numericColumn as p, byteaColumn as r, int2Column as s, bitColumn as t, intervalColumn as u, timetzColumn as v, varbitColumn as y };
|
|
125
|
+
|
|
126
|
+
//# sourceMappingURL=column-types-CwAyCgp2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"column-types-CwAyCgp2.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_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_CODEC_ID, PG_TIMESTAMP_CODEC_ID, PG_TIMETZ_CODEC_ID, PG_TIME_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 = {\n\tcodecId: PG_TEXT_CODEC_ID,\n\tnativeType: \"text\"\n};\nfunction charColumn(length) {\n\treturn {\n\t\tcodecId: SQL_CHAR_CODEC_ID,\n\t\tnativeType: \"character\",\n\t\ttypeParams: { length }\n\t};\n}\nfunction varcharColumn(length) {\n\treturn {\n\t\tcodecId: SQL_VARCHAR_CODEC_ID,\n\t\tnativeType: \"character varying\",\n\t\ttypeParams: { length }\n\t};\n}\nconst int4Column = {\n\tcodecId: PG_INT4_CODEC_ID,\n\tnativeType: \"int4\"\n};\nconst int2Column = {\n\tcodecId: PG_INT2_CODEC_ID,\n\tnativeType: \"int2\"\n};\nconst int8Column = {\n\tcodecId: PG_INT8_CODEC_ID,\n\tnativeType: \"int8\"\n};\nconst float4Column = {\n\tcodecId: PG_FLOAT4_CODEC_ID,\n\tnativeType: \"float4\"\n};\nconst float8Column = {\n\tcodecId: PG_FLOAT8_CODEC_ID,\n\tnativeType: \"float8\"\n};\nfunction numericColumn(precision, scale) {\n\treturn {\n\t\tcodecId: PG_NUMERIC_CODEC_ID,\n\t\tnativeType: \"numeric\",\n\t\ttypeParams: scale === void 0 ? { precision } : {\n\t\t\tprecision,\n\t\t\tscale\n\t\t}\n\t};\n}\nconst timestampColumn = {\n\tcodecId: PG_TIMESTAMP_CODEC_ID,\n\tnativeType: \"timestamp\"\n};\nconst timestamptzColumn = {\n\tcodecId: PG_TIMESTAMPTZ_CODEC_ID,\n\tnativeType: \"timestamptz\"\n};\nfunction timeColumn(precision) {\n\treturn {\n\t\tcodecId: PG_TIME_CODEC_ID,\n\t\tnativeType: \"time\",\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\tnativeType: \"timetz\",\n\t\t...precision === void 0 ? {} : { typeParams: { precision } }\n\t};\n}\nconst boolColumn = {\n\tcodecId: PG_BOOL_CODEC_ID,\n\tnativeType: \"bool\"\n};\nfunction bitColumn(length) {\n\treturn {\n\t\tcodecId: PG_BIT_CODEC_ID,\n\t\tnativeType: \"bit\",\n\t\ttypeParams: { length }\n\t};\n}\nfunction varbitColumn(length) {\n\treturn {\n\t\tcodecId: PG_VARBIT_CODEC_ID,\n\t\tnativeType: \"bit varying\",\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 = {\n\tcodecId: PG_BYTEA_CODEC_ID,\n\tnativeType: \"bytea\"\n};\nfunction intervalColumn(precision) {\n\treturn {\n\t\tcodecId: PG_INTERVAL_CODEC_ID,\n\t\tnativeType: \"interval\",\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 = {\n\tcodecId: PG_JSON_CODEC_ID,\n\tnativeType: \"json\"\n};\n/**\n* Postgres `jsonb` column descriptor — untyped raw JSONB. Same retirement note as {@link jsonColumn}.\n*/\nconst jsonbColumn = {\n\tcodecId: PG_JSONB_CODEC_ID,\n\tnativeType: \"jsonb\"\n};\n//#endregion\nexport { bitColumn, boolColumn, byteaColumn, charColumn, float4Column, float8Column, int2Column, int4Column, int8Column, intervalColumn, jsonColumn, jsonbColumn, numericColumn, textColumn, timeColumn, timestampColumn, timestamptzColumn, timetzColumn, varbitColumn, varcharColumn };\n\n//# sourceMappingURL=column-types.mjs.map"],"mappings":";;AAEA,MAAM,aAAa;CAClB,SAAS;CACT,YAAY;AACb;AACA,SAAS,WAAW,QAAQ;CAC3B,OAAO;EACN,SAAS;EACT,YAAY;EACZ,YAAY,EAAE,OAAO;CACtB;AACD;AACA,SAAS,cAAc,QAAQ;CAC9B,OAAO;EACN,SAAS;EACT,YAAY;EACZ,YAAY,EAAE,OAAO;CACtB;AACD;AACA,MAAM,aAAa;CAClB,SAAS;CACT,YAAY;AACb;AACA,MAAM,aAAa;CAClB,SAAS;CACT,YAAY;AACb;AACA,MAAM,aAAa;CAClB,SAAS;CACT,YAAY;AACb;AACA,MAAM,eAAe;CACpB,SAAS;CACT,YAAY;AACb;AACA,MAAM,eAAe;CACpB,SAAS;CACT,YAAY;AACb;AACA,SAAS,cAAc,WAAW,OAAO;CACxC,OAAO;EACN,SAAS;EACT,YAAY;EACZ,YAAY,UAAU,KAAK,IAAI,EAAE,UAAU,IAAI;GAC9C;GACA;EACD;CACD;AACD;AACA,MAAM,kBAAkB;CACvB,SAAS;CACT,YAAY;AACb;AACA,MAAM,oBAAoB;CACzB,SAAS;CACT,YAAY;AACb;AACA,SAAS,WAAW,WAAW;CAC9B,OAAO;EACN,SAAS;EACT,YAAY;EACZ,GAAG,cAAc,KAAK,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE;CAC5D;AACD;AACA,SAAS,aAAa,WAAW;CAChC,OAAO;EACN,SAAS;EACT,YAAY;EACZ,GAAG,cAAc,KAAK,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE;CAC5D;AACD;AACA,MAAM,aAAa;CAClB,SAAS;CACT,YAAY;AACb;AACA,SAAS,UAAU,QAAQ;CAC1B,OAAO;EACN,SAAS;EACT,YAAY;EACZ,YAAY,EAAE,OAAO;CACtB;AACD;AACA,SAAS,aAAa,QAAQ;CAC7B,OAAO;EACN,SAAS;EACT,YAAY;EACZ,YAAY,EAAE,OAAO;CACtB;AACD;;;;;;AAMA,MAAM,cAAc;CACnB,SAAS;CACT,YAAY;AACb;AACA,SAAS,eAAe,WAAW;CAClC,OAAO;EACN,SAAS;EACT,YAAY;EACZ,GAAG,cAAc,KAAK,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE;CAC5D;AACD;;;;;;AAMA,MAAM,aAAa;CAClB,SAAS;CACT,YAAY;AACb;;;;AAIA,MAAM,cAAc;CACnB,SAAS;CACT,YAAY;AACb"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { b as PG_TEXT_CODEC_ID, f as PG_INT4_CODEC_ID, g as PG_JSONB_CODEC_ID, p as PG_INT8_CODEC_ID, x as PG_TIMESTAMPTZ_CODEC_ID, y as PG_TEXT_ARRAY_CODEC_ID } from "./codec-ids-tX7Svtz--BuOfRaVU.mjs";
|
|
2
|
+
import { l as PostgresTableSource } from "./postgres-schema-KSzLDONj-CsXGoY8b.mjs";
|
|
3
|
+
import { f as createSchema, p as createTable } from "./ddl-BdP4q3KY-Duef4uHw.mjs";
|
|
4
|
+
import { col, fn, lit, table } from "@prisma/orm-family-sql/relational-core/contract-free";
|
|
5
|
+
import { APP_SPACE_ID } from "@prisma/orm-framework/components/control";
|
|
6
|
+
//#region ../../../3-targets/3-targets/postgres/dist/contract-free.mjs
|
|
7
|
+
const desc = (codecId, opts) => ({
|
|
8
|
+
codecId,
|
|
9
|
+
nullable: opts?.nullable ?? false
|
|
10
|
+
});
|
|
11
|
+
const text = (opts) => desc(PG_TEXT_CODEC_ID, opts);
|
|
12
|
+
const int4 = (opts) => desc(PG_INT4_CODEC_ID, opts);
|
|
13
|
+
const int8 = (opts) => desc(PG_INT8_CODEC_ID, opts);
|
|
14
|
+
const jsonb = (opts) => desc(PG_JSONB_CODEC_ID, opts);
|
|
15
|
+
const textArray = (opts) => desc(PG_TEXT_ARRAY_CODEC_ID, opts);
|
|
16
|
+
const timestamptz = (opts) => desc(PG_TIMESTAMPTZ_CODEC_ID, opts);
|
|
17
|
+
/**
|
|
18
|
+
* Declare a PostgreSQL control-plane table with a typed column schema. Wraps
|
|
19
|
+
* the generic `table()` factory with a `PostgresTableSource` so the renderer
|
|
20
|
+
* qualifies the table name with the optional schema prefix.
|
|
21
|
+
*
|
|
22
|
+
* ```ts
|
|
23
|
+
* const marker = pgTable(
|
|
24
|
+
* { name: 'marker', schema: 'prisma_contract' },
|
|
25
|
+
* { space: text(), core_hash: text(), updated_at: timestamptz() },
|
|
26
|
+
* );
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
function pgTable(source, columns) {
|
|
30
|
+
return table(new PostgresTableSource(source), columns);
|
|
31
|
+
}
|
|
32
|
+
const markerColumns = [
|
|
33
|
+
col("space", "text", {
|
|
34
|
+
notNull: true,
|
|
35
|
+
primaryKey: true,
|
|
36
|
+
default: lit(APP_SPACE_ID)
|
|
37
|
+
}),
|
|
38
|
+
col("core_hash", "text", { notNull: true }),
|
|
39
|
+
col("profile_hash", "text", { notNull: true }),
|
|
40
|
+
col("contract_json", "jsonb"),
|
|
41
|
+
col("canonical_version", "int"),
|
|
42
|
+
col("updated_at", "timestamptz", {
|
|
43
|
+
notNull: true,
|
|
44
|
+
default: fn("now()")
|
|
45
|
+
}),
|
|
46
|
+
col("app_tag", "text"),
|
|
47
|
+
col("meta", "jsonb", {
|
|
48
|
+
notNull: true,
|
|
49
|
+
default: lit("{}")
|
|
50
|
+
}),
|
|
51
|
+
col("invariants", "text[]", {
|
|
52
|
+
notNull: true,
|
|
53
|
+
default: lit("{}")
|
|
54
|
+
})
|
|
55
|
+
];
|
|
56
|
+
const ledgerColumns = [
|
|
57
|
+
col("id", "bigserial", { primaryKey: true }),
|
|
58
|
+
col("created_at", "timestamptz", {
|
|
59
|
+
notNull: true,
|
|
60
|
+
default: fn("now()")
|
|
61
|
+
}),
|
|
62
|
+
col("space", "text", { notNull: true }),
|
|
63
|
+
col("migration_name", "text", { notNull: true }),
|
|
64
|
+
col("migration_hash", "text", { notNull: true }),
|
|
65
|
+
col("origin_core_hash", "text"),
|
|
66
|
+
col("origin_profile_hash", "text"),
|
|
67
|
+
col("destination_core_hash", "text", { notNull: true }),
|
|
68
|
+
col("destination_profile_hash", "text"),
|
|
69
|
+
col("operations", "jsonb", { notNull: true })
|
|
70
|
+
];
|
|
71
|
+
const contractColumns = [
|
|
72
|
+
col("core_hash", "text", {
|
|
73
|
+
notNull: true,
|
|
74
|
+
primaryKey: true
|
|
75
|
+
}),
|
|
76
|
+
col("created_at", "timestamptz", {
|
|
77
|
+
notNull: true,
|
|
78
|
+
default: fn("now()")
|
|
79
|
+
}),
|
|
80
|
+
col("contract_json", "jsonb", { notNull: true })
|
|
81
|
+
];
|
|
82
|
+
const markerTable = createTable({
|
|
83
|
+
schema: "prisma_contract",
|
|
84
|
+
table: "marker",
|
|
85
|
+
ifNotExists: true,
|
|
86
|
+
columns: markerColumns
|
|
87
|
+
});
|
|
88
|
+
const ledgerTable = createTable({
|
|
89
|
+
schema: "prisma_contract",
|
|
90
|
+
table: "ledger",
|
|
91
|
+
ifNotExists: true,
|
|
92
|
+
columns: ledgerColumns
|
|
93
|
+
});
|
|
94
|
+
const contractTable = createTable({
|
|
95
|
+
schema: "prisma_contract",
|
|
96
|
+
table: "contract",
|
|
97
|
+
ifNotExists: true,
|
|
98
|
+
columns: contractColumns
|
|
99
|
+
});
|
|
100
|
+
const controlSchema = createSchema({
|
|
101
|
+
schema: "prisma_contract",
|
|
102
|
+
ifNotExists: true
|
|
103
|
+
});
|
|
104
|
+
function buildSignMarkerBootstrapQueries() {
|
|
105
|
+
return [controlSchema, markerTable];
|
|
106
|
+
}
|
|
107
|
+
function buildControlTableBootstrapQueries() {
|
|
108
|
+
return [
|
|
109
|
+
controlSchema,
|
|
110
|
+
markerTable,
|
|
111
|
+
ledgerTable,
|
|
112
|
+
contractTable
|
|
113
|
+
];
|
|
114
|
+
}
|
|
115
|
+
//#endregion
|
|
116
|
+
export { jsonb as a, textArray as c, int8 as i, timestamptz as l, buildSignMarkerBootstrapQueries as n, pgTable as o, int4 as r, text as s, buildControlTableBootstrapQueries as t };
|
|
117
|
+
|
|
118
|
+
//# sourceMappingURL=contract-free-BZUS18FU.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-free-BZUS18FU.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/contract-free.mjs"],"sourcesContent":["import { b as PG_TEXT_CODEC_ID, f as PG_INT4_CODEC_ID, g as PG_JSONB_CODEC_ID, p as PG_INT8_CODEC_ID, x as PG_TIMESTAMPTZ_CODEC_ID, y as PG_TEXT_ARRAY_CODEC_ID } from \"./codec-ids-tX7Svtz-.mjs\";\nimport { u as PostgresTableSource } from \"./postgres-schema-KSzLDONj.mjs\";\nimport { A as toRegclass, D as tableExistsAst, E as rlsPolicyExistsAst, O as tableIsEmptyAst, T as rlsEnabledAst, _ as columnNullabilityAst, b as extensionExistsAst, c as createTable, d as dropDefaultAction, g as columnExistsAst, h as columnDefaultAst, i as alterTable, k as tablePrimaryKeyAst, s as createSchema, t as addColumnAction, v as columnTypeAst, w as noNullValuesAst, x as indexExistsAst, y as constraintExistsAst } from \"./ddl-BdP4q3KY.mjs\";\nimport { col, fn, lit, table } from \"@internal/sql-relational-core/contract-free\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\n//#region src/contract-free/columns.ts\nconst desc = (codecId, opts) => ({\n\tcodecId,\n\tnullable: opts?.nullable ?? false\n});\nconst text = (opts) => desc(PG_TEXT_CODEC_ID, opts);\nconst int4 = (opts) => desc(PG_INT4_CODEC_ID, opts);\nconst int8 = (opts) => desc(PG_INT8_CODEC_ID, opts);\nconst jsonb = (opts) => desc(PG_JSONB_CODEC_ID, opts);\nconst textArray = (opts) => desc(PG_TEXT_ARRAY_CODEC_ID, opts);\nconst timestamptz = (opts) => desc(PG_TIMESTAMPTZ_CODEC_ID, opts);\n/**\n* Declare a PostgreSQL control-plane table with a typed column schema. Wraps\n* the generic `table()` factory with a `PostgresTableSource` so the renderer\n* qualifies the table name with the optional schema prefix.\n*\n* ```ts\n* const marker = pgTable(\n* { name: 'marker', schema: 'prisma_contract' },\n* { space: text(), core_hash: text(), updated_at: timestamptz() },\n* );\n* ```\n*/\nfunction pgTable(source, columns) {\n\treturn table(new PostgresTableSource(source), columns);\n}\n//#endregion\n//#region src/contract-free/control-bootstrap.ts\nconst markerColumns = [\n\tcol(\"space\", \"text\", {\n\t\tnotNull: true,\n\t\tprimaryKey: true,\n\t\tdefault: lit(APP_SPACE_ID)\n\t}),\n\tcol(\"core_hash\", \"text\", { notNull: true }),\n\tcol(\"profile_hash\", \"text\", { notNull: true }),\n\tcol(\"contract_json\", \"jsonb\"),\n\tcol(\"canonical_version\", \"int\"),\n\tcol(\"updated_at\", \"timestamptz\", {\n\t\tnotNull: true,\n\t\tdefault: fn(\"now()\")\n\t}),\n\tcol(\"app_tag\", \"text\"),\n\tcol(\"meta\", \"jsonb\", {\n\t\tnotNull: true,\n\t\tdefault: lit(\"{}\")\n\t}),\n\tcol(\"invariants\", \"text[]\", {\n\t\tnotNull: true,\n\t\tdefault: lit(\"{}\")\n\t})\n];\nconst ledgerColumns = [\n\tcol(\"id\", \"bigserial\", { primaryKey: true }),\n\tcol(\"created_at\", \"timestamptz\", {\n\t\tnotNull: true,\n\t\tdefault: fn(\"now()\")\n\t}),\n\tcol(\"space\", \"text\", { notNull: true }),\n\tcol(\"migration_name\", \"text\", { notNull: true }),\n\tcol(\"migration_hash\", \"text\", { notNull: true }),\n\tcol(\"origin_core_hash\", \"text\"),\n\tcol(\"origin_profile_hash\", \"text\"),\n\tcol(\"destination_core_hash\", \"text\", { notNull: true }),\n\tcol(\"destination_profile_hash\", \"text\"),\n\tcol(\"operations\", \"jsonb\", { notNull: true })\n];\nconst contractColumns = [\n\tcol(\"core_hash\", \"text\", {\n\t\tnotNull: true,\n\t\tprimaryKey: true\n\t}),\n\tcol(\"created_at\", \"timestamptz\", {\n\t\tnotNull: true,\n\t\tdefault: fn(\"now()\")\n\t}),\n\tcol(\"contract_json\", \"jsonb\", { notNull: true })\n];\nconst markerTable = createTable({\n\tschema: \"prisma_contract\",\n\ttable: \"marker\",\n\tifNotExists: true,\n\tcolumns: markerColumns\n});\nconst ledgerTable = createTable({\n\tschema: \"prisma_contract\",\n\ttable: \"ledger\",\n\tifNotExists: true,\n\tcolumns: ledgerColumns\n});\nconst contractTable = createTable({\n\tschema: \"prisma_contract\",\n\ttable: \"contract\",\n\tifNotExists: true,\n\tcolumns: contractColumns\n});\nconst controlSchema = createSchema({\n\tschema: \"prisma_contract\",\n\tifNotExists: true\n});\nfunction buildSignMarkerBootstrapQueries() {\n\treturn [controlSchema, markerTable];\n}\nfunction buildControlTableBootstrapQueries() {\n\treturn [\n\t\tcontrolSchema,\n\t\tmarkerTable,\n\t\tledgerTable,\n\t\tcontractTable\n\t];\n}\n//#endregion\nexport { PostgresTableSource, addColumnAction, alterTable, buildControlTableBootstrapQueries, buildSignMarkerBootstrapQueries, columnDefaultAst, columnExistsAst, columnNullabilityAst, columnTypeAst, constraintExistsAst, createSchema, createTable, dropDefaultAction, extensionExistsAst, indexExistsAst, int4, int8, jsonb, noNullValuesAst, pgTable, rlsEnabledAst, rlsPolicyExistsAst, tableExistsAst, tableIsEmptyAst, tablePrimaryKeyAst, text, textArray, timestamptz, toRegclass };\n\n//# sourceMappingURL=contract-free.mjs.map"],"mappings":";;;;;;AAMA,MAAM,QAAQ,SAAS,UAAU;CAChC;CACA,UAAU,MAAM,YAAY;AAC7B;AACA,MAAM,QAAQ,SAAS,KAAK,kBAAkB,IAAI;AAClD,MAAM,QAAQ,SAAS,KAAK,kBAAkB,IAAI;AAClD,MAAM,QAAQ,SAAS,KAAK,kBAAkB,IAAI;AAClD,MAAM,SAAS,SAAS,KAAK,mBAAmB,IAAI;AACpD,MAAM,aAAa,SAAS,KAAK,wBAAwB,IAAI;AAC7D,MAAM,eAAe,SAAS,KAAK,yBAAyB,IAAI;;;;;;;;;;;;;AAahE,SAAS,QAAQ,QAAQ,SAAS;CACjC,OAAO,MAAM,IAAI,oBAAoB,MAAM,GAAG,OAAO;AACtD;AAGA,MAAM,gBAAgB;CACrB,IAAI,SAAS,QAAQ;EACpB,SAAS;EACT,YAAY;EACZ,SAAS,IAAI,YAAY;CAC1B,CAAC;CACD,IAAI,aAAa,QAAQ,EAAE,SAAS,KAAK,CAAC;CAC1C,IAAI,gBAAgB,QAAQ,EAAE,SAAS,KAAK,CAAC;CAC7C,IAAI,iBAAiB,OAAO;CAC5B,IAAI,qBAAqB,KAAK;CAC9B,IAAI,cAAc,eAAe;EAChC,SAAS;EACT,SAAS,GAAG,OAAO;CACpB,CAAC;CACD,IAAI,WAAW,MAAM;CACrB,IAAI,QAAQ,SAAS;EACpB,SAAS;EACT,SAAS,IAAI,IAAI;CAClB,CAAC;CACD,IAAI,cAAc,UAAU;EAC3B,SAAS;EACT,SAAS,IAAI,IAAI;CAClB,CAAC;AACF;AACA,MAAM,gBAAgB;CACrB,IAAI,MAAM,aAAa,EAAE,YAAY,KAAK,CAAC;CAC3C,IAAI,cAAc,eAAe;EAChC,SAAS;EACT,SAAS,GAAG,OAAO;CACpB,CAAC;CACD,IAAI,SAAS,QAAQ,EAAE,SAAS,KAAK,CAAC;CACtC,IAAI,kBAAkB,QAAQ,EAAE,SAAS,KAAK,CAAC;CAC/C,IAAI,kBAAkB,QAAQ,EAAE,SAAS,KAAK,CAAC;CAC/C,IAAI,oBAAoB,MAAM;CAC9B,IAAI,uBAAuB,MAAM;CACjC,IAAI,yBAAyB,QAAQ,EAAE,SAAS,KAAK,CAAC;CACtD,IAAI,4BAA4B,MAAM;CACtC,IAAI,cAAc,SAAS,EAAE,SAAS,KAAK,CAAC;AAC7C;AACA,MAAM,kBAAkB;CACvB,IAAI,aAAa,QAAQ;EACxB,SAAS;EACT,YAAY;CACb,CAAC;CACD,IAAI,cAAc,eAAe;EAChC,SAAS;EACT,SAAS,GAAG,OAAO;CACpB,CAAC;CACD,IAAI,iBAAiB,SAAS,EAAE,SAAS,KAAK,CAAC;AAChD;AACA,MAAM,cAAc,YAAY;CAC/B,QAAQ;CACR,OAAO;CACP,aAAa;CACb,SAAS;AACV,CAAC;AACD,MAAM,cAAc,YAAY;CAC/B,QAAQ;CACR,OAAO;CACP,aAAa;CACb,SAAS;AACV,CAAC;AACD,MAAM,gBAAgB,YAAY;CACjC,QAAQ;CACR,OAAO;CACP,aAAa;CACb,SAAS;AACV,CAAC;AACD,MAAM,gBAAgB,aAAa;CAClC,QAAQ;CACR,aAAa;AACd,CAAC;AACD,SAAS,kCAAkC;CAC1C,OAAO,CAAC,eAAe,WAAW;AACnC;AACA,SAAS,oCAAoC;CAC5C,OAAO;EACN;EACA;EACA;EACA;CACD;AACD"}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import "./table-source-ikHOZmhD-DriY1Lcr.mjs";
|
|
2
|
+
import { f as PostgresCreateSchema, l as PostgresAlterTable, o as DropDefaultAction, p as PostgresCreateTable, r as AnyAlterTableAction, t as AddColumnAction } from "./nodes-BU-V-aZA-RqwPH68u.mjs";
|
|
3
|
+
import { DdlColumn, DdlNode, DdlTableConstraint, SelectAst } from "@prisma/orm-family-sql/relational-core/ast";
|
|
4
|
+
import { CfExpr, ColumnDescriptor, ColumnSchema, TableHandle } from "@prisma/orm-family-sql/relational-core/contract-free";
|
|
5
|
+
//#region ../../../3-targets/3-targets/postgres/dist/contract-free.d.mts
|
|
6
|
+
//#region src/contract-free/checks.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* `to_regclass($1)` with the qualified table name bound as a text parameter.
|
|
9
|
+
* Thin vocabulary wrapper over the core `cfExpr.fn` helper — the target
|
|
10
|
+
* supplies only the template and the codec'd operand.
|
|
11
|
+
*/
|
|
12
|
+
declare function toRegclass(qualifiedName: string): CfExpr;
|
|
13
|
+
interface TableExistsCheckBuilder {
|
|
14
|
+
tableAbsent(): SelectAst;
|
|
15
|
+
tablePresent(): SelectAst;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Typed builder for the migration planner's table-existence checks. Produces
|
|
19
|
+
* FROM-less `SELECT to_regclass($1) IS [NOT] NULL AS "result"` ASTs with the
|
|
20
|
+
* qualified table name bound as a text parameter — never inlined into the SQL.
|
|
21
|
+
*
|
|
22
|
+
* `schema` is a namespace coordinate: the framework `__unbound__` sentinel
|
|
23
|
+
* elides the qualifier (search_path decides at runtime); any other id
|
|
24
|
+
* qualifies as `"schema"."table"`.
|
|
25
|
+
*/
|
|
26
|
+
declare function tableExistsAst(schema: string, table: string): TableExistsCheckBuilder;
|
|
27
|
+
interface ConstraintExistsCheckBuilder {
|
|
28
|
+
constraintPresent(): SelectAst;
|
|
29
|
+
constraintAbsent(): SelectAst;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Typed builder for the migration planner's constraint-existence checks.
|
|
33
|
+
* Produces `SELECT [NOT ]EXISTS (SELECT 1 FROM pg_constraint c JOIN
|
|
34
|
+
* pg_namespace n ON n.oid = c.connamespace WHERE c.conname = $1 AND
|
|
35
|
+
* n.nspname = $2 [AND c.conrelid = to_regclass($3)]) AS "result"` with the
|
|
36
|
+
* constraint name, schema name, and qualified table name bound as text
|
|
37
|
+
* parameters.
|
|
38
|
+
*
|
|
39
|
+
* When `table` is omitted the check matches by name + schema across all
|
|
40
|
+
* tables. Pass `table` to scope the check to a single table (prevents false
|
|
41
|
+
* matches on identically-named constraints in different tables). `schema`
|
|
42
|
+
* is a namespace coordinate: the `__unbound__` sentinel compares `nspname`
|
|
43
|
+
* against `current_schema()` instead of a bound parameter.
|
|
44
|
+
*/
|
|
45
|
+
declare function constraintExistsAst(options: {
|
|
46
|
+
readonly constraintName: string;
|
|
47
|
+
readonly schema: string;
|
|
48
|
+
readonly table?: string;
|
|
49
|
+
}): ConstraintExistsCheckBuilder;
|
|
50
|
+
interface ColumnExistsCheckBuilder {
|
|
51
|
+
columnPresent(): SelectAst;
|
|
52
|
+
columnAbsent(): SelectAst;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Typed builder for column-existence checks over
|
|
56
|
+
* `information_schema.columns`, with schema, table, and column names bound
|
|
57
|
+
* as text parameters.
|
|
58
|
+
*/
|
|
59
|
+
declare function columnExistsAst(options: {
|
|
60
|
+
readonly schema: string;
|
|
61
|
+
readonly table: string;
|
|
62
|
+
readonly column: string;
|
|
63
|
+
}): ColumnExistsCheckBuilder;
|
|
64
|
+
/**
|
|
65
|
+
* Typed nullability check: EXISTS over `information_schema.columns` with
|
|
66
|
+
* `is_nullable` compared against the bound `'YES'` / `'NO'` marker.
|
|
67
|
+
*/
|
|
68
|
+
declare function columnNullabilityAst(options: {
|
|
69
|
+
readonly schema: string;
|
|
70
|
+
readonly table: string;
|
|
71
|
+
readonly column: string;
|
|
72
|
+
readonly nullable: boolean;
|
|
73
|
+
}): SelectAst;
|
|
74
|
+
interface ColumnDefaultCheckBuilder {
|
|
75
|
+
defaultPresent(): SelectAst;
|
|
76
|
+
defaultAbsent(): SelectAst;
|
|
77
|
+
noDefault(): SelectAst;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Typed default-presence checks over `information_schema.columns`.
|
|
81
|
+
* `defaultPresent` / `defaultAbsent` assert the column row exists with a
|
|
82
|
+
* non-null / null `column_default`; `noDefault` is the NOT EXISTS variant
|
|
83
|
+
* (also true when the column row is missing entirely).
|
|
84
|
+
*/
|
|
85
|
+
declare function columnDefaultAst(options: {
|
|
86
|
+
readonly schema: string;
|
|
87
|
+
readonly table: string;
|
|
88
|
+
readonly column: string;
|
|
89
|
+
}): ColumnDefaultCheckBuilder;
|
|
90
|
+
/**
|
|
91
|
+
* Typed column-type check: EXISTS over `pg_attribute` joined to `pg_class`
|
|
92
|
+
* and `pg_namespace`, comparing `format_type(a.atttypid, a.atttypmod)`
|
|
93
|
+
* against the bound expected display type and excluding dropped columns.
|
|
94
|
+
*/
|
|
95
|
+
declare function columnTypeAst(options: {
|
|
96
|
+
readonly schema: string;
|
|
97
|
+
readonly table: string;
|
|
98
|
+
readonly column: string;
|
|
99
|
+
readonly expectedType: string;
|
|
100
|
+
}): SelectAst;
|
|
101
|
+
interface TablePrimaryKeyCheckBuilder {
|
|
102
|
+
pkPresent(): SelectAst;
|
|
103
|
+
pkAbsent(): SelectAst;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Typed primary-key existence check over `pg_index` joined to `pg_class`
|
|
107
|
+
* and `pg_namespace`, with a LEFT JOIN on the index relation so an
|
|
108
|
+
* optional `constraintName` can scope the match to a named constraint.
|
|
109
|
+
*/
|
|
110
|
+
declare function tablePrimaryKeyAst(options: {
|
|
111
|
+
readonly schema: string;
|
|
112
|
+
readonly table: string;
|
|
113
|
+
readonly constraintName?: string;
|
|
114
|
+
}): TablePrimaryKeyCheckBuilder;
|
|
115
|
+
/**
|
|
116
|
+
* Typed emptiness check: NOT EXISTS over the user table itself with
|
|
117
|
+
* `LIMIT 1`. The table is addressed through the namespace's polymorphic
|
|
118
|
+
* `tableSource` (qualified for named schemas, bare for the unbound slot).
|
|
119
|
+
*/
|
|
120
|
+
declare function tableIsEmptyAst(schema: string, table: string): SelectAst;
|
|
121
|
+
/**
|
|
122
|
+
* Typed no-NULL-values data check used by `SET NOT NULL` prechecks:
|
|
123
|
+
* NOT EXISTS over the user table where the column IS NULL.
|
|
124
|
+
*/
|
|
125
|
+
declare function noNullValuesAst(options: {
|
|
126
|
+
readonly schema: string;
|
|
127
|
+
readonly table: string;
|
|
128
|
+
readonly column: string;
|
|
129
|
+
}): SelectAst;
|
|
130
|
+
interface ExtensionExistsCheckBuilder {
|
|
131
|
+
extensionPresent(): SelectAst;
|
|
132
|
+
extensionAbsent(): SelectAst;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Typed extension existence check over `pg_extension`, with the extension
|
|
136
|
+
* name bound as a text parameter.
|
|
137
|
+
*/
|
|
138
|
+
declare function extensionExistsAst(extensionName: string): ExtensionExistsCheckBuilder;
|
|
139
|
+
interface RlsPolicyExistsCheckBuilder {
|
|
140
|
+
policyPresent(): SelectAst;
|
|
141
|
+
policyAbsent(): SelectAst;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Typed RLS-policy existence check over `pg_policies`, with schema, table,
|
|
145
|
+
* and policy names bound as text parameters (never inlined). The `schema`
|
|
146
|
+
* coordinate is the resolved live-database schema name (e.g. `'public'`),
|
|
147
|
+
* compared against `pg_policies.schemaname` as a bound parameter.
|
|
148
|
+
*/
|
|
149
|
+
declare function rlsPolicyExistsAst(options: {
|
|
150
|
+
readonly schema: string;
|
|
151
|
+
readonly table: string;
|
|
152
|
+
readonly policyName: string;
|
|
153
|
+
}): RlsPolicyExistsCheckBuilder;
|
|
154
|
+
interface RlsEnabledCheckBuilder {
|
|
155
|
+
rlsEnabled(): SelectAst;
|
|
156
|
+
rlsDisabled(): SelectAst;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Typed row-level-security enabled check over `pg_class` joined to
|
|
160
|
+
* `pg_namespace`, comparing `pg_class.relrowsecurity` against the expected
|
|
161
|
+
* boolean. Schema and table names are bound as text parameters.
|
|
162
|
+
*/
|
|
163
|
+
declare function rlsEnabledAst(schema: string, table: string): RlsEnabledCheckBuilder;
|
|
164
|
+
interface IndexExistsCheckBuilder {
|
|
165
|
+
indexPresent(): SelectAst;
|
|
166
|
+
indexAbsent(): SelectAst;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Typed index existence check riding the same `to_regclass` vocabulary as
|
|
170
|
+
* `tableExistsAst`, with the qualified index name bound as a text parameter.
|
|
171
|
+
*/
|
|
172
|
+
declare function indexExistsAst(schema: string, indexName: string): IndexExistsCheckBuilder;
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region src/contract-free/columns.d.ts
|
|
175
|
+
type ColOpts = {
|
|
176
|
+
readonly nullable?: boolean;
|
|
177
|
+
};
|
|
178
|
+
declare const text: (opts?: ColOpts) => ColumnDescriptor;
|
|
179
|
+
declare const int4: (opts?: ColOpts) => ColumnDescriptor;
|
|
180
|
+
declare const int8: (opts?: ColOpts) => ColumnDescriptor;
|
|
181
|
+
declare const jsonb: (opts?: ColOpts) => ColumnDescriptor;
|
|
182
|
+
declare const textArray: (opts?: ColOpts) => ColumnDescriptor;
|
|
183
|
+
declare const timestamptz: (opts?: ColOpts) => ColumnDescriptor;
|
|
184
|
+
/**
|
|
185
|
+
* Declare a PostgreSQL control-plane table with a typed column schema. Wraps
|
|
186
|
+
* the generic `table()` factory with a `PostgresTableSource` so the renderer
|
|
187
|
+
* qualifies the table name with the optional schema prefix.
|
|
188
|
+
*
|
|
189
|
+
* ```ts
|
|
190
|
+
* const marker = pgTable(
|
|
191
|
+
* { name: 'marker', schema: 'prisma_contract' },
|
|
192
|
+
* { space: text(), core_hash: text(), updated_at: timestamptz() },
|
|
193
|
+
* );
|
|
194
|
+
* ```
|
|
195
|
+
*/
|
|
196
|
+
declare function pgTable<Schema extends ColumnSchema>(source: {
|
|
197
|
+
readonly name: string;
|
|
198
|
+
readonly schema?: string;
|
|
199
|
+
readonly alias?: string;
|
|
200
|
+
}, columns: Schema): TableHandle<Schema>;
|
|
201
|
+
//#endregion
|
|
202
|
+
//#region src/contract-free/control-bootstrap.d.ts
|
|
203
|
+
declare function buildSignMarkerBootstrapQueries(): readonly DdlNode[];
|
|
204
|
+
declare function buildControlTableBootstrapQueries(): readonly DdlNode[];
|
|
205
|
+
//#endregion
|
|
206
|
+
//#region src/contract-free/ddl.d.ts
|
|
207
|
+
/**
|
|
208
|
+
* Build a Postgres `CREATE TABLE` query node.
|
|
209
|
+
*
|
|
210
|
+
* Pass `constraints` for table-level composite primary keys, foreign keys, and
|
|
211
|
+
* unique constraints — use the {@link PrimaryKeyConstraint}, {@link ForeignKeyConstraint},
|
|
212
|
+
* and {@link UniqueConstraint} classes from `@internal/sql-relational-core/ast`.
|
|
213
|
+
*
|
|
214
|
+
* Precondition: identifiers (`table`, `schema`, column names/types) are
|
|
215
|
+
* emitted to SQL verbatim — they are not quoted or escaped, so callers must
|
|
216
|
+
* pass pre-trusted values (e.g. fixed control-plane identifiers). String-literal
|
|
217
|
+
* default values, by contrast, are single-quote-escaped (embedded `'` doubled)
|
|
218
|
+
* by the renderer. Identifier quoting for untrusted identifiers is added when
|
|
219
|
+
* the migration planner adopts this lowering path.
|
|
220
|
+
*/
|
|
221
|
+
declare function createTable(options: {
|
|
222
|
+
readonly table: string;
|
|
223
|
+
readonly schema?: string;
|
|
224
|
+
readonly ifNotExists?: boolean;
|
|
225
|
+
readonly columns: readonly DdlColumn[];
|
|
226
|
+
readonly constraints?: readonly DdlTableConstraint[];
|
|
227
|
+
}): PostgresCreateTable;
|
|
228
|
+
/**
|
|
229
|
+
* Build a Postgres `CREATE SCHEMA` query node. See {@link createTable} for the
|
|
230
|
+
* pre-trusted-identifier precondition.
|
|
231
|
+
*/
|
|
232
|
+
declare function createSchema(options: {
|
|
233
|
+
readonly schema: string;
|
|
234
|
+
readonly ifNotExists?: boolean;
|
|
235
|
+
}): PostgresCreateSchema;
|
|
236
|
+
/**
|
|
237
|
+
* Build an `ADD COLUMN` action for use inside {@link alterTable}.
|
|
238
|
+
* The column is a structured `DdlColumn` so codec-encoded defaults flow
|
|
239
|
+
* through the adapter's `pgRenderDdlColumn` → `pgRenderDdlColumnDefault` path.
|
|
240
|
+
*/
|
|
241
|
+
declare function addColumnAction(column: DdlColumn): AddColumnAction;
|
|
242
|
+
/**
|
|
243
|
+
* Build a `DROP DEFAULT` action (`ALTER COLUMN "<name>" DROP DEFAULT`) for
|
|
244
|
+
* use inside {@link alterTable}. The renderer quotes the column name.
|
|
245
|
+
*/
|
|
246
|
+
declare function dropDefaultAction(columnName: string): DropDefaultAction;
|
|
247
|
+
/**
|
|
248
|
+
* Build a Postgres `ALTER TABLE` query node carrying one or more actions.
|
|
249
|
+
* See {@link addColumnAction} / {@link dropDefaultAction} for building actions.
|
|
250
|
+
*/
|
|
251
|
+
declare function alterTable(options: {
|
|
252
|
+
readonly table: string;
|
|
253
|
+
readonly schema?: string;
|
|
254
|
+
readonly actions: readonly AnyAlterTableAction[];
|
|
255
|
+
}): PostgresAlterTable;
|
|
256
|
+
//#endregion
|
|
257
|
+
export { rlsPolicyExistsAst as A, indexExistsAst as C, noNullValuesAst as D, jsonb as E, textArray as F, timestamptz as I, toRegclass as L, tableIsEmptyAst as M, tablePrimaryKeyAst as N, pgTable as O, text as P, extensionExistsAst as S, int8 as T, columnTypeAst as _, IndexExistsCheckBuilder as a, createTable as b, TableExistsCheckBuilder as c, alterTable as d, buildControlTableBootstrapQueries as f, columnNullabilityAst as g, columnExistsAst as h, ExtensionExistsCheckBuilder as i, tableExistsAst as j, rlsEnabledAst as k, TablePrimaryKeyCheckBuilder as l, columnDefaultAst as m, ColumnExistsCheckBuilder as n, RlsEnabledCheckBuilder as o, buildSignMarkerBootstrapQueries as p, ConstraintExistsCheckBuilder as r, RlsPolicyExistsCheckBuilder as s, ColumnDefaultCheckBuilder as t, addColumnAction as u, constraintExistsAst as v, int4 as w, dropDefaultAction as x, createSchema as y };
|
|
258
|
+
//# sourceMappingURL=contract-free-DzpGxLfb.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-free-DzpGxLfb.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/contract-free.d.mts"],"mappings":";;;;;;;;;;;iBAUiB,WAAW,wBAAwB;UAC1C;EACR,eAAe;EACf,gBAAgB;;;;;;;;;;;iBAWD,eAAe,gBAAgB,gBAAgB;UACtD;EACR,qBAAqB;EACrB,oBAAoB;;;;;;;;;;;;;;;;iBAgBL,oBAAoB;WAC1B;WACA;WACA;IACP;UACM;EACR,iBAAiB;EACjB,gBAAgB;;;;;;;iBAOD,gBAAgB;WACtB;WACA;WACA;IACP;;;;;iBAKa,qBAAqB;WAC3B;WACA;WACA;WACA;IACP;UACM;EACR,kBAAkB;EAClB,iBAAiB;EACjB,aAAa;;;;;;;;iBAQE,iBAAiB;WACvB;WACA;WACA;IACP;;;;;;iBAMa,cAAc;WACpB;WACA;WACA;WACA;IACP;UACM;EACR,aAAa;EACb,YAAY;;;;;;;iBAOG,mBAAmB;WACzB;WACA;WACA;IACP;;;;;;iBAMa,gBAAgB,gBAAgB,gBAAgB;;;;;iBAKhD,gBAAgB;WACtB;WACA;WACA;IACP;UACM;EACR,oBAAoB;EACpB,mBAAmB;;;;;;iBAMJ,mBAAmB,wBAAwB;UAClD;EACR,iBAAiB;EACjB,gBAAgB;;;;;;;;iBAQD,mBAAmB;WACzB;WACA;WACA;IACP;UACM;EACR,cAAc;EACd,eAAe;;;;;;;iBAOA,cAAc,gBAAgB,gBAAgB;UACrD;EACR,gBAAgB;EAChB,eAAe;;;;;;iBAMA,eAAe,gBAAgB,oBAAoB;;;KAG/D;WACM;;cAEG,OAAO,OAAO,YAAY;cAC1B,OAAO,OAAO,YAAY;cAC1B,OAAO,OAAO,YAAY;cAC1B,QAAQ,OAAO,YAAY;cAC3B,YAAY,OAAO,YAAY;cAC/B,cAAc,OAAO,YAAY;;;;;;;;;;;;;iBAa9B,QAAQ,eAAe,cAAc;WAC3C;WACA;WACA;GACR,SAAS,SAAS,YAAY;;;iBAGhB,4CAA4C;iBAC5C,8CAA8C;;;;;;;;;;;;;;;;;iBAiB9C,YAAY;WAClB;WACA;WACA;WACA,kBAAkB;WAClB,uBAAuB;IAC9B;;;;;iBAKa,aAAa;WACnB;WACA;IACP;;;;;;iBAMa,gBAAgB,QAAQ,YAAY;;;;;iBAKpC,kBAAkB,qBAAqB;;;;;iBAKvC,WAAW;WACjB;WACA;WACA,kBAAkB;IACzB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { t as PostgresPlanTargetDetails } from "./planner-target-details-HkP4RrRO-_xPQVPF0.mjs";
|
|
2
|
+
import { StorageColumn } from "@prisma/orm-family-sql/contract/types";
|
|
3
|
+
import { SqlControlTargetDescriptor } from "@prisma/orm-family-sql/family/control";
|
|
4
|
+
import { ColumnDefault } from "@prisma/orm-framework/contract/types";
|
|
5
|
+
//#region ../../../3-targets/3-targets/postgres/dist/control.d.mts
|
|
6
|
+
//#region src/exports/control.d.ts
|
|
7
|
+
declare function postgresRenderDefault(def: ColumnDefault, column: StorageColumn): string;
|
|
8
|
+
declare const postgresTargetDescriptor: SqlControlTargetDescriptor<'postgres', PostgresPlanTargetDetails>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { postgresTargetDescriptor as n, postgresRenderDefault as t };
|
|
11
|
+
//# sourceMappingURL=control-2F195jJk.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-2F195jJk.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/control.d.mts"],"mappings":";;;;;;iBAKiB,sBAAsB,KAAK,eAAe,QAAQ;cACrD,0BAA0B,uCAAuC"}
|