Skip to content

Commit

Permalink
fix: avoid typeerror on promisify statement
Browse files Browse the repository at this point in the history
closes #11
  • Loading branch information
naxmefy committed Sep 23, 2020
1 parent 1eddcbd commit 41cd393
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Statement.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as Promise from 'bluebird'

import { IResultSet, ResultSet } from './ResultSet'

export interface IStatement {
Expand All @@ -19,7 +20,11 @@ export class Statement {
protected statement: IStatement

constructor (statement) {
this.statement = Promise.promisifyAll(statement) as IStatement
this.statement = Promise.promisifyAll(statement, {
filter: (name, _, __, passesDefaultFilter) => {
return passesDefaultFilter && !name.endsWith('Async')
}
}) as IStatement
}

executeUpdate (sql: string): Promise<number> {
Expand Down

0 comments on commit 41cd393

Please sign in to comment.