Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build & Test & Publish
name: Build & Publish

on:
workflow_dispatch:
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

- Date format: YYYY-MM-dd

## 2.0.0 / 2025-10-xx

### All

* Update `Kotlin`'s version to `2.2.20`
* Remove the Desuger configuration

### sqllin-driver

* Update the `sqlite-jdbc`'s version to `3.50.3.0`

### sqllin-processor

* Update `KSP`'s version to `2.2.20-2.0.4`

## 1.4.4 / 2025-07-07

### All
Expand Down
20 changes: 9 additions & 11 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
[versions]

kotlin = "2.2.0"
agp = "8.10.1"
ksp = "2.2.0-2.0.2"
kotlin = "2.2.20"
agp = "8.12.3"
ksp = "2.2.20-2.0.4"
serialization = "1.9.0"
coroutines = "1.10.2"
androidx-annotation = "1.9.1"
androidx-test = "1.6.1"
androidx-test-runner = "1.6.2"
sqlite-jdbc = "3.50.2.0"
desugar-jdk-libs = "2.1.5"
androidx-test = "1.7.0"
androidx-test-runner = "1.7.0"
sqlite-jdbc = "3.50.3.0"
jvm-toolchain = "21"
android-sdk-compile = "36"
android-sdk-min = "23"
vanniktech-maven-publish = "0.33.0"
vanniktech-maven-publish = "0.34.0"

[libraries]

ksp = { group = "com.google.devtools.ksp", name= "symbol-processing-api", version.ref = "ksp" }

kotlinx-serialization = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-core", version.ref = "serialization" }
kotlinx-coroutines = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "coroutines" }
kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "coroutines" }
kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "coroutines" }

androidx-annotation = { group = "androidx.annotation", name = "annotation", version.ref = "androidx-annotation" }
androidx-test-core = { group = "androidx.test", name = "core", version.ref = "androidx-test" }
Expand All @@ -29,8 +29,6 @@ androidx-test-rules = { group = "androidx.test", name = "rules", version.ref = "

sqlite-jdbc = { group = "org.xerial", name = "sqlite-jdbc", version.ref = "sqlite-jdbc" }

desugar-jdk-libs = { group = "com.android.tools", name = "desugar_jdk_libs", version.ref = "desugar-jdk-libs" }

[plugins]

kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
Expand Down
6 changes: 1 addition & 5 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ kotlin {
dependencies {
implementation(project(":sqllin-dsl"))
implementation(libs.kotlinx.serialization)
implementation(libs.kotlinx.coroutines)
implementation(libs.kotlinx.coroutines.core)
}
}
}
Expand All @@ -47,13 +47,9 @@ android {
defaultConfig {
minSdk = libs.versions.android.sdk.min.get().toInt()
}
compileOptions {
isCoreLibraryDesugaringEnabled = true
}
}

dependencies {
coreLibraryDesugaring(libs.desugar.jdk.libs)
add("kspCommonMainMetadata", project(":sqllin-processor"))
}

Expand Down
10 changes: 2 additions & 8 deletions sqllin-driver/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ kotlin {
}
commonTest.dependencies {
implementation(kotlin("test"))
implementation(libs.kotlinx.coroutines)
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.coroutines.test)
}
androidMain.dependencies {
implementation(libs.androidx.annotation)
Expand Down Expand Up @@ -105,9 +106,6 @@ android {
minSdk = libs.versions.android.sdk.min.get().toInt()
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
isCoreLibraryDesugaringEnabled = true
}
}

fun KotlinNativeTarget.setupNativeConfig() {
Expand All @@ -124,10 +122,6 @@ fun KotlinNativeTarget.setupNativeConfig() {
}
}

dependencies {
coreLibraryDesugaring(libs.desugar.jdk.libs)
}

