Filo.Describe (Filo v0.2.0)

Copy Markdown View Source

The result of a Hrana describe request: the parameters and columns of a prepared statement, plus whether it is an EXPLAIN and whether it is read-only. The libSQL client uses this to learn a statement's shape (e.g. how many parameters to bind) before executing it.

A host executor fills this struct; encode/1 produces the Hrana DescribeResult map. params are parameter names (nil for an unnamed positional ?). cols may be bare column-name strings or %{name: ..., decltype: ...} maps, matching Filo.StmtResult.

Summary

Functions

Encodes a Filo.Describe into a Hrana DescribeResult map.

Types

col()

@type col() :: String.t() | %{name: String.t(), decltype: String.t() | nil}

param()

@type param() :: String.t() | nil

t()

@type t() :: %Filo.Describe{
  cols: [col()],
  is_explain: boolean(),
  is_readonly: boolean(),
  params: [param()]
}

Functions

encode(describe)

@spec encode(t()) :: map()

Encodes a Filo.Describe into a Hrana DescribeResult map.