pg-triggers is a PostgreSQL trigger-based auditing library (v0.4.6, maintained intermittently) that automatically records changes to tables (INSERT, UPDATE, DELETE) into changelog tables. It uses PSQL scripts and requires manual enabling per table via the `enance_table` function. Differentiates from other auditing extensions by being lightweight and SQL-only (no PG extensions).
npm install pg-triggersNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to install the SQL triggers and enable auditing on a table using psql commands.
Execute the SQL files using psql as described in the README.
Run: psql -c "SELECT enance_table('table_name','primary_key_columns')"Check the actual file names in the `lib/` directory; use `ls node_modules/pg-triggers/lib/` to see available scripts.
Monitor query performance and consider asynchronous logging alternatives for high-throughput systems.
Run: psql < node_modules/pg-triggers/lib/recreate-his.sql
Run: psql -d your_database < node_modules/pg-triggers/lib/enance.sql
No dependency data recorded yet.