# `Continuum.Query`
[🔗](https://github.com/Yyeger/Continuum/blob/main/lib/continuum/query.ex#L1)

Structured read API for durable run rows.

Queries are intentionally closed over a small set of fields and operators.
This keeps the public API independent from arbitrary SQL fragments while still
supporting operator dashboards and search attributes.

# `attribute_path`

```elixir
@type attribute_path() :: [atom() | binary()]
```

# `condition`

```elixir
@type condition() ::
  {:eq | :neq | :lt | :lte | :gt | :gte, field(), term()}
  | {:eq | :neq, attribute_path(), term()}
  | {:in, field(), [term()]}
```

# `field`

```elixir
@type field() :: :id | :run_id | :state | :workflow | :started_at | :completed_at
```

# `get_run`

```elixir
@spec get_run(
  binary(),
  keyword()
) :: {:ok, map()} | {:error, :not_found | term()}
```

Loads one run by id.

# `list`

```elixir
@spec list(keyword()) :: {:ok, map()} | {:error, term()}
```

Lists runs matching a structured query.

Options:

  * `:instance` - Continuum instance name or struct. Defaults to `Continuum`.
  * `:namespace` - run namespace. Defaults to `"default"`.
  * `:where` - list of condition tuples.
  * `:search` - run id or workflow substring convenience filter.
  * `:workflow` - workflow substring convenience filter.
  * `:state` - run state convenience filter.
  * `:order_by` - `{direction, field}`. Defaults to `{:desc, :started_at}`.
  * `:page` and `:per_page` - 1-based pagination; `:per_page` caps at 100.

# `set_attributes`

```elixir
@spec set_attributes(binary(), map(), keyword()) :: :ok | {:error, term()}
```

Merges search attributes into a run row.

Attributes must be JSON-encodable map data. This updates metadata only; it
does not append a journal event.

---

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