# `Ch.Query`
[🔗](https://github.com/plausible/ch/blob/v0.8.2/lib/ch/query.ex#L1)

Query struct wrapping the SQL statement.

# `command`

```elixir
@type command() ::
  :undrop
  | :move
  | :watch
  | :use
  | :truncate
  | :set
  | :exchange
  | :rename
  | :optimize
  | :kill
  | :exists
  | :drop
  | :detach
  | :describe
  | :check
  | :attach
  | :update
  | :revoke
  | :explain
  | :grant
  | :select
  | :show
  | :system
  | :delete
  | :alter
  | :create
  | :insert
  | :select
```

Atom representing the type of SQL command.

Derived automatically from the start of the SQL statement (e.g., `"SELECT ..."` -> `:select`),
or provided explicitly via options.

# `t`

```elixir
@type t() :: %Ch.Query{
  command: command(),
  decode: boolean(),
  encode: boolean(),
  multipart: boolean(),
  statement: iodata()
}
```

The Query struct.

## Fields

  * `:statement` - The SQL statement to be executed (as `t:iodata/0`).
  * `:command` - The detected or enforced SQL command type (e.g., `:select`, `:insert`).
  * `:encode` - Whether to encode parameters (defaults to `true`).
  * `:decode` - Whether to decode the response (defaults to `true`).
  * `:multipart` - Whether to use `multipart/form-data` for the request (defaults to `false`).

---

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