Releases: smyrgeorge/sqlx4k
1.5.4
Release Notes - Version 1.5.4
This release introduces significant improvements to the code generation processor, enhanced transaction handling, and better error propagation across all supported database drivers.
🚀 New Features & Enhancements
-
Codegen & Annotations:
- Auto-generated RowMappers: Added support for
AutoRowMapperin the@Repositoryannotation.RepositoryProcessornow automatically handles mappers when a custom one isn't specified. - PostgreSQL Support: Expanded
TableProcessorandRowMappergeneration to support the PostgreSQL dialect. - SQL Validation: Integrated JetBrains annotations, enabling
@Language("SQL")on@Querymethods for better IDE-level SQL syntax highlighting and validation.
- Auto-generated RowMappers: Added support for
-
Core API & Transactions:
- Safe Transactions: Introduced
transactionCatchingfor safer transactional operations and enhanced existingtransactionlogic with betterResulthandling. - Value Encoding/Decoding:
- Refactored
ValueEncoderas a functional interface. - Expanded
ValueEncoderto support bidirectional encoding (addeddecodesupport). - Enhanced
ValueEncoderRegistrywith reified type support and improved registration APIs.
- Refactored
- RowMapper Improvements: Refactored the
RowMapperinterface to support value decoders, improving query mapping and class name handling.
- Safe Transactions: Introduced
-
Error Handling & Drivers:
- Enhanced Error Propagation: Improved
SQLErrorcreation to include underlying exception causes across MySQL, PostgreSQL, SQLite, andConnectionPoolimplementations.
- Enhanced Error Propagation: Improved
Full Changelog: 1.5.3...1.5.4
1.5.3
Release Notes - Version 1.5.3
This release introduces powerful new features for repository interception, refactors core components for better consistency and modularity, and improves the annotation processing logic.
🚀 Features & Improvements
- Repository Hooks: Introduced a new hooking system for
CrudRepository.- Entity Hooks:
preInsertHook,preUpdateHook, andpreDeleteHookallow for entity transformation or validation before database operations. - Query Hook:
aroundQueryprovides a way to intercept all database operations (including custom@Querymethods). This is ideal for implementing cross-cutting concerns such as logging, performance monitoring, and distributed tracing.
- Entity Hooks:
- Enhanced KSP Processor: The
RepositoryProcessorhas been significantly improved:- Better handling of
contextparameters in repository methods. - Improved support and validation for
sqlx4k-arrowreturn types. - Stronger validation for hierarchical repository types.
- Better handling of
⚙️ Refactorings & Internal Changes
- Migrator Refactor: Renamed
Migrator.DbtoMigrator.QueryExecutorto align with the naming conventions used throughout the library. - Decoupled Value Encoding: Extracted
ValueEncoderandValueEncoderRegistryfrom theStatementinterface into standalone files, improving the modularity of the core API. - Consistency Updates: Standardized
QueryExecutorreferences across MySQL, PostgreSQL, and SQLite implementations.
📚 Documentation & Examples
- Hooks Documentation: Added a new section to the
README.mdexplaining how to use Repository Hooks. - Postgres Example: Updated the PostgreSQL example to demonstrate integration with the
sqlx4k-arrowmodule. - API Docs: Updated Dokka documentation for the 1.5.3 release.
Full Changelog: 1.5.2...1.5.3
1.5.2
Release Notes - Version 1.5.2
This release introduces significant improvements to the project structure, specifically around the integration with the Arrow library, along with enhancements to the code generation processor and error handling.
🚀 New Features & Enhancements
- Modularized Arrow Integration:
- Extracted Arrow-related components into a dedicated
sqlx4k-arrowmodule to keep the core library lightweight. - Introduced
ArrowCrudRepositoryandArrowContextCrudRepositoryfor better integration with Arrow's functional patterns.
- Extracted Arrow-related components into a dedicated
- Repository Processor Improvements:
- Added support for repository type categorization.
- Enhanced error handling by utilizing specific
SQLErrorcodes. - Improved robustness and documentation within the code generation phase.
- Library Updates:
- Integrated the Arrow library into the ecosystem.
- Adjusted dependencies across modules to support the new modular structure.
🔧 Internal Refactorings
- Refactored
RepositoryProcessor.ktfor better maintainability and error reporting. - Updated
SQLErrorto includeUknownErrorcode for improved fallback error handling.
📦 Module Changes
- sqlx4k: Removed direct Arrow dependency (moved to
sqlx4k-arrow). - sqlx4k-arrow: New module providing Arrow-specific repository implementations and extensions.
- sqlx4k-codegen: Updated to support new repository types and improved error mapping.
Full Changelog: 1.5.1...1.5.2
1.5.1
Release Notes - Version 1.5.1
This release includes several refactorings for consistency across database modules, improvements to transaction handling, new features for PGMQ, and various dependency updates.
🚀 Features
- PGMQ Improvements: Added support for installing the PGMQ extension directly from SQL files.
- Result Set Extensions: Added unsigned number type extensions to
ResultSet.Row.Columnfor better type support. - Enhanced Error Reporting:
SQLErrornow supports nested exceptions, providing more detailed error reporting.
🛠️ Improvements & Refactoring
- Consistent Naming: Refactored connection and transaction classes to use consistent
SqlxandNativeprefixes across MySQL, PostgreSQL, and SQLite modules. - Transaction Handling: Improved rollback error handling and separated commit logic from the main try-catch block for better reliability.
- Transaction Error Codes: Added specific error codes for transaction commit and rollback failures.
- Optimization: Optimized schema check queries and re-enabled consumer tests in both JVM and Native test suites.
- PGMQ Configuration: Updated the PGMQ GitHub organization reference.
🐞 Bug Fixes
- Fixed a typo in
libs.versions.tomland build scripts, correctingkotlinx-serialisationtokotlinx-serialization.
🔄 Dependency Updates
- Kotlin: Updated to
2.3.0. - Gradle: Updated to
9.2.1. - KSP: Updated from
2.3.2to2.3.4. - Spring Boot: Updated from
3.5.7to4.0.1. - Kotlinx Libraries: Updated
kotlinx-io(to0.8.1) andkotlinx-datetime. - SQLite JDBC: Updated from
3.51.0.0to3.51.1.0. - GitHub Actions: Updated
actions/cachetov5andactions/checkouttov6. - Publish Plugin: Updated from
0.34.0to0.35.0.
New Contributors
- @ChuckHend made their first contribution in #73
Full Changelog: 1.5.0...1.5.1
1.5.0
Release: sqlx4k 1.5.0 (2025-11-21)
Highlights
- Cross-database support for setting transaction isolation level via
Connection.setTransactionIsolationLevel(...)
across MySQL, PostgreSQL, and SQLite. - Safer PostgreSQL PGMQ schema:
pgmq.topic_bindings.queue_namenow has a foreign key withON DELETE CASCADE. - Simplified execution paths leveraging shared
encoders; fewer overrides and cleaner internals. - Dependency refresh across SQLite JDBC, PostgreSQL R2DBC, Apache Calcite, Spring Boot, and KSP.
New features
- Transaction isolation levels across databases
- New API:
Connection.setTransactionIsolationLevel(level: IsolationLevel, lock: Boolean = false). - Implemented for MySQL, PostgreSQL, and SQLite.
- Defaults per database.
- Commits:
22521c80,165daac6,1edfaa54,b5670d59.
- New API:
Behavior and schema changes
- PostgreSQL PGMQ: add FK on
pgmq.topic_bindings(queue_name)withON DELETE CASCADEfor safer cleanup.- Commit:
6bfb62d2. - Impact: Deleting a queue cascades to its topic bindings.
- Suggested migration example:
ALTER TABLE pgmq.topic_bindings ADD CONSTRAINT fk_topic_bindings_queue_name FOREIGN KEY (queue_name) REFERENCES pgmq.queues(queue_name) ON DELETE CASCADE;
- Commit:
API changes and refactors
Connectioninterface now includessetTransactionIsolationLevel(...).- Maintainors of custom
Connectionimpls must add this method. - Commits:
22521c80,1edfaa54,b5670d59.
- Maintainors of custom
- Unify default execution using
encoders; remove DB-specific overrides ofexecuteandfetchAll(Statement).- Commits:
4f7e48da,243627ed.
- Commits:
- Expose/propagate
encodersacross modules; remove redundant companion objects.- Commit:
243627ed.
- Commit:
- Internal cleanup: inline isolation level SQL; remove
NoQuotingString(internal).- Commit:
b5670d59.
- Commit:
Documentation
- README improvements:
- Added "Running Queries" and "Setting Transaction Isolation Level" sections.
- Formatting and language updates.
- Commits:
3df1e91d,f558c75c,a010e079.
Dependency updates
- SQLite JDBC:
org.xerial:sqlite-jdbc3.50.3.0 → 3.51.0.0 (e57682f0). - KSP:
2.2.20-2.0.4→2.3.0(1ce65f66), then2.3.0→2.3.2(ea5b9658). - PostgreSQL R2DBC:
org.postgresql:r2dbc-postgresql1.1.0.RELEASE → 1.1.1.RELEASE (414075c6). - Apache Calcite:
1.40.0→1.41.0(ff291302). - Spring Boot:
3.5.6→3.5.7(2b06e836).
Upgrade notes
- If you implement custom
Connectiontypes, addsetTransactionIsolationLevel(...). - PostgreSQL PGMQ users: consider applying the FK with cascade delete if you rely on the provided schema SQL.
- Review dependency bumps for any transitive changes.
Full Changelog: 1.4.1...1.5.0
1.4.1
Full Changelog: 1.4.0...1.4.1
1.4.0
[1.4.0] - 2025-10-25
Breaking changes
- Connection API:
Connection.release()was renamed toConnection.close()to align with common lifecycle semantics (commit 4b2406c). Update all usages toclose().
Added
- SQLite (JVM) support:
- Initial SQLite JVM implementation with connection pooling, migrations, and transactions; comprehensive integration tests (commit 865ec70).
- New coroutine-based Connection Pool implementation with lifecycle management, size limits, cleanup, and a test suite (commits d9baa91, c0062e6, 563bf38, d686842, 7a2bd9e).
Connection.encoders()method to accessValueEncoderRegistry(commit 964f95d).- PostgreSQL LISTEN/NOTIFY: automatic reconnection with exponential backoff for channel listeners (commit 3b7b069).
- PGMQ (PostgreSQL Message Queue) extension:
Changed / Improved
- Substantial refactors to
ConnectionPoolImplto improve atomicity, thread-safety, lifecycle management, coroutine scope handling, idle cleanup, and logging (commits 0dd4087, c0062e6, 563bf38, d686842, 7a2bd9e). - Introduced
PooledConnectionwith overridden SQL execution methods, connection status management, and consistent lifecycle semantics (commit 964f95d). - Simplified SQLite URL handling and standardized error reporting via
SQLError(commit 90beae3). - Standardized
R2dbcResultSetalias usage across MySQL and PostgreSQL implementations for consistency (commit c1a336c). - SQL parameter rendering refactor, adoption of
DoubleQuotingString, and identifier processing optimizations with ASCII lookup tables (commits dd9e885, 7843334). - PgMQ
enableNotifyInsert: unified SQL statement creation and always bindthrottle_interval_ms(commit 90a3e44).
Documentation
- README and docs refreshed: revised project description; added examples for PGMQ notifications and topic-based routing; noted SQLite JDBC details (commits 34d23c3, 1146142, c57b087, 5d8d19e, 9fd753e, dc28e5d).
Dependencies / Build
- Kotlin, Tokio, and cbindgen versions updated across modules (commit 2c96c17).
- Dokka bumped from 2.0.0 to 2.1.0 (commit bb5286a by dependabot).
- Minor cleanup: remove unused suppress annotation in
ConnectionPool.Builder(commit 9855371).
Full Changelog: 1.3.0...1.4.0
1.3.0
Release Notes - v1.3.0
New Features
PostgreSQL PGMQ Extension Support (Experimental)
- Introduced module sqlx4k-postgres-pgmq for PostgreSQL Message Queue support
- Added PgMqClient class with comprehensive functionality:
- send() and send_batch() methods for sending messages
- pop() method for retrieving messages
- archive() and delete() methods for message management
- metrics() methods for queue monitoring
- Added PgMqConsumer class with:
- Message consumption from channels
- Listen support for insert notifications
- Comprehensive KDoc documentation for all PGMQ classes
- Unit tests for PgMqClient and PgMqConsumer
- Updated README with PGMQ extension section and documentation
Migration Enhancements
- Added overload Migrator.migrate() method that accepts List instead of path
SQL Validation
- Enable SQL schema validation in KSP
- Added configurable schema migrations path in KSP
- Refactored SqlValidator for enhanced query and schema validation capabilities
Context Parameters Documentation
- Added comprehensive documentation for Context-Parameters usage in repositories
- Includes configuration examples and usage guidelines
Dependency Updates
- Bumped org.postgresql:r2dbc-postgresql from 1.0.7.RELEASE to 1.1.0.RELEASE
- Bumped io.github.smyrgeorge:log4k-slf4j from 1.1.1 to 1.1.2
- Bumped KSP from 2.2.20-2.0.3 to 2.2.20-2.0.4
Build & CI Updates
- Updated JVM target to 21 across workflows and multiplatform configurations
- Updated macOS runner to macos-latest in CI workflow
- Reinstated log4k.slf4j dependency in sqlx4k-codegen module
Bug Fixes
- Fixed SQL syntax for send_batch method in PgMqClient
Full Changelog: 1.2.0...1.3.0
1.2.0
[1.2.0] - 2025-10-06
Highlights
- New SQL validation capabilities with per-query toggles, including syntax and schema checks.
- Introduced context-parameter aware repositories with a feature toggle.
- Connection pooling model simplified and unified under
ConnectionPool. - Significant documentation revamp and build performance improvements.
Added
- Per-query SQL syntax validation toggle via
@Query(checkSyntax)and related validation mechanism inRepositoryProcessor. (ffadffe, e6b2bc2) - Introduced
ContextCrudRepositoryto clarify intent; updated references and type handling accordingly. Use context-parameters, experimental. (3d78b00, 7bb2392) - Extracted parameter properties in
Statementinterface to support richer metadata handling. (5e21e1d)
Changed
- Replaced
QueryExecutor.Poolwith unifiedConnectionPool; updated related imports and refactored connection handling across modules. (a1910d5) - Refactored
RepositoryProcessorfor improved context parameter validation; switched validation helpers from parameter lists to function declarations; various null-safety and readability improvements across processors. (71c1c2f, 3d976fa) - Refactored annotation handling to rely on
qualifiedName; centralized annotation constants inTypeNames; general cleanup. (f23c85b) - Consolidated
qualifiedNameandsimpleNameextensions and standardized usage across processors. (c9b5f86)
Removed
- Dropped Calcite server dependency after initial adoption; replaced with lighter validation approach and enhanced schema handling. (76c73c7)
Documentation
- Major README revamp: reorganized sections, expanded articles, detailed usage, SQL validation, supported targets, and examples; removed outdated build scripts. (2f0919b, 349e562, 427c97d)
- Added documentation for 1.2.0. (41917bf)
Performance / Build
- Enabled Gradle parallel execution, build caching, and worker configuration to improve build times. (ef3144e)
CI / Dependencies
- Bump
gradle/actionsfrom 4 to 5 in CI. (1223b9f)
Migration notes
- If you referenced
QueryExecutor.Pool, migrate toConnectionPooland update imports accordingly. - Validation behavior can be tuned using the new toggles. Review README for configuration details.
Full Changelog: 1.1.0...1.2.0
1.1.0
Release Notes — sqlx4k 1.1.0
Date: 2025-09-26
Overview
sqlx4k 1.1.0 delivers schema-aware migrations, richer migration result reporting and callbacks, expanded platform
support, and multiple quality-of-life improvements.
Highlights
- Schema-aware migrations with optional automatic schema creation
- New migration callbacks and unified migration results
- UUID support and improved timestamp parsing
- iOS Simulator (Arm64) target support
New features and improvements
- Migrations
- Schema support in Migrator, including validation of table and schema names using regex safeguards.
- migrate now supports optional schema parameter and createSchema toggle for convenience.
- New execution callbacks for both statement and file-level migrations to aid observability.
- Results type revamped (Migrator.Results) to expose per-statement and per-file details more cleanly.
- Data types and parsing
- UUID support added.
- Timestamp parsing improved: supports “T” separator, stricter offset validation, and enhanced precision mapping to
Kotlin Time Instant.
- Developer experience and examples
- Examples updated to showcase the new callbacks and to log migration details.
- SQL preview in statement classes is now truncated in toString for cleaner logs.
- Multiplatform
- iosSimulatorArm64 target added across modules.
- Documentation
- README updated describing Kotlin-first DB implementations, WASM support, and compile-time query validation.
- Code quality and cleanup
- Removed unused extensions and redundant imports; consolidated extensions under impl.
- AbstractStatement simplified for positional parameters; optimized SQL rendering and scanner logic.
Bug fixes
-
Various internal refactors closed minor inconsistencies in documentation and parameter handling across modules. No
user-reported functional bugs were tracked during this cycle. -
Issues: please open a GitHub issue with a minimal reproducible example where possible.
Full Changelog: 1.0.0...1.1.0