(match: re.Match[str])
| 203 | pattern = r'("(?:[^"\\]|\\.)*")|(\'(?:[^\'\\]|\\.)*\')|(\{[^}]*\})' |
| 204 | |
| 205 | def replacement_func(match: re.Match[str]) -> str: |
| 206 | double_quoted = match.group(1) |
| 207 | single_quoted = match.group(2) |
| 208 | bracket = match.group(3) |
| 209 | |
| 210 | # If it's a quoted string, return it as-is |
| 211 | if double_quoted or single_quoted: |
| 212 | return match.group(0) |
| 213 | |
| 214 | # If it's a bracket, quote it and record the offset |
| 215 | if bracket: |
| 216 | offset_record[match.start()] = QUOTE_LENGTH |
| 217 | return f"'{bracket}'" |
| 218 | |
| 219 | return match.group(0) |
| 220 | |
| 221 | replaced_sql = re.sub(pattern, replacement_func, sql) |
| 222 |
nothing calls this directly
no test coverage detected
searching dependent graphs…