Creates a hook that only runs for specific operations.
Operations to filter for
Hooks to apply
Filtered hooks
const writeOnlyHooks = filterHooks(['run', 'batch'], { onBeforeWrite: async (ctx) => { console.log('Write:', ctx.statement); return ctx; }}); Copy
const writeOnlyHooks = filterHooks(['run', 'batch'], { onBeforeWrite: async (ctx) => { console.log('Write:', ctx.statement); return ctx; }});
Creates a hook that only runs for specific operations.