Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[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

Merged
merged 1 commit into from
Aug 22, 2015

Conversation

nicolas-grekas
Copy link
Member

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!

@nicolas-grekas
Copy link
Member Author

Ping @chanmix51

$a['affected rows'] = pg_affected_rows($result);
$a['last OID'] = pg_last_oid($result);

$fields = pg_field_num($result);

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$a['options'] = pg_options($link);
$a['version'] = pg_version($link);

foreach (self::$linkParameters as $v) {

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chanmix51
Copy link

Nice work 👍

@nicolas-grekas
Copy link
Member Author

Cool, thank you! Do you have any suggestions to make it better?

@nicolas-grekas nicolas-grekas changed the title WIP [VarDumper] Add caster for pgsql resources [VarDumper] Add caster for pgsql resources Aug 15, 2015
@chanmix51
Copy link

@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).

@nicolas-grekas
Copy link
Member Author

I found pg_result_seek() for seeking, but nothing for getting the current cursor position. Can you find a way to get it?

@chanmix51
Copy link

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] = ;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax error

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed, fixed!

@fabpot
Copy link
Member

fabpot commented Aug 22, 2015

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 6c3cfe5 into symfony:2.8 Aug 22, 2015
fabpot added a commit that referenced this pull request Aug 22, 2015
…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
@nicolas-grekas nicolas-grekas deleted the pgsql-caster branch August 26, 2015 11:50
@fabpot fabpot mentioned this pull request Nov 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants