Skip to content

Commit

Permalink
Set sqlite PRAGMA via Url
Browse files Browse the repository at this point in the history
  • Loading branch information
AsamK committed Jan 14, 2025
1 parent e4af0be commit 74c2604
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,9 @@ private static HikariDataSource getHikariDataSource(final String databaseFile) {
sqliteConfig.setTransactionMode(SQLiteConfig.TransactionMode.IMMEDIATE);

HikariConfig config = new HikariConfig();
config.setJdbcUrl("jdbc:sqlite:" + databaseFile);
config.setJdbcUrl("jdbc:sqlite:" + databaseFile + "?foreign_keys=ON");
config.setDataSourceProperties(sqliteConfig.toProperties());
config.setMinimumIdle(1);
config.setConnectionInitSql("PRAGMA foreign_keys=ON");
return new HikariDataSource(config);
}
}

0 comments on commit 74c2604

Please sign in to comment.