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
8 changes: 5 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ name: Build & Test
on:
push:
branches:
- '*'
- main
- 'release/**'
pull_request:
branches:
- '*'
branches:
- main
- 'release/**'

jobs:

Expand Down
80 changes: 3 additions & 77 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,87 +41,13 @@ jobs:
${{ runner.os }}-konan-

- name: Build sqllin-driver
run: ./gradlew :sqllin-driver:assemble -PonCICD

- name: Build sqllin-dsl
run: ./gradlew :sqllin-dsl:assemble -PonCICD

- name: Publish to MavenCentral
run: ./publish_apple_android_jvm.sh

build-on-windows:
runs-on: windows-latest
timeout-minutes: 60

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Cache Kotlin/Native
uses: actions/cache@v4
with:
path: ~/.konan
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-konan-

- name: Build sqllin-driver
run: ./gradlew :sqllin-driver:mingwX64MainKlibrary

- name: Build sqllin-dsl
run: ./gradlew :sqllin-dsl:mingwX64MainKlibrary

- name: Publish to MavenCentral
run: ./gradlew :sqllin-driver:publishMingwX64PublicationToMavenCentralRepository && ./gradlew :sqllin-dsl:publishMingwX64PublicationToMavenCentralRepository

build-on-linux:
runs-on: ubuntu-latest
timeout-minutes: 60

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Cache Kotlin/Native
uses: actions/cache@v4
with:
path: ~/.konan
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-konan-

- name: Build sqllin-driver
run: ./gradlew :sqllin-driver:assemble -PonCICD
run: ./gradlew :sqllin-driver:assemble

- name: Build sqllin-processor
run: ./gradlew :sqllin-processor:assemble

- name: Build sqllin-dsl
run: ./gradlew :sqllin-dsl:assemble -PonCICD
run: ./gradlew :sqllin-dsl:assemble

- name: Publish to MavenCentral
run: ./publish_linux_processor.sh
run: ./publish_all.sh
14 changes: 9 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,28 @@

- Date format: YYYY-MM-dd

## 2.3.0 / 2026-05-16
## 2.3.0 / 2026-08-20

### All

* Update `Kotlin`'s version to `2.3.21`
* Update `AGP`'s version to `9.0.0`, migrated from `com.android.library` plugin to `com.android.kotlin.multiplatform.library`
* Update `Kotlin`'s version to `2.4.10`
* Update `AGP`'s version to `9.3.1`, migrated from `com.android.library` plugin to `com.android.kotlin.multiplatform.library`
* Update `kotlinx.serialization`'s version to `1.11.0`
* Update `kotlinx.coroutines`'s version to `1.11.0`
* Fix documentation: Android minimum supported version has been `7.0+` (API 24) since `2.0.0`, the README incorrectly stated `6.0+`
* **Breaking change**: Drop `iosX64`, `macosX64`, `watchosX64`, and `tvosX64` target support

### sqllin-dsl

* New DSL API: `DatabaseScope#INSERT_OR_REPLACE` for SQL syntax `INSERT OR REPLACE`

### sqllin-driver

* Update `sqlite-jdbc`'s version to `3.53.1.0`
* Update `sqlite-jdbc`'s version to `3.53.2.1`

### sqllin-processor

* Update `KSP`'s version to `2.3.7`
* Update `KSP`'s version to `2.3.11`

## 2.2.0 / 2025-12-15

Expand Down
14 changes: 7 additions & 7 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# SQLlin Roadmap

## High Priority

* Support FOREIGN KEY DSL (2.2.0 ✅)
* Support CREATE INDEX DSL (2.2.0 ✅)
* Support INSERT OR REPLACE

## Medium Priority

* Support WASM platform DSL
Expand All @@ -18,4 +12,10 @@
## Low Priority

* Support store instances of kotlinx.datetime
* Support CHECK keyword
* Support CHECK keyword

## Supported

* Support INSERT OR REPLACE (2.3.0 ✅)
* Support FOREIGN KEY DSL (2.2.0 ✅)
* Support CREATE INDEX DSL (2.2.0 ✅)
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ org.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=16g -XX:+HeapDumpOnOutOfMemoryErr
org.gradle.workers.max=16
org.gradle.parallel=true
org.gradle.caching=true
# Enabled parallel sync for Gradle 9.4+
org.gradle.tooling.parallel=true

#Android
android.useAndroidX=true
Expand All @@ -31,4 +33,4 @@ kotlin.native.ignoreDisabledTargets=true
kotlin.jvm.target.validation.mode=warning
kotlin.native.binary.pagedAllocator=false
kotlin.native.binary.latin1Strings=true
#kotlin.compiler.execution.strategy=out-of-process
#kotlin.compiler.execution.strategy=out-of-process
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[versions]

kotlin = "2.3.21"
agp = "9.2.1"
ksp = "2.3.7"
kotlin = "2.4.10"
agp = "9.3.1"
ksp = "2.3.11"
serialization = "1.11.0"
coroutines = "1.11.0"
androidx-annotation = "1.10.0"
androidx-test = "1.7.0"
androidx-test-runner = "1.7.0"
sqlite-jdbc = "3.53.1.0"
sqlite-jdbc = "3.53.2.1"
jvm-toolchain = "21"
android-sdk-compile = "37"
android-sdk-min = "24"
vanniktech-maven-publish = "0.36.0"
vanniktech-maven-publish = "0.37.0"

