Skip to main content

Module audit

Module audit 

Source

Structs§

AuditEntry
One recorded change to one record.

Enums§

Event
What happened to a record.

Constants§

HISTORY_LIMIT
How many versions the history page shows. An audit table only grows, so the per-record view is capped rather than paginated for now.

Traits§

Auditor
A pluggable audit sink. Unlike Authorizer this is async and does I/O — it runs once per mutation, not several times per request.

Functions§

auditor
The registered auditor, if any.
diff
Diff a submitted write against the row it replaced, keeping only the columns that actually changed.
diff_removed
The inverse shape, for a delete: every stored column moves from its value to null, so the log holds the whole record as it last existed.
emit
Hand an entry to the registered auditor.
history
Entries for one record, shaped for the history template: the stored changes document is expanded into a per-field [old, new] list so the view layer doesn’t have to parse JSON.
is_enabled
Whether auditing is on. Default CRUD checks this before spending a read to capture before-state, so an unaudited app issues exactly the queries it did before this module existed.
set_auditor
Register the global audit sink. Set-once, matching set_storage and set_authorizer.