Expose MySQL and PostgreSQL protocol ports in ClickHouseContainer - #12001
Expose MySQL and PostgreSQL protocol ports in ClickHouseContainer#12001junho0831 wants to merge 1 commit into
Conversation
ClickHouse server provides native compatibility with MySQL (port 9004) and PostgreSQL (port 9005) wire protocols by default. Previously, ClickHouseContainer only exposed the HTTP (8123) and Native (9000) ports, preventing users from connecting via MySQL and PostgreSQL drivers/clients without manual port configuration. Expose MYSQL_PORT (9004) and POSTGRESQL_PORT (9005) by default, and provide helper methods (getMysqlPort(), getPostgresqlPort(), getMysqlJdbcUrl(), getPostgresqlJdbcUrl()) in ClickHouseContainer. Fixes testcontainers#3827
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughChangesClickHouse protocol support
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: 🔵 Low · up to Each ClickHouse container will now expose MySQL and PostgreSQL-compatible endpoints by default, making those protocols easier to use but potentially increasing network exposure when container ports are reachable beyond trusted test environments. The change is mergeable with explicit owner awareness and follow-up to document trusted bindings and credential practices. Sequence Diagram(s)sequenceDiagram
participant ClickHouseContainer
participant DriverManager
participant ClickHouseServer
ClickHouseContainer->>DriverManager: provide protocol JDBC URL
DriverManager->>ClickHouseServer: connect through MySQL or PostgreSQL protocol
ClickHouseServer-->>DriverManager: return connection
DriverManager->>ClickHouseServer: execute SELECT 1
ClickHouseServer-->>DriverManager: return 1
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 3 files. (1 skipped: 1 unsupported.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
ClickHouse server provides native compatibility with MySQL (port 9004) and PostgreSQL (port 9005) wire protocols by default. Previously,
ClickHouseContaineronly exposed the HTTP (8123) and Native (9000) ports, preventing users from connecting via MySQL and PostgreSQL drivers/clients without manual port configuration.Changes
MYSQL_PORT = 9004andPOSTGRESQL_PORT = 9005toClickHouseContainerand exposed them by default.getMysqlPort(),getPostgresqlPort(),getHttpPort(),getNativePort(),getMysqlJdbcUrl(), andgetPostgresqlJdbcUrl().ClickHouseContainerTestverifying end-to-end query execution across both MySQL and PostgreSQL protocols.Fixes #3827
Summary by CodeRabbit
New Features
Tests