(self, tx: &mut Transaction<'_, Postgres>)
| 99 | } |
| 100 | } |
| 101 | async fn store(self, tx: &mut Transaction<'_, Postgres>) -> Result<(), sqlx::Error> { |
| 102 | sqlx::query!( |
| 103 | r#" |
| 104 | INSERT INTO de(key,data,hash) |
| 105 | VALUES ($1,$2,$3) |
| 106 | ON CONFLICT (key) DO UPDATE |
| 107 | SET data = EXCLUDED.data, |
| 108 | hash = EXCLUDED.hash"#, |
| 109 | self.key, |
| 110 | self.de, |
| 111 | self.hash, |
| 112 | ) |
| 113 | .execute(&mut **tx) |
| 114 | .await?; |
| 115 | |
| 116 | sqlx::query!( |
| 117 | r#" |
| 118 | INSERT INTO en(key,data) |
| 119 | VALUES ($1,$2) |
| 120 | ON CONFLICT (key) DO UPDATE |
| 121 | SET data = EXCLUDED.data"#, |
| 122 | self.key, |
| 123 | self.en, |
| 124 | ) |
| 125 | .execute(&mut **tx) |
| 126 | .await?; |
| 127 | |
| 128 | Ok(()) |
| 129 | } |
| 130 | } |
| 131 | #[tracing::instrument] |
| 132 | pub async fn download_updates( |
no test coverage detected