ecto_duckdb

A DuckDB Ecto3 adapter.


License
MIT

Documentation

Ecto DuckDB Adapter

A quick-n-dirty Ecto DuckDB Adapter. Uses Exduckdb as the driver to communicate with DuckDB.

Mostly similar to the upstream ecto_sqlite3.

Caveats and limitations

This is mostly a copy/paste from the original fork. DuckDB might support more features that throw errors, or might error on some data types. Use with caution.

Installation

defp deps do
  {:ecto_duckdb, "~> 0.8.0"}
end

Usage

Define your repo similar to this.

defmodule MyApp.Repo do
  use Ecto.Repo, otp_app: :my_app, adapter: Ecto.Adapters.DuckDB
end

Configure your repository similar to the following. If you want to know more about the possible options to pass the repository, checkout the documentation for Ecto.Adapters.SQLite. It will have more information on what is configurable.

config :my_app,
  ecto_repos: [MyApp.Repo]

config :my_app, MyApp.Repo,
  database: "path/to/my/database.db",

Benchmarks

We have some benchmarks comparing it against the MySQL and Postgres adapters.

You can read more about those at bench/README.md.

Running Tests

Running unit tests

mix test

Runing integration tests

EXDUCKDB_INTEGRATION=true mix test