Skip to content

Conversation

@olavloite
Copy link
Collaborator

Adds an execute method to the Connection API that allows the caller to specify the allowed result types. This can be used by driver implementations, such as JDBC, to use a single execute method in the Connection API, while still making sure that the method only executes statements that it should.
The current executeUpdate method in the Connection API does not overlap completely with semantics of executeUpdate in JDBC, as JDBC allows any statement type that does not return a ResultSet to be executed with that method. The Connection API only allows statements that return an update count.
Instead of modifying the executeUpdate method in the Connection API to match the semantics of JDBC (which would be a breaking change), this method can be used generically for all execute*** methods in the JDBC driver, which again can be used to clean up some code there.

Adds an execute method to the Connection API that allows the caller to
specify the allowed result types. This can be used by driver
implementations, such as JDBC, to use a single execute method in the
Connection API, while still making sure that the method only executes
statements that it should.
The current executeUpdate method in the Connection API does not overlap
completely with semantics of executeUpdate in JDBC, as JDBC allows any
statement type that does not return a ResultSet to be executed with that
method. The Connection API only allows statements that return an update
count.
Instead of modifying the executeUpdate method in the Connection API to
match the semantics of JDBC (which would be a breaking change), this
method can be used generically for all execute*** methods in the JDBC
driver, which again can be used to clean up some code there.
@olavloite olavloite requested a review from rajatbhatta August 15, 2023 15:44
@olavloite olavloite requested review from a team as code owners August 15, 2023 15:44
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: spanner Issues related to the googleapis/java-spanner API. labels Aug 15, 2023
@olavloite olavloite requested review from manu2 and removed request for rajatbhatta September 1, 2023 18:26
Copy link

@bharadwaj-aditya bharadwaj-aditya left a comment

Choose a reason for hiding this comment

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

LGTM

@olavloite olavloite merged commit 2851ce8 into main Sep 6, 2023
@olavloite olavloite deleted the allowed-return-types branch September 6, 2023 08:36
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 googleapis/java-spanner API. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants