Commit 099ec9d
committed
Quote reserved-word identifiers via sqlglot.to_identifier
_quote_identifier was only quoting names with dots/special chars but
passing reserved words like 'order' through unquoted, producing
invalid SQL. Now delegates to sqlglot.to_identifier for all simple
names so reserved words get quoted automatically. Uses lru_cache to
avoid perf regression from repeated sqlglot calls.1 parent 72a340d commit 099ec9d
1 file changed
Lines changed: 13 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
15 | 25 | | |
16 | 26 | | |
17 | 27 | | |
| |||
232 | 242 | | |
233 | 243 | | |
234 | 244 | | |
235 | | - | |
| 245 | + | |
| 246 | + | |
236 | 247 | | |
237 | | - | |
238 | | - | |
239 | | - | |
| 248 | + | |
240 | 249 | | |
241 | 250 | | |
242 | 251 | | |
| |||
0 commit comments