pub async fn query_players(connection: &PgPool) -> Vec<Player> {
    let mut players: Vec<Player> = vec![];
    let mut query = sqlx::query_as::<_, Player>("SELECT * FROM players;").fetch(connection);

    while let Some(player) = query.next().await {
        match player {
            Ok(player) => players.push(player),
            Err(_) => (),
        }
    }
    players
}
/// Returns **ALL** players that are stored in the database
Returns **ALL** players that are stored in the database
Returns ** ALL ** players that are stored in the database
pub async fn query_players(connection: &PgPool) -> Vec<Player> {
    let mut players: Vec<Player> = vec![];
    let mut query = sqlx::query_as::<_, Player>("SELECT * FROM players;").fetch(connection);
    while let Some(player) = query.next().await {
        match player {
            Ok(player) => players.push(player),
            Err(_) => (),
        }
    }
    players
}
pub async fn query_players ( connection : & PgPool ) -> Vec < Player > { let mut players : Vec < Player > = vec ! [ ] ; let mut query = sqlx :: query_as :: < _ , Player > ( " " ) . fetch ( connection ) ; while let Some ( player ) = query . next ( ) . await { match player { Ok ( player ) => players . push ( player ) , Err ( _ ) => ( ) , } } players }
Returns **ALL** players that are stored in the database
Returns ** ALL ** players that are stored in the database
connection
&PgPool
connection
&PgPool