(
ex: &mut PgConnection,
order: &OrderUid,
interaction: &Interaction,
)
| 274 | |
| 275 | #[instrument(skip_all)] |
| 276 | pub async fn insert_interaction( |
| 277 | ex: &mut PgConnection, |
| 278 | order: &OrderUid, |
| 279 | interaction: &Interaction, |
| 280 | ) -> Result<(), sqlx::Error> { |
| 281 | const QUERY: &str = r#" |
| 282 | INSERT INTO interactions ( |
| 283 | order_uid, |
| 284 | index, |
| 285 | target, |
| 286 | value, |
| 287 | data, |
| 288 | execution |
| 289 | ) |
| 290 | VALUES ($1, $2, $3, $4, $5, $6) |
| 291 | "#; |
| 292 | sqlx::query(QUERY) |
| 293 | .bind(order) |
| 294 | .bind(interaction.index) |
| 295 | .bind(interaction.target) |
| 296 | .bind(&interaction.value) |
| 297 | .bind(&interaction.data) |
| 298 | .bind(interaction.execution) |
| 299 | .execute(ex) |
| 300 | .await?; |
| 301 | Ok(()) |
| 302 | } |
| 303 | |
| 304 | #[instrument(skip_all)] |
| 305 | pub async fn insert_or_overwrite_interactions( |
no test coverage detected