@prisma/orm-postgres 8.0.0-rc.23-dev.14 → 8.0.0-rc.24-dev.2
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/{binding-BilWdtbO-DQOnbc6i.d.mts → binding-BN5X69gf-CIDnIWcw.d.mts} +3 -3
- package/dist/{binding-BilWdtbO-DQOnbc6i.d.mts.map → binding-BN5X69gf-CIDnIWcw.d.mts.map} +1 -1
- package/dist/{binding-DgumIe5f-BPV5_73g.mjs → binding-DkfRsUZE-Co5ssUZw.mjs} +4 -29
- package/dist/binding-DkfRsUZE-Co5ssUZw.mjs.map +1 -0
- package/dist/{contract-from-json-Cg0YjE7V-DcM6l3n6.mjs → contract-from-json-B5HzTVcl-ndoIqEHE.mjs} +3 -3
- package/dist/contract-from-json-B5HzTVcl-ndoIqEHE.mjs.map +1 -0
- package/dist/internal__options.d.mts +3 -3
- package/dist/internal__options.mjs +3 -2
- package/dist/internal__static-context.mjs +1 -1
- package/dist/internal__transaction-members.d.mts +1 -1
- package/dist/internal__transaction-members.mjs +1 -1
- package/dist/internal__validate-contract.mjs +1 -1
- package/dist/{postgres-members-Bwcngc1q-HwIhD-Fq.mjs → postgres-members-B7ZvxGYc-D_L3NVGm.mjs} +11 -4
- package/dist/postgres-members-B7ZvxGYc-D_L3NVGm.mjs.map +1 -0
- package/dist/{postgres-members-C-tRvikK-CCXnwtJ2.d.mts → postgres-members-F9CVSrrN-BFAuNPbW.d.mts} +4 -3
- package/dist/postgres-members-F9CVSrrN-BFAuNPbW.d.mts.map +1 -0
- package/dist/{postgres-options-BmYdDr4L-Dir2eRdu.d.mts → postgres-options-B0YrJID9-YkuL0Mao.d.mts} +10 -3
- package/dist/postgres-options-B0YrJID9-YkuL0Mao.d.mts.map +1 -0
- package/dist/postgres-options-CZyV9Him-2OSYJKqo.mjs +51 -0
- package/dist/postgres-options-CZyV9Him-2OSYJKqo.mjs.map +1 -0
- package/dist/{postgres-static-CI-UYXCi-DBAI4T10.mjs → postgres-static-D6D18p5D-Bwj0XxHU.mjs} +3 -3
- package/dist/{postgres-static-CI-UYXCi-DBAI4T10.mjs.map → postgres-static-D6D18p5D-Bwj0XxHU.mjs.map} +1 -1
- package/dist/runtime.d.mts +5 -4
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs +10 -7
- package/dist/runtime.mjs.map +1 -1
- package/dist/serverless.d.mts +4 -3
- package/dist/serverless.d.mts.map +1 -1
- package/dist/serverless.mjs +10 -7
- package/dist/serverless.mjs.map +1 -1
- package/dist/static.mjs +2 -2
- package/package.json +8 -8
- package/skills/prisma-8/SKILL.md +1 -1
- package/skills/prisma-8/references/contract.md +3 -1
- package/skills/prisma-8/references/migrations.md +1 -1
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.23-to-8.0.0-rc.24/instructions.md +319 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.23-to-8.0.0-rc.24/scripts/mongo-convenience-date-time-types/rewrite-mongo-date-types.ts +220 -0
- package/skills/prisma-8/upgrading/app/upgrades/8.0.0-rc.23-to-8.0.0-rc.24/scripts/mongo-type-helpers/rewrite-mongo-field-types.ts +621 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.23-to-8.0.0-rc.24/instructions.md +304 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.23-to-8.0.0-rc.24/scripts/mongo-convenience-date-time-types/rewrite-mongo-date-types.ts +220 -0
- package/skills/prisma-8/upgrading/extension/upgrades/8.0.0-rc.23-to-8.0.0-rc.24/scripts/mongo-type-helpers/rewrite-mongo-field-types.ts +621 -0
- package/dist/binding-DgumIe5f-BPV5_73g.mjs.map +0 -1
- package/dist/contract-from-json-Cg0YjE7V-DcM6l3n6.mjs.map +0 -1
- package/dist/postgres-members-Bwcngc1q-HwIhD-Fq.mjs.map +0 -1
- package/dist/postgres-members-C-tRvikK-CCXnwtJ2.d.mts.map +0 -1
- package/dist/postgres-options-BmYdDr4L-Dir2eRdu.d.mts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as PostgresPoolOptions } from "./postgres-options-
|
|
1
|
+
import { r as PostgresPoolOptions } from "./postgres-options-B0YrJID9-YkuL0Mao.mjs";
|
|
2
2
|
import { PostgresBinding } from "@prisma/orm-target-postgres/driver/runtime";
|
|
3
3
|
import { Client, Pool } from "pg";
|
|
4
|
-
//#region ../../../3-targets/postgres/9-facade/dist/binding-
|
|
4
|
+
//#region ../../../3-targets/postgres/9-facade/dist/binding-BN5X69gf.d.mts
|
|
5
5
|
//#region src/runtime/binding.d.ts
|
|
6
6
|
declare const isPgPool: (pg: Pool | Client) => pg is Pool;
|
|
7
7
|
declare const isPgClient: (pg: Pool | Client) => pg is Client;
|
|
@@ -48,4 +48,4 @@ declare function connectWithBinding(driver: {
|
|
|
48
48
|
}): Promise<void>;
|
|
49
49
|
//#endregion
|
|
50
50
|
export { isPgClient as a, connectWithBinding as i, PostgresBindingInput as n, isPgPool as o, PostgresBindingRules as r, resolveOptionalPostgresBinding as s, PostgresBinding$1 as t };
|
|
51
|
-
//# sourceMappingURL=binding-
|
|
51
|
+
//# sourceMappingURL=binding-BN5X69gf-CIDnIWcw.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binding-
|
|
1
|
+
{"version":3,"file":"binding-BN5X69gf-CIDnIWcw.d.mts","names":[],"sources":["../../../../3-targets/postgres/9-facade/dist/binding-BN5X69gf.d.mts"],"mappings":";;;;;cAIc,WAAW,IAAI,OAAO,WAAW,MAAM;cACvC,aAAa,IAAI,OAAO,WAAW,MAAM;KAClD;WACM;WACA;;WAEA;WACA,MAAM;;WAEN;WACA,QAAQ;;KAEd;WACM,SAAS;WACT;WACA;;WAEA;WACA;WACA;;WAEA,IAAI,OAAO;WACX;WACA;;KAEN;WACM,UAAU;WACV;WACA,KAAK,OAAO;;KAElB,cAAc;;UAET;WACC;WACA,OAAO,SAAS,QAAQ,OAAO;;iBAEzB,+BAA+B,SAAS,uBAAuB,OAAO,uBAAuB;;iBAE7F,mBAAmB;EAClC,QAAQ,SAAS,kBAAkB;GAClC,SAAS,mBAAmB;WACpB,cAAc;IACrB"}
|
|
@@ -1,35 +1,10 @@
|
|
|
1
1
|
import { t as postgresError } from "./errors-DfWK9xep-CB07krZF.mjs";
|
|
2
2
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
3
3
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
4
|
-
import { createPgPool, suppressIdleConnectionErrors } from "@prisma/orm-target-postgres/driver/runtime";
|
|
5
4
|
import postgresTarget from "@prisma/orm-target-postgres/target/runtime";
|
|
5
|
+
import { createPgPool, suppressIdleConnectionErrors } from "@prisma/orm-target-postgres/driver/runtime";
|
|
6
6
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
7
|
-
|
|
8
|
-
//#region ../../../3-targets/postgres/9-facade/dist/binding-DgumIe5f.mjs
|
|
9
|
-
/**
|
|
10
|
-
* Default time to wait for the database to accept a connection, for a client's pool and for a
|
|
11
|
-
* connection's `pg.Client`.
|
|
12
|
-
*/
|
|
13
|
-
const DEFAULT_CONNECT_TIMEOUT_MILLIS = 2e4;
|
|
14
|
-
const cursorOptionsSchema = type({ "batchSize?": "number.integer > 0 | undefined" }).onUndeclaredKey("reject");
|
|
15
|
-
function validateCursorOptions(cursor, helper) {
|
|
16
|
-
if (cursor === void 0) return;
|
|
17
|
-
const result = cursorOptionsSchema(cursor);
|
|
18
|
-
if (result instanceof type.errors) throw postgresError("RUNTIME.ARGUMENT_INVALID", "Invalid cursor option", {
|
|
19
|
-
why: result.summary,
|
|
20
|
-
fix: "Pass cursor: {} or cursor: { batchSize: <positive integer> } to read through a server-side cursor, or leave cursor unset to read without one.",
|
|
21
|
-
meta: {
|
|
22
|
-
extension: "postgres",
|
|
23
|
-
helper,
|
|
24
|
-
argument: "cursor",
|
|
25
|
-
received: cursor
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
return result;
|
|
29
|
-
}
|
|
30
|
-
function toDriverCursorOptions(cursor) {
|
|
31
|
-
return cursor === void 0 ? { disabled: true } : ifDefined("batchSize", cursor.batchSize);
|
|
32
|
-
}
|
|
7
|
+
//#region ../../../3-targets/postgres/9-facade/dist/binding-DkfRsUZE.mjs
|
|
33
8
|
const isPgPool = (pg) => "totalCount" in pg && "idleCount" in pg && "waitingCount" in pg;
|
|
34
9
|
const isPgClient = (pg) => "escapeIdentifier" in pg && "escapeLiteral" in pg;
|
|
35
10
|
function validatePostgresUrl(url, extension = "postgres") {
|
|
@@ -276,6 +251,6 @@ async function connectWithBinding(driver, binding, options) {
|
|
|
276
251
|
}
|
|
277
252
|
}
|
|
278
253
|
//#endregion
|
|
279
|
-
export {
|
|
254
|
+
export { resolveOptionalPostgresBinding as a, postgresBindingRules as i, isPgClient as n, resolvePostgresBinding as o, isPgPool as r, validatePostgresUrl as s, connectWithBinding as t };
|
|
280
255
|
|
|
281
|
-
//# sourceMappingURL=binding-
|
|
256
|
+
//# sourceMappingURL=binding-DkfRsUZE-Co5ssUZw.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binding-DkfRsUZE-Co5ssUZw.mjs","names":[],"sources":["../../../../3-targets/postgres/9-facade/dist/binding-DkfRsUZE.mjs"],"sourcesContent":["import { t as postgresError } from \"./errors-DfWK9xep.mjs\";\nimport \"./postgres-options-CZyV9Him.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport postgresTarget from \"@internal/target-postgres/runtime\";\nimport { createPgPool, suppressIdleConnectionErrors } from \"@internal/driver-postgres/runtime\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/runtime/binding.ts\nconst isPgPool = (pg) => \"totalCount\" in pg && \"idleCount\" in pg && \"waitingCount\" in pg;\nconst isPgClient = (pg) => \"escapeIdentifier\" in pg && \"escapeLiteral\" in pg;\nfunction validatePostgresUrl(url, extension = \"postgres\") {\n\tconst trimmed = url.trim();\n\tif (trimmed.length === 0) throw postgresError(\"RUNTIME.BINDING_INVALID\", \"Postgres URL must be a non-empty string\", { meta: {\n\t\textension,\n\t\treason: \"empty url\"\n\t} });\n\tlet parsed;\n\ttry {\n\t\tparsed = new URL(trimmed);\n\t} catch {\n\t\tthrow postgresError(\"RUNTIME.BINDING_INVALID\", \"Postgres URL must be a valid URL\", { meta: {\n\t\t\textension,\n\t\t\treason: \"unparseable url\"\n\t\t} });\n\t}\n\tif (parsed.protocol !== \"postgres:\" && parsed.protocol !== \"postgresql:\") throw postgresError(\"RUNTIME.BINDING_INVALID\", \"Postgres URL must use postgres:// or postgresql://\", { meta: {\n\t\textension,\n\t\treason: \"wrong scheme\",\n\t\t...ifDefined(\"received\", trimmed.toLowerCase().startsWith(`${parsed.protocol}//`) ? parsed.protocol : void 0)\n\t} });\n\treturn trimmed;\n}\nfunction typeOfInput(value) {\n\treturn value === null ? \"null\" : typeof value;\n}\nfunction isObject(value) {\n\treturn typeof value === \"object\" && value !== null;\n}\nconst postgresBindingRules = {\n\textension: \"postgres\",\n\tkinds: {\n\t\turl: true,\n\t\tpgPool: true,\n\t\tpgClient: true\n\t}\n};\nconst bindingForms = {\n\turl: \"{ kind: 'url', url }\",\n\tpgPool: \"{ kind: 'pgPool', pool }\",\n\tpgClient: \"{ kind: 'pgClient', client }\"\n};\nfunction isBindingKind(kind) {\n\treturn typeof kind === \"string\" && Object.hasOwn(bindingForms, kind);\n}\nconst pgObjectNames = {\n\tpgPool: \"pg.Pool\",\n\tpgClient: \"pg.Client\"\n};\nfunction orList(items) {\n\treturn items.length < 2 ? items.join(\"\") : `${items.slice(0, -1).join(\", \")} or ${items[items.length - 1]}`;\n}\nfunction wordingOf(rules) {\n\tconst kinds = Object.keys(bindingForms).filter(isBindingKind).filter((kind) => rules.kinds[kind] === true);\n\tconst pgKinds = kinds.filter((kind) => pgObjectNames[kind] !== void 0);\n\tconst pgNames = pgKinds.flatMap((kind) => pgObjectNames[kind] ?? []);\n\treturn {\n\t\textension: rules.extension,\n\t\tkinds: orList(kinds.map((kind) => `'${kind}'`)),\n\t\tforms: orList(kinds.map((kind) => bindingForms[kind])),\n\t\tpgForms: orList(pgKinds.map((kind) => `binding: ${bindingForms[kind]}`)),\n\t\tpgObjects: orList(pgNames),\n\t\tpgObjectsEach: orList(pgNames.map((name) => `a ${name}`))\n\t};\n}\nfunction invalidInput(wording, input, message, fix) {\n\tconst receivedType = typeOfInput(input.value);\n\treturn postgresError(\"RUNTIME.BINDING_INVALID\", message, {\n\t\twhy: `The ${input.name} is ${receivedType === \"null\" ? \"null\" : `a ${receivedType}`}, and it must be ${input.expected}.`,\n\t\tfix,\n\t\tmeta: {\n\t\t\textension: wording.extension,\n\t\t\treason: input.reason,\n\t\t\treceivedType\n\t\t}\n\t});\n}\nconst echoableKind = /^[A-Za-z_][A-Za-z0-9_]{0,31}$/;\nfunction describeUnknownKind(kind) {\n\tif (kind === void 0) return {\n\t\twhy: \"The binding option has no kind, so it names no database.\",\n\t\treceived: { receivedKind: \"undefined\" }\n\t};\n\tif (typeof kind === \"string\" && echoableKind.test(kind)) return {\n\t\twhy: `The binding option has kind '${kind}', which is not a binding kind this client takes.`,\n\t\treceived: { receivedKind: kind }\n\t};\n\tconst receivedType = typeOfInput(kind);\n\treturn {\n\t\twhy: typeof kind === \"string\" ? \"The binding option has a kind that is a string not in the list of binding kinds.\" : `The binding option has kind of type ${receivedType}, which is not a binding kind.`,\n\t\treceived: typeof kind === \"string\" ? { receivedType } : { receivedKind: receivedType }\n\t};\n}\nfunction unknownKindError(wording, kind) {\n\tconst { why, received } = describeUnknownKind(kind);\n\treturn postgresError(\"RUNTIME.BINDING_INVALID\", `The binding option must have kind ${wording.kinds}`, {\n\t\twhy,\n\t\tfix: `Pass binding: ${wording.forms}.`,\n\t\tmeta: {\n\t\t\textension: wording.extension,\n\t\t\treason: \"unknown binding kind\",\n\t\t\t...received\n\t\t}\n\t});\n}\nfunction checkInputTypes(options, rules, wording) {\n\tconst binding = options.binding;\n\tconst url = options.url;\n\tconst pg = options.pg;\n\tif (binding !== void 0 && !isObject(binding)) throw invalidInput(wording, {\n\t\tname: \"binding option\",\n\t\tvalue: binding,\n\t\texpected: \"an object with a kind\",\n\t\treason: \"invalid binding input\"\n\t}, \"The binding option must be an object with a kind\", `Pass binding: ${wording.forms}.`);\n\tif (url !== void 0 && typeof url !== \"string\") throw invalidInput(wording, {\n\t\tname: \"url option\",\n\t\tvalue: url,\n\t\texpected: \"a connection string\",\n\t\treason: \"invalid url input\"\n\t}, \"The url option must be a string\", \"Pass a postgres:// or postgresql:// connection string as url, and check that the variable it comes from is set.\");\n\tif (pg !== void 0 && !isObject(pg)) throw invalidInput(wording, {\n\t\tname: \"pg option\",\n\t\tvalue: pg,\n\t\texpected: `a ${wording.pgObjects} object`,\n\t\treason: \"invalid pg input\"\n\t}, `The pg option must be ${wording.pgObjectsEach}`, `Pass a ${wording.pgObjects} as pg, or pass a connection string as url.`);\n\tif (binding !== void 0) {\n\t\tconst kind = \"kind\" in binding ? binding.kind : void 0;\n\t\tif (!isBindingKind(kind) || rules.kinds[kind] !== true) throw unknownKindError(wording, kind);\n\t}\n}\nfunction checkBindingContents(binding, wording) {\n\tif (binding.kind === \"url\") {\n\t\tconst url = binding.url;\n\t\tif (typeof url !== \"string\") throw invalidInput(wording, {\n\t\t\tname: \"url in the binding option\",\n\t\t\tvalue: url,\n\t\t\texpected: \"a connection string\",\n\t\t\treason: \"invalid binding url\"\n\t\t}, \"The url in the binding option must be a string\", \"Pass binding: { kind: 'url', url } with a postgres:// or postgresql:// connection string, and check that the variable it comes from is set.\");\n\t\treturn {\n\t\t\tkind: \"url\",\n\t\t\turl: validatePostgresUrl(url, wording.extension)\n\t\t};\n\t}\n\tconst [name, value] = binding.kind === \"pgPool\" ? [\"pool\", binding.pool] : [\"client\", binding.client];\n\tif (!isObject(value)) {\n\t\tconst objectName = binding.kind === \"pgPool\" ? \"pg.Pool\" : \"pg.Client\";\n\t\tthrow invalidInput(wording, {\n\t\t\tname: `${name} in the binding option`,\n\t\t\tvalue,\n\t\t\texpected: `a ${objectName}`,\n\t\t\treason: `invalid binding ${name}`\n\t\t}, `The ${name} in the binding option must be a ${objectName}`, `Pass binding: ${bindingForms[binding.kind]} with a ${objectName}.`);\n\t}\n\treturn binding;\n}\nfunction resolveBinding(options, rules) {\n\tconst wording = wordingOf(rules);\n\tcheckInputTypes(options, rules, wording);\n\tconst binding = resolveInput(options, rules, wording);\n\tif (rules.kinds[binding.kind] !== true) throw refusedInputError(wording, options.url !== void 0 ? \"url\" : \"pg\", binding.kind);\n\treturn binding;\n}\nconst inputDescriptions = {\n\turl: \"a connection string\",\n\tpgPool: \"a pg.Pool\",\n\tpgClient: \"a pg.Client\"\n};\nfunction refusedInputError(wording, option, kind) {\n\tconst pgFix = wording.pgObjectsEach === \"\" ? \"\" : `${wording.pgObjectsEach} as pg, or `;\n\treturn postgresError(\"RUNTIME.BINDING_INVALID\", `The ${option} option is ${inputDescriptions[kind]}, which this client does not take`, {\n\t\tfix: `Pass ${pgFix}binding: ${wording.forms}.`,\n\t\tmeta: {\n\t\t\textension: wording.extension,\n\t\t\treason: `refused ${option} input`,\n\t\t\treceivedKind: kind\n\t\t}\n\t});\n}\nfunction resolveInput(options, rules, wording) {\n\tif (Number(options.binding !== void 0) + Number(options.url !== void 0) + Number(options.pg !== void 0) !== 1) throw postgresError(\"RUNTIME.BINDING_INVALID\", \"Provide one binding input: binding, url, or pg\", {\n\t\tfix: \"Pass exactly one of `binding`, `url`, or `pg`.\",\n\t\tmeta: {\n\t\t\textension: rules.extension,\n\t\t\treason: \"zero or multiple binding inputs\"\n\t\t}\n\t});\n\tif (options.binding !== void 0) return checkBindingContents(options.binding, wording);\n\tif (options.url !== void 0) return {\n\t\tkind: \"url\",\n\t\turl: validatePostgresUrl(options.url, rules.extension)\n\t};\n\tconst pgBinding = options.pg;\n\tif (pgBinding === void 0) throw new InternalError(\"Invariant violation: expected pg binding after validation\");\n\tif (isPgPool(pgBinding)) return {\n\t\tkind: \"pgPool\",\n\t\tpool: pgBinding\n\t};\n\tif (isPgClient(pgBinding)) return {\n\t\tkind: \"pgClient\",\n\t\tclient: pgBinding\n\t};\n\tthrow postgresError(\"RUNTIME.BINDING_INVALID\", \"Unable to determine pg binding type from pg input; use binding with explicit kind\", {\n\t\tfix: `Pass ${wording.pgForms} instead of pg.`,\n\t\tmeta: {\n\t\t\textension: rules.extension,\n\t\t\treason: \"unrecognizable pg object\"\n\t\t}\n\t});\n}\nfunction resolvePostgresBinding(options) {\n\treturn resolveBinding(options, postgresBindingRules);\n}\nfunction resolveOptionalPostgresBinding(options, rules) {\n\tif (Number(options.binding !== void 0) + Number(options.url !== void 0) + Number(options.pg !== void 0) === 0) return;\n\treturn resolveBinding(blindCast(options), rules);\n}\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/** Connects `driver` to `binding`, and ends the pool created for a url binding when the connection fails. */\nasync function connectWithBinding(driver, binding, options) {\n\tconst runtimeBinding = toRuntimeBinding(binding, options);\n\ttry {\n\t\tawait driver.connect(runtimeBinding);\n\t} catch (error) {\n\t\tif (runtimeBinding.kind === \"pgPool\" && runtimeBinding.ownedByDriver) await runtimeBinding.pool.end().catch(() => void 0);\n\t\tthrow error;\n\t}\n}\n//#endregion\nexport { resolveOptionalPostgresBinding as a, postgresBindingRules as i, isPgClient as n, resolvePostgresBinding as o, isPgPool as r, validatePostg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C,kBAAkB,QAAQ;GAC1B,yBAAyB,QAAQ,aAAa,2BAA2B;GACzE,mBAAmB,QAAQ,aAAa,qBAAqB;EAC9D,GAAG,eAAe,mBAAmB,CAAC,CAAC,CAAC;CACzC;AACD;;AAEA,eAAe,mBAAmB,QAAQ,SAAS,SAAS;CAC3D,MAAM,iBAAiB,iBAAiB,SAAS,OAAO;CACxD,IAAI;EACH,MAAM,OAAO,QAAQ,cAAc;CACpC,SAAS,OAAO;EACf,IAAI,eAAe,SAAS,YAAY,eAAe,eAAe,MAAM,eAAe,KAAK,IAAI,CAAC,CAAC,YAAY,KAAK,CAAC;EACxH,MAAM;CACP;AACD"}
|
package/dist/{contract-from-json-Cg0YjE7V-DcM6l3n6.mjs → contract-from-json-B5HzTVcl-ndoIqEHE.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-targets/postgres/9-facade/dist/contract-from-json-
|
|
4
|
-
var version = "8.0.0-rc.
|
|
3
|
+
//#region ../../../3-targets/postgres/9-facade/dist/contract-from-json-B5HzTVcl.mjs
|
|
4
|
+
var version = "8.0.0-rc.24-dev.2";
|
|
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-B5HzTVcl-ndoIqEHE.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-from-json-B5HzTVcl-ndoIqEHE.mjs","names":[],"sources":["../../../../3-targets/postgres/9-facade/dist/contract-from-json-B5HzTVcl.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.24-dev.2\";\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-B5HzTVcl.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,3 +1,3 @@
|
|
|
1
|
-
import { a as validateCursorOptions,
|
|
2
|
-
import { i as connectWithBinding, r as PostgresBindingRules, s as resolveOptionalPostgresBinding } from "./binding-
|
|
3
|
-
export { type PostgresBindingRules, connectWithBinding, resolveOptionalPostgresBinding, toDriverCursorOptions, validateCursorOptions };
|
|
1
|
+
import { a as toDriverCursorOptions, o as validateCursorOptions, s as validateTransactionOptions } from "./postgres-options-B0YrJID9-YkuL0Mao.mjs";
|
|
2
|
+
import { i as connectWithBinding, r as PostgresBindingRules, s as resolveOptionalPostgresBinding } from "./binding-BN5X69gf-CIDnIWcw.mjs";
|
|
3
|
+
export { type PostgresBindingRules, connectWithBinding, resolveOptionalPostgresBinding, toDriverCursorOptions, validateCursorOptions, validateTransactionOptions };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { i as validateTransactionOptions, n as toDriverCursorOptions, r as validateCursorOptions } from "./postgres-options-CZyV9Him-2OSYJKqo.mjs";
|
|
2
|
+
import { a as resolveOptionalPostgresBinding, t as connectWithBinding } from "./binding-DkfRsUZE-Co5ssUZw.mjs";
|
|
3
|
+
export { connectWithBinding, resolveOptionalPostgresBinding, toDriverCursorOptions, validateCursorOptions, validateTransactionOptions };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as buildPostgresStaticContext } from "./postgres-static-
|
|
1
|
+
import { n as buildPostgresStaticContext } from "./postgres-static-D6D18p5D-Bwj0XxHU.mjs";
|
|
2
2
|
export { buildPostgresStaticContext };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { o as buildPostgresQueryMembers } from "./postgres-members-
|
|
1
|
+
import { o as buildPostgresQueryMembers } from "./postgres-members-F9CVSrrN-BFAuNPbW.mjs";
|
|
2
2
|
export { buildPostgresQueryMembers };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as buildPostgresQueryMembers } from "./postgres-members-
|
|
1
|
+
import { t as buildPostgresQueryMembers } from "./postgres-members-B7ZvxGYc-D_L3NVGm.mjs";
|
|
2
2
|
export { buildPostgresQueryMembers };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as validatePostgresContract } from "./contract-from-json-
|
|
1
|
+
import { n as validatePostgresContract } from "./contract-from-json-B5HzTVcl-ndoIqEHE.mjs";
|
|
2
2
|
export { validatePostgresContract };
|
package/dist/{postgres-members-Bwcngc1q-HwIhD-Fq.mjs → postgres-members-B7ZvxGYc-D_L3NVGm.mjs}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { i as validateTransactionOptions } from "./postgres-options-CZyV9Him-2OSYJKqo.mjs";
|
|
1
2
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
2
3
|
import { activitySource, delegatingActivitySource, delegatingRuntime, withTransaction, withTransactionMembers } from "@prisma/orm-family-sql/runtime";
|
|
3
4
|
import { orm, prepareQuery } from "@prisma/orm-family-sql/orm-client";
|
|
4
|
-
//#region ../../../3-targets/postgres/9-facade/dist/postgres-members-
|
|
5
|
+
//#region ../../../3-targets/postgres/9-facade/dist/postgres-members-B7ZvxGYc.mjs
|
|
5
6
|
/**
|
|
6
7
|
* Builds the query members of a Postgres transaction over `txCtx`, so every statement they run goes through the transaction. `query` and `execute` are the transaction's own; `sql`, `raw` and `toSql` are the client's. Preparing sends nothing to the database, so `prepare` uses `prepareRuntime`; the prepared statement runs on the queryable it is given.
|
|
7
8
|
*/
|
|
@@ -30,7 +31,7 @@ function buildPostgresQueryMembers(options, txCtx) {
|
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
function buildPostgresRuntimeBoundMembers(options) {
|
|
33
|
-
const { context, collections, sql, raw, enums, nativeEnums, toSql, getRuntime, getRuntimeForWork } = options;
|
|
34
|
+
const { context, collections, sql, raw, enums, nativeEnums, toSql, getRuntime, getRuntimeForWork, transactionOptions } = options;
|
|
34
35
|
const workRuntime = delegatingRuntime(getRuntimeForWork);
|
|
35
36
|
const orm$1 = orm({
|
|
36
37
|
runtime: workRuntime,
|
|
@@ -48,7 +49,10 @@ function buildPostgresRuntimeBoundMembers(options) {
|
|
|
48
49
|
return getRuntime();
|
|
49
50
|
},
|
|
50
51
|
prepare,
|
|
51
|
-
transaction(fn) {
|
|
52
|
+
async transaction(fn, localOptions) {
|
|
53
|
+
const local = validateTransactionOptions(localOptions);
|
|
54
|
+
const isolationLevel = local?.isolationLevel !== void 0 ? local.isolationLevel : transactionOptions?.isolationLevel;
|
|
55
|
+
const timeout = local?.timeout !== void 0 ? local.timeout : transactionOptions?.timeout;
|
|
52
56
|
return withTransaction(workRuntime, (txCtx) => {
|
|
53
57
|
return fn(withTransactionMembers(txCtx, {
|
|
54
58
|
...buildPostgresQueryMembers({
|
|
@@ -62,6 +66,9 @@ function buildPostgresRuntimeBoundMembers(options) {
|
|
|
62
66
|
enums,
|
|
63
67
|
nativeEnums
|
|
64
68
|
}));
|
|
69
|
+
}, {
|
|
70
|
+
isolationLevel,
|
|
71
|
+
timeout
|
|
65
72
|
});
|
|
66
73
|
}
|
|
67
74
|
};
|
|
@@ -69,4 +76,4 @@ function buildPostgresRuntimeBoundMembers(options) {
|
|
|
69
76
|
//#endregion
|
|
70
77
|
export { buildPostgresRuntimeBoundMembers as n, buildPostgresQueryMembers as t };
|
|
71
78
|
|
|
72
|
-
//# sourceMappingURL=postgres-members-
|
|
79
|
+
//# sourceMappingURL=postgres-members-B7ZvxGYc-D_L3NVGm.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postgres-members-B7ZvxGYc-D_L3NVGm.mjs","names":[],"sources":["../../../../3-targets/postgres/9-facade/dist/postgres-members-B7ZvxGYc.mjs"],"sourcesContent":["import { i as validateTransactionOptions } from \"./postgres-options-CZyV9Him.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { activitySource, delegatingActivitySource, delegatingRuntime, withTransaction, withTransactionMembers } from \"@internal/sql-runtime\";\nimport { orm, prepareQuery } from \"@internal/sql-orm-client\";\n//#region src/runtime/postgres-members.ts\n/**\n* Builds the query members of a Postgres transaction over `txCtx`, so every statement they run goes through the transaction. `query` and `execute` are the transaction's own; `sql`, `raw` and `toSql` are the client's. Preparing sends nothing to the database, so `prepare` uses `prepareRuntime`; the prepared statement runs on the queryable it is given.\n*/\nfunction buildPostgresQueryMembers(options, txCtx) {\n\tconst { context, collections, sql, raw, toSql, prepareRuntime } = options;\n\treturn {\n\t\ttoSql,\n\t\tsql,\n\t\traw,\n\t\torm: orm({\n\t\t\truntime: {\n\t\t\t\tquery(plan) {\n\t\t\t\t\treturn txCtx.query(plan);\n\t\t\t\t},\n\t\t\t\texecute(plan) {\n\t\t\t\t\treturn txCtx.execute(plan);\n\t\t\t\t},\n\t\t\t\t[activitySource]: delegatingActivitySource(() => txCtx)\n\t\t\t},\n\t\t\tcontext,\n\t\t\t...ifDefined(\"collections\", collections)\n\t\t}),\n\t\tprepare(declaration, callback) {\n\t\t\treturn prepareQuery(prepareRuntime, declaration, callback);\n\t\t}\n\t};\n}\nfunction buildPostgresRuntimeBoundMembers(options) {\n\tconst { context, collections, sql, raw, enums, nativeEnums, toSql, getRuntime, getRuntimeForWork, transactionOptions } = options;\n\tconst workRuntime = delegatingRuntime(getRuntimeForWork);\n\tconst orm$1 = orm({\n\t\truntime: workRuntime,\n\t\tcontext,\n\t\t...ifDefined(\"collections\", collections)\n\t});\n\tfunction prepare(declaration, callback) {\n\t\treturn prepareQuery(workRuntime, declaration, callback);\n\t}\n\treturn {\n\t\torm: orm$1,\n\t\tquery: workRuntime.query,\n\t\texecute: workRuntime.execute,\n\t\truntime() {\n\t\t\treturn getRuntime();\n\t\t},\n\t\tprepare,\n\t\tasync transaction(fn, localOptions) {\n\t\t\tconst local = validateTransactionOptions(localOptions);\n\t\t\tconst isolationLevel = local?.isolationLevel !== void 0 ? local.isolationLevel : transactionOptions?.isolationLevel;\n\t\t\tconst timeout = local?.timeout !== void 0 ? local.timeout : transactionOptions?.timeout;\n\t\t\treturn withTransaction(workRuntime, (txCtx) => {\n\t\t\t\treturn fn(withTransactionMembers(txCtx, {\n\t\t\t\t\t...buildPostgresQueryMembers({\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\tcollections,\n\t\t\t\t\t\tsql,\n\t\t\t\t\t\traw,\n\t\t\t\t\t\ttoSql,\n\t\t\t\t\t\tprepareRuntime: workRuntime\n\t\t\t\t\t}, txCtx),\n\t\t\t\t\tenums,\n\t\t\t\t\tnativeEnums\n\t\t\t\t}));\n\t\t\t}, {\n\t\t\t\tisolationLevel,\n\t\t\t\ttimeout\n\t\t\t});\n\t\t}\n\t};\n}\n//#endregion\nexport { buildPostgresRuntimeBoundMembers as n, buildPostgresQueryMembers as t };\n\n//# sourceMappingURL=postgres-members-B7ZvxGYc.mjs.map"],"mappings":";;;;;;;;AAQA,SAAS,0BAA0B,SAAS,OAAO;CAClD,MAAM,EAAE,SAAS,aAAa,KAAK,KAAK,OAAO,mBAAmB;CAClE,OAAO;EACN;EACA;EACA;EACA,KAAK,IAAI;GACR,SAAS;IACR,MAAM,MAAM;KACX,OAAO,MAAM,MAAM,IAAI;IACxB;IACA,QAAQ,MAAM;KACb,OAAO,MAAM,QAAQ,IAAI;IAC1B;KACC,iBAAiB,+BAA+B,KAAK;GACvD;GACA;GACA,GAAG,UAAU,eAAe,WAAW;EACxC,CAAC;EACD,QAAQ,aAAa,UAAU;GAC9B,OAAO,aAAa,gBAAgB,aAAa,QAAQ;EAC1D;CACD;AACD;AACA,SAAS,iCAAiC,SAAS;CAClD,MAAM,EAAE,SAAS,aAAa,KAAK,KAAK,OAAO,aAAa,OAAO,YAAY,mBAAmB,uBAAuB;CACzH,MAAM,cAAc,kBAAkB,iBAAiB;CACvD,MAAM,QAAQ,IAAI;EACjB,SAAS;EACT;EACA,GAAG,UAAU,eAAe,WAAW;CACxC,CAAC;CACD,SAAS,QAAQ,aAAa,UAAU;EACvC,OAAO,aAAa,aAAa,aAAa,QAAQ;CACvD;CACA,OAAO;EACN,KAAK;EACL,OAAO,YAAY;EACnB,SAAS,YAAY;EACrB,UAAU;GACT,OAAO,WAAW;EACnB;EACA;EACA,MAAM,YAAY,IAAI,cAAc;GACnC,MAAM,QAAQ,2BAA2B,YAAY;GACrD,MAAM,iBAAiB,OAAO,mBAAmB,KAAK,IAAI,MAAM,iBAAiB,oBAAoB;GACrG,MAAM,UAAU,OAAO,YAAY,KAAK,IAAI,MAAM,UAAU,oBAAoB;GAChF,OAAO,gBAAgB,cAAc,UAAU;IAC9C,OAAO,GAAG,uBAAuB,OAAO;KACvC,GAAG,0BAA0B;MAC5B;MACA;MACA;MACA;MACA;MACA,gBAAgB;KACjB,GAAG,KAAK;KACR;KACA;IACD,CAAC,CAAC;GACH,GAAG;IACF;IACA;GACD,CAAC;EACF;CACD;AACD"}
|
package/dist/{postgres-members-C-tRvikK-CCXnwtJ2.d.mts → postgres-members-F9CVSrrN-BFAuNPbW.d.mts}
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { t as PostgresTargetId } from "./postgres-target-id-C9d1Qq7Q-70StSvqm.mjs";
|
|
2
|
+
import { i as PostgresTransactionOptions } from "./postgres-options-B0YrJID9-YkuL0Mao.mjs";
|
|
2
3
|
import { n as PostgresStaticContext, t as NamespacedNativeEnums } from "./postgres-static-S38TCEK6-Dswb17fx.mjs";
|
|
3
4
|
import { NamespacedEnums } from "@prisma/orm-framework/contract/enum-accessor";
|
|
4
5
|
import { ExecutionContext, Runtime, SqlExecutionStackWithDriver, ToSqlMember, TransactionContext } from "@prisma/orm-family-sql/runtime";
|
|
@@ -7,7 +8,7 @@ import { Contract } from "@prisma/orm-framework/contract/types";
|
|
|
7
8
|
import { SqlStorage } from "@prisma/orm-family-sql/contract/types";
|
|
8
9
|
import { Db, RawLane } from "@prisma/orm-family-sql/builder/types";
|
|
9
10
|
import { RuntimeScope } from "@prisma/orm-family-sql/relational-core/types";
|
|
10
|
-
//#region ../../../3-targets/postgres/9-facade/dist/postgres-members-
|
|
11
|
+
//#region ../../../3-targets/postgres/9-facade/dist/postgres-members-F9CVSrrN.d.mts
|
|
11
12
|
//#region src/runtime/postgres-members.d.ts
|
|
12
13
|
type OrmClient<TContract extends Contract<SqlStorage>, TCollections extends CollectionClasses> = ReturnType<typeof orm<TContract, TCollections>>;
|
|
13
14
|
/** The query members of a Postgres client, which its transactions and Supabase's role-bound clients offer with the same types. */
|
|
@@ -38,7 +39,7 @@ interface PostgresStaticMembers<TContract extends Contract<SqlStorage>> extends
|
|
|
38
39
|
interface PostgresRuntimeBoundMembers<TContract extends Contract<SqlStorage>, TCollections extends CollectionClasses = NoCollectionClasses> extends PrepareMember<TContract> {
|
|
39
40
|
readonly orm: OrmClient<TContract, TCollections>;
|
|
40
41
|
runtime(): Runtime;
|
|
41
|
-
transaction<R>(fn: (tx: PostgresTransactionContext<TContract, TCollections>) => PromiseLike<R
|
|
42
|
+
transaction<R>(fn: (tx: PostgresTransactionContext<TContract, TCollections>) => PromiseLike<R>, options?: PostgresTransactionOptions): Promise<R>;
|
|
42
43
|
}
|
|
43
44
|
interface PostgresLifecycleMembers {
|
|
44
45
|
close(): Promise<void>;
|
|
@@ -46,4 +47,4 @@ interface PostgresLifecycleMembers {
|
|
|
46
47
|
}
|
|
47
48
|
//#endregion
|
|
48
49
|
export { PostgresTransactionContext as a, PostgresStaticMembers as i, PostgresQueryMembers as n, buildPostgresQueryMembers as o, PostgresRuntimeBoundMembers as r, PostgresLifecycleMembers as t };
|
|
49
|
-
//# sourceMappingURL=postgres-members-
|
|
50
|
+
//# sourceMappingURL=postgres-members-F9CVSrrN-BFAuNPbW.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postgres-members-F9CVSrrN-BFAuNPbW.d.mts","names":[],"sources":["../../../../3-targets/postgres/9-facade/dist/postgres-members-F9CVSrrN.d.mts"],"mappings":";;;;;;;;;;;;KAWK,UAAU,kBAAkB,SAAS,aAAa,qBAAqB,qBAAqB,kBAAkB,IAAI,WAAW;;UAExH,qBAAqB,kBAAkB,SAAS,aAAa,qBAAqB,oBAAoB,6BAA6B,cAAc,YAAY,cAAc;WAC1K,KAAK,GAAG;WACR,KAAK,UAAU,WAAW;WAC1B,KAAK,QAAQ;;UAEd,2BAA2B,kBAAkB,SAAS,aAAa,qBAAqB,oBAAoB,6BAA6B,oBAAoB,qBAAqB,WAAW;WAC5L,OAAO,gBAAgB;WACvB,aAAa,sBAAsB;;UAEpC,4BAA4B,kBAAkB,SAAS,aAAa,qBAAqB;WACxF,SAAS,iBAAiB;WAC1B,aAAa;WACb,KAAK,GAAG;WACR,KAAK,QAAQ;WACb,OAAO;WACP,gBAAgB,KAAK;;;;;iBAKf,0BAA0B,kBAAkB,SAAS,aAAa,qBAAqB,mBAAmB,SAAS,4BAA4B,WAAW,eAAe,OAAO,qBAAqB,KAAK,qBAAqB,WAAW,qBAAqB;UACtQ,sBAAsB,kBAAkB,SAAS,qBAAqB,sBAAsB;WAC3F,OAAO,4BAA4B;;UAEpC,4BAA4B,kBAAkB,SAAS,aAAa,qBAAqB,oBAAoB,6BAA6B,cAAc;WACvJ,KAAK,UAAU,WAAW;EACnC,WAAW;EACX,YAAY,GAAG,KAAK,IAAI,2BAA2B,WAAW,kBAAkB,YAAY,IAAI,UAAU,6BAA6B,QAAQ;;UAEvI;EACR,SAAS;GACR,OAAO,iBAAiB"}
|
package/dist/{postgres-options-BmYdDr4L-Dir2eRdu.d.mts → postgres-options-B0YrJID9-YkuL0Mao.d.mts}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { t as PostgresTargetId } from "./postgres-target-id-C9d1Qq7Q-70StSvqm.mjs";
|
|
2
|
+
import { PostgresIsolationLevel } from "@prisma/orm-target-postgres/target/runtime";
|
|
2
3
|
import { PostgresDriverCreateOptions } from "@prisma/orm-target-postgres/driver/runtime";
|
|
3
4
|
import { SqlExecutionOptions } from "@prisma/orm-family-sql/runtime";
|
|
4
|
-
//#region ../../../3-targets/postgres/9-facade/dist/postgres-options-
|
|
5
|
+
//#region ../../../3-targets/postgres/9-facade/dist/postgres-options-B0YrJID9.d.mts
|
|
5
6
|
//#region src/runtime/postgres-options.d.ts
|
|
6
7
|
type PostgresDriverCursorOptions = NonNullable<PostgresDriverCreateOptions['cursor']>;
|
|
7
8
|
/** Timeouts for the pool a client creates from a url. */
|
|
@@ -23,9 +24,15 @@ interface PostgresCursorOptions {
|
|
|
23
24
|
*/
|
|
24
25
|
interface PostgresExecutionOptions extends SqlExecutionOptions<PostgresTargetId> {
|
|
25
26
|
readonly cursor?: PostgresCursorOptions;
|
|
27
|
+
readonly transactionOptions?: PostgresTransactionOptions | undefined;
|
|
26
28
|
}
|
|
29
|
+
interface PostgresTransactionOptions {
|
|
30
|
+
readonly isolationLevel?: PostgresIsolationLevel | undefined;
|
|
31
|
+
readonly timeout?: number | null | undefined;
|
|
32
|
+
}
|
|
33
|
+
declare function validateTransactionOptions(options: PostgresTransactionOptions | undefined): PostgresTransactionOptions | undefined;
|
|
27
34
|
declare function validateCursorOptions(cursor: PostgresCursorOptions | undefined, helper: string): PostgresCursorOptions | undefined;
|
|
28
35
|
declare function toDriverCursorOptions(cursor: PostgresCursorOptions | undefined): PostgresDriverCursorOptions;
|
|
29
36
|
//#endregion
|
|
30
|
-
export {
|
|
31
|
-
//# sourceMappingURL=postgres-options-
|
|
37
|
+
export { toDriverCursorOptions as a, PostgresTransactionOptions as i, PostgresExecutionOptions as n, validateCursorOptions as o, PostgresPoolOptions as r, validateTransactionOptions as s, PostgresCursorOptions as t };
|
|
38
|
+
//# sourceMappingURL=postgres-options-B0YrJID9-YkuL0Mao.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postgres-options-B0YrJID9-YkuL0Mao.d.mts","names":[],"sources":["../../../../3-targets/postgres/9-facade/dist/postgres-options-B0YrJID9.d.mts"],"mappings":";;;;;;KAKK,8BAA8B,YAAY;;UAErC;WACC;WACA;;;;;;;UAOD;WACC;;;;;;UAMD,iCAAiC,oBAAoB;WACpD,SAAS;WACT,qBAAqB;;UAEtB;WACC,iBAAiB;WACjB;;iBAEM,2BAA2B,SAAS,yCAAyC;iBAC7E,sBAAsB,QAAQ,mCAAmC,iBAAiB;iBAClF,sBAAsB,QAAQ,oCAAoC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { t as postgresError } from "./errors-DfWK9xep-CB07krZF.mjs";
|
|
2
|
+
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
3
|
+
import { postgresIsolationLevelSchema } from "@prisma/orm-target-postgres/target/runtime";
|
|
4
|
+
import { type } from "arktype";
|
|
5
|
+
//#region ../../../3-targets/postgres/9-facade/dist/postgres-options-CZyV9Him.mjs
|
|
6
|
+
/**
|
|
7
|
+
* Default time to wait for the database to accept a connection, for a client's pool and for a
|
|
8
|
+
* connection's `pg.Client`.
|
|
9
|
+
*/
|
|
10
|
+
const DEFAULT_CONNECT_TIMEOUT_MILLIS = 2e4;
|
|
11
|
+
const transactionOptionsSchema = type({
|
|
12
|
+
"isolationLevel?": postgresIsolationLevelSchema.or("undefined"),
|
|
13
|
+
"timeout?": "1 <= number.integer <= 2147483647 | null | undefined"
|
|
14
|
+
}).onUndeclaredKey("reject");
|
|
15
|
+
function validateTransactionOptions(options) {
|
|
16
|
+
if (options === void 0) return void 0;
|
|
17
|
+
const result = transactionOptionsSchema(options);
|
|
18
|
+
if (result instanceof type.errors) throw postgresError("RUNTIME.ARGUMENT_INVALID", "Invalid transaction options", {
|
|
19
|
+
why: result.summary,
|
|
20
|
+
fix: "Pass an isolationLevel of ReadUncommitted, ReadCommitted, RepeatableRead, or Serializable, or leave it unset. Timeout must be an integer from 1 to 2147483647 milliseconds; null disables it.",
|
|
21
|
+
meta: {
|
|
22
|
+
extension: "postgres",
|
|
23
|
+
argument: "transactionOptions",
|
|
24
|
+
received: options
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
const cursorOptionsSchema = type({ "batchSize?": "number.integer > 0 | undefined" }).onUndeclaredKey("reject");
|
|
30
|
+
function validateCursorOptions(cursor, helper) {
|
|
31
|
+
if (cursor === void 0) return;
|
|
32
|
+
const result = cursorOptionsSchema(cursor);
|
|
33
|
+
if (result instanceof type.errors) throw postgresError("RUNTIME.ARGUMENT_INVALID", "Invalid cursor option", {
|
|
34
|
+
why: result.summary,
|
|
35
|
+
fix: "Pass cursor: {} or cursor: { batchSize: <positive integer> } to read through a server-side cursor, or leave cursor unset to read without one.",
|
|
36
|
+
meta: {
|
|
37
|
+
extension: "postgres",
|
|
38
|
+
helper,
|
|
39
|
+
argument: "cursor",
|
|
40
|
+
received: cursor
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
function toDriverCursorOptions(cursor) {
|
|
46
|
+
return cursor === void 0 ? { disabled: true } : ifDefined("batchSize", cursor.batchSize);
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { validateTransactionOptions as i, toDriverCursorOptions as n, validateCursorOptions as r, DEFAULT_CONNECT_TIMEOUT_MILLIS as t };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=postgres-options-CZyV9Him-2OSYJKqo.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postgres-options-CZyV9Him-2OSYJKqo.mjs","names":[],"sources":["../../../../3-targets/postgres/9-facade/dist/postgres-options-CZyV9Him.mjs"],"sourcesContent":["import { t as postgresError } from \"./errors-DfWK9xep.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { postgresIsolationLevelSchema } from \"@internal/target-postgres/runtime\";\nimport { type } from \"arktype\";\n//#region src/runtime/postgres-options.ts\n/**\n* Default time to wait for the database to accept a connection, for a client's pool and for a\n* connection's `pg.Client`.\n*/\nconst DEFAULT_CONNECT_TIMEOUT_MILLIS = 2e4;\nconst transactionOptionsSchema = type({\n\t\"isolationLevel?\": postgresIsolationLevelSchema.or(\"undefined\"),\n\t\"timeout?\": \"1 <= number.integer <= 2147483647 | null | undefined\"\n}).onUndeclaredKey(\"reject\");\nfunction validateTransactionOptions(options) {\n\tif (options === void 0) return void 0;\n\tconst result = transactionOptionsSchema(options);\n\tif (result instanceof type.errors) throw postgresError(\"RUNTIME.ARGUMENT_INVALID\", \"Invalid transaction options\", {\n\t\twhy: result.summary,\n\t\tfix: \"Pass an isolationLevel of ReadUncommitted, ReadCommitted, RepeatableRead, or Serializable, or leave it unset. Timeout must be an integer from 1 to 2147483647 milliseconds; null disables it.\",\n\t\tmeta: {\n\t\t\textension: \"postgres\",\n\t\t\targument: \"transactionOptions\",\n\t\t\treceived: options\n\t\t}\n\t});\n\treturn result;\n}\nconst cursorOptionsSchema = type({ \"batchSize?\": \"number.integer > 0 | undefined\" }).onUndeclaredKey(\"reject\");\nfunction validateCursorOptions(cursor, helper) {\n\tif (cursor === void 0) return;\n\tconst result = cursorOptionsSchema(cursor);\n\tif (result instanceof type.errors) throw postgresError(\"RUNTIME.ARGUMENT_INVALID\", \"Invalid cursor option\", {\n\t\twhy: result.summary,\n\t\tfix: \"Pass cursor: {} or cursor: { batchSize: <positive integer> } to read through a server-side cursor, or leave cursor unset to read without one.\",\n\t\tmeta: {\n\t\t\textension: \"postgres\",\n\t\t\thelper,\n\t\t\targument: \"cursor\",\n\t\t\treceived: cursor\n\t\t}\n\t});\n\treturn result;\n}\nfunction toDriverCursorOptions(cursor) {\n\treturn cursor === void 0 ? { disabled: true } : ifDefined(\"batchSize\", cursor.batchSize);\n}\n//#endregion\nexport { validateTransactionOptions as i, toDriverCursorOptions as n, validateCursorOptions as r, DEFAULT_CONNECT_TIMEOUT_MILLIS as t };\n\n//# sourceMappingURL=postgres-options-CZyV9Him.mjs.map"],"mappings":";;;;;;;;;AASA,MAAM,iCAAiC;AACvC,MAAM,2BAA2B,KAAK;CACrC,mBAAmB,6BAA6B,GAAG,WAAW;CAC9D,YAAY;AACb,CAAC,CAAC,CAAC,gBAAgB,QAAQ;AAC3B,SAAS,2BAA2B,SAAS;CAC5C,IAAI,YAAY,KAAK,GAAG,OAAO,KAAK;CACpC,MAAM,SAAS,yBAAyB,OAAO;CAC/C,IAAI,kBAAkB,KAAK,QAAQ,MAAM,cAAc,4BAA4B,+BAA+B;EACjH,KAAK,OAAO;EACZ,KAAK;EACL,MAAM;GACL,WAAW;GACX,UAAU;GACV,UAAU;EACX;CACD,CAAC;CACD,OAAO;AACR;AACA,MAAM,sBAAsB,KAAK,EAAE,cAAc,iCAAiC,CAAC,CAAC,CAAC,gBAAgB,QAAQ;AAC7G,SAAS,sBAAsB,QAAQ,QAAQ;CAC9C,IAAI,WAAW,KAAK,GAAG;CACvB,MAAM,SAAS,oBAAoB,MAAM;CACzC,IAAI,kBAAkB,KAAK,QAAQ,MAAM,cAAc,4BAA4B,yBAAyB;EAC3G,KAAK,OAAO;EACZ,KAAK;EACL,MAAM;GACL,WAAW;GACX;GACA,UAAU;GACV,UAAU;EACX;CACD,CAAC;CACD,OAAO;AACR;AACA,SAAS,sBAAsB,QAAQ;CACtC,OAAO,WAAW,KAAK,IAAI,EAAE,UAAU,KAAK,IAAI,UAAU,aAAa,OAAO,SAAS;AACxF"}
|
package/dist/{postgres-static-CI-UYXCi-DBAI4T10.mjs → postgres-static-D6D18p5D-Bwj0XxHU.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as validatePostgresContract } from "./contract-from-json-
|
|
1
|
+
import { n as validatePostgresContract } from "./contract-from-json-B5HzTVcl-ndoIqEHE.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-D6D18p5D.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-D6D18p5D-Bwj0XxHU.mjs.map
|
package/dist/{postgres-static-CI-UYXCi-DBAI4T10.mjs.map → postgres-static-D6D18p5D-Bwj0XxHU.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres-static-
|
|
1
|
+
{"version":3,"file":"postgres-static-D6D18p5D-Bwj0XxHU.mjs","names":[],"sources":["../../../../3-targets/postgres/9-facade/dist/postgres-static-D6D18p5D.mjs"],"sourcesContent":["import { n as validatePostgresContract } from \"./contract-from-json-B5HzTVcl.mjs\";\nimport { PG_ENUM_CODEC_ID } from \"@internal/target-postgres/codec-ids\";\nimport postgresTarget from \"@internal/target-postgres/runtime\";\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 { 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-D6D18p5D.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
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { n as PostgresExecutionOptions, r as PostgresPoolOptions, t as PostgresCursorOptions } from "./postgres-options-
|
|
2
|
-
import { a as isPgClient, n as PostgresBindingInput, o as isPgPool, t as PostgresBinding$1 } from "./binding-
|
|
1
|
+
import { i as PostgresTransactionOptions, n as PostgresExecutionOptions, r as PostgresPoolOptions, t as PostgresCursorOptions } from "./postgres-options-B0YrJID9-YkuL0Mao.mjs";
|
|
2
|
+
import { a as isPgClient, n as PostgresBindingInput, o as isPgPool, t as PostgresBinding$1 } from "./binding-BN5X69gf-CIDnIWcw.mjs";
|
|
3
3
|
import { r as buildNamespacedNativeEnums, t as NamespacedNativeEnums } from "./postgres-static-S38TCEK6-Dswb17fx.mjs";
|
|
4
|
-
import { a as PostgresTransactionContext, i as PostgresStaticMembers, n as PostgresQueryMembers, r as PostgresRuntimeBoundMembers, t as PostgresLifecycleMembers } from "./postgres-members-
|
|
4
|
+
import { a as PostgresTransactionContext, i as PostgresStaticMembers, n as PostgresQueryMembers, r as PostgresRuntimeBoundMembers, t as PostgresLifecycleMembers } from "./postgres-members-F9CVSrrN-BFAuNPbW.mjs";
|
|
5
|
+
import { postgresIsolationLevels as IsolationLevel } from "@prisma/orm-target-postgres/target/runtime";
|
|
5
6
|
import { Runtime, SqlRuntimeBase } from "@prisma/orm-family-sql/runtime";
|
|
6
7
|
import { CollectionClasses, NoCollectionClasses } from "@prisma/orm-family-sql/orm-client";
|
|
7
8
|
import { Contract } from "@prisma/orm-framework/contract/types";
|
|
@@ -58,5 +59,5 @@ declare class PostgresRuntimeImpl<TContract extends Contract<SqlStorage> = Contr
|
|
|
58
59
|
protected getListDecoder(): PostgresListDecoder;
|
|
59
60
|
}
|
|
60
61
|
//#endregion
|
|
61
|
-
export { type NamespacedNativeEnums, type PostgresBinding$1 as PostgresBinding, type PostgresBindingOptions, type PostgresClient, type PostgresCursorOptions, type PostgresFullTextMethods, type PostgresOptions, type PostgresOptionsBase, type PostgresPoolOptions, type PostgresQueryMembers, type PostgresRuntime, PostgresRuntimeImpl, type PostgresTransactionContext, buildNamespacedNativeEnums, postgres as default, isPgClient, isPgPool };
|
|
62
|
+
export { IsolationLevel, type NamespacedNativeEnums, type PostgresBinding$1 as PostgresBinding, type PostgresBindingOptions, type PostgresClient, type PostgresCursorOptions, type PostgresFullTextMethods, type PostgresOptions, type PostgresOptionsBase, type PostgresPoolOptions, type PostgresQueryMembers, type PostgresRuntime, PostgresRuntimeImpl, type PostgresTransactionContext, type PostgresTransactionOptions, buildNamespacedNativeEnums, postgres as default, isPgClient, isPgPool };
|
|
62
63
|
//# sourceMappingURL=runtime.d.mts.map
|
package/dist/runtime.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.mts","names":[],"sources":["../../../../3-targets/postgres/9-facade/dist/runtime.d.mts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"runtime.d.mts","names":[],"sources":["../../../../3-targets/postgres/9-facade/dist/runtime.d.mts"],"mappings":";;;;;;;;;;;;;UAYU,eAAe,kBAAkB,SAAS,aAAa,qBAAqB,oBAAoB,6BAA6B,qBAAqB,WAAW,eAAe,sBAAsB,YAAY,4BAA4B,WAAW,eAAe;EAC5Q,QAAQ,eAAe,uBAAuB,QAAQ;;UAE9C,4BAA4B;WAC3B,cAAc;;UAEf;WACC,UAAU;WACV;WACA,KAAK,OAAO;;KAElB,gBAAgB,kBAAkB,SAAS,aAAa,qBAAqB,oBAAoB,uBAAuB,yBAAyB;WAC3I,UAAU;WACV,cAAc;;;;;;;;;;;;;;;;;;;iBAmBR,SAAS,kBAAkB,SAAS,aAAa,qBAAqB,oBAAoB,qBAAqB,SAAS,gBAAgB,WAAW,gBAAgB,eAAe,WAAW;;;;;;;;;;UAUpM,wBAAwB;KAC7B,uBAAuB,oBAAoB,gBAAgB,mBAAmB,qBAAqB;cAC1F,oBAAoB,kBAAkB,SAAS,cAAc,SAAS,qBAAqB,eAAe;YAC5G,kBAAkB"}
|
package/dist/runtime.mjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { t as postgresError } from "./errors-DfWK9xep-CB07krZF.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
4
|
-
import { n as
|
|
5
|
-
import { n as
|
|
2
|
+
import { i as validateTransactionOptions, n as toDriverCursorOptions, r as validateCursorOptions } from "./postgres-options-CZyV9Him-2OSYJKqo.mjs";
|
|
3
|
+
import { a as resolveOptionalPostgresBinding, i as postgresBindingRules, n as isPgClient, o as resolvePostgresBinding, r as isPgPool, t as connectWithBinding } from "./binding-DkfRsUZE-Co5ssUZw.mjs";
|
|
4
|
+
import { n as validatePostgresContract } from "./contract-from-json-B5HzTVcl-ndoIqEHE.mjs";
|
|
5
|
+
import { n as buildPostgresStaticContext, t as buildNamespacedNativeEnums } from "./postgres-static-D6D18p5D-Bwj0XxHU.mjs";
|
|
6
|
+
import { n as buildPostgresRuntimeBoundMembers } from "./postgres-members-B7ZvxGYc-D_L3NVGm.mjs";
|
|
6
7
|
import { t as PostgresRuntimeImpl } from "./postgres-runtime-BKdag6p9-gHVB2jfC.mjs";
|
|
7
8
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
9
|
+
import postgresTarget, { postgresIsolationLevels as IsolationLevel } from "@prisma/orm-target-postgres/target/runtime";
|
|
8
10
|
import postgresDriver from "@prisma/orm-target-postgres/driver/runtime";
|
|
9
|
-
import postgresTarget from "@prisma/orm-target-postgres/target/runtime";
|
|
10
11
|
import postgresAdapter from "@prisma/orm-target-postgres/adapter/runtime";
|
|
11
12
|
import { createExecutionContext, createSqlExecutionStack, toRuntimeOptions } from "@prisma/orm-family-sql/runtime";
|
|
12
13
|
//#region ../../../3-targets/postgres/9-facade/dist/runtime.mjs
|
|
@@ -29,6 +30,7 @@ import { createExecutionContext, createSqlExecutionStack, toRuntimeOptions } fro
|
|
|
29
30
|
*/
|
|
30
31
|
function postgres(options) {
|
|
31
32
|
const cursor = validateCursorOptions(options.cursor, "postgres");
|
|
33
|
+
const transactionOptions = validateTransactionOptions(options.transactionOptions);
|
|
32
34
|
const contract = validatePostgresContract(options.contract);
|
|
33
35
|
let binding = resolveOptionalPostgresBinding(options, postgresBindingRules);
|
|
34
36
|
const stack = createSqlExecutionStack({
|
|
@@ -100,7 +102,8 @@ function postgres(options) {
|
|
|
100
102
|
nativeEnums,
|
|
101
103
|
toSql,
|
|
102
104
|
getRuntime,
|
|
103
|
-
getRuntimeForWork: getRuntime
|
|
105
|
+
getRuntimeForWork: getRuntime,
|
|
106
|
+
transactionOptions
|
|
104
107
|
}),
|
|
105
108
|
enums,
|
|
106
109
|
nativeEnums,
|
|
@@ -140,6 +143,6 @@ function postgres(options) {
|
|
|
140
143
|
};
|
|
141
144
|
}
|
|
142
145
|
//#endregion
|
|
143
|
-
export { PostgresRuntimeImpl, buildNamespacedNativeEnums, postgres as default, isPgClient, isPgPool };
|
|
146
|
+
export { IsolationLevel, PostgresRuntimeImpl, buildNamespacedNativeEnums, postgres as default, isPgClient, isPgPool };
|
|
144
147
|
|
|
145
148
|
//# sourceMappingURL=runtime.mjs.map
|
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 {
|
|
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 { i as validateTransactionOptions, n as toDriverCursorOptions, r as validateCursorOptions } from \"./postgres-options-CZyV9Him.mjs\";\nimport { a as resolveOptionalPostgresBinding, i as postgresBindingRules, n as isPgClient, o as resolvePostgresBinding, r as isPgPool, t as connectWithBinding } from \"./binding-DkfRsUZE.mjs\";\nimport { r as buildNamespacedNativeEnums, t as buildPostgresStaticContext } from \"./postgres-static-D6D18p5D.mjs\";\nimport { n as validatePostgresContract } from \"./contract-from-json-B5HzTVcl.mjs\";\nimport { n as buildPostgresRuntimeBoundMembers } from \"./postgres-members-B7ZvxGYc.mjs\";\nimport { t as PostgresRuntimeImpl } from \"./postgres-runtime-BKdag6p9.mjs\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport postgresTarget, { postgresIsolationLevels as IsolationLevel } from \"@internal/target-postgres/runtime\";\nimport postgresDriver from \"@internal/driver-postgres/runtime\";\nimport postgresAdapter from \"@internal/adapter-postgres/runtime\";\nimport { createExecutionContext, createSqlExecutionStack, toRuntimeOptions } from \"@internal/sql-runtime\";\n//#region src/runtime/postgres.ts\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 transactionOptions = validateTransactionOptions(options.transactionOptions);\n\tconst contract = validatePostgresContract(options.contract);\n\tlet binding = resolveOptionalPostgresBinding(options, postgresBindingRules);\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 closedError = () => postgresError(\"DRIVER.NOT_CONNECTED\", \"Postgres client is closed\", {\n\t\twhy: \"close() was called on this client.\",\n\t\tfix: \"Create a new postgres(...) client.\",\n\t\tmeta: { extension: \"postgres\" }\n\t});\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\tconnectPromise = connectWithBinding(runtimeDriver, resolvedBinding, options).then(() => {\n\t\t\tdriverConnected = true;\n\t\t}).catch((err) => {\n\t\t\tbackgroundConnectError = err;\n\t\t\tconnectPromise = 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 closedError();\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 driver = stack.driver.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\ttransactionOptions\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 closedError();\n\t\t\tif (driverConnected || connectPromise) {\n\t\t\t\tif (bindingInput !== void 0) throw postgresError(\"DRIVER.ALREADY_CONNECTED\", \"Postgres client is already bound\", {\n\t\t\t\t\twhy: \"connect() was given options after the client was bound to a database.\",\n\t\t\t\t\tfix: \"Call connect() without options, or create a new client for another database.\",\n\t\t\t\t\tmeta: { extension: \"postgres\" }\n\t\t\t\t});\n\t\t\t\tconst runtime = getRuntime();\n\t\t\t\tawait connectPromise;\n\t\t\t\tif (closePromise !== void 0) throw closedError();\n\t\t\t\treturn runtime;\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\tif (closePromise !== void 0) throw closedError();\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 { IsolationLevel, PostgresRuntimeImpl, buildNamespacedNativeEnums, postgres as default, isPgClient, isPgPool };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,SAAS,SAAS,SAAS;CAC1B,MAAM,SAAS,sBAAsB,QAAQ,QAAQ,UAAU;CAC/D,MAAM,qBAAqB,2BAA2B,QAAQ,kBAAkB;CAChF,MAAM,WAAW,yBAAyB,QAAQ,QAAQ;CAC1D,IAAI,UAAU,+BAA+B,SAAS,oBAAoB;CAC1E,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,oBAAoB,cAAc,wBAAwB,6BAA6B;EAC5F,KAAK;EACL,KAAK;EACL,MAAM,EAAE,WAAW,WAAW;CAC/B,CAAC;CACD,MAAM,gBAAgB,OAAO,oBAAoB;E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AE,WAAW,WAAW;IAC/B,CAAC;IACD,MAAM,UAAU,WAAW;IAC3B,MAAM;IACN,IAAI,iBAAiB,KAAK,GAAG,MAAM,YAAY;IAC/C,OAAO;GACR;GACA,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,IAAI,iBAAiB,KAAK,GAAG,MAAM,YAAY;GAC/C,OAAO;EACR;EACA,QAAQ;GACP,iBAAiB,aAAa;GAC9B,OAAO;EACR;EACA,CAAC,OAAO,gBAAgB;GACvB,OAAO,KAAK,MAAM;EACnB;CACD;AACD"}
|
package/dist/serverless.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { n as PostgresExecutionOptions, t as PostgresCursorOptions } from "./postgres-options-
|
|
2
|
-
import { i as PostgresStaticMembers, n as PostgresQueryMembers, r as PostgresRuntimeBoundMembers, t as PostgresLifecycleMembers } from "./postgres-members-
|
|
1
|
+
import { i as PostgresTransactionOptions, n as PostgresExecutionOptions, t as PostgresCursorOptions } from "./postgres-options-B0YrJID9-YkuL0Mao.mjs";
|
|
2
|
+
import { i as PostgresStaticMembers, n as PostgresQueryMembers, r as PostgresRuntimeBoundMembers, t as PostgresLifecycleMembers } from "./postgres-members-F9CVSrrN-BFAuNPbW.mjs";
|
|
3
|
+
import { postgresIsolationLevels as IsolationLevel } from "@prisma/orm-target-postgres/target/runtime";
|
|
3
4
|
import { CollectionClasses, NoCollectionClasses } from "@prisma/orm-family-sql/orm-client";
|
|
4
5
|
import { Contract } from "@prisma/orm-framework/contract/types";
|
|
5
6
|
import { SqlStorage } from "@prisma/orm-family-sql/contract/types";
|
|
@@ -45,5 +46,5 @@ type PostgresServerlessOptions<TContract extends Contract<SqlStorage>, TCollecti
|
|
|
45
46
|
*/
|
|
46
47
|
declare function postgresServerless<TContract extends Contract<SqlStorage>, TCollections extends CollectionClasses = NoCollectionClasses>(options: PostgresServerlessOptions<TContract, TCollections>): PostgresServerlessClient<TContract, TCollections>;
|
|
47
48
|
//#endregion
|
|
48
|
-
export { type PostgresCursorOptions, type PostgresFullTextMethods, type PostgresServerlessClient, type PostgresServerlessConnection, type PostgresServerlessOptions, type PostgresServerlessOptionsBase, postgresServerless as default };
|
|
49
|
+
export { IsolationLevel, type PostgresCursorOptions, type PostgresFullTextMethods, type PostgresServerlessClient, type PostgresServerlessConnection, type PostgresServerlessOptions, type PostgresServerlessOptionsBase, type PostgresTransactionOptions, postgresServerless as default };
|
|
49
50
|
//# sourceMappingURL=serverless.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverless.d.mts","names":[],"sources":["../../../../3-targets/postgres/9-facade/dist/serverless.d.mts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"serverless.d.mts","names":[],"sources":["../../../../3-targets/postgres/9-facade/dist/serverless.d.mts"],"mappings":";;;;;;;;;UAQU,6BAA6B,kBAAkB,SAAS,aAAa,qBAAqB,oBAAoB,6BAA6B,qBAAqB,WAAW,eAAe,sBAAsB,YAAY,4BAA4B,WAAW,eAAe;UAClR,yBAAyB,kBAAkB,SAAS,aAAa,qBAAqB,oBAAoB,6BAA6B,sBAAsB;EACrK,QAAQ;aACG;MACP,QAAQ,6BAA6B,WAAW;;UAE5C,sCAAsC;KAC3C,0BAA0B,kBAAkB,SAAS,aAAa,qBAAqB,oBAAoB,uBAAuB;WAC5H,UAAU;WACV,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4BR,mBAAmB,kBAAkB,SAAS,aAAa,qBAAqB,oBAAoB,qBAAqB,SAAS,0BAA0B,WAAW,gBAAgB,yBAAyB,WAAW"}
|