Releases: ray-di/Ray.MediaQuery
1.0.2
1.0.1
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
- @hajime-matsumoto for the excellent contribution to SQL comment handling! 🙏
Full Changelog: 1.0.0...1.0.1
1.0.0
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-querypackage - 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
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
@internallow-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:
- Update PHP version: Ensure your environment runs PHP 8.2 or higher
- Update dependencies: Run
composer update - 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'));
- 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
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-rc2Notes
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-rc2No breaking changes from RC1. This is a dependency update to improve compatibility.
1.0.0-rc1
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
@DbQueryand@Pagerannotations 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-queryUpdate 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,WebQueryConfigMediaQueryWebModule,WebApiQueryInterfaceWebQueryannotation,WebApiListqualifierCamelCaseTrait(replaced withStringCaseutility)- 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.
0.17.1
Changed
- Update ray/input-query dependency to ^1.0
See CHANGELOG.md for full details.
Additional Notes
This section was added later (2025-11-11) to provide detailed migration guides and examples.
Changed
- Updated ray/input-query dependency to stable v1.0 release
- Ensures compatibility with the stable Input Query API
- No breaking changes in Ray.MediaQuery itself
- Recommended to update for improved stability and future support
0.17.0
Ray.MediaQuery v0.17.0
Added
- Type-safe Input Objects - Support for Input object flattening in ParamConverter with #[Input] attribute
- Enhanced parameter conversion with conflict detection for Input objects
- Comprehensive test coverage for Input object processing
Type-safe Input Objects
You can now use structured input objects for better type safety and organization:
use Ray\InputQuery\Attribute\Input;
final class TodoCreateInput
{
public function __construct(
#[Input] public readonly string $title,
#[Input] public readonly UserInput $assignee,
#[Input] public readonly ?DateTimeInterface $dueDate
) {}
}
interface TodoInterface
{
#[DbQuery('todo_create')]
public function create(TodoCreateInput $input): void;
}Automatic Flattening
The nested structure is automatically flattened for SQL binding:
// Input object:
TodoCreateInput {
title: "Buy milk",
assignee: UserInput { givenName: "John", familyName: "Doe" },
},
new DateTime("2025-07-07")
// Flattened parameters:
[
"title" => "Buy milk",
"givenName" => "John", // directly from UserInput
"familyName" => "Doe", // directly from UserInput
"dueDate" => "2025-07-07 00:00:00" // DateTime converted
]Changed
- Update ray/input-query dependency to ^0.2.0
- Refactor ParamConverter with improved type annotations and static analysis compliance
Fixed
- All static analysis errors (Psalm and PHPStan)
- Remove unreachable code and add defensive assertions
- Improve type safety throughout the codebase
Full Changelog
Additional Notes
This section was added later (2025-11-11) to provide detailed migration guides and examples.
Key Benefits
- Type Safety: Input objects provide compile-time type checking
- Organization: Group related parameters in structured objects
- Reusability: Share input objects across multiple queries
- Validation: Integrate with validation libraries through Input objects
- Documentation: Self-documenting API with clear parameter structure
Migration from Raw Parameters
// Before (0.16.x) - loose parameters
#[DbQuery('todo_create')]
public function create(string $title, string $givenName, string $familyName, ?DateTimeInterface $dueDate): void;
// After (0.17.0+) - structured input
#[DbQuery('todo_create')]
public function create(TodoCreateInput $input): void;The new approach provides better maintainability and type safety, especially for queries with many parameters.
0.16.0
What's Changed
Full Changelog: 0.15.1...0.16.0
Additional Notes
This section was added later (2025-11-11) to provide detailed migration guides and examples.
Added
-
PerformSqlinterface for SQL template logging (#67)- New interface for tracking SQL query execution
- Enables logging of SQL templates with parameter placeholders
- Useful for debugging and monitoring database queries
- Helps identify query patterns and performance issues
Benefits:
- Better visibility into query execution
- Easier debugging of database interactions
- Performance monitoring capabilities
- Query pattern analysis
0.15.1
Enable PHP 8.4 compat
Full Changelog: 0.15.0...0.15.1
Additional Notes
This section was added later (2025-11-11) to provide detailed migration guides and examples.
Added
- PHP 8.4 compatibility (#65)
- Full support for PHP 8.4
- Enhanced CI workflow for better testing coverage
- Improved input handling and default values in CI pipelines