Skip to content

Commit fd89091

Browse files
authored
Merge pull request #103 from qiaoyuang/main
Update sqlite-jdbc's version to 3.49.0.0
2 parents 24217ed + bcd2f98 commit fd89091

File tree

7 files changed

+12
-9
lines changed

7 files changed

+12
-9
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# SQLlin Change Log
22

33
- Date format: YYYY-MM-dd
4+
-
5+
## v1.4.2 / 2025-xx-xx
6+
7+
### sqllin-driver
8+
9+
* Update the `sqlite-jdbc`'s version to `3.49.0.0`
410

511
## v1.4.1 / 2025-02-04
612

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ coroutines = "1.10.1"
88
androidx-annotation = "1.9.1"
99
androidx-test = "1.6.1"
1010
androidx-test-runner = "1.6.2"
11-
sqlite-jdbc = "3.48.0.0"
11+
sqlite-jdbc = "3.49.0.0"
1212

1313
[libraries]
1414

sqllin-driver/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ _sqllin-driver_ use the _New Native Driver_.
3535
Whatever, [SQLiter](https://github.com/touchlab/SQLiter) still is a good project. I referred to a lot of designs and code
3636
details from it and use them in _New Native Driver_ in _sqllin-driver_ .
3737

38-
Since `1.2.0`, SQLlin started to support JVM target, and it's base on [sqlite-jdbc](https://github.com/xerial/sqlite-jdbc).
38+
Since `1.2.0`, SQLlin started to support JVM target, and it's based on [sqlite-jdbc](https://github.com/xerial/sqlite-jdbc).
3939

4040
## Basic usage
4141

sqllin-driver/README_CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
source set 可用的通用 API,并且它们在不同的平台有不同的实现。
88

99
在 Android 上,并没有太多的方法可供我们选择。如果我们使用 Android Framework SQLite Java
10-
API,事情将会变得非常简单,但是缺点是很多 SQLite 参数不能再 Android P 以下版本的系统上生效。如果我们自己编写
10+
API,事情将会变得非常简单,但是缺点是很多 SQLite 参数不能在 Android P 以下版本的系统上生效。如果我们自己编写
1111
JNI 代码去调用 SQLite C 函数,看起来可以解决这个问题,但是会遇到一个更大的问题:在版本高于 Android N
1212
的系统上,Google 不允许开发者在 NDK 中调用系统内置的 SQLite C 函数。如果我们坚定地选择这条路,我们必须自己将
1313
SQLite 源码编译到 _sqllin-driver_ ,这将让我们的工程变得更复杂。最后我们还是选择了基于 Android Framework Java API。

sqllin-driver/src/androidMain/kotlin/com/ctrip/sqllin/driver/ExtensionAndroid.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public fun Context.toDatabasePath(): DatabasePath = AndroidDatabasePath(this)
3434
internal value class AndroidDatabasePath(val context: Context) : DatabasePath
3535

3636
public actual fun openDatabase(config: DatabaseConfiguration): DatabaseConnection {
37-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && config.inMemory)
38-
return AndroidDatabaseConnection(createInMemory(config.toAndroidOpenParams()))
3937
val isEqualsOrHigherThanAndroidP = Build.VERSION.SDK_INT >= Build.VERSION_CODES.P
38+
if (isEqualsOrHigherThanAndroidP && config.inMemory)
39+
return AndroidDatabaseConnection(createInMemory(config.toAndroidOpenParams()))
4040
val helper = if (isEqualsOrHigherThanAndroidP)
4141
AndroidDBHelper(config)
4242
else

sqllin-driver/src/jvmMain/kotlin/com/ctrip/sqllin/driver/JdbcDatabaseConnection.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.ctrip.sqllin.driver
1818

19-
import java.lang.IllegalStateException
2019
import java.sql.Connection
2120

2221
import java.sql.PreparedStatement

sqllin-driver/src/nativeInterop/cinterop/sqlite3.def

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ package = com.ctrip.sqllin.sqlite3
22
headers = sqlite3.h
33
headerFilter = sqlite3*.h
44

5-
linkerOpts.linux_x64 = -lpthread -ldl
6-
linkerOpts.macos_x64 = -lpthread -ldl
7-
linkerOpts.macos_arm64 = -lpthread -ldl
5+
linkerOpts.linux = -lpthread -ldl
86

97
noStringConversion = sqlite3_prepare_v2 sqlite3_prepare_v3
108

0 commit comments

Comments
 (0)