Skip to content

Conversation

@mzitnik
Copy link
Contributor

@mzitnik mzitnik commented Apr 24, 2025

Summary

If the client wants to disable the retrieval of the server version & server timezone (extra query when init of JDBC Connection)
Example (how to disable)

properties.put(ClientConfigProperties.SERVER_TIMEZONE.getKey(), "GMT");
properties.put(ClientConfigProperties.SERVER_VERSION.getKey(), "1.0.0");

Closes #2191

Checklist

Delete items not relevant to your PR:

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
6.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@mzitnik mzitnik requested review from Paultagoras and chernser April 24, 2025 11:53
this.configuration.put(ClientConfigProperties.SERVER_TIMEZONE.getKey(), reader.getString("timezone"));
serverVersion = reader.getString("version");
// only if 2 properties are set disable retrieval from server
if (!this.configuration.containsKey(ClientConfigProperties.SERVER_TIMEZONE.getKey()) && !this.configuration.containsKey(ClientConfigProperties.SERVER_VERSION.getKey())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think. in the future it will be a bug when more then timezone is get with server info.
So I'd just have an explicit flag documenting that all required configuration should be set. In the builder test that all required configuration is set

@mzitnik mzitnik merged commit 5ae9b83 into main Apr 24, 2025
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In JDBC V1 version it had the option to disable an extra query that is make to the server

3 participants