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

Function insert_interaction

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

Source from the content-addressed store, hash-verified

321
322#[instrument(skip_all)]
323pub async fn insert_interaction(
324 ex: &mut PgConnection,
325 order: &OrderUid,
326 interaction: &Interaction,
327) -> Result<(), sqlx::Error> {
328 const QUERY: &str = r#"
329INSERT INTO interactions (
330 order_uid,
331 index,
332 target,
333 value,
334 data,
335 execution
336)
337VALUES ($1, $2, $3, $4, $5, $6)
338 "#;
339 sqlx::query(QUERY)
340 .bind(order)
341 .bind(interaction.index)
342 .bind(interaction.target)
343 .bind(&interaction.value)
344 .bind(&interaction.data)
345 .bind(interaction.execution)
346 .execute(ex)
347 .await?;
348 Ok(())
349}
350
351#[instrument(skip_all)]
352pub async fn insert_or_overwrite_interactions(

Calls 3

queryFunction · 0.50
executeMethod · 0.45
bindMethod · 0.45

Tested by

no test coverage detected