Registry / database / amphora-storage-postgres

amphora-storage-postgres

JSON →
library2.1.1jsnpmunverified

A storage module for the Amphora publishing system that uses PostgreSQL with Redis caching. Version 2.1.1 is the current stable release. Updated infrequently as needed. Key differentiator: provides persistent storage for Amphora's content graph with Postgres, using Redis for performance. Alternatives include amphora-storage-memory and amphora-storage-mongo.

npm install amphora-storage-postgres
INSTALL
IMPORT
SIG · AMPHORA-STORAGE-PO
A
amphora-storage-postgres
databasejavascriptv2.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

storagePostgres
import storagePostgres from 'amphora-storage-postgres'
const storagePostgres = require('amphora-storage-postgres').default
Default CommonJS require returns the module directly; no .default needed.
storagePostgres
const storagePostgres = require('amphora-storage-postgres')
CommonJS require works directly.
storagePostgres
amphora({ storage: require('amphora-storage-postgres') })
amphora({ storage: { ... } })
Pass the entire module, not an object.

Demonstrates basic usage integrating amphora-storage-postgres as the storage plugin for Amphora.

const amphora = require('amphora'); const storage = require('amphora-storage-postgres'); amphora({ storage: storage, // other config }) .then(site => { console.log('Site running with Postgres storage'); });
Debug
Known issues
gotchaThe module tries to connect to Postgres and Redis at startup. Ensure environment variables are set (e.g., DATABASE_URL, REDIS_URL) to avoid connection failures.
fix
Set required environment variables or use defaults for local dev.
affects: >=2.0.0
deprecatedVersion 1.x used a different configuration API; upgrade to 2.x for current setup.
fix
Update to amphora-storage-postgres@2.x and adjust config.
affects: <2.0.0
gotchaThe module expects a running Postgres and Redis instance. No graceful fallback if unavailable; startup will fail.
fix
Ensure Postgres and Redis are accessible before starting Amphora.
affects: >=1.0.0
Errors
Common errors & fixes
Error: connect ECONNREFUSED 127.0.0.1:5432
Postgres is not running or not reachable at the default host and port.
fix
Start Postgres or set the DATABASE_URL environment variable to point to the correct instance.
Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
Redis is not running or not reachable at the default host and port.
fix
Start Redis or set the REDIS_URL environment variable to point to the correct instance.
Upgrade
Version history
2.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
29 hits · last 30 days
node
22
Resources
amphora-storage-postgres — npm install amphora-storage-postgres · libregistry