Move bundled Android, Native and JVM SQLite drivers.
This changes moves the SQLite KMP drivers for Android, Native and JVM that uses a bundled SQLite.
Bug: 300660920
Relnote: "Add BundledSQLiteDriver which is the entry point to an implementation of SQLite KMP that includes a compiled SQLite."
Test: ./sqlite/scripts/runConformanceTest
Change-Id: Iee702bc6ba5e48ad6409315bd02188ff4a933e0c
diff --git a/sqlite/sqlite-bundled/api/api_lint.ignore b/sqlite/sqlite-bundled/api/api_lint.ignore
new file mode 100644
index 0000000..2f12705
--- /dev/null
+++ b/sqlite/sqlite-bundled/api/api_lint.ignore
@@ -0,0 +1,3 @@
+// Baseline format: 1.0
+AcronymName: androidx.sqlite.driver.bundled.BundledSQLiteDriver:
+ Acronyms should not be capitalized in class names: was `BundledSQLiteDriver`, should this be `BundledSqLiteDriver`?
diff --git a/sqlite/sqlite-bundled/api/current.txt b/sqlite/sqlite-bundled/api/current.txt
new file mode 100644
index 0000000..a09c7d3
--- /dev/null
+++ b/sqlite/sqlite-bundled/api/current.txt
@@ -0,0 +1,10 @@
+// Signature format: 4.0
+package androidx.sqlite.driver.bundled {
+
+ public final class BundledSQLiteDriver implements androidx.sqlite.SQLiteDriver {
+ ctor public BundledSQLiteDriver(String filename);
+ method public androidx.sqlite.SQLiteConnection open();
+ }
+
+}
+
diff --git a/sqlite/sqlite-bundled/api/res-current.txt b/sqlite/sqlite-bundled/api/res-current.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/sqlite/sqlite-bundled/api/res-current.txt
diff --git a/sqlite/sqlite-bundled/api/restricted_current.txt b/sqlite/sqlite-bundled/api/restricted_current.txt
new file mode 100644
index 0000000..a09c7d3
--- /dev/null
+++ b/sqlite/sqlite-bundled/api/restricted_current.txt
@@ -0,0 +1,10 @@
+// Signature format: 4.0
+package androidx.sqlite.driver.bundled {
+
+ public final class BundledSQLiteDriver implements androidx.sqlite.SQLiteDriver {
+ ctor public BundledSQLiteDriver(String filename);
+ method public androidx.sqlite.SQLiteConnection open();
+ }
+
+}
+
diff --git a/sqlite/sqlite-bundled/build.gradle b/sqlite/sqlite-bundled/build.gradle
index 4caa0be..bb24383 100644
--- a/sqlite/sqlite-bundled/build.gradle
+++ b/sqlite/sqlite-bundled/build.gradle
@@ -16,7 +16,6 @@
import androidx.build.AndroidXConfig
import androidx.build.KmpPlatformsKt
-import androidx.build.LibraryType
import androidx.build.PlatformIdentifier
import androidx.build.Publish
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
@@ -87,8 +86,9 @@
KonanTarget.MACOS_X64,
KonanTarget.LINUX_X64,
].collect { it.INSTANCE } // Use INSTANCE to get object class instance from kotlin
+
// Define C compilation of SQLite (sqlite3.c)
- def sqliteCompilation = createNativeCompilation("androidXUnbundledSqlite") {
+ def sqliteCompilation = createNativeCompilation("androidXBundledSqlite") {
configureEachTarget { nativeCompilation ->
// add SQLite header
nativeCompilation.includes.from(
@@ -168,7 +168,7 @@
// commonMain
// ┌───────────────────────────────────────────┐
// ▼ ▼
- // androidJvmCommonMain nativeCommonMain
+ // androidJvmCommonMain nativeMain
// ┌────────────────┐ ┌──────────┬────────────┐
// │ │ │ │ │
// ▼ ▼ ▼ ▼ ▼
@@ -182,7 +182,7 @@
// ┌───────────────────────────────────────────┐
// │ │
// ▼ ▼
- // androidJvmCommonTest nativeCommonTest
+ // androidJvmCommonTest nativeTest
// ┌────────────────────┐ ┌─────────┬─────────────┐
// │ │ │ │ │
// ▼ ▼ ▼ ▼ ▼
@@ -190,7 +190,7 @@
commonMain {
dependencies {
implementation(libs.kotlinStdlib)
- api(project(":sqliteMultiplatform:sqlite"))
+ api(project(":sqlite:sqlite"))
}
}
sharedTest {
@@ -202,7 +202,7 @@
implementation(libs.kotlinTest)
implementation(libs.kotlinTestAnnotationsCommon)
implementation(project(":kruth:kruth"))
- implementation(project(":sqliteMultiplatform:conformanceTest"))
+ implementation(project(":sqlite:integration-tests:driver-conformance-test"))
}
}
androidJvmCommonMain {
@@ -230,13 +230,13 @@
}
}
if (nativeEnabled) {
- nativeCommonMain {
+ nativeMain {
dependsOn(commonMain)
dependencies {
- implementation(project(":sqliteMultiplatform:sqlite-driver"))
+ implementation(project(":sqlite:sqlite-framework"))
}
}
- nativeCommonTest {
+ nativeTest {
dependsOn(sharedTest)
}
}
@@ -244,10 +244,10 @@
targets.all { target ->
if (target.platformType == KotlinPlatformType.native) {
target.compilations["main"].defaultSourceSet {
- dependsOn(nativeCommonMain)
+ dependsOn(nativeMain)
}
target.compilations["test"].defaultSourceSet {
- dependsOn(nativeCommonTest)
+ dependsOn(nativeTest)
}
}
}
@@ -255,14 +255,13 @@
}
android {
- namespace "androidx.sqliteMultiplatform.driver.unbundled"
+ namespace "androidx.sqlite.driver.bundled"
}
androidx {
- name = "SQLite Unbundled KMP Implementation"
- type = LibraryType.UNSET
+ name = "SQLite Bundled Integration"
+ publish = Publish.SNAPSHOT_AND_RELEASE
inceptionYear = "2023"
- description = "SQLite Kotlin Multiplatform Implementation with Unbundled SQLite"
- publish = Publish.NONE
+ description = "The implementation of SQLite library using the bundled SQLite."
metalavaK2UastEnabled = false
}
diff --git a/sqlite/sqlite-bundled/src/androidJvmCommonMain/jni/README.md b/sqlite/sqlite-bundled/src/androidJvmCommonMain/jni/README.md
index 8a7bf81..ec76497 100644
--- a/sqlite/sqlite-bundled/src/androidJvmCommonMain/jni/README.md
+++ b/sqlite/sqlite-bundled/src/androidJvmCommonMain/jni/README.md
@@ -1 +1 @@
-Unbundled SQLite Driver's JNI bindings.
\ No newline at end of file
+Bundled SQLite Driver's JNI bindings.
\ No newline at end of file
diff --git a/sqlite/sqlite-bundled/src/androidJvmCommonMain/jni/sqlite_bindings.cpp b/sqlite/sqlite-bundled/src/androidJvmCommonMain/jni/sqlite_bindings.cpp
index 8b87c79..ad73740 100644
--- a/sqlite/sqlite-bundled/src/androidJvmCommonMain/jni/sqlite_bindings.cpp
+++ b/sqlite/sqlite-bundled/src/androidJvmCommonMain/jni/sqlite_bindings.cpp
@@ -9,7 +9,7 @@
* @return true if the exception was thrown, otherwise false.
*/
static bool throwSQLiteException(JNIEnv *env, int errorCode, const char *errorMsg) {
- jclass exceptionClass = env->FindClass("androidx/sqliteMultiplatform/SQLiteException");
+ jclass exceptionClass = env->FindClass("androidx/sqlite/SQLiteException");
std::stringstream message;
message << "Error code: " << errorCode;
if (errorMsg != nullptr) {
@@ -35,7 +35,7 @@
}
extern "C" JNIEXPORT jlong JNICALL
-Java_androidx_sqliteMultiplatform_unbundled_UnbundledSQLiteDriverKt_nativeOpen(
+Java_androidx_sqlite_driver_bundled_BundledSQLiteDriverKt_nativeOpen(
JNIEnv* env,
jclass clazz,
jstring name) {
@@ -52,7 +52,7 @@
}
extern "C" JNIEXPORT jlong JNICALL
-Java_androidx_sqliteMultiplatform_unbundled_UnbundledSQLiteConnectionKt_nativePrepare(
+Java_androidx_sqlite_driver_bundled_BundledSQLiteConnectionKt_nativePrepare(
JNIEnv* env,
jclass clazz,
jlong dbPointer,
@@ -72,7 +72,7 @@
}
extern "C" JNIEXPORT void JNICALL
-Java_androidx_sqliteMultiplatform_unbundled_UnbundledSQLiteConnectionKt_nativeClose(
+Java_androidx_sqlite_driver_bundled_BundledSQLiteConnectionKt_nativeClose(
JNIEnv* env,
jclass clazz,
jlong dbPointer) {
@@ -81,7 +81,7 @@
}
extern "C" JNIEXPORT void JNICALL
-Java_androidx_sqliteMultiplatform_unbundled_UnbundledSQLiteStatementKt_nativeBindBlob(
+Java_androidx_sqlite_driver_bundled_BundledSQLiteStatementKt_nativeBindBlob(
JNIEnv* env,
jclass clazz,
jlong stmtPointer,
@@ -98,7 +98,7 @@
}
extern "C" JNIEXPORT void JNICALL
-Java_androidx_sqliteMultiplatform_unbundled_UnbundledSQLiteStatementKt_nativeBindDouble(
+Java_androidx_sqlite_driver_bundled_BundledSQLiteStatementKt_nativeBindDouble(
JNIEnv* env,
jclass clazz,
jlong stmtPointer,
@@ -112,7 +112,7 @@
}
extern "C" JNIEXPORT void JNICALL
-Java_androidx_sqliteMultiplatform_unbundled_UnbundledSQLiteStatementKt_nativeBindLong(
+Java_androidx_sqlite_driver_bundled_BundledSQLiteStatementKt_nativeBindLong(
JNIEnv* env,
jclass clazz,
jlong stmtPointer,
@@ -126,7 +126,7 @@
}
extern "C" JNIEXPORT void JNICALL
-Java_androidx_sqliteMultiplatform_unbundled_UnbundledSQLiteStatementKt_nativeBindText(
+Java_androidx_sqlite_driver_bundled_BundledSQLiteStatementKt_nativeBindText(
JNIEnv* env,
jclass clazz,
jlong stmtPointer,
@@ -143,7 +143,7 @@
}
extern "C" JNIEXPORT void JNICALL
-Java_androidx_sqliteMultiplatform_unbundled_UnbundledSQLiteStatementKt_nativeBindNull(
+Java_androidx_sqlite_driver_bundled_BundledSQLiteStatementKt_nativeBindNull(
JNIEnv* env,
jclass clazz,
jlong stmtPointer,
@@ -156,7 +156,7 @@
}
extern "C" JNIEXPORT jboolean JNICALL
-Java_androidx_sqliteMultiplatform_unbundled_UnbundledSQLiteStatementKt_nativeStep(
+Java_androidx_sqlite_driver_bundled_BundledSQLiteStatementKt_nativeStep(
JNIEnv *env,
jclass clazz,
jlong stmtPointer) {
@@ -173,7 +173,7 @@
}
extern "C" JNIEXPORT jbyteArray JNICALL
-Java_androidx_sqliteMultiplatform_unbundled_UnbundledSQLiteStatementKt_nativeGetBlob(
+Java_androidx_sqlite_driver_bundled_BundledSQLiteStatementKt_nativeGetBlob(
JNIEnv *env,
jclass clazz,
jlong stmtPointer,
@@ -192,7 +192,7 @@
}
extern "C" JNIEXPORT jdouble JNICALL
-Java_androidx_sqliteMultiplatform_unbundled_UnbundledSQLiteStatementKt_nativeGetDouble(
+Java_androidx_sqlite_driver_bundled_BundledSQLiteStatementKt_nativeGetDouble(
JNIEnv *env,
jclass clazz,
jlong stmtPointer,
@@ -204,7 +204,7 @@
}
extern "C" JNIEXPORT jlong JNICALL
-Java_androidx_sqliteMultiplatform_unbundled_UnbundledSQLiteStatementKt_nativeGetLong(
+Java_androidx_sqlite_driver_bundled_BundledSQLiteStatementKt_nativeGetLong(
JNIEnv *env,
jclass clazz,
jlong stmtPointer,
@@ -216,7 +216,7 @@
}
extern "C" JNIEXPORT jstring JNICALL
-Java_androidx_sqliteMultiplatform_unbundled_UnbundledSQLiteStatementKt_nativeGetText(
+Java_androidx_sqlite_driver_bundled_BundledSQLiteStatementKt_nativeGetText(
JNIEnv *env,
jclass clazz,
jlong stmtPointer,
@@ -235,7 +235,7 @@
}
extern "C" JNIEXPORT jint JNICALL
-Java_androidx_sqliteMultiplatform_unbundled_UnbundledSQLiteStatementKt_nativeGetColumnCount(
+Java_androidx_sqlite_driver_bundled_BundledSQLiteStatementKt_nativeGetColumnCount(
JNIEnv *env,
jclass clazz,
jlong stmtPointer) {
@@ -244,7 +244,7 @@
}
extern "C" JNIEXPORT jstring JNICALL
-Java_androidx_sqliteMultiplatform_unbundled_UnbundledSQLiteStatementKt_nativeGetColumnName(
+Java_androidx_sqlite_driver_bundled_BundledSQLiteStatementKt_nativeGetColumnName(
JNIEnv *env,
jclass clazz,
jlong stmtPointer,
@@ -259,7 +259,7 @@
}
extern "C" JNIEXPORT jint JNICALL
-Java_androidx_sqliteMultiplatform_unbundled_UnbundledSQLiteStatementKt_nativeGetColumnType(
+Java_androidx_sqlite_driver_bundled_BundledSQLiteStatementKt_nativeGetColumnType(
JNIEnv *env,
jclass clazz,
jlong stmtPointer,
@@ -271,7 +271,7 @@
}
extern "C" JNIEXPORT void JNICALL
-Java_androidx_sqliteMultiplatform_unbundled_UnbundledSQLiteStatementKt_nativeReset(
+Java_androidx_sqlite_driver_bundled_BundledSQLiteStatementKt_nativeReset(
JNIEnv* env,
jclass clazz,
jlong stmtPointer) {
@@ -283,7 +283,7 @@
}
extern "C" JNIEXPORT void JNICALL
-Java_androidx_sqliteMultiplatform_unbundled_UnbundledSQLiteStatementKt_nativeClose(
+Java_androidx_sqlite_driver_bundled_BundledSQLiteStatementKt_nativeClose(
JNIEnv* env,
jclass clazz,
jlong stmtPointer) {
diff --git a/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLite.androidJvmCommon.kt b/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLite.androidJvmCommon.kt
similarity index 93%
rename from sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLite.androidJvmCommon.kt
rename to sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLite.androidJvmCommon.kt
index 8089830..7708fba 100644
--- a/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLite.androidJvmCommon.kt
+++ b/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLite.androidJvmCommon.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.sqliteMultiplatform.unbundled
+package androidx.sqlite.driver.bundled
internal object ResultCode {
const val SQLITE_MISUSE = 21
diff --git a/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteConnection.androidJvmCommon.kt b/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteConnection.androidJvmCommon.kt
similarity index 71%
rename from sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteConnection.androidJvmCommon.kt
rename to sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteConnection.androidJvmCommon.kt
index 12ce016..f9b9e02 100644
--- a/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteConnection.androidJvmCommon.kt
+++ b/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteConnection.androidJvmCommon.kt
@@ -13,16 +13,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-@file:JvmName("UnbundledSQLiteConnectionKt")
+@file:JvmName("BundledSQLiteConnectionKt")
-package androidx.sqliteMultiplatform.unbundled
+package androidx.sqlite.driver.bundled
-import androidx.sqliteMultiplatform.SQLiteConnection
-import androidx.sqliteMultiplatform.SQLiteStatement
-import androidx.sqliteMultiplatform.throwSQLiteException
-import androidx.sqliteMultiplatform.unbundled.ResultCode.SQLITE_MISUSE
+import androidx.annotation.RestrictTo
+import androidx.sqlite.SQLiteConnection
+import androidx.sqlite.SQLiteStatement
+import androidx.sqlite.driver.bundled.ResultCode.SQLITE_MISUSE
+import androidx.sqlite.throwSQLiteException
-actual class UnbundledSQLiteConnection(
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+actual class BundledSQLiteConnection(
private val connectionPointer: Long
) : SQLiteConnection {
@@ -33,7 +35,7 @@
throwSQLiteException(SQLITE_MISUSE, "connection is closed")
}
val statementPointer = nativePrepare(connectionPointer, sql)
- return UnbundledSQLiteStatement(connectionPointer, statementPointer)
+ return BundledSQLiteStatement(connectionPointer, statementPointer)
}
override fun close() {
diff --git a/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteDriver.androidJvmCommon.kt b/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteDriver.androidJvmCommon.kt
similarity index 76%
rename from sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteDriver.androidJvmCommon.kt
rename to sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteDriver.androidJvmCommon.kt
index a73d879..791f50c 100644
--- a/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteDriver.androidJvmCommon.kt
+++ b/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteDriver.androidJvmCommon.kt
@@ -13,23 +13,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-@file:JvmName("UnbundledSQLiteDriverKt")
+@file:JvmName("BundledSQLiteDriverKt")
-package androidx.sqliteMultiplatform.unbundled
+package androidx.sqlite.driver.bundled
-import androidx.sqliteMultiplatform.SQLiteConnection
-import androidx.sqliteMultiplatform.SQLiteDriver
+import androidx.sqlite.SQLiteConnection
+import androidx.sqlite.SQLiteDriver
// TODO(b/313895287): Explore usability of @FastNative and @CriticalNative for the external functions.
-actual class UnbundledSQLiteDriver actual constructor(
+actual class BundledSQLiteDriver actual constructor(
private val filename: String
) : SQLiteDriver {
override fun open(): SQLiteConnection {
val address = nativeOpen(filename)
- return UnbundledSQLiteConnection(address)
+ return BundledSQLiteConnection(address)
}
- companion object {
+ private companion object {
init {
NativeLibraryLoader.loadLibrary("jvmArtJniImplementation")
}
diff --git a/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteStatement.androidJvmCommon.kt b/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteStatement.androidJvmCommon.kt
similarity index 92%
rename from sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteStatement.androidJvmCommon.kt
rename to sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteStatement.androidJvmCommon.kt
index 7bbd5b8..bb60768 100644
--- a/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteStatement.androidJvmCommon.kt
+++ b/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteStatement.androidJvmCommon.kt
@@ -13,15 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-@file:JvmName("UnbundledSQLiteStatementKt")
+@file:JvmName("BundledSQLiteStatementKt")
-package androidx.sqliteMultiplatform.unbundled
+package androidx.sqlite.driver.bundled
-import androidx.sqliteMultiplatform.SQLiteStatement
-import androidx.sqliteMultiplatform.throwSQLiteException
-import androidx.sqliteMultiplatform.unbundled.ResultCode.SQLITE_MISUSE
+import androidx.annotation.RestrictTo
+import androidx.sqlite.SQLiteStatement
+import androidx.sqlite.driver.bundled.ResultCode.SQLITE_MISUSE
+import androidx.sqlite.throwSQLiteException
-actual class UnbundledSQLiteStatement(
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+actual class BundledSQLiteStatement(
private val connectionPointer: Long,
private val statementPointer: Long
) : SQLiteStatement {
diff --git a/sqlite/sqlite-bundled/src/androidMain/kotlin/androidx/sqlite/driver/bundled/NativeLibraryLoader.android.kt b/sqlite/sqlite-bundled/src/androidMain/kotlin/androidx/sqlite/driver/bundled/NativeLibraryLoader.android.kt
index 0ee21f0..c54b9a6 100644
--- a/sqlite/sqlite-bundled/src/androidMain/kotlin/androidx/sqlite/driver/bundled/NativeLibraryLoader.android.kt
+++ b/sqlite/sqlite-bundled/src/androidMain/kotlin/androidx/sqlite/driver/bundled/NativeLibraryLoader.android.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.sqliteMultiplatform.unbundled
+package androidx.sqlite.driver.bundled
internal actual object NativeLibraryLoader {
actual fun loadLibrary(name: String) {
diff --git a/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLite.androidJvmCommon.kt b/sqlite/sqlite-bundled/src/commonMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteConnection.kt
similarity index 81%
copy from sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLite.androidJvmCommon.kt
copy to sqlite/sqlite-bundled/src/commonMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteConnection.kt
index 8089830..82f35e8 100644
--- a/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLite.androidJvmCommon.kt
+++ b/sqlite/sqlite-bundled/src/commonMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteConnection.kt
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-package androidx.sqliteMultiplatform.unbundled
+package androidx.sqlite.driver.bundled
-internal object ResultCode {
- const val SQLITE_MISUSE = 21
-}
+import androidx.sqlite.SQLiteConnection
+
+expect class BundledSQLiteConnection : SQLiteConnection
diff --git a/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLite.androidJvmCommon.kt b/sqlite/sqlite-bundled/src/commonMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteDriver.kt
similarity index 80%
copy from sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLite.androidJvmCommon.kt
copy to sqlite/sqlite-bundled/src/commonMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteDriver.kt
index 8089830..e7e0625 100644
--- a/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLite.androidJvmCommon.kt
+++ b/sqlite/sqlite-bundled/src/commonMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteDriver.kt
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-package androidx.sqliteMultiplatform.unbundled
+package androidx.sqlite.driver.bundled
-internal object ResultCode {
- const val SQLITE_MISUSE = 21
-}
+import androidx.sqlite.SQLiteDriver
+
+expect class BundledSQLiteDriver(filename: String) : SQLiteDriver
diff --git a/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLite.androidJvmCommon.kt b/sqlite/sqlite-bundled/src/commonMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteStatement.kt
similarity index 81%
copy from sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLite.androidJvmCommon.kt
copy to sqlite/sqlite-bundled/src/commonMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteStatement.kt
index 8089830..85071f1 100644
--- a/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLite.androidJvmCommon.kt
+++ b/sqlite/sqlite-bundled/src/commonMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteStatement.kt
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-package androidx.sqliteMultiplatform.unbundled
+package androidx.sqlite.driver.bundled
-internal object ResultCode {
- const val SQLITE_MISUSE = 21
-}
+import androidx.sqlite.SQLiteStatement
+
+expect class BundledSQLiteStatement : SQLiteStatement
diff --git a/sqlite/sqlite-bundled/src/commonMain/kotlin/androidx/sqlite/driver/bundled/NativeLibraryLoader.kt b/sqlite/sqlite-bundled/src/commonMain/kotlin/androidx/sqlite/driver/bundled/NativeLibraryLoader.kt
index 12d1431..6930b5f 100644
--- a/sqlite/sqlite-bundled/src/commonMain/kotlin/androidx/sqlite/driver/bundled/NativeLibraryLoader.kt
+++ b/sqlite/sqlite-bundled/src/commonMain/kotlin/androidx/sqlite/driver/bundled/NativeLibraryLoader.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.sqliteMultiplatform.unbundled
+package androidx.sqlite.driver.bundled
internal expect object NativeLibraryLoader {
/**
diff --git a/sqlite/sqlite-bundled/src/commonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteDriver.kt b/sqlite/sqlite-bundled/src/commonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteDriver.kt
deleted file mode 100644
index bbb13d8..0000000
--- a/sqlite/sqlite-bundled/src/commonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteDriver.kt
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package androidx.sqliteMultiplatform.unbundled
-
-import androidx.sqliteMultiplatform.SQLiteDriver
-
-expect class UnbundledSQLiteDriver(filename: String) : SQLiteDriver
diff --git a/sqlite/sqlite-bundled/src/commonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteStatement.kt b/sqlite/sqlite-bundled/src/commonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteStatement.kt
deleted file mode 100644
index 9c3b862..0000000
--- a/sqlite/sqlite-bundled/src/commonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteStatement.kt
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package androidx.sqliteMultiplatform.unbundled
-
-import androidx.sqliteMultiplatform.SQLiteStatement
-
-expect class UnbundledSQLiteStatement : SQLiteStatement
diff --git a/sqlite/sqlite-bundled/src/jvmMain/kotlin/androidx/sqlite/driver/bundled/NativeLibraryLoader.jvm.kt b/sqlite/sqlite-bundled/src/jvmMain/kotlin/androidx/sqlite/driver/bundled/NativeLibraryLoader.jvm.kt
index 73b8710..cae82a8 100644
--- a/sqlite/sqlite-bundled/src/jvmMain/kotlin/androidx/sqlite/driver/bundled/NativeLibraryLoader.jvm.kt
+++ b/sqlite/sqlite-bundled/src/jvmMain/kotlin/androidx/sqlite/driver/bundled/NativeLibraryLoader.jvm.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.sqliteMultiplatform.unbundled
+package androidx.sqlite.driver.bundled
import java.nio.file.Files
import java.nio.file.StandardCopyOption
diff --git a/sqlite/sqlite-bundled/src/nativeCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteDriver.nativeCommon.kt b/sqlite/sqlite-bundled/src/nativeCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteDriver.nativeCommon.kt
deleted file mode 100644
index cc30cf2..0000000
--- a/sqlite/sqlite-bundled/src/nativeCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteDriver.nativeCommon.kt
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package androidx.sqliteMultiplatform.unbundled
-
-actual typealias UnbundledSQLiteDriver =
- androidx.sqliteMultiplatform.driver.NativeSQLiteDriver
diff --git a/sqlite/sqlite-bundled/src/nativeCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteStatement.nativeCommon.kt b/sqlite/sqlite-bundled/src/nativeCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteStatement.nativeCommon.kt
deleted file mode 100644
index cac1dfe..0000000
--- a/sqlite/sqlite-bundled/src/nativeCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteStatement.nativeCommon.kt
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package androidx.sqliteMultiplatform.unbundled
-
-actual typealias UnbundledSQLiteStatement =
- androidx.sqliteMultiplatform.driver.NativeSQLiteStatement
diff --git a/sqlite/sqlite-bundled/src/nativeInterop/cinterop/androidXUnbundledSqlite.def b/sqlite/sqlite-bundled/src/nativeInterop/cinterop/androidXBundledSqlite.def
similarity index 86%
rename from sqlite/sqlite-bundled/src/nativeInterop/cinterop/androidXUnbundledSqlite.def
rename to sqlite/sqlite-bundled/src/nativeInterop/cinterop/androidXBundledSqlite.def
index f80c617..b7405478 100644
--- a/sqlite/sqlite-bundled/src/nativeInterop/cinterop/androidXUnbundledSqlite.def
+++ b/sqlite/sqlite-bundled/src/nativeInterop/cinterop/androidXBundledSqlite.def
@@ -1,4 +1,4 @@
-package = androidx.sqlite3.unbundled
+package = androidx.sqlite3.bundled
headers = sqlite3.h
linkerOpts.linux_x64 = -lpthread -ldl
diff --git a/sqlite/sqlite-bundled/src/nativeCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteConnection.nativeCommon.kt b/sqlite/sqlite-bundled/src/nativeMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteConnection.nativeCommon.kt
similarity index 74%
rename from sqlite/sqlite-bundled/src/nativeCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteConnection.nativeCommon.kt
rename to sqlite/sqlite-bundled/src/nativeMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteConnection.nativeCommon.kt
index 84c8055..622b676 100644
--- a/sqlite/sqlite-bundled/src/nativeCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteConnection.nativeCommon.kt
+++ b/sqlite/sqlite-bundled/src/nativeMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteConnection.nativeCommon.kt
@@ -14,7 +14,11 @@
* limitations under the License.
*/
-package androidx.sqliteMultiplatform.unbundled
+@file:RestrictTo(RestrictTo.Scope.LIBRARY)
-actual typealias UnbundledSQLiteConnection =
- androidx.sqliteMultiplatform.driver.NativeSQLiteConnection
+package androidx.sqlite.driver.bundled
+
+import androidx.annotation.RestrictTo
+
+actual typealias BundledSQLiteConnection =
+ androidx.sqlite.driver.NativeSQLiteConnection
diff --git a/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLite.androidJvmCommon.kt b/sqlite/sqlite-bundled/src/nativeMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteDriver.nativeCommon.kt
similarity index 82%
copy from sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLite.androidJvmCommon.kt
copy to sqlite/sqlite-bundled/src/nativeMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteDriver.nativeCommon.kt
index 8089830..50a7940 100644
--- a/sqlite/sqlite-bundled/src/androidJvmCommonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLite.androidJvmCommon.kt
+++ b/sqlite/sqlite-bundled/src/nativeMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteDriver.nativeCommon.kt
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-package androidx.sqliteMultiplatform.unbundled
+package androidx.sqlite.driver.bundled
-internal object ResultCode {
- const val SQLITE_MISUSE = 21
-}
+actual typealias BundledSQLiteDriver =
+ androidx.sqlite.driver.NativeSQLiteDriver
diff --git a/sqlite/sqlite-bundled/src/commonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteConnection.kt b/sqlite/sqlite-bundled/src/nativeMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteStatement.nativeCommon.kt
similarity index 74%
rename from sqlite/sqlite-bundled/src/commonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteConnection.kt
rename to sqlite/sqlite-bundled/src/nativeMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteStatement.nativeCommon.kt
index 9674f1f..bfeab9e 100644
--- a/sqlite/sqlite-bundled/src/commonMain/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteConnection.kt
+++ b/sqlite/sqlite-bundled/src/nativeMain/kotlin/androidx/sqlite/driver/bundled/BundledSQLiteStatement.nativeCommon.kt
@@ -14,8 +14,11 @@
* limitations under the License.
*/
-package androidx.sqliteMultiplatform.unbundled
+@file:RestrictTo(RestrictTo.Scope.LIBRARY)
-import androidx.sqliteMultiplatform.SQLiteConnection
+package androidx.sqlite.driver.bundled
-expect class UnbundledSQLiteConnection : SQLiteConnection
+import androidx.annotation.RestrictTo
+
+actual typealias BundledSQLiteStatement =
+ androidx.sqlite.driver.NativeSQLiteStatement
diff --git a/sqlite/sqlite-bundled/src/nativeCommonMain/kotlin/androidx/sqlite/driver/bundled/NativeLibraryLoader.nativeCommon.kt b/sqlite/sqlite-bundled/src/nativeMain/kotlin/androidx/sqlite/driver/bundled/NativeLibraryLoader.nativeCommon.kt
similarity index 93%
rename from sqlite/sqlite-bundled/src/nativeCommonMain/kotlin/androidx/sqlite/driver/bundled/NativeLibraryLoader.nativeCommon.kt
rename to sqlite/sqlite-bundled/src/nativeMain/kotlin/androidx/sqlite/driver/bundled/NativeLibraryLoader.nativeCommon.kt
index e0cc4bb..1ae2bf8 100644
--- a/sqlite/sqlite-bundled/src/nativeCommonMain/kotlin/androidx/sqlite/driver/bundled/NativeLibraryLoader.nativeCommon.kt
+++ b/sqlite/sqlite-bundled/src/nativeMain/kotlin/androidx/sqlite/driver/bundled/NativeLibraryLoader.nativeCommon.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package androidx.sqliteMultiplatform.unbundled
+package androidx.sqlite.driver.bundled
internal actual object NativeLibraryLoader {
actual fun loadLibrary(name: String) {
diff --git a/sqlite/sqlite-bundled/src/sharedTest/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteDriverTest.kt b/sqlite/sqlite-bundled/src/sharedTest/kotlin/androidx/sqlite/driver/bundled/bundled/BundledSQLiteDriverTest.kt
similarity index 73%
rename from sqlite/sqlite-bundled/src/sharedTest/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteDriverTest.kt
rename to sqlite/sqlite-bundled/src/sharedTest/kotlin/androidx/sqlite/driver/bundled/bundled/BundledSQLiteDriverTest.kt
index f8c77cc..97fc167 100644
--- a/sqlite/sqlite-bundled/src/sharedTest/kotlin/androidx/sqlite/driver/bundled/UnbundledSQLiteDriverTest.kt
+++ b/sqlite/sqlite-bundled/src/sharedTest/kotlin/androidx/sqlite/driver/bundled/bundled/BundledSQLiteDriverTest.kt
@@ -14,17 +14,17 @@
* limitations under the License.
*/
-package androidx.sqliteMultiplatform.unbundled
+package androidx.sqlite.driver.bundled
import androidx.kruth.assertThat
-import androidx.sqliteMultiplatform.BaseConformanceTest
-import androidx.sqliteMultiplatform.SQLiteDriver
-import androidx.sqliteMultiplatform.use
+import androidx.sqlite.SQLiteDriver
+import androidx.sqlite.driver.BaseConformanceTest
+import androidx.sqlite.use
import kotlin.test.Test
-class UnbundledSQLiteDriverTest : BaseConformanceTest() {
+class BundledSQLiteDriverTest : BaseConformanceTest() {
override fun getDriver(): SQLiteDriver {
- return UnbundledSQLiteDriver(filename = ":memory:")
+ return BundledSQLiteDriver(filename = ":memory:")
}
@Test
@@ -35,7 +35,7 @@
it.step()
it.getText(0)
}
- // The unbundled androidx SQLite version compiled and statically included
+ // The bundled androidx SQLite version compiled and statically included
assertThat(version).isEqualTo("3.42.0")
} finally {
connection.close()
diff --git a/sqlite/sqlite-framework/src/commonMain/kotlin/androidx/sqlite/Placeholder.kt b/sqlite/sqlite-framework/src/commonMain/kotlin/androidx/sqlite/Placeholder.kt
deleted file mode 100644
index ed7a1d9..0000000
--- a/sqlite/sqlite-framework/src/commonMain/kotlin/androidx/sqlite/Placeholder.kt
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package androidx.sqlite
-
-// empty file to trigger klib creation
-// see: https://youtrack.jetbrains.com/issue/KT-52344