summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmjith Ramanujam <amjith.r@gmail.com>2015-03-14 13:35:15 -0700
committerAmjith Ramanujam <amjith.r@gmail.com>2015-03-14 13:38:12 -0700
commit5be22f57a69986b1a1be63f2f57c08c14e7deda8 (patch)
tree30dc3961f5a6d214579e5e97659763714b1dc459
parent7e61c6ddfcc1680d67113dde6f45977d428ce903 (diff)
Add \connect to the list of commands that need completion refresh.
-rwxr-xr-xpgcli/main.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pgcli/main.py b/pgcli/main.py
index ff4091eb..41f325b0 100755
--- a/pgcli/main.py
+++ b/pgcli/main.py
@@ -350,7 +350,8 @@ def format_output(cur, headers, status, table_format):
if is_expanded_output():
output.append(expanded_table(cur, headers))
else:
- output.append(tabulate(cur, headers, tablefmt=table_format, missingval='<null>'))
+ output.append(tabulate(cur, headers, tablefmt=table_format,
+ missingval='<null>'))
if status: # Only print the status if it's not None.
output.append(status)
return output
@@ -361,8 +362,8 @@ def need_completion_refresh(queries):
for query in sqlparse.split(queries):
try:
first_token = query.split()[0]
- return first_token.lower() in ('alter', 'create', 'use', '\c',
- 'drop')
+ return first_token.lower() in ('alter', 'create', 'use', '\\c',
+ '\\connect', 'drop')
except Exception:
return False