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