Optional Explorer integration for QuackDB results.
This module requires the optional :explorer dependency at runtime. It materializes
QuackDB query results in Elixir and then builds an Explorer.DataFrame.
It is not a zero-copy Arrow IPC path.
Summary
Functions
Runs a QuackDB query and returns an Explorer.DataFrame.
Runs a QuackDB query and returns an Explorer.DataFrame, raising on error.
Converts a QuackDB.Columns struct into an Explorer.DataFrame.
Converts a QuackDB.Columns struct into an Explorer.DataFrame, raising on error.
Converts a QuackDB.Result into an Explorer.DataFrame.
Converts a QuackDB.Result into an Explorer.DataFrame, raising on error.
Appends an Explorer.DataFrame to a DuckDB table through Quack's native append protocol.
Appends an Explorer.DataFrame to a DuckDB table, raising on error.
Types
@type insert_dataframe_option() :: {:columns, list()} | {:batch_size, pos_integer()} | {:schema, String.t()}
Functions
@spec dataframe(DBConnection.conn(), iodata() | term(), [term()] | Keyword.t(), [ dataframe_option() ]) :: {:ok, Explorer.DataFrame.t()} | {:error, Exception.t()}
Runs a QuackDB query and returns an Explorer.DataFrame.
The query can be raw SQL iodata or an Ecto query. Use :query to pass
QuackDB query options and :dataframe to pass options to
Explorer.DataFrame.new/2.
@spec dataframe!(DBConnection.conn(), iodata(), [term()], [dataframe_option()]) :: Explorer.DataFrame.t()
Runs a QuackDB query and returns an Explorer.DataFrame, raising on error.
@spec from_columns(QuackDB.Columns.t(), Keyword.t()) :: {:ok, Explorer.DataFrame.t()} | {:error, Exception.t()}
Converts a QuackDB.Columns struct into an Explorer.DataFrame.
Options are passed to Explorer.DataFrame.new/2.
@spec from_columns!(QuackDB.Columns.t(), Keyword.t()) :: Explorer.DataFrame.t()
Converts a QuackDB.Columns struct into an Explorer.DataFrame, raising on error.
@spec from_result(QuackDB.Result.t(), Keyword.t()) :: {:ok, Explorer.DataFrame.t()} | {:error, Exception.t()}
Converts a QuackDB.Result into an Explorer.DataFrame.
@spec from_result!(QuackDB.Result.t(), Keyword.t()) :: Explorer.DataFrame.t()
Converts a QuackDB.Result into an Explorer.DataFrame, raising on error.
@spec insert_dataframe( DBConnection.conn(), String.t() | atom(), Explorer.DataFrame.t(), Keyword.t() ) :: {:ok, QuackDB.Result.t()} | {:error, Exception.t()}
Appends an Explorer.DataFrame to a DuckDB table through Quack's native append protocol.
This uses QuackDB.insert_columns/4 to preserve Explorer's columnar shape and
avoid row materialization. Pass :columns to override inferred DuckDB types.
:batch_size and :schema are forwarded to QuackDB.insert_columns/4.
@spec insert_dataframe!( DBConnection.conn(), String.t() | atom(), Explorer.DataFrame.t(), Keyword.t() ) :: QuackDB.Result.t()
Appends an Explorer.DataFrame to a DuckDB table, raising on error.