mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-04 02:34:13 +02:00
filterbar wip
This commit is contained in:
parent
10ea8ddcbc
commit
e5c9aeb7fe
15 changed files with 1905 additions and 420 deletions
19
src/data/maps.rs
Normal file
19
src/data/maps.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
use crate::Result;
|
||||
use sqlx::{query, Executor, Postgres};
|
||||
use tracing::instrument;
|
||||
|
||||
#[instrument(skip(connection))]
|
||||
pub async fn map_list(
|
||||
connection: impl Executor<'_, Database = Postgres>,
|
||||
) -> Result<impl Iterator<Item = String>> {
|
||||
Ok(query!(
|
||||
r#"SELECT
|
||||
map as "map!"
|
||||
FROM map_list
|
||||
ORDER BY count DESC LIMIT 50"#
|
||||
)
|
||||
.fetch_all(connection)
|
||||
.await?
|
||||
.into_iter()
|
||||
.map(|res| res.map))
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
pub mod chat;
|
||||
pub mod demo;
|
||||
pub mod maps;
|
||||
pub mod player;
|
||||
pub mod steam_id;
|
||||
pub mod user;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue