# `Sigra.Audit.Query`
[🔗](https://github.com/sztheory/sigra/blob/v1.20.0/lib/sigra/audit/query.ex#L1)

Composable Ecto query builder for `audit_events`.

Supported filters (D-12):

  * `:actor_id`
  * `:action`
  * `:action_prefix` — SQL LIKE with escaped prefix
  * `:outcome`
  * `:from` / `:to` — `DateTime` bounds on `inserted_at`
  * `:target_id`
  * `:target_type`

Pagination uses the or-expanded `(inserted_at, id)` tiebreak so it is
portable across PostgreSQL, MySQL, and SQLite (RESEARCH A3).

# `allowed_filters`

```elixir
@spec allowed_filters() :: [atom()]
```

Returns the canonical list of filter keys accepted by `build/2`.

Unknown keys raise `ArgumentError` (D-15 breaking change in v1.1).

# `build`

```elixir
@spec build(
  module(),
  keyword()
) :: Ecto.Query.t()
```

# `paginate`

```elixir
@spec paginate(Ecto.Query.t(), nil | {DateTime.t(), binary()}, pos_integer()) ::
  Ecto.Query.t()
```

Applies cursor + limit + desc ordering using or-expanded tiebreak
(portable across PostgreSQL, MySQL, and SQLite).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
