Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PostgreSQL adapter for ShareDB

License

NotificationsYou must be signed in to change notification settings

share/sharedb-postgres

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.)

Installation

npm i sharedb-postgres

Requirements

Due to the fix to resolvehigh concurency issues Postgres 9.5+ is now required.

Migrating older versions

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;

Usage

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})

Error codes

PostgreSQL errors are passed back directly.

Changelog

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

Stars

Watchers

Forks

Packages

No packages published

Contributors10


[8]ページ先頭

©2009-2025 Movatter.jp