A decoded Hrana batch: an ordered list of steps, each a statement with an
optional condition. run/3 executes the steps in order, gating each on its
condition, and collects a Filo.BatchResult.
Summary
Types
Reports the connection's current autocommit state.
Runs one statement against the underlying connection.
Functions
Decodes a Hrana Batch map into a Filo.Batch struct.
Runs each step in order, gated by its condition, returning a Filo.BatchResult.
Types
@type autocommit_fun() :: (-> boolean())
Reports the connection's current autocommit state.
@type exec_fun() :: (Filo.Stmt.t() -> {:ok, Filo.StmtResult.t()} | {:error, Filo.Error.t()})
Runs one statement against the underlying connection.
@type step() :: %{condition: Filo.BatchCond.t() | nil, stmt: Filo.Stmt.t()}
@type t() :: %Filo.Batch{steps: [step()]}
Functions
Decodes a Hrana Batch map into a Filo.Batch struct.
@spec run(t(), exec_fun(), autocommit_fun()) :: Filo.BatchResult.t()
Runs each step in order, gated by its condition, returning a Filo.BatchResult.
exec_fun runs one statement; autocommit_fun reports the connection's current
autocommit state, consulted by any is_autocommit conditions. A step whose
condition is false is skipped — nil in both result and error positions.