MCPcopy Create free account
hub / github.com/CL-lau/SQL-GPT / __init__

Method __init__

sql/SQLOperator.py:93–116  ·  view source on GitHub ↗
(self, jdbcList=None, userNames=None, passwords=None)

Source from the content-addressed store, hash-verified

91
92class SQL_operator(nn.Module):
93 def __init__(self, jdbcList=None, userNames=None, passwords=None):
94 super().__init__()
95
96 self.jdbcList = jdbcList # jdbcList的每一项的格式[host/db_name]
97 if self.jdbcList is None or len(self.jdbcList) <= 0:
98 self.jdbcList = []
99 self.userNames = userNames
100 self.userNameMap = {}
101 if self.userNames is None or len(self.userNames) <= 0:
102 self.userNames = []
103 self.userNameMap = {}
104 self.passwords = passwords
105 self.userNameMap = {}
106 if self.passwords is None or len(self.passwords) <= 0:
107 self.passwords = []
108 self.passwordMap = {}
109 self.tableList = {}
110 self.columnsList = {}
111 self.connMap = {}
112
113 self.config_file = "config.json"
114 self.initJDBC()
115 self.get_table_columns()
116 self.sql_class = SQL_class()
117
118 def initJDBC(self):
119 if os.path.exists(self.config_file):

Callers

nothing calls this directly

Calls 4

initJDBCMethod · 0.95
get_table_columnsMethod · 0.95
SQL_classClass · 0.90
__init__Method · 0.45

Tested by

no test coverage detected