Add query_one to postgres::Transaction

I believe this was missed in 31855141d2
This commit is contained in:
Ivan Kozik 2019-10-27 13:04:29 +00:00
parent 286f41d423
commit 0b5ca1bd68

View File

@ -58,6 +58,14 @@ impl<'a> Transaction<'a> {
executor::block_on(self.0.query(query, params))
}
/// Like `Client::query_one`.
pub fn query_one<T>(&mut self, query: &T, params: &[&(dyn ToSql + Sync)]) -> Result<Row, Error>
where
T: ?Sized + ToStatement,
{
executor::block_on(self.0.query_one(query, params))
}
/// Like `Client::query_raw`.
pub fn query_raw<'b, T, I>(
&mut self,