Skip to content

Conversation

@enqueue
Copy link
Contributor

@enqueue enqueue commented Jul 8, 2025

Summary

This PR ensures that valid JDBC URLs are also accepted as endpoints by Client.

JDBC URLs which contain multiple endpoints are considered invalid

This is an alternative PR to #2488 which supports the use of multiple endpoints in JDBC URLs.

Checklist

  • [ ✅ ] Unit and integration tests covering the common scenarios were added
@enqueue enqueue marked this pull request as ready for review July 8, 2025 14:47
Copy link

@windsurf-bot windsurf-bot bot left a comment

Choose a reason for hiding this comment

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

💡 To request another review, post a new comment with "/windsurf-review".

@enqueue
Copy link
Contributor Author

enqueue commented Jul 8, 2025

Hi @chernser , this is the minimal PR that makes sure JDBC URLs can be used as Client endpoint. If you want to allow multiple endpoints, please check out #2488

@enqueue enqueue changed the title Default port, multiple endpoints verboten [jdbc-v2] Default port, multiple endpoints verboten Jul 8, 2025
{ "jdbc:clickhouse://foo.bar?x==&y=z" },
{ "jdbc:clickhouse://localhost?☺=value1" },
// multiple endpoints are invalid
{ "jdbc:clickhouse://foo,bar" },
Copy link
Contributor

Choose a reason for hiding this comment

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

yes, multiple endpoints is what we do not plan to support:

  • JDBC has datasources for multiple endpoints
  • Client v2 has addEndpoint() that will be used to add more endpoints when we support them.
@chernser chernser changed the title [jdbc-v2] Default port, multiple endpoints verboten [jdbc-v2] Adds default port and restricts multiple endpoints Jul 8, 2025
@chernser
Copy link
Contributor

chernser commented Jul 8, 2025

@enqueue thank you for the contribution!
I will review a bit later.
We do not plan to support multiple endpoint. Especially in URL.

@chernser chernser requested a review from mzitnik July 8, 2025 16:15
@chernser chernser merged commit 72573f8 into ClickHouse:main Jul 15, 2025
14 of 23 checks passed
@enqueue enqueue deleted the jdbc_url_default_ports branch July 15, 2025 07:18
@stronglxp
Copy link

@chernser Hi, Why not support multi node connections in the URL? How to use JDBC to connect multiple nodes?

@chernser
Copy link
Contributor

Good day, @stronglxp !
Currently it is not supported but we will do something with it soon.

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

Labels

None yet

3 participants