Filo.BatchResult (Filo v0.2.0)

Copy Markdown View Source

The result of executing a batch, encoded to a Hrana BatchResult.

Per step there is either a Filo.StmtResult (the step ran and succeeded), a Filo.Error (it ran and failed), or nil (its condition was false and it was skipped) — tracked positionally in step_results and step_errors.

Summary

Functions

Encodes a Filo.BatchResult into a Hrana BatchResult map.

Types

t()

@type t() :: %Filo.BatchResult{
  step_errors: [Filo.Error.t() | nil],
  step_results: [Filo.StmtResult.t() | nil]
}

Functions

encode(result, opts \\ [])

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

Encodes a Filo.BatchResult into a Hrana BatchResult map.

Options pass through to Filo.StmtResult.encode/2 per step — rows: :json gives each step's rows as a pre-encoded Jason.Fragment (the JSON transports' fast path; the protobuf paths keep the default :maps).