m6w6 / ext-pq

PostgreSQL client library (libpq) binding
BSD 2-Clause "Simplified" License
39 stars 7 forks source link

version properties #49

Closed remicollet closed 1 year ago

remicollet commented 1 year ago

The problem was about to be able to detect running server version to detect is json is available (the test is failing on RHEL-7 with libpq 9.2)

1st commit add 2 property to the Connection class

2nd commit use serverVersion to skip the new json test

codecov[bot] commented 1 year ago

Codecov Report

Merging #49 (d7871d8) into master (b86e51c) will increase coverage by 0.10%. The diff coverage is 95.23%.

@@            Coverage Diff             @@
##           master      #49      +/-   ##
==========================================
+ Coverage   76.72%   76.82%   +0.10%     
==========================================
  Files          17       17              
  Lines        3592     3612      +20     
==========================================
+ Hits         2756     2775      +19     
- Misses        836      837       +1     
Impacted Files Coverage Δ
src/php_pq_misc.c 72.68% <75.00%> (+0.04%) :arrow_up:
src/php_pq_module.c 100.00% <100.00%> (ø)
src/php_pqconn.c 67.77% <100.00%> (+0.56%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

remicollet commented 1 year ago

Rewritten returning string instead of long, more readable and easy to compare in PHP

remicollet commented 1 year ago

Perhaps time to raise minimal version ? to 9.1 ? (since PHP 8.0, libpq >= 9.1 is required)

RHEL-7 has 9.2, is >9 years old, and is close to its EOL in <1 year (I don't think something older exists) RHEL-8 was released with 10.5 but now has 13.5

remicollet commented 1 year ago

Added: factorization of version to string conversion (and fix from pr #48)

remicollet commented 1 year ago

Added: new properties are read only (PHP 8.1+)

TODO: review all existing properties (not in the scope of this PR, another will follow)