README.md

# Ecto DuckDB Adapter

A quick-n-dirty Ecto DuckDB Adapter. Uses [Exduckdb](https://github.com/mpope9/exduckdb)
as the driver to communicate with DuckDB.

Mostly similar to the upstream [ecto_sqlite3](https://github.com/elixir-sqlite/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

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

## Usage

Define your repo similar to this.

```elixir
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`](https://hexdocs.pm/ecto_sqlite3/). It will have
more information on what is configurable.

```elixir
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](bench/README.md).

## Running Tests

Running unit tests

```sh
mix test
```

Runing integration tests

```sh
EXDUCKDB_INTEGRATION=true mix test
```