@@ -7,6 +7,82 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
88## [ Unreleased]
99
10+ ## [ 2.12.0] - 2025-12-12
11+
12+ ### Added
13+ - ** Optimize Command** (` pdodb optimize ` ) - Comprehensive database optimization tool:
14+ - ` pdodb optimize analyze ` - Analyze database schema for optimization opportunities
15+ - ` pdodb optimize structure ` - Analyze specific table structure
16+ - ` pdodb optimize logs ` - Analyze slow query logs
17+ - ` pdodb optimize query ` - Analyze and optimize specific SQL queries
18+ - Detects missing indexes, redundant indexes, missing foreign key indexes
19+ - Suggests indexes for common patterns (soft delete, status columns, timestamps)
20+ - Identifies large tables that may benefit from partitioning
21+ - Provides detailed statistics and recommendations
22+ - Support for JSON, table, and YAML output formats
23+
24+ - ** AI-Powered Database Analysis** (` pdodb ai ` ) - Intelligent database optimization with AI:
25+ - ` pdodb ai query <sql> ` - Get AI-powered query analysis and optimization suggestions
26+ - ` pdodb ai schema [table] ` - Analyze database schema with AI recommendations
27+ - ` pdodb ai optimize ` - AI-powered database optimization suggestions
28+ - Automatic EXPLAIN plan integration for better AI analysis
29+ - Support for multiple AI providers:
30+ - ** OpenAI** (GPT-4, GPT-3.5-turbo, GPT-4-turbo)
31+ - ** Anthropic** (Claude 3 Opus, Sonnet, Haiku)
32+ - ** Google** (Gemini Pro, Gemini Pro Vision)
33+ - ** Microsoft Azure OpenAI** (GPT-4, GPT-3.5-turbo)
34+ - ** DeepSeek** (DeepSeek Chat, DeepSeek Coder)
35+ - ** Yandex Cloud GPT** (YandexGPT, YandexGPT Lite)
36+ - Configurable temperature, max_tokens, and timeout settings
37+ - Progress indicators for long-running AI requests
38+ - Integration with ` explainAiAdvice() ` method in QueryBuilder
39+
40+ - ** AI Provider Configuration** :
41+ - Support for temperature, max_tokens, and timeout configuration for all AI providers
42+ - Improved error handling and response parsing
43+ - Enhanced markdown formatting in AI responses
44+ - AI configuration options in ` pdodb init ` command
45+
46+ ### Changed
47+ - ** Performance Optimizations** :
48+ - Optimized ` SchemaAnalyzer ` to reduce duplicate database queries (~ 25% faster)
49+ - Eliminated redundant ` TableManager::info() ` and ` getForeignKeys() ` calls
50+ - Optimized ` getTableRowCount() ` to only execute for tables with detected issues
51+ - Removed unnecessary ` tableExists() ` checks
52+ - Added filtering for Oracle system tables (` BIN$% ` , ` SYS_% ` , ` DUAL ` )
53+ - Added filtering for MSSQL system schemas (` sys ` , ` INFORMATION_SCHEMA ` )
54+ - Improved test execution time for Oracle optimize tests (32s → 24s)
55+
56+ - ** Code Quality** :
57+ - Removed ` #[RunInSeparateProcess] ` attributes from tests
58+ - Improved test reliability by throwing exceptions instead of ` exit() ` in test environment
59+ - Better handling of non-interactive mode in CLI commands
60+ - Extracted magic numbers to constants in AI providers
61+
62+ ### Fixed
63+ - ** Test Reliability** :
64+ - Fixed blocking input issues in non-interactive test environments
65+ - Fixed "risky tests" warnings by properly managing output buffers
66+ - Fixed MSSQL test failures in GitHub Actions (environment variable handling)
67+ - Fixed Oracle test timeouts and hanging issues
68+ - Preserved critical environment variables in test tearDown methods
69+ - Improved non-interactive mode detection across all CLI commands
70+
71+ - ** AI Command** :
72+ - Removed redundant ` ai analyze ` command (consolidated into ` ai query ` )
73+ - Fixed AI command output formatting
74+ - Fixed schema analysis in AI command
75+ - Improved Yandex AI provider response handling
76+
77+ - ** Database Dialect Fixes** :
78+ - Fixed MSSQL ` listTables() ` to filter system schemas for better performance
79+ - Fixed Oracle system table filtering in ` listTables() `
80+
81+ ### Documentation
82+ - Updated ` composer.json ` with AI integration keywords and description
83+ - Removed references to deprecated ` ai analyze ` command
84+ - Updated bash completion script to remove ` ai analyze ` command
85+
1086## [ 2.11.2] - 2025-12-06
1187
1288### Added
@@ -1981,7 +2057,8 @@ Initial tagged release with basic PDO database abstraction functionality.
19812057
19822058---
19832059
1984- [Unreleased]: https://github.com/tommyknocker/pdo-database-class/compare/v2.11.2...HEAD
2060+ [Unreleased]: https://github.com/tommyknocker/pdo-database-class/compare/v2.12.0...HEAD
2061+ [2.12.0]: https://github.com/tommyknocker/pdo-database-class/compare/v2.11.2...v2.12.0
19852062[2.11.2]: https://github.com/tommyknocker/pdo-database-class/compare/v2.11.1...v2.11.2
19862063[2.11.1]: https://github.com/tommyknocker/pdo-database-class/compare/v2.11.0...v2.11.1
19872064[2.11.0]: https://github.com/tommyknocker/pdo-database-class/compare/v2.10.3...v2.11.0
0 commit comments