mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-03 22:20:56 +00:00
refactor(utils/parseExecute): allow other methods through prepare calls
This commit is contained in:
1 parent
54deb4ab66
commit
8a340d60e3
1 file changed
+1
-3
@@ -2,8 +2,6 @@ import { CFXParameters } from '../types';
|
|||||||
|
|
||||||
export const executeType = (query: string) => {
|
export const executeType = (query: string) => {
|
||||||
switch (query.substring(0, query.indexOf(' '))) {
|
switch (query.substring(0, query.indexOf(' '))) {
|
||||||
case 'SELECT':
|
|
||||||
return null;
|
|
||||||
case 'INSERT':
|
case 'INSERT':
|
||||||
return 'insert';
|
return 'insert';
|
||||||
case 'UPDATE':
|
case 'UPDATE':
|
||||||
@@ -11,7 +9,7 @@ export const executeType = (query: string) => {
|
|||||||
case 'DELETE':
|
case 'DELETE':
|
||||||
return 'update';
|
return 'update';
|
||||||
default:
|
default:
|
||||||
throw new Error(`Prepared statements only accept SELECT, INSERT, UPDATE, and DELETE methods.`);
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user