A Node.js library implementing the transactional outbox pattern on PostgreSQL with basic event sourcing support. Current stable version is 0.19.256, released on an ongoing cadence. It provides short-polling and LISTEN/NOTIFY modes for message delivery, supports commands and events handled by multiple consumers, and integrates with custom adapters. Key differentiators include built-in event sourcing primitives, row locking for at-least-once delivery, and a rich set of configuration options. The library ships TypeScript definitions.
npm install pg-trx-outboxNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates and starts a PgTrxOutbox instance with short polling mode, then stops after 10 seconds.
Update adapter's onMessages method to accept an array of messages.
Pass a Pool instance to pgOptions instead of a PoolConfig object.
Install pg-listen, create the SQL trigger as documented, and ensure function exists.
Use the provided migration script and avoid renaming the table.
Ensure pg-listen is installed and configured properly; check outboxOptions and adapter initialization.
Pass a valid Pool instance to pgOptions: `pgOptions: { pool: new Pool() }`.Run the CREATE TABLE migration provided in the documentation.