Repository navigation
Commit 6d4de97
fix: Escape backticks, \${ and backslashes in generated query literals
Query text is emitted inside a template literal, so MySQL
backtick-quoted identifiers (and any backslash or "${" sequence in a
SQL string literal) terminated or corrupted the literal and produced
unparseable or wrong generated code.
The raw template text now escapes backslashes, backticks, and "${"
while the runtime string value stays byte-identical to the original
SQL. Verified by evaluating the emitted literal for a MySQL query using
backtick quoting and a literal containing "${" and backslashes, and
comparing against the source SQL. Existing example output is unchanged.
Fixes #40.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GFyrFwpJC2eivaBRyNBJqv1 parent 74e1a5e commit 6d4de97
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
242 | 249 | | |
243 | 250 | | |
244 | 251 | | |
| |||
247 | 254 | | |
248 | 255 | | |
249 | 256 | | |
250 | | - | |
| 257 | + | |
251 | 258 | | |
252 | 259 | | |
253 | 260 | | |
| |||
0 commit comments