Skip to content
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

Add engine_adapter_callback #1919

Draft
wants to merge 1 commit into
base: devel
Choose a base branch
from
Draft

Conversation

umar-ahmed
Copy link

@umar-ahmed umar-ahmed commented Oct 3, 2024

Description

  • Adds engine_adapter_callback that is executed after the SQLAlchemy engine is constructed
  • This allows developers to apply any arbitrary statements before subsequent queries are issued
  • In particular, I want to be able to run SET workload = "olap"; to connect to a Planetscale DB without bumping into 100k rows returned system limits.

Related Issues

  • Fixes #...
  • Closes #...
  • Resolves #...

Additional Context

Copy link

netlify bot commented Oct 3, 2024

Deploy Preview for dlt-hub-docs canceled.

Name Link
🔨 Latest commit b263900
🔍 Latest deploy log https://app.netlify.com/sites/dlt-hub-docs/deploys/66fde5afe23a9d00081b808a

@rudolfix
Copy link
Collaborator

rudolfix commented Oct 6, 2024

@umar-ahmed sql_database and sql_table accept Engine instance in credentials. So you can create your own, run anything on it and then pass it to dlt. OFC having this callback is more convenient because you do not need to handle credentials yourself. if you plan to continue this PR we will also need a simple test where you verify that adapter receives engine instance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants