ClickHouse / ClickHouse/clickhouse-java

[jdbc-v2] JDBC Escaping

未关闭
#2,352 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
area:jdbc-insert bug jdbc-v2
主要语言
Java
星标
1.6k
派生
636
平均合并
2 天 23 小时
30 天内合并 PR
29

描述

### 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/.

贡献指南

打开贡献指南

调研方向

从 com.clickhouse.jdbc.StatementImpl#setEscapeProcessing 开始,跟踪相对于 prepared-statement 解析而言转义是如何应用的。查阅 JDBC 转义说明和 JDBC 集成文档,然后为 Statement 和 PreparedStatement 都添加覆盖。完成的标准是转义可配置、对两种 statement 类型都已启用,并且有文档说明。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
database
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。