Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.
/ lib_event Public archive

Event auditing for PostgreSQL (PL/pgSQL)

Notifications You must be signed in to change notification settings

netwo-io/lib_event

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Event recording for auditability for PostgreSQL (PL/pgSQL)

Features

  • ✓ unrestricted event name

  • ✓ user-defined headers

  • ✓ handles payload of any-size

Convention

An event is something that has happened. In the past.

Event should be in the form of: <service>.<resourceType>.<verb_past_tense>

Examples:

  • iam.user.created

  • billing.invoice.drafted

  • billing.invoice.paid

Usage

API

(function) create a new event (event_id), insert it (table lib_event.event) and trigger a pg_notify("lib_event.created", event_id)

lib_events.create("iam.user.created", payload jsonb, ...)

pg_notify limits payload to 8000 bytes so lib_event only contains the event_id that can then be retrieved with

select * from lib_events.events where event__id = XXXX

(view) public access to one or more events

select event__id, headers, payload from lib_events.events;

Releases

No releases published

Packages

No packages published