Skip to content

Commit 35c8d82

Browse files
authored
Removing constant refresh block. (#108)
1 parent 11e51e9 commit 35c8d82

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

mssqlcli/main.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,6 @@ def execute_command(self, text, query):
365365
else:
366366
print('Time: %0.03fs' % query.total_time)
367367

368-
with self._completer_lock:
369-
self.completer.reset_completions()
370-
self.refresh_completions(persist_priorities='keywords')
371-
372368
# Check if we need to update completions, in order of most
373369
# to least drastic changes
374370
if query.db_changed:
@@ -555,6 +551,9 @@ def _evaluate_command(self, text):
555551
if new_db_name:
556552
self.mssqlcliclient_query_execution.database = new_db_name
557553

554+
if all_success:
555+
meta_changed = meta_changed or has_meta_cmd(text)
556+
558557
return output, MetaQuery(
559558
sql, all_success, total, meta_changed, db_changed, path_changed, mutated)
560559

@@ -710,7 +709,7 @@ def has_meta_cmd(query):
710709
statement is an alter, create, drop, commit or rollback."""
711710
try:
712711
first_token = query.split()[0]
713-
if first_token.lower() in ('alter', 'create', 'drop', 'commit', 'rollback'):
712+
if first_token.lower() in ('alter', 'create', 'drop'):
714713
return True
715714
except Exception:
716715
return False

0 commit comments

Comments
 (0)