feat(model): Add new LLMClient and new build tools (#967)

This commit is contained in:
Fangyin Cheng
2023-12-23 16:33:01 +08:00
committed by GitHub
parent 12234ae258
commit 0c46c339ca
30 changed files with 1072 additions and 133 deletions

View File

@@ -37,7 +37,14 @@ class SQLiteConnect(RDBMSDatabase):
"""Get table indexes about specified table."""
cursor = self.session.execute(text(f"PRAGMA index_list({table_name})"))
indexes = cursor.fetchall()
return [(index[1], index[3]) for index in indexes]
result = []
for idx in indexes:
index_name = idx[1]
cursor = self.session.execute(text(f"PRAGMA index_info({index_name})"))
index_infos = cursor.fetchall()
column_names = [index_info[2] for index_info in index_infos]
result.append({"name": index_name, "column_names": column_names})
return result
def get_show_create_table(self, table_name):
"""Get table show create table about specified table."""