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

Commit a89db0e

Browse files
committed
Fixes #21 issue
1 parent 63bc708 commit a89db0e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

SQLTools.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class ST(sublime_plugin.EventListener):
2222
conn = None
2323
history = []
2424
tables = []
25+
functions = []
2526
columns = []
2627
connectionList = {}
2728
autoCompleteList = []
@@ -32,20 +33,20 @@ def bootstrap():
3233
ST.checkDefaultConnection()
3334

3435
@staticmethod
35-
def setTablesIfNotEmpty(tables):
36-
if type(tables) is list and len(tables) == 0:
36+
def setAttrIfNotEmpty(attr, value):
37+
if type(value) is list and len(value) == 0:
3738
# sublime.message_dialog('Connection failed. Check your settings and try again.')
3839
return
39-
ST.tables = tables
40+
setattr(ST, attr, value)
4041

4142
@staticmethod
4243
def loadConnectionData():
4344
if not ST.conn:
4445
return
4546

46-
ST.conn.getTables(lambda tables: ST.setTablesIfNotEmpty(tables))
47-
ST.conn.getColumns(lambda columns: setattr(ST, 'columns', columns))
48-
ST.conn.getFunctions(lambda functions: setattr(ST, 'functions', functions))
47+
ST.conn.getTables(lambda tables: ST.setAttrIfNotEmpty('tables', tables))
48+
ST.conn.getColumns(lambda columns: ST.setAttrIfNotEmpty('columns', columns))
49+
ST.conn.getFunctions(lambda functions: ST.setAttrIfNotEmpty('functions', functions))
4950

5051
@staticmethod
5152
def setConnection(index):

0 commit comments

Comments
 (0)