Skip to content

Commit 65c6eb6

Browse files
authored
Use piplining in AsyncPgConnection::set_config_options
1 parent 017ebe2 commit 65c6eb6

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/pg/mod.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -328,12 +328,10 @@ impl AsyncPgConnection {
328328
async fn set_config_options(&mut self) -> QueryResult<()> {
329329
use crate::run_query_dsl::RunQueryDsl;
330330

331-
diesel::sql_query("SET TIME ZONE 'UTC'")
332-
.execute(self)
333-
.await?;
334-
diesel::sql_query("SET CLIENT_ENCODING TO 'UTF8'")
335-
.execute(self)
336-
.await?;
331+
futures_util::try_join!(
332+
diesel::sql_query("SET TIME ZONE 'UTC'").execute(self),
333+
diesel::sql_query("SET CLIENT_ENCODING TO 'UTF8'").execute(self),
334+
)?;
337335
Ok(())
338336
}
339337

0 commit comments

Comments
 (0)