sqlx4k — first stable release of a high-performanc...
# feed
y
sqlx4k — first stable release of a high-performance, non-blocking DB driver for Kotlin Multiplatform Hey Kotlin folks! I’m excited to share the first stable release of sqlx4k — a high-performance, non-blocking database driver for Kotlin Multiplatform. What it is: • A Kotlin-first, async driver for PostgreSQL, MySQL, and SQLite • Works across JVM and native targets (macOS, Linux, Windows, iOS, Android NDK) • Built for coroutines and modern, scalable apps You can check it out here: https://github.com/smyrgeorge/sqlx4k Highlights: • Async I/O with connection pooling • Prepared statements (named and positional) • Row mappers • Transactions + coroutine-friendly TransactionContext • Code generation (CRUD and @Repository with KSP) • Database migrations • PostgreSQL LISTEN/NOTIFY • SQLDelight integration Supported targets: • JVM (PostgreSQL and MySQL on JVM today) • iosArm64, androidNativeX64/Arm64, macosArm64/X64, linuxArm64/X64, mingwX64 • wasmWasi is being explored Get it from Maven Central:
Copy code
// PostgreSQL
implementation("io.github.smyrgeorge:sqlx4k-postgres:x.y.z")
// MySQL
implementation("io.github.smyrgeorge:sqlx4k-mysql:x.y.z")
// SQLite
implementation("io.github.smyrgeorge:sqlx4k-sqlite:x.y.z")
❤️ 3
K 3
👍 5
p
Hello, @Yorgos S.! Nice lib! Thanks! Just noticed when creating database client seems like redundant database vendor in url.
Copy code
val db = PostgreSQL(
    url = "<postgresql://localhost:15432/test>", // may be omit 'postgresql:' we already creating PostgreSQL client
    username = "postgres",
    password = "postgres",
    options = options
)
y
Hello @PHondogo probably you’re right. Maybe we can omit the database vendor in the future.
a
Hahaha, this is amazing. I have been working as a side project on a pure Kotlin coroutine based Postgres client. Drawing inspiration from SqlX 😄. Yours looks infinitely better though. So I'll just keep mine a hobby then.
y
To be honest I’m planning also in the future to start working on a pure kotlin pg client. When I started this project it was my only option (I was developing an app in kotlin native).
a
I see now that you wrap sqlx in rust right?
y
yes
The idea is having something that is working and slowly replace the underlying clients.
a
Nice. I implemented the postgres wire protocol as an educational exercise.
💪 2
y
Nice
d
PostgreSQL LISTEN/NOTIFY
- having just hand-rolled this for use with Exposed myself, you have my attention! 👀
🙂 1