Skip to content

Releases: smyrgeorge/sqlx4k

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

1.0.0

22 Sep 12:05

Choose a tag to compare

[1.0.0] - 2025-09-22

First stable release.

Features

  • High-performance, non-blocking database drivers for Kotlin Multiplatform.
  • Supported databases: PostgreSQL, MySQL, SQLite.
  • Supported targets:
    • jvm (currently PostgreSQL and MySQL)
    • iosArm64, androidNativeX64, androidNativeArm64
    • macosArm64, macosX64
    • linuxArm64, linuxX64
    • mingwX64
    • wasmWasi (planned candidate)
  • Async I/O throughout the driver.
  • Connection pooling with configurable options (min/max connections, acquire timeout, idle timeout, max lifetime).
  • Simple APIs for acquiring connections and executing commands/queries.
  • Prepared statements with both named and positional parameters.
  • Row mapping utilities for ergonomic mapping from ResultSet rows to domain objects.
  • Transactions with both manual begin/commit/rollback and block-scoped transactions.
  • Coroutine-aware TransactionContext to propagate an active transaction via coroutine context and compose suspending functions.
  • Code generation module (KSP) for CRUD and @repository implementations.
  • Database migrations support.
  • PostgreSQL LISTEN/NOTIFY support.
  • SQLDelight integration.
  • Documentation site: https://smyrgeorge.github.io/sqlx4k/

Known limitations and notes

  • On JVM, SQLite is not yet supported; PostgreSQL and MySQL are supported.
  • wasmWasi is a potential future target and not yet officially supported.
  • Windows (mingwX64) users: if you encounter lld-link: error: -exclude-symbols:___chkstk_ms is not allowed in .drectve, see issue #18: #18

How to use 1.0.0

Use the coordinates that match your database:

implementation("io.github.smyrgeorge:sqlx4k-postgres:1.0.0")
// or for MySQL
implementation("io.github.smyrgeorge:sqlx4k-mysql:1.0.0")
// or for SQLite
implementation("io.github.smyrgeorge:sqlx4k-sqlite:1.0.0")

For more details, see the README and the documentation site.

0.80.0

15 Sep 10:27

Choose a tag to compare

[0.80.0] - 2025-09-15

This release includes significant improvements to code generation (CRUD and @repository), expanded examples, and broader test coverage across drivers, plus dependency updates.

Added

  • MySQL-specific CRUD query generation in the codegen module, enabling dialect-aware auto-generated SQL for MySQL.
  • New MySQL examples demonstrating code generation, repository integration, and transactional context usage.
  • New SQLite examples demonstrating code generation, repository integration, and transactional context usage.
  • Common and platform-specific tests for execute and fetchAll, including prepared statements support on MySQL, PostgreSQL, and SQLite.

Changed

  • Refactored examples to streamline entry points and reduce duplication by centralizing logic in an Examples utility across JVM and Native targets.
  • Code generation refactoring to avoid redundant sequence traversals and to improve SQL query generation consistency across dialects.

Fixed

  • Fixed MySQL auto-generated CRUD example (correct SQL generation and usage patterns).
  • Restored and fixed SQLite auto-generated CRUD example.

Dependencies

  • Kotlin: 2.2.10 → 2.2.20.
  • KSP: 2.2.10-2.0.2 → 2.2.20-2.0.3.

Documentation

  • README updates: Kotlin badge version and notes on configuring dialect (e.g., MySQL) for the codegen.

Notes on Codegen and Potential Breakages

The code generation changes may subtly affect generated SQL in edge cases (especially for MySQL and SQLite). If you rely on generated CRUD or repository methods, please re-run KSP and verify:

  • Insert/Update statement column ordering and parameter binding.
  • Dialect-specific quoting and placeholders (named/positional) as applicable.

If you encounter issues, please open an issue with the failing SQL and your model/repository definitions.

Full Changelog: 0.74.0...0.80.0

0.74.0

13 Sep 17:11

Choose a tag to compare

[0.74.0] - 2025-09-13

Summary: This release focuses on unified connection management across drivers, improvements to PostgreSQL LISTEN/NOTIFY, new PostgreSQL array decoding, a number of fixes/refactors in connection/transaction handling, and extensive new tests and docs. Some API changes are breaking — see Breaking changes and Upgrade notes below.

Added

  • PostgreSQL: Support for decoding SQL array types. (1169bb0)
  • Connection management implementations across drivers:
    • PostgreSQL: acquire/release methods, improved QueryExecutor and Connection integrations. (88cc757)
    • MySQL & SQLite: acquire/release, query execution, transaction handling, native interop updates. (305a1f8)
  • Unified connection management abstractions for MySQL and PostgreSQL via a new Cn class; examples for manual connection handling in README. (2b32753)
  • Tests: Extensive common and platform-specific tests for connections, transactions, and migrations across PostgreSQL, MySQL, and SQLite. (1db3f5a, eafab34, ee4c3ca)

