Action handler implementation for demux-js, providing Postgres database integration for blockchain event processing. Current stable version 4.0.1, maintained as part of EOSIO demux ecosystem. Releases are infrequent, with v4 focusing on TypeScript and updated demux peer dependency. Key differentiator: directly maps blockchain actions to Postgres state updates via SQL statements, offering persistence and queryability compared to in-memory handlers.
npm install demux-postgresNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize PostgresActionHandler with a pg.Pool connection, then integrate with BaseActionWatcher for blockchain action processing.
Use import syntax and ensure package.json type: module or .mjs extension.
Remove PostgresDatabaseInitialization calls, call handler.migrate() on the handler instance.
Use new pg.Pool() and pass the pool object; do not use pg.Client.
Update HandlerVersion instantiation to pass object with versionName and effects.
Create schema before running migrations, or set migrationTable to include schema (e.g., 'public.migrations').
npm install demux@4.0.0
Replace initializer import with handler.migrate() call.
Set type: module in package.json or use .mjs extension, and use import.
Use 'import { Pool } from 'pg'' or 'const { Pool } = require('pg')' if using CJS.