# `Adbc.Result`
[🔗](https://github.com/elixir-explorer/adbc/blob/v0.11.0/lib/adbc/result.ex#L118)

A struct returned as result from queries.

It has two fields:

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

  * `:data` - a private field that stores the returned
    `Adbc.Column`s. Use `to_columns/1` to convert to a public format

# `t`

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

# `from_ipc_stream`

```elixir
@spec from_ipc_stream(binary()) :: {:ok, t()} | {:error, Adbc.Error.t()}
```

Load an `Adbc.Result` from in-memory IPC stream data.

# `from_ipc_stream!`

```elixir
@spec from_ipc_stream!(binary()) :: t()
```

Same as `from_ipc_stream/1` but raises on error.

# `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.

# `from_py!`

Same as `from_py/1` but raises on error.

# `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_columns`

Returns a map of columns as `Adbc.Column` without materializing them.

# `to_map`

Returns a map of columns as a result.

---

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