Changed

  • PostgreSQL LISTEN/NOTIFY:
    • listen method signatures now accept suspend callbacks. (7be0020)
    • Enhanced channel name validation; safer SQL string construction for LISTEN. (7be0020, e20d84f)
  • Transactions and error handling:
    • Refactored connection and transaction error-handling methods across all drivers. (97ded4f)
    • Refined transaction handling and introduced closeConnectionAfterTx behavior in tests/config. (eafab34)
  • Documentation and examples:
    • README and examples updated to reflect new transaction API (withCurrent accepting Driver) and connection management patterns. (34bbb8a, 2b32753)
  • Build/dependencies: Upgraded Rust tokio to 1.47.1 across native modules. (34bbb8a)

Fixed

  • PostgreSQL: Correct variable binding for pg_notify and safer construction of LISTEN statements. (e20d84f)

Tests/Chore

  • Added/updated tests across drivers for connections, transactions, migrations, and LISTEN/NOTIFY. (1db3f5a, eafab34, ee4c3ca, 7be0020, 1169bb0)
  • .gitignore: Include SQLite temporary files; remove obsolete entries. (6e5f7ac)

Breaking changes

  • PostgreSQL LISTEN API: listen callbacks are now suspend functions. If you passed a non-suspending lambda previously, update signatures/usages to a suspending context.
  • Connection/Transaction APIs: Unification and introduction of the Cn class and revised Connection/QueryExecutor usages may require minor source updates. Review your manual acquire/release and transaction flows.
  • Transaction API docs updated: withCurrent now accepts a Driver; verify your call sites align with the new signature.

Upgrade notes

  • Update any PostgreSQL listen handlers to be suspend and ensure they are invoked from a coroutine context.
  • If using manual connection management, migrate to the new unified APIs:
    • Prefer acquire { /* use connection */ } patterns or explicit acquire/release with the new Cn wrapper where applicable.
  • Revisit transaction flows to ensure compatibility with refined error handling and any closeConnectionAfterTx semantics in your configuration/tests.
  • If you build native modules, ensure your environment is compatible with tokio 1.47.1.

Full Changelog: 0.73.0...0.74.0

0.73.0

04 Sep 21:18

Choose a tag to compare

[0.73.0] - 2025-09-04

Features:

  • Introduce TransactionContext for coroutine-aware transactional boundaries. Examples and docs updated to illustrate usage.

Improvements:

  • Centralize and reuse type names in sqlx4k-codegen via TypeNames to reduce duplication in TableProcessor and RepositoryProcessor.
  • Enhance RepositoryProcessor with additional validation and logging; consolidate CRUD generation and method checks.
  • Refine repository interface to integrate with CrudRepository and improve SQL query APIs.

Documentation:

  • Expanded README with clearer sections for CRUD helpers and @Repository usage.
  • Clarified that code-generation modules are still evolving (potential breaking changes).
  • Updated examples, removed unused imports, and improved anchors/section titles.
  • Updated LICENSE year to 2025 and added Acknowledgements/License sections.
  • Added documentation for 0.73.0.

Full Changelog: 0.72.1...0.73.0

0.72.1

01 Sep 13:25

Choose a tag to compare

[0.72.1] - 2025-09-01

Small corrective release.

Summary

  • Migrator: enforce deterministic ordering by version and validate for gaps in filesystem-discovered migrations. This prevents accidentally skipping versions and ensures a strictly monotonic sequence.
  • Files/IO: replace okio usage with kotlinx-io, simplify file reading utilities, and improve resource handling.
  • Tests/Docs: re-enable previously disabled migration tests and update documentation/examples accordingly.

Details (since 0.72.0)

  • ea6bb01: Refactor file and buffer handling, enforce absolute random values, enable previously disabled migration test cases, and improve sorting logic in migrator.
  • aeb4ef1: Replace okio with kotlinx-io, refactor file handling logic, adjust migration tests, update dependency imports, and deprecate unused test cases.
  • 6cff9b9: Update okio to 3.16.0, refactor file handling utilities, and simplify migration file processing.
  • 6aec418: Added documentation for 0.72.1.

Dependency updates

  • Removed: okio
  • Added: org.jetbrains.kotlinx:kotlinx-io-core:0.8.0

Migration notes

  • No API changes expected. Behavior is stricter around migrations: versions must be contiguous and unique; files are processed deterministically by version. Ensure your migration files are named <version>_<description>.sql with no gaps in version numbering.

Full Changelog: 0.72.0...0.72.1