Skip to content

Commit

Permalink
Merge pull request #782 from cofin/alembic-readme
Browse files Browse the repository at this point in the history
docs: add directions for `alembic` integration
  • Loading branch information
Mause authored Sep 18, 2023
2 parents c8840a4 + d549ba4 commit 4aae0d2
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 4aae0d2

Please sign in to comment.