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.
Would it be better to name it executeReadQuery?
There was a problem hiding this comment.
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.
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.