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

[jdbc] added some tests and fixes #1966

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

[jdbc] added some tests and fixes #1966

wants to merge 18 commits into from

Conversation

chernser
Copy link
Contributor

@chernser chernser commented Nov 23, 2024

Summary

Next things are done:

  • Marked tests integration to make them run while CI build and maven install
  • Fixed required dependency on client-v2
  • Removed unnecessary dependencies from jdbc-v2
  • Made Database metadata a single instance per connection to avoid spreading connection reference
  • Fixed get server version query
  • Fixed type matching for columns with 'Nullable(...)' type
  • Fixed catalog and schema terms confusion
  • Fixed different flag values like for nullsAreSortedHigh and supportsCatalogsInIndexDefinitions
  • Fixed getTables to return schema, type
  • Fixed getTableTypes to return what is stored in DB
  • Fixed getColumns correct types, flags, precision, decimal digits ...
  • Added some DatabaseMedata tests
  • Fixed changing schema to take effect
  • Implemented getting functions
  • Implemented getting type info

Relates to: #1974

Checklist

Delete items not relevant to your PR:

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG
  • For significant changes, documentation in https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials

@chernser chernser marked this pull request as ready for review November 27, 2024 23:23
Copy link

sonarcloud bot commented Nov 29, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
4 Security Hotspots
55.6% Coverage on New Code (required ≥ 80%)
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@mshustov mshustov linked an issue Nov 29, 2024 that may be closed by this pull request
checkClosed();
StatementType type = parseStatementType(sql);

if (type == StatementType.SELECT) {
executeQuery(sql, settings);
executeQuery(sql, settings); // keep open to allow getResultSet()
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we eventually close it?

/**
* JDBC driver specific properties. Do not include any ClickHouse client properties here.
*/
public enum DriveProperties {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be DriverProperties?

}

private Connection getConnection() throws SQLException {
return DriverManager.getConnection(getEndpointString(isCloud()));
Copy link
Contributor

Choose a reason for hiding this comment

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

In theory this could be restored to just the one line

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.

[jdbc-v2] Fill DatabaseMetadata object with correct information
2 participants