amphp / postgres

Async Postgres client for PHP based on Amp.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Throw when prepare fails

PeeHaa opened this issue · comments

AFAICS currently preparing a statement fails silently.

You will only find out it failed when trying to execute the statement resulting in the somewhat less useful message:

error Amp\Postgres\QueryError: ERROR: prepared statement "amp_46cfa66905e07b1e3b52558541a4bcf486056883" does not exist

Would be nice if errors on prepare would throw instead. So we have:

  1. the error at the location it actually fails
  2. have access to the actual error message.