Lotus.Result (Lotus v0.9.2)

View Source

Represents the result of a SQL query execution.

Contains the columns, rows, and metadata about the query result.

Summary

Functions

Creates a new Result from columns and rows.

Types

t()

@type t() :: %Lotus.Result{
  columns: [String.t()],
  command: String.t() | nil,
  duration_ms: non_neg_integer() | nil,
  meta: map(),
  num_rows: non_neg_integer() | nil,
  rows: [[term()]]
}

Functions

new(columns, rows, opts \\ [])

Creates a new Result from columns and rows.

Examples

iex> Lotus.Result.new(["name", "age"], [["John", 25], ["Jane", 30]])
%Lotus.Result{
  columns: ["name", "age"],
  rows: [["John", 25], ["Jane", 30]],
  num_rows: 2,
  duration_ms: nil,
  command: nil,
  meta: %{}
}