# `PgRest.Select`
[🔗](https://github.com/agoodway/pgrest/blob/v0.1.0/lib/pg_rest/select.ex#L1)

Applies parsed select AST to Ecto queries.

Supports:
- Field selection on the root resource
- Embed preloading with optional field selection
- Embed filtering via preload queries
- `!inner` joins for top-level filtering by associated data
- Anti-joins via left join + is_nil check
- Nested embeds (recursive preload structures)
- Embed aliasing (renaming association keys in response)

# `apply_select`

```elixir
@spec apply_select(Ecto.Queryable.t(), [map()] | nil, module(), map(), map()) ::
  Ecto.Queryable.t() | Ecto.Query.t()
```

Applies the parsed select AST to an Ecto query.

Splits the AST into root-level field selections and embed preloads,
then applies each to the query using Ecto's `select/3` and `preload/3`.

---

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