Skip to content

Commit 430fdc4

Browse files
committed
chore: prepare release v2.10.0
- Add MSSQL (Microsoft SQL Server) support as fifth database dialect - Major architecture refactoring: move dialect-specific logic to dialects - Update all examples to use library helpers exclusively - Add comprehensive MSSQL test coverage and CI integration - Fix PostgreSQL and MSSQL dialect-specific issues
1 parent 37556d8 commit 430fdc4

File tree

1 file changed

+82
-1
lines changed

1 file changed

+82
-1
lines changed

CHANGELOG.md

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

88
## [Unreleased]
99

10+
## [2.10.0] - 2025-11-09
11+
12+
### Added
13+
- **MSSQL (Microsoft SQL Server) Support** - Full support for MSSQL as a fifth database dialect:
14+
- **New MSSQLDialect class** - Complete SQL dialect implementation for Microsoft SQL Server
15+
- **Comprehensive test coverage** - 28 test suites, 732+ tests covering all MSSQL-specific functionality
16+
- **GitHub Actions integration** - Dedicated CI job for MSSQL with coverage reporting
17+
- **Example compatibility** - All examples now support MSSQL (64/64 passing)
18+
- **REGEXP support** - Custom REGEXP implementation using `PATINDEX` for pattern matching
19+
- **Cross-dialect compatibility** - All helper functions work consistently across all five dialects
20+
- **Complete documentation** - MSSQL configuration and usage examples added to documentation
21+
22+
- **MSSQL-Specific Features**:
23+
- **LATERAL JOIN support** - Automatic conversion to `CROSS APPLY`/`OUTER APPLY` syntax
24+
- **MERGE statement support** - Native MERGE operations for UPSERT patterns
25+
- **Window functions** - Full support for SQL Server window functions
26+
- **JSON operations** - Complete JSON support using SQL Server JSON functions
27+
- **Type casting** - Safe type conversion using `TRY_CAST` for error-free casting
28+
- **String functions** - Dialect-specific implementations (`LEN` vs `LENGTH`, `CEILING` vs `CEIL`)
29+
- **Date/time functions** - SQL Server-specific date/time handling
30+
- **Boolean types** - `BIT` type support with proper 0/1 handling
31+
- **Identity columns** - `IDENTITY(1,1)` support for auto-incrementing primary keys
32+
33+
### Changed
34+
- **Architecture Improvements** - Major refactoring following SOLID principles:
35+
- **Dialect-specific logic migration** - Moved all dialect-specific checks from general classes to dialect implementations
36+
- **New DialectInterface methods** - Added 20+ new methods to `DialectInterface` for better abstraction:
37+
- `formatLateralJoin()` - Handle LATERAL JOIN conversion
38+
- `needsColumnQualificationInUpdateSet()` - PostgreSQL-specific UPDATE behavior
39+
- `executeExplainAnalyze()` - Dialect-specific EXPLAIN ANALYZE execution
40+
- `getBooleanType()`, `getTimestampType()`, `getDatetimeType()` - Type system abstraction
41+
- `isNoFieldsError()` - MSSQL-specific error detection
42+
- `appendLimitOffset()` - Dialect-specific LIMIT/OFFSET handling
43+
- `getPrimaryKeyType()`, `getBigPrimaryKeyType()`, `getStringType()` - Schema type abstraction
44+
- `formatMaterializedCte()` - Materialized CTE support
45+
- `registerRegexpFunctions()` - REGEXP function registration
46+
- `normalizeDefaultValue()` - Default value normalization
47+
- `buildMigrationTableSql()`, `buildMigrationInsertSql()` - Migration infrastructure
48+
- `extractErrorCode()` - Error code extraction
49+
- `getExplainParser()` - EXPLAIN parser abstraction
50+
- `getRecursiveCteKeyword()` - Recursive CTE keyword handling
51+
- `formatGreatest()`, `formatLeast()` - Type-safe GREATEST/LEAST functions
52+
- `buildDropTableIfExistsSql()` - DROP TABLE IF EXISTS support
53+
- **Removed dialect checks from general classes** - No more `if ($driver === 'sqlsrv')` in general classes
54+
- **Better separation of concerns** - Each dialect handles its own specific requirements
55+
56+
- **Example Improvements**:
57+
- **Refactored examples** - Removed `Db::raw()` calls with dialect-specific SQL from examples
58+
- **Library helpers usage** - Examples now use library helpers exclusively (`Db::length()`, `Db::position()`, `Db::greatest()`, etc.)
59+
- **Schema Builder usage** - Examples use Schema Builder for DDL operations where possible
60+
- **Better educational value** - Examples demonstrate proper library usage patterns
61+
62+
- **CI/CD Improvements**:
63+
- **MSSQL GitHub Actions job** - Complete CI setup for MSSQL testing
64+
- **Environment variable support** - Examples and tests can use environment variables for configuration
65+
- **Simplified user management** - Use SA user directly in CI for better reliability
66+
67+
### Fixed
68+
- **PostgreSQL DROP TABLE CASCADE** - Fixed foreign key constraint issues when dropping tables
69+
- **MSSQL type compatibility** - Fixed GREATEST/LEAST functions to handle type compatibility issues
70+
- **MSSQL boolean handling** - Proper conversion of TRUE/FALSE to 1/0 for BIT type
71+
- **MSSQL string functions** - Fixed LENGTH() -> LEN() conversion, SUBSTRING syntax
72+
- **MSSQL REGEXP support** - Custom PATINDEX-based implementation for pattern matching
73+
- **MSSQL LIMIT/OFFSET** - Proper OFFSET ... FETCH NEXT ... ROWS ONLY syntax
74+
- **MSSQL error handling** - Proper handling of "contains no fields" errors
75+
- **Example compatibility** - All examples now work correctly on all five dialects
76+
77+
### Technical Details
78+
- **All tests passing**: 2052 tests, 7097 assertions (+732 tests, +2239 assertions from 2.9.3)
79+
- **All examples passing**: 320/320 examples (64 files × 5 dialects each)
80+
- SQLite: 64/64 ✅
81+
- MySQL: 64/64 ✅
82+
- MariaDB: 64/64 ✅
83+
- PostgreSQL: 64/64 ✅
84+
- MSSQL: 64/64 ✅
85+
- **PHPStan Level 8**: Zero errors across entire codebase
86+
- **PHP-CS-Fixer**: All code complies with PSR-12 standards
87+
- **Full backward compatibility**: 100% maintained - all existing code continues to work
88+
- **Code quality**: Follows KISS, SOLID, DRY, YAGNI principles
89+
- **MSSQL integration**: Complete dialect support with comprehensive testing and CI integration
1090

1191
## [2.9.3] - 2025-11-09
1292

@@ -1285,7 +1365,8 @@ Initial tagged release with basic PDO database abstraction functionality.
12851365

12861366
---
12871367

1288-
[Unreleased]: https://github.com/tommyknocker/pdo-database-class/compare/v2.9.3...HEAD
1368+
[Unreleased]: https://github.com/tommyknocker/pdo-database-class/compare/v2.10.0...HEAD
1369+
[2.10.0]: https://github.com/tommyknocker/pdo-database-class/compare/v2.9.3...v2.10.0
12891370
[2.9.3]: https://github.com/tommyknocker/pdo-database-class/compare/v2.9.2...v2.9.3
12901371
[2.9.2]: https://github.com/tommyknocker/pdo-database-class/compare/v2.9.1...v2.9.2
12911372
[2.9.1]: https://github.com/tommyknocker/pdo-database-class/compare/v2.9.0...v2.9.1

0 commit comments

Comments
 (0)