mavenPublishing {
publishToMavenCentral()
signAllPublications()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.ctrip.sqllin.driver

import kotlinx.coroutines.*
import kotlinx.coroutines.test.runTest
import kotlin.test.assertEquals

/**
Expand Down Expand Up @@ -194,7 +195,7 @@ class CommonBasicTest(private val path: DatabasePath) {
}

@OptIn(DelicateCoroutinesApi::class, ExperimentalCoroutinesApi::class)
fun testConcurrency() = runBlocking {
fun testConcurrency() = runTest {
val readWriteConfig = getDefaultDBConfig(false)
openDatabase(readWriteConfig) {
launch(newSingleThreadContext("test0")) {
Expand Down
7 changes: 2 additions & 5 deletions sqllin-dsl-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@ kotlin {
dependencies {
implementation(project(":sqllin-dsl"))
implementation(libs.kotlinx.serialization)
implementation(libs.kotlinx.coroutines)
implementation(libs.kotlinx.coroutines.core)
}
}
commonTest.dependencies {
implementation(kotlin("test"))
implementation(libs.kotlinx.coroutines.test)
}
androidInstrumentedTest {
dependencies {
Expand All @@ -89,9 +90,6 @@ android {
minSdk = libs.versions.android.sdk.min.get().toInt()
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
isCoreLibraryDesugaringEnabled = true
}
}

fun KotlinNativeTarget.setupNativeConfig() {
Expand All @@ -107,7 +105,6 @@ fun KotlinNativeTarget.setupNativeConfig() {
}

dependencies {
coreLibraryDesugaring(libs.desugar.jdk.libs)
add("kspCommonMainMetadata", project(":sqllin-processor"))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ import com.ctrip.sqllin.dsl.sql.clause.*
import com.ctrip.sqllin.dsl.sql.clause.OrderByWay.ASC
import com.ctrip.sqllin.dsl.sql.clause.OrderByWay.DESC
import com.ctrip.sqllin.dsl.sql.statement.SelectStatement
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.newSingleThreadContext
import kotlinx.coroutines.test.runTest
import kotlin.test.assertEquals
import kotlin.test.assertNotEquals

Expand Down Expand Up @@ -77,7 +79,7 @@ class CommonBasicTest(private val path: DatabasePath) {
}
}
assertEquals(true, statement!!.getResults().any { it == book1 })
assertEquals(true, statement!!.getResults().any { it == book2 })
assertEquals(true, statement.getResults().any { it == book2 })

var statement1: SelectStatement<Book>? = null
var statement2: SelectStatement<Book>? = null
Expand Down Expand Up @@ -105,7 +107,7 @@ class CommonBasicTest(private val path: DatabasePath) {
}

assertEquals(true, statement!!.getResults().any { it == book1 })
assertEquals(true, statement!!.getResults().any { it == book2 })
assertEquals(true, statement.getResults().any { it == book2 })

val book1NewPrice = 18.96
val book2NewPrice = 21.95
Expand All @@ -124,7 +126,7 @@ class CommonBasicTest(private val path: DatabasePath) {
}

assertEquals(true, newResult!!.getResults().any { it == newBook1 })
assertEquals(true, newResult!!.getResults().any { it == newBook2 })
assertEquals(true, newResult.getResults().any { it == newBook2 })
}

fun testSelectWhereClause() = Database(getDefaultDBConfig(), true).databaseAutoClose { database ->
Expand Down Expand Up @@ -281,10 +283,10 @@ class CommonBasicTest(private val path: DatabasePath) {
}
}
assertEquals(7, statement!!.getResults().size)
assertEquals(2, statement!!.getResults().count { it == book0 })
assertEquals(2, statement!!.getResults().count { it == book1 })
assertEquals(1, statement!!.getResults().count { it == book2 })
assertEquals(2, statement!!.getResults().count { it == book3 })
assertEquals(2, statement.getResults().count { it == book0 })
assertEquals(2, statement.getResults().count { it == book1 })
assertEquals(1, statement.getResults().count { it == book2 })
assertEquals(2, statement.getResults().count { it == book3 })
}

fun testFunction() = Database(getDefaultDBConfig(), true).databaseAutoClose { database ->
Expand Down Expand Up @@ -370,11 +372,12 @@ class CommonBasicTest(private val path: DatabasePath) {
assertEquals(outerJoinStatementWithOn?.getResults()?.size, books.size)
}

@OptIn(DelicateCoroutinesApi::class, ExperimentalCoroutinesApi::class)
fun testConcurrency() = Database(getDefaultDBConfig(), true).databaseAutoClose { database ->
runBlocking(Dispatchers.Default) {
runTest {
val book1 = Book(name = "The Da Vinci Code", author = "Dan Brown", pages = 454, price = 16.96)
val book2 = Book(name = "The Lost Symbol", author = "Dan Brown", pages = 510, price = 19.95)
launch {
launch(newSingleThreadContext("test0")) {
lateinit var statement: SelectStatement<Book>
database suspendedScope {
statement = BookTable { table ->
Expand All @@ -385,7 +388,7 @@ class CommonBasicTest(private val path: DatabasePath) {
assertEquals(true, statement.getResults().any { it == book1 })
assertEquals(true, statement.getResults().any { it == book2 })
}
launch {
launch(newSingleThreadContext("test1")) {
val book1NewPrice = 18.96
val book2NewPrice = 21.95
val newBook1 = Book(name = "The Da Vinci Code", author = "Dan Brown", pages = 454, price = book1NewPrice)
Expand All @@ -407,7 +410,7 @@ class CommonBasicTest(private val path: DatabasePath) {

fun testPrimitiveTypeForKSP() {
TestPrimitiveTypeForKSPTable {
SET<TestPrimitiveTypeForKSP> {
SET {
assertEquals(0, testInt)
assertEquals(0L, testLong)
assertEquals(0, testShort)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ class JvmTest {
@Test
fun testJoinClause() = commonTest.testJoinClause()

@Test
fun testConcurrency() = commonTest.testConcurrency()

@Test
fun testPrimitiveTypeForKSP() = commonTest.testPrimitiveTypeForKSP()

Expand Down
9 changes: 1 addition & 8 deletions sqllin-dsl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ kotlin {
commonMain.dependencies {
api(project(":sqllin-driver"))
implementation(libs.kotlinx.serialization)
implementation(libs.kotlinx.coroutines)
implementation(libs.kotlinx.coroutines.core)
}
}
}
Expand All @@ -87,13 +87,6 @@ android {
defaultConfig {
minSdk = libs.versions.android.sdk.min.get().toInt()
}
compileOptions {
isCoreLibraryDesugaringEnabled = true
}
}

dependencies {
coreLibraryDesugaring(libs.desugar.jdk.libs)
}

mavenPublishing {
Expand Down
Loading