From 97dd0026a134411b7d18ad66fab5d0c8a1488078 Mon Sep 17 00:00:00 2001 From: Mark Gordon Date: Mon, 24 Aug 2026 10:36:02 -0400 Subject: [PATCH] Add engine plugins option --- CHANGELOG.md | 4 ++++ subsetter.example.yaml | 4 ++++ subsetter/_version.py | 2 +- subsetter/common.py | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5f8cdf..61a6f99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# v0.4.6 + +- Added `plugins` option to add custom plugins to sqlalchemy engine (e.g. geoalchemy) + # v0.4.5 - Change `infer_foreign_keys` option to `infer_fks` to match other option names (old name still works) diff --git a/subsetter.example.yaml b/subsetter.example.yaml index 58fa5d3..6c847b5 100644 --- a/subsetter.example.yaml +++ b/subsetter.example.yaml @@ -13,6 +13,10 @@ source: - SET @@session.wait_timeout=28800 - SET @@session.innodb_lock_wait_timeout=3600 + # List of plugins to configure the sqlalchemy engine with + plugins: [] + # - geoalchemy2 + # Set transaction isolation level. Defaults to 'READ COMMITTED' (SERIALIZABLE # for sqlite). isolation_level: "READ COMMITTED" diff --git a/subsetter/_version.py b/subsetter/_version.py index 98a433b..3dd3d2d 100644 --- a/subsetter/_version.py +++ b/subsetter/_version.py @@ -1 +1 @@ -__version__ = "0.4.5" +__version__ = "0.4.6" diff --git a/subsetter/common.py b/subsetter/common.py index dc6cc5d..7651c3b 100644 --- a/subsetter/common.py +++ b/subsetter/common.py @@ -165,6 +165,7 @@ def get_connect_args( isolation_level: Optional[IsolationLevel] = None ssl: SSLConfig = SSLConfig() echo: bool = False + plugins: list[str] = [] def database_url( self, @@ -200,6 +201,7 @@ def database_engine( env_prefix=env_prefix, ), echo=self.echo, + plugins=self.plugins, ) @sa.event.listens_for(engine, "connect")