Skip to content

Commit

Permalink
feat(get-raw-sql): don't exectute hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
seromenho committed Aug 3, 2020
1 parent 47006a8 commit 057b7b5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ const Hooks = {
async runHooks(hooks, ...hookArgs) {
if (!hooks) throw new Error('runHooks requires at least 1 argument');

// Skip hooks if we are only getting raw SQL
if (hookArgs[0] && typeof hookArgs[0] === 'object' && hookArgs[0].getRawSql) {
return;
}

let hookType;

if (typeof hooks === 'string') {
Expand Down

0 comments on commit 057b7b5

Please sign in to comment.