Composable Ecto queries for audit timelines.
Every helper returns an %Ecto.Query{} and uses occurred_at, id for a
deterministic display order. UUID order is only a tie-breaker; it does not
imply causality.
All helpers accept:
:order-:descby default, or:asc:prefix- optional PostgreSQL schema prefix
Summary
Functions
Returns the complete event timeline.
Filters events to the half-open [from, to) time window.
Filters the timeline to one actor.
Filters the timeline to an explicit actor type and identifier.
Filters the timeline to one correlation UUID.
Filters the timeline to one subject.
Filters the timeline to an explicit subject type and identifier.
Functions
@spec all(keyword()) :: Ecto.Query.t()
Returns the complete event timeline.
@spec between(DateTime.t(), DateTime.t(), keyword()) :: Ecto.Query.t()
Filters events to the half-open [from, to) time window.
Both boundaries must be DateTime values and from must be earlier than
to.
@spec for_actor( AuditLog.Actor.t(), keyword() ) :: Ecto.Query.t()
Filters the timeline to one actor.
The filter includes both actor type and ID.
@spec for_actor(String.Chars.t(), String.Chars.t(), keyword()) :: Ecto.Query.t()
Filters the timeline to an explicit actor type and identifier.
The type and ID are normalized in the same way as AuditLog.Actor.new!/3.
@spec for_correlation( Ecto.UUID.t(), keyword() ) :: Ecto.Query.t()
Filters the timeline to one correlation UUID.
@spec for_subject( AuditLog.Subject.t(), keyword() ) :: Ecto.Query.t()
Filters the timeline to one subject.
The filter includes both subject type and ID.
@spec for_subject(String.Chars.t(), String.Chars.t(), keyword()) :: Ecto.Query.t()
Filters the timeline to an explicit subject type and identifier.
The type and ID are normalized in the same way as AuditLog.Subject.new!/3.