-
-
Notifications
You must be signed in to change notification settings - Fork 411
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
Executing other queries inside user-defined functions #338
Comments
For the time being I'm using a second |
For the same reason as in #203, it's currently disabled. But in a future version there might be an "expert mode" that can be turned on, for people with these needs. |
Thanks for the reply.
Reading is not disabled anymore, #203 is open because the writing part is still open. But I understand your argument and for now I can workaround it. I'm not sure if SELECT inside user-defined functions can have side-effects I'm not aware of. Anyway, I'm probably one of very few people with that use-case, so add it whenever you feel like it. Be it with or without an expert-mode (which might only be needed for writes, not reads). |
For future reference: I don't think SQLite itself has any issues with doing what is asked here
https://www.sqlite.org/c3ref/create_function.html I'm not familiar with SQLite internals, but that sounds like the list of things you can not do is pretty short? |
Essentially #203, but inside user-defined functions. I didn't wanted to hijack that thread as it is moving in a different direction (mutating stuff).
Assuming SQLite allows that, would it be possible to enable
SELECT
inside user-defined functions? Currently I'm getting "TypeError: This database connection is busy executing a query".My current use-case is a custom caching mechanism. Passing large
BLOB
orTEXT
to a user-defined function is slow (not necessarily the passing, but reading them from disk) and makes the difference between 5000ms and 30ms. If I couldSELECT
inside the user-defined function I could only process the data I need and cache the results of the function for later. The user-defined function would then only accept the id as parameter instead of the data itself.The text was updated successfully, but these errors were encountered: