robertmu opened a new pull request, #5:
URL: https://github.com/apache/cloudberry-go-libs/pull/5

   This commit refactors the database version parsing logic to support multiple 
database types, starting with Greenplum and Apache Cloudberry. The previous 
implementation was tightly coupled to Greenplum Database and used a simple 
string search to extract the version, which was not robust or extensible.
   
   Key changes:
   1. Introduces a DBType enum to identify the database (GPDB, CBDB).
   2. Replaces string manipulation with regular expressions in ParseVersionInfo 
for more accurate and reliable version parsing. 3 . Adds helper functions 
(IsGPDB(), IsCBDB()) to easily check the database type.
   4. Updates unit tests in version_test.go to validate the new parsing logic 
for both supported databases.
   
   Additionally, this change lays the groundwork for resolving a similar 
version detection issue in the apache/cloudberry-gpbackup project. The backup 
utility currently cannot correctly identify Apache Cloudberry, and this 
foundational fix in the shared library is the first step toward enabling proper 
support in that tool.
   
   This new approach makes the system more maintainable and easier to extend 
with support for other database systems in the future.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to