use of com.abubusoft.kripton.processor.sqlite.grammars.jsql.JqlParser.Select_stmtContext in project kripton by xcesco.
the class SQLiteUpdateTestHelper method readSQLFromFile.
public static List<String> readSQLFromFile(String sqlDefinitionFile) {
try {
final List<String> executionList = new ArrayList<>();
File f = new File(sqlDefinitionFile);
final String ddl = IOUtils.toString(new FileInputStream(f), Charset.forName("utf-8"));
MigrationSQLChecker.getInstance().analyze(ddl, new JqlBaseListener() {
public void enterSelect_stmt(Select_stmtContext ctx) {
}
public void enterSql_stmt(Sql_stmtContext ctx) {
;
int start = ctx.getStart().getStartIndex();
int stop = ctx.getStop().getStopIndex() + 1;
if (start == stop)
return;
String statement = ddl.substring(start, stop).trim();
executionList.add(statement);
}
});
return executionList;
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
Aggregations