Closed
Conversation
Extended query protocol support with error recovery
Summary:
- Implement full extended query protocol (Parse, Bind, Describe, Execute,
Close, Sync, Flush) with proper wire message parsing and serialization
- Add IExtendedQueryBackend interface with opt-in support via type assertion;
DefaultExtendedQueryBackend delegates to simple query path for backwards compat
- Restructure command loop: ReadyForQuery sent once initially, then only after
SimpleQuery completion and Sync (per PostgreSQL protocol spec)
- Add error state tracking: after extended query failure, discard messages until
Sync, then send ReadyForQuery('E') matching PostgreSQL behavior
- Fix ClientClose ('C') to close prepared statements/portals, not the connection;
connection close moved to ClientTerminate ('X') where it belongs
- Add text format bypass in Column.Write: string/[]byte sources write raw bytes
directly, preserving exact backend representation (e.g. sqlite "t"/"f" for bools)
- Thread resultFormats from Bind through to RowDescription and data encoding,
supporting per-column text/binary format selection per protocol spec
- Per-connection PreparedStatement and Portal caches
- Enable previously disabled pgx query test
- Add comprehensive test coverage: extended query happy path, error recovery
(Parse/Bind/Describe/Execute errors), statement/portal lifecycle, multiple
Sync recovery, simple query after extended query error, text bypass
preservation, resolveResultFormat protocol rules, sqlbackend unit tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.