compute proper rank

This commit is contained in:
2025-08-02 20:18:11 +02:00
parent 4587998e91
commit bad6dab8e8

View File

@@ -9,12 +9,11 @@ pub(crate) struct Rank {
impl Backend {
pub(crate) async fn highscore(&self) -> Vec<Rank> {
// TODO: proper rank calculation
match self {
Backend::Sqlite(db) => sqlx::query_as!(
Rank,
"SELECT
1 as rank,
RANK() OVER (ORDER BY COUNT(s.client_uuid) DESC) as rank,
c.name,
c.uuid,
COUNT(s.client_uuid) as amount