Executes a query and returns the total number of affected rows.
(
&'s mut self,
query: impl AsQuery<Self::Driver> + 's,
)
| 75 | |
| 76 | /// Executes a query and returns the total number of affected rows. |
| 77 | fn execute<'s>( |
| 78 | &'s mut self, |
| 79 | query: impl AsQuery<Self::Driver> + 's, |
| 80 | ) -> impl Future<Output = Result<RowsAffected>> + Send { |
| 81 | self.run(query) |
| 82 | .filter_map(|v| async move { |
| 83 | match v { |
| 84 | Ok(QueryResult::Affected(v)) => Some(Ok(v)), |
| 85 | Err(e) => Some(Err(e)), |
| 86 | _ => None, |
| 87 | } |
| 88 | }) |
| 89 | .try_collect() |
| 90 | } |
| 91 | |
| 92 | /// Efficiently inserts a collection of entities bypassing regular SQL execution when supported by the driver. |
| 93 | fn append<It>(&mut self, entities: It) -> impl Future<Output = Result<RowsAffected>> + Send |
nothing calls this directly
no test coverage detected