mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 14:38:50 +00:00
revert(execute): transaction api
Somebody, somewhere, will experience compatibility issues with any change made to oxmysql.
This commit is contained in:
1 parent
57bf223a7d
commit
da83eff989
1 file changed
-4
@@ -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}`);
|
||||
|
||||
Reference in new issue
Block a user