-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[VarDumper] Add caster for pgsql resources #15555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Ping @chanmix51 |
79b7532
to
62bb4b1
Compare
$a['affected rows'] = pg_affected_rows($result); | ||
$a['last OID'] = pg_last_oid($result); | ||
|
||
$fields = pg_field_num($result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHP warning: pg_field_num() expects exactly 2 parameters, 1 given
pg_field_num <> pg_num_fields ;) see http://php.net/pg_field_num
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
62bb4b1
to
8a30b3c
Compare
$a['options'] = pg_options($link); | ||
$a['version'] = pg_version($link); | ||
|
||
foreach (self::$linkParameters as $v) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Access to undeclared static property: Symfony\Component\VarDumper\Caster\PgSqlCaster::$linkParameters in /home/greg/test/symfony/src/Symfony/Component/VarDumper/Caster/PgSqlCaster.php on line 94
Should be paramCodes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8a30b3c
to
0452eae
Compare
Nice work 👍 |
Cool, thank you! Do you have any suggestions to make it better? |
0452eae
to
a672efb
Compare
@nicolas-grekas maybe yes. I have tested the result cast and afaicr I couldn't tell the index of the last fetched result. Postgres' cursors are scrollable, you can iterate several times on them and fetch directly the nth row of a result. I could not see that in the stub (maybe this data is not available but I think it is). |
I found pg_result_seek() for seeking, but nothing for getting the current cursor position. Can you find a way to get it? |
Don't mind, there are no PHP functions for that, this is why it is kept in Pomm's iterators. All good ! |
|
||
foreach (self::$paramCodes as $v) { | ||
if (false !== $v = pg_parameter_status($link, $v)) { | ||
$a['param'][$v] = ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Syntax error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed, fixed!
a672efb
to
6c3cfe5
Compare
Thank you @nicolas-grekas. |
…ekas) This PR was merged into the 2.8 branch. Discussion ---------- [VarDumper] Add caster for pgsql resources | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - If pgsql users could give feedback on this one, that would we great! Commits ------- 6c3cfe5 [VarDumper] Add caster for pgsql resources
If pgsql users could give feedback on this one, that would we great!