# `Adbc.Result`
[🔗](https://github.com/elixir-explorer/adbc/blob/v0.9.0/lib/adbc_result.ex#L28)

A struct returned as result from queries.

It has two fields:

  * `:data` - a list of `Adbc.Column`. The `Adbc.Column` may
    not yet have been materialized

  * `:num_rows` - the number of rows returned, if returned
    by the database

# `t`

```elixir
@type t() :: %Adbc.Result{data: [Adbc.Column.t()], num_rows: non_neg_integer() | nil}
```

# `from_py`

Consumes Arrow data from a Python object that implements the
[ArrowStream Export interface](https://arrow.apache.org/docs/format/CDataInterface/PyCapsuleInterface.html#arrowstream-export).

The interface is typically implemented for dataframe objects, including
ones from Pandas and Polars.

It returns an ok-tuple with `Adbc.Result` or an error-tuple.
You often want to call `Adbc.Result.materialize/1` or
`Adbc.Result.to_map/1` on the results to consume it.

# `materialize`

```elixir
@spec materialize(
  %Adbc.Result{data: term(), num_rows: term()}
  | {:ok, %Adbc.Result{data: term(), num_rows: term()}}
  | {:error, String.t()}
) ::
  %Adbc.Result{data: term(), num_rows: term()}
  | {:ok, %Adbc.Result{data: term(), num_rows: term()}}
  | {:error, String.t()}
```

`materialize/1` converts the result set's data from reference type to regular Elixir terms.

# `to_map`

Returns a map of columns as a result.

---

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