postgres: use PgStream::receive over PgStream::read to handle errors

* PgStream::read should probably be named better; maybe PgStream::raw_receive

Fixes #203
This commit is contained in:
Ryan Leckey 2020-03-30 18:38:31 -07:00
parent bbbc1811ce
commit d3eb9c7800

View file

@ -167,7 +167,7 @@ impl PgConnection {
if !self.cache_statement_id.contains_key(query) {
// wait for `ParseComplete` on the stream or the
// error before we cache the statement
match self.stream.read().await? {
match self.stream.receive().await? {
Message::ParseComplete => {
self.cache_statement_id.insert(query.into(), statement);
}