# `Beancount.Query.Result`
[🔗](https://github.com/thanos/beancount_ex/blob/v0.6.0/lib/beancount/query/result.ex#L1)

Neutral, engine-independent result of a BQL query.

Like `Beancount.Result`, this struct is populated identically by the CLI
engine today and by any future native engine, so query output can be compared
across backends (see `Beancount.Compare` and the oracle strategy guide).

Fields:

  * `:columns` - ordered list of column names.
  * `:rows` - list of rows; each row is a list of string cells aligned with
    `:columns`. Values are kept as raw strings here; higher-level helpers
    (`Beancount.Report`) and the optional Explorer bridge handle typing.
  * `:raw` - the raw output (CSV) returned by the engine, for debugging.
  * `:status` - always `:ok` for a successful query.

# `row`

```elixir
@type row() :: [String.t()]
```

# `t`

```elixir
@type t() :: %Beancount.Query.Result{
  columns: [String.t()],
  raw: binary(),
  rows: [row()],
  status: :ok
}
```

# `to_maps`

```elixir
@spec to_maps(t()) :: [map()]
```

Convert the result into a list of maps keyed by column name.

## Examples

    iex> result = %Beancount.Query.Result{
    ...>   columns: ["account", "balance"],
    ...>   rows: [["Assets:Bank", "5000 USD"]]
    ...> }
    iex> Beancount.Query.Result.to_maps(result)
    [%{"account" => "Assets:Bank", "balance" => "5000 USD"}]

---

*Consult [api-reference.md](api-reference.md) for complete listing*
