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

Method get_table_columns

sql/SQLOperator.py:135–144  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

133 self.connMap[host + '/' + db] = create_engine('mysql+pymysql://' + name + ':' + password + '@' + host + '/' + db)
134
135 def get_table_columns(self):
136 for jdbc in self.jdbcList:
137 # self.connMap[jdbc] = create_engine('mysql+pymysql://root:password@localhost/test_db')
138 # self.connMap[jdbc] = create_engine('mysql+pymysql://' + self.userNames + ':' +
139 # self.passwords + '@' + jdbc)
140 inspector = inspect(self.connMap[jdbc])
141 tables = inspector.get_table_names()
142 self.tableList[jdbc] = [table for table in tables]
143 for table in tables:
144 self.columnsList[jdbc + "_" + table] = [column for column in inspector.get_columns(table)]
145
146 def process_result(self, sql, result):
147 operator_type = get_db_operation_class(sql)

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected