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

Python API ability to opt-out of connection plugins #575

Closed
simonw opened this issue Jul 22, 2023 · 2 comments
Closed

Python API ability to opt-out of connection plugins #575

simonw opened this issue Jul 22, 2023 · 2 comments
Labels

Comments

@simonw
Copy link
Owner

simonw commented Jul 22, 2023

Plugins affecting the CLI by default makes sense to me.

I'm less confident about them always affecting users of the Python API.

I'm going to have them apply by default, but I'm going to add a mechanism to opt-out on an individual database basis. Basically this:

from sqlite_utils import Database
db = Database(memory=True, execute_plugins=False)
# Anything using db from here on will not execute plugins

cc @asg017

Refs:

@simonw
Copy link
Owner Author

simonw commented Jul 22, 2023

Relevant code:

pm.hook.prepare_connection(conn=self.conn)

@simonw
Copy link
Owner Author

simonw commented Jul 22, 2023

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

No branches or pull requests

1 participant