Repository navigation
Commit ea6c30d
Suggest columns after a column named type (#1611)
sqlparse tags a column literally named "type" as the TYPE keyword because
type is non-reserved in postgres. suggest_based_on_last_token matched that
token unconditionally, so the SELECT list switched to datatype/table/schema
suggestions and offered no columns for the rest of the query.
The TYPE keyword only introduces a datatype in DDL contexts, so only treat
it as such when the preceding keyword is not a DML statement keyword.
Cast operators and parenthesized column lists are unaffected.
Fixes #1412
Co-authored-by: Irina Truong <[email protected]>1 parent 4beae47 commit ea6c30d
3 files changed
Lines changed: 42 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
281 | 304 | | |
282 | 305 | | |
283 | 306 | | |
| |||
492 | 515 | | |
493 | 516 | | |
494 | 517 | | |
495 | | - | |
| 518 | + | |
496 | 519 | | |
497 | 520 | | |
498 | 521 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
798 | 798 | | |
799 | 799 | | |
800 | 800 | | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
801 | 818 | | |
802 | 819 | | |
803 | 820 | | |
| |||
0 commit comments