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

Function insert_interaction

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

Source from the content-addressed store, hash-verified

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

Calls 2

queryFunction · 0.85
executeMethod · 0.45

Tested by

no test coverage detected