@prisma/driver-adapter-utils 7.5.0-dev.3 → 7.5.0-dev.30
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 +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +11 -1
- package/dist/index.mjs +11 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -382,6 +382,18 @@ export declare interface Transaction extends AdapterInfo, SqlQueryable {
|
|
|
382
382
|
* Roll back the transaction.
|
|
383
383
|
*/
|
|
384
384
|
rollback(): Promise<void>;
|
|
385
|
+
/**
|
|
386
|
+
* Creates a savepoint within the currently running transaction.
|
|
387
|
+
*/
|
|
388
|
+
createSavepoint?(name: string): Promise<void>;
|
|
389
|
+
/**
|
|
390
|
+
* Rolls back transaction state to a previously created savepoint.
|
|
391
|
+
*/
|
|
392
|
+
rollbackToSavepoint?(name: string): Promise<void>;
|
|
393
|
+
/**
|
|
394
|
+
* Releases a previously created savepoint. Optional because not every connector supports this operation.
|
|
395
|
+
*/
|
|
396
|
+
releaseSavepoint?(name: string): Promise<void>;
|
|
385
397
|
}
|
|
386
398
|
|
|
387
399
|
export declare type TransactionOptions = {
|
package/dist/index.d.ts
CHANGED
|
@@ -382,6 +382,18 @@ export declare interface Transaction extends AdapterInfo, SqlQueryable {
|
|
|
382
382
|
* Roll back the transaction.
|
|
383
383
|
*/
|
|
384
384
|
rollback(): Promise<void>;
|
|
385
|
+
/**
|
|
386
|
+
* Creates a savepoint within the currently running transaction.
|
|
387
|
+
*/
|
|
388
|
+
createSavepoint?(name: string): Promise<void>;
|
|
389
|
+
/**
|
|
390
|
+
* Rolls back transaction state to a previously created savepoint.
|
|
391
|
+
*/
|
|
392
|
+
rollbackToSavepoint?(name: string): Promise<void>;
|
|
393
|
+
/**
|
|
394
|
+
* Releases a previously created savepoint. Optional because not every connector supports this operation.
|
|
395
|
+
*/
|
|
396
|
+
releaseSavepoint?(name: string): Promise<void>;
|
|
385
397
|
}
|
|
386
398
|
|
|
387
399
|
export declare type TransactionOptions = {
|
package/dist/index.js
CHANGED
|
@@ -151,7 +151,7 @@ var bindAdapter = (adapter, errorRegistry = new ErrorRegistryInternal()) => {
|
|
|
151
151
|
return boundAdapter;
|
|
152
152
|
};
|
|
153
153
|
var bindTransaction = (errorRegistry, transaction) => {
|
|
154
|
-
|
|
154
|
+
const boundTransaction = {
|
|
155
155
|
adapterName: transaction.adapterName,
|
|
156
156
|
provider: transaction.provider,
|
|
157
157
|
options: transaction.options,
|
|
@@ -160,6 +160,16 @@ var bindTransaction = (errorRegistry, transaction) => {
|
|
|
160
160
|
commit: wrapAsync(errorRegistry, transaction.commit.bind(transaction)),
|
|
161
161
|
rollback: wrapAsync(errorRegistry, transaction.rollback.bind(transaction))
|
|
162
162
|
};
|
|
163
|
+
if (transaction.createSavepoint) {
|
|
164
|
+
boundTransaction.createSavepoint = wrapAsync(errorRegistry, transaction.createSavepoint.bind(transaction));
|
|
165
|
+
}
|
|
166
|
+
if (transaction.rollbackToSavepoint) {
|
|
167
|
+
boundTransaction.rollbackToSavepoint = wrapAsync(errorRegistry, transaction.rollbackToSavepoint.bind(transaction));
|
|
168
|
+
}
|
|
169
|
+
if (transaction.releaseSavepoint) {
|
|
170
|
+
boundTransaction.releaseSavepoint = wrapAsync(errorRegistry, transaction.releaseSavepoint.bind(transaction));
|
|
171
|
+
}
|
|
172
|
+
return boundTransaction;
|
|
163
173
|
};
|
|
164
174
|
function wrapAsync(registry, fn) {
|
|
165
175
|
return async (...args) => {
|
package/dist/index.mjs
CHANGED
|
@@ -113,7 +113,7 @@ var bindAdapter = (adapter, errorRegistry = new ErrorRegistryInternal()) => {
|
|
|
113
113
|
return boundAdapter;
|
|
114
114
|
};
|
|
115
115
|
var bindTransaction = (errorRegistry, transaction) => {
|
|
116
|
-
|
|
116
|
+
const boundTransaction = {
|
|
117
117
|
adapterName: transaction.adapterName,
|
|
118
118
|
provider: transaction.provider,
|
|
119
119
|
options: transaction.options,
|
|
@@ -122,6 +122,16 @@ var bindTransaction = (errorRegistry, transaction) => {
|
|
|
122
122
|
commit: wrapAsync(errorRegistry, transaction.commit.bind(transaction)),
|
|
123
123
|
rollback: wrapAsync(errorRegistry, transaction.rollback.bind(transaction))
|
|
124
124
|
};
|
|
125
|
+
if (transaction.createSavepoint) {
|
|
126
|
+
boundTransaction.createSavepoint = wrapAsync(errorRegistry, transaction.createSavepoint.bind(transaction));
|
|
127
|
+
}
|
|
128
|
+
if (transaction.rollbackToSavepoint) {
|
|
129
|
+
boundTransaction.rollbackToSavepoint = wrapAsync(errorRegistry, transaction.rollbackToSavepoint.bind(transaction));
|
|
130
|
+
}
|
|
131
|
+
if (transaction.releaseSavepoint) {
|
|
132
|
+
boundTransaction.releaseSavepoint = wrapAsync(errorRegistry, transaction.releaseSavepoint.bind(transaction));
|
|
133
|
+
}
|
|
134
|
+
return boundTransaction;
|
|
125
135
|
};
|
|
126
136
|
function wrapAsync(registry, fn) {
|
|
127
137
|
return async (...args) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/driver-adapter-utils",
|
|
3
|
-
"version": "7.5.0-dev.
|
|
3
|
+
"version": "7.5.0-dev.30",
|
|
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": "7.5.0-dev.
|
|
34
|
+
"@prisma/debug": "7.5.0-dev.30"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"dev": "DEV=true tsx helpers/build.ts",
|