Skip to content

Commit 4193b5f

Browse files
committed
chore: prepare release v2.9.2
- Add [2.9.2] section with all changes since v2.9.1 - Document Sharding feature with 3 strategies (range, hash, modulo) - Document QueryBuilder Macros feature - Document Enhanced WHERE Condition Methods - Document Fluent Interface improvements (self -> static) - Document Composer metadata updates - Update Unreleased link to point to v2.9.2...HEAD - Add v2.9.2 comparison link
1 parent 5414e46 commit 4193b5f

File tree

1 file changed

+68
-1
lines changed

1 file changed

+68
-1
lines changed

CHANGELOG.md

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

1010

11+
## [2.9.2] - 2025-11-06
12+
13+
### Added
14+
- **Sharding Support** - Horizontal partitioning across multiple databases with automatic query routing:
15+
- **Three sharding strategies** - Range, Hash, and Modulo strategies for data distribution
16+
- **Range Strategy** - Distributes data based on numeric ranges (e.g., 0-1000, 1001-2000)
17+
- **Hash Strategy** - Distributes data based on hash of shard key value (CRC32)
18+
- **Modulo Strategy** - Distributes data based on modulo operation (`value % shard_count`)
19+
- **Unified connection pool** - Uses existing connections from `PdoDb` connection pool via `useConnections()`
20+
- **Automatic query routing** - Queries automatically routed to appropriate shard based on shard key in WHERE conditions
21+
- **ShardConfig, ShardRouter, ShardConfigBuilder** - Complete infrastructure for sharding configuration
22+
- **ShardStrategyInterface** - Extensible interface for custom sharding strategies
23+
- **Fluent API** - `$db->shard('table')->shardKey('id')->strategy('range')->useConnections([...])->register()`
24+
- **Comprehensive examples** - `examples/30-sharding/` with all strategies and use cases
25+
- **Complete documentation** - `documentation/05-advanced-features/sharding.md` with detailed guides
26+
- **Full test coverage** - 15 tests covering all sharding strategies and edge cases
27+
28+
- **QueryBuilder Macros** - Extend QueryBuilder with custom methods:
29+
- **MacroRegistry class** - Central registry for managing macro registration and storage
30+
- **QueryBuilder::macro()** - Register custom query methods as macros
31+
- **QueryBuilder::hasMacro()** - Check if a macro exists
32+
- **Dynamic execution** - `__call()` implementation for automatic macro execution
33+
- **Comprehensive examples** - `examples/29-macros/` demonstrating macro usage patterns
34+
- **Complete documentation** - `documentation/05-advanced-features/query-macros.md` with examples
35+
- **Full test coverage** - Comprehensive tests for macro functionality
36+
37+
- **Enhanced WHERE Condition Methods** - Fluent methods for common WHERE patterns:
38+
- **Null checks**: `whereNull()`, `whereNotNull()`, `andWhereNull()`, `orWhereNull()`, etc.
39+
- **Range checks**: `whereBetween()`, `whereNotBetween()`, `andWhereBetween()`, `orWhereBetween()`, etc.
40+
- **Column comparisons**: `whereColumn()`, `andWhereColumn()`, `orWhereColumn()`
41+
- **Enhanced IN clauses**: `whereIn()` and `whereNotIn()` now support arrays in addition to subqueries
42+
- **AND/OR variants** - All new methods have `and*` and `or*` variants for fluent chaining
43+
- **27 new tests** - Comprehensive test coverage (66 assertions) in `WhereConditionMethodsTests`
44+
- **Updated examples** - `examples/01-basic/03-where-conditions.php` demonstrates all new methods
45+
- Improves developer experience by eliminating need for helper functions in common WHERE patterns
46+
47+
- **Connection Management**:
48+
- **PdoDb::getConnection()** - Retrieve connection from pool by name
49+
- Enables sharding to reuse existing connections from connection pool
50+
51+
### Changed
52+
- **Fluent Interface Return Types** - Replaced `self` with `static` in all interfaces:
53+
- `ConditionBuilderInterface`, `DmlQueryBuilderInterface`, `ExecutionEngineInterface`
54+
- `FileLoaderInterface`, `JoinBuilderInterface`, `JsonQueryBuilderInterface`
55+
- `ParameterManagerInterface`, `QueryBuilderInterface`, `SelectQueryBuilderInterface`
56+
- Better support for extending QueryBuilder classes and improved IDE autocomplete
57+
58+
- **Composer Metadata**:
59+
- **Updated description** - Full description (487 chars) with all major features including sharding, migrations, query macros
60+
- **Added keywords** - 17 new keywords: `sharding`, `migrations`, `query-macros`, `macro-system`, `ddl`, `schema-builder`, `lateral-join`, `query-profiling`, `query-compilation-cache`, `batch-processing`, `merge-statements`, `sql-formatter`, `sql-pretty-printer`, `connection-retry`, `psr-14`, `event-dispatcher`, `explain-analysis`
61+
- Improves discoverability on Packagist and GitHub
62+
63+
### Technical Details
64+
- **All tests passing**: Comprehensive test coverage with new sharding, macro, and WHERE condition tests
65+
- **PHPStan Level 8**: Zero errors across entire codebase
66+
- **PHP-CS-Fixer**: All code complies with PSR-12 standards
67+
- **Full backward compatibility**: 100% maintained - all existing code continues to work
68+
- **Code quality**: Follows KISS, SOLID, DRY, YAGNI principles
69+
- **Documentation**: Added 3 new comprehensive documentation files:
70+
- `documentation/05-advanced-features/sharding.md` (241 lines)
71+
- `documentation/05-advanced-features/query-macros.md` (345 lines)
72+
- Updated `documentation/03-query-builder/filtering-conditions.md` with enhanced WHERE methods
73+
- **Examples**: Added 2 new example directories:
74+
- `examples/30-sharding/` (3 files, 352 lines total)
75+
- `examples/29-macros/` (2 files, 470 lines total)
76+
1177
## [2.9.1] - 2025-11-04
1278

1379
### Added
@@ -1110,7 +1176,8 @@ Initial tagged release with basic PDO database abstraction functionality.
11101176

11111177
---
11121178

1113-
[Unreleased]: https://github.com/tommyknocker/pdo-database-class/compare/v2.9.1...HEAD
1179+
[Unreleased]: https://github.com/tommyknocker/pdo-database-class/compare/v2.9.2...HEAD
1180+
[2.9.2]: https://github.com/tommyknocker/pdo-database-class/compare/v2.9.1...v2.9.2
11141181
[2.9.1]: https://github.com/tommyknocker/pdo-database-class/compare/v2.9.0...v2.9.1
11151182
[2.9.0]: https://github.com/tommyknocker/pdo-database-class/compare/v2.8.0...v2.9.0
11161183
[2.8.0]: https://github.com/tommyknocker/pdo-database-class/compare/v2.7.1...v2.8.0

0 commit comments

Comments
 (0)