From d549ba497b1830b73b54dda4cd983ddb3114c150 Mon Sep 17 00:00:00 2001 From: Cody Fincher <204685+cofin@users.noreply.github.com> Date: Sun, 17 Sep 2023 22:16:13 +0000 Subject: [PATCH] docs: add directions for `alembic` support --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index f1fcdb8b..8c3394cc 100644 --- a/README.md +++ b/README.md @@ -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