From ab754223a63c65a828687eb073760ae6922b35c5 Mon Sep 17 00:00:00 2001 From: mercury Date: Thu, 31 Mar 2022 21:05:37 +0400 Subject: [PATCH] improve: show current db in status bar --- SQLTools.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SQLTools.py b/SQLTools.py index 1d28050..72b75b5 100644 --- a/SQLTools.py +++ b/SQLTools.py @@ -345,9 +345,6 @@ def createConnection(connectionName, config, settings, callback=None): settingsConnection = config.get('cli_options', {}) Utils.merge({'cli_options':settingsConnection}, settings) ST.conn = Connection(connectionName, config, settings=settings) - views = Window().views() - for view in views: - view.set_status('db', 'db: ' + connectionName + ' ') except FileNotFoundError as e: # use only first line of the Exception in status message Window().status_message(__package__ + ": " + str(e).splitlines()[0]) @@ -397,6 +394,10 @@ def loadConnectionData(callback=None): if not ST.conn: return + views = Window().views() + for view in views: + view.set_status('db', 'db: ' + ST.conn.name + ' ') + def afterAllDataHasLoaded(): ST.completion = Completion(ST.tables, ST.columns, ST.functions, settings=settingsStore) logger.info('completions loaded')