amphp / postgres

Async Postgres client for PHP based on Amp.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error codes (sqlstate) missing in QueryError

brstgt opened this issue · comments

To handle a query error properly, it is necessary what kind of error this is. Working on an error message is not viable. PG offers the SQLSTATE for that. The QueryError could be extended to contain the SQLSTATE and even more diagnostic information.

PQ offers that information in the 'diag' field of the result, pgsql offers this through pg_result_error_field. QueryError should provide a common interface for that.

Something like ac11c55?