mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-10-05 16:54:50 +00:00
parent
90fd35745c
commit
80eb2cc7d2
@ -146,20 +146,20 @@ where
|
|||||||
pub fn fetch<'e: 'q, E>(
|
pub fn fetch<'e: 'q, E>(
|
||||||
mut self,
|
mut self,
|
||||||
executor: E,
|
executor: E,
|
||||||
) -> impl Stream<Item = crate::Result<F::Output>> + 'e
|
) -> impl Stream<Item = crate::Result<F::Output>> + Unpin + 'e
|
||||||
where
|
where
|
||||||
'q: 'e,
|
'q: 'e,
|
||||||
E: RefExecutor<'e, Database = DB> + 'e,
|
E: RefExecutor<'e, Database = DB> + 'e,
|
||||||
F: 'e,
|
F: 'e,
|
||||||
F::Output: 'e,
|
F::Output: 'e,
|
||||||
{
|
{
|
||||||
try_stream! {
|
Box::pin(try_stream! {
|
||||||
let mut cursor = executor.fetch_by_ref(self.query);
|
let mut cursor = executor.fetch_by_ref(self.query);
|
||||||
while let Some(next) = cursor.next().await? {
|
while let Some(next) = cursor.next().await? {
|
||||||
let mapped = self.mapper.try_map_row(next)?;
|
let mapped = self.mapper.try_map_row(next)?;
|
||||||
yield mapped;
|
yield mapped;
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the first row in the result
|
/// Get the first row in the result
|
||||||
|
Loading…
x
Reference in New Issue
Block a user