@prisma/orm-target-postgres 8.0.0-rc.1-dev.5 → 8.0.0-rc.1-dev.7
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-Ddgpoq1S-C7ylX0yv.mjs → adapter-Ddgpoq1S-BjseYB90.mjs} +3 -3
- package/dist/{adapter-Ddgpoq1S-C7ylX0yv.mjs.map → adapter-Ddgpoq1S-BjseYB90.mjs.map} +1 -1
- package/dist/adapter.mjs +3 -3
- package/dist/adapter__adapter.mjs +1 -1
- package/dist/adapter__control.mjs +2 -2
- package/dist/adapter__runtime.mjs +4 -4
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/{codec-descriptor-CB6x0xEu-C-Zn2IEz.mjs → codec-descriptor-LT7BpQta-BaDM8UQQ.mjs} +8 -5
- package/dist/{codec-descriptor-CB6x0xEu-C-Zn2IEz.mjs.map → codec-descriptor-LT7BpQta-BaDM8UQQ.mjs.map} +1 -1
- package/dist/{codecs-DNf0Tmab-Bsdj1npb.mjs → codecs-B5ZWvB6I-DyHzqNQV.mjs} +3 -3
- package/dist/{codecs-DNf0Tmab-Bsdj1npb.mjs.map → codecs-B5ZWvB6I-DyHzqNQV.mjs.map} +1 -1
- package/dist/{codecs-BbkV3FUQ.mjs → codecs-BqvYbD8j.mjs} +3 -3
- package/dist/{codecs-BbkV3FUQ.mjs.map → codecs-BqvYbD8j.mjs.map} +1 -1
- package/dist/{control-adapter-D4fT5c42-CosMjFPJ.mjs → control-adapter-D4fT5c42-xeEY2Qy4.mjs} +4 -4
- package/dist/{control-adapter-D4fT5c42-CosMjFPJ.mjs.map → control-adapter-D4fT5c42-xeEY2Qy4.mjs.map} +1 -1
- package/dist/{control-Bg9zfwmi.mjs → control-gLnLIG1B.mjs} +5 -5
- package/dist/{control-Bg9zfwmi.mjs.map → control-gLnLIG1B.mjs.map} +1 -1
- package/dist/{control-6WFTtLAM.mjs → control-hqYHq_Y_.mjs} +6 -5
- package/dist/{control-6WFTtLAM.mjs.map → control-hqYHq_Y_.mjs.map} +1 -1
- package/dist/{control-policy-DHKvUOIr-DAyVIwLu.mjs → control-policy-DsZAbgzB-DRv2BiZp.mjs} +4 -4
- package/dist/{control-policy-DHKvUOIr-DAyVIwLu.mjs.map → control-policy-DsZAbgzB-DRv2BiZp.mjs.map} +1 -1
- package/dist/{descriptor-meta--MCrvIgj-CwlRmzIb.mjs → descriptor-meta--MCrvIgj-CjXgTwsw.mjs} +3 -3
- package/dist/{descriptor-meta--MCrvIgj-CwlRmzIb.mjs.map → descriptor-meta--MCrvIgj-CjXgTwsw.mjs.map} +1 -1
- package/dist/{descriptor-meta-Bm8_p6kK-CjDa5ovb.mjs → descriptor-meta-CwrzNafe-Dhr0-5KZ.mjs} +3 -3
- package/dist/{descriptor-meta-Bm8_p6kK-CjDa5ovb.mjs.map → descriptor-meta-CwrzNafe-Dhr0-5KZ.mjs.map} +1 -1
- package/dist/{diff-database-schema-ad-D4dAq-DV_k33bS.mjs → diff-database-schema-wkN6289o-CNZoBfTy.mjs} +3 -3
- package/dist/{diff-database-schema-ad-D4dAq-DV_k33bS.mjs.map → diff-database-schema-wkN6289o-CNZoBfTy.mjs.map} +1 -1
- package/dist/driver.mjs +1 -1
- package/dist/driver__control.mjs +1 -1
- package/dist/migration-PTHAY9Cv.mjs.map +1 -1
- package/dist/{op-factory-call-Brgoyup0-PVFU69JM.mjs → op-factory-call-CyayLh7T-Dp409cas.mjs} +3 -3
- package/dist/{op-factory-call-Brgoyup0-PVFU69JM.mjs.map → op-factory-call-CyayLh7T-Dp409cas.mjs.map} +1 -1
- package/dist/{planner-BycBXxqk-DUExzUoz.mjs → planner-Z_q8OX5_-Ccaa65Pc.mjs} +6 -6
- package/dist/{planner-BycBXxqk-DUExzUoz.mjs.map → planner-Z_q8OX5_-Ccaa65Pc.mjs.map} +1 -1
- package/dist/{planner-ddl-builders-DJrx9cJg-Ct2ly5Em.mjs → planner-ddl-builders-BVKsooij-B_abn0ED.mjs} +3 -3
- package/dist/{planner-ddl-builders-DJrx9cJg-Ct2ly5Em.mjs.map → planner-ddl-builders-BVKsooij-B_abn0ED.mjs.map} +1 -1
- package/dist/{planner-produced-postgres-migration-B9P7yeDs-BgEtBGET.mjs → planner-produced-postgres-migration-CDdv2rTU-C6zFqgeb.mjs} +3 -3
- package/dist/{planner-produced-postgres-migration-B9P7yeDs-BgEtBGET.mjs.map → planner-produced-postgres-migration-CDdv2rTU-C6zFqgeb.mjs.map} +1 -1
- package/dist/{postgres-migration-BOVlNbh2-D3by-atW.mjs → postgres-migration-BdY4uI_M-CujBOPWE.mjs} +3 -3
- package/dist/{postgres-migration-BOVlNbh2-D3by-atW.mjs.map → postgres-migration-BdY4uI_M-CujBOPWE.mjs.map} +1 -1
- package/dist/{sql-renderer-CZE98PJj-E5yVGXmL.mjs → sql-renderer-CZE98PJj-BmLyMQw_.mjs} +2 -2
- package/dist/{sql-renderer-CZE98PJj-E5yVGXmL.mjs.map → sql-renderer-CZE98PJj-BmLyMQw_.mjs.map} +1 -1
- package/dist/target.mjs +11 -11
- package/dist/target__codec-descriptor.mjs +1 -1
- package/dist/target__codecs.mjs +2 -2
- package/dist/target__control.mjs +1 -1
- package/dist/target__diff-database-schema.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.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.mjs +2 -2
- package/package.json +9 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as renderLoweredSql, t as adapterError } from "./sql-renderer-CZE98PJj-
|
|
2
|
-
import { i as createPostgresCodecRegistryWithBuiltins, t as PostgresControlAdapter } from "./control-adapter-D4fT5c42-
|
|
1
|
+
import { n as renderLoweredSql, t as adapterError } from "./sql-renderer-CZE98PJj-BmLyMQw_.mjs";
|
|
2
|
+
import { i as createPostgresCodecRegistryWithBuiltins, t as PostgresControlAdapter } from "./control-adapter-D4fT5c42-xeEY2Qy4.mjs";
|
|
3
3
|
import { isDdlNode } from "@prisma/orm-family-sql/relational-core/ast";
|
|
4
4
|
import { APP_SPACE_ID } from "@prisma/orm-framework/components/control";
|
|
5
5
|
//#region ../../../3-targets/6-adapters/postgres/dist/adapter-Ddgpoq1S.mjs
|
|
@@ -73,4 +73,4 @@ function createPostgresAdapterWithCodecRegistry(codecRegistry) {
|
|
|
73
73
|
//#endregion
|
|
74
74
|
export { createPostgresAdapterWithCodecRegistry as n, postgresRawCodecInferer as r, createPostgresAdapter as t };
|
|
75
75
|
|
|
76
|
-
//# sourceMappingURL=adapter-Ddgpoq1S-
|
|
76
|
+
//# sourceMappingURL=adapter-Ddgpoq1S-BjseYB90.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-Ddgpoq1S-
|
|
1
|
+
{"version":3,"file":"adapter-Ddgpoq1S-BjseYB90.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/adapter-Ddgpoq1S.mjs"],"sourcesContent":["import { n as adapterError, t as renderLoweredSql } from \"./sql-renderer-CZE98PJj.mjs\";\nimport { i as createPostgresCodecRegistryWithBuiltins, t as PostgresControlAdapter } from \"./control-adapter-D4fT5c42.mjs\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { isDdlNode } from \"@internal/sql-relational-core/ast\";\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}\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};\n/** Codec-id lookup for bare-literal interpolations used by `fns.raw` on a postgres client. Contributed as the descriptor's static `rawCodecInferer` slot. */\nconst postgresRawCodecInferer = { inferCodec(value) {\n\tswitch (typeof value) {\n\t\tcase \"number\": return Number.isSafeInteger(value) && value % 1 === 0 ? \"pg/int4\" : \"pg/float8\";\n\t\tcase \"bigint\": return \"pg/int8\";\n\t\tcase \"string\": return \"pg/text\";\n\t\tcase \"boolean\": return \"pg/bool\";\n\t\tcase \"object\": if (value instanceof Uint8Array) return \"pg/bytea\";\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-Ddgpoq1S.mjs.map"],"mappings":";;;;;AAKA,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;CACb;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;;AAEA,MAAM,0BAA0B,EAAE,WAAW,OAAO;CACnD,QAAQ,OAAO,OAAf;EACC,KAAK,UAAU,OAAO,OAAO,cAAc,KAAK,KAAK,QAAQ,MAAM,IAAI,YAAY;EACnF,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.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as qualifyName, r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-BnBlQxyh-DaX9Nb7Z.mjs";
|
|
2
2
|
import { t as parsePostgresDefault } from "./default-normalizer-Ba5ZebHM-isV86rjy.mjs";
|
|
3
3
|
import { t as normalizeSchemaNativeType } from "./native-type-normalizer-yvd3tqv-.mjs";
|
|
4
|
-
import { n as renderLoweredSql } from "./sql-renderer-CZE98PJj-
|
|
5
|
-
import { i as createPostgresCodecRegistryWithBuiltins, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from "./control-adapter-D4fT5c42-
|
|
6
|
-
import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-Ddgpoq1S-
|
|
4
|
+
import { n as renderLoweredSql } from "./sql-renderer-CZE98PJj-BmLyMQw_.mjs";
|
|
5
|
+
import { i as createPostgresCodecRegistryWithBuiltins, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from "./control-adapter-D4fT5c42-xeEY2Qy4.mjs";
|
|
6
|
+
import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-Ddgpoq1S-BjseYB90.mjs";
|
|
7
7
|
import { _ as timestamptzColumn, a as float4Column, b as varcharColumn, c as int4Column, d as jsonColumn, f as jsonbColumn, g as timestampColumn, h as timeColumn, i as charColumn, l as int8Column, m as textColumn, n as boolColumn, o as float8Column, p as numericColumn, r as byteaColumn, s as int2Column, t as bitColumn, u as intervalColumn, v as timetzColumn, y as varbitColumn } from "./column-types-Bh92dNjD.mjs";
|
|
8
8
|
export { PostgresControlAdapter, bitColumn, boolColumn, byteaColumn, charColumn, createPostgresAdapter, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, escapeLiteral, float4Column, float8Column, int2Column, int4Column, int8Column, intervalColumn, jsonColumn, jsonbColumn, normalizeSchemaNativeType, numericColumn, parsePostgresDefault, postgresRawCodecInferer, qualifyName, quoteIdentifier, renderLoweredSql, textColumn, timeColumn, timestampColumn, timestamptzColumn, timetzColumn, varbitColumn, varcharColumn };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-Ddgpoq1S-
|
|
1
|
+
import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-Ddgpoq1S-BjseYB90.mjs";
|
|
2
2
|
export { createPostgresAdapter, postgresRawCodecInferer };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as qualifyName, r as quoteIdentifier, t as escapeLiteral } from "./sql-utils-BnBlQxyh-DaX9Nb7Z.mjs";
|
|
2
2
|
import { t as parsePostgresDefault } from "./default-normalizer-Ba5ZebHM-isV86rjy.mjs";
|
|
3
3
|
import { t as normalizeSchemaNativeType } from "./native-type-normalizer-yvd3tqv-.mjs";
|
|
4
|
-
import { i as createPostgresCodecRegistryWithBuiltins, n as assemblePostgresCodecRegistry, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from "./control-adapter-D4fT5c42-
|
|
5
|
-
import { t as postgresAdapterDescriptorMeta } from "./descriptor-meta--MCrvIgj-
|
|
4
|
+
import { i as createPostgresCodecRegistryWithBuiltins, n as assemblePostgresCodecRegistry, r as createPostgresBuiltinCodecLookup, t as PostgresControlAdapter } from "./control-adapter-D4fT5c42-xeEY2Qy4.mjs";
|
|
5
|
+
import { t as postgresAdapterDescriptorMeta } from "./descriptor-meta--MCrvIgj-CjXgTwsw.mjs";
|
|
6
6
|
import { timestampNowControlDescriptor } from "@prisma/orm-family-sql/family/control";
|
|
7
7
|
import { int, num, oneOf, optional, str } from "@prisma/orm-framework/psl-parser";
|
|
8
8
|
import { builtinGeneratorRegistryMetadata } from "@prisma/orm-framework/ids";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as postgresCodecRegistry } from "./codecs-
|
|
2
|
-
import { n as assemblePostgresCodecRegistry } from "./control-adapter-D4fT5c42-
|
|
3
|
-
import { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from "./adapter-Ddgpoq1S-
|
|
4
|
-
import { n as postgresQueryOperations, t as postgresAdapterDescriptorMeta } from "./descriptor-meta--MCrvIgj-
|
|
1
|
+
import { n as postgresCodecRegistry } from "./codecs-BqvYbD8j.mjs";
|
|
2
|
+
import { n as assemblePostgresCodecRegistry } from "./control-adapter-D4fT5c42-xeEY2Qy4.mjs";
|
|
3
|
+
import { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from "./adapter-Ddgpoq1S-BjseYB90.mjs";
|
|
4
|
+
import { n as postgresQueryOperations, t as postgresAdapterDescriptorMeta } from "./descriptor-meta--MCrvIgj-CjXgTwsw.mjs";
|
|
5
5
|
import { builtinGeneratorIds } from "@prisma/orm-framework/ids";
|
|
6
6
|
import { timestampNowRuntimeGenerator } from "@prisma/orm-family-sql/family/runtime";
|
|
7
7
|
import { generateId } from "@prisma/orm-framework/ids/runtime";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as renderLoweredSql } from "./sql-renderer-CZE98PJj-
|
|
1
|
+
import { n as renderLoweredSql } from "./sql-renderer-CZE98PJj-BmLyMQw_.mjs";
|
|
2
2
|
export { renderLoweredSql };
|
package/dist/{codec-descriptor-CB6x0xEu-C-Zn2IEz.mjs → codec-descriptor-LT7BpQta-BaDM8UQQ.mjs}
RENAMED
|
@@ -2,7 +2,7 @@ import { CaseExpr, ColumnRef, DerivedTableSource, FunctionSource, JsonArrayAggEx
|
|
|
2
2
|
import { CodecDescriptorImpl, validateCodecTypeParams } from "@prisma/orm-framework/components/codec";
|
|
3
3
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
4
4
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
5
|
-
//#region ../../../3-targets/3-targets/postgres/dist/codec-descriptor-
|
|
5
|
+
//#region ../../../3-targets/3-targets/postgres/dist/codec-descriptor-LT7BpQta.mjs
|
|
6
6
|
const POSTGRES_CODEC_DESCRIPTOR_KIND = "postgres-codec";
|
|
7
7
|
const ARRAY_INPUT_ALIAS = "array_input";
|
|
8
8
|
const ARRAY_ELEMENT_ALIAS = "array_element";
|
|
@@ -111,16 +111,19 @@ function buildPostgresCodecDescriptorRegistry(descriptors) {
|
|
|
111
111
|
for (const descriptor of descriptors) {
|
|
112
112
|
if (!isPostgresCodecDescriptor(descriptor)) {
|
|
113
113
|
const codecId = candidateCodecId(descriptor);
|
|
114
|
-
throw structuredError("
|
|
114
|
+
throw structuredError("RUNTIME.CODEC_DESCRIPTOR_INVALID", `Codec descriptor '${codecId}' is not a valid PostgreSQL codec descriptor.`, {
|
|
115
115
|
why: "PostgreSQL codec registries require the postgres-codec discriminant and complete target descriptor methods.",
|
|
116
116
|
fix: "Extend PostgresCodecDescriptor or adapt a generic descriptor with postgresCodec().",
|
|
117
117
|
meta: { codecId }
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
|
-
if (byId.has(descriptor.codecId)) throw structuredError("
|
|
120
|
+
if (byId.has(descriptor.codecId)) throw structuredError("RUNTIME.DUPLICATE_CODEC", `Duplicate PostgreSQL codec descriptor id '${descriptor.codecId}'.`, {
|
|
121
121
|
why: "Each codecId must resolve to exactly one PostgreSQL descriptor during registry composition.",
|
|
122
122
|
fix: "Remove the duplicate target, adapter, or extension contribution.",
|
|
123
|
-
meta: {
|
|
123
|
+
meta: {
|
|
124
|
+
codecId: descriptor.codecId,
|
|
125
|
+
target: "postgres"
|
|
126
|
+
}
|
|
124
127
|
});
|
|
125
128
|
byId.set(descriptor.codecId, descriptor);
|
|
126
129
|
}
|
|
@@ -132,4 +135,4 @@ function candidateCodecId(value) {
|
|
|
132
135
|
//#endregion
|
|
133
136
|
export { postgresCodec as a, isPostgresCodecDescriptor as i, buildPostgresCodecDescriptorRegistry as n, definePostgresCodecs as r, PostgresCodecDescriptor as t };
|
|
134
137
|
|
|
135
|
-
//# sourceMappingURL=codec-descriptor-
|
|
138
|
+
//# sourceMappingURL=codec-descriptor-LT7BpQta-BaDM8UQQ.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec-descriptor-CB6x0xEu-C-Zn2IEz.mjs","names":["#descriptors"],"sources":["../../../../3-targets/3-targets/postgres/dist/codec-descriptor-CB6x0xEu.mjs"],"sourcesContent":["import { CaseExpr, ColumnRef, DerivedTableSource, FunctionSource, JsonArrayAggExpr, LiteralExpr, NativeJsonValueProjection, NullCheckExpr, OrderByItem, ProjectionItem, SelectAst, SubqueryExpr } from \"@internal/sql-relational-core/ast\";\nimport { CodecDescriptorImpl, validateCodecTypeParams } from \"@internal/framework-components/codec\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/core/codec-descriptor.ts\nconst POSTGRES_CODEC_DESCRIPTOR_KIND = \"postgres-codec\";\nconst ARRAY_INPUT_ALIAS = \"array_input\";\nconst ARRAY_ELEMENT_ALIAS = \"array_element\";\nconst ARRAY_VALUE_COLUMN = \"value\";\nconst ARRAY_ORDINALITY_COLUMN = \"ordinality\";\nvar PostgresCodecDescriptor = class extends CodecDescriptorImpl {\n\tdescriptorKind = POSTGRES_CODEC_DESCRIPTOR_KIND;\n\tjsonArrayProjection(expression, params) {\n\t\tconst boundArray = ColumnRef.of(ARRAY_INPUT_ALIAS, ARRAY_VALUE_COLUMN);\n\t\tconst element = ColumnRef.of(ARRAY_ELEMENT_ALIAS, ARRAY_VALUE_COLUMN);\n\t\tconst ordinality = ColumnRef.of(ARRAY_ELEMENT_ALIAS, ARRAY_ORDINALITY_COLUMN);\n\t\tconst projectedElement = CaseExpr.of([{\n\t\t\tcondition: NullCheckExpr.isNull(element),\n\t\t\tvalue: LiteralExpr.of(null)\n\t\t}], this.jsonProjection(element, params));\n\t\tconst aggregate = JsonArrayAggExpr.of(new NativeJsonValueProjection(projectedElement), \"emptyArray\", [OrderByItem.asc(ordinality)]);\n\t\tconst aggregateQuery = SelectAst.from(FunctionSource.of(\"unnest\", [boundArray], {\n\t\t\talias: ARRAY_ELEMENT_ALIAS,\n\t\t\tcolumnAliases: [ARRAY_VALUE_COLUMN, ARRAY_ORDINALITY_COLUMN]\n\t\t}).withOrdinality()).withProjection([ProjectionItem.of(ARRAY_VALUE_COLUMN, aggregate)]);\n\t\tconst arrayResult = CaseExpr.of([{\n\t\t\tcondition: NullCheckExpr.isNull(boundArray),\n\t\t\tvalue: LiteralExpr.of(null)\n\t\t}], SubqueryExpr.of(aggregateQuery));\n\t\tconst inputBinding = SelectAst.noFrom().withProjection([ProjectionItem.of(ARRAY_VALUE_COLUMN, expression)]);\n\t\treturn SubqueryExpr.of(SelectAst.from(DerivedTableSource.as(ARRAY_INPUT_ALIAS, inputBinding)).withProjection([ProjectionItem.of(ARRAY_VALUE_COLUMN, arrayResult)]));\n\t}\n\tnativeTypeFor(ref) {\n\t\treturn this.nativeType(this.validateParams(ref));\n\t}\n\tprojectJson(expression, ref) {\n\t\tconst params = this.validateParams(ref);\n\t\treturn ref.many === true ? this.jsonArrayProjection(expression, params) : this.jsonProjection(expression, params);\n\t}\n\tvalidateParams(ref) {\n\t\treturn blindCast(validateCodecTypeParams(this, ref));\n\t}\n};\nvar PostgresCodecDescriptorAdapter = class extends PostgresCodecDescriptor {\n\tdescriptor;\n\toptions;\n\tcodecId;\n\ttraits;\n\ttargetTypes;\n\tparamsSchema;\n\trenderOutputType;\n\trenderInputType;\n\trenderValueLiteral;\n\tfactory;\n\tconstructor(descriptor, options) {\n\t\tsuper();\n\t\tthis.descriptor = descriptor;\n\t\tthis.options = options;\n\t\tthis.codecId = descriptor.codecId;\n\t\tthis.traits = descriptor.traits;\n\t\tthis.targetTypes = descriptor.targetTypes;\n\t\tthis.paramsSchema = descriptor.paramsSchema;\n\t\tthis.factory = (params) => descriptor.factory(params);\n\t\tconst renderOutputType = descriptor.renderOutputType;\n\t\tif (renderOutputType !== void 0) this.renderOutputType = (params) => renderOutputType.call(descriptor, params);\n\t\tconst renderInputType = descriptor.renderInputType;\n\t\tif (renderInputType !== void 0) this.renderInputType = (params) => renderInputType.call(descriptor, params);\n\t\tconst renderValueLiteral = descriptor.renderValueLiteral;\n\t\tif (renderValueLiteral !== void 0) this.renderValueLiteral = (value, side) => renderValueLiteral.call(descriptor, value, side);\n\t}\n\tget isParameterized() {\n\t\treturn this.descriptor.isParameterized;\n\t}\n\tnativeType(params) {\n\t\treturn this.options.nativeType(params);\n\t}\n\tjsonProjection(expression, params) {\n\t\treturn this.options.jsonProjection(expression, params);\n\t}\n\tjsonArrayProjection(expression, params) {\n\t\treturn this.options.jsonArrayProjection === void 0 ? super.jsonArrayProjection(expression, params) : this.options.jsonArrayProjection(expression, params);\n\t}\n};\nfunction postgresCodec(descriptor, options) {\n\treturn blindCast(new PostgresCodecDescriptorAdapter(descriptor, options));\n}\nfunction definePostgresCodecs(descriptors) {\n\treturn descriptors;\n}\nfunction isPostgresCodecDescriptor(value) {\n\treturn typeof value === \"object\" && value !== null && \"descriptorKind\" in value && value.descriptorKind === POSTGRES_CODEC_DESCRIPTOR_KIND && \"codecId\" in value && typeof value.codecId === \"string\" && \"traits\" in value && Array.isArray(value.traits) && \"targetTypes\" in value && Array.isArray(value.targetTypes) && value.targetTypes.every((targetType) => typeof targetType === \"string\") && \"paramsSchema\" in value && isObjectLike(value.paramsSchema) && \"~standard\" in value.paramsSchema && isObjectLike(value.paramsSchema[\"~standard\"]) && \"validate\" in value.paramsSchema[\"~standard\"] && typeof value.paramsSchema[\"~standard\"].validate === \"function\" && \"isParameterized\" in value && typeof value.isParameterized === \"boolean\" && \"factory\" in value && typeof value.factory === \"function\" && \"nativeTypeFor\" in value && typeof value.nativeTypeFor === \"function\" && \"projectJson\" in value && typeof value.projectJson === \"function\";\n}\nfunction isObjectLike(value) {\n\treturn typeof value === \"object\" && value !== null || typeof value === \"function\";\n}\nvar PostgresCodecDescriptorRegistryImpl = class {\n\t#descriptors;\n\tconstructor(descriptors) {\n\t\tthis.#descriptors = descriptors;\n\t\tObject.freeze(this);\n\t}\n\tdescriptorFor(codecId) {\n\t\treturn this.#descriptors.get(codecId);\n\t}\n\t*values() {\n\t\tyield* this.#descriptors.values();\n\t}\n};\nfunction buildPostgresCodecDescriptorRegistry(descriptors) {\n\tconst byId = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tif (!isPostgresCodecDescriptor(descriptor)) {\n\t\t\tconst codecId = candidateCodecId(descriptor);\n\t\t\tthrow structuredError(\"POSTGRES.CODEC_DESCRIPTOR_INVALID\", `Codec descriptor '${codecId}' is not a valid PostgreSQL codec descriptor.`, {\n\t\t\t\twhy: \"PostgreSQL codec registries require the postgres-codec discriminant and complete target descriptor methods.\",\n\t\t\t\tfix: \"Extend PostgresCodecDescriptor or adapt a generic descriptor with postgresCodec().\",\n\t\t\t\tmeta: { codecId }\n\t\t\t});\n\t\t}\n\t\tif (byId.has(descriptor.codecId)) throw structuredError(\"POSTGRES.CODEC_DESCRIPTOR_DUPLICATE\", `Duplicate PostgreSQL codec descriptor id '${descriptor.codecId}'.`, {\n\t\t\twhy: \"Each codecId must resolve to exactly one PostgreSQL descriptor during registry composition.\",\n\t\t\tfix: \"Remove the duplicate target, adapter, or extension contribution.\",\n\t\t\tmeta: { codecId: descriptor.codecId }\n\t\t});\n\t\tbyId.set(descriptor.codecId, descriptor);\n\t}\n\treturn new PostgresCodecDescriptorRegistryImpl(byId);\n}\nfunction candidateCodecId(value) {\n\treturn typeof value === \"object\" && value !== null && \"codecId\" in value && typeof value.codecId === \"string\" ? value.codecId : \"<unknown>\";\n}\n//#endregion\nexport { postgresCodec as a, isPostgresCodecDescriptor as i, buildPostgresCodecDescriptorRegistry as n, definePostgresCodecs as r, PostgresCodecDescriptor as t };\n\n//# sourceMappingURL=codec-descriptor-CB6x0xEu.mjs.map"],"mappings":";;;;;AAKA,MAAM,iCAAiC;AACvC,MAAM,oBAAoB;AAC1B,MAAM,sBAAsB;AAC5B,MAAM,qBAAqB;AAC3B,MAAM,0BAA0B;AAChC,IAAI,0BAA0B,cAAc,oBAAoB;CAC/D,iBAAiB;CACjB,oBAAoB,YAAY,QAAQ;EACvC,MAAM,aAAa,UAAU,GAAG,mBAAmB,kBAAkB;EACrE,MAAM,UAAU,UAAU,GAAG,qBAAqB,kBAAkB;EACpE,MAAM,aAAa,UAAU,GAAG,qBAAqB,uBAAuB;EAC5E,MAAM,mBAAmB,SAAS,GAAG,CAAC;GACrC,WAAW,cAAc,OAAO,OAAO;GACvC,OAAO,YAAY,GAAG,IAAI;EAC3B,CAAC,GAAG,KAAK,eAAe,SAAS,MAAM,CAAC;EACxC,MAAM,YAAY,iBAAiB,GAAG,IAAI,0BAA0B,gBAAgB,GAAG,cAAc,CAAC,YAAY,IAAI,UAAU,CAAC,CAAC;EAClI,MAAM,iBAAiB,UAAU,KAAK,eAAe,GAAG,UAAU,CAAC,UAAU,GAAG;GAC/E,OAAO;GACP,eAAe,CAAC,oBAAoB,uBAAuB;EAC5D,CAAC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A,SAAS,aAAa,OAAO;CAC5B,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,OAAO,UAAU;AACxE;AACA,IAAI,sCAAsC,MAAM;CAC/C;CACA,YAAY,aAAa;EACxB,KAAKA,eAAe;EACpB,OAAO,OAAO,IAAI;CACnB;CACA,cAAc,SAAS;EACtB,OAAO,KAAKA,aAAa,IAAI,OAAO;CACrC;CACA,CAAC,SAAS;EACT,OAAO,KAAKA,aAAa,OAAO;CACjC;AACD;AACA,SAAS,qCAAqC,aAAa;CAC1D,MAAM,uBAAuB,IAAI,IAAI;CACrC,KAAK,MAAM,cAAc,aAAa;EACrC,IAAI,CAAC,0BAA0B,UAAU,GAAG;GAC3C,MAAM,UAAU,iBAAiB,UAAU;GAC3C,MAAM,gBAAgB,qCAAqC,qBAAqB,QAAQ,gDAAgD;IACvI,KAAK;IACL,KAAK;IACL,MAAM,EAAE,QAAQ;GACjB,CAAC;EACF;EACA,IAAI,KAAK,IAAI,WAAW,OAAO,GAAG,MAAM,gBAAgB,uCAAuC,6CAA6C,WAAW,QAAQ,KAAK;GACnK,KAAK;GACL,KAAK;GACL,MAAM,EAAE,SAAS,WAAW,QAAQ;EACrC,CAAC;EACD,KAAK,IAAI,WAAW,SAAS,UAAU;CACxC;CACA,OAAO,IAAI,oCAAoC,IAAI;AACpD;AACA,SAAS,iBAAiB,OAAO;CAChC,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,aAAa,SAAS,OAAO,MAAM,YAAY,WAAW,MAAM,UAAU;AACjI"}
|
|
1
|
+
{"version":3,"file":"codec-descriptor-LT7BpQta-BaDM8UQQ.mjs","names":["#descriptors"],"sources":["../../../../3-targets/3-targets/postgres/dist/codec-descriptor-LT7BpQta.mjs"],"sourcesContent":["import { CaseExpr, ColumnRef, DerivedTableSource, FunctionSource, JsonArrayAggExpr, LiteralExpr, NativeJsonValueProjection, NullCheckExpr, OrderByItem, ProjectionItem, SelectAst, SubqueryExpr } from \"@internal/sql-relational-core/ast\";\nimport { CodecDescriptorImpl, validateCodecTypeParams } from \"@internal/framework-components/codec\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/core/codec-descriptor.ts\nconst POSTGRES_CODEC_DESCRIPTOR_KIND = \"postgres-codec\";\nconst ARRAY_INPUT_ALIAS = \"array_input\";\nconst ARRAY_ELEMENT_ALIAS = \"array_element\";\nconst ARRAY_VALUE_COLUMN = \"value\";\nconst ARRAY_ORDINALITY_COLUMN = \"ordinality\";\nvar PostgresCodecDescriptor = class extends CodecDescriptorImpl {\n\tdescriptorKind = POSTGRES_CODEC_DESCRIPTOR_KIND;\n\tjsonArrayProjection(expression, params) {\n\t\tconst boundArray = ColumnRef.of(ARRAY_INPUT_ALIAS, ARRAY_VALUE_COLUMN);\n\t\tconst element = ColumnRef.of(ARRAY_ELEMENT_ALIAS, ARRAY_VALUE_COLUMN);\n\t\tconst ordinality = ColumnRef.of(ARRAY_ELEMENT_ALIAS, ARRAY_ORDINALITY_COLUMN);\n\t\tconst projectedElement = CaseExpr.of([{\n\t\t\tcondition: NullCheckExpr.isNull(element),\n\t\t\tvalue: LiteralExpr.of(null)\n\t\t}], this.jsonProjection(element, params));\n\t\tconst aggregate = JsonArrayAggExpr.of(new NativeJsonValueProjection(projectedElement), \"emptyArray\", [OrderByItem.asc(ordinality)]);\n\t\tconst aggregateQuery = SelectAst.from(FunctionSource.of(\"unnest\", [boundArray], {\n\t\t\talias: ARRAY_ELEMENT_ALIAS,\n\t\t\tcolumnAliases: [ARRAY_VALUE_COLUMN, ARRAY_ORDINALITY_COLUMN]\n\t\t}).withOrdinality()).withProjection([ProjectionItem.of(ARRAY_VALUE_COLUMN, aggregate)]);\n\t\tconst arrayResult = CaseExpr.of([{\n\t\t\tcondition: NullCheckExpr.isNull(boundArray),\n\t\t\tvalue: LiteralExpr.of(null)\n\t\t}], SubqueryExpr.of(aggregateQuery));\n\t\tconst inputBinding = SelectAst.noFrom().withProjection([ProjectionItem.of(ARRAY_VALUE_COLUMN, expression)]);\n\t\treturn SubqueryExpr.of(SelectAst.from(DerivedTableSource.as(ARRAY_INPUT_ALIAS, inputBinding)).withProjection([ProjectionItem.of(ARRAY_VALUE_COLUMN, arrayResult)]));\n\t}\n\tnativeTypeFor(ref) {\n\t\treturn this.nativeType(this.validateParams(ref));\n\t}\n\tprojectJson(expression, ref) {\n\t\tconst params = this.validateParams(ref);\n\t\treturn ref.many === true ? this.jsonArrayProjection(expression, params) : this.jsonProjection(expression, params);\n\t}\n\tvalidateParams(ref) {\n\t\treturn blindCast(validateCodecTypeParams(this, ref));\n\t}\n};\nvar PostgresCodecDescriptorAdapter = class extends PostgresCodecDescriptor {\n\tdescriptor;\n\toptions;\n\tcodecId;\n\ttraits;\n\ttargetTypes;\n\tparamsSchema;\n\trenderOutputType;\n\trenderInputType;\n\trenderValueLiteral;\n\tfactory;\n\tconstructor(descriptor, options) {\n\t\tsuper();\n\t\tthis.descriptor = descriptor;\n\t\tthis.options = options;\n\t\tthis.codecId = descriptor.codecId;\n\t\tthis.traits = descriptor.traits;\n\t\tthis.targetTypes = descriptor.targetTypes;\n\t\tthis.paramsSchema = descriptor.paramsSchema;\n\t\tthis.factory = (params) => descriptor.factory(params);\n\t\tconst renderOutputType = descriptor.renderOutputType;\n\t\tif (renderOutputType !== void 0) this.renderOutputType = (params) => renderOutputType.call(descriptor, params);\n\t\tconst renderInputType = descriptor.renderInputType;\n\t\tif (renderInputType !== void 0) this.renderInputType = (params) => renderInputType.call(descriptor, params);\n\t\tconst renderValueLiteral = descriptor.renderValueLiteral;\n\t\tif (renderValueLiteral !== void 0) this.renderValueLiteral = (value, side) => renderValueLiteral.call(descriptor, value, side);\n\t}\n\tget isParameterized() {\n\t\treturn this.descriptor.isParameterized;\n\t}\n\tnativeType(params) {\n\t\treturn this.options.nativeType(params);\n\t}\n\tjsonProjection(expression, params) {\n\t\treturn this.options.jsonProjection(expression, params);\n\t}\n\tjsonArrayProjection(expression, params) {\n\t\treturn this.options.jsonArrayProjection === void 0 ? super.jsonArrayProjection(expression, params) : this.options.jsonArrayProjection(expression, params);\n\t}\n};\nfunction postgresCodec(descriptor, options) {\n\treturn blindCast(new PostgresCodecDescriptorAdapter(descriptor, options));\n}\nfunction definePostgresCodecs(descriptors) {\n\treturn descriptors;\n}\nfunction isPostgresCodecDescriptor(value) {\n\treturn typeof value === \"object\" && value !== null && \"descriptorKind\" in value && value.descriptorKind === POSTGRES_CODEC_DESCRIPTOR_KIND && \"codecId\" in value && typeof value.codecId === \"string\" && \"traits\" in value && Array.isArray(value.traits) && \"targetTypes\" in value && Array.isArray(value.targetTypes) && value.targetTypes.every((targetType) => typeof targetType === \"string\") && \"paramsSchema\" in value && isObjectLike(value.paramsSchema) && \"~standard\" in value.paramsSchema && isObjectLike(value.paramsSchema[\"~standard\"]) && \"validate\" in value.paramsSchema[\"~standard\"] && typeof value.paramsSchema[\"~standard\"].validate === \"function\" && \"isParameterized\" in value && typeof value.isParameterized === \"boolean\" && \"factory\" in value && typeof value.factory === \"function\" && \"nativeTypeFor\" in value && typeof value.nativeTypeFor === \"function\" && \"projectJson\" in value && typeof value.projectJson === \"function\";\n}\nfunction isObjectLike(value) {\n\treturn typeof value === \"object\" && value !== null || typeof value === \"function\";\n}\nvar PostgresCodecDescriptorRegistryImpl = class {\n\t#descriptors;\n\tconstructor(descriptors) {\n\t\tthis.#descriptors = descriptors;\n\t\tObject.freeze(this);\n\t}\n\tdescriptorFor(codecId) {\n\t\treturn this.#descriptors.get(codecId);\n\t}\n\t*values() {\n\t\tyield* this.#descriptors.values();\n\t}\n};\nfunction buildPostgresCodecDescriptorRegistry(descriptors) {\n\tconst byId = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tif (!isPostgresCodecDescriptor(descriptor)) {\n\t\t\tconst codecId = candidateCodecId(descriptor);\n\t\t\tthrow structuredError(\"RUNTIME.CODEC_DESCRIPTOR_INVALID\", `Codec descriptor '${codecId}' is not a valid PostgreSQL codec descriptor.`, {\n\t\t\t\twhy: \"PostgreSQL codec registries require the postgres-codec discriminant and complete target descriptor methods.\",\n\t\t\t\tfix: \"Extend PostgresCodecDescriptor or adapt a generic descriptor with postgresCodec().\",\n\t\t\t\tmeta: { codecId }\n\t\t\t});\n\t\t}\n\t\tif (byId.has(descriptor.codecId)) throw structuredError(\"RUNTIME.DUPLICATE_CODEC\", `Duplicate PostgreSQL codec descriptor id '${descriptor.codecId}'.`, {\n\t\t\twhy: \"Each codecId must resolve to exactly one PostgreSQL descriptor during registry composition.\",\n\t\t\tfix: \"Remove the duplicate target, adapter, or extension contribution.\",\n\t\t\tmeta: {\n\t\t\t\tcodecId: descriptor.codecId,\n\t\t\t\ttarget: \"postgres\"\n\t\t\t}\n\t\t});\n\t\tbyId.set(descriptor.codecId, descriptor);\n\t}\n\treturn new PostgresCodecDescriptorRegistryImpl(byId);\n}\nfunction candidateCodecId(value) {\n\treturn typeof value === \"object\" && value !== null && \"codecId\" in value && typeof value.codecId === \"string\" ? value.codecId : \"<unknown>\";\n}\n//#endregion\nexport { postgresCodec as a, isPostgresCodecDescriptor as i, buildPostgresCodecDescriptorRegistry as n, definePostgresCodecs as r, PostgresCodecDescriptor as t };\n\n//# sourceMappingURL=codec-descriptor-LT7BpQta.mjs.map"],"mappings":";;;;;AAKA,MAAM,iCAAiC;AACvC,MAAM,oBAAoB;AAC1B,MAAM,sBAAsB;AAC5B,MAAM,qBAAqB;AAC3B,MAAM,0BAA0B;AAChC,IAAI,0BAA0B,cAAc,oBAAoB;CAC/D,iBAAiB;CACjB,oBAAoB,YAAY,QAAQ;EACvC,MAAM,aAAa,UAAU,GAAG,mBAAmB,kBAAkB;EACrE,MAAM,UAAU,UAAU,GAAG,qBAAqB,kBAAkB;EACpE,MAAM,aAAa,UAAU,GAAG,qBAAqB,uBAAuB;EAC5E,MAAM,mBAAmB,SAAS,GAAG,CAAC;GACrC,WAAW,cAAc,OAAO,OAAO;GACvC,OAAO,YAAY,GAAG,IA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jI"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as PG_TIMESTAMP_CODEC_ID, D as PG_UUID_CODEC_ID, E as PG_UNBOUNDED_INT_CODEC_ID, O as PG_VARBIT_CODEC_ID, S as PG_TIMESTAMPTZ_CODEC_ID, T as PG_TIME_CODEC_ID, _ as PG_JSONB_CODEC_ID, a as PG_DATE_CODEC_ID, b as PG_TEXT_ARRAY_CODEC_ID, c as PG_FLOAT8_CODEC_ID, d as PG_INT2_CODEC_ID, f as PG_INT4_CODEC_ID, g as PG_INT_CODEC_ID, h as PG_INTERVAL_CODEC_ID, i as PG_CHAR_CODEC_ID, k as PG_VARCHAR_CODEC_ID, l as PG_FLOAT_CODEC_ID, m as PG_INT8_NUMBER_CODEC_ID, n as PG_BOOL_CODEC_ID, o as PG_ENUM_CODEC_ID, p as PG_INT8_CODEC_ID, r as PG_BYTEA_CODEC_ID, s as PG_FLOAT4_CODEC_ID, t as PG_BIT_CODEC_ID, u as PG_INET_CODEC_ID, v as PG_JSON_CODEC_ID, w as PG_TIMETZ_CODEC_ID, x as PG_TEXT_CODEC_ID, y as PG_NUMERIC_CODEC_ID } from "./codec-ids-C5Rkltkw-DMf87l9s.mjs";
|
|
2
|
-
import { a as postgresCodec, r as definePostgresCodecs, t as PostgresCodecDescriptor } from "./codec-descriptor-
|
|
2
|
+
import { a as postgresCodec, r as definePostgresCodecs, t as PostgresCodecDescriptor } from "./codec-descriptor-LT7BpQta-BaDM8UQQ.mjs";
|
|
3
3
|
import { n as postgresError } from "./errors-kYxOQjdD-D4T3rbVp.mjs";
|
|
4
4
|
import { t as PostgresNativeEnum } from "./postgres-native-enum-CdP3b_-R-Cgz9KEKx.mjs";
|
|
5
5
|
import { BinaryExpr, CaseExpr, CastExpr, FunctionCallExpr, LiteralExpr, NullCheckExpr, OrExpr, SqlCharCodec, SqlFloatCodec, SqlIntCodec, SqlVarcharCodec, sqlCharDescriptor, sqlFloatDescriptor, sqlIntDescriptor, sqlTextDescriptor, sqlTimestampDescriptor, sqlVarcharDescriptor } from "@prisma/orm-family-sql/relational-core/ast";
|
|
@@ -7,7 +7,7 @@ import { CodecImpl, column, renderTsLiteral, voidParamsSchema } from "@prisma/or
|
|
|
7
7
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
8
8
|
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
9
9
|
import { type } from "arktype";
|
|
10
|
-
//#region ../../../3-targets/3-targets/postgres/dist/codecs-
|
|
10
|
+
//#region ../../../3-targets/3-targets/postgres/dist/codecs-B5ZWvB6I.mjs
|
|
11
11
|
function renderLength(typeName, typeParams) {
|
|
12
12
|
const length = typeParams["length"];
|
|
13
13
|
if (length === void 0) return;
|
|
@@ -1635,4 +1635,4 @@ const codecDescriptors = definePostgresCodecs([
|
|
|
1635
1635
|
//#endregion
|
|
1636
1636
|
export { postgresQualifyColumnType as A, pgTimestampColumn as C, pgUuidColumn as D, pgUnboundedIntColumn as E, pgVarbitColumn as O, pgTimeColumn as S, pgTimetzColumn as T, pgIntervalColumn as _, pgCharColumn as a, pgNumericColumn as b, pgFloat4Column as c, pgInetColumn as d, pgInt2Column as f, pgIntColumn as g, pgInt8NumberColumn as h, pgBoolColumn as i, pgVarcharColumn as k, pgFloat8Column as l, pgInt8Column as m, isPgEnumParams as n, pgDateColumn as o, pgInt4Column as p, pgBitColumn as r, pgEnumDescriptor as s, codecDescriptors as t, pgFloatColumn as u, pgJsonColumn as v, pgTimestamptzColumn as w, pgTextColumn as x, pgJsonbColumn as y };
|
|
1637
1637
|
|
|
1638
|
-
//# sourceMappingURL=codecs-
|
|
1638
|
+
//# sourceMappingURL=codecs-B5ZWvB6I-DyHzqNQV.mjs.map
|