-
Notifications
You must be signed in to change notification settings - Fork 614
[JDBC] enabled tests. added some more for ConnectionImpl. implementated nati… #2521
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.
Pull Request Overview
This PR enables and extends JDBC tests while refactoring internal class accessibility. It implements the nativeSQL method to handle JDBC escape sequences and adds tests for setSchema functionality.
- Enables previously disabled integration tests
- Implements
nativeSQLmethod to convert JDBC escape sequences to native SQL - Refactors
DriverPropertiesandClientInfoPropertiesclasses from internal package to public
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| jdbc-v2/src/main/java/com/clickhouse/jdbc/DriverProperties.java | Moved from internal package to public API |
| jdbc-v2/src/main/java/com/clickhouse/jdbc/ClientInfoProperties.java | Moved from internal package to public API |
| jdbc-v2/src/main/java/com/clickhouse/jdbc/ConnectionImpl.java | Enhanced connection validation, implemented nativeSQL, made client field private |
| jdbc-v2/src/main/java/com/clickhouse/jdbc/StatementImpl.java | Extracted static method for SQL escape processing, improved error handling |
| jdbc-v2/src/test/java/com/clickhouse/jdbc/ConnectionTest.java | Enabled and expanded tests for connection functionality |
| jdbc-v2/src/test/java/com/clickhouse/jdbc/StatementTest.java | Added schema setting tests and enabled existing tests |
| Various test files | Updated imports to reflect package structure changes |
Comments suppressed due to low confidence (1)
jdbc-v2/src/test/java/com/clickhouse/jdbc/StatementTest.java:1037
- The test checks that the database name remains the same for an existing statement after changing the connection schema, but doesn't verify that new statements use the updated schema. Consider adding a test that creates a new statement after schema change to verify the schema switch works correctly.
assertEquals(getDBName(stmt), db1);
Client V2 CoverageCoverage Report
Class Coverage
|
JDBC V2 CoverageCoverage Report
Class Coverage
|
JDBC V1 CoverageCoverage Report
Class Coverage
|
Client V1 CoverageCoverage Report
Class Coverage
|
mzitnik
left a comment
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.
LGTM
|
Thank you, @mzitnik ! |
|



Summary
nativeSQLto return SQL after escaping functions. (Simplest implementation)setSchema(String schema)DriverPropertiesandClientInforPropertiesenums to a public package for better UX.Closes #2411
Checklist
Delete items not relevant to your PR: