pouchdb / pouchdb-server

CouchDB-compatible server built on PouchDB and Node
Apache License 2.0
956 stars 154 forks source link

Give a working example of using sqldown with a connection string? #251

Open shutej opened 7 years ago

shutej commented 7 years ago

I am trying to do something akin to ./node_modules/.bin/pouchdb-server --level-backend sqldown --level-prefix "$DATABASE_URL" where

DATABASE_URL=postgres://username:password@localhost:5432/databasename

Fauxton does not work...

(node:46947) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I've installed things correctly (I think)...

npm install --save pouchdb-server pg pg-query-stream sqldown
+ pg@6.4.0
+ pg-query-stream@1.0.0
+ sqldown@2.1.0
+ pouchdb-server@2.3.7
updated 4 packages in 3.651s
Bondifrench commented 5 years ago

@shutej Did you manage to find a solution for this?

noahdiewald commented 5 years ago

I seem to be having a similar problem.

node_modules/.bin/pouchdb-server --level-backend sqldown --level-prefix postgres://username:password@localhost:5432/pouchtest

(node:31529) UnhandledPromiseRejectionWarning: Error: Invalid Adapter: postgres at PouchAlt.PouchDB (/home/noah/Projects/pouchdbtest/node_modules/pouchdb-core/lib/index.js:1292:11) at new PouchAlt (/home/noah/Projects/pouchdbtest/node_modules/pouchdb-core/lib/index.js:1412:13) at /home/noah/Projects/pouchdbtest/node_modules/express-pouchdb/lib/create-or-delete-dbs.js:30:10 (node:31529) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:31529) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. [info] pouchdb-server has started on http://127.0.0.1:5984/ [info] using alternative backend: sqldown [info] all databases will be created with prefix: postgres://postgres:postgres@localhost:5432/pouchtest [info] navigate to http://127.0.0.1:5984/_utils for the Fauxton UI.