Xqlite.Result (Xqlite v0.7.0)

View Source

A struct representing the result of a query.

Implements the Table.Reader protocol, making results directly consumable by libraries like Explorer, Kino, VegaLite, etc.

Fields

  • :columns — list of column name strings
  • :rows — list of rows, each row being a list of values
  • :num_rows — number of result rows returned
  • :changes — number of rows modified by the last DML statement (INSERT/UPDATE/DELETE). For SELECT queries this is 0.

Summary

Functions

Converts a raw NIF query result map into a Xqlite.Result struct.

Types

t()

@type t() :: %Xqlite.Result{
  changes: non_neg_integer(),
  columns: [String.t()],
  num_rows: non_neg_integer(),
  rows: [[term()]]
}

Functions

from_map(map)

@spec from_map(%{
  columns: [String.t()],
  rows: [[term()]],
  num_rows: non_neg_integer()
}) :: t()

Converts a raw NIF query result map into a Xqlite.Result struct.