-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Context
Currently, PDOConnection::getServerVersion() returns a hardcoded version string "5.0.0" (see src/Crate/DBAL/Driver/PDOCrate/PDOConnection.php).
This hardcoded approach was discussed in PR #122 (comment thread: #122 (comment)).
Problem
The hardcoded version assumes all CrateDB deployments are running a modern version (>= 4.0.0), which causes Driver::createDatabasePlatformForVersion() to always select CratePlatform4(). This may cause issues if the actual server is running an older CrateDB version that requires a different platform implementation.
Proposed Solution
Implement dynamic version detection by querying the CrateDB server. CrateDB supports:
SELECT version();- returns CrateDB version stringSELECT version FROM sys.nodes;- returns version per node
The version can be retrieved via the existing query() or exec() methods in PDOConnection.
Discussion Summary
From PR #122 discussion:
- @amotl initially changed the hardcoded version from "6.0.0" to "5.0.0" as a more conservative choice
- @seut expressed concern about hardcoding this value and requested proper version detection, at least as a followup
- The pragmatic approach for now is to assume modern CrateDB versions by default
References
- PR: Support for Doctrine DBAL 3 #122
- Comment thread: Support for Doctrine DBAL 3 #122 (comment)
- Requested by: @amotl
- Reviewed by: @seut
Acceptance Criteria
-
getServerVersion()queries the actual CrateDB server for its version - Proper error handling if version detection fails
- Consider caching the version to avoid repeated queries
- Update documentation to reflect minimum supported CrateDB version
Metadata
Metadata
Assignees
Labels
No labels