mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Set sqlite PRAGMA via Url
This commit is contained in:
parent
e4af0be0ad
commit
74c2604dc8
1 changed files with 1 additions and 2 deletions
|
@ -95,10 +95,9 @@ public abstract class Database implements AutoCloseable {
|
||||||
sqliteConfig.setTransactionMode(SQLiteConfig.TransactionMode.IMMEDIATE);
|
sqliteConfig.setTransactionMode(SQLiteConfig.TransactionMode.IMMEDIATE);
|
||||||
|
|
||||||
HikariConfig config = new HikariConfig();
|
HikariConfig config = new HikariConfig();
|
||||||
config.setJdbcUrl("jdbc:sqlite:" + databaseFile);
|
config.setJdbcUrl("jdbc:sqlite:" + databaseFile + "?foreign_keys=ON");
|
||||||
config.setDataSourceProperties(sqliteConfig.toProperties());
|
config.setDataSourceProperties(sqliteConfig.toProperties());
|
||||||
config.setMinimumIdle(1);
|
config.setMinimumIdle(1);
|
||||||
config.setConnectionInitSql("PRAGMA foreign_keys=ON");
|
|
||||||
return new HikariDataSource(config);
|
return new HikariDataSource(config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue