Chronicle. Query
(chronicle v0.1.2)
Copy Markdown
Read API for Ecto-backed audit timelines.
Filters are a map or keyword list. Supported filters include :actor,
:tenant, :subject, :correlation_id, :type, :outcome, :from,
:to, and :kinds. Reference filters accept the same values as
Chronicle.record/3.
Chronicle.Query.timeline(actor: user, limit: 50)
Chronicle.Query.for_subject(order, from: yesterday)
Chronicle.Query.group(group_id)Pages use opaque cursors backed by immutable ledger positions rather than
user-supplied event timestamps. Do not parse or rely on their representation.
Queries do not verify the ledger; use Chronicle.verify_all/2 for integrity
assurance.
Summary
Functions
@spec for_actor( term(), keyword() ) :: {:ok, Chronicle.Query.Page.t()} | {:error, Chronicle.Error.t()}
@spec for_correlation( String.t(), keyword() ) :: {:ok, Chronicle.Query.Page.t()} | {:error, Chronicle.Error.t()}
@spec for_subject( term(), keyword() ) :: {:ok, Chronicle.Query.Page.t()} | {:error, Chronicle.Error.t()}
@spec for_tenant( term(), keyword() ) :: {:ok, Chronicle.Query.Page.t()} | {:error, Chronicle.Error.t()}
@spec group( String.t(), keyword() ) :: {:ok, {Chronicle.Group.t(), [Chronicle.Event.t()]}} | {:error, Chronicle.Error.t()}
@spec timeline( map() | keyword(), keyword() ) :: {:ok, Chronicle.Query.Page.t()} | {:error, Chronicle.Error.t()}