Hrana batch step conditions.
Each batch step may carry a condition gating whether it runs, expressed over
the outcomes of earlier steps and the connection's autocommit state. This is
how libsql clients build transactional batches: BEGIN, then statements
guarded by ok of the previous step, a COMMIT guarded by ok of the last
statement, and a ROLLBACK guarded by not ok of the commit.
Decoded form (tagged terms):
{:ok, step} | {:error, step} | {:not, cond} | {:and, [cond]} |
{:or, [cond]} | :is_autocommit
Summary
Functions
Decodes a Hrana BatchCond map into a tagged condition term.
Evaluates a condition. outcomes is the list of earlier step outcomes indexed
by step number; autocommit? is the connection's current autocommit state.
Types
@type outcome() :: :ok | :error | :skipped
@type t() :: {:ok, non_neg_integer()} | {:error, non_neg_integer()} | {:not, t()} | {:and, [t()]} | {:or, [t()]} | :is_autocommit
Functions
Decodes a Hrana BatchCond map into a tagged condition term.
Evaluates a condition. outcomes is the list of earlier step outcomes indexed
by step number; autocommit? is the connection's current autocommit state.