chore(spanner): directly execute queries and wait for first result#5698
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 55675 55691 +16
==========================================
+ Hits 54503 54512 +9
- Misses 1172 1179 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9d3aad9 to
5b2d174
Compare
The addition of a default TLS provider is not directly related to this change, and should go into its own pull request.
a77bdd4 to
79a4422
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