Audit platform for Elixir teams using Phoenix, Ecto, and PostgreSQL.
Threadline combines trigger-backed row-change capture, rich action semantics (actor/intent/context), and operator-grade exploration.
Summary
Functions
Returns AuditTransaction records for a given actor, ordered by
occurred_at descending.
Exports matching audit changes as CSV (same filters / opts as Threadline.Query.timeline/2).
Exports matching audit changes as JSON (same filters / opts as Threadline.Query.timeline/2).
Returns AuditChange records for a given schema record, ordered by
captured_at descending.
Records a semantic audit action.
Returns AuditChange records across tables, filtered by the given options,
ordered by captured_at descending.
Functions
Returns AuditTransaction records for a given actor, ordered by
occurred_at descending.
Options
:repo— requiredEcto.Repomodule
Exports matching audit changes as CSV (same filters / opts as Threadline.Query.timeline/2).
Exports matching audit changes as JSON (same filters / opts as Threadline.Query.timeline/2).
Pass json_format: :ndjson in opts for newline-delimited objects. See Threadline.Export
and Threadline.Query.timeline/2.
Returns AuditChange records for a given schema record, ordered by
captured_at descending.
Structs include :changed_from when present in the row (sparse prior values on
UPDATE under an opt-in per-table capture function; nil when disabled or on
INSERT/DELETE rows).
Options
:repo— requiredEcto.Repomodule
Records a semantic audit action.
Required options
:actoror:actor_ref—%ActorRef{}identifying who performed the action:repo— theEcto.Repomodule to use for insertion
Optional options
:status—:okor:error(default::ok):verb— string or atom (e.g.,"update"):category— string or atom (e.g.,"membership"):reason— atom (e.g.,:insufficient_permissions):comment— free-text string explanation:correlation_id— cross-boundary correlation ID string:request_id— request ID string (fromPlug.RequestId/x-request-id):job_id— Oban job ID string
Returns
{:ok, %AuditAction{}}on success{:error, %Ecto.Changeset{}}if changeset validation fails{:error, :missing_actor}if no actor was provided{:error, :invalid_actor_ref}if the actor fails ActorRef validation{:error, :missing_repo}if:repois not provided
Returns AuditChange records across tables, filtered by the given options,
ordered by captured_at descending.