
6/28/2024 · Andrew Repp
What this post added
Added support for Postgres protocol-level named prepared statements in Hyperdrive. This involved deep dives into the Postgres Message Protocol, specifically the extended query flow involving Parse, Bind, Execute, and Sync messages. Challenges included buffering messages for caching, managing session scope of prepared statements within a pooled connection environment, and implementing logic to handle four scenarios: Parse with cache hit, Parse with cache miss, Reuse with cache hit, and Reuse with cache miss. Utilized Rust data structures like HashMap, LruCaches, and VecDeque for efficient message management.