@prisma/orm-target-postgres 8.0.0-rc.1-dev.46 → 8.0.0-rc.10-dev.1
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/README.md +1 -5
- package/dist/{adapter-B0xsc80z-sYcF0RVF.mjs → adapter-BO4-D_sb-Dv6OpO1E.mjs} +4 -4
- package/dist/{adapter-B0xsc80z-sYcF0RVF.mjs.map → adapter-BO4-D_sb-Dv6OpO1E.mjs.map} +1 -1
- package/dist/{adapter-CPesdzv0.d.mts → adapter-BQrsKoUs.d.mts} +2 -2
- package/dist/{adapter-CPesdzv0.d.mts.map → adapter-BQrsKoUs.d.mts.map} +1 -1
- package/dist/adapter.d.mts +8 -8
- 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 +2 -2
- package/dist/adapter__column-types.mjs +2 -2
- package/dist/adapter__control.d.mts +1 -1
- package/dist/adapter__control.mjs +78 -12
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.d.mts +1 -1
- package/dist/adapter__runtime.mjs +23 -14
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/adapter__sql-renderer.d.mts +1 -1
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/adapter__types.d.mts +2 -2
- package/dist/{aggregates-Dh6HPdvC.mjs → aggregates-Ckjhz1o7.mjs} +15 -10
- package/dist/aggregates-Ckjhz1o7.mjs.map +1 -0
- package/dist/{authoring-BOpdZa2N-ClrLFiXw.mjs → authoring-Dm1jBKhq-i8FD48I-.mjs} +84 -48
- package/dist/authoring-Dm1jBKhq-i8FD48I-.mjs.map +1 -0
- package/dist/{check-expressions-DRgG8RN5-DiA-22aC.d.mts → check-expressions-D4R7JhiZ-q-dFPGT2.d.mts} +7 -9
- package/dist/check-expressions-D4R7JhiZ-q-dFPGT2.d.mts.map +1 -0
- package/dist/{check-expressions-5vhxWaFy-CBcjFeur.mjs → check-expressions-DFTeR0rd-CSxSpyMV.mjs} +14 -11
- package/dist/check-expressions-DFTeR0rd-CSxSpyMV.mjs.map +1 -0
- package/dist/codec-ids-CmcC76hX-C0JIyoua.d.mts +39 -0
- package/dist/codec-ids-CmcC76hX-C0JIyoua.d.mts.map +1 -0
- package/dist/codec-ids-D3ZEAmt2-DjoKUAas.mjs +39 -0
- package/dist/codec-ids-D3ZEAmt2-DjoKUAas.mjs.map +1 -0
- package/dist/codec-ids-cWPqrkcF.d.mts +1 -0
- package/dist/{codec-types-BRU4F-7t-BaJbKF_i.d.mts → codec-types-X0ENu4sQ-C6GS_WDR.d.mts} +21 -9
- package/dist/codec-types-X0ENu4sQ-C6GS_WDR.d.mts.map +1 -0
- package/dist/codec-types-Zel4Dk7S.d.mts +2 -0
- package/dist/{codecs-BmPCJWqb-DveZGJvm.mjs → codecs-CxWg7WrX-DtVAuuXA.mjs} +351 -255
- package/dist/codecs-CxWg7WrX-DtVAuuXA.mjs.map +1 -0
- package/dist/{codecs-B1HgsJZ2.mjs → codecs-DZMfLjGe.mjs} +2 -2
- package/dist/codecs-DZMfLjGe.mjs.map +1 -0
- package/dist/{codecs-D8tLswBi-_nbo-Z8x.d.mts → codecs-bwX5JaME-ByuPNLC5.d.mts} +146 -86
- package/dist/codecs-bwX5JaME-ByuPNLC5.d.mts.map +1 -0
- package/dist/{codecs-DmCKO7dg.d.mts → codecs-ePpDWH7z.d.mts} +2 -2
- package/dist/codecs-ePpDWH7z.d.mts.map +1 -0
- package/dist/{column-types-BH-MU6uU.d.mts → column-types-CwjYfNCi.d.mts} +33 -7
- package/dist/column-types-CwjYfNCi.d.mts.map +1 -0
- package/dist/{column-types-Bh92dNjD.mjs → column-types-DU7C_gwa.mjs} +37 -9
- package/dist/column-types-DU7C_gwa.mjs.map +1 -0
- package/dist/{contract-free-aQ4nT-_R.mjs → contract-free-CzTZEwpt.mjs} +5 -5
- package/dist/contract-free-CzTZEwpt.mjs.map +1 -0
- package/dist/{control-Drq2rquV.mjs → control-BF220oqr.mjs} +82 -24
- package/dist/control-BF220oqr.mjs.map +1 -0
- package/dist/{control-2F195jJk.d.mts → control-ByalKcpe.d.mts} +2 -1
- package/dist/control-ByalKcpe.d.mts.map +1 -0
- package/dist/{control-Y6FxMu3o.mjs → control-DzK5mSLo.mjs} +3 -3
- package/dist/control-DzK5mSLo.mjs.map +1 -0
- package/dist/{control-adapter-DFr4gS-r-DM3KcZdQ.mjs → control-adapter-BM70RkWS-kIC873DD.mjs} +21 -10
- package/dist/control-adapter-BM70RkWS-kIC873DD.mjs.map +1 -0
- package/dist/{control-policy-B53lnBCT-B9K9Cj1x.mjs → control-policy-BN8Ouun3-BtGYeb4f.mjs} +7 -7
- package/dist/control-policy-BN8Ouun3-BtGYeb4f.mjs.map +1 -0
- package/dist/{control-DLTOAEHj.d.mts → control-xdW1bgaP.d.mts} +3 -3
- package/dist/{control-DLTOAEHj.d.mts.map → control-xdW1bgaP.d.mts.map} +1 -1
- package/dist/{ddl-CNQJds-C-WfZ3y4y8.mjs → ddl-GXbCrKp_-CBKFkq1r.mjs} +4 -4
- package/dist/{ddl-CNQJds-C-WfZ3y4y8.mjs.map → ddl-GXbCrKp_-CBKFkq1r.mjs.map} +1 -1
- package/dist/{descriptor-meta-rilAH3ep-dAmiVLpe.mjs → descriptor-meta-D41CePyY-B0L9RIgT.mjs} +7 -6
- package/dist/descriptor-meta-D41CePyY-B0L9RIgT.mjs.map +1 -0
- package/dist/{descriptor-meta-KVX21fsl-DBDoB4eg.mjs → descriptor-meta-zQNj82MZ-CDwEiYdj.mjs} +50 -21
- package/dist/descriptor-meta-zQNj82MZ-CDwEiYdj.mjs.map +1 -0
- package/dist/{diff-database-schema-DKq76rCk-uehceHYz.mjs → diff-database-schema-C9UxdmYu-BzQjQb1e.mjs} +6 -6
- package/dist/{diff-database-schema-DKq76rCk-uehceHYz.mjs.map → diff-database-schema-C9UxdmYu-BzQjQb1e.mjs.map} +1 -1
- package/dist/driver.d.mts +2 -2
- package/dist/driver.mjs +3 -2
- package/dist/driver__control.mjs +1 -1
- package/dist/driver__runtime.d.mts +2 -2
- package/dist/driver__runtime.mjs +2 -639
- package/dist/{errors-CU4xIwwk.d.mts → errors-5fMq0U66.d.mts} +2 -2
- package/dist/{errors-CU4xIwwk.d.mts.map → errors-5fMq0U66.d.mts.map} +1 -1
- package/dist/errors-DYyzTYzE-39CV_aMo.mjs +92 -0
- package/dist/errors-DYyzTYzE-39CV_aMo.mjs.map +1 -0
- package/dist/instant-now-generator-lJQqn_8K-JOzseqXI.d.mts +9 -0
- package/dist/instant-now-generator-lJQqn_8K-JOzseqXI.d.mts.map +1 -0
- package/dist/migration-PTHAY9Cv.mjs.map +1 -1
- package/dist/{op-factory-call-H6zeDGLe-_1pAftJk.mjs → op-factory-call-CSkQdszU-C43tr0rP.mjs} +7 -7
- package/dist/{op-factory-call-H6zeDGLe-_1pAftJk.mjs.map → op-factory-call-CSkQdszU-C43tr0rP.mjs.map} +1 -1
- package/dist/{pack-CySS3DQU.d.mts → pack-BByvVlUw.d.mts} +177 -13
- package/dist/pack-BByvVlUw.d.mts.map +1 -0
- package/dist/{planner-D0uogzvT-1WyGIC5p.mjs → planner-DtwSy6w3--x0IvtI9.mjs} +8 -8
- package/dist/{planner-D0uogzvT-1WyGIC5p.mjs.map → planner-DtwSy6w3--x0IvtI9.mjs.map} +1 -1
- package/dist/{planner-ddl-builders-Chxh-LEQ-DXvwOeeA.mjs → planner-ddl-builders-CsfmnnKR-CNn0fLyx.mjs} +5 -5
- package/dist/{planner-ddl-builders-Chxh-LEQ-DXvwOeeA.mjs.map → planner-ddl-builders-CsfmnnKR-CNn0fLyx.mjs.map} +1 -1
- package/dist/{planner-produced-postgres-migration-D5m8nK6s-CbZ4hlbv.mjs → planner-produced-postgres-migration-BResV739-meZQaWcU.mjs} +4 -4
- package/dist/{planner-produced-postgres-migration-D5m8nK6s-CbZ4hlbv.mjs.map → planner-produced-postgres-migration-BResV739-meZQaWcU.mjs.map} +1 -1
- package/dist/{planner-sql-checks-ftgzvIO9-BTtBg2Vz.mjs → planner-sql-checks-Bcngv5YZ-Dnp05hSM.mjs} +4 -4
- package/dist/{planner-sql-checks-ftgzvIO9-BTtBg2Vz.mjs.map → planner-sql-checks-Bcngv5YZ-Dnp05hSM.mjs.map} +1 -1
- package/dist/{postgres-contract-view-B8ykf2cO-T2LvWVFZ.mjs → postgres-contract-view-dWcpuV6T-CJPsHGox.mjs} +5 -5
- package/dist/{postgres-contract-view-B8ykf2cO-T2LvWVFZ.mjs.map → postgres-contract-view-dWcpuV6T-CJPsHGox.mjs.map} +1 -1
- package/dist/{postgres-migration-Dbq3RGfZ-aMnwfEAb.mjs → postgres-migration-DRKw86P7-C1eWF86n.mjs} +6 -6
- package/dist/{postgres-migration-Dbq3RGfZ-aMnwfEAb.mjs.map → postgres-migration-DRKw86P7-C1eWF86n.mjs.map} +1 -1
- package/dist/{postgres-schema-CF0yHESb-D7n2X21R.mjs → postgres-schema-B3t7Zr52-CMlY9aGw.mjs} +4 -4
- package/dist/{postgres-schema-CF0yHESb-D7n2X21R.mjs.map → postgres-schema-B3t7Zr52-CMlY9aGw.mjs.map} +1 -1
- package/dist/{render-ops-DOsRP0Po-BKn_c_Ia.mjs → render-ops-D2vJApKB-B281fzmn.mjs} +3 -3
- package/dist/{render-ops-DOsRP0Po-BKn_c_Ia.mjs.map → render-ops-D2vJApKB-B281fzmn.mjs.map} +1 -1
- package/dist/{resolve-ddl-schema-CoaeNP35-C-UZldpj.mjs → resolve-ddl-schema-Cab6g5MC-SRco-A7L.mjs} +3 -3
- package/dist/{resolve-ddl-schema-CoaeNP35-C-UZldpj.mjs.map → resolve-ddl-schema-Cab6g5MC-SRco-A7L.mjs.map} +1 -1
- package/dist/{runtime-DOXznQe0.d.mts → runtime-BdRKoWQu.d.mts} +2 -2
- package/dist/{runtime-DOXznQe0.d.mts.map → runtime-BdRKoWQu.d.mts.map} +1 -1
- package/dist/runtime-Di_BFzUC.mjs +685 -0
- package/dist/runtime-Di_BFzUC.mjs.map +1 -0
- package/dist/{runtime-lHBKgjB9.d.mts → runtime-DtoNQntj.d.mts} +3 -2
- package/dist/runtime-DtoNQntj.d.mts.map +1 -0
- package/dist/{runtime-_TfO66h5.d.mts → runtime-bbCw9Omq.d.mts} +2 -1
- package/dist/runtime-bbCw9Omq.d.mts.map +1 -0
- package/dist/{sql-renderer-BgC0ZgLS.d.mts → sql-renderer-Cshx9dNa.d.mts} +2 -2
- package/dist/{sql-renderer-BgC0ZgLS.d.mts.map → sql-renderer-Cshx9dNa.d.mts.map} +1 -1
- package/dist/{sql-renderer-ComgusFq-BBlqM1fw.mjs → sql-renderer-DMMtw8lD-K9zLsg-g.mjs} +8 -75
- package/dist/sql-renderer-DMMtw8lD-K9zLsg-g.mjs.map +1 -0
- package/dist/{sql-utils-DuzN3JZg-DiXy4Vah.mjs → sql-utils-6j9YTLpr-BCyCBPBg.mjs} +3 -3
- package/dist/{sql-utils-DuzN3JZg-DiXy4Vah.mjs.map → sql-utils-6j9YTLpr-BCyCBPBg.mjs.map} +1 -1
- package/dist/target.d.mts +14 -13
- package/dist/target.mjs +24 -23
- package/dist/target__aggregates.mjs +1 -1
- package/dist/target__codec-ids.d.mts +3 -3
- package/dist/target__codec-ids.mjs +2 -2
- package/dist/target__codec-types.d.mts +4 -4
- package/dist/target__codecs.d.mts +3 -3
- package/dist/target__codecs.mjs +3 -3
- package/dist/target__contract-free.mjs +3 -3
- package/dist/target__control.d.mts +3 -2
- package/dist/target__control.mjs +3 -2
- package/dist/target__diff-database-schema.mjs +1 -1
- package/dist/target__errors.d.mts +1 -1
- package/dist/target__errors.mjs +1 -1
- package/dist/target__issue-planner.mjs +1 -1
- package/dist/target__migration.mjs +2 -2
- package/dist/target__op-factory-call.mjs +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__planner-ddl-builders.mjs +1 -1
- package/dist/target__planner-produced-postgres-migration.mjs +1 -1
- package/dist/target__planner-sql-checks.mjs +1 -1
- package/dist/target__planner.mjs +2 -2
- package/dist/target__render-ops.mjs +1 -1
- package/dist/target__runtime.d.mts +3 -2
- package/dist/target__runtime.mjs +3 -2
- package/dist/target__runtime.mjs.map +1 -1
- package/dist/target__schema-ir-annotations.mjs +1 -1
- package/dist/target__sql-utils.mjs +1 -1
- package/dist/target__types.d.mts +2 -2
- package/dist/target__types.mjs +2 -2
- package/dist/{types-CjGjPLr5.d.mts → types-B4IkFolc.d.mts} +2 -2
- package/dist/{types-CjGjPLr5.d.mts.map → types-B4IkFolc.d.mts.map} +1 -1
- package/dist/types-C7BEZmFD.d.mts +1 -0
- package/dist/{types-CkryN1AS-BcQRGsDn.d.mts → types-CkryN1AS-CZtzRJFZ.d.mts} +2 -2
- package/dist/{types-CkryN1AS-BcQRGsDn.d.mts.map → types-CkryN1AS-CZtzRJFZ.d.mts.map} +1 -1
- package/package.json +13 -12
- package/dist/aggregates-Dh6HPdvC.mjs.map +0 -1
- package/dist/authoring-BOpdZa2N-ClrLFiXw.mjs.map +0 -1
- package/dist/check-expressions-5vhxWaFy-CBcjFeur.mjs.map +0 -1
- package/dist/check-expressions-DRgG8RN5-DiA-22aC.d.mts.map +0 -1
- package/dist/codec-ids-Bqu_IwO0-DKOdPizQ.d.mts +0 -35
- package/dist/codec-ids-Bqu_IwO0-DKOdPizQ.d.mts.map +0 -1
- package/dist/codec-ids-C5Rkltkw-DMf87l9s.mjs +0 -35
- package/dist/codec-ids-C5Rkltkw-DMf87l9s.mjs.map +0 -1
- package/dist/codec-ids-DJ6j6pZc.d.mts +0 -1
- package/dist/codec-types-BRU4F-7t-BaJbKF_i.d.mts.map +0 -1
- package/dist/codec-types-bX63JRLf.d.mts +0 -2
- package/dist/codecs-B1HgsJZ2.mjs.map +0 -1
- package/dist/codecs-BmPCJWqb-DveZGJvm.mjs.map +0 -1
- package/dist/codecs-D8tLswBi-_nbo-Z8x.d.mts.map +0 -1
- package/dist/codecs-DmCKO7dg.d.mts.map +0 -1
- package/dist/column-types-BH-MU6uU.d.mts.map +0 -1
- package/dist/column-types-Bh92dNjD.mjs.map +0 -1
- package/dist/contract-free-aQ4nT-_R.mjs.map +0 -1
- package/dist/control-2F195jJk.d.mts.map +0 -1
- package/dist/control-Drq2rquV.mjs.map +0 -1
- package/dist/control-Y6FxMu3o.mjs.map +0 -1
- package/dist/control-adapter-DFr4gS-r-DM3KcZdQ.mjs.map +0 -1
- package/dist/control-policy-B53lnBCT-B9K9Cj1x.mjs.map +0 -1
- package/dist/descriptor-meta-KVX21fsl-DBDoB4eg.mjs.map +0 -1
- package/dist/descriptor-meta-rilAH3ep-dAmiVLpe.mjs.map +0 -1
- package/dist/driver__runtime.mjs.map +0 -1
- package/dist/errors-DKjQzNaN-DFcF1thx.mjs +0 -39
- package/dist/errors-DKjQzNaN-DFcF1thx.mjs.map +0 -1
- package/dist/pack-CySS3DQU.d.mts.map +0 -1
- package/dist/runtime-_TfO66h5.d.mts.map +0 -1
- package/dist/runtime-lHBKgjB9.d.mts.map +0 -1
- package/dist/sql-renderer-ComgusFq-BBlqM1fw.mjs.map +0 -1
- package/dist/types-B-4d5_4a.d.mts +0 -1
|
@@ -1,20 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { s as PG_ENUM_CODEC_ID } from "./codec-ids-D3ZEAmt2-DjoKUAas.mjs";
|
|
2
|
+
import { i as errorTemporalUnavailableForDefault, s as postgresError } from "./errors-DYyzTYzE-39CV_aMo.mjs";
|
|
3
3
|
import { t as PostgresNativeEnum } from "./postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs";
|
|
4
|
-
import { a as PostgresRlsPolicySchema, i as PostgresRlsPolicy, n as PostgresRlsEnablement, o as PostgresRole, r as PostgresRlsEnablementSchema, s as PostgresRoleSchema, t as PostgresNativeEnumSchema } from "./postgres-schema-
|
|
4
|
+
import { a as PostgresRlsPolicySchema, i as PostgresRlsPolicy, n as PostgresRlsEnablement, o as PostgresRole, r as PostgresRlsEnablementSchema, s as PostgresRoleSchema, t as PostgresNativeEnumSchema } from "./postgres-schema-B3t7Zr52-CMlY9aGw.mjs";
|
|
5
5
|
import { n as computeContentHash, t as POLICY_OPERATION_PREDICATES } from "./canonicalize-CrN3u_xM-D4MrOqcB.mjs";
|
|
6
6
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
7
7
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
8
8
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
9
9
|
import { assertWireNamePrefixLength, normalizeSqlBody } from "@prisma/orm-family-sql/schema-ir/naming";
|
|
10
|
-
import { assertDefined } from "@prisma/orm-framework/utils/assertions";
|
|
11
|
-
import { temporalAuthoringPresets, temporalCodecPresetWithPrecision } from "@prisma/orm-family-sql/family/control";
|
|
12
|
-
import { modelAttribute } from "@prisma/orm-framework/psl-parser";
|
|
10
|
+
import { assertDefined, invariant } from "@prisma/orm-framework/utils/assertions";
|
|
11
|
+
import { temporalAuthoringPresets, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets } from "@prisma/orm-family-sql/family/control";
|
|
12
|
+
import { blockAttribute, leafDiagnostic, modelAttribute, str } from "@prisma/orm-framework/psl-parser";
|
|
13
13
|
import { exactNameBodyWarning } from "@prisma/orm-family-sql/contract/index-naming";
|
|
14
|
-
//#region ../../../3-targets/3-targets/postgres/dist/authoring-
|
|
14
|
+
//#region ../../../3-targets/3-targets/postgres/dist/authoring-Dm1jBKhq.mjs
|
|
15
|
+
const INSTANT_NOW_GENERATOR_ID = "instantNow";
|
|
16
|
+
function instantNowControlDescriptor() {
|
|
17
|
+
return {
|
|
18
|
+
id: INSTANT_NOW_GENERATOR_ID,
|
|
19
|
+
buildPhases: () => ({
|
|
20
|
+
onCreate: {
|
|
21
|
+
kind: "generator",
|
|
22
|
+
id: INSTANT_NOW_GENERATOR_ID
|
|
23
|
+
},
|
|
24
|
+
onUpdate: {
|
|
25
|
+
kind: "generator",
|
|
26
|
+
id: INSTANT_NOW_GENERATOR_ID
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function instantNow() {
|
|
32
|
+
if (typeof Temporal === "undefined") throw errorTemporalUnavailableForDefault(INSTANT_NOW_GENERATOR_ID);
|
|
33
|
+
return Temporal.Now.instant();
|
|
34
|
+
}
|
|
15
35
|
const PSL_RLS_PREDICATE_NOT_FOR_OPERATION = "PSL_RLS_PREDICATE_NOT_FOR_OPERATION";
|
|
16
36
|
const PSL_POLICY_INVALID_MAP = "PSL_POLICY_INVALID_MAP";
|
|
17
|
-
const PSL_NATIVE_ENUM_INVALID_MAP = "PSL_NATIVE_ENUM_INVALID_MAP";
|
|
18
37
|
const PSL_NATIVE_ENUM_BARE_MEMBER = "PSL_NATIVE_ENUM_BARE_MEMBER";
|
|
19
38
|
const PSL_EXTENSION_INVALID_VALUE = "PSL_EXTENSION_INVALID_VALUE";
|
|
20
39
|
const PSL_NATIVE_ENUM_DUPLICATE_MEMBER_VALUE = "PSL_NATIVE_ENUM_DUPLICATE_MEMBER_VALUE";
|
|
@@ -163,19 +182,10 @@ function lowerRlsPolicyFromBlock(block, ctx) {
|
|
|
163
182
|
return;
|
|
164
183
|
}
|
|
165
184
|
const permissive = permissiveRaw !== "false";
|
|
166
|
-
const mapAttr = block.
|
|
167
|
-
if (mapAttr) {
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
if (exactName === void 0 || exactName === "") {
|
|
171
|
-
ctx.diagnostics?.push({
|
|
172
|
-
code: PSL_POLICY_INVALID_MAP,
|
|
173
|
-
message: `\`${block.keyword}\` policy "${block.name}" @@map attribute must have a quoted, non-empty policy-name argument`,
|
|
174
|
-
sourceId: ctx.sourceId ?? "unknown",
|
|
175
|
-
span: mapAttr.span
|
|
176
|
-
});
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
185
|
+
const mapAttr = block.attributes["map"];
|
|
186
|
+
if (mapAttr !== void 0) {
|
|
187
|
+
const exactName = mapAttr.args["name"];
|
|
188
|
+
invariant(typeof exactName === "string", "@@map on a policy block parses one string argument");
|
|
179
189
|
ctx.warnings?.push(exactNameBodyWarning("policy", exactName));
|
|
180
190
|
return new PostgresRlsPolicy({
|
|
181
191
|
naming: {
|
|
@@ -215,20 +225,11 @@ function lowerRlsPolicyFromBlock(block, ctx) {
|
|
|
215
225
|
function lowerNativeEnumFromBlock(block, ctx) {
|
|
216
226
|
const sourceId = ctx.sourceId ?? "unknown";
|
|
217
227
|
const diagnostics = ctx.diagnostics;
|
|
218
|
-
const mapAttr = block.
|
|
228
|
+
const mapAttr = block.attributes["map"];
|
|
219
229
|
let typeName = block.name;
|
|
220
|
-
if (mapAttr) {
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
if (mapped === void 0) {
|
|
224
|
-
diagnostics?.push({
|
|
225
|
-
code: PSL_NATIVE_ENUM_INVALID_MAP,
|
|
226
|
-
message: `native_enum "${block.name}" @@map attribute must have a quoted type-name argument`,
|
|
227
|
-
sourceId,
|
|
228
|
-
span: mapAttr.span
|
|
229
|
-
});
|
|
230
|
-
return;
|
|
231
|
-
}
|
|
230
|
+
if (mapAttr !== void 0) {
|
|
231
|
+
const mapped = mapAttr.args["name"];
|
|
232
|
+
invariant(typeof mapped === "string", "@@map on a native_enum block parses one string argument");
|
|
232
233
|
typeName = mapped;
|
|
233
234
|
}
|
|
234
235
|
let memberError = false;
|
|
@@ -414,6 +415,18 @@ const policyRequiresRls = {
|
|
|
414
415
|
parameter: "target",
|
|
415
416
|
attribute: "rls"
|
|
416
417
|
};
|
|
418
|
+
const policyMapAttribute = blockAttribute("map", {
|
|
419
|
+
positional: [{
|
|
420
|
+
key: "name",
|
|
421
|
+
type: str()
|
|
422
|
+
}],
|
|
423
|
+
refine: (parsed, ctx, attributeNode) => parsed.name === "" ? [leafDiagnostic(ctx, attributeNode, "@@map policy name must be a non-empty string", PSL_POLICY_INVALID_MAP)] : []
|
|
424
|
+
});
|
|
425
|
+
const policyBlockAttributes = { map: () => policyMapAttribute };
|
|
426
|
+
const nativeEnumMapAttribute = blockAttribute("map", { positional: [{
|
|
427
|
+
key: "name",
|
|
428
|
+
type: str()
|
|
429
|
+
}] });
|
|
417
430
|
const postgresAuthoringPslBlockDescriptors = {
|
|
418
431
|
policy_select: {
|
|
419
432
|
kind: "pslBlock",
|
|
@@ -426,7 +439,8 @@ const postgresAuthoringPslBlockDescriptors = {
|
|
|
426
439
|
using: policyPredicateParam,
|
|
427
440
|
permissive: policyPermissiveParam
|
|
428
441
|
},
|
|
429
|
-
requiresModelAttribute: policyRequiresRls
|
|
442
|
+
requiresModelAttribute: policyRequiresRls,
|
|
443
|
+
attributes: policyBlockAttributes
|
|
430
444
|
},
|
|
431
445
|
policy_delete: {
|
|
432
446
|
kind: "pslBlock",
|
|
@@ -439,7 +453,8 @@ const postgresAuthoringPslBlockDescriptors = {
|
|
|
439
453
|
using: policyPredicateParam,
|
|
440
454
|
permissive: policyPermissiveParam
|
|
441
455
|
},
|
|
442
|
-
requiresModelAttribute: policyRequiresRls
|
|
456
|
+
requiresModelAttribute: policyRequiresRls,
|
|
457
|
+
attributes: policyBlockAttributes
|
|
443
458
|
},
|
|
444
459
|
policy_insert: {
|
|
445
460
|
kind: "pslBlock",
|
|
@@ -452,7 +467,8 @@ const postgresAuthoringPslBlockDescriptors = {
|
|
|
452
467
|
withCheck: policyPredicateParam,
|
|
453
468
|
permissive: policyPermissiveParam
|
|
454
469
|
},
|
|
455
|
-
requiresModelAttribute: policyRequiresRls
|
|
470
|
+
requiresModelAttribute: policyRequiresRls,
|
|
471
|
+
attributes: policyBlockAttributes
|
|
456
472
|
},
|
|
457
473
|
policy_update: {
|
|
458
474
|
kind: "pslBlock",
|
|
@@ -466,7 +482,8 @@ const postgresAuthoringPslBlockDescriptors = {
|
|
|
466
482
|
withCheck: policyPredicateParam,
|
|
467
483
|
permissive: policyPermissiveParam
|
|
468
484
|
},
|
|
469
|
-
requiresModelAttribute: policyRequiresRls
|
|
485
|
+
requiresModelAttribute: policyRequiresRls,
|
|
486
|
+
attributes: policyBlockAttributes
|
|
470
487
|
},
|
|
471
488
|
policy_all: {
|
|
472
489
|
kind: "pslBlock",
|
|
@@ -480,7 +497,8 @@ const postgresAuthoringPslBlockDescriptors = {
|
|
|
480
497
|
withCheck: policyPredicateParam,
|
|
481
498
|
permissive: policyPermissiveParam
|
|
482
499
|
},
|
|
483
|
-
requiresModelAttribute: policyRequiresRls
|
|
500
|
+
requiresModelAttribute: policyRequiresRls,
|
|
501
|
+
attributes: policyBlockAttributes
|
|
484
502
|
},
|
|
485
503
|
/**
|
|
486
504
|
* PSL block descriptor for `native_enum`.
|
|
@@ -498,7 +516,8 @@ const postgresAuthoringPslBlockDescriptors = {
|
|
|
498
516
|
discriminator: "native_enum",
|
|
499
517
|
name: { required: true },
|
|
500
518
|
parameters: {},
|
|
501
|
-
variadicParameters: true
|
|
519
|
+
variadicParameters: true,
|
|
520
|
+
attributes: { map: () => nativeEnumMapAttribute }
|
|
502
521
|
},
|
|
503
522
|
/**
|
|
504
523
|
* PSL block descriptor for `role` (e.g. `role anon {}`). Name-only, no
|
|
@@ -514,6 +533,8 @@ const postgresAuthoringPslBlockDescriptors = {
|
|
|
514
533
|
parameters: {}
|
|
515
534
|
}
|
|
516
535
|
};
|
|
536
|
+
const postgresRlsSpec = modelAttribute("rls", {});
|
|
537
|
+
const postgresRlsSpecFactory = () => postgresRlsSpec;
|
|
517
538
|
/**
|
|
518
539
|
* `@@` model attributes contributed by the Postgres target pack.
|
|
519
540
|
*
|
|
@@ -526,7 +547,7 @@ const postgresAuthoringPslBlockDescriptors = {
|
|
|
526
547
|
const postgresAuthoringModelAttributes = { rls: {
|
|
527
548
|
kind: "modelAttribute",
|
|
528
549
|
attribute: "rls",
|
|
529
|
-
spec:
|
|
550
|
+
spec: postgresRlsSpecFactory,
|
|
530
551
|
lower: (_parsed, ctx) => ({
|
|
531
552
|
key: ctx.storageName,
|
|
532
553
|
entity: new PostgresRlsEnablement({
|
|
@@ -595,21 +616,36 @@ const postgresAuthoringFieldPresets = {
|
|
|
595
616
|
dateTime: {
|
|
596
617
|
kind: "fieldPreset",
|
|
597
618
|
output: {
|
|
598
|
-
codecId: "pg/timestamptz@1",
|
|
619
|
+
codecId: "pg/timestamptz-temporal@1",
|
|
599
620
|
nativeType: "timestamptz"
|
|
600
621
|
}
|
|
601
622
|
},
|
|
602
623
|
temporal: {
|
|
603
624
|
.../* @__PURE__ */ temporalAuthoringPresets({
|
|
604
|
-
codecId: "pg/timestamptz@1",
|
|
625
|
+
codecId: "pg/timestamptz-temporal@1",
|
|
626
|
+
nativeType: "timestamptz",
|
|
627
|
+
generatorId: INSTANT_NOW_GENERATOR_ID
|
|
628
|
+
}),
|
|
629
|
+
.../* @__PURE__ */ temporalStringAuthoringPresets({
|
|
630
|
+
codecId: "pg/timestamptz-string@1",
|
|
605
631
|
nativeType: "timestamptz"
|
|
606
632
|
}),
|
|
607
633
|
timestamp: /* @__PURE__ */ temporalCodecPresetWithPrecision({
|
|
608
|
-
codecId: "pg/timestamp@1",
|
|
609
|
-
nativeType: "timestamp"
|
|
634
|
+
codecId: "pg/timestamp-temporal@1",
|
|
635
|
+
nativeType: "timestamp",
|
|
636
|
+
generatorId: INSTANT_NOW_GENERATOR_ID
|
|
610
637
|
}),
|
|
611
638
|
timestamptz: /* @__PURE__ */ temporalCodecPresetWithPrecision({
|
|
612
|
-
codecId: "pg/timestamptz@1",
|
|
639
|
+
codecId: "pg/timestamptz-temporal@1",
|
|
640
|
+
nativeType: "timestamptz",
|
|
641
|
+
generatorId: INSTANT_NOW_GENERATOR_ID
|
|
642
|
+
}),
|
|
643
|
+
timestampString: /* @__PURE__ */ temporalCodecPresetWithPrecision({
|
|
644
|
+
codecId: "pg/timestamp-string@1",
|
|
645
|
+
nativeType: "timestamp"
|
|
646
|
+
}),
|
|
647
|
+
timestamptzString: /* @__PURE__ */ temporalCodecPresetWithPrecision({
|
|
648
|
+
codecId: "pg/timestamptz-string@1",
|
|
613
649
|
nativeType: "timestamptz"
|
|
614
650
|
})
|
|
615
651
|
},
|
|
@@ -768,6 +804,6 @@ function postgresLowerEntityHandles(input) {
|
|
|
768
804
|
return rows;
|
|
769
805
|
}
|
|
770
806
|
//#endregion
|
|
771
|
-
export {
|
|
807
|
+
export { postgresAuthoringFieldPresets as a, postgresAuthoringTypes as c, postgresAuthoringEntityTypes as i, postgresLowerEntityHandles as l, instantNow as n, postgresAuthoringModelAttributes as o, instantNowControlDescriptor as r, postgresAuthoringPslBlockDescriptors as s, INSTANT_NOW_GENERATOR_ID as t };
|
|
772
808
|
|
|
773
|
-
//# sourceMappingURL=authoring-
|
|
809
|
+
//# sourceMappingURL=authoring-Dm1jBKhq-i8FD48I-.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoring-Dm1jBKhq-i8FD48I-.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/authoring-Dm1jBKhq.mjs"],"sourcesContent":["import { s as PG_ENUM_CODEC_ID } from \"./codec-ids-D3ZEAmt2.mjs\";\nimport { i as errorTemporalUnavailableForDefault, s as postgresError } from \"./errors-DYyzTYzE.mjs\";\nimport { t as PostgresNativeEnum } from \"./postgres-native-enum-CdP3b_-R.mjs\";\nimport { _ as PostgresRlsPolicy, d as PostgresNativeEnumSchema, f as PostgresRlsEnablementSchema, h as PostgresRole, m as PostgresRoleSchema, p as PostgresRlsPolicySchema, v as PostgresRlsEnablement } from \"./postgres-schema-B3t7Zr52.mjs\";\nimport { n as computeContentHash, t as POLICY_OPERATION_PREDICATES } from \"./canonicalize-CrN3u_xM.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { temporalAuthoringPresets, temporalCodecPresetWithPrecision, temporalStringAuthoringPresets } from \"@internal/family-sql/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { blockAttribute, leafDiagnostic, modelAttribute, str } from \"@internal/psl-parser\";\nimport { exactNameBodyWarning } from \"@internal/sql-contract/index-naming\";\nimport { assertWireNamePrefixLength, normalizeSqlBody } from \"@internal/sql-schema-ir/naming\";\nimport { assertDefined, invariant } from \"@internal/utils/assertions\";\n//#region src/core/instant-now-generator.ts\nconst INSTANT_NOW_GENERATOR_ID = \"instantNow\";\nfunction instantNowControlDescriptor() {\n\treturn {\n\t\tid: INSTANT_NOW_GENERATOR_ID,\n\t\tbuildPhases: () => ({\n\t\t\tonCreate: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid: INSTANT_NOW_GENERATOR_ID\n\t\t\t},\n\t\t\tonUpdate: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid: INSTANT_NOW_GENERATOR_ID\n\t\t\t}\n\t\t})\n\t};\n}\nfunction instantNow() {\n\tif (typeof Temporal === \"undefined\") throw errorTemporalUnavailableForDefault(INSTANT_NOW_GENERATOR_ID);\n\treturn Temporal.Now.instant();\n}\n//#endregion\n//#region src/core/authoring.ts\nconst PSL_RLS_PREDICATE_NOT_FOR_OPERATION = \"PSL_RLS_PREDICATE_NOT_FOR_OPERATION\";\nconst PSL_POLICY_INVALID_MAP = \"PSL_POLICY_INVALID_MAP\";\nconst PSL_NATIVE_ENUM_BARE_MEMBER = \"PSL_NATIVE_ENUM_BARE_MEMBER\";\nconst PSL_EXTENSION_INVALID_VALUE = \"PSL_EXTENSION_INVALID_VALUE\";\nconst PSL_NATIVE_ENUM_DUPLICATE_MEMBER_VALUE = \"PSL_NATIVE_ENUM_DUPLICATE_MEMBER_VALUE\";\nconst PSL_NATIVE_ENUM_MISSING_MEMBERS = \"PSL_NATIVE_ENUM_MISSING_MEMBERS\";\nconst PSL_ROLE_BLOCK_OUTSIDE_UNBOUND_NAMESPACE = \"PSL_ROLE_BLOCK_OUTSIDE_UNBOUND_NAMESPACE\";\n/**\n* `pg.enum(<ref>)` registers as an ordinary type constructor whose sole\n* positional argument names a `native_enum` entity instead of carrying a\n* literal value. The interpreter resolves the ref to the `native_enum`\n* entity generically (driven by `entityRefArg`); the `pg/enum@1` codec\n* descriptor's `columnFromEntity` hook (see `codecs.ts`) converts that\n* entity into the column's `typeParams` and native type.\n*/\nconst postgresAuthoringTypes = {\n\tBigIntNumber: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int8number@1\",\n\t\t\tnativeType: \"int8\"\n\t\t}\n\t},\n\tUnboundedInt: {\n\t\tkind: \"typeConstructor\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/unboundedint@1\",\n\t\t\tnativeType: \"numeric\"\n\t\t}\n\t},\n\tpg: { enum: {\n\t\tkind: \"typeConstructor\",\n\t\tentityRefArg: {\n\t\t\tindex: 0,\n\t\t\tentityKind: \"native_enum\"\n\t\t},\n\t\toutput: { codecId: PG_ENUM_CODEC_ID }\n\t} }\n};\n/**\n* Maps a `policy_<op>` keyword to the RLS operation it authors. The keyword\n* IS the operation (per the project's rejection of a `policy { operation = … }`\n* conditional block).\n*/\nconst POLICY_KEYWORD_OPERATION = {\n\tpolicy_select: \"select\",\n\tpolicy_insert: \"insert\",\n\tpolicy_update: \"update\",\n\tpolicy_delete: \"delete\",\n\tpolicy_all: \"all\"\n};\nfunction readValueParam(block, key) {\n\tconst param = block.parameters[key];\n\treturn param?.kind === \"value\" ? param.raw : void 0;\n}\nfunction readListRefParams(block, key) {\n\tconst param = block.parameters[key];\n\tif (param?.kind !== \"list\") return [];\n\treturn param.items.flatMap((item) => item.kind === \"ref\" ? [item.identifier] : []);\n}\n/**\n* Unwraps a quoted PSL string argument, inverting the printer's\n* `escapePslString` escapes (`\\\\`, `\\\"`, `\\n`, `\\r`). An unknown escape\n* sequence is kept verbatim, matching the printer-side `unescapePslString`\n* convention.\n*/\nfunction unwrapQuotedString(raw) {\n\tif (!(raw.startsWith(\"\\\"\") && raw.endsWith(\"\\\"\") && raw.length >= 2)) return raw;\n\tconst inner = raw.slice(1, -1);\n\tlet result = \"\";\n\tfor (let i = 0; i < inner.length; i++) {\n\t\tif (inner[i] !== \"\\\\\" || i + 1 >= inner.length) {\n\t\t\tresult += inner[i];\n\t\t\tcontinue;\n\t\t}\n\t\tconst next = inner[i + 1];\n\t\tif (next === \"\\\\\" || next === \"\\\"\") result += next;\n\t\telse if (next === \"n\") result += \"\\n\";\n\t\telse if (next === \"r\") result += \"\\r\";\n\t\telse {\n\t\t\tresult += \"\\\\\";\n\t\t\tresult += next;\n\t\t}\n\t\ti++;\n\t}\n\treturn result;\n}\n/**\n* Assembles a {@link PostgresRlsPolicy} from lowered inputs: normalizes the\n* predicates, computes the content-hash wire name, and constructs the frozen\n* entity. The single hash-assembly body shared by the PSL block lowering\n* ({@link lowerRlsPolicyFromBlock}) and the TS entity-handle lowering\n* ({@link postgresLowerEntityHandles}) so the two surfaces cannot drift.\n*/\nfunction buildRlsPolicyEntity(input) {\n\tconst permissive = input.permissive ?? true;\n\tconst wireHash = computeContentHash({\n\t\t...ifDefined(\"using\", input.using !== void 0 ? normalizeSqlBody(input.using) : void 0),\n\t\t...ifDefined(\"withCheck\", input.withCheck !== void 0 ? normalizeSqlBody(input.withCheck) : void 0),\n\t\troles: input.roles,\n\t\toperation: input.operation,\n\t\tpermissive\n\t});\n\treturn new PostgresRlsPolicy({\n\t\tnaming: {\n\t\t\tkind: \"wire\",\n\t\t\tprefix: input.prefix,\n\t\t\thash: wireHash\n\t\t},\n\t\ttableName: input.tableName,\n\t\tnamespaceId: input.namespaceId,\n\t\toperation: input.operation,\n\t\troles: input.roles,\n\t\tusing: input.using,\n\t\twithCheck: input.withCheck,\n\t\tpermissive\n\t});\n}\nfunction lowerRlsPolicyFromBlock(block, ctx) {\n\tconst prefix = block.name;\n\tconst operation = POLICY_KEYWORD_OPERATION[block.keyword] ?? \"select\";\n\tconst tableName = block.resolvedModelRefs?.[\"target\"]?.tableName;\n\tassertDefined(tableName, `lowerRlsPolicyFromBlock: policy \"${block.name}\" reached the factory without a resolved \\`target\\` ref; the interpreter resolves same-namespace model refs before invoking entity factories.`);\n\tconst roles = [...readListRefParams(block, \"roles\")].sort();\n\tconst usingRaw = readValueParam(block, \"using\");\n\tconst withCheckRaw = readValueParam(block, \"withCheck\");\n\tconst support = POLICY_OPERATION_PREDICATES[operation];\n\tconst rejectPredicate = (predicate) => {\n\t\tctx.diagnostics?.push({\n\t\t\tcode: PSL_RLS_PREDICATE_NOT_FOR_OPERATION,\n\t\t\tmessage: `\\`${block.keyword}\\` policy \"${block.name}\" does not take a \\`${predicate}\\` predicate; the ${operation.toUpperCase()} operation uses ${support.using ? \"`using`\" : \"`withCheck`\"}${support.using && support.withCheck ? \" and `withCheck`\" : \" only\"}.`,\n\t\t\tsourceId: ctx.sourceId ?? \"unknown\",\n\t\t\tspan: block.parameters[predicate]?.span ?? block.span\n\t\t});\n\t};\n\tif (usingRaw !== void 0 && !support.using) return rejectPredicate(\"using\");\n\tif (withCheckRaw !== void 0 && !support.withCheck) return rejectPredicate(\"withCheck\");\n\tconst using = usingRaw !== void 0 ? unwrapQuotedString(usingRaw) : void 0;\n\tconst withCheck = withCheckRaw !== void 0 ? unwrapQuotedString(withCheckRaw) : void 0;\n\tconst permissiveRaw = readValueParam(block, \"permissive\");\n\tif (permissiveRaw !== void 0 && permissiveRaw !== \"true\" && permissiveRaw !== \"false\") {\n\t\tctx.diagnostics?.push({\n\t\t\tcode: PSL_EXTENSION_INVALID_VALUE,\n\t\t\tmessage: `\\`${block.keyword}\\` policy \"${block.name}\" \\`permissive\\` must be \\`true\\` or \\`false\\`, got ${permissiveRaw}.`,\n\t\t\tsourceId: ctx.sourceId ?? \"unknown\",\n\t\t\tspan: block.parameters[\"permissive\"]?.span ?? block.span\n\t\t});\n\t\treturn;\n\t}\n\tconst permissive = permissiveRaw !== \"false\";\n\tconst mapAttr = block.attributes[\"map\"];\n\tif (mapAttr !== void 0) {\n\t\tconst exactName = mapAttr.args[\"name\"];\n\t\tinvariant(typeof exactName === \"string\", \"@@map on a policy block parses one string argument\");\n\t\tctx.warnings?.push(exactNameBodyWarning(\"policy\", exactName));\n\t\treturn new PostgresRlsPolicy({\n\t\t\tnaming: {\n\t\t\t\tkind: \"exact\",\n\t\t\t\tname: exactName\n\t\t\t},\n\t\t\ttableName,\n\t\t\tnamespaceId: block.namespaceId,\n\t\t\toperation,\n\t\t\troles,\n\t\t\tusing,\n\t\t\twithCheck,\n\t\t\tpermissive\n\t\t});\n\t}\n\treturn buildRlsPolicyEntity({\n\t\tprefix,\n\t\ttableName,\n\t\tnamespaceId: block.namespaceId,\n\t\toperation,\n\t\troles,\n\t\t...ifDefined(\"using\", using),\n\t\t...ifDefined(\"withCheck\", withCheck),\n\t\tpermissive\n\t});\n}\n/**\n* Lowers a `native_enum { memberName = \"value\" … @@map(\"type_name\") }` block\n* into a {@link PostgresNativeEnum}. Members must be authored as explicit\n* `key = \"value\"` pairs — a bare (value-less) member is a diagnostic, not\n* accepted (authoring-design.md §2.1). The parsed `memberName` is only used\n* to duplicate-check and report diagnostics; the lowered entity carries just\n* the member values (a native enum is value-only — the member \"name\" isn't\n* a separate authoring concept from the value). `typeName` comes from\n* `@@map` or defaults to the block name verbatim.\n*/\nfunction lowerNativeEnumFromBlock(block, ctx) {\n\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\tconst diagnostics = ctx.diagnostics;\n\tconst mapAttr = block.attributes[\"map\"];\n\tlet typeName = block.name;\n\tif (mapAttr !== void 0) {\n\t\tconst mapped = mapAttr.args[\"name\"];\n\t\tinvariant(typeof mapped === \"string\", \"@@map on a native_enum block parses one string argument\");\n\t\ttypeName = mapped;\n\t}\n\tlet memberError = false;\n\tconst seenValues = /* @__PURE__ */ new Set();\n\tconst members = [];\n\tfor (const [memberName, paramValue] of Object.entries(block.parameters)) {\n\t\tif (paramValue.kind === \"bare\") {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: PSL_NATIVE_ENUM_BARE_MEMBER,\n\t\t\t\tmessage: `native_enum \"${block.name}\" member \"${memberName}\" has no value; members must be authored as \"${memberName} = \\\\\"value\\\\\"\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: paramValue.span\n\t\t\t});\n\t\t\tmemberError = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (paramValue.kind !== \"value\") continue;\n\t\tlet jsonValue;\n\t\ttry {\n\t\t\tjsonValue = JSON.parse(paramValue.raw);\n\t\t} catch {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: PSL_EXTENSION_INVALID_VALUE,\n\t\t\t\tmessage: `native_enum \"${block.name}\" member \"${memberName}\" value \"${paramValue.raw}\" is not valid JSON`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: paramValue.span\n\t\t\t});\n\t\t\tmemberError = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof jsonValue !== \"string\") {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: PSL_EXTENSION_INVALID_VALUE,\n\t\t\t\tmessage: `native_enum \"${block.name}\" member \"${memberName}\" value must be a string`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: paramValue.span\n\t\t\t});\n\t\t\tmemberError = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (seenValues.has(jsonValue)) {\n\t\t\tdiagnostics?.push({\n\t\t\t\tcode: PSL_NATIVE_ENUM_DUPLICATE_MEMBER_VALUE,\n\t\t\t\tmessage: `native_enum \"${block.name}\": duplicate member value \"${jsonValue}\"`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: paramValue.span\n\t\t\t});\n\t\t\tmemberError = true;\n\t\t\tcontinue;\n\t\t}\n\t\tseenValues.add(jsonValue);\n\t\tmembers.push(jsonValue);\n\t}\n\tif (memberError) return void 0;\n\tif (members.length === 0) {\n\t\tdiagnostics?.push({\n\t\t\tcode: PSL_NATIVE_ENUM_MISSING_MEMBERS,\n\t\t\tmessage: `native_enum \"${block.name}\" must have at least one member`,\n\t\t\tsourceId,\n\t\t\tspan: block.span\n\t\t});\n\t\treturn;\n\t}\n\treturn new PostgresNativeEnum({\n\t\ttypeName,\n\t\tmembers\n\t});\n}\n/**\n* `native_enum`'s entity-type factory output, checked separately from the assembled\n* `postgresAuthoringEntityTypes` map below: `deriveValueSet` is SQL-family surface\n* ({@link SqlValueSetDerivingEntityTypeOutput}), not part of the framework\n* `AuthoringEntityTypeFactoryOutput` shape, so folding it directly into the map's single\n* `satisfies AuthoringEntityTypeNamespace` check would trip an excess-property error. Checking it\n* here against the intersection of both shapes keeps it structurally valid against each without\n* widening the map's own check.\n*/\nconst nativeEnumEntityTypeOutput = {\n\tfactory: lowerNativeEnumFromBlock,\n\tderiveValueSet: (entity) => ({\n\t\tkind: \"valueSet\",\n\t\tvalues: [...entity.members]\n\t})\n};\n/**\n* Lowers a `role <name> {}` block into a {@link PostgresRole}. Roles are\n* cluster-scoped in Postgres, so the block must be declared inside\n* `namespace unbound { … }` — any other lexical namespace (a named schema,\n* or the default bucket top-level declarations resolve to) is a load-time\n* diagnostic. The lowered entity carries the unbound coordinate.\n*/\nfunction lowerRoleFromBlock(block, ctx) {\n\tif (block.namespaceId !== UNBOUND_NAMESPACE_ID) {\n\t\tctx.diagnostics?.push({\n\t\t\tcode: PSL_ROLE_BLOCK_OUTSIDE_UNBOUND_NAMESPACE,\n\t\t\tmessage: `\\`role\\` block \"${block.name}\" must be declared inside \\`namespace unbound { }\\`, not in namespace \"${block.namespaceId}\"`,\n\t\t\tsourceId: ctx.sourceId ?? \"unknown\",\n\t\t\tspan: block.span\n\t\t});\n\t\treturn;\n\t}\n\treturn new PostgresRole({\n\t\tname: block.name,\n\t\tnamespaceId: UNBOUND_NAMESPACE_ID\n\t});\n}\nconst postgresAuthoringEntityTypes = {\n\trole: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"role\",\n\t\tvalidatorSchema: PostgresRoleSchema,\n\t\toutput: { factory: lowerRoleFromBlock }\n\t},\n\trls: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"rls\",\n\t\tvalidatorSchema: PostgresRlsEnablementSchema,\n\t\toutput: { factory: (input) => new PostgresRlsEnablement(input) }\n\t},\n\tpolicy: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"policy\",\n\t\tvalidatorSchema: PostgresRlsPolicySchema,\n\t\toutput: { factory: lowerRlsPolicyFromBlock }\n\t},\n\tnative_enum: {\n\t\tkind: \"entity\",\n\t\tdiscriminator: \"native_enum\",\n\t\tvalidatorSchema: PostgresNativeEnumSchema,\n\t\toutput: nativeEnumEntityTypeOutput\n\t}\n};\n/**\n* Field presets contributed by the Postgres target pack.\n*\n* These mirror the PSL scalar-to-codec mapping used by the Postgres adapter\n* (see `createPostgresPslScalarTypeDescriptors`), so that authoring a field\n* via the TS callback surface (e.g. `field.int()`) and via the PSL scalar\n* surface (e.g. `Int`) lowers to byte-identical contracts.\n*\n* The `uuidNative` / `id.uuidv4Native` / `id.uuidv7Native` presets use the\n* native Postgres `uuid` type (codecId `pg/uuid@1`). For cross-target\n* portability use `uuidString` / `id.uuidv4String` / `id.uuidv7String` from\n* the family pack instead.\n*/\n/**\n* Shared parameter descriptors for the five `policy_<op>` PSL block\n* keywords. All five share the `policy` discriminator — the parser\n* dispatches by keyword (see the framework's PSL-block SPI), and every\n* keyword's factory lowers to `PostgresRlsPolicy` via `lowerRlsPolicyFromBlock`.\n*\n* The `roles` list uses `scope:'cross-space'` because same-namespace\n* role ref resolution requires PSL namespace entries keyed by `refKind`\n* (i.e. `'role'`), which in turn requires the role block discriminator to\n* equal `'role'`. Aligning discriminator with refKind is tracked for\n* slice 4 (cross-space roles). Until then cross-space passes validation\n* unconditionally and the authored role names flow through unchanged.\n*/\nconst policyTargetParam = {\n\tkind: \"ref\",\n\trefKind: \"model\",\n\tscope: \"same-namespace\",\n\trequired: true\n};\nconst policyRolesParam = {\n\tkind: \"list\",\n\tof: {\n\t\tkind: \"ref\",\n\t\trefKind: \"role\",\n\t\tscope: \"cross-space\"\n\t}\n};\nconst policyPredicateParam = {\n\tkind: \"value\",\n\tcodecId: \"pg/text@1\",\n\trequired: true\n};\nconst policyPermissiveParam = {\n\tkind: \"value\",\n\tcodecId: \"pg/bool@1\"\n};\nconst policyRequiresRls = {\n\tparameter: \"target\",\n\tattribute: \"rls\"\n};\nconst policyMapAttribute = blockAttribute(\"map\", {\n\tpositional: [{\n\t\tkey: \"name\",\n\t\ttype: str()\n\t}],\n\trefine: (parsed, ctx, attributeNode) => parsed.name === \"\" ? [leafDiagnostic(ctx, attributeNode, \"@@map policy name must be a non-empty string\", PSL_POLICY_INVALID_MAP)] : []\n});\nconst policyBlockAttributes = { map: () => policyMapAttribute };\nconst nativeEnumMapAttribute = blockAttribute(\"map\", { positional: [{\n\tkey: \"name\",\n\ttype: str()\n}] });\nconst postgresAuthoringPslBlockDescriptors = {\n\tpolicy_select: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: \"policy_select\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tparameters: {\n\t\t\ttarget: policyTargetParam,\n\t\t\troles: policyRolesParam,\n\t\t\tusing: policyPredicateParam,\n\t\t\tpermissive: policyPermissiveParam\n\t\t},\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\tpolicy_delete: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: \"policy_delete\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tparameters: {\n\t\t\ttarget: policyTargetParam,\n\t\t\troles: policyRolesParam,\n\t\t\tusing: policyPredicateParam,\n\t\t\tpermissive: policyPermissiveParam\n\t\t},\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\tpolicy_insert: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: \"policy_insert\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tparameters: {\n\t\t\ttarget: policyTargetParam,\n\t\t\troles: policyRolesParam,\n\t\t\twithCheck: policyPredicateParam,\n\t\t\tpermissive: policyPermissiveParam\n\t\t},\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\tpolicy_update: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: \"policy_update\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tparameters: {\n\t\t\ttarget: policyTargetParam,\n\t\t\troles: policyRolesParam,\n\t\t\tusing: policyPredicateParam,\n\t\t\twithCheck: policyPredicateParam,\n\t\t\tpermissive: policyPermissiveParam\n\t\t},\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\tpolicy_all: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: \"policy_all\",\n\t\tdiscriminator: \"policy\",\n\t\tname: { required: true },\n\t\tparameters: {\n\t\t\ttarget: policyTargetParam,\n\t\t\troles: policyRolesParam,\n\t\t\tusing: policyPredicateParam,\n\t\t\twithCheck: policyPredicateParam,\n\t\t\tpermissive: policyPermissiveParam\n\t\t},\n\t\trequiresModelAttribute: policyRequiresRls,\n\t\tattributes: policyBlockAttributes\n\t},\n\t/**\n\t* PSL block descriptor for `native_enum`.\n\t*\n\t* Reuses the existing variadic-block mechanism (the same shape the SQL\n\t* family's `enum` block ships): the body is an open `memberName = \"value\"`\n\t* list. `variadicParameters: true` opens the block to arbitrary keys\n\t* beyond the declared (empty) `parameters` set — the lowering factory\n\t* (`lowerNativeEnumFromBlock`) turns the variadic entries into ordered\n\t* members and rejects a bare (value-less) member.\n\t*/\n\tnative_enum: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: \"native_enum\",\n\t\tdiscriminator: \"native_enum\",\n\t\tname: { required: true },\n\t\tparameters: {},\n\t\tvariadicParameters: true,\n\t\tattributes: { map: () => nativeEnumMapAttribute }\n\t},\n\t/**\n\t* PSL block descriptor for `role` (e.g. `role anon {}`). Name-only, no\n\t* parameters and no body content. Declared inside `namespace unbound { }`\n\t* — see {@link lowerRoleFromBlock} for the placement check and the\n\t* coordinate the lowered entity carries.\n\t*/\n\trole: {\n\t\tkind: \"pslBlock\",\n\t\tkeyword: \"role\",\n\t\tdiscriminator: \"role\",\n\t\tname: { required: true },\n\t\tparameters: {}\n\t}\n};\nconst postgresRlsSpec = modelAttribute(\"rls\", {});\nconst postgresRlsSpecFactory = () => postgresRlsSpec;\n/**\n* `@@` model attributes contributed by the Postgres target pack.\n*\n* `@@rls` is argument-less: presence marks the model's table\n* RLS-controlled. It lowers to a {@link PostgresRlsEnablement} marker in\n* the namespace's `entries.rls`, keyed by the model's table name — the\n* marker (never the policy set) is what drives\n* `ENABLE`/`DISABLE ROW LEVEL SECURITY` planning.\n*/\nconst postgresAuthoringModelAttributes = { rls: {\n\tkind: \"modelAttribute\",\n\tattribute: \"rls\",\n\tspec: postgresRlsSpecFactory,\n\tlower: (_parsed, ctx) => ({\n\t\tkey: ctx.storageName,\n\t\tentity: new PostgresRlsEnablement({\n\t\t\ttableName: ctx.storageName,\n\t\t\tnamespaceId: ctx.namespaceId\n\t\t})\n\t})\n} };\nconst postgresAuthoringFieldPresets = {\n\ttext: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/text@1\",\n\t\t\tnativeType: \"text\"\n\t\t}\n\t},\n\tint: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int4@1\",\n\t\t\tnativeType: \"int4\"\n\t\t}\n\t},\n\tbigint: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/int8@1\",\n\t\t\tnativeType: \"int8\"\n\t\t}\n\t},\n\tfloat: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/float8@1\",\n\t\t\tnativeType: \"float8\"\n\t\t}\n\t},\n\tdecimal: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/numeric@1\",\n\t\t\tnativeType: \"numeric\"\n\t\t}\n\t},\n\tboolean: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/bool@1\",\n\t\t\tnativeType: \"bool\"\n\t\t}\n\t},\n\tjson: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/jsonb@1\",\n\t\t\tnativeType: \"jsonb\"\n\t\t}\n\t},\n\tbytes: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/bytea@1\",\n\t\t\tnativeType: \"bytea\"\n\t\t}\n\t},\n\tdateTime: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/timestamptz-temporal@1\",\n\t\t\tnativeType: \"timestamptz\"\n\t\t}\n\t},\n\ttemporal: {\n\t\t.../* @__PURE__ */ temporalAuthoringPresets({\n\t\t\tcodecId: \"pg/timestamptz-temporal@1\",\n\t\t\tnativeType: \"timestamptz\",\n\t\t\tgeneratorId: INSTANT_NOW_GENERATOR_ID\n\t\t}),\n\t\t.../* @__PURE__ */ temporalStringAuthoringPresets({\n\t\t\tcodecId: \"pg/timestamptz-string@1\",\n\t\t\tnativeType: \"timestamptz\"\n\t\t}),\n\t\ttimestamp: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: \"pg/timestamp-temporal@1\",\n\t\t\tnativeType: \"timestamp\",\n\t\t\tgeneratorId: INSTANT_NOW_GENERATOR_ID\n\t\t}),\n\t\ttimestamptz: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: \"pg/timestamptz-temporal@1\",\n\t\t\tnativeType: \"timestamptz\",\n\t\t\tgeneratorId: INSTANT_NOW_GENERATOR_ID\n\t\t}),\n\t\ttimestampString: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: \"pg/timestamp-string@1\",\n\t\t\tnativeType: \"timestamp\"\n\t\t}),\n\t\ttimestamptzString: /* @__PURE__ */ temporalCodecPresetWithPrecision({\n\t\t\tcodecId: \"pg/timestamptz-string@1\",\n\t\t\tnativeType: \"timestamptz\"\n\t\t})\n\t},\n\tuuidNative: {\n\t\tkind: \"fieldPreset\",\n\t\toutput: {\n\t\t\tcodecId: \"pg/uuid@1\",\n\t\t\tnativeType: \"uuid\"\n\t\t}\n\t},\n\tid: {\n\t\tuuidv4Native: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: \"pg/uuid@1\",\n\t\t\t\tnativeType: \"uuid\",\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv4\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t},\n\t\tuuidv7Native: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\tcodecId: \"pg/uuid@1\",\n\t\t\t\tnativeType: \"uuid\",\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: \"uuidv7\"\n\t\t\t\t} },\n\t\t\t\tid: true\n\t\t\t}\n\t\t}\n\t}\n};\n/**\n* Resolves an entity handle's `target` ref to a table coordinate of this\n* contract, or throws the load-time diagnostic naming the handle: a\n* cross-space target is rejected (you cannot CREATE POLICY on a table\n* another space owns) and an unresolved target names the model.\n*/\nfunction requireLocalTarget(refs, subject) {\n\tconst target = refs[\"target\"];\n\tif (target !== void 0 && target.kind === \"resolved\") return {\n\t\tnamespaceId: target.namespaceId,\n\t\ttableName: target.tableName\n\t};\n\tif (target !== void 0 && target.kind === \"cross-space\") throw postgresError(\"CONTRACT.POLICY_INVALID\", `defineContract: ${subject} targets model \"${target.modelName ?? target.tableName}\", which lives in another contract space. Policies and rlsEnabled entries must target a model declared in this contract.`, { meta: {\n\t\tmodel: target.modelName ?? target.tableName,\n\t\treason: \"cross-space-target\"\n\t} });\n\tthrow postgresError(\"CONTRACT.MODEL_UNKNOWN\", `defineContract: ${subject} targets model \"${target?.modelName ?? \"<anonymous>\"}\", which is not in the contract's models. Add the model to \\`models\\`.`, { meta: { model: target?.modelName ?? \"<anonymous>\" } });\n}\n/**\n* The SQL-family entity-handle batch lowering hook for the Postgres pack\n* (`SqlEntityHandleLoweringContribution`). Receives every `entities` handle\n* whose kind this pack registered — batch, so the cross-entity diagnostics\n* (duplicate prefix, policy without rlsEnabled, duplicate role) can see\n* sibling handles — and lowers them with the same keying and hash assembly\n* as the PSL path: `policy` keyed by prefix (wire name via\n* {@link buildRlsPolicyEntity}), `rls` keyed by table name, `role` keyed by\n* name and filed under the default namespace (roles are declared\n* contract-wide; PSL has no role block to set a precedent).\n*/\nfunction postgresLowerEntityHandles(input) {\n\tconst enablements = /* @__PURE__ */ new Map();\n\tconst roles = /* @__PURE__ */ new Map();\n\tconst policies = [];\n\tconst coordinateKey = (coordinate) => `${coordinate.namespaceId} ${coordinate.tableName}`;\n\tfor (const { handle, refs } of input.handles) switch (handle.entityKind) {\n\t\tcase \"rls\": {\n\t\t\tconst coordinate = requireLocalTarget(refs, \"an rlsEnabled entry\");\n\t\t\tconst key = coordinateKey(coordinate);\n\t\t\tif (!enablements.has(key)) enablements.set(key, {\n\t\t\t\tcoordinate,\n\t\t\t\tentity: new PostgresRlsEnablement({\n\t\t\t\t\ttableName: coordinate.tableName,\n\t\t\t\t\tnamespaceId: coordinate.namespaceId\n\t\t\t\t})\n\t\t\t});\n\t\t\tbreak;\n\t\t}\n\t\tcase \"role\": {\n\t\t\tconst roleHandle = blindCast(handle);\n\t\t\tif (roles.has(roleHandle.name)) throw postgresError(\"CONTRACT.ROLE_INVALID\", `defineContract: role \"${roleHandle.name}\" is declared more than once in the entities list.`, { meta: {\n\t\t\t\trole: roleHandle.name,\n\t\t\t\treason: \"duplicate\"\n\t\t\t} });\n\t\t\troles.set(roleHandle.name, new PostgresRole({\n\t\t\t\tname: roleHandle.name,\n\t\t\t\tnamespaceId: UNBOUND_NAMESPACE_ID\n\t\t\t}));\n\t\t\tbreak;\n\t\t}\n\t\tcase \"policy\": {\n\t\t\tconst policyHandle = blindCast(handle);\n\t\t\tpolicies.push({\n\t\t\t\thandle: policyHandle,\n\t\t\t\trefs\n\t\t\t});\n\t\t\tbreak;\n\t\t}\n\t\tdefault: throw postgresError(\"CONTRACT.ENTITY_KIND_INVALID\", `defineContract: the postgres pack does not lower \"${handle.entityKind}\" handles from the entities list.`, { meta: { entityKind: handle.entityKind } });\n\t}\n\tconst rows = [];\n\tconst seenPrefixes = /* @__PURE__ */ new Set();\n\tfor (const { handle: policy, refs } of policies) {\n\t\tconst prefix = policy.name;\n\t\tassertWireNamePrefixLength(prefix, \"defineContract: policy prefix\");\n\t\tconst coordinate = requireLocalTarget(refs, `policy \"${prefix}\"`);\n\t\tif (!enablements.has(coordinateKey(coordinate))) {\n\t\t\tconst target = refs[\"target\"];\n\t\t\tthrow postgresError(\"CONTRACT.POLICY_INVALID\", `defineContract: policy \"${prefix}\" targets model \"${target?.modelName ?? coordinate.tableName}\", whose table is not RLS-enabled. Add rlsEnabled(<model>) to the entities list.`, { meta: {\n\t\t\t\tprefix,\n\t\t\t\tmodel: target?.modelName ?? coordinate.tableName,\n\t\t\t\treason: \"target-not-rls-enabled\"\n\t\t\t} });\n\t\t}\n\t\tconst prefixKey = `${coordinate.namespaceId} ${prefix}`;\n\t\tif (seenPrefixes.has(prefixKey)) throw postgresError(\"CONTRACT.POLICY_INVALID\", `defineContract: policy prefix \"${prefix}\" is declared more than once in namespace \"${coordinate.namespaceId}\". Policy prefixes must be unique per namespace.`, { meta: {\n\t\t\tprefix,\n\t\t\tnamespaceId: coordinate.namespaceId,\n\t\t\treason: \"duplicate-prefix\"\n\t\t} });\n\t\tseenPrefixes.add(prefixKey);\n\t\tconst roleNames = [...new Set(policy.roles.map((roleHandle) => roleHandle.name))].sort();\n\t\trows.push({\n\t\t\tnamespaceId: coordinate.namespaceId,\n\t\t\tentityKind: \"policy\",\n\t\t\tkey: prefix,\n\t\t\tentity: buildRlsPolicyEntity({\n\t\t\t\tprefix,\n\t\t\t\ttableName: coordinate.tableName,\n\t\t\t\tnamespaceId: coordinate.namespaceId,\n\t\t\t\toperation: policy.operation,\n\t\t\t\troles: roleNames,\n\t\t\t\t...ifDefined(\"using\", policy.using),\n\t\t\t\t...ifDefined(\"withCheck\", policy.withCheck)\n\t\t\t})\n\t\t});\n\t}\n\tfor (const { coordinate, entity } of enablements.values()) rows.push({\n\t\tnamespaceId: coordinate.namespaceId,\n\t\tentityKind: \"rls\",\n\t\tkey: coordinate.tableName,\n\t\tentity\n\t});\n\tfor (const [name, entity] of roles) rows.push({\n\t\tnamespaceId: UNBOUND_NAMESPACE_ID,\n\t\tentityKind: \"role\",\n\t\tkey: name,\n\t\tentity\n\t});\n\treturn rows;\n}\n//#endregion\nexport { postgresAuthoringTypes as a, instantNow as c, postgresAuthoringPslBlockDescriptors as i, instantNowControlDescriptor as l, postgresAuthoringFieldPresets as n, postgresLowerEntityHandles as o, postgresAuthoringModelAttributes as r, INSTANT_NOW_GENERATOR_ID as s, postgresAuthoringEntityTypes as t };\n\n//# sourceMappingURL=authoring-Dm1jBKhq.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,MAAM,2BAA2B;AACjC,SAAS,8BAA8B;CACtC,OAAO;EACN,IAAI;EACJ,oBAAoB;GACnB,UAAU;IACT,MAAM;IACN,IAAI;GACL;GACA,UAAU;IACT,MAAM;IACN,IAAI;GACL;EACD;CACD;AACD;AACA,SAAS,aAAa;CACrB,IAAI,OAAO,aAAa,aAAa,MAAM,mCAAmC,wBAAwB;CACtG,OAAO,SAAS,IAAI,QAAQ;AAC7B;AAGA,MAAM,sCAAsC;AAC5C,MAAM,yBAAyB;AAC/B,MAAM,8BAA8B;AACpC,MAAM,8BAA8B;AACpC,MAAM,yCAAyC;AAC/C,MAAM,kCAAkC;AACxC,MAAM,2CAA2C;;;;;;;;;AASjD,MAAM,yBAAyB;CAC9B,cAAc;EACb,MAAM;EACN,QAAQ;GACP,SAAS;GACT,YAAY;EACb;C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IAAI,aAAa,IAAI,SAAS,GAAG,MAAM,cAAc,2BAA2B,kCAAkC,OAAO,6CAA6C,WAAW,YAAY,mDAAmD,EAAE,MAAM;GACvP;GACA,aAAa,WAAW;GACxB,QAAQ;EACT,EAAE,CAAC;EACH,aAAa,IAAI,SAAS;EAC1B,MAAM,YAAY,CAAC,GAAG,IAAI,IAAI,OAAO,MAAM,KAAK,eAAe,WAAW,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK;EACvF,KAAK,KAAK;GACT,aAAa,WAAW;GACxB,YAAY;GACZ,KAAK;GACL,QAAQ,qBAAqB;IAC5B;IACA,WAAW,WAAW;IACtB,aAAa,WAAW;IACxB,WAAW,OAAO;IAClB,OAAO;IACP,GAAG,UAAU,SAAS,OAAO,KAAK;IAClC,GAAG,UAAU,aAAa,OAAO,SAAS;GAC3C,CAAC;EACF,CAAC;CACF;CACA,KAAK,MAAM,EAAE,YAAY,YAAY,YAAY,OAAO,GAAG,KAAK,KAAK;EACpE,aAAa,WAAW;EACxB,YAAY;EACZ,KAAK,WAAW;EAChB;CACD,CAAC;CACD,KAAK,MAAM,CAAC,MAAM,WAAW,OAAO,KAAK,KAAK;EAC7C,aAAa;EACb,YAAY;EACZ,KAAK;EACL;CACD,CAAC;CACD,OAAO;AACR"}
|
package/dist/{check-expressions-DRgG8RN5-DiA-22aC.d.mts → check-expressions-D4R7JhiZ-q-dFPGT2.d.mts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CheckKind } from "@prisma/orm-family-sql/schema-ir/naming";
|
|
2
|
-
//#region ../../../3-targets/3-targets/postgres/dist/check-expressions-
|
|
2
|
+
//#region ../../../3-targets/3-targets/postgres/dist/check-expressions-D4R7JhiZ.d.mts
|
|
3
3
|
//#region src/core/check-expressions.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* What a rendered check enforces. The contract builder turns this into the
|
|
@@ -18,7 +18,7 @@ interface PostgresCheckExpressionInput {
|
|
|
18
18
|
readonly tableName: string;
|
|
19
19
|
readonly columnName: string;
|
|
20
20
|
readonly many: boolean;
|
|
21
|
-
readonly memberValues: readonly string[] | undefined;
|
|
21
|
+
readonly memberValues: readonly (string | number)[] | undefined;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* A check the target wants written. The target contributes only what it
|
|
@@ -36,19 +36,17 @@ interface PostgresCheckExpressionCandidate {
|
|
|
36
36
|
/**
|
|
37
37
|
* Renders the checks a Postgres column needs, as opaque predicate text.
|
|
38
38
|
*
|
|
39
|
-
* A
|
|
39
|
+
* A domain enum has no type-level enforcement, so membership is a
|
|
40
40
|
* predicate: `IN` for a scalar, and `<@` containment for an array — an array
|
|
41
41
|
* column cannot use `IN` at all (`operator does not exist: text[] = text`),
|
|
42
42
|
* and containment additionally rejects NULL elements. Every list column also
|
|
43
43
|
* gets an element-non-null check, which no Postgres column type can express.
|
|
44
44
|
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* `operator does not exist` this project exists to eliminate. The scalar `IN`
|
|
49
|
-
* form needs no cast — `varchar = text` resolves on its own.
|
|
45
|
+
* Array containment casts both operands to `numeric[]` for numeric members or
|
|
46
|
+
* `text[]` for string members, so different storage types share an operator
|
|
47
|
+
* without comparing numbers as text. The scalar `IN` form needs no cast.
|
|
50
48
|
*/
|
|
51
49
|
declare function postgresRenderCheckExpressions(input: PostgresCheckExpressionInput): readonly PostgresCheckExpressionCandidate[];
|
|
52
50
|
//#endregion
|
|
53
51
|
export { postgresRenderCheckExpressions as i, PostgresCheckExpressionInput as n, PostgresCheckKind as r, PostgresCheckExpressionCandidate as t };
|
|
54
|
-
//# sourceMappingURL=check-expressions-
|
|
52
|
+
//# sourceMappingURL=check-expressions-D4R7JhiZ-q-dFPGT2.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-expressions-D4R7JhiZ-q-dFPGT2.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/check-expressions-D4R7JhiZ.d.mts"],"mappings":";;;;;;;;;KAQK,oBAAoB;;;;;;;UAOf;WACC;WACA;WACA;WACA;;;;;;;;UAQD;WACC,MAAM;;WAEN;;WAEA;;;;;;;;;;;;;;;iBAeM,+BAA+B,OAAO,wCAAwC"}
|
package/dist/{check-expressions-5vhxWaFy-CBcjFeur.mjs → check-expressions-DFTeR0rd-CSxSpyMV.mjs}
RENAMED
|
@@ -1,31 +1,34 @@
|
|
|
1
|
-
import { r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-
|
|
1
|
+
import { r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-6j9YTLpr-BCyCBPBg.mjs";
|
|
2
2
|
import { invariant } from "@prisma/orm-framework/utils/assertions";
|
|
3
|
-
//#region ../../../3-targets/3-targets/postgres/dist/check-expressions-
|
|
3
|
+
//#region ../../../3-targets/3-targets/postgres/dist/check-expressions-DFTeR0rd.mjs
|
|
4
4
|
/**
|
|
5
5
|
* Renders the checks a Postgres column needs, as opaque predicate text.
|
|
6
6
|
*
|
|
7
|
-
* A
|
|
7
|
+
* A domain enum has no type-level enforcement, so membership is a
|
|
8
8
|
* predicate: `IN` for a scalar, and `<@` containment for an array — an array
|
|
9
9
|
* column cannot use `IN` at all (`operator does not exist: text[] = text`),
|
|
10
10
|
* and containment additionally rejects NULL elements. Every list column also
|
|
11
11
|
* gets an element-non-null check, which no Postgres column type can express.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* `operator does not exist` this project exists to eliminate. The scalar `IN`
|
|
17
|
-
* form needs no cast — `varchar = text` resolves on its own.
|
|
13
|
+
* Array containment casts both operands to `numeric[]` for numeric members or
|
|
14
|
+
* `text[]` for string members, so different storage types share an operator
|
|
15
|
+
* without comparing numbers as text. The scalar `IN` form needs no cast.
|
|
18
16
|
*/
|
|
19
17
|
function postgresRenderCheckExpressions(input) {
|
|
20
18
|
const candidates = [];
|
|
21
19
|
const column = quoteIdentifier(input.columnName);
|
|
22
20
|
if (input.memberValues !== void 0) {
|
|
23
21
|
invariant(input.memberValues.length > 0, `check for "${input.tableName}"."${input.columnName}": empty member set; both authoring surfaces reject a member-less enum before rendering`);
|
|
24
|
-
const members = input.memberValues.map((value) =>
|
|
22
|
+
const members = input.memberValues.map((value) => {
|
|
23
|
+
if (typeof value === "string") return `'${escapeLiteral(value)}'`;
|
|
24
|
+
invariant(Number.isFinite(value), `check for "${input.tableName}"."${input.columnName}": non-finite numeric member`);
|
|
25
|
+
return String(value);
|
|
26
|
+
}).join(", ");
|
|
27
|
+
const arrayType = input.memberValues.every((value) => typeof value === "number") ? "numeric[]" : "text[]";
|
|
25
28
|
candidates.push({
|
|
26
29
|
kind: "membership",
|
|
27
30
|
columnName: input.columnName,
|
|
28
|
-
expression: input.many ? `${column}
|
|
31
|
+
expression: input.many ? `${column}::${arrayType} <@ ARRAY[${members}]::${arrayType}` : `${column} IN (${members})`
|
|
29
32
|
});
|
|
30
33
|
}
|
|
31
34
|
if (input.many) candidates.push({
|
|
@@ -38,4 +41,4 @@ function postgresRenderCheckExpressions(input) {
|
|
|
38
41
|
//#endregion
|
|
39
42
|
export { postgresRenderCheckExpressions as t };
|
|
40
43
|
|
|
41
|
-
//# sourceMappingURL=check-expressions-
|
|
44
|
+
//# sourceMappingURL=check-expressions-DFTeR0rd-CSxSpyMV.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-expressions-DFTeR0rd-CSxSpyMV.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/check-expressions-DFTeR0rd.mjs"],"sourcesContent":["import { r as quoteIdentifier, t as escapeLiteral } from \"./sql-utils-6j9YTLpr.mjs\";\nimport { invariant } from \"@internal/utils/assertions\";\n//#region src/core/check-expressions.ts\n/**\n* Renders the checks a Postgres column needs, as opaque predicate text.\n*\n* A domain enum has no type-level enforcement, so membership is a\n* predicate: `IN` for a scalar, and `<@` containment for an array — an array\n* column cannot use `IN` at all (`operator does not exist: text[] = text`),\n* and containment additionally rejects NULL elements. Every list column also\n* gets an element-non-null check, which no Postgres column type can express.\n*\n* Array containment casts both operands to `numeric[]` for numeric members or\n* `text[]` for string members, so different storage types share an operator\n* without comparing numbers as text. The scalar `IN` form needs no cast.\n*/\nfunction postgresRenderCheckExpressions(input) {\n\tconst candidates = [];\n\tconst column = quoteIdentifier(input.columnName);\n\tif (input.memberValues !== void 0) {\n\t\tinvariant(input.memberValues.length > 0, `check for \"${input.tableName}\".\"${input.columnName}\": empty member set; both authoring surfaces reject a member-less enum before rendering`);\n\t\tconst members = input.memberValues.map((value) => {\n\t\t\tif (typeof value === \"string\") return `'${escapeLiteral(value)}'`;\n\t\t\tinvariant(Number.isFinite(value), `check for \"${input.tableName}\".\"${input.columnName}\": non-finite numeric member`);\n\t\t\treturn String(value);\n\t\t}).join(\", \");\n\t\tconst arrayType = input.memberValues.every((value) => typeof value === \"number\") ? \"numeric[]\" : \"text[]\";\n\t\tcandidates.push({\n\t\t\tkind: \"membership\",\n\t\t\tcolumnName: input.columnName,\n\t\t\texpression: input.many ? `${column}::${arrayType} <@ ARRAY[${members}]::${arrayType}` : `${column} IN (${members})`\n\t\t});\n\t}\n\tif (input.many) candidates.push({\n\t\tkind: \"elementNotNull\",\n\t\tcolumnName: input.columnName,\n\t\texpression: `array_position(${column}, NULL) IS NULL`\n\t});\n\treturn candidates;\n}\n//#endregion\nexport { postgresRenderCheckExpressions as t };\n\n//# sourceMappingURL=check-expressions-DFTeR0rd.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAS,+BAA+B,OAAO;CAC9C,MAAM,aAAa,CAAC;CACpB,MAAM,SAAS,gBAAgB,MAAM,UAAU;CAC/C,IAAI,MAAM,iBAAiB,KAAK,GAAG;EAClC,UAAU,MAAM,aAAa,SAAS,GAAG,cAAc,MAAM,UAAU,KAAK,MAAM,WAAW,wFAAwF;EACrL,MAAM,UAAU,MAAM,aAAa,KAAK,UAAU;GACjD,IAAI,OAAO,UAAU,UAAU,OAAO,IAAI,cAAc,KAAK,EAAE;GAC/D,UAAU,OAAO,SAAS,KAAK,GAAG,cAAc,MAAM,UAAU,KAAK,MAAM,WAAW,6BAA6B;GACnH,OAAO,OAAO,KAAK;EACpB,CAAC,CAAC,CAAC,KAAK,IAAI;EACZ,MAAM,YAAY,MAAM,aAAa,OAAO,UAAU,OAAO,UAAU,QAAQ,IAAI,cAAc;EACjG,WAAW,KAAK;GACf,MAAM;GACN,YAAY,MAAM;GAClB,YAAY,MAAM,OAAO,GAAG,OAAO,IAAI,UAAU,YAAY,QAAQ,KAAK,cAAc,GAAG,OAAO,OAAO,QAAQ;EAClH,CAAC;CACF;CACA,IAAI,MAAM,MAAM,WAAW,KAAK;EAC/B,MAAM;EACN,YAAY,MAAM;EAClB,YAAY,kBAAkB,OAAO;CACtC,CAAC;CACD,OAAO;AACR"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID } from "@prisma/orm-family-sql/relational-core/ast";
|
|
2
|
+
//#region ../../../3-targets/3-targets/postgres/dist/codec-ids-CmcC76hX.d.mts
|
|
3
|
+
//#region src/core/codec-ids.d.ts
|
|
4
|
+
declare const PG_TEXT_CODEC_ID: "pg/text@1";
|
|
5
|
+
declare const PG_TEXT_ARRAY_CODEC_ID: "pg/text-array@1";
|
|
6
|
+
declare const PG_ENUM_CODEC_ID: "pg/enum@1";
|
|
7
|
+
declare const PG_CHAR_CODEC_ID: "pg/char@1";
|
|
8
|
+
declare const PG_VARCHAR_CODEC_ID: "pg/varchar@1";
|
|
9
|
+
declare const PG_INT_CODEC_ID: "pg/int@1";
|
|
10
|
+
declare const PG_INT2_CODEC_ID: "pg/int2@1";
|
|
11
|
+
declare const PG_INT4_CODEC_ID: "pg/int4@1";
|
|
12
|
+
declare const PG_INT8_CODEC_ID: "pg/int8@1";
|
|
13
|
+
declare const PG_INT8_NUMBER_CODEC_ID: "pg/int8number@1";
|
|
14
|
+
declare const PG_FLOAT_CODEC_ID: "pg/float@1";
|
|
15
|
+
declare const PG_FLOAT4_CODEC_ID: "pg/float4@1";
|
|
16
|
+
declare const PG_FLOAT8_CODEC_ID: "pg/float8@1";
|
|
17
|
+
declare const PG_NUMERIC_CODEC_ID: "pg/numeric@1";
|
|
18
|
+
declare const PG_UNBOUNDED_INT_CODEC_ID: "pg/unboundedint@1";
|
|
19
|
+
declare const PG_BOOL_CODEC_ID: "pg/bool@1";
|
|
20
|
+
declare const PG_BIT_CODEC_ID: "pg/bit@1";
|
|
21
|
+
declare const PG_VARBIT_CODEC_ID: "pg/varbit@1";
|
|
22
|
+
declare const PG_DATE_TEMPORAL_CODEC_ID: "pg/date-temporal@1";
|
|
23
|
+
declare const PG_TIMESTAMP_TEMPORAL_CODEC_ID: "pg/timestamp-temporal@1";
|
|
24
|
+
declare const PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID: "pg/timestamptz-temporal@1";
|
|
25
|
+
declare const PG_TIME_TEMPORAL_CODEC_ID: "pg/time-temporal@1";
|
|
26
|
+
declare const PG_DATE_STRING_CODEC_ID: "pg/date-string@1";
|
|
27
|
+
declare const PG_TIMESTAMP_STRING_CODEC_ID: "pg/timestamp-string@1";
|
|
28
|
+
declare const PG_TIMESTAMPTZ_STRING_CODEC_ID: "pg/timestamptz-string@1";
|
|
29
|
+
declare const PG_TIME_STRING_CODEC_ID: "pg/time-string@1";
|
|
30
|
+
declare const PG_TIMETZ_CODEC_ID: "pg/timetz@1";
|
|
31
|
+
declare const PG_INTERVAL_CODEC_ID: "pg/interval@1";
|
|
32
|
+
declare const PG_JSON_CODEC_ID: "pg/json@1";
|
|
33
|
+
declare const PG_JSONB_CODEC_ID: "pg/jsonb@1";
|
|
34
|
+
declare const PG_BYTEA_CODEC_ID: "pg/bytea@1";
|
|
35
|
+
declare const PG_UUID_CODEC_ID: "pg/uuid@1";
|
|
36
|
+
declare const PG_INET_CODEC_ID: "pg/inet@1";
|
|
37
|
+
//#endregion
|
|
38
|
+
export { PG_UNBOUNDED_INT_CODEC_ID as A, PG_TIMESTAMPTZ_STRING_CODEC_ID as C, PG_TIMETZ_CODEC_ID as D, PG_TIMESTAMP_TEMPORAL_CODEC_ID as E, SQL_FLOAT_CODEC_ID as F, SQL_INT_CODEC_ID as I, SQL_TEXT_CODEC_ID as L, PG_VARBIT_CODEC_ID as M, PG_VARCHAR_CODEC_ID as N, PG_TIME_STRING_CODEC_ID as O, SQL_CHAR_CODEC_ID as P, SQL_VARCHAR_CODEC_ID as R, PG_TEXT_CODEC_ID as S, PG_TIMESTAMP_STRING_CODEC_ID as T, PG_INT_CODEC_ID as _, PG_DATE_STRING_CODEC_ID as a, PG_NUMERIC_CODEC_ID as b, PG_FLOAT4_CODEC_ID as c, PG_INET_CODEC_ID as d, PG_INT2_CODEC_ID as f, PG_INTERVAL_CODEC_ID as g, PG_INT8_NUMBER_CODEC_ID as h, PG_CHAR_CODEC_ID as i, PG_UUID_CODEC_ID as j, PG_TIME_TEMPORAL_CODEC_ID as k, PG_FLOAT8_CODEC_ID as l, PG_INT8_CODEC_ID as m, PG_BOOL_CODEC_ID as n, PG_DATE_TEMPORAL_CODEC_ID as o, PG_INT4_CODEC_ID as p, PG_BYTEA_CODEC_ID as r, PG_ENUM_CODEC_ID as s, PG_BIT_CODEC_ID as t, PG_FLOAT_CODEC_ID as u, PG_JSONB_CODEC_ID as v, PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID as w, PG_TEXT_ARRAY_CODEC_ID as x, PG_JSON_CODEC_ID as y };
|
|
39
|
+
//# sourceMappingURL=codec-ids-CmcC76hX-C0JIyoua.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-ids-CmcC76hX-C0JIyoua.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/codec-ids-CmcC76hX.d.mts"],"mappings":";;;cAEc;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID } from "@prisma/orm-family-sql/relational-core/ast";
|
|
2
|
+
//#region ../../../3-targets/3-targets/postgres/dist/codec-ids-D3ZEAmt2.mjs
|
|
3
|
+
const PG_TEXT_CODEC_ID = "pg/text@1";
|
|
4
|
+
const PG_TEXT_ARRAY_CODEC_ID = "pg/text-array@1";
|
|
5
|
+
const PG_ENUM_CODEC_ID = "pg/enum@1";
|
|
6
|
+
const PG_CHAR_CODEC_ID = "pg/char@1";
|
|
7
|
+
const PG_VARCHAR_CODEC_ID = "pg/varchar@1";
|
|
8
|
+
const PG_INT_CODEC_ID = "pg/int@1";
|
|
9
|
+
const PG_INT2_CODEC_ID = "pg/int2@1";
|
|
10
|
+
const PG_INT4_CODEC_ID = "pg/int4@1";
|
|
11
|
+
const PG_INT8_CODEC_ID = "pg/int8@1";
|
|
12
|
+
const PG_INT8_NUMBER_CODEC_ID = "pg/int8number@1";
|
|
13
|
+
const PG_FLOAT_CODEC_ID = "pg/float@1";
|
|
14
|
+
const PG_FLOAT4_CODEC_ID = "pg/float4@1";
|
|
15
|
+
const PG_FLOAT8_CODEC_ID = "pg/float8@1";
|
|
16
|
+
const PG_NUMERIC_CODEC_ID = "pg/numeric@1";
|
|
17
|
+
const PG_UNBOUNDED_INT_CODEC_ID = "pg/unboundedint@1";
|
|
18
|
+
const PG_BOOL_CODEC_ID = "pg/bool@1";
|
|
19
|
+
const PG_BIT_CODEC_ID = "pg/bit@1";
|
|
20
|
+
const PG_VARBIT_CODEC_ID = "pg/varbit@1";
|
|
21
|
+
const PG_DATE_TEMPORAL_CODEC_ID = "pg/date-temporal@1";
|
|
22
|
+
const PG_TIMESTAMP_TEMPORAL_CODEC_ID = "pg/timestamp-temporal@1";
|
|
23
|
+
const PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID = "pg/timestamptz-temporal@1";
|
|
24
|
+
const PG_TIME_TEMPORAL_CODEC_ID = "pg/time-temporal@1";
|
|
25
|
+
const PG_DATE_STRING_CODEC_ID = "pg/date-string@1";
|
|
26
|
+
const PG_TIMESTAMP_STRING_CODEC_ID = "pg/timestamp-string@1";
|
|
27
|
+
const PG_TIMESTAMPTZ_STRING_CODEC_ID = "pg/timestamptz-string@1";
|
|
28
|
+
const PG_TIME_STRING_CODEC_ID = "pg/time-string@1";
|
|
29
|
+
const PG_TIMETZ_CODEC_ID = "pg/timetz@1";
|
|
30
|
+
const PG_INTERVAL_CODEC_ID = "pg/interval@1";
|
|
31
|
+
const PG_JSON_CODEC_ID = "pg/json@1";
|
|
32
|
+
const PG_JSONB_CODEC_ID = "pg/jsonb@1";
|
|
33
|
+
const PG_BYTEA_CODEC_ID = "pg/bytea@1";
|
|
34
|
+
const PG_UUID_CODEC_ID = "pg/uuid@1";
|
|
35
|
+
const PG_INET_CODEC_ID = "pg/inet@1";
|
|
36
|
+
//#endregion
|
|
37
|
+
export { PG_UNBOUNDED_INT_CODEC_ID as A, PG_TIMESTAMPTZ_STRING_CODEC_ID as C, PG_TIMETZ_CODEC_ID as D, PG_TIMESTAMP_TEMPORAL_CODEC_ID as E, SQL_FLOAT_CODEC_ID as F, SQL_INT_CODEC_ID as I, SQL_TEXT_CODEC_ID as L, PG_VARBIT_CODEC_ID as M, PG_VARCHAR_CODEC_ID as N, PG_TIME_STRING_CODEC_ID as O, SQL_CHAR_CODEC_ID as P, SQL_VARCHAR_CODEC_ID as R, PG_TEXT_CODEC_ID as S, PG_TIMESTAMP_STRING_CODEC_ID as T, PG_INT_CODEC_ID as _, PG_DATE_STRING_CODEC_ID as a, PG_NUMERIC_CODEC_ID as b, PG_FLOAT4_CODEC_ID as c, PG_INET_CODEC_ID as d, PG_INT2_CODEC_ID as f, PG_INTERVAL_CODEC_ID as g, PG_INT8_NUMBER_CODEC_ID as h, PG_CHAR_CODEC_ID as i, PG_UUID_CODEC_ID as j, PG_TIME_TEMPORAL_CODEC_ID as k, PG_FLOAT8_CODEC_ID as l, PG_INT8_CODEC_ID as m, PG_BOOL_CODEC_ID as n, PG_DATE_TEMPORAL_CODEC_ID as o, PG_INT4_CODEC_ID as p, PG_BYTEA_CODEC_ID as r, PG_ENUM_CODEC_ID as s, PG_BIT_CODEC_ID as t, PG_FLOAT_CODEC_ID as u, PG_JSONB_CODEC_ID as v, PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID as w, PG_TEXT_ARRAY_CODEC_ID as x, PG_JSON_CODEC_ID as y };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=codec-ids-D3ZEAmt2-DjoKUAas.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-ids-D3ZEAmt2-DjoKUAas.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/codec-ids-D3ZEAmt2.mjs"],"sourcesContent":["import { SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_TEXT_CODEC_ID, SQL_VARCHAR_CODEC_ID } from \"@internal/sql-relational-core/ast\";\n//#region src/core/codec-ids.ts\nconst PG_TEXT_CODEC_ID = \"pg/text@1\";\nconst PG_TEXT_ARRAY_CODEC_ID = \"pg/text-array@1\";\nconst PG_ENUM_CODEC_ID = \"pg/enum@1\";\nconst PG_CHAR_CODEC_ID = \"pg/char@1\";\nconst PG_VARCHAR_CODEC_ID = \"pg/varchar@1\";\nconst PG_INT_CODEC_ID = \"pg/int@1\";\nconst PG_INT2_CODEC_ID = \"pg/int2@1\";\nconst PG_INT4_CODEC_ID = \"pg/int4@1\";\nconst PG_INT8_CODEC_ID = \"pg/int8@1\";\nconst PG_INT8_NUMBER_CODEC_ID = \"pg/int8number@1\";\nconst PG_FLOAT_CODEC_ID = \"pg/float@1\";\nconst PG_FLOAT4_CODEC_ID = \"pg/float4@1\";\nconst PG_FLOAT8_CODEC_ID = \"pg/float8@1\";\nconst PG_NUMERIC_CODEC_ID = \"pg/numeric@1\";\nconst PG_UNBOUNDED_INT_CODEC_ID = \"pg/unboundedint@1\";\nconst PG_BOOL_CODEC_ID = \"pg/bool@1\";\nconst PG_BIT_CODEC_ID = \"pg/bit@1\";\nconst PG_VARBIT_CODEC_ID = \"pg/varbit@1\";\nconst PG_DATE_TEMPORAL_CODEC_ID = \"pg/date-temporal@1\";\nconst PG_TIMESTAMP_TEMPORAL_CODEC_ID = \"pg/timestamp-temporal@1\";\nconst PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID = \"pg/timestamptz-temporal@1\";\nconst PG_TIME_TEMPORAL_CODEC_ID = \"pg/time-temporal@1\";\nconst PG_DATE_STRING_CODEC_ID = \"pg/date-string@1\";\nconst PG_TIMESTAMP_STRING_CODEC_ID = \"pg/timestamp-string@1\";\nconst PG_TIMESTAMPTZ_STRING_CODEC_ID = \"pg/timestamptz-string@1\";\nconst PG_TIME_STRING_CODEC_ID = \"pg/time-string@1\";\nconst PG_TIMETZ_CODEC_ID = \"pg/timetz@1\";\nconst PG_INTERVAL_CODEC_ID = \"pg/interval@1\";\nconst PG_JSON_CODEC_ID = \"pg/json@1\";\nconst PG_JSONB_CODEC_ID = \"pg/jsonb@1\";\nconst PG_BYTEA_CODEC_ID = \"pg/bytea@1\";\nconst PG_UUID_CODEC_ID = \"pg/uuid@1\";\nconst PG_INET_CODEC_ID = \"pg/inet@1\";\n//#endregion\nexport { PG_UNBOUNDED_INT_CODEC_ID as A, PG_TIMESTAMPTZ_STRING_CODEC_ID as C, PG_TIMETZ_CODEC_ID as D, PG_TIMESTAMP_TEMPORAL_CODEC_ID as E, SQL_FLOAT_CODEC_ID as F, SQL_INT_CODEC_ID as I, SQL_TEXT_CODEC_ID as L, PG_VARBIT_CODEC_ID as M, PG_VARCHAR_CODEC_ID as N, PG_TIME_STRING_CODEC_ID as O, SQL_CHAR_CODEC_ID as P, SQL_VARCHAR_CODEC_ID as R, PG_TEXT_CODEC_ID as S, PG_TIMESTAMP_STRING_CODEC_ID as T, PG_INT_CODEC_ID as _, PG_DATE_STRING_CODEC_ID as a, PG_NUMERIC_CODEC_ID as b, PG_FLOAT4_CODEC_ID as c, PG_INET_CODEC_ID as d, PG_INT2_CODEC_ID as f, PG_INTERVAL_CODEC_ID as g, PG_INT8_NUMBER_CODEC_ID as h, PG_CHAR_CODEC_ID as i, PG_UUID_CODEC_ID as j, PG_TIME_TEMPORAL_CODEC_ID as k, PG_FLOAT8_CODEC_ID as l, PG_INT8_CODEC_ID as m, PG_BOOL_CODEC_ID as n, PG_DATE_TEMPORAL_CODEC_ID as o, PG_INT4_CODEC_ID as p, PG_BYTEA_CODEC_ID as r, PG_ENUM_CODEC_ID as s, PG_BIT_CODEC_ID as t, PG_FLOAT_CODEC_ID as u, PG_JSONB_CODEC_ID as v, PG_TIMESTAMPTZ_TEMPORAL_CODEC_ID as w, PG_TEXT_ARRAY_CODEC_ID as x, PG_JSON_CODEC_ID as y };\n\n//# sourceMappingURL=codec-ids-D3ZEAmt2.mjs.map"],"mappings":";;AAEA,MAAM,mBAAmB;AACzB,MAAM,yBAAyB;AAC/B,MAAM,mBAAmB;AACzB,MAAM,mBAAmB;AACzB,MAAM,sBAAsB;AAC5B,MAAM,kBAAkB;AACxB,MAAM,mBAAmB;AACzB,MAAM,mBAAmB;AACzB,MAAM,mBAAmB;AACzB,MAAM,0BAA0B;AAChC,MAAM,oBAAoB;AAC1B,MAAM,qBAAqB;AAC3B,MAAM,qBAAqB;AAC3B,MAAM,sBAAsB;AAC5B,MAAM,4BAA4B;AAClC,MAAM,mBAAmB;AACzB,MAAM,kBAAkB;AACxB,MAAM,qBAAqB;AAC3B,MAAM,4BAA4B;AAClC,MAAM,iCAAiC;AACvC,MAAM,mCAAmC;AACzC,MAAM,4BAA4B;AAClC,MAAM,0BAA0B;AAChC,MAAM,+BAA+B;AACrC,MAAM,iCAAiC;AACvC,MAAM,0BAA0B;AAChC,MAAM,qBAAqB;AAC3B,MAAM,uBAAuB;AAC7B,MAAM,mBAAmB;AACzB,MAAM,oBAAoB;AAC1B,MAAM,oBAAoB;AAC1B,MAAM,mBAAmB;AACzB,MAAM,mBAAmB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./codec-ids-CmcC76hX-C0JIyoua.mjs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as AdaptedPostgresCodecDescriptor } from "./codec-descriptor-Bec_zukr-BfvtUqhm.mjs";
|
|
2
|
-
import { A as
|
|
2
|
+
import { A as PgTimestamptzTemporalDescriptor, C as PgNumericDescriptor, D as PgTimestampStringDescriptor, E as PgTimeTemporalDescriptor, F as PgVarcharDescriptor, M as PgUnboundedIntDescriptor, N as PgUuidDescriptor, O as PgTimestampTemporalDescriptor, P as PgVarbitDescriptor, S as PgJsonbDescriptor, T as PgTimeStringDescriptor, _ as PgInt8NumberDescriptor, a as PgDateStringDescriptor, b as PgIntervalDescriptor, c as PgEnumDescriptor, d as PgFloat8Descriptor, f as PgFloatDescriptor, g as PgInt8Descriptor, h as PgInt4Descriptor, i as PgCharDescriptor, j as PgTimetzDescriptor, k as PgTimestamptzStringDescriptor, m as PgInt2Descriptor, n as PgBoolDescriptor, o as PgDateTemporalDescriptor, p as PgInetDescriptor, r as PgByteaDescriptor, t as PgBitDescriptor, u as PgFloat4Descriptor, v as PgIntDescriptor, w as PgTextDescriptor, x as PgJsonDescriptor } from "./codecs-bwX5JaME-ByuPNLC5.mjs";
|
|
3
3
|
import { ExtractCodecTypes } from "@prisma/orm-family-sql/relational-core/ast";
|
|
4
4
|
import { JsonValue as JsonValue$1 } from "@prisma/orm-framework/contract/types";
|
|
5
|
-
//#region ../../../3-targets/3-targets/postgres/dist/codec-types-
|
|
5
|
+
//#region ../../../3-targets/3-targets/postgres/dist/codec-types-X0ENu4sQ.d.mts
|
|
6
6
|
//#region src/core/codec-type-map.d.ts
|
|
7
7
|
declare const codecDescriptorMap: {
|
|
8
8
|
readonly char: AdaptedPostgresCodecDescriptor<import("@prisma/orm-family-sql/relational-core/ast").SqlCharDescriptor>;
|
|
@@ -10,7 +10,6 @@ declare const codecDescriptorMap: {
|
|
|
10
10
|
readonly int: AdaptedPostgresCodecDescriptor<import("@prisma/orm-family-sql/relational-core/ast").SqlIntDescriptor>;
|
|
11
11
|
readonly float: AdaptedPostgresCodecDescriptor<import("@prisma/orm-family-sql/relational-core/ast").SqlFloatDescriptor>;
|
|
12
12
|
readonly 'sql-text': AdaptedPostgresCodecDescriptor<import("@prisma/orm-family-sql/relational-core/ast").SqlTextDescriptor>;
|
|
13
|
-
readonly 'sql-timestamp': AdaptedPostgresCodecDescriptor<import("@prisma/orm-family-sql/relational-core/ast").SqlTimestampDescriptor>;
|
|
14
13
|
readonly text: PgTextDescriptor;
|
|
15
14
|
readonly enum: PgEnumDescriptor;
|
|
16
15
|
readonly character: PgCharDescriptor;
|
|
@@ -25,10 +24,14 @@ declare const codecDescriptorMap: {
|
|
|
25
24
|
readonly float8: PgFloat8Descriptor;
|
|
26
25
|
readonly numeric: PgNumericDescriptor;
|
|
27
26
|
readonly unboundedint: PgUnboundedIntDescriptor;
|
|
28
|
-
readonly date:
|
|
29
|
-
readonly timestamp:
|
|
30
|
-
readonly timestamptz:
|
|
31
|
-
readonly time:
|
|
27
|
+
readonly 'date-temporal': PgDateTemporalDescriptor;
|
|
28
|
+
readonly 'timestamp-temporal': PgTimestampTemporalDescriptor;
|
|
29
|
+
readonly 'timestamptz-temporal': PgTimestamptzTemporalDescriptor;
|
|
30
|
+
readonly 'time-temporal': PgTimeTemporalDescriptor;
|
|
31
|
+
readonly 'date-string': PgDateStringDescriptor;
|
|
32
|
+
readonly 'timestamp-string': PgTimestampStringDescriptor;
|
|
33
|
+
readonly 'timestamptz-string': PgTimestamptzStringDescriptor;
|
|
34
|
+
readonly 'time-string': PgTimeStringDescriptor;
|
|
32
35
|
readonly timetz: PgTimetzDescriptor;
|
|
33
36
|
readonly bool: PgBoolDescriptor;
|
|
34
37
|
readonly bit: PgBitDescriptor;
|
|
@@ -76,9 +79,18 @@ type Time<P extends number | undefined = undefined> = BrandedString<{
|
|
|
76
79
|
type Timetz<P extends number | undefined = undefined> = BrandedString<{
|
|
77
80
|
__timetzPrecision: P;
|
|
78
81
|
}>;
|
|
82
|
+
type TimestampString<P extends number | undefined = undefined> = BrandedString<{
|
|
83
|
+
__timestampStringPrecision: P;
|
|
84
|
+
}>;
|
|
85
|
+
type TimestamptzString<P extends number | undefined = undefined> = BrandedString<{
|
|
86
|
+
__timestamptzStringPrecision: P;
|
|
87
|
+
}>;
|
|
88
|
+
type TimeString<P extends number | undefined = undefined> = BrandedString<{
|
|
89
|
+
__timeStringPrecision: P;
|
|
90
|
+
}>;
|
|
79
91
|
type Interval<P extends number | undefined = undefined> = BrandedString<{
|
|
80
92
|
__intervalPrecision: P;
|
|
81
93
|
}>;
|
|
82
94
|
//#endregion
|
|
83
|
-
export { JsonValue$1 as a,
|
|
84
|
-
//# sourceMappingURL=codec-types-
|
|
95
|
+
export { JsonValue$1 as a, TimeString as c, Timestamptz as d, TimestamptzString as f, Varchar as h, Interval as i, Timestamp as l, VarBit as m, Char as n, Numeric as o, Timetz as p, CodecTypes as r, Time as s, Bit as t, TimestampString as u };
|
|
96
|
+
//# sourceMappingURL=codec-types-X0ENu4sQ-C6GS_WDR.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-types-X0ENu4sQ-C6GS_WDR.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/codec-types-X0ENu4sQ.d.mts"],"mappings":";;;;;;cAKc;WACH,MAAM,2EAA2E;WACjF,SAAS,2EAA2E;WACpF,KAAK,2EAA2E;WAChF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