Skip to content

fix: sqlite: string interpolation incorrectly uses backslash escapes#228

Merged
huandu merged 4 commits into
huandu:masterfrom
shoriwe:fix/sqlite-strings
Dec 30, 2025
Merged

fix: sqlite: string interpolation incorrectly uses backslash escapes#228
huandu merged 4 commits into
huandu:masterfrom
shoriwe:fix/sqlite-strings

Conversation

@shoriwe

@shoriwe shoriwe commented Dec 25, 2025

Copy link
Copy Markdown
Contributor

Patch for: #227

@shoriwe

shoriwe commented Dec 25, 2025

Copy link
Copy Markdown
Contributor Author

Here is the exact reference to the documentation:

A string constant is formed by enclosing the string in single quotes ('). A single quote within the string can be encoded by putting two single quotes in a row - as in Pascal. C-style escapes using the backslash character are not supported because they are not standard SQL.

@shoriwe shoriwe changed the title fix: sqlite single quote interpolations fix: sqlite: string interpolation incorrectly uses backslash escapes Dec 25, 2025
@shoriwe

shoriwe commented Dec 25, 2025

Copy link
Copy Markdown
Contributor Author

I just added support for the other cases where interpolation is incorrectly using backslash in SQLite

@huandu huandu added the bug label Dec 29, 2025
@huandu

huandu commented Dec 29, 2025

Copy link
Copy Markdown
Owner

Thanks for your contribution.

@huandu huandu left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor issues in comments.

Comment thread interpolate.go Outdated
Comment thread interpolate.go Outdated
Comment thread interpolate.go Outdated
Comment thread interpolate.go Outdated
Comment thread interpolate.go Outdated
@huandu

huandu commented Dec 29, 2025

Copy link
Copy Markdown
Owner

@shoriwe Don't forget to fix failed cases. Thanks.

@shoriwe

shoriwe commented Dec 29, 2025

Copy link
Copy Markdown
Contributor Author

@shoriwe Don't forget to fix failed cases. Thanks.

Made all SQLite test pass by resolving to valid SQLite string syntax

@coveralls

coveralls commented Dec 29, 2025

Copy link
Copy Markdown

Coverage Status

coverage: 96.999% (+0.02%) from 96.975%
when pulling 2994d27 on shoriwe:fix/sqlite-strings
into e4f129e on huandu:master.

@shoriwe

shoriwe commented Dec 29, 2025

Copy link
Copy Markdown
Contributor Author

@huandu. I have updated the PR, let me know if it is now ready to merge

@huandu huandu merged commit 21cf114 into huandu:master Dec 30, 2025
2 checks passed
@huandu

huandu commented Dec 30, 2025

Copy link
Copy Markdown
Owner

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants