Skip to content

Commit

Permalink
saving
Browse files Browse the repository at this point in the history
  • Loading branch information
juliuskreutz committed Dec 21, 2024
1 parent 71f0b8b commit 85cf413
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
7 changes: 7 additions & 0 deletions sql/warps/departure/get_ids_by_uid.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SELECT
warps_departure.id
FROM
warps_departure
WHERE
uid = $1;

11 changes: 11 additions & 0 deletions src/database/warps/departure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ pub async fn get_by_uid(
)
}

pub async fn get_ids_by_uid(uid: i32, pool: &PgPool) -> anyhow::Result<Vec<i64>> {
Ok(
sqlx::query_file!("sql/warps/departure/get_ids_by_uid.sql", uid)

Check failure on line 40 in src/database/warps/departure.rs

View workflow job for this annotation

GitHub Actions / Clippy

set `DATABASE_URL` to use query macros online, or run `cargo sqlx prepare` to update the query cache
.fetch_all(pool)
.await?
.into_iter()
.map(|r| r.id)
.collect(),
)
}

pub async fn get_count_by_uid(uid: i32, pool: &PgPool) -> anyhow::Result<i64> {
Ok(
sqlx::query_file!("sql/warps/departure/get_count_by_uid.sql", uid)
Expand Down
2 changes: 1 addition & 1 deletion src/update/mod.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 85cf413

Please sign in to comment.