mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-04-28 11:54:20 +08:00
Merge branch 'master' of github.com:tencentmusic/supersonic
This commit is contained in:
@@ -186,6 +186,9 @@ public class DatabaseServiceImpl extends ServiceImpl<DatabaseDOMapper, DatabaseD
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DBColumn> getColumns(Long id, String sql) throws SQLException {
|
public List<DBColumn> getColumns(Long id, String sql) throws SQLException {
|
||||||
|
if (sql.endsWith(";")) {
|
||||||
|
sql = sql.substring(0, sql.length() - 1);
|
||||||
|
}
|
||||||
String wrapSql = String.format("select * from (%s) a limit 1", sql);
|
String wrapSql = String.format("select * from (%s) a limit 1", sql);
|
||||||
DatabaseResp databaseResp = getDatabase(id);
|
DatabaseResp databaseResp = getDatabase(id);
|
||||||
SemanticQueryResp semanticQueryResp = executeSql(wrapSql, databaseResp);
|
SemanticQueryResp semanticQueryResp = executeSql(wrapSql, databaseResp);
|
||||||
|
|||||||
Reference in New Issue
Block a user