Ch.Query (Ch v0.7.0)

View Source

Query struct wrapping the SQL statement.

Summary

Types

Atom representing the type of SQL command.

t()

The Query struct.

Types

command()

@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()

@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 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).