Skip to content

Releases: ray-di/Ray.MediaQuery

1.1.1

Choose a tag to compare

@koriym koriym released this 25 Jun 14:38

Added

  • English hands-on tutorial covering Ray.MediaQuery 1.1 features end-to-end on SQLite (docs/tutorial/README.md), with the Japanese edition preserved at /tutorial/ja/
  • Manual covering installation, module setup, SQL conventions, result mapping, factories, parameter handling, pagination, and direct SQL execution (docs/reference.md)
  • GitHub Pages documentation site (home, manual, FAQ) and a slimmed README landing page
  • Ray.WebQuery manual on the documentation site (#107)
  • Optional, dev-only PHPStan extension under vendor-bin/media-query-phpstan/ that statically verifies #[DbQuery] contracts: SQL file existence, #[Pager] / PagesInterface coherence, and factory class/method validation (#105)

Changed

  • Document that StringCase is unused internally (#92)

Fixed

  • Restore Ray\MediaQuery\CamelCaseTrait (deprecated) for 1.x backward compatibility. It was unintentionally removed in 1.1.0, causing a hard fatal (Trait ... not found) for entities still importing it (#93, #96)
  • Correct the manual's #[DbQuery(type: 'row')] example return type to ?array (a single-row query returns null when no row matches) and the tutorial's readonly class PHP version (8.2, not 8.4) (#102)

1.1.0

Choose a tag to compare

@koriym koriym released this 06 May 14:39

Added

  • PostQueryInterface for typed result building (DML results and SELECT collection wrappers) (#85, #89)
  • AffectedRows / InsertedRow result types and execAffected() for DML (#85)
  • AI-oriented reference at docs/llms-full.txt (#90)

Fixed

  • Pager hydration honors the factory on #[DbQuery] (#91)

Full Changelog: 1.0.4...1.1.0

1.0.4

Choose a tag to compare

@koriym koriym released this 13 Apr 23:06
a3a9a52

Fixed

  • Fix DbPager mutating the #[Pager] attribute instance it receives. DbPager::__invoke() now clones the Pager at entry so dynamicPager() no longer writes back to the caller's instance (#80, #81)

See CHANGELOG.md for full details.

Full Changelog: 1.0.3...1.0.4

1.0.3

Choose a tag to compare

@koriym koriym released this 24 Jan 21:09
7850653

Changed

  • Upgrade phpdocumentor/reflection-docblock from ^5.3 to ^6.0
  • Upgrade phpdocumentor/type-resolver from ^1.6.1 to ^2.0
  • Inject DocBlockFactoryInterface via constructor in ReturnEntity

Fixed

  • Fix extractValueType to correctly return value type for multi-parameter generics (array<K, V>)

Full Changelog: 1.0.1...1.0.3

1.0.2

Choose a tag to compare

@koriym koriym released this 28 Dec 18:24
0f43c1b

Add Psalm taint annotations for SQL injection analysis

1.0.1

Choose a tag to compare

@koriym koriym released this 23 Nov 09:13

Fixed

  • Fixed line comment handling in query type detection. SQL files with line comments (--) containing query keywords (e.g., -- SELECT for testing) no longer cause incorrect query type detection. (#76)
  • Added missing trailing newlines to SQL test files to follow POSIX text file standard

Thanks


Full Changelog: 1.0.0...1.0.1

1.0.0

Choose a tag to compare

@koriym koriym released this 20 Nov 14:49

Stable Release:

Ray.MediaQuery 1.0.0 marks the stable release with full PHP 8 attribute only support.

Added

  • MediaQuerySqlModule - Simplified module configuration for SQL-only usage

Breaking Changes

  • Annotation support removed - use PHP 8 attributes instead (#[DbQuery], #[Pager])
  • Web API functionality moved to separate ray/web-query package
  • See 1.0.0-rc1 release notes and Migration Guide for details

Changed

  • Updated to PHP 8 attribute-based dependencies (ray/aop ^2.19, ray/di ^2.19)
  • Improved documentation with clearer interface-driven SQL approach

Full Changelog: 1.0.0-rc2...1.0.0

1.0.0-rc3 - PHP 8.2+ Migration

Pre-release

Choose a tag to compare

@koriym koriym released this 11 Nov 09:29
f7dfff9

Breaking Changes

Minimum PHP Version: 8.2

  • Dropped support for PHP 8.1
  • Added support for PHP 8.2, 8.3, 8.4, and 8.5

New Features

MediaQuerySqlModule - Simplified API

Introduces a new high-level API for easier SQL query integration:

// New simplified way (recommended)
$this->install(new MediaQuerySqlModule('/path/to/interfaces', '/path/to/sql'));

// Old way (still supported, marked as @internal low-level API)
$queries = Queries::fromDir('/path/to/interfaces');
$this->install(new MediaQueryModule($queries, [new DbQueryConfig('/path/to/sql')]));

Benefits:

  • One-line module installation for typical use cases
  • Automatic discovery of query interfaces
  • Clear separation between high-level and low-level APIs
  • Full backward compatibility

Removed Dependencies

The following dependencies have been removed as they are no longer needed:

  • nikic/php-parser - Not used in the codebase (still available as transitive dependency via PHPUnit)
  • koriym/attributes - No longer required
  • symfony/polyfill-php81 - Not needed for PHP 8.2+
  • symfony/polyfill-php83 - Not needed for PHP 8.2+

Updated Dependencies

  • ray/aura-sql-module: ^1.12.0 → ^1.13.7

Internal API Documentation

  • MediaQueryModule: Now marked as @internal low-level API for advanced use cases
  • MediaQueryBaseModule: Marked as @internal (common bindings)
  • MediaQueryDbModule: Marked as @internal (SQL-specific bindings)

CI/Testing Changes

  • Removed PHP 8.1 from CI test matrix
  • Added PHP 8.5 to CI test matrix
  • Test coverage: PHP 8.2, 8.3, 8.4 (highest and lowest dependencies)
  • Test coverage: PHP 8.5 (highest dependencies only)
  • Excluded PHP 8.4+ lowest dependencies testing due to aura/sql v4 incompatibility

Migration Guide

If you are upgrading from a previous version:

  1. Update PHP version: Ensure your environment runs PHP 8.2 or higher
  2. Update dependencies: Run composer update
  3. Update module installation (optional, recommended):
    // From:
    $queries = Queries::fromDir('/path/to/interfaces');
    $this->install(new MediaQueryModule($queries, [new DbQueryConfig('/path/to/sql')]));
    
    // To:
    $this->install(new MediaQuerySqlModule('/path/to/interfaces', '/path/to/sql'));
  4. Test your application: All existing functionality remains compatible

Notes

  • No breaking changes to existing public APIs
  • All 82 tests passing on PHP 8.2, 8.3, 8.4, and 8.5
  • 100% static analysis coverage (Psalm & PHPStan)
  • Full backward compatibility maintained

1.0.0-rc2

1.0.0-rc2 Pre-release
Pre-release

Choose a tag to compare

@koriym koriym released this 03 Oct 08:42

Release 1.0.0 Release Candidate 2

Changed

  • Updated pagerfanta/pagerfanta dependency to ^3.5 || ^4.7
  • PHP 8.4 support enabled through pagerfanta compatibility

Installation

composer require ray/media-query:^1.0.0-rc2

Notes

This is a release candidate. Please test thoroughly before using in production.

For full changelog, see CHANGELOG.md


Additional Notes

This section was added later (2025-11-11) to provide detailed migration guides and examples.

Changed

  • Updated pagerfanta/pagerfanta dependency to support both v3 and v4 (#PR)
    • Supports pagerfanta ^3.5 || ^4.7
    • Enables PHP 8.4 compatibility through pagerfanta v4
    • Maintains backward compatibility with pagerfanta v3

PHP 8.4 Support

This release enables full PHP 8.4 compatibility by updating the pagerfanta dependency. No changes to your code are required.

Upgrading from RC1

composer require ray/media-query:^1.0.0-rc2

No breaking changes from RC1. This is a dependency update to improve compatibility.

1.0.0-rc1

Choose a tag to compare

@koriym koriym released this 01 Aug 06:27
662b7ef

1.0.0-rc1 Release Notes

Major Release Candidate - Modernized Architecture

We're excited to announce the first release candidate for Ray.MediaQuery 1.0.0! This major release modernizes the framework with a focus on PHP 8+ attributes, improved separation of concerns, and enhanced developer experience.

What's New

Attributes-Only Support

  • Full migration to PHP 8 Attributes: All @DbQuery and @Pager annotations have been replaced with modern #[DbQuery] and #[Pager] attributes
  • Rector integration: Automatic migration tooling available via vendor/bin/rector process
  • Improved IDE support: Better autocomplete, refactoring, and type checking with native PHP attributes

Separated Web API Functionality

  • New dedicated package: Web API functionality moved to ray/web-query
  • Cleaner architecture: Core database functionality separated from web concerns
  • Focused development: Each package can evolve independently with specialized features

Enhanced Documentation

  • Business Domain Repository (BDR) Pattern: Comprehensive guide to transforming database queries into rich domain objects
  • Japanese documentation: Full localization for Japanese developers
  • Improved README: Clearer examples and better organization

Breaking Changes

Required Migration Steps

For users with Web API queries:

composer require ray/web-query

Update your module configuration to use the new MediaQueryWebModule.

For annotation users:

// Old annotation syntax (deprecated)
/** @DbQuery("user_list") */

// New attribute syntax (required)
#[DbQuery('user_list')]

For CamelCaseTrait users:
Replace with constructor property promotion and StringCase utility.

Removed Components

  • WebQueryInterceptor, WebApiQuery, WebQueryConfig
  • MediaQueryWebModule, WebApiQueryInterface
  • WebQuery annotation, WebApiList qualifier
  • CamelCaseTrait (replaced with StringCase utility)
  • Dependencies: guzzlehttp/guzzle, psr/http-message, doctrine/annotations

Migration Guide

DB-only users: No changes required - your existing code continues to work!

Comprehensive migration support:

  • Detailed migration guide in MIGRATION.md
  • Automated tooling via Rector
  • Backward compatibility preserved for core database functionality

Current Status

This is a Release Candidate - we're seeking community feedback before the final 1.0.0 release. The API is stable and production-ready, but we welcome testing and feedback from the community.