mirror of
https://github.com/wgtunnel/android.git
synced 2026-07-03 14:07:49 +02:00
9e797b24d6
closes #636
22 lines
634 B
Kotlin
22 lines
634 B
Kotlin
package com.zaneschepke.wireguardautotunnel.data
|
|
|
|
import androidx.room.RoomDatabase
|
|
import androidx.sqlite.db.SupportSQLiteDatabase
|
|
import timber.log.Timber
|
|
|
|
class DatabaseCallback : RoomDatabase.Callback() {
|
|
override fun onCreate(db: SupportSQLiteDatabase) =
|
|
db.run {
|
|
beginTransaction()
|
|
try {
|
|
execSQL(Queries.createDefaultSettings())
|
|
Timber.i("Bootstrapping settings data")
|
|
setTransactionSuccessful()
|
|
} catch (e: Exception) {
|
|
Timber.e(e)
|
|
} finally {
|
|
endTransaction()
|
|
}
|
|
}
|
|
}
|