Filo.Stmt (Filo v0.2.0)

Copy Markdown View Source

A decoded Hrana statement.

Hrana statements carry SQL (or a sql_id referencing a previously stored statement), positional args, named_args, and a want_rows flag. Argument values are decoded from Hrana into native terms via Filo.Value; named arguments keep the client's parameter name verbatim (e.g. ":a") so the host executor can bind them however its engine expects.

Summary

Functions

Decodes a Hrana Stmt map into a Filo.Stmt struct.

Types

t()

@type t() :: %Filo.Stmt{
  args: [Filo.Value.native()],
  named_args: [{String.t(), Filo.Value.native()}],
  sql: String.t() | nil,
  sql_id: integer() | nil,
  want_rows: boolean()
}

Functions

decode(stmt)

@spec decode(map()) :: t()

Decodes a Hrana Stmt map into a Filo.Stmt struct.