Skip to content

Commit 657fea8

Browse files
committed
expose db options
1 parent e26f394 commit 657fea8

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

src/bouncer/db/loki-db.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ const debug = require('debug')('dataparty.local.loki-db')
1414

1515
module.exports = class LokiDb extends IDb {
1616

17-
constructor ({path, factory, dbAdapter}) {
17+
constructor ({path, factory, dbAdapter, lokiOptions}) {
1818
super(factory)
1919
debug('constructor')
2020
this.loki = null
21+
this.lokiOptions = lokiOptions
2122
this.path = path
2223
this.dbAdapter = dbAdapter || new LFSA()
2324
this.error = null
@@ -32,7 +33,8 @@ module.exports = class LokiDb extends IDb {
3233
this.loki = new Loki(
3334
this.path,
3435
{
35-
adapter : this.dbAdapter
36+
adapter : this.dbAdapter,
37+
...this.lokiOptions
3638
}
3739
)
3840

src/party/local/loki-party.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ const Qb = require('../qb')
1616
*/
1717
class LokiParty extends IParty {
1818

19-
constructor ({path, dbAdapter, qbOptions, ...options}) {
19+
constructor ({path, dbAdapter, qbOptions, lokiOptions, ...options}) {
2020
super(options)
2121

2222
this.db = new LokiDb({
2323
dbAdapter,
24-
path, factory: this.factory
24+
path, factory: this.factory,
25+
lokiOptions
2526
})
2627

2728
this.crufler = new AdminCrufler({

src/party/local/tingo-party.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ const Qb = require('../qb')
1616
*/
1717
class TingoParty extends IParty {
1818

19-
constructor ({path, qbOptions, ...options}) {
19+
constructor ({path, qbOptions, tingoOptions, ...options}) {
2020
super(options)
2121

2222
this.db = new TingoDb({
23-
path, factory: this.factory
23+
path, factory: this.factory,
24+
tingoOptions
2425
})
2526

2627
this.crufler = new AdminCrufler({

0 commit comments

Comments
 (0)