Skip to content

Releases: smyrgeorge/sqlx4k

1.5.20

04 Feb 11:41

Choose a tag to compare

What's Changed

Full Changelog: 1.5.19...1.5.20

1.5.19

02 Feb 21:02

Choose a tag to compare

Full Changelog: 1.5.18...1.5.19

1.5.18

01 Feb 10:36

Choose a tag to compare

Full Changelog: 1.5.17...1.5.18

1.5.17

01 Feb 10:36

Choose a tag to compare

Full Changelog: 1.5.16...1.5.17

1.5.16

26 Jan 15:46

Choose a tag to compare

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.h and its associated .def file in favor of a more streamlined native interop approach.
    • Simplified FFI logic within MultiplatformLibConventions to reduce build-logic complexity.
    • Modularized FFI logic across different database dialects (MySQL, PostgreSQL, SQLite).
  • Unified Native Callbacks:
    • Implemented a unified fn callback 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.
  • Code Quality & Maintenance:
    • Removed redundant imports and cleaned up unused native utility functions (DriverNativeUtils.kt).
    • Added auto-generated stubs for key structs like Ptr and Sqlx4kResult to ensure better type safety and interop stability.

🛠 Build & Infrastructure

  • Updated MultiplatformLibConventions plugin to handle cinterop more dynamically based on the target platform and project name.
  • Refined sqlx4k/build.gradle.kts to 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

26 Jan 09:19

Choose a tag to compare

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 batchInsert and batchUpdate methods to CrudRepository and ContextCrudRepository.
    • PostgreSQL: Full support for batch INSERT and UPDATE with RETURNING clauses.
    • SQLite: Added batchUpdate support using CTE-based implementations (WITH ... UPDATE ... RETURNING).
  • Improved Error Handling: Replaced map with fold in RepositoryProcessor for 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, and sqlx4k.sqlite.
  • Optimization: Updated Rust Cargo.toml to optimize release profiles (opt-level = 3, codegen-units = 1) and enabled dynamic linking for dialect-specific builds to prevent symbol duplication.
  • Core Improvements:
    • Refactored AbstractStatement for explicit null handling and optimized parameter map initialization.
    • Moved benchmark logic to commonMain for better cross-platform reusability.
    • Removed legacy sqlx4k.h and updated sqlx4k.def compiler options.

📦 Dependency Updates

  • Kotlinx Serialization: Bumped from 1.9.0 to 1.10.0.
  • Spring Boot: Bumped from 4.0.1 to 4.0.2.
  • Gradle Wrapper: Updated from 9.2.1 to 9.3.0.

📖 Documentation & Examples

  • Updated README.md with SQLite support details and batch operation examples.
  • Added exampleBatchOperations to the PostgreSQL example project.
  • Annotated QueryExecutor methods with @Language("SQL") for better IDE support.

Full Changelog: 1.5.14...1.5.15

1.5.14

23 Jan 07:51

Choose a tag to compare

Release Notes - Version 1.5.14

🚀 New Features

  • Support for @Converter Annotation: Introduced the @Converter annotation to enable property-level custom type encoding and decoding.
    • Allows specifying a custom ValueEncoder (which must be a Kotlin singleton object) directly on @Table property 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.

🛠️ Improvements & Optimizations

  • Statement Performance: Refactored AbstractStatement to optimize the parameter extraction and binding process, leading to more efficient query execution.
  • Code Generation:
    • Significant refactoring of TableProcessor and RepositoryProcessor to improve maintainability and code quality.
    • Enhanced decoder logic within TableProcessor for more robust row mapping.
  • Better Error Messages: Improved error reporting in TableProcessor specifically for RETURNING clause issues, making it easier to debug invalid entity mappings.

📖 Documentation

  • Updated README.md and project documentation to include usage examples for the new @Converter annotation and other version-specific updates.

Full Changelog: 1.5.13...1.5.14

1.5.13

19 Jan 19:15

Choose a tag to compare

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 INSERT or UPDATE operations. 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.RowMismatch for 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 Migrator now enforces the presence of a schema when createSchema is set to true.

⚠️ Breaking Changes

  • RowMapper Refactoring: The RowMapper interface has been refactored to require a ValueEncoderRegistry. The single-argument map method 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: TableProcessor and RepositoryProcessor received 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, and AbstractStatement.
  • Fixed a naming typo: Renamed Quadraple to Quadruple in RepositoryProcessor and utility classes.

📦 Dependency Updates

  • Bumped io.github.smyrgeorge:log4k-slf4j from 1.3.1 to 1.3.2.
  • Bumped publish plugin from 0.35.0 to 0.36.0.

🧪 Testing

  • Added comprehensive test suites for ContextCrudRepository and CrudRepository hooks.
  • Increased test coverage for generated repository implementations and processors.

Full Changelog: 1.5.12...1.5.13

1.5.12

15 Jan 17:39

Choose a tag to compare

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 to ResultSet.Row.Column to easily check for null values during result set processing.
  • Enhanced Error Codes: Refined SQLError.Code for better clarity and consistency.

🛠 Bug Fixes

  • Fixed various typos in SQLError.Code:
    • EmpryResultSet corrected to EmptyResultSet.
    • UknownError corrected to UnknownError.
  • Renamed NamedParameterTypeNotSupported to MissingValueConverter to 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

14 Jan 23:24

Choose a tag to compare

Release Notes - Version 1.5.11

Release notes for version 1.5.11 (changes since 1.5.10):

🚀 New Features

  • ValueEncoderRegistry Enhancements:
    • Added plus operator support to easily merge two ValueEncoderRegistry instances.
    • Introduced getTyped(type: KClass<T>) for type-safe encoder retrieval.
    • Improved the inline get<T>() method to return a typed ValueEncoder<T> instead of ValueEncoder<Any>.

🔄 Dependency Updates

  • Bumped io.github.smyrgeorge:log4k (and related log4k-slf4j) from 1.2.3 to 1.3.1.

Full Changelog: 1.5.10...1.5.11