Skip to content

Commit

Permalink
Merge pull request #25 from cloudnode-pro/fix-sqlite-error
Browse files Browse the repository at this point in the history
Fix SQLite error caused by comments in `init-db/sql.sql`
  • Loading branch information
zefir-git committed Aug 7, 2023
2 parents 3fef8e7 + 3531908 commit 1d73dc6
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 1d73dc6

Please sign in to comment.