public class SqlParserUtils extends Object
| Constructor and Description |
|---|
SqlParserUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canParseSqlStatement(String sqlCommand) |
static net.sf.jsqlparser.expression.Expression |
getWhere(net.sf.jsqlparser.statement.Statement parsedStatement) |
static boolean |
isDelete(String sqlCommand) |
static boolean |
isInsert(String sqlCommand) |
static boolean |
isSelect(String sqlCommand)
We only use the selects that refer to objects in the database that are meaningful for testing purposes,
when code access to a sequence for example when getting the next id for a new object in the table,
then we don't want to use that select as a target.
|
static boolean |
isSelectOne(String sqlCommand)
check if the sql is `Select 1`
detected by proxyprint as
ERROR - FAILED TO COMPUTE HEURISTICS FOR SQL: SELECT 1
https://stackoverflow.com/questions/3668506/efficient-sql-test-query-or-validation-query-that-will-work-across-all-or-most
|
static boolean |
isUpdate(String sqlCommand) |
static net.sf.jsqlparser.statement.Statement |
parseSqlCommand(String sqlCommand)
This method assumes that the SQL command can be successfully parsed.
|
public static boolean isSelect(String sqlCommand)
sqlCommand - public static boolean isDelete(String sqlCommand)
public static boolean isUpdate(String sqlCommand)
public static boolean isInsert(String sqlCommand)
public static boolean isSelectOne(String sqlCommand)
public static net.sf.jsqlparser.expression.Expression getWhere(net.sf.jsqlparser.statement.Statement parsedStatement)
public static net.sf.jsqlparser.statement.Statement parseSqlCommand(String sqlCommand)
sqlCommand - to be parsedpublic static boolean canParseSqlStatement(String sqlCommand)
Copyright © 2016–2024. All rights reserved.