Skip to content

Commit f11778b

Browse files
authored
Merge pull request #28 from qiaoyuang/main
Fix some docs
2 parents c4db615 + 88c70d4 commit f11778b

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

sqllin-driver/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ our project. Finally we still choose based on Android Framework Java API.
1818

1919
In Native platforms, things look different. We can call SQLite C API directly, this is the most intuitive way.
2020
The ability of Kotlin/Native interop with C is very perfect, but in Kotlin/Native you must use some APIs to
21-
complete interop with C that very difficult to understanding, like: `memScoped`, `CPointer`, `CPointerVarOf`, `toKString` etc..
21+
complete interop with C that very difficult to understanding, like: `memScoped`, `CPointer`, `CPointerVarOf`, `toKString`, etc..
2222
So, in the beginning, I chose the [SQLiter](https://github.com/touchlab/SQLiter), that's a Kotlin/Native multiplatform
2323
library. If I use it, I can put the Kotlin-C interop translate to Kotlin language-internal calls. It is very
2424
convenient. [SQLiter](https://github.com/touchlab/SQLiter) also is the driver that
@@ -30,6 +30,8 @@ example, [SQLiter](https://github.com/touchlab/SQLiter) updates very infrequentl
3030
it still hasn't been merged, and no one replied to me. And, after Kotlin `1.8.0`, Kotlin/Native added a new target:
3131
`watchosDeviceArm64`. Due to [SQLiter](https://github.com/touchlab/SQLiter) updates infrequently, SQLlin can't support
3232
`watchosDeviceArm64` either. So, I decided to implement interop with SQLite C APIs by myself as I originally conceived.
33+
Before the version `1.1.0`, _sqllin-driver_ use [SQLiter](https://github.com/touchlab/SQLiter), and after `1.1.0`(including),
34+
_sqllin-driver_ use the _New Native Driver_.
3335

3436
Whatever, [SQLiter](https://github.com/touchlab/SQLiter) still is a good project. I referred to a lot of designs and code
3537
details from it and use them in _New Native Driver_ in _sqllin-driver_ .

sqllin-driver/README_CN.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ Windows(mingwX86, mingwX64)。
2121

2222
但是在几个月后,我发现使用 [SQLiter](https://github.com/touchlab/SQLiter) 也有许多缺点。比如说,[SQLiter](https://github.com/touchlab/SQLiter) 的更新频率非常低。我提交了一个 PR
2323
很长时间没有被合并,也没有人回复我。并且,在 Kotlin `1.8.0` 之后,Kotlin/Native 新增了一个目标平台:`watchosDeviceArm64`。由于 [SQLiter](https://github.com/touchlab/SQLiter)
24-
更新缓慢,SQLlin 也同样无法支持 `watchosDeviceArm64`。所以我决定自己重新实现与 SQLite C API 的互操作,就像最开始构想的那样。
24+
更新缓慢,SQLlin 也同样无法支持 `watchosDeviceArm64`。所以我决定自己重新实现与 SQLite C API 的互操作,就像最开始构想的那样。在 `1.1.0` 版本之前,_sqllin-driver_ 使用
25+
[SQLiter](https://github.com/touchlab/SQLiter),而在 `1.1.0`(包含)之后 _sqllin-driver_ 则使用*新 Native 驱动*
2526

2627
无论如何,[SQLiter](https://github.com/touchlab/SQLiter) 仍然是一个非常棒的项目。我参考了许多它的设计与实现细节并将它们用在了 _sqllin-driver_*新 Native 驱动*中。
2728

sqllin-driver/src/nativeMain/kotlin/com/ctrip/sqllin/driver/NativeDatabaseConnection.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ package com.ctrip.sqllin.driver
2323

2424
internal abstract class NativeDatabaseConnection : DatabaseConnection {
2525

26-
internal abstract fun createStatement(sql: String): SQLiteStatement
26+
abstract fun createStatement(sql: String): SQLiteStatement
2727

28-
internal fun bindParamsToSQL(sql: String, bindParams: Array<Any?>?): SQLiteStatement = createStatement(sql).apply {
28+
protected fun bindParamsToSQL(sql: String, bindParams: Array<Any?>?): SQLiteStatement = createStatement(sql).apply {
2929
bindParams?.run {
3030
require(isNotEmpty()) { "Empty bindArgs" }
3131
forEachIndexed { index, any ->

sqllin-driver/src/nativeMain/kotlin/com/ctrip/sqllin/driver/SQLiteStatement.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
package com.ctrip.sqllin.driver
1818

1919
/**
20-
* SQLite native statement abstruct APIs
20+
* SQLite native statement abstract APIs
21+
* @author yaqiao
2122
*/
2223

2324
internal interface SQLiteStatement {

sqllin-dsl/doc/getting-start-cn.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ plugins {
1414
id("com.google.devtools.ksp")
1515
}
1616

17-
val sqllinVersion = "1.0.1"
17+
val sqllinVersion = "1.1.0"
1818

1919
kotlin {
2020
// ......
@@ -28,7 +28,7 @@ kotlin {
2828
implementation("com.ctrip.kotlin:sqllin-driver:$sqllinVersion")
2929

3030
// The sqllin-dsl serialization and deserialization depends on kotlinx-serialization
31-
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.4.1")
31+
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.5.1")
3232
}
3333
}
3434
// ......
@@ -147,7 +147,7 @@ data class Person(
147147
你定义的 DBEntity 的属性名应与数据库表的列名相对应。DBEntity 不应该拥有名字与表中的所有列名均不相同的属性,但是
148148
DBEntity 的属性数量可以比表中列的数量少。
149149

150-
`@DBRow` 的参数 `tableName` 表示数据库中的表明,请确保传入正确的值。如果不手动传入,_sqllin-processor_
150+
`@DBRow` 的参数 `tableName` 表示数据库中的表名,请确保传入正确的值。如果不手动传入,_sqllin-processor_
151151
将会使用类名作为表名,比如 `Person` 类的默认表名是"Person"。
152152

153153
_sqllin-dsl_ 中,对象序列化为 SQL 语句,或者从游标中反序列化依赖 _kotlinx.serialization_,所以你需要在你的 data class

sqllin-dsl/doc/getting-start.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ plugins {
1616
id("com.google.devtools.ksp")
1717
}
1818

19-
val sqllinVersion = "1.0.1"
19+
val sqllinVersion = "1.1.0"
2020

2121
kotlin {
2222
// ......
@@ -30,7 +30,7 @@ kotlin {
3030
implementation("com.ctrip.kotlin:sqllin-driver:$sqllinVersion")
3131

3232
// The sqllin-dsl serialization and deserialization depends on kotlinx-serialization
33-
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.4.1")
33+
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.5.1")
3434
}
3535
}
3636
// ......

0 commit comments

Comments
 (0)