Remove backfill, add bulk get game_mod method

This commit is contained in:
2021-07-21 22:25:45 -04:00
parent 4b333b3b99
commit 04773954f9
2 changed files with 49 additions and 94 deletions

View File

@@ -31,6 +31,21 @@ pub async fn get_by_nexus_mod_id(
.context("Failed to get mod")
}
#[instrument(level = "debug", skip(pool))]
pub async fn bulk_get_by_nexus_mod_id(
pool: &sqlx::Pool<sqlx::Postgres>,
nexus_mod_ids: &[i32],
) -> Result<Vec<Mod>> {
sqlx::query_as!(
Mod,
"SELECT * FROM mods WHERE nexus_mod_id = ANY($1::int[])",
nexus_mod_ids,
)
.fetch_all(pool)
.await
.context("Failed to get mods")
}
#[instrument(level = "debug", skip(pool))]
pub async fn insert(
pool: &sqlx::Pool<sqlx::Postgres>,