@prisma/driver-adapter-utils 6.6.0-dev.60 → 6.6.0-dev.61
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/index.d.mts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +15 -1
- package/dist/index.mjs +14 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -16,7 +16,9 @@ declare interface AdapterInfo {
|
|
|
16
16
|
*/
|
|
17
17
|
export declare type ArgType = 'Int32' | 'Int64' | 'Float' | 'Double' | 'Text' | 'Enum' | 'EnumArray' | 'Bytes' | 'Boolean' | 'Char' | 'Array' | 'Numeric' | 'Json' | 'Xml' | 'Uuid' | 'DateTime' | 'Date' | 'Time';
|
|
18
18
|
|
|
19
|
-
export declare const bindAdapter: (adapter: SqlDriverAdapter) => ErrorCapturingSqlDriverAdapter;
|
|
19
|
+
export declare const bindAdapter: (adapter: SqlDriverAdapter, errorRegistry?: ErrorRegistryInternal) => ErrorCapturingSqlDriverAdapter;
|
|
20
|
+
|
|
21
|
+
export declare const bindSqlAdapterFactory: (adapterFactory: SqlDriverAdapterFactory) => ErrorCapturingSqlDriverAdapterFactory;
|
|
20
22
|
|
|
21
23
|
export declare type ColumnType = (typeof ColumnTypeEnum)[keyof typeof ColumnTypeEnum];
|
|
22
24
|
|
|
@@ -123,6 +125,10 @@ export declare interface ErrorCapturingSqlDriverAdapter extends ErrorCapturingIn
|
|
|
123
125
|
readonly errorRegistry: ErrorRegistry;
|
|
124
126
|
}
|
|
125
127
|
|
|
128
|
+
export declare interface ErrorCapturingSqlDriverAdapterFactory extends ErrorCapturingInterface<SqlDriverAdapterFactory> {
|
|
129
|
+
readonly errorRegistry: ErrorRegistry;
|
|
130
|
+
}
|
|
131
|
+
|
|
126
132
|
export declare type ErrorCapturingSqlQueryable = ErrorCapturingInterface<SqlQueryable>;
|
|
127
133
|
|
|
128
134
|
export declare type ErrorCapturingTransaction = ErrorCapturingInterface<Transaction>;
|
|
@@ -135,6 +141,12 @@ export declare interface ErrorRegistry {
|
|
|
135
141
|
consumeError(id: number): ErrorRecord | undefined;
|
|
136
142
|
}
|
|
137
143
|
|
|
144
|
+
declare class ErrorRegistryInternal implements ErrorRegistry {
|
|
145
|
+
private registeredErrors;
|
|
146
|
+
consumeError(id: number): ErrorRecord | undefined;
|
|
147
|
+
registerNewError(error: unknown): number;
|
|
148
|
+
}
|
|
149
|
+
|
|
138
150
|
export declare type IsolationLevel = 'READ UNCOMMITTED' | 'READ COMMITTED' | 'REPEATABLE READ' | 'SNAPSHOT' | 'SERIALIZABLE';
|
|
139
151
|
|
|
140
152
|
declare const officialPrismaAdapters: readonly ["@prisma/adapter-planetscale", "@prisma/adapter-neon", "@prisma/adapter-libsql", "@prisma/adapter-d1", "@prisma/adapter-pg", "@prisma/adapter-pg-worker"];
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,9 @@ declare interface AdapterInfo {
|
|
|
16
16
|
*/
|
|
17
17
|
export declare type ArgType = 'Int32' | 'Int64' | 'Float' | 'Double' | 'Text' | 'Enum' | 'EnumArray' | 'Bytes' | 'Boolean' | 'Char' | 'Array' | 'Numeric' | 'Json' | 'Xml' | 'Uuid' | 'DateTime' | 'Date' | 'Time';
|
|
18
18
|
|
|
19
|
-
export declare const bindAdapter: (adapter: SqlDriverAdapter) => ErrorCapturingSqlDriverAdapter;
|
|
19
|
+
export declare const bindAdapter: (adapter: SqlDriverAdapter, errorRegistry?: ErrorRegistryInternal) => ErrorCapturingSqlDriverAdapter;
|
|
20
|
+
|
|
21
|
+
export declare const bindSqlAdapterFactory: (adapterFactory: SqlDriverAdapterFactory) => ErrorCapturingSqlDriverAdapterFactory;
|
|
20
22
|
|
|
21
23
|
export declare type ColumnType = (typeof ColumnTypeEnum)[keyof typeof ColumnTypeEnum];
|
|
22
24
|
|
|
@@ -123,6 +125,10 @@ export declare interface ErrorCapturingSqlDriverAdapter extends ErrorCapturingIn
|
|
|
123
125
|
readonly errorRegistry: ErrorRegistry;
|
|
124
126
|
}
|
|
125
127
|
|
|
128
|
+
export declare interface ErrorCapturingSqlDriverAdapterFactory extends ErrorCapturingInterface<SqlDriverAdapterFactory> {
|
|
129
|
+
readonly errorRegistry: ErrorRegistry;
|
|
130
|
+
}
|
|
131
|
+
|
|
126
132
|
export declare type ErrorCapturingSqlQueryable = ErrorCapturingInterface<SqlQueryable>;
|
|
127
133
|
|
|
128
134
|
export declare type ErrorCapturingTransaction = ErrorCapturingInterface<Transaction>;
|
|
@@ -135,6 +141,12 @@ export declare interface ErrorRegistry {
|
|
|
135
141
|
consumeError(id: number): ErrorRecord | undefined;
|
|
136
142
|
}
|
|
137
143
|
|
|
144
|
+
declare class ErrorRegistryInternal implements ErrorRegistry {
|
|
145
|
+
private registeredErrors;
|
|
146
|
+
consumeError(id: number): ErrorRecord | undefined;
|
|
147
|
+
registerNewError(error: unknown): number;
|
|
148
|
+
}
|
|
149
|
+
|
|
138
150
|
export declare type IsolationLevel = 'READ UNCOMMITTED' | 'READ COMMITTED' | 'REPEATABLE READ' | 'SNAPSHOT' | 'SERIALIZABLE';
|
|
139
151
|
|
|
140
152
|
declare const officialPrismaAdapters: readonly ["@prisma/adapter-planetscale", "@prisma/adapter-neon", "@prisma/adapter-libsql", "@prisma/adapter-d1", "@prisma/adapter-pg", "@prisma/adapter-pg-worker"];
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@ __export(index_exports, {
|
|
|
24
24
|
Debug: () => import_debug.Debug,
|
|
25
25
|
DriverAdapterError: () => DriverAdapterError,
|
|
26
26
|
bindAdapter: () => bindAdapter,
|
|
27
|
+
bindSqlAdapterFactory: () => bindSqlAdapterFactory,
|
|
27
28
|
err: () => err,
|
|
28
29
|
ok: () => ok
|
|
29
30
|
});
|
|
@@ -83,8 +84,20 @@ var ErrorRegistryInternal = class {
|
|
|
83
84
|
return i;
|
|
84
85
|
}
|
|
85
86
|
};
|
|
86
|
-
var
|
|
87
|
+
var bindSqlAdapterFactory = (adapterFactory) => {
|
|
87
88
|
const errorRegistry = new ErrorRegistryInternal();
|
|
89
|
+
const boundFactory = {
|
|
90
|
+
adapterName: adapterFactory.adapterName,
|
|
91
|
+
provider: adapterFactory.provider,
|
|
92
|
+
errorRegistry,
|
|
93
|
+
connect: async (...args) => {
|
|
94
|
+
const ctx = await wrapAsync(errorRegistry, adapterFactory.connect.bind(adapterFactory))(...args);
|
|
95
|
+
return ctx.map((ctx2) => bindAdapter(ctx2, errorRegistry));
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
return boundFactory;
|
|
99
|
+
};
|
|
100
|
+
var bindAdapter = (adapter, errorRegistry = new ErrorRegistryInternal()) => {
|
|
88
101
|
const boundAdapter = {
|
|
89
102
|
adapterName: adapter.adapterName,
|
|
90
103
|
errorRegistry,
|
|
@@ -188,6 +201,7 @@ var import_debug = require("@prisma/debug");
|
|
|
188
201
|
Debug,
|
|
189
202
|
DriverAdapterError,
|
|
190
203
|
bindAdapter,
|
|
204
|
+
bindSqlAdapterFactory,
|
|
191
205
|
err,
|
|
192
206
|
ok
|
|
193
207
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -52,8 +52,20 @@ var ErrorRegistryInternal = class {
|
|
|
52
52
|
return i;
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
var
|
|
55
|
+
var bindSqlAdapterFactory = (adapterFactory) => {
|
|
56
56
|
const errorRegistry = new ErrorRegistryInternal();
|
|
57
|
+
const boundFactory = {
|
|
58
|
+
adapterName: adapterFactory.adapterName,
|
|
59
|
+
provider: adapterFactory.provider,
|
|
60
|
+
errorRegistry,
|
|
61
|
+
connect: async (...args) => {
|
|
62
|
+
const ctx = await wrapAsync(errorRegistry, adapterFactory.connect.bind(adapterFactory))(...args);
|
|
63
|
+
return ctx.map((ctx2) => bindAdapter(ctx2, errorRegistry));
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
return boundFactory;
|
|
67
|
+
};
|
|
68
|
+
var bindAdapter = (adapter, errorRegistry = new ErrorRegistryInternal()) => {
|
|
57
69
|
const boundAdapter = {
|
|
58
70
|
adapterName: adapter.adapterName,
|
|
59
71
|
errorRegistry,
|
|
@@ -156,6 +168,7 @@ export {
|
|
|
156
168
|
Debug,
|
|
157
169
|
DriverAdapterError,
|
|
158
170
|
bindAdapter,
|
|
171
|
+
bindSqlAdapterFactory,
|
|
159
172
|
err,
|
|
160
173
|
ok
|
|
161
174
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/driver-adapter-utils",
|
|
3
|
-
"version": "6.6.0-dev.
|
|
3
|
+
"version": "6.6.0-dev.61",
|
|
4
4
|
"description": "Internal set of utilities and types for Prisma's driver adapters.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"license": "Apache-2.0",
|
|
32
32
|
"sideEffects": false,
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@prisma/debug": "6.6.0-dev.
|
|
34
|
+
"@prisma/debug": "6.6.0-dev.61"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"dev": "DEV=true tsx helpers/build.ts",
|