db-watch
TypeScript icon, indicating that this package has built-in type declarations

0.0.8 • Public • Published

db-watch image test

Various implementation of database replication, including creating Postgres triggers and monitoring with notify listeners.

Example

// Add to migrations
for (const query of setupQueries) await knex.raw(query)

// After CREATE TABLE users
await knex.raw(createNotifyRowFunction('users', 'updated', "'username', orig.username"))
await knex.raw(createNotifyTrigger('users', 'updated'))

// Maximum PostgreSQL NOTIFY payload is 8192 bytes.
await knex.raw(createNotifyRowFieldsFunction('event', 'updated', "'date', orig.date, 'guid', orig.guid))
await knex.raw(createNotifyTrigger('event', 'updated'))

Readme

Keywords

none

Package Sidebar

Install

npm i db-watch

Weekly Downloads

2

Version

0.0.8

License

Apache-2.0

Unpacked Size

128 kB

Total Files

46

Last publish

Collaborators

  • wholenewsorg
  • jmfoutts