200
201
202
203
204
205
206
207
208
209
210
211
212
213
|
where I: Into<i64> {
sqlx::query("update rsstg_source set last_scrape = now() where source_id = $1;")
.bind(id.into())
.execute(&mut *self.0).await.stack()?;
Ok(())
}
pub async fn update <I> (&mut self, update: Option<i32>, channel: &str, channel_id: i64, url: &str, iv_hash: Option<&str>, url_re: Option<&str>, owner: I) -> Result<&str>
where I: Into<i64> {
match match update {
Some(id) => {
sqlx::query("update rsstg_source set channel_id = $2, url = $3, iv_hash = $4, owner = $5, channel = $6, url_re = $7 where source_id = $1")
.bind(id)
},
|
>
>
>
|
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
|
where I: Into<i64> {
sqlx::query("update rsstg_source set last_scrape = now() where source_id = $1;")
.bind(id.into())
.execute(&mut *self.0).await.stack()?;
Ok(())
}
#[allow(clippy::too_many_arguments)] // XXX do I need to make it variadic? I guess it work fine
// this way for now, unless there would be a good struct
// with all source fields to use that as an argument
pub async fn update <I> (&mut self, update: Option<i32>, channel: &str, channel_id: i64, url: &str, iv_hash: Option<&str>, url_re: Option<&str>, owner: I) -> Result<&str>
where I: Into<i64> {
match match update {
Some(id) => {
sqlx::query("update rsstg_source set channel_id = $2, url = $3, iv_hash = $4, owner = $5, channel = $6, url_re = $7 where source_id = $1")
.bind(id)
},
|