Skip to content

Commit

Permalink
updated CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cocoa-xu committed Jun 23, 2024
1 parent 76654e6 commit b04da6e
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,52 @@
#### Breaking changes
* To avoid allocating data twice for inputs, the results now by default will return references in the data field of `Adbc.Column`.

If you need to use the in the Elixir world, you can use `Adbc.Result.materialize/1` and
If you need to use them in the Elixir world, you can use `Adbc.Result.materialize/1` and
`Adbc.Column.materialize/1` to convert the data to regular Elixir terms.

```elixir
iex> {:ok, results} = Connection.query(conn, "SELECT 123 as num, 456.78 as fp")
{:ok,
results = %Adbc.Result{
data: [
%Adbc.Column{
name: "num",
type: :s64,
metadata: nil,
nullable: true,
data: [#Reference<0.351247108.3006922760.20174>]
},
%Adbc.Column{
name: "fp",
type: :f64,
metadata: nil,
nullable: true,
data: [#Reference<0.351247108.3006922760.20175>]
}
],
num_rows: nil
}}
iex> Adbc.Result.materialize(results)
%Adbc.Result{
data: [
%Adbc.Column{
name: "num",
type: :s64,
nullable: true,
metadata: nil,
data: [123]
},
%Adbc.Column{
name: "fp",
type: :f64,
nullable: true,
metadata: nil,
data: [456.78]
}
]
}
```

## v0.5.0

#### Breaking changes
Expand Down

0 comments on commit b04da6e

Please sign in to comment.