Skip to content

Commit

Permalink
remove comments when executing queries
Browse files Browse the repository at this point in the history
  • Loading branch information
zefir-git committed Aug 7, 2023
1 parent 3fef8e7 commit 3531908
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ private void initDb() throws @NotNull SQLException, @NotNull IOException {
throw e;
}
final @NotNull String[] queries = setup.split(";");
for (final @NotNull String query : queries) {
for (@NotNull String query : queries) {
query = query.stripTrailing().stripIndent().replaceAll("^\\s+(?:--.+)*", "");
if (query.isBlank()) continue;
try (final @NotNull Connection conn = getDb().getConnection();
final @NotNull PreparedStatement stmt = conn.prepareStatement(query)) {
Expand Down

0 comments on commit 3531908

Please sign in to comment.