diff options
author | Darik Gamble <darik.gamble@gmail.com> | 2016-10-26 11:12:59 -0400 |
---|---|---|
committer | Darik Gamble <darik.gamble@gmail.com> | 2016-10-26 11:12:59 -0400 |
commit | 9c32912b32d0ebec6a4db025345682675172ce4c (patch) | |
tree | d52c0080979349e7474f983acfefd0aead5ec984 | |
parent | 3f2e686d4f628981621d826ca50641eff3a2c2df (diff) |
Hardcode case where last token is 'AS'
Fixes failing tests. In earlier versions of sqlparse this dangling AS was grouped with the previous
identifier so this case was handled implicitly
-rw-r--r-- | pgcli/packages/sqlcompletion.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pgcli/packages/sqlcompletion.py b/pgcli/packages/sqlcompletion.py index b1a59da9..1e537a22 100644 --- a/pgcli/packages/sqlcompletion.py +++ b/pgcli/packages/sqlcompletion.py @@ -358,7 +358,9 @@ def suggest_based_on_last_token(token, stmt): return (Column(table_refs=tables, local_tables=stmt.local_tables), Function(schema=None), Keyword(),) - + elif token_v == 'as': + # Don't suggest anything for aliases + return () elif (token_v.endswith('join') and token.is_keyword) or (token_v in ('copy', 'from', 'update', 'into', 'describe', 'truncate')): |