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

ClickHouse uses new driver if it is available and version is compatible #6236

Merged
merged 3 commits into from Feb 1, 2023

Conversation

trolley813
Copy link
Contributor

A replacement for #5666 (related to the now-closed #6232). Now, ClickHouseContainer picks up the new com.clickhouse.jdbc.ClickHouseDriver driver if it is available and the version tag is 20.7 or later (as supported by the driver), otherwise it falls back to the legacy ru.yandex.clickhouse.ClickHouseDriver driver.

}
}

private static boolean isNewDriverSupported(DockerImageName dockerImageName) {
Copy link
Member

Choose a reason for hiding this comment

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

I think you may want to use ComparableVersion. See

new ComparableVersion(dockerImageName.getVersionPart()).isGreaterThanOrEqualTo("8.0.0");

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@eddumelendez Oh, that's great, thanks! Will fix it as soon as possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced with ComparableVersion.

@trolley813
Copy link
Contributor Author

Oh, I forgot to run spotless after making changes. (Actually, the only violation were unsorted imports.)
Now, it's probably ready.

@eddumelendez eddumelendez merged commit 80700c1 into testcontainers:main Feb 1, 2023
@eddumelendez
Copy link
Member

Thanks for your contribution @trolley813 ! This is now is main branch and it will be available in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement]: Make ClickHouseContainer try to use new driver by default
2 participants