Skip to content

Commit

Permalink
passing options to sqlite3
Browse files Browse the repository at this point in the history
  • Loading branch information
refractalize committed Feb 1, 2016
1 parent a6b7579 commit 4314d79
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -533,3 +533,15 @@ person.query('select * from people where id = @id', {id: 1}, function (people) {
return bob.save();
});
```
## Options
You can pass options to the database driver when executing a query
```js
db.query(sql, parameters, [options])
```
* SQLite3
`exec` runs the `exec()` method on the connection, see [exec](https://github.com/mapbox/node-sqlite3/wiki/API#databaseexecsql-callback). Note that this method ignores any query `parameters` passed in.
5 changes: 5 additions & 0 deletions sqliteDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ module.exports = function() {
}
});
});
} else if (options && options.exec) {
return promisify(function (cb) {
debug(query, sqliteParams);
self.connection.exec(query, cb);
});
} else {
return promisify(function (cb) {
debug(query, sqliteParams);
Expand Down

0 comments on commit 4314d79

Please sign in to comment.