pouchdb-community / pouchdb-adapter-fs

PouchDB adapter using fsdown under the hood
Apache License 2.0
4 stars 4 forks source link

use `prefix` option as prefix to path, not only the db #1

Closed gr2m closed 8 years ago

gr2m commented 8 years ago

This code currently creates .fsdown/datamydb.json, but I’d expect data/mydb.json as the leveldb adapter does it.

var PouchDB = require('pouchdb-core')
  .plugin(require('pouchdb-adapter-fs'))
  .defaults({
    prefix: 'data/'
  })

new PouchDB('mydb')

Would you agree?

For Hoodie we need the folder where the databases are stored to be configurable. I’d suggest that we default to .fsdown/ unless the prefix option is set.

nolanlawson commented 8 years ago

This sounds reasonable to me. I'm actually also open to just removing the whole .fsdown prefix and just pushing a 2.0.0 version. This project is young and I'm sure not many people are using it.

gr2m commented 8 years ago

I'm actually also open to just removing the whole .fsdown prefix

Agree 👍 I think it’s best to match the leveldb adapter’s behavior. I’ll work on a PR, thanks Nolan :)

gr2m commented 8 years ago

Can you invite me to this repository, so we can collab on the PR if needed?

nolanlawson commented 8 years ago

sure thing!

gr2m commented 8 years ago

sorry can you add me to https://github.com/nolanlawson/fsdown, too? Sorry for pinging you on slack, too I got distracted shortly and forgot I already pinged you on GitHub

gr2m commented 8 years ago

shipped in v2