Skip to content

Commit

Permalink
Merge pull request #75 from gerry-f2c/pr@v3@perf_oracle_sql_parsing
Browse files Browse the repository at this point in the history
perf: Optimize Oracle SQL parsing
  • Loading branch information
Aaron3S authored Jan 8, 2025
2 parents 7624871 + 7eff186 commit 884bffc
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.jumpserver.chen.modules.oracle;

import com.alibaba.druid.DbType;
import com.alibaba.druid.sql.SQLUtils;
import org.jumpserver.chen.framework.datasource.ConnectionManager;
import org.jumpserver.chen.framework.datasource.base.BaseSQLActuator;
import org.jumpserver.chen.framework.datasource.sql.SQL;
Expand Down Expand Up @@ -59,4 +61,11 @@ public SQLExecutePlan createPlan(SQL sql) throws SQLException {
this.beforeCreatePlan(sql);
return super.createPlan(sql);
}

@Override
public List<String> parseSQL(SQL sql) {
return SQLUtils.parseStatements(sql.getSql(), DbType.ali_oracle).stream()
.map(stmt -> SQLUtils.toSQLString(stmt, DbType.ali_oracle))
.toList();
}
}

0 comments on commit 884bffc

Please sign in to comment.