How to use pg-pubsub - 1 common examples

To help you get started, we’ve selected a few pg-pubsub examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github forrestjs / forrestjs / packages / service-postgres-pubsub / src / lib / index.js View on Github external
postgresPubsub.forEach(config => {
                const connectionName = config.connectionName || 'default'
                const uri = [
                    'postgres://',
                    `${config.username}:${config.password}`,
                    '@',
                    `${config.host}:${config.port}`,
                    '/',
                    config.database,
                ].join('')

                connections[connectionName] = new PGPubsub(uri)
                connections[connectionName].publish('ping', Date.now())
            })

pg-pubsub

A Publish/Subscribe implementation on top of PostgreSQL NOTIFY/LISTEN

MIT
Latest version published 1 year ago

Package Health Score

55 / 100
Full package analysis

Popular pg-pubsub functions

Similar packages