@prisma/driver-adapter-utils
Advanced tools
Comparing version
@@ -170,9 +170,2 @@ export declare const bindAdapter: (adapter: DriverAdapter) => ErrorCapturingDriverAdapter; | ||
rollback(): Promise<Result<void>>; | ||
/** | ||
* Discards and closes the transaction which may or may not have been committed or rolled back. | ||
* This operation must be synchronous. If the implementation requires calling creating new | ||
* asynchronous tasks on the event loop, the driver is responsible for handling the errors | ||
* appropriately to ensure they don't crash the application. | ||
*/ | ||
dispose(): Result<void>; | ||
} | ||
@@ -179,0 +172,0 @@ |
@@ -107,4 +107,3 @@ "use strict"; | ||
commit: wrapAsync(errorRegistry, transaction.commit.bind(transaction)), | ||
rollback: wrapAsync(errorRegistry, transaction.rollback.bind(transaction)), | ||
dispose: wrapSync(errorRegistry, transaction.dispose.bind(transaction)) | ||
rollback: wrapAsync(errorRegistry, transaction.rollback.bind(transaction)) | ||
}; | ||
@@ -122,12 +121,2 @@ }; | ||
} | ||
function wrapSync(registry, fn) { | ||
return (...args) => { | ||
try { | ||
return fn(...args); | ||
} catch (error) { | ||
const id = registry.registerNewError(error); | ||
return err({ kind: "GenericJs", id }); | ||
} | ||
}; | ||
} | ||
@@ -134,0 +123,0 @@ // src/const.ts |
{ | ||
"name": "@prisma/driver-adapter-utils", | ||
"version": "5.7.0-integration-wasm-0-0-8.1", | ||
"version": "5.7.0-integration-wasm-0-0-9.1", | ||
"description": "Internal set of utilities and types for Prisma's driver adapters.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
29521
-4.58%452
-6.03%