Skip to content

Releases: smyrgeorge/sqlx4k

1.5.4

28 Dec 09:47

Choose a tag to compare

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 AutoRowMapper in the @Repository annotation. RepositoryProcessor now automatically handles mappers when a custom one isn't specified.
    • PostgreSQL Support: Expanded TableProcessor and RowMapper generation to support the PostgreSQL dialect.
    • SQL Validation: Integrated JetBrains annotations, enabling @Language("SQL") on @Query methods for better IDE-level SQL syntax highlighting and validation.
  • Core API & Transactions:

    • Safe Transactions: Introduced transactionCatching for safer transactional operations and enhanced existing transaction logic with better Result handling.
    • Value Encoding/Decoding:
      • Refactored ValueEncoder as a functional interface.
      • Expanded ValueEncoder to support bidirectional encoding (added decode support).
      • Enhanced ValueEncoderRegistry with reified type support and improved registration APIs.
    • RowMapper Improvements: Refactored the RowMapper interface to support value decoders, improving query mapping and class name handling.
  • Error Handling & Drivers:

    • Enhanced Error Propagation: Improved SQLError creation to include underlying exception causes across MySQL, PostgreSQL, SQLite, and ConnectionPool implementations.

Full Changelog: 1.5.3...1.5.4

1.5.3

26 Dec 23:09

Choose a tag to compare

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, and preDeleteHook allow for entity transformation or validation before database operations.
    • Query Hook: aroundQuery provides a way to intercept all database operations (including custom @Query methods). This is ideal for implementing cross-cutting concerns such as logging, performance monitoring, and distributed tracing.
  • Enhanced KSP Processor: The RepositoryProcessor has been significantly improved:
    • Better handling of context parameters in repository methods.
    • Improved support and validation for sqlx4k-arrow return types.
    • Stronger validation for hierarchical repository types.

⚙️ Refactorings & Internal Changes

  • Migrator Refactor: Renamed Migrator.Db to Migrator.QueryExecutor to align with the naming conventions used throughout the library.
  • Decoupled Value Encoding: Extracted ValueEncoder and ValueEncoderRegistry from the Statement interface into standalone files, improving the modularity of the core API.
  • Consistency Updates: Standardized QueryExecutor references across MySQL, PostgreSQL, and SQLite implementations.

📚 Documentation & Examples

  • Hooks Documentation: Added a new section to the README.md explaining how to use Repository Hooks.
  • Postgres Example: Updated the PostgreSQL example to demonstrate integration with the sqlx4k-arrow module.
  • API Docs: Updated Dokka documentation for the 1.5.3 release.

Full Changelog: 1.5.2...1.5.3

1.5.2

25 Dec 16:49

Choose a tag to compare

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-arrow module to keep the core library lightweight.
    • Introduced ArrowCrudRepository and ArrowContextCrudRepository for better integration with Arrow's functional patterns.
  • Repository Processor Improvements:
    • Added support for repository type categorization.
    • Enhanced error handling by utilizing specific SQLError codes.
    • 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.kt for better maintainability and error reporting.
  • Updated SQLError to include UknownError code 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

22 Dec 17:31

Choose a tag to compare

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.Column for better type support.
  • Enhanced Error Reporting: SQLError now supports nested exceptions, providing more detailed error reporting.

🛠️ Improvements & Refactoring

  • Consistent Naming: Refactored connection and transaction classes to use consistent Sqlx and Native prefixes 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.toml and build scripts, correcting kotlinx-serialisation to kotlinx-serialization.

🔄 Dependency Updates

  • Kotlin: Updated to 2.3.0.
  • Gradle: Updated to 9.2.1.
  • KSP: Updated from 2.3.2 to 2.3.4.
  • Spring Boot: Updated from 3.5.7 to 4.0.1.
  • Kotlinx Libraries: Updated kotlinx-io (to 0.8.1) and kotlinx-datetime.
  • SQLite JDBC: Updated from 3.51.0.0 to 3.51.1.0.
  • GitHub Actions: Updated actions/cache to v5 and actions/checkout to v6.
  • Publish Plugin: Updated from 0.34.0 to 0.35.0.

New Contributors

Full Changelog: 1.5.0...1.5.1

1.5.0

21 Nov 22:51

Choose a tag to compare

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_name now has a foreign key with ON 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.

Behavior and schema changes

  • PostgreSQL PGMQ: add FK on pgmq.topic_bindings(queue_name) with ON DELETE CASCADE for 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;

API changes and refactors

  • Connection interface now includes setTransactionIsolationLevel(...).
    • Maintainors of custom Connection impls must add this method.
    • Commits: 22521c80, 1edfaa54, b5670d59.
  • Unify default execution using encoders; remove DB-specific overrides of execute and fetchAll(Statement).
    • Commits: 4f7e48da, 243627ed.
  • Expose/propagate encoders across modules; remove redundant companion objects.
    • Commit: 243627ed.
  • Internal cleanup: inline isolation level SQL; remove NoQuotingString (internal).
    • Commit: b5670d59.

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-jdbc 3.50.3.0 → 3.51.0.0 (e57682f0).
  • KSP: 2.2.20-2.0.42.3.0 (1ce65f66), then 2.3.02.3.2 (ea5b9658).
  • PostgreSQL R2DBC: org.postgresql:r2dbc-postgresql 1.1.0.RELEASE → 1.1.1.RELEASE (414075c6).
  • Apache Calcite: 1.40.01.41.0 (ff291302).
  • Spring Boot: 3.5.63.5.7 (2b06e836).

Upgrade notes

  • If you implement custom Connection types, add setTransactionIsolationLevel(...).
  • 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

26 Oct 07:22

Choose a tag to compare

Full Changelog: 1.4.0...1.4.1

1.4.0

25 Oct 21:00

Choose a tag to compare

[1.4.0] - 2025-10-25

Breaking changes

  • Connection API: Connection.release() was renamed to Connection.close() to align with common lifecycle semantics (commit 4b2406c). Update all usages to close().

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 access ValueEncoderRegistry (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 ConnectionPoolImpl to improve atomicity, thread-safety, lifecycle management, coroutine scope handling, idle cleanup, and logging (commits 0dd4087, c0062e6, 563bf38, d686842, 7a2bd9e).
  • Introduced PooledConnection with 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 R2dbcResultSet alias 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 bind throttle_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

15 Oct 13:16

Choose a tag to compare

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

06 Oct 08:55

Choose a tag to compare

[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 in RepositoryProcessor. (ffadffe, e6b2bc2)
  • Introduced ContextCrudRepository to clarify intent; updated references and type handling accordingly. Use context-parameters, experimental. (3d78b00, 7bb2392)
  • Extracted parameter properties in Statement interface to support richer metadata handling. (5e21e1d)

Changed

  • Replaced QueryExecutor.Pool with unified ConnectionPool; updated related imports and refactored connection handling across modules. (a1910d5)
  • Refactored RepositoryProcessor for 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 in TypeNames; general cleanup. (f23c85b)
  • Consolidated qualifiedName and simpleName extensions 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/actions from 4 to 5 in CI. (1223b9f)

Migration notes

  • If you referenced QueryExecutor.Pool, migrate to ConnectionPool and 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

26 Sep 16:40

Choose a tag to compare

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