diff --git a/sql/warps/departure/get_ids_by_uid.sql b/sql/warps/departure/get_ids_by_uid.sql new file mode 100644 index 00000000..52ed30cc --- /dev/null +++ b/sql/warps/departure/get_ids_by_uid.sql @@ -0,0 +1,7 @@ +SELECT + warps_departure.id +FROM + warps_departure +WHERE + uid = $1; + diff --git a/src/database/warps/departure.rs b/src/database/warps/departure.rs index 2c59edd3..d7d6332f 100644 --- a/src/database/warps/departure.rs +++ b/src/database/warps/departure.rs @@ -35,6 +35,17 @@ pub async fn get_by_uid( ) } +pub async fn get_ids_by_uid(uid: i32, pool: &PgPool) -> anyhow::Result> { + Ok( + sqlx::query_file!("sql/warps/departure/get_ids_by_uid.sql", uid) + .fetch_all(pool) + .await? + .into_iter() + .map(|r| r.id) + .collect(), + ) +} + pub async fn get_count_by_uid(uid: i32, pool: &PgPool) -> anyhow::Result { Ok( sqlx::query_file!("sql/warps/departure/get_count_by_uid.sql", uid) diff --git a/src/update/mod.rs b/src/update/mod.rs index 94a644b1..e38eb61e 100644 --- a/src/update/mod.rs +++ b/src/update/mod.rs @@ -1,7 +1,7 @@ pub mod achievements_percent; pub mod dimbreath; pub mod gi_achievements_percent; -pub mod scores; +//pub mod scores; pub mod signals_stats; pub mod star_rail_res; pub mod warps_stats;