Release Notes: Version 1.14.0
This release adds optimistic locking, transaction savepoints and MariaDB batch inserts, and hardens the native drivers so connection errors are reported instead of aborting the process.
🚀 New Features
- Optimistic locking with
@Version: Annotate a single non-nullableInt/Longproperty. Generatedupdate()/delete()check the version,update()/batchUpdate()increment it in SQL and read it back viaRETURNING. Conflicts fail with the newSQLError.Code.OptimisticLockFailed. In-memory test repositories behave the same way. - Transaction savepoints:
savepoint(name),releaseSavepoint(name),rollbackToSavepoint(name), plus a scopedsavepoint { ... }: Result<T>that releases on success and rolls back on failure. - MariaDB dialect:
batchInsertvia multi-rowINSERT ... RETURNING(MariaDB 10.5+).batchUpdateis reported as unsupported on MariaDB.
🐛 Fixes
- Cancellation-safe transactions: transactions and savepoints roll back when the coroutine is cancelled.
CancellationExceptionis rethrown rather than captured in aResult. - No more native panics: PostgreSQL, MySQL, SQLite and SQLite-Cipher drivers return driver/connection errors (Io, Tls, Protocol, Decode, ...) as
SQLErrorinstead of panicking. Messages containing NUL bytes are sanitized.
🛠 Improvements
- Platform-specific error and transaction tests for every driver module.
- Dokka covers
sqlx4k-codegen-testandsqlx4k-sqlite-cipher. - Issue templates for bug reports and feature requests.
- README: banner, restructured Transactions/savepoints sections, context-parameter docs, feature overview.
📦 Dependency Updates
- Kotlin:
2.4.10→2.4.20 - KSP:
2.3.11→2.3.12 - Android KMP library plugin:
9.3.2→9.4.1 - JSqlParser:
5.3→5.4 - Robolectric:
4.16.1→4.17 - r2dbc-postgresql:
1.1.2.RELEASE→1.1.3.RELEASE - Gradle wrapper:
9.7.1→9.8.0
Full Changelog: 1.13.1...1.14.0