Use platform sqlite library again

pull/2977/head
Alex Baker 1 year ago
parent c9f4242c2a
commit d3421bd0c3

@ -184,7 +184,6 @@ dependencies {
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.androidx.lifecycle.viewmodel)
implementation(libs.androidx.room)
implementation(libs.androidx.sqlite)
implementation(libs.androidx.appcompat)
implementation(libs.iconics)
implementation(libs.markwon)

@ -43,7 +43,7 @@ class ContentProviderDaoBlocking @Inject constructor(
private fun SQLiteStatement.toCursor(): Cursor {
val cursor = MatrixCursor(getColumnNames().toTypedArray())
while (step()) {
cursor.addRow((0 until getColumnCount()).map { getText(it) })
cursor.addRow((0 until getColumnCount()).map { getTextOrNull(it) })
}
return cursor
}

@ -2,7 +2,6 @@ package org.tasks.injection
import android.content.Context
import androidx.room.Room
import androidx.sqlite.driver.bundled.BundledSQLiteDriver
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
@ -39,7 +38,6 @@ internal class ProductionModule {
name = databaseFile.absolutePath
)
.setQueryCoroutineContext(Dispatchers.IO)
.setDriver(BundledSQLiteDriver())
.addMigrations(*Migrations.migrations(context, fileStorage))
if (!BuildConfig.DEBUG || !preferences.getBoolean(R.string.p_crash_main_queries, false)) {
builder.allowMainThreadQueries()

@ -163,7 +163,7 @@ fun SQLiteStatement.getTasks(): List<TaskContainer> {
return result
}
private fun SQLiteStatement.getTextOrNull(index: Int): String? =
fun SQLiteStatement.getTextOrNull(index: Int): String? =
if (index == -1 || isNull(index)) null else this.getText(index)
private fun SQLiteStatement.getLongOrNull(index: Int): Long? =

@ -242,15 +242,13 @@
+| | | \--- androidx.sqlite:sqlite-android:2.5.0-alpha05
+| | | +--- androidx.annotation:annotation:1.8.0 (*)
+| | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 2.0.0 (*)
+| | | +--- androidx.sqlite:sqlite-framework:2.5.0-alpha05 (c)
+| | | \--- androidx.sqlite:sqlite-bundled:2.5.0-alpha05 (c)
+| | | \--- androidx.sqlite:sqlite-framework:2.5.0-alpha05 (c)
+| | +--- androidx.sqlite:sqlite-framework:2.5.0-alpha05
+| | | \--- androidx.sqlite:sqlite-framework-android:2.5.0-alpha05
+| | | +--- androidx.annotation:annotation:1.8.0 (*)
+| | | +--- androidx.sqlite:sqlite:2.5.0-alpha05 (*)
+| | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 2.0.0 (*)
+| | | +--- androidx.sqlite:sqlite:2.5.0-alpha05 (c)
+| | | \--- androidx.sqlite:sqlite-bundled:2.5.0-alpha05 (c)
+| | | \--- androidx.sqlite:sqlite:2.5.0-alpha05 (c)
+| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 2.0.0 (*)
+| | +--- org.jetbrains.kotlinx:atomicfu:0.17.0
+| | | \--- org.jetbrains.kotlinx:atomicfu-jvm:0.17.0
@ -971,12 +969,6 @@
+| \--- androidx.lifecycle:lifecycle-common-java8:2.8.3 (c)
++--- androidx.lifecycle:lifecycle-viewmodel:2.8.3 (*)
++--- androidx.room:room-runtime:2.7.0-alpha05 (*)
++--- androidx.sqlite:sqlite-bundled:2.5.0-alpha05
+| \--- androidx.sqlite:sqlite-bundled-android:2.5.0-alpha05
+| +--- androidx.sqlite:sqlite:2.5.0-alpha05 (*)
+| +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 2.0.0 (*)
+| +--- androidx.sqlite:sqlite:2.5.0-alpha05 (c)
+| \--- androidx.sqlite:sqlite-framework:2.5.0-alpha05 (c)
++--- androidx.appcompat:appcompat:1.7.0 (*)
++--- com.mikepenz:iconics-core:5.5.0-b01 (*)
++--- io.noties.markwon:core:4.6.2

@ -648,15 +648,13 @@
+| | | \--- androidx.sqlite:sqlite-android:2.5.0-alpha05
+| | | +--- androidx.annotation:annotation:1.8.0 (*)
+| | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 2.0.0 (*)
+| | | +--- androidx.sqlite:sqlite-framework:2.5.0-alpha05 (c)
+| | | \--- androidx.sqlite:sqlite-bundled:2.5.0-alpha05 (c)
+| | | \--- androidx.sqlite:sqlite-framework:2.5.0-alpha05 (c)
+| | +--- androidx.sqlite:sqlite-framework:2.5.0-alpha05
+| | | \--- androidx.sqlite:sqlite-framework-android:2.5.0-alpha05
+| | | +--- androidx.annotation:annotation:1.8.0 (*)
+| | | +--- androidx.sqlite:sqlite:2.5.0-alpha05 (*)
+| | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 2.0.0 (*)
+| | | +--- androidx.sqlite:sqlite:2.5.0-alpha05 (c)
+| | | \--- androidx.sqlite:sqlite-bundled:2.5.0-alpha05 (c)
+| | | \--- androidx.sqlite:sqlite:2.5.0-alpha05 (c)
+| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 2.0.0 (*)
+| | +--- org.jetbrains.kotlinx:atomicfu:0.17.0
+| | | \--- org.jetbrains.kotlinx:atomicfu-jvm:0.17.0
@ -1195,12 +1193,6 @@
+| \--- androidx.lifecycle:lifecycle-common-java8:2.8.3 (c)
++--- androidx.lifecycle:lifecycle-viewmodel:2.8.3 (*)
++--- androidx.room:room-runtime:2.7.0-alpha05 (*)
++--- androidx.sqlite:sqlite-bundled:2.5.0-alpha05
+| \--- androidx.sqlite:sqlite-bundled-android:2.5.0-alpha05
+| +--- androidx.sqlite:sqlite:2.5.0-alpha05 (*)
+| +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 -> 2.0.0 (*)
+| +--- androidx.sqlite:sqlite:2.5.0-alpha05 (c)
+| \--- androidx.sqlite:sqlite-framework:2.5.0-alpha05 (c)
++--- androidx.appcompat:appcompat:1.7.0 (*)
++--- com.mikepenz:iconics-core:5.5.0-b01 (*)
++--- io.noties.markwon:core:4.6.2

@ -85,7 +85,6 @@ androidx-preference = { module = "androidx.preference:preference", version.ref =
androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "recyclerview" }
androidx-room = { module = "androidx.room:room-runtime", version.ref = "room" }
androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "room"}
androidx-sqlite = { module = "androidx.sqlite:sqlite-bundled", version = "2.5.0-alpha05" }
androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "swiperefreshlayout" }
androidx-test-core = { module = "androidx.test:core", version.ref = "androidx-test" }
androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidx-test" }

Loading…
Cancel
Save