feat: handling of named prepared statements #207
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces support for prepared named statements in transaction mode.
Supavisor attempts to decode all incoming queries from connected users and retrieves the SQL statement by parsing the decoded queries through an existing Rustler wrapper around
libpg_query
. When the parsed query containsPrepareStmt
orDeallocateStmt
(which requires removing an existing named statement), theClientHandler
broadcasts it to all otherDbHandlers
in the pool.In
DbHandler
, these queries accumulate in theanon_buffer
list and will be applied whendata.caller
isnil
. They will wait until the current PID is unlinked in cases where the process is reserved by another client