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