Skip to content
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 default ClientInfo properties #324

Merged
merged 1 commit into from Jan 17, 2021
Merged

Conversation

olavloite
Copy link
Collaborator

Adds support for default ClientInfo properties. These are not required by the JDBC standard, but many applications (including IntelliJ) will try to set these, and will log a warning if they are not set. This will prevent that warning from being logged.

As a next step, these ClientInfo property values should be set as SessionLabel values in Cloud Spanner. This makes it possible to track which sessions are being used by which (JDBC) application.

@olavloite olavloite requested a review from a team as a code owner January 17, 2021 12:54
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jan 17, 2021
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/java-spanner-jdbc API. label Jan 17, 2021
StructField.of("DEFAULT_VALUE", Type.string()),
StructField.of("DESCRIPTION", Type.string())),
Collections.<Struct>emptyList()));
Arrays.asList(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These default ClientInfo properties are described here: https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html#setClientInfo-java.lang.String-java.lang.String-

The names are case insensitive.

@codecov
Copy link

codecov bot commented Jan 17, 2021

Codecov Report

Merging #324 (7cba84e) into master (e1cd90d) will increase coverage by 0.36%.
The diff coverage is 89.65%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #324      +/-   ##
============================================
+ Coverage     70.93%   71.30%   +0.36%     
- Complexity     1105     1112       +7     
============================================
  Files            24       24              
  Lines          3423     3474      +51     
  Branches        526      531       +5     
============================================
+ Hits           2428     2477      +49     
  Misses          780      780              
- Partials        215      217       +2     
Impacted Files Coverage Δ Complexity Δ
.../com/google/cloud/spanner/jdbc/JdbcConnection.java 44.01% <ø> (ø) 42.00 <0.00> (ø)
...gle/cloud/spanner/jdbc/AbstractJdbcConnection.java 67.81% <70.00%> (+3.92%) 24.00 <2.00> (+4.00)
...oogle/cloud/spanner/jdbc/JdbcDatabaseMetaData.java 95.68% <100.00%> (+0.20%) 183.00 <3.00> (+3.00)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e1cd90d...7cba84e. Read the comment docs.

@thiagotnunes thiagotnunes merged commit 250c4c1 into master Jan 17, 2021
@thiagotnunes thiagotnunes deleted the client-info branch January 17, 2021 23:50
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-jdbc API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants