Releases: smyrgeorge/sqlx4k
1.5.20
What's Changed
- Bump ksp from 2.3.4 to 2.3.5 by @dependabot[bot] in #97
- Bump gradle-wrapper from 9.3.0 to 9.3.1 by @dependabot[bot] in #96
Full Changelog: 1.5.19...1.5.20
1.5.19
Full Changelog: 1.5.18...1.5.19
1.5.18
Full Changelog: 1.5.17...1.5.18
1.5.17
Full Changelog: 1.5.16...1.5.17
1.5.16
Release Notes for Version 1.5.16
This release focuses on significant internal refactoring of the Foreign Function Interface (FFI) layer, simplifying the project structure by removing redundant header files and modularizing dialect-specific logic.
🚀 Key Improvements & Refactoring
- FFI Layer Simplification:
- Removed
sqlx4k.hand its associated.deffile in favor of a more streamlined native interop approach. - Simplified FFI logic within
MultiplatformLibConventionsto reduce build-logic complexity. - Modularized FFI logic across different database dialects (MySQL, PostgreSQL, SQLite).
- Removed
- Unified Native Callbacks:
- Implemented a unified
fncallback system across all supported dialects, improving consistency in how native results are handled. - Refactored dialect-specific implementations (
MySQL.kt,PostgreSQL.kt,SQLite.kt) to utilize the new modularized FFI structure.
- Implemented a unified
- Code Quality & Maintenance:
- Removed redundant imports and cleaned up unused native utility functions (
DriverNativeUtils.kt). - Added auto-generated stubs for key structs like
PtrandSqlx4kResultto ensure better type safety and interop stability.
- Removed redundant imports and cleaned up unused native utility functions (
🛠 Build & Infrastructure
- Updated
MultiplatformLibConventionsplugin to handle cinterop more dynamically based on the target platform and project name. - Refined
sqlx4k/build.gradle.ktsto align with the new plugin structure.
For a full list of changes from the previous version, please refer to the commit history.
Full Changelog: 1.5.15...1.5.16
1.5.15
Release Notes - Version 1.5.15
This release introduces significant new features, including batch operation support across multiple dialects, improved error handling with Result.fold, and architectural modularization for better maintainability.
🚀 New Features
- Batch Operations Support: Added
batchInsertandbatchUpdatemethods toCrudRepositoryandContextCrudRepository.- PostgreSQL: Full support for batch
INSERTandUPDATEwithRETURNINGclauses. - SQLite: Added
batchUpdatesupport using CTE-based implementations (WITH ... UPDATE ... RETURNING).
- PostgreSQL: Full support for batch
- Improved Error Handling: Replaced
mapwithfoldinRepositoryProcessorfor better result wrapping and consistent error handling across generated CRUD operations.
🛠 Refactoring & Modularization
- Dialect-Specific Modularization: Refactored platform-specific code and interop methods for MySQL, PostgreSQL, and SQLite.
- Standardized method prefixes (e.g.,
sqlx4k_mysql_,sqlx4k_postgresql_). - Updated package names to
sqlx4k.mysql,sqlx4k.postgresql, andsqlx4k.sqlite.
- Standardized method prefixes (e.g.,
- Optimization: Updated Rust
Cargo.tomlto optimize release profiles (opt-level = 3,codegen-units = 1) and enabled dynamic linking for dialect-specific builds to prevent symbol duplication. - Core Improvements:
- Refactored
AbstractStatementfor explicitnullhandling and optimized parameter map initialization. - Moved benchmark logic to
commonMainfor better cross-platform reusability. - Removed legacy
sqlx4k.hand updatedsqlx4k.defcompiler options.
- Refactored
📦 Dependency Updates
- Kotlinx Serialization: Bumped from
1.9.0to1.10.0. - Spring Boot: Bumped from
4.0.1to4.0.2. - Gradle Wrapper: Updated from
9.2.1to9.3.0.
📖 Documentation & Examples
- Updated
README.mdwith SQLite support details and batch operation examples. - Added
exampleBatchOperationsto the PostgreSQL example project. - Annotated
QueryExecutormethods with@Language("SQL")for better IDE support.
Full Changelog: 1.5.14...1.5.15
1.5.14
Release Notes - Version 1.5.14
🚀 New Features
- Support for
@ConverterAnnotation: Introduced the@Converterannotation to enable property-level custom type encoding and decoding.- Allows specifying a custom
ValueEncoder(which must be a Kotlinsingleton object) directly on@Tableproperty fields. - Provides compile-time type safety and improves performance by bypassing runtime registry lookups.
- Simplifies the handling of custom types like
Money,Address, or complex value objects.
- Allows specifying a custom
🛠️ Improvements & Optimizations
- Statement Performance: Refactored
AbstractStatementto optimize the parameter extraction and binding process, leading to more efficient query execution. - Code Generation:
- Significant refactoring of
TableProcessorandRepositoryProcessorto improve maintainability and code quality. - Enhanced decoder logic within
TableProcessorfor more robust row mapping.
- Significant refactoring of
- Better Error Messages: Improved error reporting in
TableProcessorspecifically forRETURNINGclause issues, making it easier to debug invalid entity mappings.
📖 Documentation
- Updated
README.mdand project documentation to include usage examples for the new@Converterannotation and other version-specific updates.
Full Changelog: 1.5.13...1.5.14
1.5.13
Release Notes - Version 1.5.13
This release introduces significant enhancements to the ORM capabilities, improved validation for data integrity and security, and a refactored RowMapper interface for better extensibility.
🚀 New Features
- DB-Generated Columns Support: Added support for applying DB-generated columns back to entities after
INSERTorUPDATEoperations. This ensures that fields like auto-incrementing IDs or server-side timestamps are correctly synchronized with your Kotlin objects. - Enhanced Repository Validation:
- Update Validation: Introduced checks to ensure the updated entity's ID matches the original ID after an update operation.
- Delete Validation: Added row count validation for delete operations to confirm that exactly one row was affected.
- New Error Code: Introduced
SQLError.Code.RowMismatchfor improved error handling in case of mismatched operation results.
🛡️ Security & Validation
- SQL Identifier Validation: Added validation for SQL identifiers and unsafe content in custom wrappers to prevent SQL injection and ensure data integrity.
- Schema Enforcement: The
Migratornow enforces the presence of a schema whencreateSchemais set totrue.
⚠️ Breaking Changes
- RowMapper Refactoring: The
RowMapperinterface has been refactored to require aValueEncoderRegistry. The single-argumentmapmethod has been removed. All custom implementations must be updated to use the new signature:fun map(row: ResultSet.Row, encoders: ValueEncoderRegistry): T
🛠️ Improvements
- Processor Enhancements:
TableProcessorandRepositoryProcessorreceived updates for improved error handling, consistency, and better documentation generation. - Documentation: Comprehensive updates to documentation for annotations and processors.
- Migration Logic: Refined schema management and migration file handling.
🐛 Bug Fixes
- Fixed various typos in
TableProcessor,RepositoryProcessor, andAbstractStatement. - Fixed a naming typo: Renamed
QuadrapletoQuadrupleinRepositoryProcessorand utility classes.
📦 Dependency Updates
- Bumped
io.github.smyrgeorge:log4k-slf4jfrom1.3.1to1.3.2. - Bumped
publishplugin from0.35.0to0.36.0.
🧪 Testing
- Added comprehensive test suites for
ContextCrudRepositoryandCrudRepositoryhooks. - Increased test coverage for generated repository implementations and processors.
Full Changelog: 1.5.12...1.5.13
1.5.12
Release Notes - Version 1.5.12
This release includes bug fixes, improvements in error handling, and enhanced null value processing in ResultSet.
🚀 New Features & Improvements
- Improved Null Handling: Added
isNull()method toResultSet.Row.Columnto easily check for null values during result set processing. - Enhanced Error Codes: Refined
SQLError.Codefor better clarity and consistency.
🛠 Bug Fixes
- Fixed various typos in
SQLError.Code:EmpryResultSetcorrected toEmptyResultSet.UknownErrorcorrected toUnknownError.
- Renamed
NamedParameterTypeNotSupportedtoMissingValueConverterto more accurately reflect its usage. - Improved value encoding logic to handle null values more robustly.
Full Changelog: 1.5.11...1.5.12
1.5.11
Release Notes - Version 1.5.11
Release notes for version 1.5.11 (changes since 1.5.10):
🚀 New Features
ValueEncoderRegistryEnhancements:- Added
plusoperator support to easily merge twoValueEncoderRegistryinstances. - Introduced
getTyped(type: KClass<T>)for type-safe encoder retrieval. - Improved the inline
get<T>()method to return a typedValueEncoder<T>instead ofValueEncoder<Any>.
- Added
🔄 Dependency Updates
- Bumped
io.github.smyrgeorge:log4k(and relatedlog4k-slf4j) from1.2.3to1.3.1.
Full Changelog: 1.5.10...1.5.11