- Notifications
You must be signed in to change notification settings - Fork24
PostgreSQL adapter for ShareDB
License
share/sharedb-postgres
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
PostgreSQL database adapter forsharedb. This driver can be used both as a snapshot store and oplog.
Doesn't support queries (yet?).
Moderately experimental. (This drivesSynaptograph's backend, and@nornagon hasn't noticed any issues so far.)
npm i sharedb-postgres
Due to the fix to resolvehigh concurency issues Postgres 9.5+ is now required.
Older versions of this adaptor used the data type json. You will need to alter the data type prior to using if you are upgrading.
ALTERTABLE ops ALTER COLUMN operationSET DATA TYPE jsonb USING operation::jsonb;ALTERTABLE snapshots ALTER COLUMN dataSET DATA TYPE jsonb USING data::jsonb;
sharedb-postgres-jsonb
wraps nativenode-postgres, and it supports the same configuration options.
To instantiate a sharedb-postgres wrapper, invoke the module and pass in yourPostgreSQL configuration as an argument or use environmental arguments.
For example using environmental arugments:
vardb=require('sharedb-postgres')();varbackend=require('sharedb')({db:db})
Then executing via the command line
PGUSER=dbuser PGPASSWORD=secretpassword PGHOST=database.server.com PGDATABASE=mydb PGPORT=5433 npm start
Example using an object
vardb=require('sharedb-postgres')({host:'localhost',database:'mydb'});varbackend=require('sharedb')({db:db})
PostgreSQL errors are passed back directly.
Note that version 3.0.0 introduces breaking changes in how you specifyconnection parameters. See thechangelog for more info.
About
PostgreSQL adapter for ShareDB
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors10
Uh oh!
There was an error while loading.Please reload this page.