(
ex: &mut sqlx::PgConnection,
order_ids: &[OrderUid],
)
| 442 | |
| 443 | #[instrument(skip_all)] |
| 444 | pub async fn read_quotes( |
| 445 | ex: &mut sqlx::PgConnection, |
| 446 | order_ids: &[OrderUid], |
| 447 | ) -> Result<Vec<Quote>, sqlx::Error> { |
| 448 | if order_ids.is_empty() { |
| 449 | return Ok(vec![]); |
| 450 | } |
| 451 | |
| 452 | let mut query_builder = QueryBuilder::new("SELECT * FROM order_quotes WHERE order_uid IN ("); |
| 453 | |
| 454 | let mut separated = query_builder.separated(", "); |
| 455 | for value_type in order_ids { |
| 456 | separated.push_bind(value_type); |
| 457 | } |
| 458 | separated.push_unseparated(") "); |
| 459 | |
| 460 | let query = query_builder.build_query_as(); |
| 461 | query.fetch_all(ex).await |
| 462 | } |
| 463 | |
| 464 | #[instrument(skip_all)] |
| 465 | pub async fn cancel_order( |
no test coverage detected