Skip to content

Commit

Permalink
fix: Debug info in daf-node-sqlite3
Browse files Browse the repository at this point in the history
  • Loading branch information
simonas-notcat committed Nov 30, 2019
1 parent 6599296 commit b0b5b70
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/daf-node-sqlite3/src/index.ts
@@ -1,6 +1,9 @@
import sqlite3 from 'sqlite3'
import { Types } from 'daf-data-store'

import Debug from 'debug'
const debug = Debug('daf-node-sqlite3')

export class NodeSqlite3 implements Types.DbDriver {
private db: any

Expand All @@ -9,6 +12,7 @@ export class NodeSqlite3 implements Types.DbDriver {
}

run(sql: string, params: any): Promise<boolean> {
debug('run', sql, params)
return new Promise((resolve, reject) => {
this.db.run(sql, params || [], function(err: any, result: any) {
if (err) reject(err)
Expand All @@ -19,6 +23,7 @@ export class NodeSqlite3 implements Types.DbDriver {
}

rows(sql: string, params: any): Promise<any> {
debug('rows', sql, params)
return new Promise((resolve, reject) => {
this.db.all(sql, params || [], (err: any, result: any) => {
if (err) reject(err)
Expand Down

0 comments on commit b0b5b70

Please sign in to comment.