Skip to content

[codex] Fix ClickHouse quote escaping#283

Draft
ruslandoga wants to merge 2 commits into
masterfrom
ruslandoga+conductor/ruslandoga-conductor/check-clickhouse-quote-escaping
Draft

[codex] Fix ClickHouse quote escaping#283
ruslandoga wants to merge 2 commits into
masterfrom
ruslandoga+conductor/ruslandoga-conductor/check-clickhouse-quote-escaping

Conversation

@ruslandoga
Copy link
Copy Markdown
Collaborator

What changed

  • Escapes embedded double quotes, backticks, and backslashes when rendering quoted ClickHouse identifiers.
  • Keeps single-quoted string/comment escaping on the existing ClickHouse-safe '' and \\ path.
  • Adds focused SQL generation coverage for string constants, quoted identifiers, backtick identifiers, and table comments.
  • Updates the changelog for the current release section.

Why

ClickHouse supports string literals only in single quotes, while identifiers can be quoted with double quotes or backticks. The adapter already escaped string literals, but quoted identifiers were only wrapped, so names containing quote characters or backslashes could render invalid SQL.

Validation

  • mix compile
  • MIX_ENV=test mix run .context/validate_escaping.exs

mix test test/ecto/adapters/clickhouse/connection_test.exs could not complete in this local workspace because test_helper connects to local ClickHouse and the server rejected the default credentials.

Comment thread CHANGELOG.md Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant