chore(spanner): directly execute queries and wait for first result#5698
chore(spanner): directly execute queries and wait for first result#5698olavloite wants to merge 5 commits into
Conversation
This changes the way that queries are executed on Spanner from a model that uses a background task to read from the query stream, to a model that directly calls ExecuteStreamingSql when execute_query is called, and then waits for the first PartialResultSet or error to be received. This ensures that execute_query really executes the query and returns any errors that happens during query execution. Closes googleapis#5685 Fixes googleapis#5673
There was a problem hiding this comment.
Code Review
This pull request refactors the ResultSet implementation to handle metadata initialization more robustly, replacing the background worker pattern with an explicit init_stream method. It also introduces ExplicitBeginParams to streamline transaction initialization and adds rustls as a dependency for secure connections. The reviewer suggests explicitly handling the Result from the rustls provider installation and refactoring redundant metadata logic in ResultSet to improve maintainability.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5698 +/- ##
==========================================
- Coverage 97.89% 97.88% -0.02%
==========================================
Files 226 226
Lines 55536 55552 +16
==========================================
+ Hits 54368 54378 +10
- Misses 1168 1174 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9d3aad9 to
5b2d174
Compare
This changes the way that queries are executed on Spanner from a model that uses a background task to read from the query stream, to a model that directly calls ExecuteStreamingSql when execute_query is called, and then waits for the first PartialResultSet or error to be received. This ensures that execute_query really executes the query and returns any errors that happens during query execution.
Closes #5685
Fixes #5673