mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 22:21:51 +00:00
refactor(execute): don't use transactions for SELECT statements
This commit is contained in:
1 parent
d34bbc45f5
commit
9fec9cccba
2 files changed
+5
-7
No files matched your search
@@ -3,7 +3,7 @@ import { CFXParameters } from '../types';
|
||||
export const executeType = (query: string) => {
|
||||
switch (query.replace(/\s.*/, '')) {
|
||||
case 'SELECT':
|
||||
return 'execute';
|
||||
return null;
|
||||
case 'INSERT':
|
||||
return 'insert';
|
||||
case 'UPDATE':
|
||||
@@ -11,7 +11,7 @@ export const executeType = (query: string) => {
|
||||
case 'DELETE':
|
||||
return 'update';
|
||||
default:
|
||||
return false;
|
||||
throw new Error(`Prepared statements only accept SELECT, INSERT, UPDATE, and DELETE methods.`);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user