Skip to content

Commit

Permalink
docs: add directions for alembic support
Browse files Browse the repository at this point in the history
  • Loading branch information
cofin committed Sep 17, 2023
1 parent c8840a4 commit d549ba4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,23 @@ The `pandas.read_sql()` method can read tables from `duckdb_engine` into DataFra

Unsigned integers are supported by DuckDB, and are available in [`duckdb_engine.datatypes`](duckdb_engine/datatypes.py).

## Alembic Integration

SQLAlchemy's companion library `alembic` can optionally be used to manage database migrations.

This support can be enabling by adding an Alembic implementation class for the `duckdb` dialect.

```python
from alembic.ddl.impl import DefaultImpl

class AlembicDuckDBImpl(DefaultImpl):
"""Alembic implementation for DuckDB."""

__dialect__ = "duckdb"
```

After loading this class with your program, Alembic will no longer raise an error when generating or applying migrations.

## Preloading extensions (experimental)

Until the DuckDB python client allows you to natively preload extensions, I've added experimental support via a `connect_args` parameter
Expand Down

0 comments on commit d549ba4

Please sign in to comment.