Configuration
View SourceDuckdbEx is CLI-based. Configuration is primarily environment variables and SQL settings.
Environment Variables
DUCKDB_PATH: path to the DuckDB CLI binary.DUCKDB_EX_EXEC_AS_ROOT: set to1ortrueto run the CLI as root.DUCKDB_VERSION: optional version formix duckdb_ex.install.
Resolution order:
config :duckdb_ex, :duckdb_pathDUCKDB_PATHpriv/duckdb/duckdb(installed CLI in the project when running via Mix)duckdbin PATH/usr/local/bin/duckdb
Application Config
You can pin the CLI path in config (takes precedence over DUCKDB_PATH):
config :duckdb_ex, :duckdb_path, "/opt/duckdb/duckdb"Connection Options
When connecting:
{:ok, conn} = DuckdbEx.Connection.connect("/path/to/db.duckdb", read_only: true)Supported options:
:read_only- open the database in read-only mode.
SQL Configuration
Most runtime configuration is done through SQL:
DuckdbEx.execute("SET threads=4")
DuckdbEx.execute("SET memory_limit='2GB'")Extensions
The CLI supports extensions via SQL:
DuckdbEx.execute("INSTALL httpfs")
DuckdbEx.execute("LOAD httpfs")There are no first-class Elixir wrappers yet; use SQL commands directly.