@prisma/orm-postgres 8.0.0-rc.13-dev.4 → 8.0.0-rc.13-dev.6

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.
@@ -1,133 +0,0 @@
1
- import { EnumAccessor, EnumEntriesToAccessors, NamespacedEnums } from "@prisma/orm-framework/contract/enum-accessor";
2
- import { BindSiteParams, Declaration, ExecutionContext, ParamsFromDeclaration, Runtime, SqlExecutionStackWithDriver, SqlMiddleware, SqlRuntimeExtensionDescriptor, TransactionContext, VerifyMarkerOption } from "@prisma/orm-family-sql/runtime";
3
- import { PreparedFrom, orm } from "@prisma/orm-family-sql/orm-client";
4
- import { Client, Pool } from "pg";
5
- import { Contract } from "@prisma/orm-framework/contract/types";
6
- import { ExtractCodecTypes, SqlStorage } from "@prisma/orm-family-sql/contract/types";
7
- import { Db, RawLane } from "@prisma/orm-family-sql/builder/types";
8
- import { CodecTypesBase } from "@prisma/orm-family-sql/relational-core/expression";
9
- import { Preparable, SqlQueryPlan } from "@prisma/orm-family-sql/relational-core/plan";
10
- //#region ../../../3-extensions/postgres/dist/postgres-B-ZPMR9y.d.mts
11
- //#region src/runtime/binding.d.ts
12
- declare const isPgPool: (pg: Pool | Client) => pg is Pool;
13
- declare const isPgClient: (pg: Pool | Client) => pg is Client;
14
- type PostgresBinding = {
15
- readonly kind: 'url';
16
- readonly url: string;
17
- } | {
18
- readonly kind: 'pgPool';
19
- readonly pool: Pool;
20
- } | {
21
- readonly kind: 'pgClient';
22
- readonly client: Client;
23
- };
24
- type PostgresBindingInput = {
25
- readonly binding: PostgresBinding;
26
- readonly url?: never;
27
- readonly pg?: never;
28
- } | {
29
- readonly url: string;
30
- readonly binding?: never;
31
- readonly pg?: never;
32
- } | {
33
- readonly pg: Pool | Client;
34
- readonly binding?: never;
35
- readonly url?: never;
36
- };
37
- //#endregion
38
- //#region src/runtime/native-enums.d.ts
39
- declare function buildNamespacedNativeEnums(storage: SqlStorage): Record<string, Record<string, EnumAccessor>>;
40
- type Present<T> = Exclude<T, undefined>;
41
- type NamespaceValueSetEntries<TNs> = TNs extends {
42
- readonly entries: {
43
- readonly valueSet?: infer E;
44
- };
45
- } ? unknown extends E ? Record<never, never> : Present<E> : Record<never, never>;
46
- type ValueSetEntry = {
47
- readonly values: readonly unknown[];
48
- };
49
- type ValueSetMembers<Values extends readonly unknown[]> = { readonly [I in keyof Values]: {
50
- readonly name: Extract<Values[I], string>;
51
- readonly value: Values[I];
52
- }; };
53
- /**
54
- * Projects a value-only `StorageValueSet`-shaped literal type onto the
55
- * `{name, value}[]`-member shape `ContractEnumAccessor` expects, treating
56
- * each value as its own name (Option B: a native-enum member is a value, not
57
- * a name→value pair).
58
- */
59
- type ValueSetToEnumEntry<Entry extends ValueSetEntry> = {
60
- readonly members: ValueSetMembers<Entry['values']>;
61
- };
62
- type ValueSetEntriesToEnumEntries<Entries> = { readonly [K in keyof Entries]: Entries[K] extends ValueSetEntry ? ValueSetToEnumEntry<Entries[K]> : never; };
63
- /**
64
- * Accessor type for `db.nativeEnums`. Types off the namespace's `valueSet`
65
- * entries — the same generic surface that types `db.enums` and column value
66
- * unions — not a raw `native_enum` entity slot; `contract.d.ts` no longer
67
- * emits one. For a no-emit (`typeof contract`) contract the storage type is
68
- * non-literal and this degrades to the structural shape — the same
69
- * emit/no-emit boundary column typing has (TML-2960).
70
- */
71
- type NamespacedNativeEnums<TContract extends Contract> = { readonly [Ns in keyof TContract['storage']['namespaces']]: EnumEntriesToAccessors<ValueSetEntriesToEnumEntries<NamespaceValueSetEntries<TContract['storage']['namespaces'][Ns]>>>; };
72
- //#endregion
73
- //#region src/runtime/postgres.d.ts
74
- type PostgresTargetId = 'postgres';
75
- type OrmClient<TContract extends Contract<SqlStorage>> = ReturnType<typeof orm<TContract>>;
76
- interface PostgresTransactionContext<TContract extends Contract<SqlStorage>> extends TransactionContext {
77
- readonly sql: Db<TContract>;
78
- readonly orm: OrmClient<TContract>;
79
- readonly enums: NamespacedEnums<TContract>;
80
- readonly nativeEnums: NamespacedNativeEnums<TContract>;
81
- }
82
- interface PostgresClient<TContract extends Contract<SqlStorage>> {
83
- readonly sql: Db<TContract>;
84
- readonly orm: OrmClient<TContract>;
85
- readonly enums: NamespacedEnums<TContract>;
86
- readonly nativeEnums: NamespacedNativeEnums<TContract>;
87
- readonly raw: RawLane<TContract>;
88
- readonly context: ExecutionContext<TContract>;
89
- readonly contract: TContract;
90
- readonly stack: SqlExecutionStackWithDriver<PostgresTargetId>;
91
- connect(bindingInput?: PostgresBindingInput): Promise<Runtime>;
92
- runtime(): Runtime;
93
- transaction<R>(fn: (tx: PostgresTransactionContext<TContract>) => PromiseLike<R>): Promise<R>;
94
- prepare<D extends Declaration<CT>, Q extends SqlQueryPlan | Preparable<unknown, unknown>, CT extends CodecTypesBase = ExtractCodecTypes<TContract>>(declaration: D, callback: (params: BindSiteParams<D>) => Q): Promise<PreparedFrom<ParamsFromDeclaration<D, CT>, Q>>;
95
- close(): Promise<void>;
96
- [Symbol.asyncDispose](): Promise<void>;
97
- }
98
- interface PostgresOptionsBase {
99
- readonly extensions?: readonly SqlRuntimeExtensionDescriptor<PostgresTargetId>[];
100
- readonly middleware?: readonly SqlMiddleware[];
101
- readonly verifyMarker?: VerifyMarkerOption;
102
- readonly poolOptions?: {
103
- readonly connectionTimeoutMillis?: number;
104
- readonly idleTimeoutMillis?: number;
105
- };
106
- }
107
- interface PostgresBindingOptions {
108
- readonly binding?: PostgresBinding;
109
- readonly url?: string;
110
- readonly pg?: Pool | Client;
111
- }
112
- type PostgresOptionsWithContract<TContract extends Contract<SqlStorage>> = PostgresBindingOptions & PostgresOptionsBase & {
113
- readonly contract: TContract;
114
- readonly contractJson?: never;
115
- };
116
- type PostgresOptionsWithContractJson<TContract extends Contract<SqlStorage>> = PostgresBindingOptions & PostgresOptionsBase & {
117
- readonly contractJson: unknown;
118
- readonly contract?: never;
119
- readonly _contract?: TContract;
120
- };
121
- type PostgresOptions<TContract extends Contract<SqlStorage>> = PostgresOptionsWithContract<TContract> | PostgresOptionsWithContractJson<TContract>;
122
- /**
123
- * Creates a lazy Postgres client from either `contractJson` or a TypeScript-authored `contract`.
124
- * Static query surfaces are available immediately, while `runtime()` instantiates the driver/pool on first call.
125
- *
126
- * - No-emit: pass a TypeScript-authored contract. Example: postgres({ contract })
127
- * - Emitted: pass Contract type explicitly. Example: postgres<Contract>({ contractJson, url })
128
- */
129
- declare function postgres<TContract extends Contract<SqlStorage>>(options: PostgresOptionsWithContract<TContract>): PostgresClient<TContract>;
130
- declare function postgres<TContract extends Contract<SqlStorage>>(options: PostgresOptionsWithContractJson<TContract>): PostgresClient<TContract>;
131
- //#endregion
132
- export { PostgresOptionsBase as a, PostgresTargetId as c, isPgPool as d, postgres as f, PostgresOptions as i, buildNamespacedNativeEnums as l, PostgresBinding as n, PostgresOptionsWithContract as o, PostgresClient as r, PostgresOptionsWithContractJson as s, NamespacedNativeEnums as t, isPgClient as u };
133
- //# sourceMappingURL=postgres-B-ZPMR9y-gRfTiPA0.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"postgres-B-ZPMR9y-gRfTiPA0.d.mts","names":[],"sources":["../../../../3-extensions/postgres/dist/postgres-B-ZPMR9y.d.mts"],"mappings":";;;;;;;;;;;cAUc,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;;;;iBAIM,2BAA2B,SAAS,aAAa,eAAe,eAAe;KAC3F,QAAQ,KAAK,QAAQ;KACrB,yBAAyB,OAAO;WAC1B;aACE,iBAAiB;;oBAEV,IAAI,uBAAuB,QAAQ,KAAK;KACvD;WACM;;KAEN,gBAAgB,iDAAiD,WAAW;WACtE,MAAM,QAAQ,OAAO;WACrB,OAAO,OAAO;;;;;;;;KAQp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AAkB,SAAS,aAAa,SAAS,gCAAgC,aAAa,eAAe"}
@@ -1,12 +0,0 @@
1
- import { SqlRuntimeBase } from "@prisma/orm-family-sql/runtime";
2
- import postgresTarget from "@prisma/orm-target-postgres/target/runtime";
3
- //#region ../../../3-extensions/postgres/dist/postgres-runtime-oM2EIAjm.mjs
4
- var PostgresRuntimeImpl = class extends SqlRuntimeBase {
5
- getListDecoder() {
6
- return postgresTarget.listDecoder();
7
- }
8
- };
9
- //#endregion
10
- export { PostgresRuntimeImpl as t };
11
-
12
- //# sourceMappingURL=postgres-runtime-oM2EIAjm-CZIDUstk.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"postgres-runtime-oM2EIAjm-CZIDUstk.mjs","names":[],"sources":["../../../../3-extensions/postgres/dist/postgres-runtime-oM2EIAjm.mjs"],"sourcesContent":["import { SqlRuntimeBase } from \"@internal/sql-runtime\";\nimport postgresTarget from \"@internal/target-postgres/runtime\";\n//#region src/runtime/postgres-runtime.ts\nvar PostgresRuntimeImpl = class extends SqlRuntimeBase {\n\tgetListDecoder() {\n\t\treturn postgresTarget.listDecoder();\n\t}\n};\n//#endregion\nexport { PostgresRuntimeImpl as t };\n\n//# sourceMappingURL=postgres-runtime-oM2EIAjm.mjs.map"],"mappings":";;;AAGA,IAAI,sBAAsB,cAAc,eAAe;CACtD,iBAAiB;EAChB,OAAO,eAAe,YAAY;CACnC;AACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"static.d.mts","names":[],"sources":["../../../../3-extensions/postgres/dist/static.d.mts"],"mappings":";;;;;;;;;UAQU,sBAAsB,kBAAkB,SAAS;WAChD,SAAS,iBAAiB;WAC1B,UAAU;WACV,OAAO,gBAAgB;WACvB,aAAa,sBAAsB;WACnC,KAAK,GAAG;WACR,KAAK,QAAQ;;iBAEP,eAAe,kBAAkB,SAAS,aAAa;WAC7D;WACA,sBAAsB,8BAA8B;IAC3D,sBAAsB"}