Skip to main content

lib/ex_sql/result.ex

defmodule ExSQL.Result do
  @moduledoc """
  The result of executing one statement.

  For `SELECT`, `columns` holds the output column names and `rows` the
  result rows as value lists. For DML, `rows_affected` reports the count of
  inserted/updated/deleted rows.
  """

  defstruct command: nil, columns: [], rows: [], rows_affected: 0, affinities: []

  @type t :: %__MODULE__{
          command: atom(),
          columns: [String.t()],
          rows: [[ExSQL.Value.t()]],
          rows_affected: non_neg_integer(),
          affinities: [ExSQL.AST.ColumnDef.affinity()]
        }
end