Skip to content

Commit 3309437

Browse files
committed
update sqldelight to 1.5.3 + other minor fixes
1 parent 4dcaae1 commit 3309437

File tree

8 files changed

+41
-8
lines changed
  • buildSrc/src/main/kotlin
  • common
    • features/list/src/commonTest/kotlin/work.racka.thinkrchive.v2.common/features/list/repository
    • persistence/database/src
      • androidMain/kotlin/work/racka/thinkrchive/v2/common/database/di
      • androidTest/kotlin/work/racka/thinkrchive/v2/common/database/di
      • commonMain/kotlin/work.racka.thinkrchive.v2.common.database/util
      • desktopMain/kotlin/work/racka/thinkrchive/v2/common/database/di
      • desktopTest/kotlin/work/racka/thinkrchive/v2/common/database/di
  • desktopApp

8 files changed

+41
-8
lines changed

buildSrc/src/main/kotlin/Versions.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ object Versions {
1010
const val composeDesktop = "1.1.1"
1111

1212
// Squareup
13-
const val sqlDelight = "1.5.0"
13+
const val sqlDelight = "1.5.3"
1414

1515
// Architecture
1616
const val mviKotlin = "3.0.0-beta01"
@@ -24,7 +24,7 @@ object Versions {
2424
const val coreKtx = "1.7.0"
2525

2626
// Compose Base
27-
const val compose = "1.2.0-alpha06"
27+
const val compose = "1.2.0-alpha07"
2828
const val composeConstraintLayout = "1.0.0-beta02"
2929
const val composeMaterial3 = "1.0.0-alpha08"
3030
const val activityCompose = "1.4.0"

common/features/list/src/commonTest/kotlin/work.racka.thinkrchive.v2.common/features/list/repository/ListRepositoryTest.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,11 @@ class ListRepositoryTest : KoinTest {
223223
val data = repo.getThinkpadsLowPriceFirst(query)
224224
launch {
225225
data.test {
226-
val actual = expectMostRecentItem()
226+
val actual = awaitItem()
227227

228228
verify { dao.getThinkpadsLowPriceFirst(query) }
229229
assertEquals(expected, actual)
230+
awaitComplete()
230231
}
231232
}
232233
}

common/persistence/database/src/androidMain/kotlin/work/racka/thinkrchive/v2/common/database/di/Platform.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ internal actual object Platform {
1414
context = get(),
1515
name = Constants.THINKPAD_DATABASE
1616
)
17-
ThinkrchiveDatabaseWrapper(ThinkpadDatabase(driver))
17+
ThinkrchiveDatabaseWrapper(
18+
ThinkpadDatabase(
19+
driver = driver
20+
)
21+
)
1822
}
1923
}
2024
}

common/persistence/database/src/androidTest/kotlin/work/racka/thinkrchive/v2/common/database/di/TestPlatform.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ internal actual object TestPlatform {
1010
single {
1111
val driver = JdbcSqliteDriver(JdbcSqliteDriver.IN_MEMORY)
1212
.also { ThinkpadDatabase.Schema.create(it) }
13-
ThinkrchiveDatabaseWrapper(ThinkpadDatabase(driver))
13+
ThinkrchiveDatabaseWrapper(
14+
ThinkpadDatabase(
15+
driver = driver
16+
)
17+
)
1418
}
1519
}
1620
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package work.racka.thinkrchive.v2.common.database.util
2+
3+
import com.squareup.sqldelight.ColumnAdapter
4+
5+
internal object TypeAdapters {
6+
private val longToIntAdapter = object : ColumnAdapter<Int, Long> {
7+
override fun decode(databaseValue: Long): Int = databaseValue.toInt()
8+
override fun encode(value: Int): Long = value.toLong()
9+
}
10+
11+
// To be used when upgrading to 2.0.0 release
12+
/*fun thinkpadListTableAdapter() = ThinkpadListTable(
13+
marketPriceEndAdapter = longToIntAdapter,
14+
marketPriceStartAdapter = longToIntAdapter
15+
)*/
16+
}

common/persistence/database/src/desktopMain/kotlin/work/racka/thinkrchive/v2/common/database/di/Platform.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ internal actual object Platform {
1010
single {
1111
val driver = JdbcSqliteDriver(JdbcSqliteDriver.IN_MEMORY)
1212
.also { ThinkpadDatabase.Schema.create(it) }
13-
ThinkrchiveDatabaseWrapper(ThinkpadDatabase(driver))
13+
ThinkrchiveDatabaseWrapper(
14+
ThinkpadDatabase(
15+
driver = driver
16+
)
17+
)
1418
}
1519
}
1620
}

common/persistence/database/src/desktopTest/kotlin/work/racka/thinkrchive/v2/common/database/di/TestPlatform.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ internal actual object TestPlatform {
1010
single {
1111
val driver = JdbcSqliteDriver(JdbcSqliteDriver.IN_MEMORY)
1212
.also { ThinkpadDatabase.Schema.create(it) }
13-
ThinkrchiveDatabaseWrapper(ThinkpadDatabase(driver))
13+
ThinkrchiveDatabaseWrapper(
14+
ThinkpadDatabase(
15+
driver = driver
16+
)
17+
)
1418
}
1519
}
1620
}

desktopApp/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ kotlin {
3232
implementation(compose.ui)
3333
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
3434
implementation(compose.desktop.components.splitPane)
35-
implementation("org.jetbrains.compose.material:material-icons-extended-desktop:1.0.0-rc11")
35+
implementation(compose.materialIconsExtended)
3636

3737
implementation(Dependencies.OrbitMVI.core)
3838

0 commit comments

Comments
 (0)