-
Notifications
You must be signed in to change notification settings - Fork 33
Add prepared statement cache to Sqlitex.Server. #53
Add prepared statement cache to Sqlitex.Server. #53
Conversation
We'll use this soon in Sqlitex.Server. Coverage: 100%.
Refactor to make it work anyway.
|
Thanks for the PR! Can you provide some context on the use-case for this cache? I would hazard a guess that it's performance related, but I haven't used this library in any high-volume applications so I don't have any context for why this helps with performance. |
|
Should we document how to use a statement that has been prepared by It looks from the code that I would need to call prepare with the SQL string and then any future calls to Maybe a docstring on the |
|
Yes, that makes sense. I'll add such documentation later today or tomorrow. (I'm at work today and this project lives on my personal laptop, which is at home.) |
|
@mmmries This is here to support the sqlite_ecto2 effort. Ecto really really wants to have the summary information about the prepared statement and also the signal about whether the statement would compile at all when it calls the DbConnection I tried using the Sqlitex module directly in my DbConnection implementation, but that led to a different set of issues (crashes in the |
|
@obmarg Agree that the "typical" definition of |
|
@obmarg Added docstring on |
|
Thanks @scouten for working on the ecto side of things. Hopefully the usage of |
|
released as 1.2.0 🎉 💙 💚 ❤️ 💛 |
Also adds a new function call
preparewhich prepares the SQL statement, adds it to the cache, and returns information about the query to the calling process. To protect encapsulation across processes, it does not return any direct reference to the prepared statement itself.