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

Function insert_interaction

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

Source from the content-addressed store, hash-verified

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

Calls 3

queryFunction · 0.85
bindMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected