ClickHouse / ClickHouse/clickhouse-java

[jdbc-v2] JDBC Escaping

Đang mở
#2,352 1 bình luận 1 reaction 0 người được giao Xem trên GitHub
area:jdbc-insert bug jdbc-v2
Ngôn ngữ chính
Java
Star
1.6k
Fork
636
Merge trung bình
2 ngày 23 giờ
Pull request đã merge (30 ngày)
29

Mô tả

### Description
JDBC escaping allows to write portable (really not) SQL statements that can be run with different JDBC drivers to get same affect. For example, `{ts 2025-02-20}` should be interpreted by driver as native function like `toTimestamp()` and other drivers should do similar way.

Current JDBC implementation
- does escaping always but should be controlled by `com.clickhouse.jdbc.StatementImpl#setEscapeProcessing`
- should be true for both Statement and PreparedStatement with according tests
- lacks of documentation https://clickhouse.com/docs/integrations/language-clients/java/jdbc
- done after prepared statement is parsed but should before (to not confuse parser :-))

There is a good explanation of how JDBC escaping works https://jdbc.postgresql.org/documentation/escapes/.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với com.clickhouse.jdbc.StatementImpl#setEscapeProcessing và theo dõi cách escaping được áp dụng so với việc phân tích prepared statement. Xem lại phần giải thích về JDBC escaping và tài liệu tích hợp JDBC, sau đó bổ sung coverage cho cả Statement và PreparedStatement. Công việc được hoàn thành khi escaping có thể cấu hình, được bật cho cả hai loại statement và được ghi trong tài liệu.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java
Lĩnh vực
database
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.