-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support Directed Read in Connection API #2855
Conversation
Adds support for setting Directed Read options in the Connection API. The value must be a valid JSON representation of a DirectedReadOptions protobuf instance.
google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/DirectedReadTest.java
Outdated
Show resolved
Hide resolved
} | ||
} | ||
|
||
private void executeQuery(Connection connection) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to name it executeReadQuery?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why you feel that. It calls the method executeQuery
. Or am I missing something here?
If any, I would maybe otherwise suggest executeQueryAndConsumeResults
(the latter is why I put it in a separate method, so we didn't have to repeat the empty while(resultSet.next())
block in every test method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated this method and added two more methods for executing both a read query and a DML query to ensure that we do the right thing in both cases.
(The original implementation did not do the right thing, as it would also include DirectedReadOptions for DML statements in auto-commit mode)
Adds support for setting Directed Read options in the Connection API. The value must be a valid JSON representation of a DirectedReadOptions protobuf instance.