hoodiehq / hoodie-client

:dog: Client API for the Hoodie server
Apache License 2.0
34 stars 25 forks source link

Option to set database name respectively split data into multiple databases #173

Open PiTomar opened 4 years ago

PiTomar commented 4 years ago

Hello, is there an option to set a specific database name? I would like to split my data in two different databases.

In the hoodie-client example there is no db-name option an everything is stored in _pouch_hoodie and _poch_store.
In the store-client example there is a db name parameter:

var Store = require('@hoodie/store-client')
var store = new Store('mydbname', {
  PouchDB: require('pouchdb'),
  remote: 'http://localhost:5984/mydbname'
})

So is there a way to set the db name also in the hoodie-client api? Or could I combine the store-client initialization with the hoodie-client init or is there maybe an option to set the db name in the PouchDB.default?

Thanks

gr2m commented 4 years ago

Hoodie is depending on having the single database that is mirrored on the server. For example, it gets cleaned up when you sign out.

If you want to create a 2nd database locally, you'd need to take care of all that yourself. I'd suggest to use @hoodie/store-client directly to do that