swoole / ext-postgresql

🐘 Coroutine-based client for PostgreSQL
64 stars 21 forks source link

Casting resultset to native PHP types #18

Closed codercms closed 4 years ago

codercms commented 4 years ago

According to this PR - https://github.com/php/php-src/pull/4939

codercms commented 4 years ago

@twose could you review this PR? This PR makes Postgres Client to return values in native PHP types instead of only strings.

twose commented 4 years ago

@yunnian is the author of ext-PostgreSQL

and call @matyhtf and @huanghantao too

anyway, it looks good to me, thank you for your contribution

yunnian commented 4 years ago

Let's discuss whether it's better to add an option, such as:

$mysqli->options(MYSQLI_OPT_INT_AND_FLOAT_NATIVE, 1);

codercms commented 4 years ago

@yunnian do we have any reasons to add custom parameter that toggles float/int conversion? P.S. Perhaps we can add custom parameter that will toggle casting from PostgreSQL types to PHP native types.