Skip to content

Feature/format requirements#17

Closed
general-kroll-4-life wants to merge 4 commits intomainfrom
feature/format-requirements
Closed

Feature/format requirements#17
general-kroll-4-life wants to merge 4 commits intomainfrom
feature/format-requirements

Conversation

@general-kroll-4-life
Copy link
Copy Markdown
Contributor

No description provided.

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
@general-kroll-4-life general-kroll-4-life deleted the feature/format-requirements branch April 4, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant