mirror of https://github.com/Budibase/budibase.git
10 changed files with 35 additions and 48 deletions
@ -1,11 +1,19 @@ |
|||
// const nano = require("nano")
|
|||
const PouchDB = require("pouchdb"); |
|||
const PouchDB = require("pouchdb") |
|||
|
|||
const COUCH_DB_URL = |
|||
process.env.COUCH_DB_URL || "http://admin:password@localhost:5984" |
|||
|
|||
const CouchDB = PouchDB.defaults({ |
|||
prefix: COUCH_DB_URL |
|||
}); |
|||
// database can be "pouch" or "couch"
|
|||
const CouchDB = ({ database, couchDbConnectionString }) => { |
|||
database = database || "couch" |
|||
couchDbConnectionString = couchDbConnectionString || COUCH_DB_URL |
|||
if (database === "couch") { |
|||
return PouchDB.defaults({ |
|||
prefix: couchDbConnectionString, |
|||
}) |
|||
} |
|||
// else setup for leveldb
|
|||
} |
|||
|
|||
module.exports = CouchDB; |
|||
module.exports = CouchDB |
|||
|
|||
Loading…
Reference in new issue