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

Function insert

crates/database/src/settlement_executions.rs:22–47  ·  view source on GitHub ↗
(
    ex: &mut PgConnection,
    auction_id: AuctionId,
    solver: Address,
    solution_uid: i64,
    start_timestamp: DateTime<Utc>,
    start_block: i64,
    deadline_block: i64,
)

Source from the content-addressed store, hash-verified

20
21#[instrument(skip_all)]
22pub async fn insert(
23 ex: &mut PgConnection,
24 auction_id: AuctionId,
25 solver: Address,
26 solution_uid: i64,
27 start_timestamp: DateTime<Utc>,
28 start_block: i64,
29 deadline_block: i64,
30) -> Result<(), sqlx::Error> {
31 const QUERY: &str = r#"
32INSERT INTO settlement_executions (auction_id, solver, solution_uid, start_timestamp, start_block, deadline_block)
33VALUES ($1, $2, $3, $4, $5, $6)
34 ;"#;
35
36 sqlx::query(QUERY)
37 .bind(auction_id)
38 .bind(solver)
39 .bind(solution_uid)
40 .bind(start_timestamp)
41 .bind(start_block)
42 .bind(deadline_block)
43 .execute(ex)
44 .await?;
45
46 Ok(())
47}
48
49#[instrument(skip_all)]
50pub async fn update(

Callers 1

postgres_roundtripFunction · 0.70

Calls 2

queryFunction · 0.85
executeMethod · 0.45

Tested by

no test coverage detected