-
Notifications
You must be signed in to change notification settings - Fork 439
feat/3187 add engine args sqlalchemy source and destination #3414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devel
Are you sure you want to change the base?
feat/3187 add engine args sqlalchemy source and destination #3414
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
docs | cbf342d | Commit Preview URL Branch Preview URL |
Jan 06 2026, 02:52 PM |
rudolfix
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is really good! let's look at existing test fixtures tomorrow
| return engine_.connect() | ||
|
|
||
| def return_conn(self, borrowed_conn: "Connection") -> None: | ||
| if getattr(self, "_conn_owner", None) is False: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like passing external engine here never worked before... we need to test it well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i added that passsing built engine is not disposed after use
dlt/sources/sql_database/__init__.py
Outdated
| engine_kwargs = engine_kwargs or {} | ||
| engine = engine_from_credentials( | ||
| credentials, | ||
| False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be good to pass may_dispose_after_use here
| table_name="inmemory_table" | ||
| ) | ||
|
|
||
| assert_load_info(info) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd check if engine is not disposed after use in the pipeline
|
|
||
| def test_engine_kwargs_timeout_is_honored_sqlite(): | ||
| """SQLite timeout in engine_kwargs must be honored.""" | ||
| fd, db_path = tempfile.mkstemp(suffix=".db") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have a test storage which is automatically cleared.
f6bf24a to
3a137ba
Compare
Fix documentation for inmemory sqlite destination and add test for it.
file based database.
…tests. There will be only sqlite and mysql
files for windows and linux (passes for macos)
…vs external engines
5efbc8a to
7dc1520
Compare
ed30b66 to
d168f45
Compare
3e4243a to
cbf342d
Compare
Description
dlt users want to pass SQLAlchemy engine arguments for:
Summary of Changes
This PR introduces support for configuring SQLAlchemy engine arguments across both sources and destinations, addressing a long-standing usability gap:
Sources (
sql_database,sql_table)engine_kwargs, forwarded directly tosqlalchemy.create_engine().Destination (SQLAlchemy)
engine_args.engine_args.Documentation
engine_kwargs.engine_args.Question: To reduce user confusion, should the source parameter be named
engine_kwargs(current) or unified asengine_args(matching the destination)?Related Issues