Feat/prepare execute simple query#409
Conversation
Add documentation explaining how handlers can access portal store statements for implementing PREPARE/EXECUTE in the simple query protocol. This enables sharing of prepared statements between simple and extended query protocols through downcasting of the portal store's statement type. Amp-Thread-ID: https://ampcode.com/threads/T-019c8b05-dedd-70ce-a89a-673841929957 Co-authored-by: Amp <amp@ampcode.com>
Add a TypeId-keyed extension store to ClientInfo, enabling hooks and handlers to store arbitrary per-session state with automatic cleanup on disconnect. Uses interior mutability (RwLock) so it is accessible from &dyn ClientInfo without requiring mutable access.
|
Can you please review this @sunng87 ? |
| /// Per-connection typed extension store, keyed by `TypeId`. | ||
| /// | ||
| /// Allows hooks and handlers to store arbitrary per-session state that is | ||
| /// automatically cleaned up when the connection closes. Uses interior | ||
| /// mutability so it can be accessed from `&dyn ClientInfo`. |
There was a problem hiding this comment.
Did not want to do Any -> so relied on TypeId for now.
The assumption is that we will not have two values of same type.
type T being used in prepare_execute is -
type PreparedStatements = RwLock<HashMap<String, PreparedStatementInfo>>;
|
@TwistingTwists Thank you! I'm just back from vacation. Will look into this soon. |
|
ran |
54819f6 to
eaa2a42
Compare
|
hello @TwistingTwists , I think we can reuse the |
|
Update: still trying to figure out a good solution to use |
Sister PR for: datafusion-contrib/datafusion-postgres#298