summaryrefslogtreecommitdiffstats
path: root/pgcli
diff options
context:
space:
mode:
authorAmjith Ramanujam <amjith.r@gmail.com>2019-05-06 09:05:56 -0700
committerAmjith Ramanujam <amjith.r@gmail.com>2019-05-06 09:05:56 -0700
commit1908142adb80f324d6c795e76e38f7939948d7f1 (patch)
tree66116aa6ae694675926306bfb7d7ec7aa9e3728c /pgcli
parent1421da3c336f8ae41d66d1f6989fcc1243f0cd1e (diff)
Upgrade to sqlparse 0.3.0.
Diffstat (limited to 'pgcli')
-rw-r--r--pgcli/packages/sqlcompletion.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pgcli/packages/sqlcompletion.py b/pgcli/packages/sqlcompletion.py
index d128fc5a..8ba282e8 100644
--- a/pgcli/packages/sqlcompletion.py
+++ b/pgcli/packages/sqlcompletion.py
@@ -154,7 +154,7 @@ def suggest_type(full_text, text_before_cursor):
# Be careful here because trivial whitespace is parsed as a
# statement, but the statement won't have a first token
tok1 = stmt.parsed.token_first()
- if tok1 and tok1.value == '\\':
+ if tok1 and tok1.value.startswith('\\'):
text = stmt.text_before_cursor + stmt.word_before_cursor
return suggest_special(text)
@@ -398,7 +398,7 @@ def suggest_based_on_last_token(token, stmt):
elif token_v == 'set':
return (Column(table_refs=stmt.get_tables(),
local_tables=stmt.local_tables),)
- elif token_v in ('select', 'where', 'having', 'by', 'distinct'):
+ elif token_v in ('select', 'where', 'having', 'order by', 'distinct'):
# Check for a table alias or schema qualification
parent = (stmt.identifier and stmt.identifier.get_parent_name()) or []
tables = stmt.get_tables()