Skip to content

Commit 31f8cbf

Browse files
committed
Add Android platform support for sqlx4k.
1 parent 13cf005 commit 31f8cbf

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

  • sqlx4k-sqlite/src
    • androidMain/kotlin/io/github/smyrgeorge/sqlx4k/sqlite
    • jvmMain/kotlin/io/github/smyrgeorge/sqlx4k/sqlite

sqlx4k-sqlite/src/androidMain/kotlin/io/github/smyrgeorge/sqlx4k/sqlite/SQLite.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -508,11 +508,10 @@ class SQLite(
508508
): ConnectionPoolImpl {
509509
// Parse the URL to extract database name
510510
val dbUrl = url.removePrefix("sqlite:").removePrefix("//")
511-
val isInMemory = dbUrl.equals(":memory:", ignoreCase = true) ||
512-
dbUrl.isBlank() ||
513-
dbUrl.contains(":memory:", ignoreCase = true)
514511

512+
// Validate in-memory database configuration
515513
// In-memory SQLite databases are isolated per connection, so pool size must be 1
514+
val isInMemory = dbUrl.equals(":memory:", ignoreCase = true)
516515
if (isInMemory && options.maxConnections > 1) {
517516
throw IllegalArgumentException(
518517
"SQLite in-memory databases cannot be used with connection pools larger than 1. " +

sqlx4k-sqlite/src/jvmMain/kotlin/io/github/smyrgeorge/sqlx4k/sqlite/SQLite.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,6 @@ class SQLite(
414414
@OptIn(ExperimentalTime::class)
415415
fun Any?.toJdbc(): Any? = when (this) {
416416
null -> null
417-
is TypedNull -> null
418417
is Char -> toString()
419418
// SQLite stores dates/times as text. The shared decoder uses a space-separated
420419
// format ("yyyy-MM-dd HH:mm:ss"), so we must produce that format here.

0 commit comments

Comments
 (0)