Add timestamp to mods for some resumability

This commit is contained in:
2021-07-29 00:50:42 -04:00
parent a8424e830e
commit fc5a9d39c2
5 changed files with 61 additions and 6 deletions

View File

@@ -36,6 +36,18 @@ pub async fn get_by_nexus_file_id(
.context("Failed to get file")
}
#[instrument(level = "debug", skip(pool))]
pub async fn get_nexus_file_ids_by_mod_id(
pool: &sqlx::Pool<sqlx::Postgres>,
mod_id: i32,
) -> Result<Vec<i32>> {
sqlx::query!("SELECT nexus_file_id FROM files WHERE mod_id = $1", mod_id)
.map(|row| row.nexus_file_id)
.fetch_all(pool)
.await
.context("Failed to get files")
}
#[instrument(level = "debug", skip(pool))]
pub async fn insert(
pool: &sqlx::Pool<sqlx::Postgres>,