From d3eb9c78001da66afd0cb4af0aba67b6be41d125 Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Mon, 30 Mar 2020 18:38:31 -0700 Subject: [PATCH] postgres: use PgStream::receive over PgStream::read to handle errors * PgStream::read should probably be named better; maybe PgStream::raw_receive Fixes #203 --- sqlx-core/src/postgres/executor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlx-core/src/postgres/executor.rs b/sqlx-core/src/postgres/executor.rs index 41fc40b2..61fe4ba8 100644 --- a/sqlx-core/src/postgres/executor.rs +++ b/sqlx-core/src/postgres/executor.rs @@ -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); }