# `Incant.Ecto`
[🔗](https://github.com/elixir-vibe/incant/blob/v0.1.1/lib/incant/ecto.ex#L1)

Small Ecto helpers for application-owned Incant resource queries.

Applications retain ownership of filtering, joins, projections, and
authorization. These helpers only apply normalized table sorting and exact
offset pagination.

# `page`

```elixir
@type page() :: %{
  page: pos_integer(),
  page_size: pos_integer(),
  total: non_neg_integer(),
  total_pages: pos_integer()
}
```

# `page`

```elixir
@spec page(Ecto.Queryable.t(), module(), map()) :: {Ecto.Query.t(), page()}
```

Counts, clamps, and applies exact offset pagination to a query.

# `sort`

```elixir
@spec sort(Ecto.Queryable.t(), map(), [atom()], keyword()) :: Ecto.Query.t()
```

Applies an allowlisted table sort with a deterministic tie-breaker.

---

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