Skip to content

Commit 01884c0

Browse files
committed
chore: prepare release v2.6.1
- Updated CHANGELOG.md with automatic external reference detection feature - Added comprehensive test coverage details - Updated version links for proper GitHub comparison URLs
1 parent 9ba512c commit 01884c0

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

CHANGELOG.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,43 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
---
1111

12+
## [2.6.1] - 2025-01-27
13+
14+
### Added
15+
- **Automatic external reference detection in subqueries**: QueryBuilder now automatically detects and converts external table references (`table.column`) to `RawValue` objects
16+
- Works in `where()`, `select()`, `orderBy()`, `groupBy()`, `having()` methods
17+
- Only converts references to tables not in current query's FROM clause
18+
- Supports table aliases (e.g., `u.id` where `u` is an alias)
19+
- Pattern detection: `table.column` or `alias.column`
20+
- Invalid patterns (like `123.invalid`) are not converted
21+
- **Db::ref() helper**: Manual external reference helper (though now mostly unnecessary due to automatic detection)
22+
- Equivalent to `Db::raw('table.column')` but more semantic
23+
- Still useful for complex expressions or when automatic detection doesn't work
24+
- **Comprehensive test coverage** for external reference detection across all dialects:
25+
- 13 new tests in each dialect-specific test file (MySQL, PostgreSQL, SQLite)
26+
- Tests cover `whereExists`, `whereNotExists`, `select`, `orderBy`, `groupBy`, `having`
27+
- Tests verify internal references are not converted
28+
- Tests verify aliased table references work correctly
29+
- Tests verify complex external references and edge cases
30+
31+
### Changed
32+
- **Enhanced QueryBuilder methods**: `addCondition()`, `select()`, `orderBy()`, `groupBy()` now automatically process external references
33+
- **Improved subquery examples**: Updated README.md examples to demonstrate automatic detection
34+
- **Better developer experience**: No more need for `Db::raw('users.id')` in most subquery scenarios
35+
36+
### Fixed
37+
- **QueryBuilder external reference handling**: Fixed parsing of table names and aliases from JOIN clauses
38+
- **Cross-dialect compatibility**: External reference detection works consistently across MySQL, PostgreSQL, and SQLite
39+
40+
### Technical Details
41+
- **All tests passing**: 429+ tests, 2044+ assertions
42+
- **PHPStan Level 8**: Zero errors across entire codebase
43+
- **All examples passing**: 24/24 examples on all database dialects
44+
- **Backward compatibility**: Fully maintained - existing code continues to work unchanged
45+
- **Performance**: Minimal overhead - only processes string values matching `table.column` pattern
46+
47+
---
48+
1249
## [2.6.0] - 2025-10-23
1350

1451
### ⚠️ Breaking Changes
@@ -459,7 +496,8 @@ Initial tagged release with basic PDO database abstraction functionality.
459496

460497
---
461498

462-
[Unreleased]: https://github.com/tommyknocker/pdo-database-class/compare/v2.6.0...HEAD
499+
[Unreleased]: https://github.com/tommyknocker/pdo-database-class/compare/v2.6.1...HEAD
500+
[2.6.1]: https://github.com/tommyknocker/pdo-database-class/compare/v2.6.0...v2.6.1
463501
[2.6.0]: https://github.com/tommyknocker/pdo-database-class/compare/v2.5.1...v2.6.0
464502
[2.5.1]: https://github.com/tommyknocker/pdo-database-class/compare/v2.5.0...v2.5.1
465503
[2.5.0]: https://github.com/tommyknocker/pdo-database-class/compare/v2.4.3...v2.5.0

0 commit comments

Comments
 (0)