mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-13 21:17:08 +00:00
[improvement][project] global refactor , code format , support llm , support fuzzy detect ,support query filter and so on.
This commit is contained in:
@@ -237,3 +237,32 @@ export function testDatabaseConnect(data: SaveDatabaseParams): Promise<any> {
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
type ExcuteSqlParams = {
|
||||
sql: string;
|
||||
domainId: number;
|
||||
};
|
||||
|
||||
// 执行脚本
|
||||
export async function excuteSql(params: ExcuteSqlParams) {
|
||||
const data = { ...params };
|
||||
return request.post(`${process.env.API_BASE_URL}database/executeSql`, { data });
|
||||
}
|
||||
|
||||
export function getDbNames(dbId: number): Promise<any> {
|
||||
return request(`${process.env.API_BASE_URL}database/getDbNames/${dbId}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
export function getTables(dbId: number, dbName: string): Promise<any> {
|
||||
return request(`${process.env.API_BASE_URL}database/getTables/${dbId}/${dbName}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
export function getColumns(dbId: number, dbName: string, tableName: string): Promise<any> {
|
||||
return request(`${process.env.API_BASE_URL}database/getColumns/${dbId}/${dbName}/${tableName}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user