Skip to content

Commit

Permalink
feat: remove verbose in favor of onQuery hook
Browse files Browse the repository at this point in the history
BREAKING CHANGE: the `verbose` option has been removed from trilogy instances. Use the new `onQuery` hook instead.
  • Loading branch information
haltcase committed Jun 11, 2019
1 parent 813ee0c commit cf7d085
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 5 deletions.
3 changes: 0 additions & 3 deletions src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,6 @@ export async function runQuery <D extends types.ReturnDict = types.LooseObject>
): Promise<any> {
const asString = query.toString()
const action = getQueryAction(asString)
if (util.isFunction(instance.verbose)) {
instance.verbose(asString)
}

if (options.model) {
await options.model._callHook(
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export class Trilogy {
}

this.isNative = obj.client === 'sqlite3'
this.verbose = (obj.verbose as (query: string) => any)

const config = { client: 'sqlite3', useNullAsDefault: true }

Expand Down
1 change: 0 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ export const TrilogyOptions = t.partial({
filename: t.string
}), {}),
dir: withDefault(t.string, process.cwd),
verbose: withDefault(t.Function, () => t.identity)
})

export const ModelOptions = t.partial({
Expand Down

0 comments on commit cf7d085

Please sign in to comment.