Repository navigation
Commit f0b0733
Suggest columns after a column named type (dbcli#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 dbcli#1412
Co-authored-by: Irina Truong <[email protected]>1 parent fa67580 commit f0b0733
3 files changed
Lines changed: 43 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
334 | 357 | | |
335 | 358 | | |
336 | 359 | | |
| |||
553 | 576 | | |
554 | 577 | | |
555 | 578 | | |
556 | | - | |
| 579 | + | |
557 | 580 | | |
558 | 581 | | |
559 | 582 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
801 | 801 | | |
802 | 802 | | |
803 | 803 | | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
804 | 821 | | |
805 | 822 | | |
806 | 823 | | |
| |||
0 commit comments