Skip to content

Commit db8a787

Browse files
committed
use execute_typed api
1 parent a5a7bd7 commit db8a787

File tree

1 file changed

+4
-18
lines changed
  • quaint/src/connector/postgres/native

1 file changed

+4
-18
lines changed

quaint/src/connector/postgres/native/mod.rs

+4-18
Original file line numberDiff line numberDiff line change
@@ -729,15 +729,8 @@ impl Queryable for PostgreSql {
729729
.collect();
730730

731731
let changes = self
732-
.perform_io(self.client.0.query_typed_raw::<&(dyn ToSql + Sync), _>(
733-
sql,
734-
params_with_types.as_slice().iter()
735-
.map(|(v, t)| (*v, t.clone()))
736-
.collect::<Vec<_>>()
737-
))
738-
.await?
739-
.rows_affected()
740-
.unwrap_or(0);
732+
.perform_io(self.client.0.execute_typed(sql, params_with_types.as_slice()))
733+
.await?;
741734

742735
Ok(changes)
743736
},
@@ -763,15 +756,8 @@ impl Queryable for PostgreSql {
763756
.collect();
764757

765758
let changes = self
766-
.perform_io(self.client.0.query_typed_raw::<&(dyn ToSql + Sync), _>(
767-
sql,
768-
params_with_types.as_slice().iter()
769-
.map(|(v, t)| (*v, t.clone()))
770-
.collect::<Vec<_>>()
771-
))
772-
.await?
773-
.rows_affected()
774-
.unwrap_or(0);
759+
.perform_io(self.client.0.execute_typed(sql, params_with_types.as_slice()))
760+
.await?;
775761

776762
Ok(changes)
777763
},

0 commit comments

Comments
 (0)