PostgreSQL database adapter for ShareDB that can be used as both a snapshot store and oplog. Current stable version is 5.0.1. This adapter requires PostgreSQL 9.5+ due to jsonb support for high concurrency. It wraps node-postgres and supports the same configuration options via environment variables or connection object. Unlike the deprecated sharedb-mongo, this adapter is specifically for PostgreSQL environments. Note that queries are not yet supported. The project is moderately experimental but used in production by Synaptograph.
npm install sharedb-postgresNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a ShareDB backend using the PostgreSQL adapter with environment variable configuration, then closes cleanly.
Use a separate query mechanism (e.g., direct SQL via node-postgres) for custom queries.
Upgrade configuration to use environment variables or connection object as shown in the README.
Upgrade PostgreSQL to version 9.5 or higher.
Run ALTER TABLE statements to change data type from json to jsonb as documented in README.
To use environment variables, call createPostgresDB() with no arguments.
Ensure pg is installed: npm install pg@^8
Run npm install sharedb-postgres
Use const db = require('sharedb-postgres')(); or pass config objectUse proper PostgreSQL casting or avoid queries (adapter doesn't support queries)