Skip to content

Commit 6c77baa

Browse files
authored
Merge pull request sfackler#503 from ivan/master
Add query_one to postgres::Transaction
2 parents 286f41d + 0b5ca1b commit 6c77baa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

postgres/src/transaction.rs

+8
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ impl<'a> Transaction<'a> {
5858
executor::block_on(self.0.query(query, params))
5959
}
6060

61+
/// Like `Client::query_one`.
62+
pub fn query_one<T>(&mut self, query: &T, params: &[&(dyn ToSql + Sync)]) -> Result<Row, Error>
63+
where
64+
T: ?Sized + ToStatement,
65+
{
66+
executor::block_on(self.0.query_one(query, params))
67+
}
68+
6169
/// Like `Client::query_raw`.
6270
pub fn query_raw<'b, T, I>(
6371
&mut self,

0 commit comments

Comments
 (0)