@prisma/orm-target-postgres 8.0.0-rc.15-dev.2 → 8.0.0-rc.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-BN5Wlbej-CsT1g6es.mjs → adapter-DPHDNGEY-BB4Vc4vg.mjs} +3 -3
- package/dist/{adapter-BN5Wlbej-CsT1g6es.mjs.map → adapter-DPHDNGEY-BB4Vc4vg.mjs.map} +1 -1
- package/dist/adapter.mjs +2 -2
- package/dist/adapter__adapter.mjs +2 -2
- package/dist/adapter__control.mjs +4 -4
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.mjs +2 -2
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/{control-CgOBPYS9.mjs → control-BVAy0J9w.mjs} +8 -9
- package/dist/control-BVAy0J9w.mjs.map +1 -0
- package/dist/{control-adapter-CxoGaqma-Cj25X29E.mjs → control-adapter-BvbIA5eh-DtAsNjXj.mjs} +4 -4
- package/dist/{control-adapter-CxoGaqma-Cj25X29E.mjs.map → control-adapter-BvbIA5eh-DtAsNjXj.mjs.map} +1 -1
- package/dist/{data-type-entries-B09zz50n-CpzY4XHp.mjs → data-type-entries-C2zpNOAQ-BJh8QNDa.mjs} +5 -5
- package/dist/{data-type-entries-B09zz50n-CpzY4XHp.mjs.map → data-type-entries-C2zpNOAQ-BJh8QNDa.mjs.map} +1 -1
- package/dist/{descriptor-meta-BwJ4l8Yi-C7sFL7IA.mjs → descriptor-meta-BYbrg5qK-BP8HnEvl.mjs} +3 -3
- package/dist/{descriptor-meta-BwJ4l8Yi-C7sFL7IA.mjs.map → descriptor-meta-BYbrg5qK-BP8HnEvl.mjs.map} +1 -1
- package/dist/{descriptor-meta-DhVbdKvn-BO0y2Cn-.mjs → descriptor-meta-Dp8tWKKU-5RiFTCA_.mjs} +3 -3
- package/dist/{descriptor-meta-DhVbdKvn-BO0y2Cn-.mjs.map → descriptor-meta-Dp8tWKKU-5RiFTCA_.mjs.map} +1 -1
- package/dist/{infer-psl-contract-CkUkE2fE-bg9b0E0i.mjs → infer-psl-contract-shHWsRbe-C65aVFOB.mjs} +8 -8
- package/dist/infer-psl-contract-shHWsRbe-C65aVFOB.mjs.map +1 -0
- package/dist/{prisma7-binding-BlD9U_OI.mjs → prisma7-binding-CArLf1qk.mjs} +3 -3
- package/dist/{prisma7-binding-BlD9U_OI.mjs.map → prisma7-binding-CArLf1qk.mjs.map} +1 -1
- package/dist/target.mjs +3 -3
- package/dist/target__control.mjs +1 -1
- package/dist/target__data-types.mjs +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__prisma7-binding.mjs +1 -1
- package/package.json +9 -9
- package/dist/control-CgOBPYS9.mjs.map +0 -1
- package/dist/infer-psl-contract-CkUkE2fE-bg9b0E0i.mjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { R as postgresDataTypes } from "./data-types-BRBW3ouc-ZtyZE7nE.mjs";
|
|
2
2
|
import { i as createPostgresCodecRegistryWithBuiltins } from "./codec-registry-CyhMngN6-BlKEiEni.mjs";
|
|
3
3
|
import { n as renderLoweredSql, t as adapterError } from "./sql-renderer-B2NO2v0S-Cwd6Pl6z.mjs";
|
|
4
|
-
import { n as postgresAdapterCapabilities, t as PostgresControlAdapter } from "./control-adapter-
|
|
4
|
+
import { n as postgresAdapterCapabilities, t as PostgresControlAdapter } from "./control-adapter-BvbIA5eh-DtAsNjXj.mjs";
|
|
5
5
|
import { isDdlNode } from "@prisma/orm-family-sql/relational-core/ast";
|
|
6
6
|
import { assembleDataTypes } from "@prisma/orm-framework/components/codec";
|
|
7
7
|
import { APP_SPACE_ID } from "@prisma/orm-framework/components/control";
|
|
8
|
-
//#region ../../../3-targets/6-adapters/postgres/dist/adapter-
|
|
8
|
+
//#region ../../../3-targets/6-adapters/postgres/dist/adapter-DPHDNGEY.mjs
|
|
9
9
|
var PostgresAdapterImpl = class {
|
|
10
10
|
familyId = "sql";
|
|
11
11
|
targetId = "postgres";
|
|
@@ -86,4 +86,4 @@ function createPostgresAdapterWithCodecRegistry(codecRegistry, dataTypeLookup) {
|
|
|
86
86
|
//#endregion
|
|
87
87
|
export { createPostgresAdapterWithCodecRegistry as n, postgresRawCodecInferer as r, createPostgresAdapter as t };
|
|
88
88
|
|
|
89
|
-
//# sourceMappingURL=adapter-
|
|
89
|
+
//# sourceMappingURL=adapter-DPHDNGEY-BB4Vc4vg.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-
|
|
1
|
+
{"version":3,"file":"adapter-DPHDNGEY-BB4Vc4vg.mjs","names":[],"sources":["../../../../3-targets/6-adapters/postgres/dist/adapter-DPHDNGEY.mjs"],"sourcesContent":["import { n as adapterError, t as renderLoweredSql } from \"./sql-renderer-B2NO2v0S.mjs\";\nimport { n as postgresAdapterCapabilities, t as PostgresControlAdapter } from \"./control-adapter-BvbIA5eh.mjs\";\nimport { assembleDataTypes } from \"@internal/framework-components/codec\";\nimport { APP_SPACE_ID } from \"@internal/framework-components/control\";\nimport { isDdlNode } from \"@internal/sql-relational-core/ast\";\nimport { createPostgresCodecRegistryWithBuiltins } from \"@internal/target-postgres/codecs\";\nimport { postgresDataTypes } from \"@internal/target-postgres/data-types\";\n//#region src/core/adapter.ts\nvar PostgresAdapterImpl = class {\n\tfamilyId = \"sql\";\n\ttargetId = \"postgres\";\n\tprofile;\n\tcodecRegistry;\n\tdataTypeLookup;\n\tconstructor(codecRegistry, dataTypeLookup, profileId) {\n\t\tthis.codecRegistry = codecRegistry;\n\t\tthis.dataTypeLookup = dataTypeLookup;\n\t\tconst controlAdapter = new PostgresControlAdapter(codecRegistry, dataTypeLookup);\n\t\tthis.profile = Object.freeze({\n\t\t\tid: profileId ?? \"postgres/default@1\",\n\t\t\ttarget: \"postgres\",\n\t\t\tcapabilities: postgresAdapterCapabilities,\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, this.dataTypeLookup, postgresAdapterCapabilities);\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 dataTypeLookup = assembleDataTypes([{\n\t\tid: \"postgres\",\n\t\tdataTypes: postgresDataTypes\n\t}, {\n\t\tid: \"createPostgresAdapter\",\n\t\tdataTypes: options?.dataTypes ?? []\n\t}]).lookup;\n\tconst codecRegistry = createPostgresCodecRegistryWithBuiltins(options?.codecDescriptors, dataTypeLookup);\n\treturn Object.freeze(new PostgresAdapterImpl(codecRegistry, dataTypeLookup, options?.profileId));\n}\nfunction createPostgresAdapterWithCodecRegistry(codecRegistry, dataTypeLookup) {\n\treturn Object.freeze(new PostgresAdapterImpl(codecRegistry, dataTypeLookup));\n}\n//#endregion\nexport { createPostgresAdapterWithCodecRegistry as n, postgresRawCodecInferer as r, createPostgresAdapter as t };\n\n//# sourceMappingURL=adapter-DPHDNGEY.mjs.map"],"mappings":";;;;;;;;AAQA,IAAI,sBAAsB,MAAM;CAC/B,WAAW;CACX,WAAW;CACX;CACA;CACA;CACA,YAAY,eAAe,gBAAgB,WAAW;EACrD,KAAK,gBAAgB;EACrB,KAAK,iBAAiB;EACtB,MAAM,iBAAiB,IAAI,uBAAuB,eAAe,cAAc;EAC/E,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;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resDefault } from "./default-normalizer-CrMBHF0W-BaUR4Ec8.mjs";
|
|
4
4
|
import { n as normalizeSchemaNativeType } from "./native-type-normalizer-CwyVR7xB.mjs";
|
|
5
5
|
import { n as renderLoweredSql } from "./sql-renderer-B2NO2v0S-Cwd6Pl6z.mjs";
|
|
6
|
-
import { n as postgresAdapterCapabilities, t as PostgresControlAdapter } from "./control-adapter-
|
|
7
|
-
import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-
|
|
6
|
+
import { n as postgresAdapterCapabilities, t as PostgresControlAdapter } from "./control-adapter-BvbIA5eh-DtAsNjXj.mjs";
|
|
7
|
+
import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-DPHDNGEY-BB4Vc4vg.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-Bbc3IVA7.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, postgresAdapterCapabilities, postgresRawCodecInferer, qualifyName, quoteIdentifier, renderLoweredSql, textColumn, timeStringColumn, timeTemporalColumn, timestampStringColumn, timestampTemporalColumn, timestamptzJsDateColumn, timestamptzStringColumn, timestamptzTemporalColumn, timetzColumn, varbitColumn, varcharColumn };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as postgresAdapterCapabilities } from "./control-adapter-
|
|
2
|
-
import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-
|
|
1
|
+
import { n as postgresAdapterCapabilities } from "./control-adapter-BvbIA5eh-DtAsNjXj.mjs";
|
|
2
|
+
import { r as postgresRawCodecInferer, t as createPostgresAdapter } from "./adapter-DPHDNGEY-BB4Vc4vg.mjs";
|
|
3
3
|
export { createPostgresAdapter, postgresAdapterCapabilities, postgresRawCodecInferer };
|
|
@@ -2,10 +2,10 @@ import { n as qualifyName, r as quoteIdentifier, t as escapeLiteral } from "./sq
|
|
|
2
2
|
import { i as createPostgresCodecRegistryWithBuiltins, r as createPostgresBuiltinCodecLookup, t as assemblePostgresCodecRegistry } from "./codec-registry-CyhMngN6-BlKEiEni.mjs";
|
|
3
3
|
import { a as instantNowControlDescriptor, s as plainDateTimeNowControlDescriptor } from "./authoring-CfPWv_-P-BHAGgGYI.mjs";
|
|
4
4
|
import { t as parsePostgresDefault } from "./default-normalizer-CrMBHF0W-BaUR4Ec8.mjs";
|
|
5
|
-
import { n as postgresPslTypeConstructors } from "./control-
|
|
5
|
+
import { n as postgresPslTypeConstructors } from "./control-BVAy0J9w.mjs";
|
|
6
6
|
import { n as normalizeSchemaNativeType } from "./native-type-normalizer-CwyVR7xB.mjs";
|
|
7
|
-
import { t as PostgresControlAdapter } from "./control-adapter-
|
|
8
|
-
import { t as postgresAdapterDescriptorMeta } from "./descriptor-meta-
|
|
7
|
+
import { t as PostgresControlAdapter } from "./control-adapter-BvbIA5eh-DtAsNjXj.mjs";
|
|
8
|
+
import { t as postgresAdapterDescriptorMeta } from "./descriptor-meta-BYbrg5qK-BP8HnEvl.mjs";
|
|
9
9
|
import { timestampNowControlDescriptor } from "@prisma/orm-framework/components/control";
|
|
10
10
|
import { int, num, oneOf, optional } from "@prisma/orm-framework/psl-parser";
|
|
11
11
|
import { builtinGeneratorRegistryMetadata } from "@prisma/orm-framework/ids";
|
|
@@ -155,7 +155,7 @@ const postgresAdapterDescriptor = {
|
|
|
155
155
|
stack.target,
|
|
156
156
|
...stack.adapter === void 0 ? [] : [stack.adapter],
|
|
157
157
|
...stack.extensions
|
|
158
|
-
], stack.
|
|
158
|
+
], stack.dataTypes.lookup), stack.dataTypes.lookup);
|
|
159
159
|
}
|
|
160
160
|
};
|
|
161
161
|
//#endregion
|
|
@@ -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-BvbIA5eh.mjs\";\nimport { t as postgresAdapterDescriptorMeta } from \"./descriptor-meta-BYbrg5qK.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 { instantNowControlDescriptor, plainDateTimeNowControlDescriptor, postgresPslTypeConstructors } from \"@internal/target-postgres/control\";\nimport { builtinGeneratorRegistryMetadata } from \"@internal/ids\";\nimport { int, num, oneOf, optional } from \"@internal/psl-parser\";\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];\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: postgresPslTypeConstructors,\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], stack.dataTypes.lookup), stack.dataTypes.lookup);\n\t}\n};\n//#endregion\nexport { PostgresControlAdapter, createPostgresBuiltinCodecLookup, createPostgresCodecRegistryWithBuiltins, postgresAdapterDescriptor as default, escapeLiteral, normalizeSchemaNativeType, parsePostgresDefault, qualifyName, quoteIdentifier };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;AAWA,SAAS,mBAAmB,IAAI,QAAQ;CACvC,OAAO;EACN,IAAI;EACJ,OAAO;GACN,MAAM;GACN,WAAW;IACV,MAAM;IACN;IACA,GAAG,SAAS,EAAE,OAAO,IAAI,CAAC;GAC3B;EACD;CACD;AACD;AACA,SAAS,qBAAqB;CAC7B,OAAO;EACN,IAAI;EACJ,OAAO;GACN,MAAM;GACN,cAAc;IACb,MAAM;IACN,YAAY;GACb;EACD;CACD;AACD;AACA,SAAS,WAAW;CACnB,OAAO;EACN,IAAI;EACJ,OAAO;GACN,MAAM;GACN,cAAc;IACb,MAAM;IACN,YAAY;GACb;EACD;CACD;AACD;AACA,SAAS,YAAY;CACpB,OAAO,mBAAmB,MAAM;AACjC;AACA,SAAS,UAAU,OAAO;CACzB,OAAO,MAAM,KAAK,KAAK,eAAe,IAAI,mBAAmB,QAAQ,IAAI,mBAAmB,QAAQ;AACrG;AACA,SAAS,YAAY;CACpB,OAAO,mBAAmB,OAAO;AAClC;AACA,SAAS,YAAY,OAAO;CAC3B,MAAM,OAAO,MAAM,KAAK,KAAK;CAC7B,OAAO,OAAO,SAAS,WAAW,mBAAmB,UAAU,EAAE,KAAK,CAAC,IAAI,mBAAmB,QAAQ;AACvG;AACA,MAAM,SAAS,EAAE,eAAe,4DAA4D;AAC5F,MAAM,mBAAmB,EAAE,eAAe,yDAAyD;AACn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;CACzB;CACA,yBAAyB;EACxB,yBAAyB,sCAAsC;EAC/D,sBAAsB,kDAAkD;CACzE;CACA,OAAO,OAAO;EACb,OAAO,IAAI,uBAAuB,8BAA8B;GAC/D,MAAM;GACN,GAAG,MAAM,YAAY,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM,OAAO;GACjD,GAAG,MAAM;EACV,GAAG,MAAM,UAAU,MAAM,GAAG,MAAM,UAAU,MAAM;CACnD;AACD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as postgresCodecRegistry, t as assemblePostgresCodecRegistry } from "./codec-registry-CyhMngN6-BlKEiEni.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-CfPWv_-P-BHAGgGYI.mjs";
|
|
3
|
-
import { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from "./adapter-
|
|
4
|
-
import { t as postgresAdapterDescriptorMeta } from "./descriptor-meta-
|
|
3
|
+
import { n as createPostgresAdapterWithCodecRegistry, r as postgresRawCodecInferer } from "./adapter-DPHDNGEY-BB4Vc4vg.mjs";
|
|
4
|
+
import { t as postgresAdapterDescriptorMeta } from "./descriptor-meta-BYbrg5qK-BP8HnEvl.mjs";
|
|
5
5
|
import { assembleDataTypes } from "@prisma/orm-framework/components/codec";
|
|
6
6
|
import { builtinGeneratorIds } from "@prisma/orm-framework/ids";
|
|
7
7
|
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-DPHDNGEY.mjs\";\nimport { t as postgresAdapterDescriptorMeta } from \"./descriptor-meta-BYbrg5qK.mjs\";\nimport { assembleDataTypes } from \"@internal/framework-components/codec\";\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\tconst components = [\n\t\t\tstack.target,\n\t\t\tstack.adapter,\n\t\t\t...stack.extensions\n\t\t];\n\t\tconst dataTypeLookup = assembleDataTypes(components).lookup;\n\t\treturn createPostgresAdapterWithCodecRegistry(assemblePostgresCodecRegistry(components, dataTypeLookup), dataTypeLookup);\n\t}\n};\n//#endregion\nexport { postgresRuntimeAdapterDescriptor as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;AASA,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,MAAM,aAAa;GAClB,MAAM;GACN,MAAM;GACN,GAAG,MAAM;EACV;EACA,MAAM,iBAAiB,kBAAkB,UAAU,CAAC,CAAC;EACrD,OAAO,uCAAuC,8BAA8B,YAAY,cAAc,GAAG,cAAc;CACxH;AACD"}
|
|
@@ -7,7 +7,7 @@ import { i as PostgresRlsPolicy, n as PostgresRlsEnablement, o as PostgresRole }
|
|
|
7
7
|
import { n as computeContentHash } from "./canonicalize-CrN3u_xM-D4MrOqcB.mjs";
|
|
8
8
|
import { m as postgresNowGeneratorIdFor, r as POLICY_BLOCK_KEYWORDS } from "./authoring-CfPWv_-P-BHAGgGYI.mjs";
|
|
9
9
|
import { t as postgresRenderCheckExpressions } from "./check-expressions-BRuSxJ5d-CC5OFfR1.mjs";
|
|
10
|
-
import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-
|
|
10
|
+
import { t as postgresTargetDescriptorMeta } from "./descriptor-meta-Dp8tWKKU-5RiFTCA_.mjs";
|
|
11
11
|
import { a as postgresDiffSubjectGranularity, i as postgresDiffSubjectEntityKind } from "./postgres-table-schema-node-BBkitBQh-DT1T5VWU.mjs";
|
|
12
12
|
import { t as PostgresDatabaseSchemaNode } from "./postgres-role-schema-node-B8Z5i5D--PObwlU2Z.mjs";
|
|
13
13
|
import { r as diffPostgresSchema } from "./diff-database-schema-DRPIV4Ae-BSY-cBm0.mjs";
|
|
@@ -15,7 +15,7 @@ import { t as PostgresContractSerializer } from "./postgres-contract-view-rT0ZLN
|
|
|
15
15
|
import { a as postgresContractToSchema } from "./postgres-migration-CmD95Eh_-DGLByWZD.mjs";
|
|
16
16
|
import { t as createPostgresMigrationPlanner } from "./planner-B5wkfdZ_-bckhSgt5.mjs";
|
|
17
17
|
import { n as MARKER_LOCK_SQL, t as MARKER_LOCK_KEY } from "./marker-lock-DFc1Tfv5-QMJSzMIa.mjs";
|
|
18
|
-
import { a as buildIndexAttribute, c as buildNativeEnumBlock, d as createPostgresTypeMap, f as inferPostgresPslContract, g as positionalArg, h as parseDefaultAttributeString, i as buildCheckAttribute, n as SYNTHETIC_SPAN, o as buildMapAttribute, p as namedArg, r as buildAttribute, s as buildModelConstraintAttribute } from "./infer-psl-contract-
|
|
18
|
+
import { a as buildIndexAttribute, c as buildNativeEnumBlock, d as createPostgresTypeMap, f as inferPostgresPslContract, g as positionalArg, h as parseDefaultAttributeString, i as buildCheckAttribute, n as SYNTHETIC_SPAN, o as buildMapAttribute, p as namedArg, r as buildAttribute, s as buildModelConstraintAttribute } from "./infer-psl-contract-shHWsRbe-C65aVFOB.mjs";
|
|
19
19
|
import { requiredParamKeys, validateCodecTypeParams } from "@prisma/orm-framework/components/codec";
|
|
20
20
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
21
21
|
import { dataTypeParams, isSqlDataType, unquotedSqlBaseName } from "@prisma/orm-family-sql/contract/data-type";
|
|
@@ -1211,7 +1211,7 @@ function dataTypeOfMember(type, coordinate, context) {
|
|
|
1211
1211
|
const { codecId } = type;
|
|
1212
1212
|
const descriptor = context.codecLookup.descriptorFor(codecId);
|
|
1213
1213
|
if (descriptor === void 0) refuseMemberCodecWithoutNativeType(codecId, coordinate);
|
|
1214
|
-
const dataType = context.
|
|
1214
|
+
const dataType = context.dataTypes.lookup.get(descriptor.dataType);
|
|
1215
1215
|
if (dataType === void 0 || !isSqlDataType(dataType)) refuseMemberCodecWithoutNativeType(codecId, coordinate);
|
|
1216
1216
|
const typeParams = resolvedTypeParams(type, void 0);
|
|
1217
1217
|
if (typeParams === void 0) {
|
|
@@ -1247,7 +1247,7 @@ function buildMemberType(input) {
|
|
|
1247
1247
|
}),
|
|
1248
1248
|
typeMap: input.typeMap,
|
|
1249
1249
|
authoringTypes: input.context.authoringContributions.type,
|
|
1250
|
-
dataTypeLookup: input.context.
|
|
1250
|
+
dataTypeLookup: input.context.dataTypes.lookup,
|
|
1251
1251
|
enumBlockNames: input.enumBlockNames,
|
|
1252
1252
|
coordinate
|
|
1253
1253
|
});
|
|
@@ -1302,7 +1302,7 @@ function buildTypesBlock(contract, typeMap, context) {
|
|
|
1302
1302
|
}),
|
|
1303
1303
|
typeMap,
|
|
1304
1304
|
authoringTypes: context.authoringContributions.type,
|
|
1305
|
-
dataTypeLookup: context.
|
|
1305
|
+
dataTypeLookup: context.dataTypes.lookup,
|
|
1306
1306
|
enumBlockNames: /* @__PURE__ */ new Map(),
|
|
1307
1307
|
coordinate: `types.${name}`
|
|
1308
1308
|
});
|
|
@@ -1886,8 +1886,7 @@ function buildColumnDefault(input) {
|
|
|
1886
1886
|
}
|
|
1887
1887
|
const { context } = input;
|
|
1888
1888
|
const result = mapDefault(columnDefault, {
|
|
1889
|
-
|
|
1890
|
-
dataTypeLookup: context.dataTypeLookup,
|
|
1889
|
+
dataTypes: context.dataTypes,
|
|
1891
1890
|
columnCodec: context.codecLookup.descriptorFor(input.isEnum ? PG_TEXT_CODEC_ID : input.column.codecId),
|
|
1892
1891
|
list: input.column.many !== false
|
|
1893
1892
|
});
|
|
@@ -2041,7 +2040,7 @@ function buildScalarFields(input) {
|
|
|
2041
2040
|
column,
|
|
2042
2041
|
typeMap,
|
|
2043
2042
|
authoringTypes: context.authoringContributions.type,
|
|
2044
|
-
dataTypeLookup: context.
|
|
2043
|
+
dataTypeLookup: context.dataTypes.lookup,
|
|
2045
2044
|
enumBlockNames: enums.blockNamesByTypeName,
|
|
2046
2045
|
coordinate
|
|
2047
2046
|
});
|
|
@@ -2668,4 +2667,4 @@ const postgresTargetDescriptor = createPostgresTargetDescriptor();
|
|
|
2668
2667
|
//#endregion
|
|
2669
2668
|
export { postgresTargetDescriptor as i, postgresPslTypeConstructors as n, postgresScalarAuthoringTypes as r, postgresNativeAuthoringTypes as t };
|
|
2670
2669
|
|
|
2671
|
-
//# sourceMappingURL=control-
|
|
2670
|
+
//# sourceMappingURL=control-BVAy0J9w.mjs.map
|