MCPcopy Create free account
hub / github.com/cowprotocol/services / insert_interaction

Function insert_interaction

crates/database/src/orders.rs:276–302  ·  view source on GitHub ↗
(
    ex: &mut PgConnection,
    order: &OrderUid,
    interaction: &Interaction,
)

Source from the content-addressed store, hash-verified

274
275#[instrument(skip_all)]
276pub async fn insert_interaction(
277 ex: &mut PgConnection,
278 order: &OrderUid,
279 interaction: &Interaction,
280) -> Result<(), sqlx::Error> {
281 const QUERY: &str = r#"
282INSERT INTO interactions (
283 order_uid,
284 index,
285 target,
286 value,
287 data,
288 execution
289)
290VALUES ($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)]
305pub async fn insert_or_overwrite_interactions(

Calls 2

queryFunction · 0.85
executeMethod · 0.45

Tested by

no test coverage detected