Skip to content

v2.9.1

Choose a tag to compare

@tommyknocker tommyknocker released this 04 Nov 05:10
· 300 commits to master since this release

Release 2.9.1 - Enhanced Error Diagnostics & ActiveRecord Improvements

Release Date: November 4, 2025

🎉 What's New

This release introduces Enhanced Error Diagnostics (roadmap item 1.1), significant ActiveRecord relationship improvements, and several developer experience enhancements.

✨ Major Features

Enhanced Error Diagnostics

  • QueryDebugger class - Centralized debugging utilities for parameter sanitization and context formatting
  • QueryException enhancements - Now includes queryContext property with complete query builder state
  • Automatic context capture - Query context automatically captured and included in exceptions
  • Parameter sanitization - Sensitive data (passwords, tokens, API keys) automatically masked in error messages
  • Comprehensive documentation - New error-diagnostics.md guide with practical examples

ActiveRecord Relationship Enhancements

  • Many-to-many relationships - New viaTable() and via() methods for junction table relationships
  • Yii2-like syntax - Support for Yii2-style relationship definitions for easier migration
  • Enhanced relationship documentation and examples

QueryBuilder Convenience Methods

  • first() - Get first row from query result
  • last() - Get last row from query result
  • index() - Index query results by a specific column

CLI Migration Tool

  • Yii2-style migration command-line tool
  • Create, run, and rollback migrations via command line
  • Yii2-compatible migration workflow

📚 Documentation Improvements

  • MariaDB configuration examples - Complete setup guide in Getting Started documentation
  • MariaDB connection examples - Step-by-step connection guide in first-connection.md
  • Complete MariaDB setup guide for new users

🔄 Changes

  • Fulltext search helper - Renamed Db::fulltextMatch() to Db::match() for clarity
  • Composer script namespacing - All scripts now use pdodb: prefix
  • PdoDb scope methods - Renamed for better readability

🐛 Fixes

  • Fixed fatal error in LoadBalancerTests by implementing missing setTempQueryContext() method
  • Fixed all PHPStan type errors
  • Resolved all PHP-CS-Fixer code style issues

📊 Technical Details

  • All tests passing - Comprehensive test coverage with improved ActiveQuery, EagerLoader, and CacheManager tests
  • PHPStan Level 8 - Zero errors across entire codebase
  • PHP-CS-Fixer - All code complies with PSR-12 standards
  • 100% backward compatible - All existing code continues to work
  • Code quality - Follows KISS, SOLID, DRY, YAGNI principles

📖 Documentation

🔗 Links

📦 Installation

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

Thank you for using PDOdb! 🚀