ClickHouse / ClickHouse/clickhouse-java

[jdbc-v2] JDBC Escaping

Aperta
#2,352 1 commento 1 reazione 0 assegnatari Vedi su GitHub
area:jdbc-insert bug jdbc-v2
Lingua principale
Java
Stelle
1.6k
Fork
636
Merge medio
2g 23h
PR unite (30g)
29

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.