Skip to content

Commit

Permalink
refactor(utils/parseExecute): allow other methods through prepare calls
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed Jul 6, 2023
1 parent 54deb4a commit 8a340d6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/utils/parseExecute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ import { CFXParameters } from '../types';

export const executeType = (query: string) => {
switch (query.substring(0, query.indexOf(' '))) {
case 'SELECT':
return null;
case 'INSERT':
return 'insert';
case 'UPDATE':
return 'update';
case 'DELETE':
return 'update';
default:
throw new Error(`Prepared statements only accept SELECT, INSERT, UPDATE, and DELETE methods.`);
return null;
}
};

Expand Down

0 comments on commit 8a340d6

Please sign in to comment.