Speeds up db deletions
This commit is contained in:
+3
-7
@@ -32,8 +32,8 @@ import com.vitorpamplona.quartz.nip01Core.relay.filters.Filter
|
|||||||
import com.vitorpamplona.quartz.nip40Expiration.isExpired
|
import com.vitorpamplona.quartz.nip40Expiration.isExpired
|
||||||
|
|
||||||
class SQLiteEventStore(
|
class SQLiteEventStore(
|
||||||
context: Context,
|
val context: Context,
|
||||||
dbName: String? = "events.db",
|
val dbName: String? = "events.db",
|
||||||
val relayUrl: String? = null,
|
val relayUrl: String? = null,
|
||||||
) : SQLiteOpenHelper(context, dbName, null, DATABASE_VERSION) {
|
) : SQLiteOpenHelper(context, dbName, null, DATABASE_VERSION) {
|
||||||
companion object {
|
companion object {
|
||||||
@@ -84,11 +84,7 @@ class SQLiteEventStore(
|
|||||||
) {}
|
) {}
|
||||||
|
|
||||||
fun clearDB() {
|
fun clearDB() {
|
||||||
val db = writableDatabase
|
context.deleteDatabase(dbName)
|
||||||
fullTextSearchModule.deleteAll(db)
|
|
||||||
rightToVanishModule.deleteAll(db)
|
|
||||||
expirationModule.deleteAll(db)
|
|
||||||
eventIndexModule.deleteAll(db)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun insertEvent(event: Event): Boolean {
|
fun insertEvent(event: Event): Boolean {
|
||||||
|
|||||||
Reference in New Issue
Block a user