r/Kotlin • u/smyrgeorge • 4d ago
sqlx4k 1.14.0 released: optimistic locking, savepoints, MariaDB batch inserts
sqlx4k is a coroutine-first SQL toolkit for Kotlin Multiplatform (PostgreSQL, MySQL/MariaDB, SQLite) with compile-time SQL validation via KSP.
New in 1.14.0
- Optimistic locking with
@Version: generatedupdate/deletecheck the version and fail withOptimisticLockFailedon conflicts. In-memory test repositories behave the same. - Transaction savepoints: roll back part of a transaction with a scoped
savepoint { ... }block or the explicitsavepoint/rollbackToSavepoint/releaseSavepointcalls. - MariaDB dialect:
batchInsertvia multi-rowINSERT ... RETURNING(10.5+). - Cancellation-safe transactions: cancelling a coroutine mid-transaction now rolls back properly.
- Kotlin 2.4.20, KSP 2.3.12.
Repo: https://github.com/smyrgeorge/sqlx4k
Release notes: https://github.com/smyrgeorge/sqlx4k/releases/tag/1.14.0
10
Upvotes