Merge pull request #503 from ivan/master

Add query_one to postgres::Transaction
This commit is contained in:
Steven Fackler 2019-10-27 10:29:31 -04:00 committed by GitHub
commit 6c77baad1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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,