Skip to content

example project of using pg-notify and custom trigger for audit table

Notifications You must be signed in to change notification settings

grmkris/drizzle-pg-notify-audit-table

Repository files navigation

drizzle-pg-notify-audit-table

Problem

  1. You have some tables in your database that you want to audit. You want to know who changed what and when. You want to be able to query this data easily and see the changes over time.

  2. You want to be able to subscribe to changes in the database and be notified in real-time.

Solution

  1. Audit
  1. Notifications

Example repository integrating:

To install dependencies:

bun install

To run:

bun run dev

This example projects implements 3 tables:

  • users
  • posts (with a foreign key to users)
  • comments (with a foreign key to users and posts)
  • record_version (stored in a audit table)

Server:

About

example project of using pg-notify and custom trigger for audit table

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published