This repository was archived by the owner on Mar 12, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ class ST(sublime_plugin.EventListener):
22
22
conn = None
23
23
history = []
24
24
tables = []
25
+ functions = []
25
26
columns = []
26
27
connectionList = {}
27
28
autoCompleteList = []
@@ -32,20 +33,20 @@ def bootstrap():
32
33
ST .checkDefaultConnection ()
33
34
34
35
@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 :
37
38
# sublime.message_dialog('Connection failed. Check your settings and try again.')
38
39
return
39
- ST . tables = tables
40
+ setattr ( ST , attr , value )
40
41
41
42
@staticmethod
42
43
def loadConnectionData ():
43
44
if not ST .conn :
44
45
return
45
46
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 ))
49
50
50
51
@staticmethod
51
52
def setConnection (index ):
You can’t perform that action at this time.
0 commit comments