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

Function read_order

crates/database/src/orders.rs:219–228  ·  view source on GitHub ↗
(
    ex: &mut PgConnection,
    id: &OrderUid,
)

Source from the content-addressed store, hash-verified

217
218#[instrument(skip_all)]
219pub async fn read_order(
220 ex: &mut PgConnection,
221 id: &OrderUid,
222) -> Result<Option<Order>, sqlx::Error> {
223 const QUERY: &str = r#"
224SELECT * FROM ORDERS
225WHERE uid = $1
226 "#;
227 sqlx::query_as(QUERY).bind(id).fetch_optional(ex).await
228}
229
230pub fn is_duplicate_record_error(err: &sqlx::Error) -> bool {
231 if let sqlx::Error::Database(db_err) = &err

Calls

no outgoing calls

Tested by

no test coverage detected