Skip to content

v2.9.0

Choose a tag to compare

@tommyknocker tommyknocker released this 01 Nov 05:05
· 349 commits to master since this release

🎉 Release v2.9.0 - MariaDB Support & Major Enhancements

Release Date: November 1, 2025

This release adds full MariaDB support as the fourth database dialect, along with significant enhancements for query building, debugging, and developer experience.

🚀 Major Features

✨ MariaDB Support

PDOdb now supports 4 database dialects: MySQL, MariaDB, PostgreSQL, and SQLite!

  • Complete MariaDBDialect class with full SQL dialect implementation
  • 171 dedicated tests with 783 assertions for MariaDB-specific functionality
  • All 51 examples work flawlessly on MariaDB (51/51 passing)
  • GitHub Actions CI integration with dedicated MariaDB job and coverage reporting
  • Full documentation updates across all README files

🔀 MERGE Statement Support

Standard SQL MERGE operations for complex data synchronization:

  • PostgreSQL: Native MERGE with MATCHED/NOT MATCHED clauses
  • MySQL 8.0+: Enhanced UPSERT via INSERT ... ON DUPLICATE KEY UPDATE
  • SQLite: Enhanced UPSERT support
  • New QueryBuilder::merge() method for merge operations

🎨 SQL Formatter/Pretty Printer

Enhanced debugging experience with human-readable SQL output:

  • QueryBuilder::toSQL(bool $isFormatted = false) - Optional formatted output
  • Proper indentation for nested queries, JOINs, and subqueries
  • Multi-line formatting for complex queries
  • Optional SQL keyword highlighting
  • Standalone SqlFormatter class

💡 IDE Autocomplete Improvements

Better developer experience with enhanced type inference:

  • @template annotations for better IDE support
  • More precise PHPDoc return type annotations
  • Improved inheritance support with static return types

🔧 Improvements

Fluent Interface Return Types

  • Replaced self with static for better inheritance support
  • Improved IDE autocomplete in subclass contexts
  • Better extensibility for custom QueryBuilder classes

Documentation

  • Replaced Db::raw() with QueryBuilder helpers where possible
  • Cleaner, more maintainable documentation examples
  • Better demonstrations of proper helper usage

🐛 Bug Fixes

MariaDB Compatibility

  • Window Functions: LAG/LEAD with default values now use COALESCE wrapper (MariaDB doesn't support 3rd parameter)
  • Type Casting: Fixed CAST operations - replaced REAL with DECIMAL(10,2) for MariaDB/MySQL
  • JSON Operations: Fixed JSON_SET for nested paths and JSON_REMOVE for array indices
  • Health Check: Fixed GitHub Actions MariaDB container health check configuration

Example Compatibility

  • All examples updated to support 4 dialects (MySQL, MariaDB, PostgreSQL, SQLite)
  • CREATE TABLE statements normalized for MariaDB compatibility
  • Dialect-specific logic updated in all example files

📊 Statistics

  • Tests: 1200 tests, 4856 assertions (+209 tests, +905 assertions from v2.8.0)
  • Examples: 204/204 passing (51 files × 4 dialects)
    • ✅ SQLite: 51/51
    • ✅ MySQL: 51/51
    • MariaDB: 51/51 (NEW!)
    • ✅ PostgreSQL: 51/51
  • Code Quality: PHPStan Level 8, PSR-12 compliant
  • Backward Compatibility: 100% maintained

🔗 Links

📦 Installation

composer require tommyknocker/pdo-database-class:^2.9.0

Full Changelog: v2.8.0...v2.9.0