[libraries]

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Mar 08 15:11:46 CST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
5 changes: 3 additions & 2 deletions publish_apple_android_jvm.sh → publish_all.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Publish artifacts on macOS env
./gradlew :sqllin-driver:publishAllPublicationsToMavenCentralRepository -PonCICD
./gradlew :sqllin-dsl:publishAllPublicationsToMavenCentralRepository -PonCICD
./gradlew :sqllin-driver:publishAllPublicationsToMavenCentralRepository
./gradlew :sqllin-dsl:publishAllPublicationsToMavenCentralRepository
./gradlew :sqllin-processor:publishMavenPublicationToMavenCentralRepository
6 changes: 0 additions & 6 deletions publish_linux_processor.sh

This file was deleted.

10 changes: 4 additions & 6 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ kotlin {
iosSimulatorArm64()

compilerOptions {
freeCompilerArgs.addAll("-Xexpect-actual-classes", "-Xcontext-parameters")
freeCompilerArgs.addAll("-Xexpect-actual-classes")
}

sourceSets {
Expand All @@ -48,9 +48,7 @@ dependencies {

afterEvaluate { // WORKAROUND: both register() and named() fail – https://github.com/gradle/gradle/issues/9331
tasks {
withType<KotlinCompilationTask<*>> {
if (name != "kspCommonMainKotlinMetadata")
dependsOn("kspCommonMainKotlinMetadata")
}
matching { (it is KotlinCompilationTask<*> || it.name.startsWith("ksp")) && it.name != "kspCommonMainKotlinMetadata" }
.configureEach { dependsOn("kspCommonMainKotlinMetadata") }
}
}
}
2 changes: 1 addition & 1 deletion sqllin-driver-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ kotlin {
}

compilerOptions {
freeCompilerArgs.addAll("-Xexpect-actual-classes", "-Xcontext-parameters")
freeCompilerArgs.addAll("-Xexpect-actual-classes")
}

sourceSets {
Expand Down
1 change: 0 additions & 1 deletion sqllin-driver-test/build/konan.txt

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion sqllin-driver/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ kotlin {
}

compilerOptions {
freeCompilerArgs.addAll("-Xexpect-actual-classes", "-Xcontext-parameters")
freeCompilerArgs.addAll("-Xexpect-actual-classes")
}

sourceSets {
Expand Down
10 changes: 4 additions & 6 deletions sqllin-dsl-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ kotlin {
}

compilerOptions {
freeCompilerArgs.addAll("-Xexpect-actual-classes", "-Xcontext-parameters")
freeCompilerArgs.addAll("-Xexpect-actual-classes")
}

sourceSets {
Expand Down Expand Up @@ -109,9 +109,7 @@ dependencies {

afterEvaluate { // WORKAROUND: both register() and named() fail – https://github.com/gradle/gradle/issues/9331
tasks {
withType<KotlinCompilationTask<*>> {
if (name != "kspCommonMainKotlinMetadata")
dependsOn("kspCommonMainKotlinMetadata")
}
matching { (it is KotlinCompilationTask<*> || it.name.startsWith("ksp")) && it.name != "kspCommonMainKotlinMetadata" }
.configureEach { dependsOn("kspCommonMainKotlinMetadata") }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ class AndroidTest {
@Test
fun testInsertWithId() = commonTest.testInsertWithId()

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,58 @@ class CommonBasicTest(private val path: DatabasePath) {
}
}

@OptIn(AdvancedInsertAPI::class)
fun testInsertOrReplace() {
Database(getNewAPIDBConfig()).databaseAutoClose { database ->
// Insert an initial entity with a known ID
val original = PersonWithId(id = 100L, name = "Eve", age = 28)
database {
PersonWithIdTable { table ->
table INSERT_WITH_ID original
}
}

lateinit var selectStatement: SelectStatement<PersonWithId>
database {
selectStatement = PersonWithIdTable SELECT X
}
assertEquals(1, selectStatement.getResults().size)
assertEquals(100L, selectStatement.getResults().first().id)
assertEquals("Eve", selectStatement.getResults().first().name)

// INSERT_OR_REPLACE with the same PK — should replace the existing row
val replacement = PersonWithId(id = 100L, name = "Eve Updated", age = 29)
database {
PersonWithIdTable { table ->
table INSERT_OR_REPLACE replacement
}
}

database {
selectStatement = PersonWithIdTable SELECT X
}
val resultsAfterReplace = selectStatement.getResults()
assertEquals(1, resultsAfterReplace.size)
assertEquals(100L, resultsAfterReplace.first().id)
assertEquals("Eve Updated", resultsAfterReplace.first().name)
assertEquals(29, resultsAfterReplace.first().age)

// INSERT_OR_REPLACE with a new entity (null ID) — should insert without conflict
val newEntity = PersonWithId(id = null, name = "Frank", age = 35)
database {
PersonWithIdTable { table ->
table INSERT_OR_REPLACE newEntity
}
}

database {
selectStatement = PersonWithIdTable SELECT X
}
assertEquals(2, selectStatement.getResults().size)
assertEquals(true, selectStatement.getResults().any { it.name == "Frank" })
}
}

fun testCreateInDatabaseScope() {
Database(getNewAPIDBConfig()).databaseAutoClose { database ->
val person = PersonWithId(id = null, name = "Grace", age = 40)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ class JvmTest {
@Test
fun testInsertWithId() = commonTest.testInsertWithId()

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ class NativeTest {
@Test
fun testInsertWithId() = commonTest.testInsertWithId()

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

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

Expand Down
Loading
Loading