# `Codat.QueryBuilder`
[🔗](https://github.com/iamkanishka/codat.git/blob/v1.0.0/lib/codat/query_builder.ex#L1)

Builder for Codat's query filter language.

## Example

    import Codat.QueryBuilder

    query =
      where("status", :eq, "Open")
      |> and_where("amountDue", :gt, 0)
      |> and_where("customerRef.companyName", :contains, "Acme")
      |> to_query_string()
    # => "status=Open&&amountDue>0&&customerRef.companyName~Acme"

# `clause`

```elixir
@type clause() :: {String.t(), operator(), term()}
```

# `combinator`

```elixir
@type combinator() :: :and | :or
```

# `operator`

```elixir
@type operator() :: :eq | :neq | :gt | :gte | :lt | :lte | :contains
```

# `t`

```elixir
@opaque t()
```

# `and_where`

```elixir
@spec and_where(t(), String.t(), operator(), term()) :: t()
```

Appends an AND clause.

# `from_map`

```elixir
@spec from_map(keyword() | map()) :: String.t()
```

Converts a keyword list or map to a query string using equality filters.

# `operators`

```elixir
@spec operators() :: [operator()]
```

Returns all supported operator atoms.

# `or_where`

```elixir
@spec or_where(t(), String.t(), operator(), term()) :: t()
```

Appends an OR clause.

# `to_query_string`

```elixir
@spec to_query_string(t()) :: String.t()
```

Converts a query struct to the Codat query string format.

# `where`

```elixir
@spec where(String.t(), operator(), term()) :: t()
```

Starts a query with the given equality filter.

---

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