Function
fetch
(
ex: &mut PgConnection,
contract_app_data: &AppId,
)
Source from the content-addressed store, hash-verified
| 34 | } |
| 35 | |
| 36 | pub async fn fetch( |
| 37 | ex: &mut PgConnection, |
| 38 | contract_app_data: &AppId, |
| 39 | ) -> Result<Option<Vec<u8>>, sqlx::Error> { |
| 40 | const QUERY: &str = r#" |
| 41 | SELECT full_app_data |
| 42 | FROM app_data |
| 43 | WHERE contract_app_data = $1 |
| 44 | ;"#; |
| 45 | sqlx::query_scalar(QUERY) |
| 46 | .bind(contract_app_data) |
| 47 | .fetch_optional(ex) |
| 48 | .await |
| 49 | } |
| 50 | |
| 51 | #[cfg(test)] |
| 52 | mod tests { |
Tested by
no test coverage detected