@prisma/orm-target-postgres 8.0.0-rc.14-dev.14 → 8.0.0-rc.14-dev.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-WLK_P3mT.d.mts → adapter-DmDLDsVW.d.mts} +2 -2
- package/dist/{adapter-WLK_P3mT.d.mts.map → adapter-DmDLDsVW.d.mts.map} +1 -1
- package/dist/{adapter-Bb_FFDea-DyyfToJz.mjs → adapter-zLXT8Yxm-BX8ynGWu.mjs} +3 -3
- package/dist/{adapter-Bb_FFDea-DyyfToJz.mjs.map → adapter-zLXT8Yxm-BX8ynGWu.mjs.map} +1 -1
- package/dist/adapter.d.mts +6 -6
- package/dist/adapter.mjs +2 -2
- package/dist/adapter__adapter.d.mts +1 -1
- package/dist/adapter__adapter.mjs +1 -1
- package/dist/adapter__control.d.mts +1 -1
- package/dist/adapter__control.mjs +2 -2
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.d.mts +1 -1
- package/dist/adapter__runtime.mjs +1 -1
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/adapter__sql-renderer.d.mts +1 -1
- package/dist/adapter__types.d.mts +2 -2
- package/dist/{check-expressions-D4R7JhiZ-q-dFPGT2.d.mts → check-expressions-CBIgoKhV-D7oTR8lp.d.mts} +8 -6
- package/dist/check-expressions-CBIgoKhV-D7oTR8lp.d.mts.map +1 -0
- package/dist/{check-expressions-DLCs-SXx-itMQrUsX.mjs → check-expressions-DJNIFTHB-C86_fR5c.mjs} +9 -7
- package/dist/check-expressions-DJNIFTHB-C86_fR5c.mjs.map +1 -0
- package/dist/{control-BMhsfqMy.mjs → control-9MzjJLOE.mjs} +14 -12
- package/dist/control-9MzjJLOE.mjs.map +1 -0
- package/dist/{control-DoIm71dz.d.mts → control-CoZVI8XA.d.mts} +2 -2
- package/dist/{control-DoIm71dz.d.mts.map → control-CoZVI8XA.d.mts.map} +1 -1
- package/dist/{control-adapter-C6kz--Q4-BBli0l1k.mjs → control-adapter-DlHDFQw4-Awa40s5_.mjs} +3 -2
- package/dist/{control-adapter-C6kz--Q4-BBli0l1k.mjs.map → control-adapter-DlHDFQw4-Awa40s5_.mjs.map} +1 -1
- package/dist/{control-policy-CThlWQ8k-m3CT6KpR.mjs → control-policy-B_b8ZqDi-zNYBao6-.mjs} +5 -5
- package/dist/control-policy-B_b8ZqDi-zNYBao6-.mjs.map +1 -0
- package/dist/{descriptor-meta-JJJwM3Gl-BcH0pYOV.mjs → descriptor-meta-DDMTgiok-DuHh-HnB.mjs} +3 -3
- package/dist/{descriptor-meta-JJJwM3Gl-BcH0pYOV.mjs.map → descriptor-meta-DDMTgiok-DuHh-HnB.mjs.map} +1 -1
- package/dist/{diff-database-schema-Bp0uC68P-NxeVJERq.mjs → diff-database-schema-Cd6igMdS-CD3R7EC4.mjs} +3 -3
- package/dist/{diff-database-schema-Bp0uC68P-NxeVJERq.mjs.map → diff-database-schema-Cd6igMdS-CD3R7EC4.mjs.map} +1 -1
- package/dist/{infer-psl-contract-ChPangpl-CxL4__yw.mjs → infer-psl-contract-seu9C4tb-zycCE7Sk.mjs} +3 -3
- package/dist/{infer-psl-contract-ChPangpl-CxL4__yw.mjs.map → infer-psl-contract-seu9C4tb-zycCE7Sk.mjs.map} +1 -1
- package/dist/migration-PTHAY9Cv.mjs.map +1 -1
- package/dist/{pack-DO2bXv9P.d.mts → pack-CzisXlzc.d.mts} +2 -2
- package/dist/{pack-DO2bXv9P.d.mts.map → pack-CzisXlzc.d.mts.map} +1 -1
- package/dist/{planner-B_ILQa75-CoVpbzCr.mjs → planner-CbuWXI6E-CrlrOSd3.mjs} +6 -6
- package/dist/{planner-B_ILQa75-CoVpbzCr.mjs.map → planner-CbuWXI6E-CrlrOSd3.mjs.map} +1 -1
- package/dist/{planner-produced-postgres-migration-BQFrdLuE-CeyZeWPJ.mjs → planner-produced-postgres-migration-C3-L3nmn-BnqXdB_l.mjs} +3 -3
- package/dist/{planner-produced-postgres-migration-BQFrdLuE-CeyZeWPJ.mjs.map → planner-produced-postgres-migration-C3-L3nmn-BnqXdB_l.mjs.map} +1 -1
- package/dist/{postgres-migration-DWtr5s00-CSlA4I1U.mjs → postgres-migration-4qSv6qtX-Cj41qUBf.mjs} +4 -4
- package/dist/{postgres-migration-DWtr5s00-CSlA4I1U.mjs.map → postgres-migration-4qSv6qtX-Cj41qUBf.mjs.map} +1 -1
- package/dist/{prisma7-binding-Cajs2zo2.mjs → prisma7-binding-DOj123CN.mjs} +3 -3
- package/dist/{prisma7-binding-Cajs2zo2.mjs.map → prisma7-binding-DOj123CN.mjs.map} +1 -1
- package/dist/{prisma7-binding-c5vWJV6k.d.mts → prisma7-binding-Dbsmn8B0.d.mts} +2 -2
- package/dist/{prisma7-binding-c5vWJV6k.d.mts.map → prisma7-binding-Dbsmn8B0.d.mts.map} +1 -1
- package/dist/{runtime-Bm1hGqOh.d.mts → runtime-4QFzvcCp.d.mts} +2 -2
- package/dist/{runtime-Bm1hGqOh.d.mts.map → runtime-4QFzvcCp.d.mts.map} +1 -1
- package/dist/{sql-renderer-CfXWPuXU.d.mts → sql-renderer-Bd07vbru.d.mts} +2 -2
- package/dist/{sql-renderer-CfXWPuXU.d.mts.map → sql-renderer-Bd07vbru.d.mts.map} +1 -1
- package/dist/target.d.mts +4 -4
- package/dist/target.mjs +8 -8
- package/dist/target__control.mjs +2 -2
- package/dist/target__diff-database-schema.mjs +1 -1
- package/dist/target__issue-planner.mjs +1 -1
- package/dist/target__migration.mjs +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__planner-produced-postgres-migration.mjs +1 -1
- package/dist/target__planner.mjs +2 -2
- package/dist/target__prisma7-binding.d.mts +1 -1
- package/dist/target__prisma7-binding.mjs +1 -1
- package/dist/target__types.d.mts +2 -2
- package/dist/target__types.mjs +1 -1
- package/dist/{types-BPubHbiE-SaR3Cngi.d.mts → types-BPubHbiE-BzhJ05fG.d.mts} +2 -2
- package/dist/{types-BPubHbiE-SaR3Cngi.d.mts.map → types-BPubHbiE-BzhJ05fG.d.mts.map} +1 -1
- package/dist/types-CUt2h1U-.d.mts +2 -0
- package/dist/{types-DpIAC6Ui.d.mts → types-D799eppJ.d.mts} +2 -2
- package/dist/{types-DpIAC6Ui.d.mts.map → types-D799eppJ.d.mts.map} +1 -1
- package/package.json +9 -9
- package/dist/check-expressions-D4R7JhiZ-q-dFPGT2.d.mts.map +0 -1
- package/dist/check-expressions-DLCs-SXx-itMQrUsX.mjs.map +0 -1
- package/dist/control-BMhsfqMy.mjs.map +0 -1
- package/dist/control-policy-CThlWQ8k-m3CT6KpR.mjs.map +0 -1
- package/dist/types-DvEixgWS.d.mts +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as PostgresContract } from "./postgres-schema-Xsjt3RKO-Buv2X8ai.mjs";
|
|
2
|
-
import { c as PostgresLoweredStatement, s as PostgresAdapterOptions } from "./types-BPubHbiE-
|
|
2
|
+
import { c as PostgresLoweredStatement, s as PostgresAdapterOptions } from "./types-BPubHbiE-BzhJ05fG.mjs";
|
|
3
3
|
import { r as PostgresCodecRegistry } from "./codecs-Ba3gUr67.mjs";
|
|
4
4
|
import { h as PostgresDdlNode } from "./nodes-BU-V-aZA-RqwPH68u.mjs";
|
|
5
5
|
import "./ddl-B4Rh8ntj.mjs";
|
|
@@ -24,4 +24,4 @@ declare const postgresRawCodecInferer: RawCodecInferer;
|
|
|
24
24
|
declare function createPostgresAdapter(options?: PostgresAdapterOptions): Readonly<PostgresAdapterImpl>;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { postgresRawCodecInferer as n, createPostgresAdapter as t };
|
|
27
|
-
//# sourceMappingURL=adapter-
|
|
27
|
+
//# sourceMappingURL=adapter-DmDLDsVW.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-
|
|
1
|
+
{"version":3,"file":"adapter-DmDLDsVW.d.mts","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/adapter.d.mts"],"mappings":";;;;;;;;;cAMc,+BAA+B,QAAQ,aAAa,kBAAkB;WACzE;WACA;WACA,SAAS;mBACD;EACjB,YAAY,eAAe,uBAAuB;EAClD,MAAM,KAAK,cAAc,iBAAiB,SAAS,eAAe,oBAAoB;;;;;;;cAO1E,yBAAyB;iBACtB,sBAAsB,UAAU,yBAAyB,SAAS"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { i as createPostgresCodecRegistryWithBuiltins } from "./codecs-DMPbfU3s.mjs";
|
|
2
2
|
import { n as renderLoweredSql, t as adapterError } from "./sql-renderer-CgUgFbU4-CujcTVwf.mjs";
|
|
3
|
-
import { t as PostgresControlAdapter } from "./control-adapter-
|
|
3
|
+
import { t as PostgresControlAdapter } from "./control-adapter-DlHDFQw4-Awa40s5_.mjs";
|
|
4
4
|
import { isDdlNode } from "@prisma/orm-family-sql/relational-core/ast";
|
|
5
5
|
import { APP_SPACE_ID } from "@prisma/orm-framework/components/control";
|
|
6
|
-
//#region ../../../3-targets/6-adapters/postgres/dist/adapter-
|
|
6
|
+
//#region ../../../3-targets/6-adapters/postgres/dist/adapter-zLXT8Yxm.mjs
|
|
7
7
|
const defaultCapabilities = Object.freeze({
|
|
8
8
|
postgres: {
|
|
9
9
|
orderBy: true,
|
|
@@ -95,4 +95,4 @@ function createPostgresAdapterWithCodecRegistry(codecRegistry) {
|
|
|
95
95
|
//#endregion
|
|
96
96
|
export { createPostgresAdapterWithCodecRegistry as n, postgresRawCodecInferer as r, createPostgresAdapter as t };
|
|
97
97
|
|
|
98
|
-
//# sourceMappingURL=adapter-
|
|
98
|
+
//# sourceMappingURL=adapter-zLXT8Yxm-BX8ynGWu.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-
|
|
1
|
+
{"version":3,"file":"adapter-zLXT8Yxm-BX8ynGWu.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/adapter-zLXT8Yxm.mjs"],"sourcesContent":["import { n as adapterError, t as renderLoweredSql } from \"./sql-renderer-CgUgFbU4.mjs\";\nimport { t as PostgresControlAdapter } from \"./control-adapter-DlHDFQw4.mjs\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { isDdlNode } from \"@internal/sql-relational-core/ast\";\nimport { createPostgresCodecRegistryWithBuiltins } from \"@internal/target-postgres/codecs\";\n//#region src/core/adapter.ts\nconst defaultCapabilities = Object.freeze({\n\tpostgres: {\n\t\torderBy: true,\n\t\tlimit: true,\n\t\tlateral: true,\n\t\tjsonAgg: true,\n\t\treturning: true,\n\t\tdistinctOn: true\n\t},\n\tsql: {\n\t\tenums: true,\n\t\treturning: true,\n\t\tdefaultInInsert: true,\n\t\tlateral: true,\n\t\tscalarList: true,\n\t\tcheckConstraint: true,\n\t\tinsertOnConflictSkip: true,\n\t\tinsertOnConflictWithoutTarget: true\n\t}\n});\nvar PostgresAdapterImpl = class {\n\tfamilyId = \"sql\";\n\ttargetId = \"postgres\";\n\tprofile;\n\tcodecRegistry;\n\tconstructor(codecRegistry, profileId) {\n\t\tthis.codecRegistry = codecRegistry;\n\t\tconst controlAdapter = new PostgresControlAdapter(codecRegistry);\n\t\tthis.profile = Object.freeze({\n\t\t\tid: profileId ?? \"postgres/default@1\",\n\t\t\ttarget: \"postgres\",\n\t\t\tcapabilities: defaultCapabilities,\n\t\t\treadMarker: (queryable) => controlAdapter.readMarkerDiscriminated({\n\t\t\t\tfamilyId: \"sql\",\n\t\t\t\ttargetId: \"postgres\",\n\t\t\t\tquery: async (sql, params) => {\n\t\t\t\t\tconst rows = [];\n\t\t\t\t\tfor await (const row of queryable.query({\n\t\t\t\t\t\tsql,\n\t\t\t\t\t\t...params === void 0 ? {} : { params }\n\t\t\t\t\t})) rows.push(row);\n\t\t\t\t\treturn { rows };\n\t\t\t\t},\n\t\t\t\tclose: async () => {}\n\t\t\t}, APP_SPACE_ID)\n\t\t});\n\t}\n\tlower(ast, context) {\n\t\tif (isDdlNode(ast)) throw adapterError(\"RUNTIME.DDL_UNSUPPORTED\", \"lower() does not lower DDL on the runtime adapter — DDL lowering is a control-plane concern handled by the control adapter.\", { meta: { surface: \"runtime-adapter\" } });\n\t\treturn renderLoweredSql(ast, context.contract, this.codecRegistry);\n\t}\n};\nconst INT4_MIN = -2147483648;\nconst INT4_MAX = 2147483647;\n/**\n* The codec a bare JS number is bound through.\n*\n* An integer picks the narrowest column type that holds it: `int4` while it\n* fits the signed 32-bit range, `int8` (number-valued) up to the safe-integer\n* limit. Past that limit a JS number is no longer an exact integer, so it\n* binds as `float8` rather than pretending to a precision it does not have.\n*/\nfunction inferNumberCodecId(value) {\n\tif (!Number.isSafeInteger(value)) return \"pg/float8@1\";\n\treturn value >= INT4_MIN && value <= INT4_MAX ? \"pg/int4@1\" : \"pg/int8number@1\";\n}\n/**\n* Codec-id lookup for bare-literal interpolations used by `fns.raw` on a postgres client. Contributed as the descriptor's static `rawCodecInferer` slot.\n*\n* The ids are versioned because that is how the codec registry keys them: lowering resolves an interpolated value's codec by exact id through `descriptorFor`.\n*/\nconst postgresRawCodecInferer = { inferCodec(value) {\n\tswitch (typeof value) {\n\t\tcase \"number\": return inferNumberCodecId(value);\n\t\tcase \"bigint\": return \"pg/int8@1\";\n\t\tcase \"string\": return \"pg/text@1\";\n\t\tcase \"boolean\": return \"pg/bool@1\";\n\t\tcase \"object\": if (value instanceof Uint8Array) return \"pg/bytea@1\";\n\t}\n\tthrow adapterError(\"RUNTIME.RAW_SQL_UNSUPPORTED_INTERPOLATION\", \"unsupported JS value type for raw-SQL interpolation: wrap this value in `param(...)` with an explicit codec\", { meta: { valueType: typeof value } });\n} };\nfunction createPostgresAdapter(options) {\n\tconst codecRegistry = createPostgresCodecRegistryWithBuiltins(options?.codecDescriptors);\n\treturn Object.freeze(new PostgresAdapterImpl(codecRegistry, options?.profileId));\n}\nfunction createPostgresAdapterWithCodecRegistry(codecRegistry) {\n\treturn Object.freeze(new PostgresAdapterImpl(codecRegistry));\n}\n//#endregion\nexport { createPostgresAdapterWithCodecRegistry as n, postgresRawCodecInferer as r, createPostgresAdapter as t };\n\n//# sourceMappingURL=adapter-zLXT8Yxm.mjs.map"],"mappings":";;;;;;AAMA,MAAM,sBAAsB,OAAO,OAAO;CACzC,UAAU;EACT,SAAS;EACT,OAAO;EACP,SAAS;EACT,SAAS;EACT,WAAW;EACX,YAAY;CACb;CACA,KAAK;EACJ,OAAO;EACP,WAAW;EACX,iBAAiB;EACjB,SAAS;EACT,YAAY;EACZ,iBAAiB;EACjB,sBAAsB;EACtB,+BAA+B;CAChC;AACD,CAAC;AACD,IAAI,sBAAsB,MAAM;CAC/B,WAAW;CACX,WAAW;CACX;CACA;CACA,YAAY,eAAe,WAAW;EACrC,KAAK,gBAAgB;EACrB,MAAM,iBAAiB,IAAI,uBAAuB,aAAa;EAC/D,KAAK,UAAU,OAAO,OAAO;GAC5B,IAAI,aAAa;GACjB,QAAQ;GACR,cAAc;GACd,aAAa,cAAc,eAAe,wBAAwB;IACjE,UAAU;IACV,UAAU;IACV,OAAO,OAAO,KAAK,WAAW;KAC7B,MAAM,OAAO,CAAC;KACd,WAAW,MAAM,OAAO,UAAU,MAAM;MACvC;MACA,GAAG,WAAW,KAAK,IAAI,CAAC,IAAI,EAAE,OAAO;KACtC,CAAC,GAAG,KAAK,KAAK,GAAG;KACjB,OAAO,EAAE,KAAK;IACf;IACA,OAAO,YAAY,CAAC;GACrB,GAAG,YAAY;EAChB,CAAC;CACF;CACA,MAAM,KAAK,SAAS;EACnB,IAAI,UAAU,GAAG,GAAG,MAAM,aAAa,2BAA2B,+HAA+H,EAAE,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAC;EACzO,OAAO,iBAAiB,KAAK,QAAQ,UAAU,KAAK,aAAa;CAClE;AACD;AACA,MAAM,WAAW;AACjB,MAAM,WAAW;;;;;;;;;AASjB,SAAS,mBAAmB,OAAO;CAClC,IAAI,CAAC,OAAO,cAAc,KAAK,GAAG,OAAO;CACzC,OAAO,SAAS,YAAY,SAAS,WAAW,cAAc;AAC/D;;;;;;AAMA,MAAM,0BAA0B,EAAE,WAAW,OAAO;CACnD,QAAQ,OAAO,OAAf;EACC,KAAK,UAAU,OAAO,mBAAmB,KAAK;EAC9C,KAAK,UAAU,OAAO;EACtB,KAAK,UAAU,OAAO;EACtB,KAAK,WAAW,OAAO;EACvB,KAAK,UAAU,IAAI,iBAAiB,YAAY,OAAO;CACxD;CACA,MAAM,aAAa,6CAA6C,+GAA+G,EAAE,MAAM,EAAE,WAAW,OAAO,MAAM,EAAE,CAAC;AACrN,EAAE;AACF,SAAS,sBAAsB,SAAS;CACvC,MAAM,gBAAgB,wCAAwC,SAAS,gBAAgB;CACvF,OAAO,OAAO,OAAO,IAAI,oBAAoB,eAAe,SAAS,SAAS,CAAC;AAChF;AACA,SAAS,uCAAuC,eAAe;CAC9D,OAAO,OAAO,OAAO,IAAI,oBAAoB,aAAa,CAAC;AAC5D"}
|
package/dist/adapter.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as PostgresContract } from "./postgres-schema-Xsjt3RKO-Buv2X8ai.mjs";
|
|
2
|
-
import { a as OrderClause, c as PostgresLoweredStatement, d as StorageTable, i as Expr, l as SelectAst, n as ColumnRef, o as ParamRef, r as Direction, s as PostgresAdapterOptions, t as BinaryExpr, u as StorageColumn } from "./types-BPubHbiE-
|
|
2
|
+
import { a as OrderClause, c as PostgresLoweredStatement, d as StorageTable, i as Expr, l as SelectAst, n as ColumnRef, o as ParamRef, r as Direction, s as PostgresAdapterOptions, t as BinaryExpr, u as StorageColumn } from "./types-BPubHbiE-BzhJ05fG.mjs";
|
|
3
3
|
import { o as createPostgresBuiltinCodecLookup, r as PostgresCodecRegistry, s as createPostgresCodecRegistryWithBuiltins } from "./codecs-Ba3gUr67.mjs";
|
|
4
|
-
import { n as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-
|
|
4
|
+
import { n as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-DmDLDsVW.mjs";
|
|
5
5
|
import { C as timestamptzTemporalColumn, E as varcharColumn, S as timestamptzStringColumn, T as varbitColumn, _ as timeStringColumn, a as dateStringColumn, b as timestampTemporalColumn, c as float8Column, d as int8Column, f as intervalColumn, g as textColumn, h as numericColumn, i as charColumn, l as int2Column, m as jsonbColumn, n as boolColumn, o as dateTemporalColumn, p as jsonColumn, r as byteaColumn, s as float4Column, t as bitColumn, u as int4Column, v as timeTemporalColumn, w as timetzColumn, x as timestamptzJsDateColumn, y as timestampStringColumn } from "./column-types-C_d8NCMy.mjs";
|
|
6
6
|
import { t as parsePostgresDefault } from "./default-normalizer-ZZ7Y5boE.mjs";
|
|
7
7
|
import { i as normalizeSchemaNativeType } from "./native-type-normalizer-BFo5tSyh.mjs";
|
|
8
8
|
import { i as quoteIdentifier, r as qualifyName, t as escapeLiteral } from "./sql-utils-DqFxskY6.mjs";
|
|
9
|
-
import { t as PostgresControlAdapter } from "./control-
|
|
10
|
-
import { t as SqlRuntimeAdapter } from "./runtime-
|
|
11
|
-
import { t as renderLoweredSql } from "./sql-renderer-
|
|
12
|
-
import "./types-
|
|
9
|
+
import { t as PostgresControlAdapter } from "./control-CoZVI8XA.mjs";
|
|
10
|
+
import { t as SqlRuntimeAdapter } from "./runtime-4QFzvcCp.mjs";
|
|
11
|
+
import { t as renderLoweredSql } from "./sql-renderer-Bd07vbru.mjs";
|
|
12
|
+
import "./types-CUt2h1U-.mjs";
|
|
13
13
|
export { type BinaryExpr, type ColumnRef, type Direction, type Expr, type OrderClause, type ParamRef, type PostgresAdapterOptions, type PostgresCodecRegistry, type PostgresContract, PostgresControlAdapter, type PostgresLoweredStatement, type SelectAst, SqlRuntimeAdapter, type StorageColumn, type StorageTable, bitColumn, boolColumn, byteaColumn, charColumn, createPostgresAdapter, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, dateStringColumn, dateTemporalColumn, escapeLiteral, float4Column, float8Column, int2Column, int4Column, int8Column, intervalColumn, jsonColumn, jsonbColumn, normalizeSchemaNativeType, numericColumn, parsePostgresDefault, postgresRawCodecInferer, qualifyName, quoteIdentifier, renderLoweredSql, textColumn, timeStringColumn, timeTemporalColumn, timestampStringColumn, timestampTemporalColumn, timestamptzJsDateColumn, timestamptzStringColumn, timestamptzTemporalColumn, timetzColumn, varbitColumn, varcharColumn };
|
package/dist/adapter.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { n as qualifyName, r as quoteIdentifier, t as escapeLiteral } from "./sq
|
|
|
3
3
|
import { t as parsePostgresDefault } from "./default-normalizer-Cb7nWBUa-DXchlOUk.mjs";
|
|
4
4
|
import { n as normalizeSchemaNativeType } from "./native-type-normalizer-CW6g9Fut-C5lMRRjS.mjs";
|
|
5
5
|
import { n as renderLoweredSql } from "./sql-renderer-CgUgFbU4-CujcTVwf.mjs";
|
|
6
|
-
import { t as PostgresControlAdapter } from "./control-adapter-
|
|
7
|
-
import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-
|
|
6
|
+
import { t as PostgresControlAdapter } from "./control-adapter-DlHDFQw4-Awa40s5_.mjs";
|
|
7
|
+
import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-zLXT8Yxm-BX8ynGWu.mjs";
|
|
8
8
|
import { C as timestamptzTemporalColumn, E as varcharColumn, S as timestamptzStringColumn, T as varbitColumn, _ as timeStringColumn, a as dateStringColumn, b as timestampTemporalColumn, c as float8Column, d as int8Column, f as intervalColumn, g as textColumn, h as numericColumn, i as charColumn, l as int2Column, m as jsonbColumn, n as boolColumn, o as dateTemporalColumn, p as jsonColumn, r as byteaColumn, s as float4Column, t as bitColumn, u as int4Column, v as timeTemporalColumn, w as timetzColumn, x as timestamptzJsDateColumn, y as timestampStringColumn } from "./column-types-CB_qVLNC.mjs";
|
|
9
9
|
export { PostgresControlAdapter, bitColumn, boolColumn, byteaColumn, charColumn, createPostgresAdapter, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, dateStringColumn, dateTemporalColumn, escapeLiteral, float4Column, float8Column, int2Column, int4Column, int8Column, intervalColumn, jsonColumn, jsonbColumn, normalizeSchemaNativeType, numericColumn, parsePostgresDefault, postgresRawCodecInferer, qualifyName, quoteIdentifier, renderLoweredSql, textColumn, timeStringColumn, timeTemporalColumn, timestampStringColumn, timestampTemporalColumn, timestamptzJsDateColumn, timestamptzStringColumn, timestamptzTemporalColumn, timetzColumn, varbitColumn, varcharColumn };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-
|
|
1
|
+
import { n as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-DmDLDsVW.mjs";
|
|
2
2
|
export { createPostgresAdapter, postgresRawCodecInferer };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-
|
|
1
|
+
import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-zLXT8Yxm-BX8ynGWu.mjs";
|
|
2
2
|
export { createPostgresAdapter, postgresRawCodecInferer };
|
|
@@ -2,5 +2,5 @@ import { o as createPostgresBuiltinCodecLookup, s as createPostgresCodecRegistry
|
|
|
2
2
|
import { t as parsePostgresDefault } from "./default-normalizer-ZZ7Y5boE.mjs";
|
|
3
3
|
import { i as normalizeSchemaNativeType } from "./native-type-normalizer-BFo5tSyh.mjs";
|
|
4
4
|
import { i as quoteIdentifier, r as qualifyName, t as escapeLiteral } from "./sql-utils-DqFxskY6.mjs";
|
|
5
|
-
import { n as postgresAdapterDescriptor, t as PostgresControlAdapter } from "./control-
|
|
5
|
+
import { n as postgresAdapterDescriptor, t as PostgresControlAdapter } from "./control-CoZVI8XA.mjs";
|
|
6
6
|
export { PostgresControlAdapter, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, postgresAdapterDescriptor as default, escapeLiteral, normalizeSchemaNativeType, parsePostgresDefault, qualifyName, quoteIdentifier };
|
|
@@ -4,8 +4,8 @@ import { a as instantNowControlDescriptor, s as plainDateTimeNowControlDescripto
|
|
|
4
4
|
import { t as parsePostgresDefault } from "./default-normalizer-Cb7nWBUa-DXchlOUk.mjs";
|
|
5
5
|
import { n as normalizeSchemaNativeType } from "./native-type-normalizer-CW6g9Fut-C5lMRRjS.mjs";
|
|
6
6
|
import { t as postgresDataTypeEntries } from "./data-type-entries-BDSHvsdE-Bbe1cdbR.mjs";
|
|
7
|
-
import { n as postgresScalarAuthoringTypes, t as postgresNativeAuthoringTypes } from "./control-
|
|
8
|
-
import { t as PostgresControlAdapter } from "./control-adapter-
|
|
7
|
+
import { n as postgresScalarAuthoringTypes, t as postgresNativeAuthoringTypes } from "./control-9MzjJLOE.mjs";
|
|
8
|
+
import { t as PostgresControlAdapter } from "./control-adapter-DlHDFQw4-Awa40s5_.mjs";
|
|
9
9
|
import { t as postgresAdapterDescriptorMeta } from "./descriptor-meta-BEigA5Gj-BJLRWRFj.mjs";
|
|
10
10
|
import { timestampNowControlDescriptor } from "@prisma/orm-framework/components/control";
|
|
11
11
|
import { int, num, oneOf, optional } from "@prisma/orm-framework/psl-parser";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter__control.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/control.mjs"],"sourcesContent":["import { t as PostgresControlAdapter } from \"./control-adapter-
|
|
1
|
+
{"version":3,"file":"adapter__control.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/control.mjs"],"sourcesContent":["import { t as PostgresControlAdapter } from \"./control-adapter-DlHDFQw4.mjs\";\nimport { t as postgresAdapterDescriptorMeta } from \"./descriptor-meta-BEigA5Gj.mjs\";\nimport { timestampNowControlDescriptor } from \"@internal/framework-components/control\";\nimport { assemblePostgresCodecRegistry, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins } from \"@internal/target-postgres/codecs\";\nimport { parsePostgresDefault } from \"@internal/target-postgres/default-normalizer\";\nimport { normalizeSchemaNativeType } from \"@internal/target-postgres/native-type-normalizer\";\nimport { escapeLiteral, qualifyName, quoteIdentifier } from \"@internal/target-postgres/sql-utils\";\nimport { postgresDataTypeEntries } from \"@internal/target-postgres/data-types\";\nimport { builtinGeneratorRegistryMetadata } from \"@internal/ids\";\nimport { int, num, oneOf, optional } from \"@internal/psl-parser\";\nimport { instantNowControlDescriptor, plainDateTimeNowControlDescriptor, postgresNativeAuthoringTypes, postgresScalarAuthoringTypes } from \"@internal/target-postgres/control\";\n//#region src/core/control-mutation-defaults.ts\nfunction executionGenerator(id, params) {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"execution\",\n\t\t\tgenerated: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid,\n\t\t\t\t...params ? { params } : {}\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerAutoincrement() {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: \"autoincrement()\"\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerNow() {\n\treturn {\n\t\tok: true,\n\t\tvalue: {\n\t\t\tkind: \"storage\",\n\t\t\tdefaultValue: {\n\t\t\t\tkind: \"function\",\n\t\t\t\texpression: \"now()\"\n\t\t\t}\n\t\t}\n\t};\n}\nfunction lowerUlid() {\n\treturn executionGenerator(\"ulid\");\n}\nfunction lowerUuid(input) {\n\treturn input.call.args[\"version\"] === 7 ? executionGenerator(\"uuidv7\") : executionGenerator(\"uuidv4\");\n}\nfunction lowerCuid() {\n\treturn executionGenerator(\"cuid2\");\n}\nfunction lowerNanoid(input) {\n\tconst size = input.call.args[\"size\"];\n\treturn typeof size === \"number\" ? executionGenerator(\"nanoid\", { size }) : executionGenerator(\"nanoid\");\n}\nconst nowSig = { documentation: \"Uses the current database timestamp as the default value.\" };\nconst autoincrementSig = { documentation: \"Generates an increasing integer value in the database.\" };\nconst ulidSig = { documentation: \"Generates a ULID when a value is not supplied.\" };\nconst uuidSig = {\n\tdocumentation: \"Generates a UUID when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"version\",\n\t\ttype: optional(oneOf(num(4), num(7))),\n\t\tdocumentation: \"The UUID version: `4` or `7`. Defaults to `4`.\"\n\t}]\n};\nconst cuidSig = {\n\tdocumentation: \"Generates a CUID2 identifier when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"version\",\n\t\ttype: num(2),\n\t\tdocumentation: \"The CUID version. Only `2` is supported.\"\n\t}]\n};\nconst nanoidSig = {\n\tdocumentation: \"Generates a Nano ID when a value is not supplied.\",\n\tpositional: [{\n\t\tkey: \"size\",\n\t\ttype: optional(int({\n\t\t\tmin: 2,\n\t\t\tmax: 255\n\t\t})),\n\t\tdocumentation: \"The identifier length, from `2` through `255`. Omit to use the generator default.\"\n\t}]\n};\nconst postgresDefaultFunctionRegistryEntries = [\n\t[\"autoincrement\", {\n\t\tsignature: autoincrementSig,\n\t\tlower: lowerAutoincrement,\n\t\tusageSignatures: [\"autoincrement()\"]\n\t}],\n\t[\"now\", {\n\t\tsignature: nowSig,\n\t\tlower: lowerNow,\n\t\tusageSignatures: [\"now()\"]\n\t}],\n\t[\"uuid\", {\n\t\tsignature: uuidSig,\n\t\tlower: lowerUuid,\n\t\tusageSignatures: [\n\t\t\t\"uuid()\",\n\t\t\t\"uuid(4)\",\n\t\t\t\"uuid(7)\"\n\t\t]\n\t}],\n\t[\"cuid\", {\n\t\tsignature: cuidSig,\n\t\tlower: lowerCuid,\n\t\tusageSignatures: [\"cuid(2)\"]\n\t}],\n\t[\"ulid\", {\n\t\tsignature: ulidSig,\n\t\tlower: lowerUlid,\n\t\tusageSignatures: [\"ulid()\"]\n\t}],\n\t[\"nanoid\", {\n\t\tsignature: nanoidSig,\n\t\tlower: lowerNanoid,\n\t\tusageSignatures: [\"nanoid()\", \"nanoid(<2-255>)\"]\n\t}]\n];\nconst postgresAuthoringTypes = {\n\t...postgresScalarAuthoringTypes,\n\t...postgresNativeAuthoringTypes\n};\nfunction createPostgresDefaultFunctionRegistry() {\n\treturn new Map(postgresDefaultFunctionRegistryEntries);\n}\nfunction createPostgresMutationDefaultGeneratorDescriptors() {\n\treturn [\n\t\t...builtinGeneratorRegistryMetadata.map(({ id, applicableCodecIds }) => ({\n\t\t\tid,\n\t\t\tapplicableCodecIds\n\t\t})),\n\t\ttimestampNowControlDescriptor(),\n\t\tinstantNowControlDescriptor(),\n\t\tplainDateTimeNowControlDescriptor()\n\t];\n}\n//#endregion\n//#region src/exports/control.ts\nconst postgresAdapterDescriptor = {\n\t...postgresAdapterDescriptorMeta,\n\tauthoring: {\n\t\ttype: postgresAuthoringTypes,\n\t\tdataTypes: postgresDataTypeEntries(),\n\t\tvalueObjectStorageType: \"Jsonb\"\n\t},\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: createPostgresDefaultFunctionRegistry(),\n\t\tgeneratorDescriptors: createPostgresMutationDefaultGeneratorDescriptors()\n\t},\n\tcreate(stack) {\n\t\treturn new PostgresControlAdapter(assemblePostgresCodecRegistry([\n\t\t\tstack.target,\n\t\t\t...stack.adapter === void 0 ? [] : [stack.adapter],\n\t\t\t...stack.extensions\n\t\t]));\n\t}\n};\n//#endregion\nexport { PostgresControlAdapter, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, postgresAdapterDescriptor as default, escapeLiteral, normalizeSchemaNativeType, parsePostgresDefault, qualifyName, quoteIdentifier };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as postgresRuntimeAdapterDescriptor, t as SqlRuntimeAdapter } from "./runtime-
|
|
1
|
+
import { n as postgresRuntimeAdapterDescriptor, t as SqlRuntimeAdapter } from "./runtime-4QFzvcCp.mjs";
|
|
2
2
|
export { SqlRuntimeAdapter, postgresRuntimeAdapterDescriptor as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { o as postgresCodecRegistry, t as assemblePostgresCodecRegistry } from "./codecs-DMPbfU3s.mjs";
|
|
2
2
|
import { i as instantNow, n as PLAIN_DATE_TIME_NOW_GENERATOR_ID, o as plainDateTimeNow, t as INSTANT_NOW_GENERATOR_ID } from "./authoring-DULm2ZZP-DgykBF-F.mjs";
|
|
3
|
-
import { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from "./adapter-
|
|
3
|
+
import { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from "./adapter-zLXT8Yxm-BX8ynGWu.mjs";
|
|
4
4
|
import { t as postgresAdapterDescriptorMeta } from "./descriptor-meta-BEigA5Gj-BJLRWRFj.mjs";
|
|
5
5
|
import { builtinGeneratorIds } from "@prisma/orm-framework/ids";
|
|
6
6
|
import { timestampNowRuntimeGenerator } from "@prisma/orm-family-sql/family/runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter__runtime.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/runtime.mjs"],"sourcesContent":["import { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from \"./adapter-
|
|
1
|
+
{"version":3,"file":"adapter__runtime.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/runtime.mjs"],"sourcesContent":["import { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from \"./adapter-zLXT8Yxm.mjs\";\nimport { t as postgresAdapterDescriptorMeta } from \"./descriptor-meta-BEigA5Gj.mjs\";\nimport { assemblePostgresCodecRegistry, postgresCodecRegistry } from \"@internal/target-postgres/codecs\";\nimport { builtinGeneratorIds } from \"@internal/ids\";\nimport { timestampNowRuntimeGenerator } from \"@internal/family-sql/runtime\";\nimport { generateId } from \"@internal/ids/runtime\";\nimport { INSTANT_NOW_GENERATOR_ID, PLAIN_DATE_TIME_NOW_GENERATOR_ID, instantNow, plainDateTimeNow } from \"@internal/target-postgres/runtime\";\n//#region src/exports/runtime.ts\nfunction createPostgresMutationDefaultGenerators() {\n\treturn [\n\t\t...builtinGeneratorIds.map((id) => ({\n\t\t\tid,\n\t\t\tgenerate: (params) => {\n\t\t\t\treturn generateId(params ? {\n\t\t\t\t\tid,\n\t\t\t\t\tparams\n\t\t\t\t} : { id });\n\t\t\t},\n\t\t\tstability: \"field\"\n\t\t})),\n\t\ttimestampNowRuntimeGenerator(),\n\t\t{\n\t\t\tid: INSTANT_NOW_GENERATOR_ID,\n\t\t\tgenerate: () => instantNow(),\n\t\t\tstability: \"query\"\n\t\t},\n\t\t{\n\t\t\tid: PLAIN_DATE_TIME_NOW_GENERATOR_ID,\n\t\t\tgenerate: () => plainDateTimeNow(),\n\t\t\tstability: \"query\"\n\t\t}\n\t];\n}\nconst postgresRuntimeAdapterDescriptor = {\n\t...postgresAdapterDescriptorMeta,\n\tcodecs: () => Array.from(postgresCodecRegistry.values()),\n\tmutationDefaultGenerators: createPostgresMutationDefaultGenerators,\n\trawCodecInferer: postgresRawCodecInferer,\n\tcreate(stack) {\n\t\treturn createPostgresAdapterWithCodecRegistry(assemblePostgresCodecRegistry([\n\t\t\tstack.target,\n\t\t\tstack.adapter,\n\t\t\t...stack.extensions\n\t\t]));\n\t}\n};\n//#endregion\nexport { postgresRuntimeAdapterDescriptor as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;AAQA,SAAS,0CAA0C;CAClD,OAAO;EACN,GAAG,oBAAoB,KAAK,QAAQ;GACnC;GACA,WAAW,WAAW;IACrB,OAAO,WAAW,SAAS;KAC1B;KACA;IACD,IAAI,EAAE,GAAG,CAAC;GACX;GACA,WAAW;EACZ,EAAE;EACF,6BAA6B;EAC7B;GACC,IAAI;GACJ,gBAAgB,WAAW;GAC3B,WAAW;EACZ;EACA;GACC,IAAI;GACJ,gBAAgB,iBAAiB;GACjC,WAAW;EACZ;CACD;AACD;AACA,MAAM,mCAAmC;CACxC,GAAG;CACH,cAAc,MAAM,KAAK,sBAAsB,OAAO,CAAC;CACvD,2BAA2B;CAC3B,iBAAiB;CACjB,OAAO,OAAO;EACb,OAAO,uCAAuC,8BAA8B;GAC3E,MAAM;GACN,MAAM;GACN,GAAG,MAAM;EACV,CAAC,CAAC;CACH;AACD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as renderLoweredSql } from "./sql-renderer-
|
|
1
|
+
import { t as renderLoweredSql } from "./sql-renderer-Bd07vbru.mjs";
|
|
2
2
|
export { renderLoweredSql };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as PostgresContract } from "./postgres-schema-Xsjt3RKO-Buv2X8ai.mjs";
|
|
2
|
-
import { a as OrderClause, c as PostgresLoweredStatement, d as StorageTable, i as Expr, l as SelectAst, n as ColumnRef, o as ParamRef, r as Direction, s as PostgresAdapterOptions, t as BinaryExpr, u as StorageColumn } from "./types-BPubHbiE-
|
|
2
|
+
import { a as OrderClause, c as PostgresLoweredStatement, d as StorageTable, i as Expr, l as SelectAst, n as ColumnRef, o as ParamRef, r as Direction, s as PostgresAdapterOptions, t as BinaryExpr, u as StorageColumn } from "./types-BPubHbiE-BzhJ05fG.mjs";
|
|
3
3
|
import { r as PostgresCodecRegistry } from "./codecs-Ba3gUr67.mjs";
|
|
4
|
-
import "./types-
|
|
4
|
+
import "./types-CUt2h1U-.mjs";
|
|
5
5
|
export type { BinaryExpr, ColumnRef, Direction, Expr, OrderClause, ParamRef, PostgresAdapterOptions, PostgresCodecRegistry, PostgresContract, PostgresLoweredStatement, SelectAst, StorageColumn, StorageTable };
|
package/dist/{check-expressions-D4R7JhiZ-q-dFPGT2.d.mts → check-expressions-CBIgoKhV-D7oTR8lp.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-CBIgoKhV.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
|
|
@@ -17,7 +17,9 @@ type PostgresCheckKind = CheckKind;
|
|
|
17
17
|
interface PostgresCheckExpressionInput {
|
|
18
18
|
readonly tableName: string;
|
|
19
19
|
readonly columnName: string;
|
|
20
|
-
readonly many: boolean
|
|
20
|
+
readonly many: boolean | {
|
|
21
|
+
readonly elementNullable: boolean;
|
|
22
|
+
};
|
|
21
23
|
readonly memberValues: readonly (string | number)[] | undefined;
|
|
22
24
|
}
|
|
23
25
|
/**
|
|
@@ -38,9 +40,9 @@ interface PostgresCheckExpressionCandidate {
|
|
|
38
40
|
*
|
|
39
41
|
* A domain enum has no type-level enforcement, so membership is a
|
|
40
42
|
* predicate: `IN` for a scalar, and `<@` containment for an array — an array
|
|
41
|
-
* column cannot use `IN` at all (`operator does not exist: text[] = text`)
|
|
42
|
-
*
|
|
43
|
-
*
|
|
43
|
+
* column cannot use `IN` at all (`operator does not exist: text[] = text`).
|
|
44
|
+
* Array membership strips NULL elements first, leaving element nullability to
|
|
45
|
+
* the separate element-non-null check emitted for semantically strict lists.
|
|
44
46
|
*
|
|
45
47
|
* Array containment casts both operands to `numeric[]` for numeric members or
|
|
46
48
|
* `text[]` for string members, so different storage types share an operator
|
|
@@ -49,4 +51,4 @@ interface PostgresCheckExpressionCandidate {
|
|
|
49
51
|
declare function postgresRenderCheckExpressions(input: PostgresCheckExpressionInput): readonly PostgresCheckExpressionCandidate[];
|
|
50
52
|
//#endregion
|
|
51
53
|
export { postgresRenderCheckExpressions as i, PostgresCheckExpressionInput as n, PostgresCheckKind as r, PostgresCheckExpressionCandidate as t };
|
|
52
|
-
//# sourceMappingURL=check-expressions-
|
|
54
|
+
//# sourceMappingURL=check-expressions-CBIgoKhV-D7oTR8lp.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-expressions-CBIgoKhV-D7oTR8lp.d.mts","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/check-expressions-CBIgoKhV.d.mts"],"mappings":";;;;;;;;;KAQK,oBAAoB;;;;;;;UAOf;WACC;WACA;WACA;aACE;;WAEF;;;;;;;;UAQD;WACC,MAAM;;WAEN;;WAEA;;;;;;;;;;;;;;;iBAeM,+BAA+B,OAAO,wCAAwC"}
|
package/dist/{check-expressions-DLCs-SXx-itMQrUsX.mjs → check-expressions-DJNIFTHB-C86_fR5c.mjs}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-Bh-mnsSY-D6hnFPrP.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-DJNIFTHB.mjs
|
|
4
4
|
/**
|
|
5
5
|
* Renders the checks a Postgres column needs, as opaque predicate text.
|
|
6
6
|
*
|
|
7
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
|
-
* column cannot use `IN` at all (`operator does not exist: text[] = text`)
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* column cannot use `IN` at all (`operator does not exist: text[] = text`).
|
|
10
|
+
* Array membership strips NULL elements first, leaving element nullability to
|
|
11
|
+
* the separate element-non-null check emitted for semantically strict lists.
|
|
12
12
|
*
|
|
13
13
|
* Array containment casts both operands to `numeric[]` for numeric members or
|
|
14
14
|
* `text[]` for string members, so different storage types share an operator
|
|
@@ -17,6 +17,8 @@ import { invariant } from "@prisma/orm-framework/utils/assertions";
|
|
|
17
17
|
function postgresRenderCheckExpressions(input) {
|
|
18
18
|
const candidates = [];
|
|
19
19
|
const column = quoteIdentifier(input.columnName);
|
|
20
|
+
const isMany = input.many !== false;
|
|
21
|
+
const elementNullable = typeof input.many === "object" && input.many.elementNullable || "elementNullable" in input && input.elementNullable === true;
|
|
20
22
|
if (input.memberValues !== void 0) {
|
|
21
23
|
invariant(input.memberValues.length > 0, `check for "${input.tableName}"."${input.columnName}": empty member set; both authoring surfaces reject a member-less enum before rendering`);
|
|
22
24
|
const members = input.memberValues.map((value) => {
|
|
@@ -28,10 +30,10 @@ function postgresRenderCheckExpressions(input) {
|
|
|
28
30
|
candidates.push({
|
|
29
31
|
kind: "membership",
|
|
30
32
|
columnName: input.columnName,
|
|
31
|
-
expression:
|
|
33
|
+
expression: isMany ? `array_remove(${column}::${arrayType}, NULL) <@ ARRAY[${members}]::${arrayType}` : `${column} IN (${members})`
|
|
32
34
|
});
|
|
33
35
|
}
|
|
34
|
-
if (
|
|
36
|
+
if (isMany && !elementNullable) candidates.push({
|
|
35
37
|
kind: "elementNotNull",
|
|
36
38
|
columnName: input.columnName,
|
|
37
39
|
expression: `array_position(${column}, NULL) IS NULL`
|
|
@@ -41,4 +43,4 @@ function postgresRenderCheckExpressions(input) {
|
|
|
41
43
|
//#endregion
|
|
42
44
|
export { postgresRenderCheckExpressions as t };
|
|
43
45
|
|
|
44
|
-
//# sourceMappingURL=check-expressions-
|
|
46
|
+
//# sourceMappingURL=check-expressions-DJNIFTHB-C86_fR5c.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-expressions-DJNIFTHB-C86_fR5c.mjs","names":[],"sources":["../../../../3-targets/3-targets/postgres/dist/check-expressions-DJNIFTHB.mjs"],"sourcesContent":["import { r as quoteIdentifier, t as escapeLiteral } from \"./sql-utils-Bh-mnsSY.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* Array membership strips NULL elements first, leaving element nullability to\n* the separate element-non-null check emitted for semantically strict lists.\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\tconst isMany = input.many !== false;\n\tconst elementNullable = typeof input.many === \"object\" && input.many.elementNullable || \"elementNullable\" in input && input.elementNullable === true;\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: isMany ? `array_remove(${column}::${arrayType}, NULL) <@ ARRAY[${members}]::${arrayType}` : `${column} IN (${members})`\n\t\t});\n\t}\n\tif (isMany && !elementNullable) 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-DJNIFTHB.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAS,+BAA+B,OAAO;CAC9C,MAAM,aAAa,CAAC;CACpB,MAAM,SAAS,gBAAgB,MAAM,UAAU;CAC/C,MAAM,SAAS,MAAM,SAAS;CAC9B,MAAM,kBAAkB,OAAO,MAAM,SAAS,YAAY,MAAM,KAAK,mBAAmB,qBAAqB,SAAS,MAAM,oBAAoB;CAChJ,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,SAAS,gBAAgB,OAAO,IAAI,UAAU,mBAAmB,QAAQ,KAAK,cAAc,GAAG,OAAO,OAAO,QAAQ;EAClI,CAAC;CACF;CACA,IAAI,UAAU,CAAC,iBAAiB,WAAW,KAAK;EAC/C,MAAM;EACN,YAAY,MAAM;EAClB,YAAY,kBAAkB,OAAO;CACtC,CAAC;CACD,OAAO;AACR"}
|
|
@@ -7,15 +7,15 @@ import { P as setFallbackTemporal, n as NUMERIC_SCALE_RANGE, t as NUMERIC_PRECIS
|
|
|
7
7
|
import { i as PostgresRlsPolicy, n as PostgresRlsEnablement, o as PostgresRole } from "./postgres-schema-C8slJGZo-CFGUyJPt.mjs";
|
|
8
8
|
import { n as computeContentHash } from "./canonicalize-CrN3u_xM-D4MrOqcB.mjs";
|
|
9
9
|
import { m as postgresNowGeneratorIdFor, r as POLICY_BLOCK_KEYWORDS } from "./authoring-DULm2ZZP-DgykBF-F.mjs";
|
|
10
|
-
import { t as postgresRenderCheckExpressions } from "./check-expressions-
|
|
11
|
-
import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-
|
|
10
|
+
import { t as postgresRenderCheckExpressions } from "./check-expressions-DJNIFTHB-C86_fR5c.mjs";
|
|
11
|
+
import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-DDMTgiok-DuHh-HnB.mjs";
|
|
12
12
|
import { a as postgresDiffSubjectGranularity, i as postgresDiffSubjectEntityKind } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
|
|
13
13
|
import { t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs";
|
|
14
|
-
import { i as diffPostgresSchema } from "./diff-database-schema-
|
|
14
|
+
import { i as diffPostgresSchema } from "./diff-database-schema-Cd6igMdS-CD3R7EC4.mjs";
|
|
15
15
|
import { t as PostgresContractSerializer } from "./postgres-contract-view-BEp5ikai-BmYXd1MR.mjs";
|
|
16
|
-
import { a as postgresContractToSchema } from "./postgres-migration-
|
|
17
|
-
import { t as createPostgresMigrationPlanner } from "./planner-
|
|
18
|
-
import { a as buildMapAttribute, d as inferPostgresPslContract, f as namedArg, h as positionalArg, i as buildIndexAttribute, m as parseDefaultAttributeString, n as buildAttribute, o as buildModelConstraintAttribute, r as buildCheckAttribute, s as buildNativeEnumBlock, t as SYNTHETIC_SPAN, u as createPostgresTypeMap } from "./infer-psl-contract-
|
|
16
|
+
import { a as postgresContractToSchema } from "./postgres-migration-4qSv6qtX-Cj41qUBf.mjs";
|
|
17
|
+
import { t as createPostgresMigrationPlanner } from "./planner-CbuWXI6E-CrlrOSd3.mjs";
|
|
18
|
+
import { a as buildMapAttribute, d as inferPostgresPslContract, f as namedArg, h as positionalArg, i as buildIndexAttribute, m as parseDefaultAttributeString, n as buildAttribute, o as buildModelConstraintAttribute, r as buildCheckAttribute, s as buildNativeEnumBlock, t as SYNTHETIC_SPAN, u as createPostgresTypeMap } from "./infer-psl-contract-seu9C4tb-zycCE7Sk.mjs";
|
|
19
19
|
import { escapePslString } from "@prisma/orm-family-sql/relational-core/ast";
|
|
20
20
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
21
21
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
@@ -616,7 +616,7 @@ function refuseFieldColumnMismatch(input) {
|
|
|
616
616
|
const fixForEarlierRelease = `If an earlier release emitted this contract, emit it again. ${fix}`;
|
|
617
617
|
if (input.singleTableVariant && !column.nullable) throw unsupported(`column ${coordinate} of single-table variant "${input.modelName}" is not nullable, which cannot be written in Prisma 8 PSL.`, "The PSL source makes every column of a single-table variant nullable, because the base's other rows leave it empty.", fix, { coordinate });
|
|
618
618
|
if (!input.singleTableVariant && field.nullable !== column.nullable) throw unsupported(`field ${coordinate} is ${field.nullable ? "optional" : "required"} but its column is ${column.nullable ? "nullable" : "not nullable"}, which cannot be written in Prisma 8 PSL.`, "PSL writes `?` once, and the PSL source derives the column from the field.", fix, { coordinate });
|
|
619
|
-
if ((field.type.kind === "scalar" && field.many
|
|
619
|
+
if ((field.type.kind === "scalar" && !!field.many) !== (column.many !== false)) throw unsupported(`field ${coordinate} is ${field.many ? "a list" : "not a list"} but its column is ${column.many !== false ? "a list" : "not a list"}, which cannot be written in Prisma 8 PSL.`, "PSL writes `[]` once: the PSL source stores a list of scalars in a list column, and a list of value objects in one JSON column.", fix, { coordinate });
|
|
620
620
|
if (field.type.kind === "scalar" && (field.type.codecId !== column.codecId || !sameJson(resolvedTypeParams(field.type, void 0), resolvedTypeParams(column, input.namedTypes)))) throw unsupported(`field ${coordinate} has a different codec or type parameters from its column, which cannot be written in Prisma 8 PSL.`, "The PSL source derives a scalar field's codec and type parameters from its column.", fixForEarlierRelease, { coordinate });
|
|
621
621
|
if (field.type.kind !== "scalar" || column.codecId === "pg/enum@1") return;
|
|
622
622
|
const enumName = column.valueSet?.entityName;
|
|
@@ -1257,7 +1257,8 @@ function buildCompositeTypes(input) {
|
|
|
1257
1257
|
typeName,
|
|
1258
1258
|
...ifDefined("typeConstructor", typeConstructor),
|
|
1259
1259
|
optional: field.nullable,
|
|
1260
|
-
list: field.many
|
|
1260
|
+
list: !!field.many,
|
|
1261
|
+
elementOptional: !!field.many && field.many.elementNullable,
|
|
1261
1262
|
attributes: [],
|
|
1262
1263
|
span: SYNTHETIC_SPAN
|
|
1263
1264
|
};
|
|
@@ -1410,7 +1411,7 @@ function derivedChecks(input) {
|
|
|
1410
1411
|
for (const candidate of postgresRenderCheckExpressions({
|
|
1411
1412
|
tableName: input.tableName,
|
|
1412
1413
|
columnName,
|
|
1413
|
-
many: column.many
|
|
1414
|
+
many: column.many,
|
|
1414
1415
|
memberValues: memberValues?.length === enumValues?.length ? memberValues : void 0
|
|
1415
1416
|
})) {
|
|
1416
1417
|
if (waived.has(candidate.kind)) continue;
|
|
@@ -1866,7 +1867,7 @@ function buildColumnDefault(input) {
|
|
|
1866
1867
|
dataTypeEntries: context.authoringContributions.dataTypes,
|
|
1867
1868
|
dataTypes: context.dataTypeLookup,
|
|
1868
1869
|
columnDataType: context.codecLookup.descriptorFor(input.isEnum ? PG_TEXT_CODEC_ID : input.column.codecId)?.dataType,
|
|
1869
|
-
list: input.column.many
|
|
1870
|
+
list: input.column.many !== false
|
|
1870
1871
|
});
|
|
1871
1872
|
if (result === void 0) refuseUnwritableLiteralDefault({
|
|
1872
1873
|
coordinate,
|
|
@@ -2058,7 +2059,8 @@ function buildScalarFields(input) {
|
|
|
2058
2059
|
typeName,
|
|
2059
2060
|
...ifDefined("typeConstructor", typeConstructor),
|
|
2060
2061
|
optional: field.nullable,
|
|
2061
|
-
list: field.many
|
|
2062
|
+
list: !!field.many,
|
|
2063
|
+
elementOptional: !!field.many && field.many.elementNullable,
|
|
2062
2064
|
attributes: scalarFieldAttributes({
|
|
2063
2065
|
column,
|
|
2064
2066
|
fieldName,
|
|
@@ -2692,4 +2694,4 @@ const postgresTargetDescriptor = createPostgresTargetDescriptor();
|
|
|
2692
2694
|
//#endregion
|
|
2693
2695
|
export { postgresScalarAuthoringTypes as n, postgresTargetDescriptor as r, postgresNativeAuthoringTypes as t };
|
|
2694
2696
|
|
|
2695
|
-
//# sourceMappingURL=control-
|
|
2697
|
+
//# sourceMappingURL=control-9MzjJLOE.mjs.map
|