youjie23 commented on PR #34156:
URL: https://github.com/apache/shardingsphere/pull/34156#issuecomment-2564739195
> I do not hope SQL input to be through Java's SPI. ShardingSphere is a
database (or database protocol), and all SQL-related content should be provided
through standard JDBC. It is better to use SPI for feature extend only, not
user API.
Thank for review.
So code like below is not expected?
collect like:
```
public class CollectSQLStatementParserCacheHook implements
SQLStatementParserCacheHook {
public void finishSuccess(String sql, SQLStatement sqlStatement) {
asyncSaveSqlToStorage(sql);
}
}
```
warmup like:
```
public class SqlParseWarmupHandler {
public void warmup() {
SQLStatementParserEngine sqlParseEngine =
SQLStatementParserEngineFactory.getSQLStatementParserEngine(new
MySQLDatabaseType(), new CacheOption(), new CacheOption());
List<String> sqlUsed = loadFromStorage();
for (String sql: sqlUsed) {
sqlParseEngine.parse(sql, true);
}
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]