Skip to content

Commit

Permalink
MGR-96
Browse files Browse the repository at this point in the history
  • Loading branch information
madness-inc committed Feb 4, 2020
1 parent c93255b commit 54239af
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -182,11 +182,12 @@ public void setHasError(boolean hasError) {
}

public List<String> getQueries(String sql, DatabaseConnection connection) {
Database<?> db = DatabaseFactory
.createDatabase(new FluentConfiguration().dataSource(connection.getDataSource()), true);
SqlScript sqlScript = new SqlScript(db.createSqlStatementBuilderFactory(), new StringResource(sql), false);
List<String> queries = new ArrayList<String>();
sqlScript.getSqlStatements().forEach(query -> queries.add(query.getSql()));
try (Database<?> db = DatabaseFactory
.createDatabase(new FluentConfiguration().dataSource(connection.getDataSource()), true)) {
SqlScript sqlScript = new SqlScript(db.createSqlStatementBuilderFactory(), new StringResource(sql), false);
sqlScript.getSqlStatements().forEach(query -> queries.add(query.getSql()));
}
return queries;
}

Expand Down

0 comments on commit 54239af

Please sign in to comment.