Skip to content

[jdbc-v2] Adds default port and restricts multiple endpoints #2489

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

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

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
@@ -198,6 +210,9 @@ public Object[][] createInvalidConnectionURLs() {
{ "jdbc:clickhouse://foo.bar?x&y=z" },
{ "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
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.

2 participants