Skip to content

Add support to clickhouse JDBC V2 #10280

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

Conversation

thiagohora
Copy link
Contributor

Description

This pull request adds support for ClickHouse JDBC v2 driver to the Testcontainers ClickHouse module.

Context

  • The newer ClickHouse JDBC v2 driver (com.clickhouse.jdbc.Driver and com.clickhouse.jdbc.ClickHouseDriver) introduces enhanced functionality and compatibility with ClickHouse server versions >= 20.7.
  • Previously, the Testcontainers ClickHouse module only supported the legacy Yandex driver (ru.yandex.clickhouse.ClickHouseDriver), which is now deprecated.
  • With this PR, users can seamlessly use either the legacy or the v2 driver, depending on the ClickHouse image/tag in use.

Changes

  • Updated ClickHouseContainer to detect and load the correct driver class (v1 or v2) depending on the server version and classpath.
  • Added tests for the v2 driver.
  • Improved documentation and example usage for the new driver.
  • Minor code and config cleanups to ensure forward compatibility.

Why is this useful?

  • Enables Testcontainers users to test applications using the official, actively developed ClickHouse JDBC driver (v2).
  • Eases migration from the deprecated Yandex driver to the official driver.
  • Provides compatibility with recent ClickHouse server releases and features.

Issues

Fixes #10279

@thiagohora thiagohora requested a review from a team as a code owner May 28, 2025 12:26
@thiagohora thiagohora changed the title Thiagohora/#10279 add support to clickhouse jdbc v2 #10279 Add support to clickhouse JDBC V2 May 28, 2025
Copy link
Member

@eddumelendez eddumelendez left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution, @thiagohora. I've left some comments.

@thiagohora thiagohora requested a review from eddumelendez May 28, 2025 15:38
eddumelendez
eddumelendez previously approved these changes May 29, 2025
@eddumelendez eddumelendez added this to the next milestone May 29, 2025
@eddumelendez eddumelendez changed the title #10279 Add support to clickhouse JDBC V2 Add support to clickhouse JDBC V2 May 29, 2025
@eddumelendez eddumelendez merged commit df3ed30 into testcontainers:main May 29, 2025
106 checks passed
@eddumelendez
Copy link
Member

Thanks for your contribution, @thiagohora

@thiagohora thiagohora deleted the thiagohora/#10279_add_support_to_clickhouse_jdbc_v2 branch May 29, 2025 19:47
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.

[Feature]: Support Clickhouse JDBC-V2 driver
2 participants