Skip to content

Commit

Permalink
Enabme WAL (Write Ahead Logging) by default
Browse files Browse the repository at this point in the history
  • Loading branch information
BoD committed Apr 22, 2024
1 parent d271ab7 commit deab18b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ actual class SqlNormalizedCacheFactory actual constructor(
/**
* @param [name] Name of the database file, or null for an in-memory database (as per Android framework implementation).
* @param [factory] Factory class to create instances of [SupportSQLiteOpenHelper]
* @param [configure] Optional callback, called when the database connection is being configured, to enable features such as
* @param [configure] Optional callback, called when the database connection is being configured, to configure features such as
* write-ahead logging or foreign key support. It should not modify the database except to configure it.
* @param [useNoBackupDirectory] Sets whether to use a no backup directory or not.
* @param [windowSizeBytes] Size of cursor window in bytes, per [android.database.CursorWindow] (Android 28+ only), or null to use the default.
Expand All @@ -43,6 +43,7 @@ actual class SqlNormalizedCacheFactory actual constructor(
object : AndroidSqliteDriver.Callback(getSchema(withDates)) {
override fun onConfigure(db: SupportSQLiteDatabase) {
super.onConfigure(db)
db.enableWriteAheadLogging()
configure?.invoke(db)
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ actual class SqlNormalizedCacheFactory internal constructor(
/**
* @param [name] Name of the database file, or null for an in-memory database (as per Android framework implementation).
* @param [factory] Factory class to create instances of [SupportSQLiteOpenHelper]
* @param [configure] Optional callback, called when the database connection is being configured, to enable features such as
* @param [configure] Optional callback, called when the database connection is being configured, to configure features such as
* write-ahead logging or foreign key support. It should not modify the database except to configure it.
* @param [useNoBackupDirectory] Sets whether to use a no backup directory or not.
* @param [windowSizeBytes] Size of cursor window in bytes, per [android.database.CursorWindow] (Android 28+ only), or null to use the default.
Expand All @@ -41,6 +41,7 @@ actual class SqlNormalizedCacheFactory internal constructor(
object : AndroidSqliteDriver.Callback(getSchema()) {
override fun onConfigure(db: SupportSQLiteDatabase) {
super.onConfigure(db)
db.enableWriteAheadLogging()
configure?.invoke(db)
}
},
Expand Down

0 comments on commit deab18b

Please sign in to comment.