@prisma/orm-postgres 8.0.0-rc.20-dev.10 → 8.0.0-rc.20-dev.12
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 +29 -10
- package/dist/contract-builder.d.mts.map +1 -1
- package/dist/{contract-from-json-hXeQUuNz-Cmd0uqjE.mjs → contract-from-json-CNFGzz2E-lSTeckKf.mjs} +3 -3
- package/dist/{contract-from-json-hXeQUuNz-Cmd0uqjE.mjs.map → contract-from-json-CNFGzz2E-lSTeckKf.mjs.map} +1 -1
- package/dist/internal__static-context.mjs +1 -1
- package/dist/internal__validate-contract.mjs +1 -1
- package/dist/{postgres-static-BE0S6IOR-CYSMWX5J.mjs → postgres-static-ooYYhbxU-BW-HuTms.mjs} +3 -3
- package/dist/{postgres-static-BE0S6IOR-CYSMWX5J.mjs.map → postgres-static-ooYYhbxU-BW-HuTms.mjs.map} +1 -1
- package/dist/runtime.d.mts +1 -1
- package/dist/runtime.mjs +5 -6
- package/dist/runtime.mjs.map +1 -1
- package/dist/serverless.mjs +5 -6
- package/dist/serverless.mjs.map +1 -1
- package/dist/static.mjs +2 -2
- package/package.json +9 -8
- package/skills/prisma-8/SKILL.md +1 -1
- package/skills/prisma-8/references/contract.md +3 -3
- package/skills/prisma-8/references/debug.md +1 -1
|
@@ -13,7 +13,7 @@ import "@prisma/orm-framework/contract/types";
|
|
|
13
13
|
import { CodecLookupWithDescriptors, ColumnTypeDescriptor, DataTypeLookup } from "@prisma/orm-framework/components/codec";
|
|
14
14
|
import { ExtensionPackRef } from "@prisma/orm-framework/components/components";
|
|
15
15
|
import { AuthoredStorageTypeInstance, SqlNamespaceBase, SqlNamespaceInput } from "@prisma/orm-family-sql/contract/types";
|
|
16
|
-
import { Bit, Char,
|
|
16
|
+
import { Bit, Char, Numeric, TimeString, TimestampString, TimestamptzString, Timetz, VarBit, Varchar } from "@prisma/orm-target-postgres/target/codec-types";
|
|
17
17
|
import { FullTextSearchLanguage } from "@prisma/orm-target-postgres/target/operation-types";
|
|
18
18
|
//#region ../../../3-targets/postgres/9-facade/dist/contract-builder.d.mts
|
|
19
19
|
//#region src/contract/rls.d.ts
|
|
@@ -384,26 +384,26 @@ declare const enumType: BoundEnumType<{
|
|
|
384
384
|
readonly traits: "numeric" | "equality" | "order";
|
|
385
385
|
}, "traits" | "output" | "input">;
|
|
386
386
|
readonly "pg/date-temporal@1": Pick<{
|
|
387
|
-
readonly input: Temporal.PlainDate;
|
|
388
|
-
readonly output: Temporal.PlainDate;
|
|
387
|
+
readonly input: import("temporal-spec").Temporal.PlainDate;
|
|
388
|
+
readonly output: import("temporal-spec").Temporal.PlainDate;
|
|
389
389
|
readonly json: import("@prisma/orm-framework/contract/types").JsonValue;
|
|
390
390
|
readonly traits: "equality" | "order";
|
|
391
391
|
}, "traits" | "output" | "input">;
|
|
392
392
|
readonly "pg/timestamp-temporal@1": Pick<{
|
|
393
|
-
readonly input: Temporal.PlainDateTime;
|
|
394
|
-
readonly output: Temporal.PlainDateTime;
|
|
393
|
+
readonly input: import("temporal-spec").Temporal.PlainDateTime;
|
|
394
|
+
readonly output: import("temporal-spec").Temporal.PlainDateTime;
|
|
395
395
|
readonly json: import("@prisma/orm-framework/contract/types").JsonValue;
|
|
396
396
|
readonly traits: "equality" | "order";
|
|
397
397
|
}, "traits" | "output" | "input">;
|
|
398
398
|
readonly "pg/timestamptz-temporal@1": Pick<{
|
|
399
|
-
readonly input: Temporal.Instant;
|
|
400
|
-
readonly output: Temporal.Instant;
|
|
399
|
+
readonly input: import("temporal-spec").Temporal.Instant;
|
|
400
|
+
readonly output: import("temporal-spec").Temporal.Instant;
|
|
401
401
|
readonly json: import("@prisma/orm-framework/contract/types").JsonValue;
|
|
402
402
|
readonly traits: "equality" | "order";
|
|
403
403
|
}, "traits" | "output" | "input">;
|
|
404
404
|
readonly "pg/time-temporal@1": Pick<{
|
|
405
|
-
readonly input: Temporal.PlainTime;
|
|
406
|
-
readonly output: Temporal.PlainTime;
|
|
405
|
+
readonly input: import("temporal-spec").Temporal.PlainTime;
|
|
406
|
+
readonly output: import("temporal-spec").Temporal.PlainTime;
|
|
407
407
|
readonly json: import("@prisma/orm-framework/contract/types").JsonValue;
|
|
408
408
|
readonly traits: "equality" | "order";
|
|
409
409
|
}, "traits" | "output" | "input">;
|
|
@@ -431,6 +431,18 @@ declare const enumType: BoundEnumType<{
|
|
|
431
431
|
readonly json: import("@prisma/orm-framework/contract/types").JsonValue;
|
|
432
432
|
readonly traits: "equality" | "order";
|
|
433
433
|
}, "traits" | "output" | "input">;
|
|
434
|
+
readonly "pg/timestamp-date@1": Pick<{
|
|
435
|
+
readonly input: Date;
|
|
436
|
+
readonly output: Date;
|
|
437
|
+
readonly json: import("@prisma/orm-framework/contract/types").JsonValue;
|
|
438
|
+
readonly traits: "equality" | "order";
|
|
439
|
+
}, "traits" | "output" | "input">;
|
|
440
|
+
readonly "pg/timestamp-instant@1": Pick<{
|
|
441
|
+
readonly input: import("temporal-spec").Temporal.Instant;
|
|
442
|
+
readonly output: import("temporal-spec").Temporal.Instant;
|
|
443
|
+
readonly json: import("@prisma/orm-framework/contract/types").JsonValue;
|
|
444
|
+
readonly traits: "equality" | "order";
|
|
445
|
+
}, "traits" | "output" | "input">;
|
|
434
446
|
readonly "pg/time-string@1": Pick<{
|
|
435
447
|
readonly input: string;
|
|
436
448
|
readonly output: string;
|
|
@@ -486,6 +498,13 @@ declare const enumType: BoundEnumType<{
|
|
|
486
498
|
readonly traits: "equality" | "order";
|
|
487
499
|
readonly keepsWrittenForm: true;
|
|
488
500
|
}, "traits" | "keepsWrittenForm" | "output" | "input">;
|
|
501
|
+
readonly "pg/interval-string@1": Pick<{
|
|
502
|
+
readonly input: string;
|
|
503
|
+
readonly output: string;
|
|
504
|
+
readonly json: import("@prisma/orm-framework/contract/types").JsonValue;
|
|
505
|
+
readonly traits: "equality" | "order";
|
|
506
|
+
readonly keepsWrittenForm: true;
|
|
507
|
+
}, "traits" | "keepsWrittenForm" | "output" | "input">;
|
|
489
508
|
readonly "pg/json@1": Pick<{
|
|
490
509
|
readonly input: import("@prisma/orm-framework/contract/types").JsonValue;
|
|
491
510
|
readonly output: import("@prisma/orm-framework/contract/types").JsonValue;
|
|
@@ -660,5 +679,5 @@ declare const pg: {
|
|
|
660
679
|
readonly enum: typeof pgEnumColumn;
|
|
661
680
|
};
|
|
662
681
|
//#endregion
|
|
663
|
-
export { type Bit, type Char, type CheckNode, type ComposedAuthoringHelpers, type ContractDefinition, type ContractInput, type ContractModelBuilder, type EnumMember, type EnumTypeHandle, type FieldNode, type ForeignKeyNode, type IndexNode, type
|
|
682
|
+
export { type Bit, type Char, type CheckNode, type ComposedAuthoringHelpers, type ContractDefinition, type ContractInput, type ContractModelBuilder, type EnumMember, type EnumTypeHandle, type FieldNode, type ForeignKeyNode, type IndexNode, type ModelNode, type NativeEnumHandle, type Numeric, type PrimaryKeyNode, type RelationNode, type RlsEnablementHandle, type RlsEntityHandle, type RlsPolicyHandle, type RlsRoleHandle, type RlsTargetModel, type RlsUsingPolicyDescriptor, type RlsUsingWithCheckPolicyDescriptor, type RlsWithCheckPolicyDescriptor, type ScalarFieldBuilder, type SqlExpression, type TimeString, type TimestampString, type TimestamptzString, type Timetz, type UniqueConstraintNode, type VarBit, type Varchar, autoincrement, buildSqlContractFromDefinition, check, defineContract, enumType, field, fullTextIndex, gen, member, model, nativeEnum, now, pg, policyAll, policyDelete, policyInsert, policySelect, policyUpdate, rel, rlsEnabled, role, sql };
|
|
664
683
|
//# sourceMappingURL=contract-builder.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-builder.d.mts","names":[],"sources":["../../../../3-targets/postgres/9-facade/dist/contract-builder.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;UAwBU;WACC;aACE;aACA;aACA,QAAQ,eAAe;;;;;;;;UAQ1B,cAAc;WACb;WACA,MAAM;;;UAGP;WACC;;WAEA;aACE,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aACd;aACA;aACA,yCAAyC;aACzC;aACA;;WAEF,qBAAqB;aACnB;aACA;aACA,yCAAyC;aACzC;;WAEF,sBAAsB;aACpB,
|
|
1
|
+
{"version":3,"file":"contract-builder.d.mts","names":[],"sources":["../../../../3-targets/postgres/9-facade/dist/contract-builder.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;UAwBU;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,0BAA0B,eAAe;KACzC,mBAAmB,eAAe;KAClC,kBAAkB,eAAe;KACjC,+BAA+B;KAC/B;;KAEA,yBAAyB;KACzB,eAAe,sBAAsB,yBAAyB,eAAe,kBAAkB,mBAAmB,eAAe,8CAA8C,cAAc,iBAAiB,mBAAmB,sBAAsB,2BAA2B,4CAA4C,kBAAkB,mBAAmB,WA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
|
|
2
2
|
import { validateContractOnce } from "@prisma/orm-framework/contract/validate-once";
|
|
3
|
-
//#region ../../../3-targets/postgres/9-facade/dist/contract-from-json-
|
|
4
|
-
var version = "8.0.0-rc.20-dev.
|
|
3
|
+
//#region ../../../3-targets/postgres/9-facade/dist/contract-from-json-CNFGzz2E.mjs
|
|
4
|
+
var version = "8.0.0-rc.20-dev.12";
|
|
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-CNFGzz2E-lSTeckKf.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-from-json-
|
|
1
|
+
{"version":3,"file":"contract-from-json-CNFGzz2E-lSTeckKf.mjs","names":[],"sources":["../../../../3-targets/postgres/9-facade/dist/contract-from-json-CNFGzz2E.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.20-dev.12\";\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-CNFGzz2E.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 buildPostgresStaticContext } from "./postgres-static-
|
|
1
|
+
import { n as buildPostgresStaticContext } from "./postgres-static-ooYYhbxU-BW-HuTms.mjs";
|
|
2
2
|
export { buildPostgresStaticContext };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as validatePostgresContract } from "./contract-from-json-
|
|
1
|
+
import { n as validatePostgresContract } from "./contract-from-json-CNFGzz2E-lSTeckKf.mjs";
|
|
2
2
|
export { validatePostgresContract };
|
package/dist/{postgres-static-BE0S6IOR-CYSMWX5J.mjs → postgres-static-ooYYhbxU-BW-HuTms.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as validatePostgresContract } from "./contract-from-json-
|
|
1
|
+
import { n as validatePostgresContract } from "./contract-from-json-CNFGzz2E-lSTeckKf.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 { buildNamespacedEnums, createEnumAccessor } from "@prisma/orm-framework/
|
|
|
6
6
|
import postgresAdapter from "@prisma/orm-target-postgres/adapter/runtime";
|
|
7
7
|
import { createExecutionContext, createSqlExecutionStack, createToSql } from "@prisma/orm-family-sql/runtime";
|
|
8
8
|
import { createRawLane, sql } from "@prisma/orm-family-sql/builder/runtime";
|
|
9
|
-
//#region ../../../3-targets/postgres/9-facade/dist/postgres-static-
|
|
9
|
+
//#region ../../../3-targets/postgres/9-facade/dist/postgres-static-ooYYhbxU.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
|
*/
|
|
@@ -77,4 +77,4 @@ function postgresStatic(options) {
|
|
|
77
77
|
//#endregion
|
|
78
78
|
export { buildPostgresStaticContext as n, postgresStatic as r, buildNamespacedNativeEnums as t };
|
|
79
79
|
|
|
80
|
-
//# sourceMappingURL=postgres-static-
|
|
80
|
+
//# sourceMappingURL=postgres-static-ooYYhbxU-BW-HuTms.mjs.map
|
package/dist/{postgres-static-BE0S6IOR-CYSMWX5J.mjs.map → postgres-static-ooYYhbxU-BW-HuTms.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres-static-
|
|
1
|
+
{"version":3,"file":"postgres-static-ooYYhbxU-BW-HuTms.mjs","names":[],"sources":["../../../../3-targets/postgres/9-facade/dist/postgres-static-ooYYhbxU.mjs"],"sourcesContent":["import { n as validatePostgresContract } from \"./contract-from-json-CNFGzz2E.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, createToSql } 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, stack) {\n\tconst { rawCodecInferer } = stack.adapter;\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\ttoSql: createToSql(stack, contract)\n\t};\n}\n/**\n* The query surfaces of a Postgres client without a driver: `sql`, `raw`, `enums`, `nativeEnums`\n* and `toSql`. 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);\n}\n//#endregion\nexport { postgresStatic as n, buildNamespacedNativeEnums as r, buildPostgresStaticContext as t };\n\n//# sourceMappingURL=postgres-static-ooYYhbxU.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,SAAS,gCAAgC,SAAS,QAAQ,aAAa;CACtE,MAAM,SAAS,CAAC;CAChB,MAAM,YAAY,QAAQ,WAAW,YAAY,EAAE,QAAQ;CAC3D,IAAI,CAAC,WAAW,OAAO;CACvB,MAAM,cAAc,OAAO,WAAW,YAAY,EAAE,QAAQ,CAAC;CAC7D,KAAK,MAAM,CAAC,MAAM,aAAa,OAAO,QAAQ,SAAS,GAAG;EACzD,IAAI,OAAO,OAAO,aAAa,IAAI,GAAG;EACtC,OAAO,QAAQ,mBAAmB;GACjC,SAAS;GACT,SAAS,SAAS,OAAO,KAAK,WAAW;IACxC,MAAM,OAAO,KAAK;IAClB;GACD,EAAE;EACH,CAAC;CACF;CACA,OAAO;AACR;AACA,SAAS,2BAA2B,SAAS,QAAQ;CACpD,MAAM,SAAS,CAAC;CAChB,KAAK,MAAM,eAAe,OAAO,KAAK,QAAQ,UAAU,GAAG,OAAO,eAAe,gCAAgC,SAAS,QAAQ,WAAW;CAC7I,OAAO;AACR;AAGA,SAAS,2BAA2B,UAAU,SAAS,OAAO;CAC7D,MAAM,EAAE,oBAAoB,MAAM;CAClC,MAAM,QAAQ,IAAI;EACjB;EACA;CACD,CAAC;CACD,MAAM,MAAM,cAAc;EACzB;EACA;CACD,CAAC;CACD,OAAO;EACN;EACA;EACA,OAAO,OAAO,OAAO,qBAAqB,QAAQ,SAAS,SAAS,YAAY,QAAQ,eAAe,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC;EAChI,aAAa,UAAU,OAAO,OAAO,2BAA2B,QAAQ,SAAS,SAAS,QAAQ,SAAS,MAAM,CAAC,CAAC;EACnH,KAAK;EACL;EACA,OAAO,YAAY,OAAO,QAAQ;CACnC;AACD;;;;;;;;;;;AAWA,SAAS,eAAe,SAAS;CAChC,MAAM,WAAW,yBAAyB,QAAQ,QAAQ;CAC1D,MAAM,QAAQ,wBAAwB;EACrC,QAAQ;EACR,SAAS;EACT,YAAY,QAAQ,cAAc,CAAC;CACpC,CAAC;CACD,OAAO,2BAA2B,UAAU,uBAAuB;EAClE;EACA;CACD,CAAC,GAAG,KAAK;AACV"}
|
package/dist/runtime.d.mts
CHANGED
|
@@ -3,10 +3,10 @@ import { a as PostgresTransactionContext, i as PostgresStaticMembers, n as Postg
|
|
|
3
3
|
import { n as PostgresExecutionOptions, t as PostgresCursorOptions } from "./postgres-options-HIC8ThD0-k6eyhDIx.mjs";
|
|
4
4
|
import { Runtime, SqlRuntimeBase } from "@prisma/orm-family-sql/runtime";
|
|
5
5
|
import { CollectionClasses, NoCollectionClasses } from "@prisma/orm-family-sql/orm-client";
|
|
6
|
-
import { Client, Pool } from "pg";
|
|
7
6
|
import { Contract } from "@prisma/orm-framework/contract/types";
|
|
8
7
|
import { SqlStorage } from "@prisma/orm-family-sql/contract/types";
|
|
9
8
|
import { PostgresFullTextMethods } from "@prisma/orm-target-postgres/target/full-text";
|
|
9
|
+
import { Client, Pool } from "pg";
|
|
10
10
|
//#region ../../../3-targets/postgres/9-facade/dist/runtime.d.mts
|
|
11
11
|
//#region src/runtime/binding.d.ts
|
|
12
12
|
declare const isPgPool: (pg: Pool | Client) => pg is Pool;
|
package/dist/runtime.mjs
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { t as postgresError } from "./errors-DfWK9xep-CB07krZF.mjs";
|
|
2
|
-
import { n as validatePostgresContract } from "./contract-from-json-
|
|
3
|
-
import { n as buildPostgresStaticContext, t as buildNamespacedNativeEnums } from "./postgres-static-
|
|
2
|
+
import { n as validatePostgresContract } from "./contract-from-json-CNFGzz2E-lSTeckKf.mjs";
|
|
3
|
+
import { n as buildPostgresStaticContext, t as buildNamespacedNativeEnums } from "./postgres-static-ooYYhbxU-BW-HuTms.mjs";
|
|
4
4
|
import { n as buildPostgresRuntimeBoundMembers } from "./postgres-members-Bwcngc1q-HwIhD-Fq.mjs";
|
|
5
5
|
import { a as resolveOptionalPostgresBinding, c as toRuntimeOptions, i as isPgPool, l as validateCursorOptions, n as PostgresRuntimeImpl, o as resolvePostgresBinding, r as isPgClient, s as toDriverCursorOptions } from "./postgres-runtime-xWysBSgi-7GrCIG7R.mjs";
|
|
6
6
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
7
7
|
import postgresTarget from "@prisma/orm-target-postgres/target/runtime";
|
|
8
8
|
import postgresAdapter from "@prisma/orm-target-postgres/adapter/runtime";
|
|
9
9
|
import { createExecutionContext, createSqlExecutionStack } from "@prisma/orm-family-sql/runtime";
|
|
10
|
-
import postgresDriver, { suppressIdleConnectionErrors } from "@prisma/orm-target-postgres/driver/runtime";
|
|
11
|
-
import { Pool } from "pg";
|
|
10
|
+
import postgresDriver, { createPgPool, suppressIdleConnectionErrors } from "@prisma/orm-target-postgres/driver/runtime";
|
|
12
11
|
//#region ../../../3-targets/postgres/9-facade/dist/runtime.mjs
|
|
13
12
|
function toRuntimeBinding(binding, options) {
|
|
14
13
|
if (binding.kind !== "url") return {
|
|
@@ -18,11 +17,11 @@ function toRuntimeBinding(binding, options) {
|
|
|
18
17
|
return {
|
|
19
18
|
kind: "pgPool",
|
|
20
19
|
ownedByDriver: true,
|
|
21
|
-
pool: suppressIdleConnectionErrors(
|
|
20
|
+
pool: suppressIdleConnectionErrors(createPgPool({
|
|
22
21
|
connectionString: binding.url,
|
|
23
22
|
connectionTimeoutMillis: options.poolOptions?.connectionTimeoutMillis ?? 2e4,
|
|
24
23
|
idleTimeoutMillis: options.poolOptions?.idleTimeoutMillis ?? 3e4
|
|
25
|
-
}))
|
|
24
|
+
}, postgresTarget.sessionSettings ?? {}))
|
|
26
25
|
};
|
|
27
26
|
}
|
|
28
27
|
/**
|
package/dist/runtime.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.mjs","names":[],"sources":["../../../../3-targets/postgres/9-facade/dist/runtime.mjs"],"sourcesContent":["import { t as postgresError } from \"./errors-DfWK9xep.mjs\";\nimport { a as validateCursorOptions, c as resolveOptionalPostgresBinding, i as toRuntimeOptions, l as resolvePostgresBinding, o as isPgClient, r as toDriverCursorOptions, s as isPgPool, t as PostgresRuntimeImpl } from \"./postgres-runtime-xWysBSgi.mjs\";\nimport { r as buildNamespacedNativeEnums, t as buildPostgresStaticContext } from \"./postgres-static-
|
|
1
|
+
{"version":3,"file":"runtime.mjs","names":[],"sources":["../../../../3-targets/postgres/9-facade/dist/runtime.mjs"],"sourcesContent":["import { t as postgresError } from \"./errors-DfWK9xep.mjs\";\nimport { a as validateCursorOptions, c as resolveOptionalPostgresBinding, i as toRuntimeOptions, l as resolvePostgresBinding, o as isPgClient, r as toDriverCursorOptions, s as isPgPool, t as PostgresRuntimeImpl } from \"./postgres-runtime-xWysBSgi.mjs\";\nimport { r as buildNamespacedNativeEnums, t as buildPostgresStaticContext } from \"./postgres-static-ooYYhbxU.mjs\";\nimport { n as validatePostgresContract } from \"./contract-from-json-CNFGzz2E.mjs\";\nimport { n as buildPostgresRuntimeBoundMembers } from \"./postgres-members-Bwcngc1q.mjs\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport postgresAdapter from \"@internal/adapter-postgres/runtime\";\nimport postgresDriver, { createPgPool, suppressIdleConnectionErrors } from \"@internal/driver-postgres/runtime\";\nimport { createExecutionContext, createSqlExecutionStack } from \"@internal/sql-runtime\";\nimport postgresTarget from \"@internal/target-postgres/runtime\";\n//#region src/runtime/postgres.ts\nfunction toRuntimeBinding(binding, options) {\n\tif (binding.kind !== \"url\") return {\n\t\t...binding,\n\t\townedByDriver: false\n\t};\n\treturn {\n\t\tkind: \"pgPool\",\n\t\townedByDriver: true,\n\t\tpool: suppressIdleConnectionErrors(createPgPool({\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}, postgresTarget.sessionSettings ?? {}))\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, toSql } = buildPostgresStaticContext(contract, context, stack);\n\tlet runtimeInstance;\n\tlet runtimeDriver;\n\tlet driverConnected = false;\n\tlet connectPromise;\n\tlet backgroundConnectError;\n\tlet closePromise;\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\tconnectPromise = runtimeDriver.connect(runtimeBinding).then(() => {\n\t\t\tdriverConnected = true;\n\t\t}).catch(async (err) => {\n\t\t\tbackgroundConnectError = err;\n\t\t\tconnectPromise = void 0;\n\t\t\tif (runtimeBinding.kind === \"pgPool\" && runtimeBinding.ownedByDriver) await runtimeBinding.pool.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 adapter = stack.adapter.create(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,\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 closeRuntime = async () => {\n\t\tif (!driverConnected) await connectPromise?.catch(() => void 0);\n\t\tawait 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\tsql,\n\t\t\traw: rawSqlTag,\n\t\t\tenums,\n\t\t\tnativeEnums,\n\t\t\ttoSql,\n\t\t\tgetRuntime,\n\t\t\tgetRuntimeForWork: getRuntime\n\t\t}),\n\t\tenums,\n\t\tnativeEnums,\n\t\traw: rawSqlTag,\n\t\ttoSql,\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 ??= closeRuntime();\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":";;;;;;;;;;;AAWA,SAAS,iBAAiB,SAAS,SAAS;CAC3C,IAAI,QAAQ,SAAS,OAAO,OAAO;EAClC,GAAG;EACH,eAAe;CAChB;CACA,OAAO;EACN,MAAM;EACN,eAAe;EACf,MAAM,6BAA6B,aAAa;GAC/C,kBAAkB,QAAQ;GAC1B,yBAAyB,QAAQ,aAAa,2BAA2B;GACzE,mBAAmB,QAAQ,aAAa,qBAAqB;EAC9D,GAAG,eAAe,mBAAmB,CAAC,CAAC,CAAC;CACzC;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,aAAa,UAAU,2BAA2B,UAAU,SAAS,KAAK;CAC9G,IAAI;CACJ,IAAI;CACJ,IAAI,kBAAkB;CACtB,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM,gBAAgB,OAAO,oBAAoB;EAChD,IAAI,iBAAiB;EACrB,IAAI,CAAC,eAAe,MAAM,IAAI,cAAc,iCAAiC;EAC7E,IAAI,gBAAgB,OAAO;EAC3B,MAAM,iBAAiB,iBAAiB,iBAAiB,OAAO;EAChE,iBAAiB,cAAc,QAAQ,cAAc,CAAC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G,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,aAAa;GAC9B,OAAO;EACR;EACA,CAAC,OAAO,gBAAgB;GACvB,OAAO,KAAK,MAAM;EACnB;CACD;AACD"}
|
package/dist/serverless.mjs
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { t as postgresError } from "./errors-DfWK9xep-CB07krZF.mjs";
|
|
2
|
-
import { n as validatePostgresContract } from "./contract-from-json-
|
|
3
|
-
import { n as buildPostgresStaticContext } from "./postgres-static-
|
|
2
|
+
import { n as validatePostgresContract } from "./contract-from-json-CNFGzz2E-lSTeckKf.mjs";
|
|
3
|
+
import { n as buildPostgresStaticContext } from "./postgres-static-ooYYhbxU-BW-HuTms.mjs";
|
|
4
4
|
import { n as buildPostgresRuntimeBoundMembers } from "./postgres-members-Bwcngc1q-HwIhD-Fq.mjs";
|
|
5
5
|
import { c as toRuntimeOptions, l as validateCursorOptions, n as PostgresRuntimeImpl, s as toDriverCursorOptions, t as DEFAULT_CONNECT_TIMEOUT_MILLIS, u as validatePostgresUrl } from "./postgres-runtime-xWysBSgi-7GrCIG7R.mjs";
|
|
6
6
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
7
7
|
import postgresTarget from "@prisma/orm-target-postgres/target/runtime";
|
|
8
8
|
import postgresAdapter from "@prisma/orm-target-postgres/adapter/runtime";
|
|
9
9
|
import { createExecutionContext, createSqlExecutionStack } from "@prisma/orm-family-sql/runtime";
|
|
10
|
-
import postgresDriver, { suppressIdleConnectionErrors } from "@prisma/orm-target-postgres/driver/runtime";
|
|
11
|
-
import { Client } from "pg";
|
|
10
|
+
import postgresDriver, { createPgClient, suppressIdleConnectionErrors } from "@prisma/orm-target-postgres/driver/runtime";
|
|
12
11
|
import { redactDatabaseUrl } from "@prisma/orm-framework/utils/redact-db-url";
|
|
13
12
|
//#region ../../../3-targets/postgres/9-facade/dist/serverless.mjs
|
|
14
13
|
function closedConnectionError() {
|
|
@@ -124,10 +123,10 @@ function postgresServerless(options) {
|
|
|
124
123
|
if (!driverDescriptor) throw new InternalError("Driver descriptor missing from execution stack");
|
|
125
124
|
const adapter = stack.adapter.create(stack);
|
|
126
125
|
const driver = driverDescriptor.create({ cursor: toDriverCursorOptions(cursor) });
|
|
127
|
-
const pgClient = suppressIdleConnectionErrors(
|
|
126
|
+
const pgClient = suppressIdleConnectionErrors(createPgClient({
|
|
128
127
|
connectionString: url,
|
|
129
128
|
connectionTimeoutMillis: DEFAULT_CONNECT_TIMEOUT_MILLIS
|
|
130
|
-
}));
|
|
129
|
+
}, stack.target.sessionSettings ?? {}));
|
|
131
130
|
await driver.connect({
|
|
132
131
|
kind: "pgClient",
|
|
133
132
|
client: pgClient,
|
package/dist/serverless.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverless.mjs","names":[],"sources":["../../../../3-targets/postgres/9-facade/dist/serverless.mjs"],"sourcesContent":["import { t as postgresError } from \"./errors-DfWK9xep.mjs\";\nimport { a as validateCursorOptions, i as toRuntimeOptions, n as DEFAULT_CONNECT_TIMEOUT_MILLIS, r as toDriverCursorOptions, t as PostgresRuntimeImpl, u as validatePostgresUrl } from \"./postgres-runtime-xWysBSgi.mjs\";\nimport { t as buildPostgresStaticContext } from \"./postgres-static-
|
|
1
|
+
{"version":3,"file":"serverless.mjs","names":[],"sources":["../../../../3-targets/postgres/9-facade/dist/serverless.mjs"],"sourcesContent":["import { t as postgresError } from \"./errors-DfWK9xep.mjs\";\nimport { a as validateCursorOptions, i as toRuntimeOptions, n as DEFAULT_CONNECT_TIMEOUT_MILLIS, r as toDriverCursorOptions, t as PostgresRuntimeImpl, u as validatePostgresUrl } from \"./postgres-runtime-xWysBSgi.mjs\";\nimport { t as buildPostgresStaticContext } from \"./postgres-static-ooYYhbxU.mjs\";\nimport { n as validatePostgresContract } from \"./contract-from-json-CNFGzz2E.mjs\";\nimport { n as buildPostgresRuntimeBoundMembers } from \"./postgres-members-Bwcngc1q.mjs\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport postgresAdapter from \"@internal/adapter-postgres/runtime\";\nimport postgresDriver, { createPgClient, suppressIdleConnectionErrors } from \"@internal/driver-postgres/runtime\";\nimport { createExecutionContext, createSqlExecutionStack } from \"@internal/sql-runtime\";\nimport postgresTarget from \"@internal/target-postgres/runtime\";\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 { sql, raw, enums, nativeEnums, toSql } = buildPostgresStaticContext(contract, context, stack);\n\tconst buildRuntimeBoundMembers = (getRuntime, getRuntimeForWork) => buildPostgresRuntimeBoundMembers({\n\t\tcontext,\n\t\tcollections: options.collections,\n\t\tsql,\n\t\traw,\n\t\tenums,\n\t\tnativeEnums,\n\t\ttoSql,\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\ttoSql,\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\ttoSql,\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 adapter = stack.adapter.create(stack);\n\t\t\tconst driver = driverDescriptor.create({ cursor: toDriverCursorOptions(cursor) });\n\t\t\tconst pgClient = suppressIdleConnectionErrors(createPgClient({\n\t\t\t\tconnectionString: url,\n\t\t\t\tconnectionTimeoutMillis: DEFAULT_CONNECT_TIMEOUT_MILLIS\n\t\t\t}, stack.target.sessionSettings ?? {}));\n\t\t\tawait driver.connect({\n\t\t\t\tkind: \"pgClient\",\n\t\t\t\tclient: pgClient,\n\t\t\t\townedByDriver: true\n\t\t\t});\n\t\t\tconst runtime = new PostgresRuntimeImpl({\n\t\t\t\tcontext,\n\t\t\t\tadapter,\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\tawait driver.close().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":";;;;;;;;;;;;AAYA,SAAS,wBAA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A;EACA;EACA;EACA;EACA,MAAM,QAAQ,SAAS;GACtB,MAAM,MAAM,oBAAoB,QAAQ,GAAG;GAC3C,MAAM,mBAAmB,MAAM;GAC/B,IAAI,CAAC,kBAAkB,MAAM,IAAI,cAAc,gDAAgD;GAC/F,MAAM,UAAU,MAAM,QAAQ,OAAO,KAAK;GAC1C,MAAM,SAAS,iBAAiB,OAAO,EAAE,QAAQ,sBAAsB,MAAM,EAAE,CAAC;GAChF,MAAM,WAAW,6BAA6B,eAAe;IAC5D,kBAAkB;IAClB,yBAAyB;GAC1B,GAAG,MAAM,OAAO,mBAAmB,CAAC,CAAC,CAAC;GACtC,MAAM,OAAO,QAAQ;IACpB,MAAM;IACN,QAAQ;IACR,eAAe;GAChB,CAAC;GACD,MAAM,UAAU,IAAI,oBAAoB;IACvC;IACA;IACA;IACA,GAAG,iBAAiB,OAAO;IAC3B,cAAc;GACf,CAAC;GACD,MAAM,aAAa,iBAAiB,OAAO;GAC3C,IAAI;IACH,OAAO,MAAM,OAAO,kBAAkB,EAAA,CAAG,QAAQ;GAClD,SAAS,KAAK;IACb,MAAM,OAAO,MAAM,CAAC,CAAC,YAAY,KAAK,CAAC;IACvC,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-CNFGzz2E-lSTeckKf.mjs";
|
|
2
|
+
import { r as postgresStatic } from "./postgres-static-ooYYhbxU-BW-HuTms.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.20-dev.
|
|
3
|
+
"version": "8.0.0-rc.20-dev.12",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -10,21 +10,22 @@
|
|
|
10
10
|
"skills"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@prisma/orm-family-sql": "8.0.0-rc.20-dev.
|
|
14
|
-
"@prisma/orm-framework": "8.0.0-rc.20-dev.
|
|
15
|
-
"@prisma/orm-target-postgres": "8.0.0-rc.20-dev.
|
|
16
|
-
"@prisma/orm-toolchain": "8.0.0-rc.20-dev.
|
|
13
|
+
"@prisma/orm-family-sql": "8.0.0-rc.20-dev.12",
|
|
14
|
+
"@prisma/orm-framework": "8.0.0-rc.20-dev.12",
|
|
15
|
+
"@prisma/orm-target-postgres": "8.0.0-rc.20-dev.12",
|
|
16
|
+
"@prisma/orm-toolchain": "8.0.0-rc.20-dev.12",
|
|
17
17
|
"@types/node": "26.1.2",
|
|
18
18
|
"@types/pg": "8.20.4",
|
|
19
19
|
"arktype": "^2.2.2",
|
|
20
20
|
"pathe": "^2.0.3",
|
|
21
21
|
"pg": "8.22.0",
|
|
22
|
+
"temporal-spec": "1.0.1",
|
|
22
23
|
"tinyglobby": "^0.2.17"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
25
|
-
"@internal/postgres": "8.0.0-rc.20-dev.
|
|
26
|
-
"@repo/tsconfig": "8.0.0-rc.20-dev.
|
|
27
|
-
"@repo/tsdown": "8.0.0-rc.20-dev.
|
|
26
|
+
"@internal/postgres": "8.0.0-rc.20-dev.12",
|
|
27
|
+
"@repo/tsconfig": "8.0.0-rc.20-dev.12",
|
|
28
|
+
"@repo/tsdown": "8.0.0-rc.20-dev.12",
|
|
28
29
|
"tsdown": "0.22.14",
|
|
29
30
|
"typescript": "5.9.3"
|
|
30
31
|
},
|
package/skills/prisma-8/SKILL.md
CHANGED
|
@@ -117,7 +117,7 @@ model Post {
|
|
|
117
117
|
|
|
118
118
|
Then run `pnpm prisma contract emit` (or rely on the Vite plugin — see `references/build.md`). Specify cascade behaviour explicitly with `onDelete` / `onUpdate`; the default is `Restrict`.
|
|
119
119
|
|
|
120
|
-
**Temporal columns.** On PostgreSQL, `
|
|
120
|
+
**Temporal columns.** On PostgreSQL, `DateTemporal`, `TimestampTemporal(p)`, `TimestampInstant(p)`, `TimestamptzTemporal(p)` and `TimeTemporal(p)` (and `Date`, `DateTime` and `Time`, which today mean the same as `DateTemporal`, `TimestamptzTemporal` and `TimeTemporal`) read and write `Temporal` values (`Temporal.PlainDate`, `PlainDateTime`, `Instant` for both instant types, `PlainTime`), never JavaScript `Date`. They need a global `Temporal` at query time: Node.js 26.8.2 and later ship `globalThis.Temporal`; 26.8.1 and earlier — including every 22 and 24 release — do not, and the first read or write of such a column throws `RUNTIME.TEMPORAL_UNAVAILABLE`. On those runtimes either `import 'temporal-polyfill/full/global'` before the first query (add `temporal-polyfill` as a dependency) or author the column as `DateString` / `TimestampString(p)` / `TimestamptzString(p)` / `TimeString(p)`, which carry ISO 8601 text, the same on every server (`2024-01-01T00:00:00Z` for a `timestamptz`, the instant in UTC), and need no `Temporal`, or as `TimestamptzJsDate(p)` / `TimestampJsDate(p)`, which read a JavaScript `Date`. `IntervalParts(p)` reads `{ months, days, micros }` and `IntervalString(p)` an ISO 8601 duration such as `P1Y2M`. `prisma contract emit`, `prisma db init` and the other commands need no global `Temporal`: the Postgres target loads `temporal-polyfill` as a fallback `Temporal` for the control plane, and sets no global. `temporal-polyfill` is a required peer dependency of `@prisma/orm-postgres`. npm, pnpm and bun install it automatically. With Yarn, add `temporal-polyfill` (`^1.0.4`) to the project's dependencies, or the commands fail because Node.js cannot find the package. That fallback is held once per process. An application that loads control-plane code in its own process, such as server code under `vite dev` with the Prisma Vite plugin or a script that calls the control client, decodes dates without its own `Temporal`, and then fails in production. An application that uses the Temporal codecs must load its own `Temporal`. A TypeScript contract file that constructs a `Temporal` value must load an implementation too.
|
|
121
121
|
|
|
122
122
|
`@@index` also accepts `expression:` (instead of a fields list), `where:` (partial-index predicate), `unique:`, `type:`/`options:` (target-registered access method), and `name:` xor `map:`. Raw SQL in `expression:` and `where:` is a `sql` literal; a quoted string is refused with `PSL_VALUE_TYPE_INCOMPATIBLE`, whose message gives the rewrite:
|
|
123
123
|
|
|
@@ -156,7 +156,7 @@ model User {
|
|
|
156
156
|
}
|
|
157
157
|
```
|
|
158
158
|
|
|
159
|
-
An alias is expanded into each field that uses it: the column stores the alias's codec and type params, and the contract stores no alias. An alias may carry `@default`, `@onCreate` and `@onUpdate`, which every field typed by it takes: `UpdatedAt = TimestampString(3) @onCreate(now()) @onUpdate(now())`. It may not carry `@id` or `@unique`; write those on the field. A field may add attributes its alias does not set (`updatedAt UpdatedAt @default(now())`), but repeating one the alias sets is `PSL_DUPLICATE_ATTRIBUTE`. An alias may not name another alias. The targets contribute `temporal.CreatedAt` (generated on create) and `temporal.UpdatedAt` (on create and on update), written bare: `createdAt temporal.CreatedAt`. On Postgres they are `
|
|
159
|
+
An alias is expanded into each field that uses it: the column stores the alias's codec and type params, and the contract stores no alias. An alias may carry `@default`, `@onCreate` and `@onUpdate`, which every field typed by it takes: `UpdatedAt = TimestampString(3) @onCreate(now()) @onUpdate(now())`. It may not carry `@id` or `@unique`; write those on the field. A field may add attributes its alias does not set (`updatedAt UpdatedAt @default(now())`), but repeating one the alias sets is `PSL_DUPLICATE_ATTRIBUTE`. An alias may not name another alias. The targets contribute `temporal.CreatedAt` (generated on create) and `temporal.UpdatedAt` (on create and on update), written bare: `createdAt temporal.CreatedAt`. On Postgres they are `TimestamptzTemporal` columns, with `temporal.CreatedAtString` / `UpdatedAtString` and `CreatedAtJsDate` / `UpdatedAtJsDate` variants; on SQLite `DateTime`; on Mongo `Date`. They take no arguments; for a precision, write the type and attributes, as in `TimestamptzTemporal(3) @onCreate(now())`.
|
|
160
160
|
|
|
161
161
|
Values the client generates are written `@onCreate(fn())` and `@onUpdate(fn())`: `id String @id @onCreate(uuid(7))`, `slug String @onCreate(nanoid(12))`, `updatedAt DateTime @onCreate(now()) @onUpdate(now())`. `@default(...)` is a database default only (`now()`, `autoincrement()`, a literal, or `` sql`...` ``); `@default(uuid())` is refused with `PSL_GENERATOR_IN_DEFAULT`. In the TS builder, write `.onCreate(gen.uuid(7))` and `.onUpdate(gen.now())`. Column defaults and generators can sit on one field: `@default(now()) @onCreate(now())`.
|
|
162
162
|
|
|
@@ -339,7 +339,7 @@ model User {
|
|
|
339
339
|
|
|
340
340
|
**Reading members at runtime (`db.enums`).** `db.enums.<namespace>.<Enum>` on Postgres, and `db.enums.<Enum>` on SQLite and Mongo, holds each member as a query returns it: a `pg/int8@1` member written `Low = "1"` is `1n`, a date or timestamp member is the `Date` or Temporal value its codec reads, and a float member written `"NaN"` is `NaN`. So `db.enums.public.Level.members.Low === row.level` holds wherever `===` applies. `has(value)`, `nameOf(value)` and `ordinalOf(value)` find a value equal to a member: a string, number or bigint must be the member itself, and an object such as a `Date` must be of the member's kind and stored as the member is, so a date equal to a member matches although it is a different object. Text a codec would normalize, such as an upper-case uuid, is no member. Each read of a mutable member, such as a `Date` or a `Uint8Array`, returns a fresh copy, so changing it does not change the enum; a Temporal member is immutable and is the same value on every read. An enum's members are decoded when the enum is first read, so a client builds without `Temporal` even when its contract has a Temporal enum. `contract.d.ts` types each member as that same value. The rule behind this: the value a codec reads from the contract's stored form equals the value a query returns for it. The stored form itself can differ from the text the database prints, such as ISO 8601 for a timestamp.
|
|
341
341
|
|
|
342
|
-
**Codecs an enum cannot use.** An enum compares values with its members, so a codec whose values cannot be compared for equality, or whose values read back never equal a member as the contract stores it, is refused, in TypeScript with `CONTRACT.ENUM_INVALID` and in PSL with `PSL_EXTENSION_INVALID_VALUE` at the `@@type`. The message says why and what to use instead. On Postgres: `pg/
|
|
342
|
+
**Codecs an enum cannot use.** An enum compares values with its members, so a codec whose values cannot be compared for equality, or whose values read back never equal a member as the contract stores it, is refused, in TypeScript with `CONTRACT.ENUM_INVALID` and in PSL with `PSL_EXTENSION_INVALID_VALUE` at the `@@type`. The message says why and what to use instead. On Postgres: `pg/json@1`, `pg/jsonb@1`, `pg/bytea@1` and `pg/tsquery@1` (use a text enum). The text date and time codecs read their values in ISO 8601, so an enum can use them.
|
|
343
343
|
|
|
344
344
|
**Mongo enums.** A Mongo contract's collection validator lists each enum's members in their stored JSON forms, so an enum needs a codec whose BSON type JSON holds: string, int, double, bool, object or array, with finite numbers for doubles. PSL and TypeScript contracts derive the same validator. An enum over `mongo/int64@1`, `mongo/date@1` or `mongo/objectId@1` is refused: with `PSL_EXTENSION_INVALID_VALUE` in PSL, and with `CONTRACT.ENUM_INVALID` by `defineContract`.
|
|
345
345
|
|
|
@@ -110,7 +110,7 @@ The single source of truth: read the envelope, find the row by `code`, follow th
|
|
|
110
110
|
| `BUDGET.ROWS_EXCEEDED` / `BUDGET.TIME_EXCEEDED` | Runtime, when the `budgets` middleware is active | Tune `budgets({ maxRows, maxLatencyMs, ... })` or rewrite the query. See `references/runtime.md`. |
|
|
111
111
|
| `LINT.SELECT_STAR` / `LINT.NO_LIMIT` / `LINT.DELETE_WITHOUT_WHERE` / `LINT.UPDATE_WITHOUT_WHERE` / `LINT.READ_ONLY_MUTATION` | Runtime, when the `lints` middleware is active | Fix the query (add a `WHERE` / `LIMIT` / explicit columns), or relax the lint config. See `references/runtime.md`. |
|
|
112
112
|
| `PLAN.HASH_MISMATCH` | Runtime, executing a precompiled plan | The contract the plan was built against does not match the runtime contract. Re-emit, rebuild, redeploy. |
|
|
113
|
-
| `RUNTIME.TEMPORAL_UNAVAILABLE` | Runtime, first read or write touching a Temporal-backed column (`
|
|
113
|
+
| `RUNTIME.TEMPORAL_UNAVAILABLE` | Runtime, first read or write touching a Temporal-backed column (`DateTemporal`, `TimestampTemporal(p)`, `TimestampInstant(p)`, `TimestamptzTemporal(p)`, `TimeTemporal(p)`, and `Date`, `DateTime` and `Time`) or a `temporal.updatedAt()` clock | No global `Temporal`. Node.js 26.8.2 and later ship `globalThis.Temporal`; 26.8.1 and earlier — including every 22 and 24 — do not. Either `import 'temporal-polyfill/full/global'` before the first query, or author the column as `DateString` / `TimestampString(p)` / `TimestamptzString(p)` / `TimeString(p)` to read ISO 8601 text. |
|
|
114
114
|
| `ORM.RELATION_MUTATION_UNSUPPORTED` | ORM nested `create` / `connect` on an N:M relation whose junction has required payload columns | Write the junction table directly or use the SQL builder (`meta.junction`). |
|
|
115
115
|
| `RUNTIME.ABORTED` (`details.phase` = `encode\|decode\|stream\|beforeEncode\|onRow`) | Runtime, when an `AbortSignal` fires mid-execute | Cancellation, not a bug; surface to the caller. |
|
|
116
116
|
| `SqlQueryError` (no dotted code) | Raw-SQL paths surfacing a driver error | Inspect `sqlState` + `constraint` + `table` + `column`. Postgres `23505` = unique violation, `23503` = foreign-key violation, etc. Fix the data or the schema. |
|