Skip to content

Automatic subscription to PostgreSQL tables on top of LISTEN / NOTIFY functionality

License

Notifications You must be signed in to change notification settings

Pom4H/pg-table-subscriber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pg-table-subscriber

Usage

    const { start, beforeUpdate } = require('pg-table-subscriber');

    start(dbConfig);

    beforeUpdate('some_table', ({ previous, record }) => {
        console.info('We`ve got something updated!');
        console.info('It was like this:', previous);
        console.info('A became:', record);
        console.info('Well, okay...');
    });

About

Automatic subscription to PostgreSQL tables on top of LISTEN / NOTIFY functionality

Resources

License

Stars

Watchers

Forks

Packages

No packages published