-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
Mechanism for de-registering registered SQL functions #589
Comments
For that particular case I realized I'd quite like to have a mechanism for applying functions for a block of code and then de-registering them at the end - a context manager. I played with this idea a bit: with db.register_functions(md5, md5_random):
db.query(...) |
Normally in Python/ You can't do that with sqlite-utils/sqlite_utils/db.py Lines 461 to 464 in 1260bdc
|
Here's a prototype: 62f6738 Still needs tests and documentation (and some more thought to make sure it's doing the right thing). |
I used a custom SQL function in a migration script and then realized that it should be de-registered before the end of the script to avoid leaking into the calling code.
The text was updated successfully, but these errors were encountered: