erleans / pgo

Erlang Postgres client and connection pool
Apache License 2.0
80 stars 16 forks source link

Getting field information in decode_fun/2 when no rows are returned #47

Open bryanhughes opened 3 years ago

bryanhughes commented 3 years ago

Is it possible to get the field information when no matching rows are returned. For example, selecting an empty table and providing the decode fun? decode_fun/2 provides a nice opportunity to describe a query but unfortunately it does not get called because of the receive_loop0/6 that matches on #no_data{} . When using psql (as well as other drivers like Go and Java) it returns the column names at minimum.

I am poking around the pgo_protocol.erl code, but am having a hard time tracking the DecodeOpts.