@prisma/orm-postgres 8.0.0-rc.18-dev.32 → 8.0.0-rc.18-dev.34
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/contract-builder.d.mts +4 -2
- package/dist/contract-builder.d.mts.map +1 -1
- package/dist/{contract-from-json-C9dlk9w4-jSgX1A1e.mjs → contract-from-json-DZ5ycGcM-VMuAQZ88.mjs} +3 -3
- package/dist/{contract-from-json-C9dlk9w4-jSgX1A1e.mjs.map → contract-from-json-DZ5ycGcM-VMuAQZ88.mjs.map} +1 -1
- package/dist/internal__validate-contract.mjs +1 -1
- package/dist/{postgres-static-CFOGIkFB-D8whwEpX.mjs → postgres-static-BpQ18Rm3-B4IlOU06.mjs} +3 -3
- package/dist/{postgres-static-CFOGIkFB-D8whwEpX.mjs.map → postgres-static-BpQ18Rm3-B4IlOU06.mjs.map} +1 -1
- package/dist/runtime.mjs +2 -2
- package/dist/runtime.mjs.map +1 -1
- package/dist/serverless.mjs +2 -2
- package/dist/serverless.mjs.map +1 -1
- package/dist/static.mjs +2 -2
- package/package.json +8 -8
- package/skills/prisma-8/SKILL.md +2 -2
- package/skills/prisma-8/references/debug.md +6 -5
|
@@ -372,7 +372,8 @@ declare const enumType: BoundEnumType<{
|
|
|
372
372
|
readonly output: string;
|
|
373
373
|
readonly json: import("@prisma/orm-framework/contract/types").JsonValue;
|
|
374
374
|
readonly traits: "numeric" | "equality" | "order";
|
|
375
|
-
|
|
375
|
+
readonly keepsWrittenForm: true;
|
|
376
|
+
}, "traits" | "keepsWrittenForm" | "output" | "input">;
|
|
376
377
|
readonly "pg/unboundedint@1": Pick<{
|
|
377
378
|
readonly input: bigint;
|
|
378
379
|
readonly output: bigint;
|
|
@@ -480,7 +481,8 @@ declare const enumType: BoundEnumType<{
|
|
|
480
481
|
readonly output: import("@prisma/orm-target-postgres/target/codecs").PgInterval;
|
|
481
482
|
readonly json: import("@prisma/orm-framework/contract/types").JsonValue;
|
|
482
483
|
readonly traits: "equality" | "order";
|
|
483
|
-
|
|
484
|
+
readonly keepsWrittenForm: true;
|
|
485
|
+
}, "traits" | "keepsWrittenForm" | "output" | "input">;
|
|
484
486
|
readonly "pg/json@1": Pick<{
|
|
485
487
|
readonly input: import("@prisma/orm-framework/contract/types").JsonValue;
|
|
486
488
|
readonly output: import("@prisma/orm-framework/contract/types").JsonValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-builder.d.mts","names":[],"sources":["../../../../3-extensions/postgres/dist/contract-builder.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;UAuBU;WACC;aACE;aACA;aACA,QAAQ,eAAe;;;;;;;;UAQ1B,cAAc;WACb;WACA,MAAM;;;UAGP;WACC;;WAEA;aACE,QAAQ;;;;;;;;UAQX,gBAAgB,kBAAkB,qBAAqB;WACtD;WACA,WAAW;;WAEX;;WAEA;aACE,QAAQ;;WAEV,gBAAgB;WAChB,QAAQ;WACR,YAAY;;;;;;KAMlB,kBAAkB,kBAAkB,gBAAgB;UAC/C;;WAEC;WACA,gBAAgB;;;UAGjB,iCAAiC;WAChC,OAAO;;;UAGR,qCAAqC;WACpC,WAAW;;;;;;;;;KASjB,qCAAqC;WAC/B,OAAO;WACP,YAAY;MACjB;WACK,QAAQ;WACR,WAAW;;;;;;;;iBAQL,WAAW,qBAAqB,MAAM,OAAO,cAAc;;;;;;iBAM3D,WAAW,OAAO,iBAAiB;;iBAEnC,aAAa,OAAO,gBAAgB,YAAY,2BAA2B;;iBAE3E,aAAa,OAAO,gBAAgB,YAAY,+BAA+B;;iBAE/E,aAAa,OAAO,gBAAgB,YAAY,oCAAoC;;iBAEpF,aAAa,OAAO,gBAAgB,YAAY,2BAA2B;;iBAE3E,UAAU,OAAO,gBAAgB,YAAY,oCAAoC;;;KAG7F,mBAAmB;KACnB,sBAAsB;KACtB,kBAAkB,eAAe;KACjC,mBAAmB,eAAe;KAClC,kBAAkB,eAAe;KACjC,+BA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AAmB,KAAK;;;;;;;;;;;;;UAajV,iBAAiB,8BAA8B,kCAAkC;WAChF;WACA,MAAM;WACN,UAAU;WACV,SAAS;WACT,QAAQ,mBAAmB;;;;;;EAMpC,UAAU,+BAA+B,UAAU,iBAAiB,iBAAiB,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4B5F,iBAAiB,2BAA2B,gDAAgD,MAAM,SAAS,SAAS,UAAU,iBAAiB,MAAM,MAAM;;;;;;KAMvK,uBAAuB,kDAAkD,4BAA4B;WAC/F;aACE;aACA;aACA,QAAQ,mBAAmB;;;;;;;;;;;;;iBAavB,mBAAmB,2BAA2B,+BAA+B,gDAAgD,QAAQ,iBAAiB,MAAM,UAAU,WAAW,uBAAuB;;cAE3M;WACH,aAAa"}
|
package/dist/{contract-from-json-C9dlk9w4-jSgX1A1e.mjs → contract-from-json-DZ5ycGcM-VMuAQZ88.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import postgresTarget, { PostgresContractSerializer } from "@prisma/orm-target-postgres/target/runtime";
|
|
2
2
|
import { validateContractOnce } from "@prisma/orm-framework/contract/validate-once";
|
|
3
|
-
//#region ../../../3-extensions/postgres/dist/contract-from-json-
|
|
4
|
-
var version = "8.0.0-rc.18-dev.
|
|
3
|
+
//#region ../../../3-extensions/postgres/dist/contract-from-json-DZ5ycGcM.mjs
|
|
4
|
+
var version = "8.0.0-rc.18-dev.34";
|
|
5
5
|
const serializer = new PostgresContractSerializer();
|
|
6
6
|
const validator = `${postgresTarget.targetId}@${version}`;
|
|
7
7
|
/**
|
|
@@ -30,4 +30,4 @@ function validatePostgresContract(contract) {
|
|
|
30
30
|
//#endregion
|
|
31
31
|
export { validatePostgresContract as n, contractFromJson as t };
|
|
32
32
|
|
|
33
|
-
//# sourceMappingURL=contract-from-json-
|
|
33
|
+
//# sourceMappingURL=contract-from-json-DZ5ycGcM-VMuAQZ88.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-from-json-
|
|
1
|
+
{"version":3,"file":"contract-from-json-DZ5ycGcM-VMuAQZ88.mjs","names":[],"sources":["../../../../3-extensions/postgres/dist/contract-from-json-DZ5ycGcM.mjs"],"sourcesContent":["import postgresTarget, { PostgresContractSerializer } from \"@internal/target-postgres/runtime\";\nimport { validateContractOnce } from \"@internal/contract/validate-once\";\n//#region package.json\nvar version = \"8.0.0-rc.18-dev.34\";\n//#endregion\n//#region src/static/contract-from-json.ts\nconst serializer = new PostgresContractSerializer();\nconst validator = `${postgresTarget.targetId}@${version}`;\n/**\n* Validates an emitted Postgres `contract.json` and returns it as the contract type the\n* application names, ready to pass to `postgres({ contract })` and the other Postgres clients.\n* Clients built from the result do not validate it again.\n*\n* The returned value's top level is frozen; its nested objects are not. Do not change `json` or the\n* returned value after the call: clients built from the value later do not validate it again.\n*\n* @example\n* ```ts\n* import type { Contract } from './contract.d';\n* import contractJson from './contract.json' with { type: 'json' };\n*\n* export const contract = contractFromJson<Contract>(contractJson);\n* ```\n*/\nfunction contractFromJson(json) {\n\treturn validateContractOnce(json, validator, (input) => serializer.deserializeContract(input));\n}\n/** Validates a contract value for a Postgres client, once per value. */\nfunction validatePostgresContract(contract) {\n\treturn validateContractOnce(contract, validator, () => serializer.deserializeContract(serializer.serializeContract(contract)));\n}\n//#endregion\nexport { validatePostgresContract as n, contractFromJson as t };\n\n//# sourceMappingURL=contract-from-json-DZ5ycGcM.mjs.map"],"mappings":";;;AAGA,IAAI,UAAU;AAGd,MAAM,aAAa,IAAI,2BAA2B;AAClD,MAAM,YAAY,GAAG,eAAe,SAAS,GAAG;;;;;;;;;;;;;;;;;AAiBhD,SAAS,iBAAiB,MAAM;CAC/B,OAAO,qBAAqB,MAAM,YAAY,UAAU,WAAW,oBAAoB,KAAK,CAAC;AAC9F;;AAEA,SAAS,yBAAyB,UAAU;CAC3C,OAAO,qBAAqB,UAAU,iBAAiB,WAAW,oBAAoB,WAAW,kBAAkB,QAAQ,CAAC,CAAC;AAC9H"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as validatePostgresContract } from "./contract-from-json-
|
|
1
|
+
import { n as validatePostgresContract } from "./contract-from-json-DZ5ycGcM-VMuAQZ88.mjs";
|
|
2
2
|
export { validatePostgresContract };
|
package/dist/{postgres-static-CFOGIkFB-D8whwEpX.mjs → postgres-static-BpQ18Rm3-B4IlOU06.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as validatePostgresContract } from "./contract-from-json-
|
|
1
|
+
import { n as validatePostgresContract } from "./contract-from-json-DZ5ycGcM-VMuAQZ88.mjs";
|
|
2
2
|
import { PG_ENUM_CODEC_ID } from "@prisma/orm-target-postgres/target/codec-ids";
|
|
3
3
|
import postgresTarget from "@prisma/orm-target-postgres/target/runtime";
|
|
4
4
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
@@ -6,7 +6,7 @@ import { createExecutionContext, createSqlExecutionStack } from "@prisma/orm-fam
|
|
|
6
6
|
import { createRawLane, sql } from "@prisma/orm-family-sql/builder/runtime";
|
|
7
7
|
import { buildNamespacedEnums, createEnumAccessor } from "@prisma/orm-framework/contract/enum-accessor";
|
|
8
8
|
import postgresAdapter from "@prisma/orm-target-postgres/adapter/runtime";
|
|
9
|
-
//#region ../../../3-extensions/postgres/dist/postgres-static-
|
|
9
|
+
//#region ../../../3-extensions/postgres/dist/postgres-static-BpQ18Rm3.mjs
|
|
10
10
|
/**
|
|
11
11
|
* The accessors for one namespace's value sets, leaving out each value set whose name is a domain enum's in the same namespace: a domain enum's value set takes its enum's name and namespace, and `db.enums` holds that enum. The rest are native enum types, because `native_enum` is the only pack entity that derives a value set today. Reads plain contract data, so a `validateContract`'d JSON contract works as well as a hydrated one. A member is a value, as in `CREATE TYPE … AS ENUM ('a', 'b')`, so each value is also its own name.
|
|
12
12
|
*/
|
|
@@ -75,4 +75,4 @@ function postgresStatic(options) {
|
|
|
75
75
|
//#endregion
|
|
76
76
|
export { buildPostgresStaticContext as n, postgresStatic as r, buildNamespacedNativeEnums as t };
|
|
77
77
|
|
|
78
|
-
//# sourceMappingURL=postgres-static-
|
|
78
|
+
//# sourceMappingURL=postgres-static-BpQ18Rm3-B4IlOU06.mjs.map
|
package/dist/{postgres-static-CFOGIkFB-D8whwEpX.mjs.map → postgres-static-BpQ18Rm3-B4IlOU06.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres-static-
|
|
1
|
+
{"version":3,"file":"postgres-static-BpQ18Rm3-B4IlOU06.mjs","names":[],"sources":["../../../../3-extensions/postgres/dist/postgres-static-BpQ18Rm3.mjs"],"sourcesContent":["import { n as validatePostgresContract } from \"./contract-from-json-DZ5ycGcM.mjs\";\nimport { PG_ENUM_CODEC_ID } from \"@internal/target-postgres/codec-ids\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { buildNamespacedEnums, createEnumAccessor } from \"@internal/contract/enum-accessor\";\nimport postgresAdapter from \"@internal/adapter-postgres/runtime\";\nimport { createExecutionContext, createSqlExecutionStack } from \"@internal/sql-runtime\";\nimport postgresTarget from \"@internal/target-postgres/runtime\";\nimport { createRawLane, sql } from \"@internal/sql-builder/runtime\";\n//#region src/runtime/native-enums.ts\n/**\n* The accessors for one namespace's value sets, leaving out each value set whose name is a domain enum's in the same namespace: a domain enum's value set takes its enum's name and namespace, and `db.enums` holds that enum. The rest are native enum types, because `native_enum` is the only pack entity that derives a value set today. Reads plain contract data, so a `validateContract`'d JSON contract works as well as a hydrated one. A member is a value, as in `CREATE TYPE … AS ENUM ('a', 'b')`, so each value is also its own name.\n*/\nfunction buildNativeEnumsMapForNamespace(storage, domain, namespaceId) {\n\tconst result = {};\n\tconst valueSets = storage.namespaces[namespaceId]?.entries.valueSet;\n\tif (!valueSets) return result;\n\tconst domainEnums = domain.namespaces[namespaceId]?.enum ?? {};\n\tfor (const [name, valueSet] of Object.entries(valueSets)) {\n\t\tif (Object.hasOwn(domainEnums, name)) continue;\n\t\tresult[name] = createEnumAccessor({\n\t\t\tcodecId: PG_ENUM_CODEC_ID,\n\t\t\tmembers: valueSet.values.map((value) => ({\n\t\t\t\tname: String(value),\n\t\t\t\tvalue\n\t\t\t}))\n\t\t});\n\t}\n\treturn result;\n}\nfunction buildNamespacedNativeEnums(storage, domain) {\n\tconst result = {};\n\tfor (const namespaceId of Object.keys(storage.namespaces)) result[namespaceId] = buildNativeEnumsMapForNamespace(storage, domain, namespaceId);\n\treturn result;\n}\n//#endregion\n//#region src/static/postgres-static.ts\nfunction buildPostgresStaticContext(contract, context, rawCodecInferer) {\n\tconst sqlDb = sql({\n\t\tcontext,\n\t\trawCodecInferer\n\t});\n\tconst raw = createRawLane({\n\t\tcontext,\n\t\trawCodecInferer\n\t});\n\treturn {\n\t\tcontext,\n\t\tcontract,\n\t\tenums: Object.freeze(buildNamespacedEnums(context.contract.domain, (codecId) => context.contractCodecs.forCodecRef({ codecId }))),\n\t\tnativeEnums: blindCast(Object.freeze(buildNamespacedNativeEnums(context.contract.storage, context.contract.domain))),\n\t\tsql: sqlDb,\n\t\traw\n\t};\n}\n/**\n* The query surfaces of a Postgres client without a driver: `sql`, `raw`, `enums` and\n* `nativeEnums`. Use it where loading `pg` is not wanted, for example in browser code that reads\n* enums.\n*\n* @example\n* ```ts\n* const { enums } = postgresStatic({ contract: contractFromJson<Contract>(contractJson) });\n* ```\n*/\nfunction postgresStatic(options) {\n\tconst contract = validatePostgresContract(options.contract);\n\tconst stack = createSqlExecutionStack({\n\t\ttarget: postgresTarget,\n\t\tadapter: postgresAdapter,\n\t\textensions: options.extensions ?? []\n\t});\n\treturn buildPostgresStaticContext(contract, createExecutionContext({\n\t\tcontract,\n\t\tstack\n\t}), stack.adapter.rawCodecInferer);\n}\n//#endregion\nexport { postgresStatic as n, buildNamespacedNativeEnums as r, buildPostgresStaticContext as t };\n\n//# sourceMappingURL=postgres-static-BpQ18Rm3.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,gCA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e;AAClC"}
|
package/dist/runtime.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as postgresError } from "./errors-DfWK9xep-CYOOg0sB.mjs";
|
|
2
|
-
import { n as validatePostgresContract } from "./contract-from-json-
|
|
2
|
+
import { n as validatePostgresContract } from "./contract-from-json-DZ5ycGcM-VMuAQZ88.mjs";
|
|
3
3
|
import { a as isPgPool, c as toDriverCursorOptions, i as isPgClient, l as toRuntimeOptions, n as PostgresRuntimeImpl, o as resolveOptionalPostgresBinding, r as buildPostgresRuntimeBoundMembers, s as resolvePostgresBinding, u as validateCursorOptions } from "./postgres-runtime-BLsIqXbA-LizaG8Vd.mjs";
|
|
4
|
-
import { n as buildPostgresStaticContext, t as buildNamespacedNativeEnums } from "./postgres-static-
|
|
4
|
+
import { n as buildPostgresStaticContext, t as buildNamespacedNativeEnums } from "./postgres-static-BpQ18Rm3-B4IlOU06.mjs";
|
|
5
5
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
6
6
|
import postgresTarget from "@prisma/orm-target-postgres/target/runtime";
|
|
7
7
|
import { createExecutionContext, createSqlExecutionStack } from "@prisma/orm-family-sql/runtime";
|
package/dist/runtime.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.mjs","names":[],"sources":["../../../../3-extensions/postgres/dist/runtime.mjs"],"sourcesContent":["import { t as postgresError } from \"./errors-DfWK9xep.mjs\";\nimport { a as validateCursorOptions, c as isPgPool, i as toRuntimeOptions, l as resolveOptionalPostgresBinding, o as buildPostgresRuntimeBoundMembers, r as toDriverCursorOptions, s as isPgClient, t as PostgresRuntimeImpl, u as resolvePostgresBinding } from \"./postgres-runtime-BLsIqXbA.mjs\";\nimport { r as buildNamespacedNativeEnums, t as buildPostgresStaticContext } from \"./postgres-static-
|
|
1
|
+
{"version":3,"file":"runtime.mjs","names":[],"sources":["../../../../3-extensions/postgres/dist/runtime.mjs"],"sourcesContent":["import { t as postgresError } from \"./errors-DfWK9xep.mjs\";\nimport { a as validateCursorOptions, c as isPgPool, i as toRuntimeOptions, l as resolveOptionalPostgresBinding, o as buildPostgresRuntimeBoundMembers, r as toDriverCursorOptions, s as isPgClient, t as PostgresRuntimeImpl, u as resolvePostgresBinding } from \"./postgres-runtime-BLsIqXbA.mjs\";\nimport { r as buildNamespacedNativeEnums, t as buildPostgresStaticContext } from \"./postgres-static-BpQ18Rm3.mjs\";\nimport { n as validatePostgresContract } from \"./contract-from-json-DZ5ycGcM.mjs\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport postgresAdapter from \"@internal/adapter-postgres/runtime\";\nimport postgresDriver, { suppressIdleConnectionErrors } from \"@internal/driver-postgres/runtime\";\nimport { instantiateExecutionStack } from \"@internal/framework-components/execution\";\nimport { createExecutionContext, createSqlExecutionStack } from \"@internal/sql-runtime\";\nimport postgresTarget from \"@internal/target-postgres/runtime\";\nimport { Pool } from \"pg\";\n//#region src/runtime/postgres.ts\nfunction toRuntimeBinding(binding, options) {\n\tif (binding.kind !== \"url\") return binding;\n\treturn {\n\t\tkind: \"pgPool\",\n\t\tpool: suppressIdleConnectionErrors(new Pool({\n\t\t\tconnectionString: binding.url,\n\t\t\tconnectionTimeoutMillis: options.poolOptions?.connectionTimeoutMillis ?? 2e4,\n\t\t\tidleTimeoutMillis: options.poolOptions?.idleTimeoutMillis ?? 3e4\n\t\t}))\n\t};\n}\n/**\n* Creates a lazy Postgres client. The client infers its contract type from `contract`: a value from\n* `contractFromJson` for an emitted contract, or a TypeScript-authored contract. A contract is\n* validated once, however many clients are built from it. The static query surfaces are available\n* at once; the pool is created on the first query or `connect()`.\n*\n* @example\n* ```ts\n* import { contractFromJson } from '@prisma/orm-postgres/static';\n* import postgres from '@prisma/orm-postgres/runtime';\n* import type { Contract } from './contract.d';\n* import contractJson from './contract.json' with { type: 'json' };\n*\n* export const contract = contractFromJson<Contract>(contractJson);\n* export const db = postgres({ contract, url: process.env['DATABASE_URL']! });\n* ```\n*/\nfunction postgres(options) {\n\tconst cursor = validateCursorOptions(options.cursor, \"postgres\");\n\tconst contract = validatePostgresContract(options.contract);\n\tlet binding = resolveOptionalPostgresBinding(options);\n\tconst stack = createSqlExecutionStack({\n\t\ttarget: postgresTarget,\n\t\tadapter: postgresAdapter,\n\t\tdriver: postgresDriver,\n\t\textensions: options.extensions ?? []\n\t});\n\tconst context = createExecutionContext({\n\t\tcontract,\n\t\tstack,\n\t\tdriver: postgresDriver\n\t});\n\tconst { sql, raw: rawSqlTag, enums, nativeEnums } = buildPostgresStaticContext(contract, context, stack.adapter.rawCodecInferer);\n\tlet runtimeInstance;\n\tlet runtimeDriver;\n\tlet driverConnected = false;\n\tlet connectPromise;\n\tlet backgroundConnectError;\n\tlet closePromise;\n\tlet ownsPool = false;\n\tconst connectDriver = async (resolvedBinding) => {\n\t\tif (driverConnected) return;\n\t\tif (!runtimeDriver) throw new InternalError(\"Postgres runtime driver missing\");\n\t\tif (connectPromise) return connectPromise;\n\t\tconst runtimeBinding = toRuntimeBinding(resolvedBinding, options);\n\t\tconst ownedPool = resolvedBinding.kind === \"url\" && runtimeBinding.kind === \"pgPool\" ? runtimeBinding.pool : void 0;\n\t\tconnectPromise = runtimeDriver.connect(runtimeBinding).then(() => {\n\t\t\tdriverConnected = true;\n\t\t\townsPool = ownedPool !== void 0;\n\t\t}).catch(async (err) => {\n\t\t\tbackgroundConnectError = err;\n\t\t\tconnectPromise = void 0;\n\t\t\tawait ownedPool?.end().catch(() => void 0);\n\t\t\tthrow err;\n\t\t});\n\t\treturn connectPromise;\n\t};\n\tconst getRuntime = () => {\n\t\tif (closePromise !== void 0) throw postgresError(\"DRIVER.NOT_CONNECTED\", \"Postgres client is closed\", {\n\t\t\twhy: \"close() was called on this client.\",\n\t\t\tfix: \"Create a new postgres(...) client.\",\n\t\t\tmeta: { extension: \"postgres\" }\n\t\t});\n\t\tif (backgroundConnectError !== void 0) throw backgroundConnectError;\n\t\tif (runtimeInstance) return runtimeInstance;\n\t\tconst stackInstance = instantiateExecutionStack(stack);\n\t\tconst driverDescriptor = stack.driver;\n\t\tif (!driverDescriptor) throw new InternalError(\"Driver descriptor missing from execution stack\");\n\t\tconst driver = driverDescriptor.create({ cursor: toDriverCursorOptions(cursor) });\n\t\truntimeDriver = driver;\n\t\tconst runtime = new PostgresRuntimeImpl({\n\t\t\tcontext,\n\t\t\tadapter: stackInstance.adapter,\n\t\t\tdriver,\n\t\t\t...toRuntimeOptions(options),\n\t\t\tcloseRefusal: \"at-once\"\n\t\t});\n\t\truntimeInstance = runtime;\n\t\tif (binding !== void 0) connectDriver(binding).catch(() => void 0);\n\t\treturn runtime;\n\t};\n\tconst closeOwnedRuntime = async () => {\n\t\tif (!driverConnected) await connectPromise?.catch(() => void 0);\n\t\tif (ownsPool) await runtimeInstance?.close();\n\t};\n\treturn {\n\t\tsql,\n\t\t...buildPostgresRuntimeBoundMembers({\n\t\t\tcontext,\n\t\t\tcollections: options.collections,\n\t\t\trawCodecInferer: stack.adapter.rawCodecInferer,\n\t\t\tenums,\n\t\t\tnativeEnums,\n\t\t\tgetRuntime,\n\t\t\tgetRuntimeForWork: getRuntime\n\t\t}),\n\t\tenums,\n\t\tnativeEnums,\n\t\traw: rawSqlTag,\n\t\tcontext,\n\t\tcontract,\n\t\tstack,\n\t\tasync connect(bindingInput) {\n\t\t\tif (closePromise !== void 0) throw postgresError(\"DRIVER.NOT_CONNECTED\", \"Postgres client is closed\", {\n\t\t\t\twhy: \"close() was called on this client.\",\n\t\t\t\tfix: \"Create a new postgres(...) client.\",\n\t\t\t\tmeta: { extension: \"postgres\" }\n\t\t\t});\n\t\t\tif (driverConnected || connectPromise) throw postgresError(\"DRIVER.ALREADY_CONNECTED\", \"Postgres client already connected\", {\n\t\t\t\tfix: \"Call connect() at most once per client.\",\n\t\t\t\tmeta: { extension: \"postgres\" }\n\t\t\t});\n\t\t\tif (bindingInput !== void 0) binding = resolvePostgresBinding(bindingInput);\n\t\t\tif (binding === void 0) throw postgresError(\"RUNTIME.BINDING_MISSING\", \"Postgres binding not configured. Pass url/pg/binding to postgres(...) or call db.connect({ ... }).\", { meta: { extension: \"postgres\" } });\n\t\t\tconst runtime = getRuntime();\n\t\t\tif (driverConnected) return runtime;\n\t\t\tawait connectDriver(binding);\n\t\t\treturn runtime;\n\t\t},\n\t\tclose() {\n\t\t\tclosePromise ??= closeOwnedRuntime();\n\t\t\treturn closePromise;\n\t\t},\n\t\t[Symbol.asyncDispose]() {\n\t\t\treturn this.close();\n\t\t}\n\t};\n}\n//#endregion\nexport { PostgresRuntimeImpl, buildNamespacedNativeEnums, postgres as default, isPgClient, isPgPool };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,iBAAiB,SAAS,SAAS;CAC3C,IAAI,QAAQ,SAAS,OAAO,OAAO;CACnC,OAAO;EACN,MAAM;EACN,MAAM,6BAA6B,IAAI,KAAK;GAC3C,kBAAkB,QAAQ;GAC1B,yBAAyB,QAAQ,aAAa,2BAA2B;GACzE,mBAAmB,QAAQ,aAAa,qBAAqB;EAC9D,CAAC,CAAC;CACH;AACD;;;;;;;;;;;;;;;;;;AAkBA,SAAS,SAAS,SAAS;CAC1B,MAAM,SAAS,sBAAsB,QAAQ,QAAQ,UAAU;CAC/D,MAAM,WAAW,yBAAyB,QAAQ,QAAQ;CAC1D,IAAI,UAAU,+BAA+B,OAAO;CACpD,MAAM,QAAQ,wBAAwB;EACrC,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,YAAY,QAAQ,cAAc,CAAC;CACpC,CAAC;CACD,MAAM,UAAU,uBAAuB;EACtC;EACA;EACA,QAAQ;CACT,CAAC;CACD,MAAM,EAAE,KAAK,KAAK,WAAW,OAAO,gBAAgB,2BAA2B,UAAU,SAAS,MAAM,QAAQ,eAAe;CAC/H,IAAI;CACJ,IAAI;CACJ,IAAI,kBAAkB;CACtB,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI,WAAW;CACf,MAAM,gBAA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AM,iBAAiB,MAAM;CAC5C;CACA,OAAO;EACN;EACA,GAAG,iCAAiC;GACnC;GACA,aAAa,QAAQ;GACrB,iBAAiB,MAAM,QAAQ;GAC/B;GACA;GACA;GACA,mBAAmB;EACpB,CAAC;EACD;EACA;EACA,KAAK;EACL;EACA;EACA;EACA,MAAM,QAAQ,cAAc;GAC3B,IAAI,iBAAiB,KAAK,GAAG,MAAM,cAAc,wBAAwB,6BAA6B;IACrG,KAAK;IACL,KAAK;IACL,MAAM,EAAE,WAAW,WAAW;GAC/B,CAAC;GACD,IAAI,mBAAmB,gBAAgB,MAAM,cAAc,4BAA4B,qCAAqC;IAC3H,KAAK;IACL,MAAM,EAAE,WAAW,WAAW;GAC/B,CAAC;GACD,IAAI,iBAAiB,KAAK,GAAG,UAAU,uBAAuB,YAAY;GAC1E,IAAI,YAAY,KAAK,GAAG,MAAM,cAAc,2BAA2B,sGAAsG,EAAE,MAAM,EAAE,WAAW,WAAW,EAAE,CAAC;GAChN,MAAM,UAAU,WAAW;GAC3B,IAAI,iBAAiB,OAAO;GAC5B,MAAM,cAAc,OAAO;GAC3B,OAAO;EACR;EACA,QAAQ;GACP,iBAAiB,kBAAkB;GACnC,OAAO;EACR;EACA,CAAC,OAAO,gBAAgB;GACvB,OAAO,KAAK,MAAM;EACnB;CACD;AACD"}
|
package/dist/serverless.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as postgresError } from "./errors-DfWK9xep-CYOOg0sB.mjs";
|
|
2
|
-
import { n as validatePostgresContract } from "./contract-from-json-
|
|
2
|
+
import { n as validatePostgresContract } from "./contract-from-json-DZ5ycGcM-VMuAQZ88.mjs";
|
|
3
3
|
import { c as toDriverCursorOptions, d as validatePostgresUrl, l as toRuntimeOptions, n as PostgresRuntimeImpl, r as buildPostgresRuntimeBoundMembers, t as DEFAULT_CONNECT_TIMEOUT_MILLIS, u as validateCursorOptions } from "./postgres-runtime-BLsIqXbA-LizaG8Vd.mjs";
|
|
4
|
-
import { n as buildPostgresStaticContext } from "./postgres-static-
|
|
4
|
+
import { n as buildPostgresStaticContext } from "./postgres-static-BpQ18Rm3-B4IlOU06.mjs";
|
|
5
5
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
6
6
|
import postgresTarget from "@prisma/orm-target-postgres/target/runtime";
|
|
7
7
|
import { createExecutionContext, createSqlExecutionStack } from "@prisma/orm-family-sql/runtime";
|
package/dist/serverless.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverless.mjs","names":[],"sources":["../../../../3-extensions/postgres/dist/serverless.mjs"],"sourcesContent":["import { t as postgresError } from \"./errors-DfWK9xep.mjs\";\nimport { a as validateCursorOptions, d as validatePostgresUrl, i as toRuntimeOptions, n as DEFAULT_CONNECT_TIMEOUT_MILLIS, o as buildPostgresRuntimeBoundMembers, r as toDriverCursorOptions, t as PostgresRuntimeImpl } from \"./postgres-runtime-BLsIqXbA.mjs\";\nimport { t as buildPostgresStaticContext } from \"./postgres-static-
|
|
1
|
+
{"version":3,"file":"serverless.mjs","names":[],"sources":["../../../../3-extensions/postgres/dist/serverless.mjs"],"sourcesContent":["import { t as postgresError } from \"./errors-DfWK9xep.mjs\";\nimport { a as validateCursorOptions, d as validatePostgresUrl, i as toRuntimeOptions, n as DEFAULT_CONNECT_TIMEOUT_MILLIS, o as buildPostgresRuntimeBoundMembers, r as toDriverCursorOptions, t as PostgresRuntimeImpl } from \"./postgres-runtime-BLsIqXbA.mjs\";\nimport { t as buildPostgresStaticContext } from \"./postgres-static-BpQ18Rm3.mjs\";\nimport { n as validatePostgresContract } from \"./contract-from-json-DZ5ycGcM.mjs\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport postgresAdapter from \"@internal/adapter-postgres/runtime\";\nimport postgresDriver, { suppressIdleConnectionErrors } from \"@internal/driver-postgres/runtime\";\nimport { instantiateExecutionStack } from \"@internal/framework-components/execution\";\nimport { createExecutionContext, createSqlExecutionStack } from \"@internal/sql-runtime\";\nimport postgresTarget from \"@internal/target-postgres/runtime\";\nimport { Client } from \"pg\";\nimport { redactDatabaseUrl } from \"@internal/utils/redact-db-url\";\n//#region src/runtime/postgres-serverless.ts\nfunction closedConnectionError() {\n\treturn postgresError(\"DRIVER.NOT_CONNECTED\", \"Postgres connection is closed\", {\n\t\twhy: \"close() was called on this connection, or the await using scope that held it has ended.\",\n\t\tfix: \"Call connect({ url }) again to open a new connection.\",\n\t\tmeta: { extension: \"postgres\" }\n\t});\n}\nfunction connectionFailedError(url, cause) {\n\treturn postgresError(\"DRIVER.CONNECTION_FAILED\", \"Database connection failed\", {\n\t\twhy: cause instanceof Error ? cause.message : String(cause),\n\t\tfix: \"Verify the database URL, ensure the database is reachable, and confirm credentials/permissions\",\n\t\tmeta: {\n\t\t\textension: \"postgres\",\n\t\t\t...redactDatabaseUrl(url)\n\t\t},\n\t\tcause\n\t});\n}\n/**\n* Creates a serverless client for serverless and edge runtimes (Cloudflare Workers + Hyperdrive,\n* AWS Lambda, Vercel, Deno Deploy).\n*\n* The serverless client holds no database connection and has the static members. Each\n* `connect({ url })` opens one database connection, a fresh `pg.Client`, and returns a connection\n* with the members of a `postgres()` client except `connect`. It rejects with\n* `DRIVER.CONNECTION_FAILED` when the database refuses the connection, rejects the credentials,\n* or does not answer within 20 seconds. Close the connection with `await using` or `close()`.\n*\n* The client infers its contract type from `contract` and validates it once, when the client is\n* created; connections reuse it.\n*\n* @example\n* ```ts\n* const postgres = postgresServerless({ contract: contractFromJson<Contract>(contractJson) });\n*\n* export default {\n* async fetch(_req: Request, env: Env): Promise<Response> {\n* await using db = await postgres.connect({ url: env.HYPERDRIVE.connectionString });\n* const users = await db.orm.public.User.all();\n* return Response.json(users);\n* },\n* };\n* ```\n*/\nfunction postgresServerless(options) {\n\tconst cursor = validateCursorOptions(options.cursor, \"postgresServerless\");\n\tconst contract = validatePostgresContract(options.contract);\n\tconst stack = createSqlExecutionStack({\n\t\ttarget: postgresTarget,\n\t\tadapter: postgresAdapter,\n\t\tdriver: postgresDriver,\n\t\textensions: options.extensions ?? []\n\t});\n\tconst context = createExecutionContext({\n\t\tcontract,\n\t\tstack,\n\t\tdriver: postgresDriver\n\t});\n\tconst rawCodecInferer = stack.adapter.rawCodecInferer;\n\tconst { sql, raw, enums, nativeEnums } = buildPostgresStaticContext(contract, context, rawCodecInferer);\n\tconst buildRuntimeBoundMembers = (getRuntime, getRuntimeForWork) => buildPostgresRuntimeBoundMembers({\n\t\tcontext,\n\t\tcollections: options.collections,\n\t\trawCodecInferer,\n\t\tenums,\n\t\tnativeEnums,\n\t\tgetRuntime,\n\t\tgetRuntimeForWork\n\t});\n\tconst noRuntime = () => {\n\t\tthrow new InternalError(\"The serverless client has no runtime\");\n\t};\n\tbuildRuntimeBoundMembers(noRuntime, noRuntime);\n\tconst createConnection = (runtime) => {\n\t\tlet closing;\n\t\tconst close = () => {\n\t\t\tclosing ??= runtime.close();\n\t\t\treturn closing;\n\t\t};\n\t\tconst runtimeBoundMembers = buildRuntimeBoundMembers(() => {\n\t\t\tif (closing !== void 0) throw closedConnectionError();\n\t\t\treturn runtime;\n\t\t}, () => runtime);\n\t\treturn {\n\t\t\tsql,\n\t\t\traw,\n\t\t\tenums,\n\t\t\tnativeEnums,\n\t\t\tcontext,\n\t\t\tcontract,\n\t\t\tstack,\n\t\t\t...runtimeBoundMembers,\n\t\t\tclose,\n\t\t\t[Symbol.asyncDispose]: close\n\t\t};\n\t};\n\treturn {\n\t\tsql,\n\t\traw,\n\t\tenums,\n\t\tnativeEnums,\n\t\tcontext,\n\t\tstack,\n\t\tcontract,\n\t\tasync connect(binding) {\n\t\t\tconst url = validatePostgresUrl(binding.url);\n\t\t\tconst driverDescriptor = stack.driver;\n\t\t\tif (!driverDescriptor) throw new InternalError(\"Driver descriptor missing from execution stack\");\n\t\t\tconst stackInstance = instantiateExecutionStack(stack);\n\t\t\tconst driver = driverDescriptor.create({ cursor: toDriverCursorOptions(cursor) });\n\t\t\tconst pgClient = suppressIdleConnectionErrors(new Client({\n\t\t\t\tconnectionString: url,\n\t\t\t\tconnectionTimeoutMillis: DEFAULT_CONNECT_TIMEOUT_MILLIS\n\t\t\t}));\n\t\t\tawait driver.connect({\n\t\t\t\tkind: \"pgClient\",\n\t\t\t\tclient: pgClient\n\t\t\t});\n\t\t\tconst runtime = new PostgresRuntimeImpl({\n\t\t\t\tcontext,\n\t\t\t\tadapter: stackInstance.adapter,\n\t\t\t\tdriver,\n\t\t\t\t...toRuntimeOptions(options),\n\t\t\t\tcloseRefusal: \"when-idle\"\n\t\t\t});\n\t\t\tconst connection = createConnection(runtime);\n\t\t\ttry {\n\t\t\t\tawait (await driver.acquireConnection()).release();\n\t\t\t} catch (err) {\n\t\t\t\tpgClient.end().catch(() => void 0);\n\t\t\t\tthrow connectionFailedError(url, err);\n\t\t\t}\n\t\t\treturn connection;\n\t\t}\n\t};\n}\n//#endregion\nexport { postgresServerless as default };\n\n//# sourceMappingURL=serverless.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,SAAS,wBAAwB;CAChC,OAAO,cAAc,wBAAwB,iCAAiC;EAC7E,KAAK;EACL,KAAK;EACL,MAAM,EAAE,WAAW,WAAW;CAC/B,CAAC;AACF;AACA,SAAS,sBAAsB,KAAK,OAAO;CAC1C,OAAO,cAAc,4BAA4B,8BAA8B;EAC9E,KAAK,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EAC1D,KAAK;EACL,MAAM;GACL,WAAW;GACX,GAAG,kBAAkB,GAAG;EACzB;EACA;CACD,CAAC;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAS,mBAAmB,SAAS;CACpC,MAAM,SAAS,sBAAsB,QAAQ,QAAQ,oBAAoB;CACzE,MAAM,WAAW,yBAAyB,QAAQ,QAAQ;CAC1D,MAAM,QAAQ,wBAAwB;EACrC,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,YAAY,QAAQ,cAAc,CAAC;CACpC,CAAC;CACD,MAAM,U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,OAAO,MAAM,OAAO,kBAAkB,EAAA,CAAG,QAAQ;GAClD,SAAS,KAAK;IACb,SAAS,IAAI,CAAC,CAAC,YAAY,KAAK,CAAC;IACjC,MAAM,sBAAsB,KAAK,GAAG;GACrC;GACA,OAAO;EACR;CACD;AACD"}
|
package/dist/static.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as contractFromJson } from "./contract-from-json-
|
|
2
|
-
import { r as postgresStatic } from "./postgres-static-
|
|
1
|
+
import { t as contractFromJson } from "./contract-from-json-DZ5ycGcM-VMuAQZ88.mjs";
|
|
2
|
+
import { r as postgresStatic } from "./postgres-static-BpQ18Rm3-B4IlOU06.mjs";
|
|
3
3
|
export { contractFromJson, postgresStatic as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/orm-postgres",
|
|
3
|
-
"version": "8.0.0-rc.18-dev.
|
|
3
|
+
"version": "8.0.0-rc.18-dev.34",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"skills"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@prisma/orm-family-sql": "8.0.0-rc.18-dev.
|
|
14
|
-
"@prisma/orm-framework": "8.0.0-rc.18-dev.
|
|
15
|
-
"@prisma/orm-target-postgres": "8.0.0-rc.18-dev.
|
|
16
|
-
"@prisma/orm-toolchain": "8.0.0-rc.18-dev.
|
|
13
|
+
"@prisma/orm-family-sql": "8.0.0-rc.18-dev.34",
|
|
14
|
+
"@prisma/orm-framework": "8.0.0-rc.18-dev.34",
|
|
15
|
+
"@prisma/orm-target-postgres": "8.0.0-rc.18-dev.34",
|
|
16
|
+
"@prisma/orm-toolchain": "8.0.0-rc.18-dev.34",
|
|
17
17
|
"@types/node": "26.1.2",
|
|
18
18
|
"@types/pg": "8.20.4",
|
|
19
19
|
"arktype": "^2.2.2",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"tinyglobby": "^0.2.17"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@internal/postgres": "8.0.0-rc.18-dev.
|
|
26
|
-
"@repo/tsconfig": "8.0.0-rc.18-dev.
|
|
27
|
-
"@repo/tsdown": "8.0.0-rc.18-dev.
|
|
25
|
+
"@internal/postgres": "8.0.0-rc.18-dev.34",
|
|
26
|
+
"@repo/tsconfig": "8.0.0-rc.18-dev.34",
|
|
27
|
+
"@repo/tsdown": "8.0.0-rc.18-dev.34",
|
|
28
28
|
"tsdown": "0.22.14",
|
|
29
29
|
"typescript": "5.9.3"
|
|
30
30
|
},
|
package/skills/prisma-8/SKILL.md
CHANGED
|
@@ -15,7 +15,7 @@ description: >-
|
|
|
15
15
|
ORM 7 or earlier (schema.prisma + @prisma/client).
|
|
16
16
|
metadata:
|
|
17
17
|
library: '@prisma/orm-postgres'
|
|
18
|
-
library_version: '8.0.0-rc.18-dev.
|
|
18
|
+
library_version: '8.0.0-rc.18-dev.34'
|
|
19
19
|
version: '2026-09-12'
|
|
20
20
|
---
|
|
21
21
|
|
|
@@ -66,7 +66,7 @@ Open the reference whose triggers match the task. If more than one matches, open
|
|
|
66
66
|
| Wire the runtime | [`references/runtime.md`](references/runtime.md) | `db.ts`, `contractFromJson<Contract>(...)`, `postgres({ contract })` / `sqlite({ contract })` / `mongo({ contract })` façades, middleware composition (lints, budgets, cache via `@prisma/orm-extension-middleware-cache`, custom `activityEnded` middleware, `@prisma/orm-postgres/family-runtime`), `DATABASE_URL`, `.env`, connection pool / `poolOptions`, dev vs prod config, transactions, read replicas, multi-database, script won't exit / hangs, `db.close` / `pool.end`, `await using` / `[Symbol.asyncDispose]` |
|
|
67
67
|
| Build-tool integration | [`references/build.md`](references/build.md) | Vite plugin (`@internal/vite-plugin-contract-emit`, Vite 7/8), `vite.config.ts`, contract emit on save, HMR / dev server, Next.js / Webpack / esbuild / Rollup / Turbopack (named gaps, not fabricated) |
|
|
68
68
|
| Supabase | [`references/supabase.md`](references/supabase.md) | `@internal/extension-supabase`, RLS, row level security, policies (`policy_select` / `policy_update` / `@@rls`, `auth.uid()`), role binding (`asUser(jwt)` / `asAnon()` / `asServiceRole()`), `auth.users`, cross-space FKs to `supabase:auth.AuthUser`, JWT / JWKS (`SUPABASE_JWKS_URL`, `SUPABASE_JWT_SECRET`), `SUPABASE.JWT_INVALID`, `SUPABASE.CONFIG_INVALID`, `RoleBoundDb`, session pooler |
|
|
69
|
-
| Debug an error | [`references/debug.md`](references/debug.md) | any structured error envelope (code, severity, why, fix, nextActions, meta), emit failed, query won't typecheck, query crashed, migration won't apply, `MIGRATION.HASH_MISMATCH`, `MIGRATION.
|
|
69
|
+
| Debug an error | [`references/debug.md`](references/debug.md) | any structured error envelope (code, severity, why, fix, nextActions, meta), emit failed, query won't typecheck, query crashed, migration won't apply, `MIGRATION.HASH_MISMATCH`, `MIGRATION.SCHEMA_VERIFY_FAILED`, `MIGRATION.PRECHECK_FAILED`, `BUDGET.ROWS_EXCEEDED`, `BUDGET.TIME_EXCEEDED`, `RUNTIME.ABORTED`, `RUNTIME.TEMPORAL_UNAVAILABLE`, `PLAN.HASH_MISMATCH`, `CONTRACT.MARKER_MISSING`, `CONFIG.*` / `CLI.*` / `CONTRACT.*` / `MIGRATION.*` / `ORM.*` / `RUNTIME.*` codes, legacy `PN-*` codes, exit code 4 findings, drift, capability missing, planner conflict, EXPLAIN, query log, script won't exit / close connection |
|
|
70
70
|
| Upgrade Prisma in an app | [`references/upgrade-app.md`](references/upgrade-app.md) | "upgrade Prisma", "upgrade Prisma 8", "bump Prisma 8", "move to Prisma 8 X.Y", `@internal/*` version bump in an application, per-transition upgrade instructions in [`upgrading/app/upgrades/`](upgrading/app/upgrades/), extension-pin pre-flight, `PN-UPGRADE-*` |
|
|
71
71
|
| Upgrade Prisma in an extension | [`references/upgrade-extension.md`](references/upgrade-extension.md) | the same request in a package that *is* a Prisma extension (`@internal/contract` / SPI dependency, `^@.*/extension-` name), `prisma-8-check-pins`, exact-pin rule, per-transition instructions in [`upgrading/extension/upgrades/`](upgrading/extension/upgrades/) |
|
|
72
72
|
| File feedback / ask the team | [`references/feedback.md`](references/feedback.md) | bug report, file an issue, feature request, missing feature, capability gap, "this is broken", surprising behaviour, Q&A / design discussion, ask the Prisma team, Prisma Discord (pris.ly/discord), extension-author questions |
|
|
@@ -53,9 +53,9 @@ Every code is a dotted `NAMESPACE.SUBCODE`; the namespace is the prefix (`CONFIG
|
|
|
53
53
|
|
|
54
54
|
**3. SQL driver errors** — surface as `SqlQueryError` / `SqlConnectionError` (see `packages/2-sql/1-core/errors/`). Fields on `SqlQueryError`: `kind: 'sql_query'`, `sqlState` (Postgres SQLSTATE, e.g. `'23505'`), `constraint`, `table`, `column`, `detail`, `cause`. These carry no dotted code — route on `sqlState` and the constraint metadata. SQL driver errors are typically wrapped by middleware before reaching the user, but raw-SQL paths can surface them directly.
|
|
55
55
|
|
|
56
|
-
###
|
|
56
|
+
### Migration apply failures
|
|
57
57
|
|
|
58
|
-
`db migrate`, `db init`, and `db update`
|
|
58
|
+
`db migrate`, `db init`, and `db update` report a failure of the migration runner with the runner's own code, such as `MIGRATION.SCHEMA_VERIFY_FAILED`, `MIGRATION.PRECHECK_FAILED`, `MIGRATION.POSTCHECK_FAILED` or `MIGRATION.EXECUTION_FAILED`, and its `meta` unchanged. The facts are typed `meta` keys: `schemaIssues` (the schema check's issues), `failedCheck` (`operationId`, `phase`, `description`), `failedTypeChange`, `rowsWithoutValue`, and `failingSpace`, the contract space whose plan failed. Read `why` for what failed and `nextActions` for the way out.
|
|
59
59
|
|
|
60
60
|
### How to ask for the full envelope
|
|
61
61
|
|
|
@@ -95,7 +95,8 @@ The single source of truth: read the envelope, find the row by `code`, follow th
|
|
|
95
95
|
| `CONTRACT.MARKER_MISMATCH` | `db verify` (exit 4), runtime startup (warning) | Marker disagrees with contract hash (`meta.expected` / `meta.actual`). Either migrate forward (`db migrate` / `db update`), or — if the DB is correct after a manual fix-up — `db sign`. See `references/migrations.md`. |
|
|
96
96
|
| `CONTRACT.TARGET_MISMATCH` | `db verify`, runtime startup | Contract target ≠ config target; align them (see `meta.expected` / `meta.actual`). |
|
|
97
97
|
| `CONTRACT.SCHEMA_VERIFICATION_FAILED` | `db verify`, `db sign` (both exit 4 with the finding) | Live schema does not satisfy the contract; `meta.issues` lists the drifted paths per `meta.space`. Run `db update` to reconcile, or adjust the contract. |
|
|
98
|
-
| `MIGRATION.
|
|
98
|
+
| `MIGRATION.SCHEMA_VERIFY_FAILED` | `db migrate`, `db update`, `db init` | The schema after apply does not satisfy the contract; the marker stays at its origin, and on SQL targets the apply rolled back (on MongoDB the operations that ran stay applied). `meta.schemaIssues` lists the issues and `why` names them. Change the contract source to resolve them, re-emit, and re-run; `db migrate` also says how to plan the failed migration again. |
|
|
99
|
+
| `MIGRATION.PRECHECK_FAILED` | `db migrate`, `db update`, `db init` | An operation's check before it ran did not hold (`meta.failedCheck`); the apply rolled back on SQL targets. `meta.rowsWithoutValue` is set when a field becoming required has rows with no value. Follow `nextActions`. |
|
|
99
100
|
| `CLI.CONSENT_REQUIRED` | `migration plan` / `db update` when a plan would lose data (or, on `db update`, widen access) and nobody can answer (`--no-interactive`, CI, `--yes`) | `meta.unanswered[]` and `nextActions` list each question with its flags. Re-run with `--delete <subject>`, `--rename <subject>:<new name>` or `--allow <Model>` as each subject means. `--confirm` and `--yes` answer none of them. `db migrate` does not ask. |
|
|
100
101
|
| `CLI.CONSENT_UNUSED` | `migration plan` / `db update` | Every question was answered, and a `--delete` or `--allow` was left over: a typo, a subject the plan does not touch, or a `--confirm` (which consents to nothing). Fix or drop the flag. A typo next to a question nobody answered is reported as `CLI.CONSENT_REQUIRED` instead, which names the flag that matched nothing. On `db update --dry-run` the same mistake is `MIGRATION.STATEMENT_ANSWERS_NO_QUESTION`. |
|
|
101
102
|
| `MIGRATION.STATEMENT_DID_NOT_RESOLVE_LOSS` | A rename typed at the data-loss prompt | The rename still loses the subject's data. Answer with `delete`, or give a rename whose old name is the subject. |
|
|
@@ -122,7 +123,7 @@ If the envelope's `code` is not in this table, follow the envelope's `fix` field
|
|
|
122
123
|
|
|
123
124
|
1. **Reading only `summary`, not the rest of the envelope.** `code`, `severity`, `why`, `fix`, `meta`/`details`, and (for CLI errors) `where` all carry information the recovery depends on. The agent routes on `code`; the user sees `summary`.
|
|
124
125
|
2. **Ignoring `severity`.** `migration status` emits warn-level diagnostics and **exits 0**. An agent that only checks exit code misses every concurrent-migration warning.
|
|
125
|
-
3. **
|
|
126
|
+
3. **Matching `MIGRATION.RUNNER_FAILED`.** That code no longer exists: an apply failure carries the runner's own code, and its facts are in typed `meta` keys.
|
|
126
127
|
4. **Treating drift as something to silence with `db sign`.** `db sign` writes the marker from the current contract hash and, by default, advances the `db` ref to it (`--no-advance-ref` skips the ref), but it requires schema verification to pass first. Run `db verify` before reaching for `db sign`.
|
|
127
128
|
5. **Re-running `db migrate` after a partial failure without inspecting state.** `db schema --db <url>` shows the live shape; `migration status --db <url> --json` shows where the marker actually is.
|
|
128
129
|
|
|
@@ -142,7 +143,7 @@ If the envelope's `code` is not in this table, follow the envelope's `fix` field
|
|
|
142
143
|
|
|
143
144
|
- [ ] Identified which envelope shape (`CliErrorEnvelope`, `RuntimeErrorEnvelope`, `SqlQueryError`).
|
|
144
145
|
- [ ] Read every field — `code`, `severity`, `why`, `fix`, `meta` (or `details`), `where` if present.
|
|
145
|
-
- [ ]
|
|
146
|
+
- [ ] For an apply failure, read the typed `meta` keys (`schemaIssues`, `failedCheck`, `rowsWithoutValue`, `failedTypeChange`).
|
|
146
147
|
- [ ] Routed on `code` to the next move (and chained to the matching authoring skill where the table says so).
|
|
147
148
|
- [ ] Re-verified with the relevant CLI command (`db verify`, `migration status --json`, `contract emit`, `db migrate`).
|
|
148
149
|
- [ ] Did not confabulate a Studio / EXPLAIN / query-log API — used the documented workaround and routed unmet capability gaps to `references/feedback.md`.
|