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

Parses PostgREST-style URL parameters into structured ASTs.

Handles filters, select, order, pagination, embed filters (dot-notation),
custom params, on_conflict, and columns.

# `parse`

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

Parses a map of URL query parameters into a structured result.

## Options

  * `:allowed_fields` - list of atoms restricting which fields can be filtered
  * `:max_limit` - integer clamping the maximum limit value

## Returns

  `{:ok, parsed}` where parsed contains:
  * `:filters` - list of filter AST nodes for the root resource
  * `:embed_filters` - map of embed name to list of filter AST nodes
  * `:select` - select AST or nil
  * `:order` - order AST or nil
  * `:limit`, `:offset` - pagination values
  * `:custom_params` - params not matching any known field or standard param
  * `:on_conflict`, `:columns` - upsert-related params

# `parse_operator_value`

```elixir
@spec parse_operator_value(String.t()) :: {:ok, atom(), term()} | {:error, term()}
```

Parses an operator.value string into `{:ok, operator, value}`.

## Examples

    iex> PgRest.Parser.parse_operator_value("eq.active")
    {:ok, :eq, "active"}

    iex> PgRest.Parser.parse_operator_value("in.(a,b,c)")
    {:ok, :in, ["a", "b", "c"]}

---

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