Open
Conversation
65b446a to
6eaca5b
Compare
9d5f0cd to
61610de
Compare
mpetazzoni
requested changes
Feb 26, 2026
… pattern Implement connection-level progress reporting as a PEP 249 vendor extension: - ProgressInfo NamedTuple and ProgressHandler type alias in connection.py - set_progress_handler(handler) method on Connection - Automatically sends enable_progress_events: true when handler is set - Handles execution_progress WebSocket events independently of the query state machine, with exception isolation - Export ProgressInfo from wherobots.db - Add --progress flag to tests/smoke.py for manual testing with rich output
61610de to
0a41d31
Compare
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.
Summary
Add
Connection.set_progress_handler()that lets callers receive real-time execution progress events from the SQL session.When a handler is registered,
execute_sqlrequests automatically includeenable_progress_events: true. The server streamsexecution_progressevents with task counts, and the SDK dispatches them to the user's callback. PassNoneto disable.This is a backwards-compatible change. The SDK can safely send
enable_progress_events: trueto older server versions that don't support it — the unknown field is silently ignored and queries execute normally. Progress events are best-effort: depending on the server version and query type, the handler may not be invoked.Companion server-side PR: https://github.com/wherobots/sql-session/pull/189
Related Issues
Relates to sql-session#189
Requester Checklist
Complete these before marking Ready for Review
Visual Proof
Tested end-to-end on staging with a custom image built from the sql-session
peter/execution-progressbranch:Without
--progress(baseline — no regression):With
--progress(progress events flowing):Backwards compatibility (against current released staging, no custom image):
Size Justification (if L/XL)
N/A — small PR (+83/-2 lines across 4 files)
Reviewer Checklist
If these are not met, close the tab — this PR is not ready for review