Skip to content
This repository was archived by the owner on Mar 12, 2020. It is now read-only.

Commit 1adda85

Browse files
committed
Showing message when fails to connect
1 parent c01d3bf commit 1adda85

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

SQLTools.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,19 @@ def bootstrap():
1616
ST.connectionList = Settings.getConnections()
1717
ST.checkDefaultConnection()
1818

19+
@staticmethod
20+
def setTablesIfNotEmpty(tables):
21+
if type(tables) is list and len(tables) == 0:
22+
sublime.message_dialog('Connection failed. Check your settings and try again.')
23+
return
24+
ST.tables = tables
25+
1926
@staticmethod
2027
def loadConnectionData():
2128
if not ST.conn:
2229
return
2330

24-
ST.conn.getTables(lambda tables: setattr(ST, 'tables', tables))
31+
ST.conn.getTables(lambda tables: ST.setTablesIfNotEmpty(tables))
2532
ST.conn.getColumns(lambda columns: setattr(ST, 'columns', columns))
2633

2734
@staticmethod

0 commit comments

Comments
 (0)