diff --git a/c_src/value_to_term.cpp b/c_src/value_to_term.cpp index 1e537b5..68a0081 100644 --- a/c_src/value_to_term.cpp +++ b/c_src/value_to_term.cpp @@ -190,6 +190,7 @@ bool nif::value_to_term(ErlNifEnv* env, const duckdb::Value& value, ERL_NIF_TERM sink = make_binary_term(env, varchar.c_str(), varchar.size()); return true; } + case duckdb::LogicalTypeId::ARRAY: case duckdb::LogicalTypeId::LIST: { auto& list = duckdb::ListValue::GetChildren(value); std::vector term_array(list.size()); diff --git a/mix.exs b/mix.exs index b00304c..c5f717a 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Duckdbex.MixProject do use Mix.Project - @version "0.3.0" + @version "0.3.1" @duckdb_version "1.0.0" def project do diff --git a/test/nif/types_test.exs b/test/nif/types_test.exs index 57036ef..48b97d6 100644 --- a/test/nif/types_test.exs +++ b/test/nif/types_test.exs @@ -378,6 +378,13 @@ defmodule Duckdbex.Nif.QueryTest do assert [] = NIF.fetch_all(r) end + test "ARRAY", %{conn: conn} do + assert {:ok, _} = NIF.query(conn, "CREATE TABLE an_array(embeddings FLOAT[3])") + assert {:ok, _} = NIF.query(conn, "INSERT INTO an_array VALUES ([1, 2, 3])") + assert {:ok, r} = NIF.query(conn, "SELECT * FROM an_array") + assert [[[1.0, 2.0, 3.0]]] = NIF.fetch_all(r) + end + test "MAP", %{conn: conn} do assert {:ok, r} = NIF.query(conn, "select map();") assert [[%{}]] = NIF.fetch_all(r)