-
Notifications
You must be signed in to change notification settings - Fork 614
Database names with dashes #2484
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
There was a problem hiding this 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".
jdbc-v2/src/test/java/com/clickhouse/jdbc/ConnectionWithCustomDatabaseTest.java
Outdated
Show resolved
Hide resolved
|
/windsurf-review |
There was a problem hiding this 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".
jdbc-v2/src/main/java/com/clickhouse/jdbc/internal/JdbcConfiguration.java
Outdated
Show resolved
Hide resolved
jdbc-v2/src/test/java/com/clickhouse/jdbc/ConnectionWithCustomDatabaseTest.java
Outdated
Show resolved
Hide resolved
jdbc-v2/src/test/java/com/clickhouse/jdbc/internal/JdbcConfigurationTest.java
Outdated
Show resolved
Hide resolved
|
@enqueue thank you for the contribution! Thanks! |
|
@enqueue Would you please fix? I'd also would like to know if this tests failing for your local build? Please let me know if it is not failing - I want to make sure tests are working in all environments. Thanks! |
|
Hello @chernser I am still working on this PR, and am going to enhance implementation and tests. As always, some easy looking issue leads you into a rabbit hole 🤷♂️ . I think I was able to get properly encoded HTTP header values work. [felix@fmueller2021 jdbc-v2]$ echo "SELECT 1" | curl 'http://localhost:8123/' -H "X-ClickHouse-Database*: UTF-8''%F0%9F%98%8B" --data-binary @-
1Are additional ("phantasy") JDBC URL parameters actually taken into account, i.e. should they end up as query parameters or headers in HTTP call? There is a test for parsing them into Is it intended behavior that JDBC URL allows invalid URLs, e.g. non URL-encoded query parameters? This would be different to other popular JDBC drivers, e.g. MySQL, PostgreSQL Furthermore, it looks to me that JdbcConfiguration does not support multiple hosts via JDBC URL, while the old implementation does. Is this intentional? If not, perhaps a follow-up issue / PR would be good. |
|
@enqueue I've merged. Thank you! My opinion on the JDBC URL: it is not HTTP one and should not follow HTTP rules. It is very inconvenient to observe encoded values in JDBC connect string ("URL"). |
|
@chernser Thanks, I tried to limit changes to fixing issue at hand.
new JdbcConfigurationTestData("jdbc:clickhouse://localhost?key1=not enc/öd',e&d")
.withAdditionalExpectedClientProperties(
Map.of(
"key1", "not enc/öd',e&d"
))The test will fail, because general URI format according to RFC 2396 is violated (also see JDK JavaDoc URI). If we want to allow non-encoded values we will have to establish proprietary escaping rules for some characters ("&", "=" come to mind). |
|
@enqueue URL encoded parameter seems a correct way. At least everyone expects it and other JDBC drivers have this rule. Using special escaping rules would be hard to adopt. |
Summary
Try to support database names with dashes. See #2463
Closes #2463
Checklist
Delete items not relevant to your PR: