From da83eff989c8d5b3f8c52438e1f3c5a5cf9e091e Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Thu, 21 Apr 2022 12:07:47 +1000 Subject: [PATCH] revert(execute): transaction api Somebody, somewhere, will experience compatibility issues with any change made to oxmysql. --- src/database/rawExecute.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/database/rawExecute.ts b/src/database/rawExecute.ts index ccda338..a336b31 100644 --- a/src/database/rawExecute.ts +++ b/src/database/rawExecute.ts @@ -24,7 +24,6 @@ export const rawExecute = async ( const connection = await pool.promise().getConnection(); try { - if (type !== null) await connection.beginTransaction(); const placeholders = query.split('?').length - 1; for (let values of parameters as CFXParameters[]) { @@ -45,10 +44,7 @@ export const rawExecute = async ( } single = response.length === 1; - if (type !== null) connection.commit(); } catch (err: any) { - if (connection && type !== null) connection.rollback(); - throw new Error(`${invokingResource} was unable to execute a query! ${err.message} ${err.sql}`);