compute proper rank
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user