1
0
Fork 0

Refresh completions after COMMIT or ROLLBACK.

This commit is contained in:
Irina Truong 2017-05-28 17:56:48 -07:00
parent 265c063159
commit fc3025e9bc
3 changed files with 5 additions and 3 deletions

View File

@ -1,7 +1,7 @@
Upcoming
========
* TBD
* Refresh completions after `COMMIT` or `ROLLBACK`. (Thanks: `Irina Truong`_)
1.6.0
=====

View File

@ -893,10 +893,10 @@ def format_output(title, cur, headers, status, settings):
def has_meta_cmd(query):
"""Determines if the completion needs a refresh by checking if the sql
statement is an alter, create, or drop"""
statement is an alter, create, drop, commit or rollback"""
try:
first_token = query.split()[0]
if first_token.lower() in ('alter', 'create', 'drop'):
if first_token.lower() in ('alter', 'create', 'drop', 'commit', 'rollback'):
return True
except Exception:
return False

View File

@ -50,6 +50,7 @@
"CLUSTER": [],
"COLUMN": [],
"COMMENT": [],
"COMMIT": [],
"COMPRESS": [],
"CONCURRENTLY": [],
"CONNECT": [],
@ -218,6 +219,7 @@
"RETURNS": [],
"REVOKE": [],
"RIGHT": [],
"ROLLBACK": [],
"ROW": [],
"ROWID": [],
"ROWNUM": [],