Migrates EventStore from Android's SQLLite to KMP

Fixes testing of libsodium between java and android
This commit is contained in:
Vitor Pamplona
2026-03-20 16:00:17 -04:00
parent c5066d89c3
commit d431b12f94
53 changed files with 22041 additions and 513 deletions
@@ -51,7 +51,7 @@ class LargeDBInsertBenchmark : BaseLargeCacheBenchmark() {
benchmarkRule.measureRepeated {
val db =
runWithMeasurementDisabled {
EventStore(context, null)
EventStore(null)
}
firstThousandEvents.forEach { event ->
try {
@@ -81,7 +81,8 @@ class LargeDBInsertBenchmark : BaseLargeCacheBenchmark() {
benchmarkRule.measureRepeated {
val db =
runWithMeasurementDisabled {
val db = EventStore(context, null)
val db =
EventStore(null)
toBeDeletedEvents.forEach { event ->
try {
db.insert(event)
@@ -49,14 +49,14 @@ class LargeDBQueryingBenchmark : BaseLargeCacheBenchmark() {
val allEvents = getEventDB().distinctBy { it.id }.sortedBy { it.createdAt }
}
lateinit var db: EventStore
lateinit var db: com.vitorpamplona.quartz.nip01Core.store.sqlite.EventStore
@Before
fun setup() {
val context = ApplicationProvider.getApplicationContext<Context>()
context.deleteDatabase("allEvents.db")
db = EventStore(context, "allEvents.db")
db = EventStore("allEvents.db")
allEvents.forEach { event ->
try {
db.insert(event)