Skip to content

Commit d5b5509

Browse files
committed
chore: prepare release v2.10.3
- Add changelog entry for v2.10.3 (2025-11-21) - Document all new features: pdodb init, repository/service generators, cache enhancements, monitoring, migration dry-run SQL collection - Document architecture refactoring (Open/Closed Principle) - Document MSSQL driver standardization (sqlsrv only) - Update Unreleased link to point to v2.10.3...HEAD - Add v2.10.3 link to compare v2.10.2...v2.10.3
1 parent 59d32e8 commit d5b5509

File tree

1 file changed

+127
-1
lines changed

1 file changed

+127
-1
lines changed

CHANGELOG.md

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

88
## [Unreleased]
99

10+
## [2.10.3] - 2025-11-21
11+
12+
### Added
13+
- **Project Initialization** (`pdodb init`) - Interactive wizard for quick project setup:
14+
- Interactive configuration wizard for database connection settings
15+
- Support for MySQL, PostgreSQL, SQLite, and MSSQL (SQLSRV) drivers
16+
- Configuration file generation (`.env` or `config/db.php`)
17+
- Automatic directory structure creation (migrations, models, repositories, services)
18+
- Connection testing before saving configuration
19+
- Advanced options (table prefix, caching, performance settings, multiple connections)
20+
- Cache dependency validation with helpful warnings if dependencies are missing
21+
- Fallback to array cache if selected cache type dependencies are unavailable
22+
23+
- **Repository and Service Generators** (`pdodb repository`, `pdodb service`):
24+
- `pdodb repository make <name>` - Generate repository classes with auto-detected model and table names
25+
- `pdodb service make <name>` - Generate service classes with dependency injection
26+
- Automatic primary key detection
27+
- Support for `--namespace`, `--force`, and `--connection` options
28+
29+
- **Cache Management Enhancements** (`pdodb cache`):
30+
- `pdodb cache invalidate <pattern>` - Invalidate cache entries by pattern:
31+
- `table:users` - Invalidate all cache entries for a specific table
32+
- `table:users_*` - Invalidate cache entries for tables with prefix
33+
- `pdodb_table_users_*` - Invalidate cache entries matching key pattern
34+
- Cache type detection in `pdodb cache stats` output (Redis, APCu, Memcached, Filesystem, Array, Unknown)
35+
- Universal cache type detection for all PSR-16 implementations (not just Symfony Cache)
36+
- Persistent cache statistics with atomic operations (Redis INCR, Memcached increment, APCu apcu_inc)
37+
- Optimistic locking with retry for non-atomic caches (Filesystem, Array)
38+
- Cache metadata storage linking cache keys to table names for efficient invalidation
39+
40+
- **Database Monitoring** (`pdodb monitor`):
41+
- `pdodb monitor queries` - Show active queries
42+
- `pdodb monitor connections` - Show active connections
43+
- `pdodb monitor slow [threshold]` - Show slow queries (default threshold: 1.0 seconds)
44+
- Cross-dialect support (MySQL, MariaDB, PostgreSQL, MSSQL, SQLite)
45+
46+
- **Table Management Enhancements** (`pdodb table`):
47+
- `pdodb table foreign-keys list <table>` - List foreign keys
48+
- `pdodb table foreign-keys add <table>` - Add foreign key
49+
- `pdodb table foreign-keys drop <table> <name>` - Drop foreign key
50+
51+
- **Migration Dry-Run Improvements** (`pdodb migrate`):
52+
- `pdodb migrate up --dry-run` now shows actual SQL queries that would be executed
53+
- SQL queries are collected via event dispatcher during migration execution in transaction
54+
- Transaction is rolled back after collecting SQL to prevent actual changes
55+
- SQL queries are formatted with parameter substitution for readable output
56+
57+
- **Bash Completion Script** (`scripts/pdodb-completion.bash`):
58+
- Tab completion for all pdodb CLI commands and subcommands
59+
- Completion for command options (`--force`, `--format`, `--connection`, etc.)
60+
- Completion for cache subcommands (`clear`, `stats`, `invalidate`)
61+
- Completion for migration, model, repository, service, and init commands
62+
63+
- **Dialect-Specific DDL Query Builders**:
64+
- MySQL-specific types: `enum()`, `set()`, `tinyInteger()`, `mediumInteger()`, `longText()`, `mediumText()`, `binary()`, `varbinary()`, `blob()` variants, `year()`, optimized `uuid()` (CHAR(36)), `boolean()` (TINYINT(1))
65+
- PostgreSQL-specific types: `uuid()`, `jsonb()`, `serial()`, `bigSerial()`, `inet()`, `cidr()`, `macaddr()`, `tsvector()`, `tsquery()`, `bytea()`, `money()`, `interval()`, `array()`, geometric types (`point()`, `line()`, `polygon()`, `circle()`, etc.)
66+
- MSSQL-specific types: `uniqueidentifier()`, `nvarchar()`, `nchar()`, `ntext()`, `money()`, `smallMoney()`, `datetime2()`, `smallDatetime()`, `datetimeOffset()`, `time()`, `binary()`, `varbinary()`, `image()`, `real()`, `xml()`, `geography()`, `geometry()`, `hierarchyid()`, `sqlVariant()`
67+
- SQLite-specific type mappings for all types
68+
- MariaDB inherits MySQL types with potential for MariaDB-specific extensions
69+
70+
- **CLI Version Auto-Detection**:
71+
- CLI version now automatically detected from git tags using `Composer\InstalledVersions` or `git describe`
72+
- Falls back to `composer.json` version if git is not available
73+
- Removes `-dev` suffix for clean version display
74+
75+
### Changed
76+
- **Architecture Refactoring** - Moved dialect-specific logic from common classes to dialect implementations:
77+
- Monitoring methods (`getActiveQueries`, `getActiveConnections`, `getSlowQueries`) moved to `DialectInterface`
78+
- Table listing (`listTables`) moved to `DialectInterface`
79+
- Error handling methods (`getRetryableErrorCodes`, `getErrorDescription`) moved to `DialectInterface`
80+
- DML operations (`getInsertSelectColumns`) moved to `DialectInterface`
81+
- Configuration methods (`buildConfigFromEnv`, `normalizeConfigParams`) moved to `DialectInterface`
82+
- Concatenation formatting (`formatConcatExpression`) moved to `DialectInterface`
83+
- Removed `match/case` and `if` statements based on specific dialects from common classes
84+
- Follows Open/Closed Principle - new dialects can be added without modifying common classes
85+
86+
- **MSSQL Driver Standardization**:
87+
- Removed `mssql` alias, use only `sqlsrv` driver name everywhere
88+
- Renamed `config.mssql.php` to `config.sqlsrv.php`
89+
- Updated all examples, documentation, and tests to use `sqlsrv` instead of `mssql`
90+
- Updated `DialectRegistry` to remove `mssql` alias
91+
92+
- **CLI Command Organization**:
93+
- Commands sorted by logical groups with `init` at the top
94+
- Grouped commands: Project initialization, Migrations, Code generation, Database management, Development tools, Monitoring and performance, Utilities
95+
96+
- **Environment Variables Standardization**:
97+
- Standardized all environment variables from `DB_*` to `PDODB_*` in CI/CD workflows
98+
- Updated GitHub Actions workflow (`tests.yml`) to use `PDODB_*` variables
99+
- Removed fallback to `DB_*` variables in `BaseCliCommand` and `InitWizard`
100+
101+
- **Migration Dry-Run Behavior**:
102+
- `pdodb migrate up --dry-run` now executes migrations in transaction to collect actual SQL
103+
- Previously only showed comments like "Would execute migration.up()"
104+
- Now shows real SQL queries (CREATE TABLE, INSERT, etc.) that would be executed
105+
106+
- **README Updates**:
107+
- Added `pdodb init` as the fastest way to get started
108+
- Updated quick start guide to highlight interactive wizard
109+
- Updated examples to use `sqlsrv` instead of `mssql`
110+
111+
### Fixed
112+
- **Cache Factory**:
113+
- Handle Redis connection errors gracefully (return null instead of throwing exception)
114+
- Improved error handling for missing Redis/Memcached extensions
115+
116+
- **MSSQL Monitoring Example**:
117+
- Fixed MSSQL monitoring example failing in GitHub Actions
118+
- Standardized environment variable names to `PDODB_*`
119+
120+
- **Configuration Loading**:
121+
- Fixed `database` vs `dbname` parameter normalization for PostgreSQL and MSSQL
122+
- Ensured `dbname` is required everywhere (not `database`)
123+
- Fixed `InitWizard` connection test to properly normalize parameters
124+
125+
- **CLI Prompts**:
126+
- Fixed duplicate default values in prompts (e.g., `Select [1] [1]:``Select [1]:`)
127+
- Removed hardcoded default values from prompt strings
128+
129+
### Technical Details
130+
- **All tests passing**: 2491 tests, 8468 assertions across all dialects
131+
- **Test coverage**: Added tests for SQL collection in dry-run mode, cache dependency validation, dialect-specific schema builders
132+
- **Code quality**: PHPStan level 9, PHP-CS-Fixer compliant
133+
- **Full backward compatibility**: 100% maintained (except removed `mssql` alias)
134+
10135
## [2.10.2] - 2025-11-18
11136

12137
### Added
@@ -1589,7 +1714,8 @@ Initial tagged release with basic PDO database abstraction functionality.
15891714

15901715
---
15911716

1592-
[Unreleased]: https://github.com/tommyknocker/pdo-database-class/compare/v2.10.2...HEAD
1717+
[Unreleased]: https://github.com/tommyknocker/pdo-database-class/compare/v2.10.3...HEAD
1718+
[2.10.3]: https://github.com/tommyknocker/pdo-database-class/compare/v2.10.2...v2.10.3
15931719
[2.10.2]: https://github.com/tommyknocker/pdo-database-class/compare/v2.10.1...v2.10.2
15941720
[2.10.1]: https://github.com/tommyknocker/pdo-database-class/compare/v2.10.0...v2.10.1
15951721
[2.10.0]: https://github.com/tommyknocker/pdo-database-class/compare/v2.9.3...v2.10.0

0 commit comments

Comments
 (0)