Skip to content

Fix backslash escaping in ClickHouse string literals#51

Merged
tycooon merged 3 commits into
mainfrom
fix-slash-escape
Jun 15, 2026
Merged

Fix backslash escaping in ClickHouse string literals#51
tycooon merged 3 commits into
mainfrom
fix-slash-escape

Conversation

@KirIgor

@KirIgor KirIgor commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

ClickHouse uses C-style escape sequences so backslashes in string literals must be doubled. Sequel's Postgres adapter only escapes single-quotes, leaving bare backslashes that ClickHouse misinterprets (e.g. ' breaks query boundaries).

Override literal_string_append via a dataset module mixed into every CH dataset returned by Base#from, so the fix applies through all Sequel chaining.

KirIgor and others added 3 commits June 15, 2026 13:47
ClickHouse uses C-style escape sequences so backslashes in string
literals must be doubled. Sequel's Postgres adapter only escapes
single-quotes, leaving bare backslashes that ClickHouse misinterprets
(e.g. \' breaks query boundaries).

Override literal_string_append via a dataset module mixed into every
CH dataset returned by Base#from, so the fix applies through all
Sequel chaining.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tycooon tycooon merged commit 447ab22 into main Jun 15, 2026
4 checks passed
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.

2 participants