Skip to content

feat(spanner): support directed reads#5446

Open
olavloite wants to merge 1 commit intogoogleapis:mainfrom
olavloite:spanner-directed-reads
Open

feat(spanner): support directed reads#5446
olavloite wants to merge 1 commit intogoogleapis:mainfrom
olavloite:spanner-directed-reads

Conversation

@olavloite
Copy link
Copy Markdown
Contributor

Add support for setting DirectedReadOptions for SQL statements and read operations.

@olavloite olavloite requested review from a team as code owners April 17, 2026 08:20
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label Apr 17, 2026
Comment thread src/spanner/src/client.rs
pub use crate::from_value::{ConvertError, FromValue};
pub use crate::key::{Key, KeyRange, KeySet, KeySetBuilder};
pub use crate::model::DirectedReadOptions;
pub use crate::model::directed_read_options;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dbolduc I would like your opinion on this: DirectedReadOptions contains multiple nested options. Should we expose the module like this? The advantage being that any potential new option that is added to the module in the future will automatically also be exposed? Or should we explicitly list the nested options?
We would want to expose all nested options as it is today, and I also do not foresee any options that we might add in the future that we would not want to expose here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to expose here

Here is not the right place.

We can expose them in a pub mod crate::model instead of from the mod crate::client.


Do you only want to expose a subset of the types in the generated mod model? You can pick and choose things to export in the src/lib.rs. src/storage/src/lib.rs might be inspiring.

Also, there are generator options to skip generating a message or RPC. I think there is also an option to generate a message as pub(crate) if it is only used internally. (We can also add new generator options if needed).

With that being said, there is not any maintenance burden associated with exposing a generated model type we don't use in our API. It is just ideal not to do that.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.74%. Comparing base (d647e58) to head (a334694).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5446   +/-   ##
=======================================
  Coverage   97.74%   97.74%           
=======================================
  Files         216      216           
  Lines       47549    47559   +10     
=======================================
+ Hits        46477    46488   +11     
+ Misses       1072     1071    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Add support for setting DirectedReadOptions for SQL statements and read operations.
@olavloite olavloite force-pushed the spanner-directed-reads branch from aeaf064 to a334694 Compare April 17, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the Spanner API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants