/// Retrieves an user from the database by its name
/// (player_name in the Player struct and database).
///
/// Returns None if there is no such player in the database.
///
/// Returns the Player if it is in the database.
Retrieves an user from the database by its name
(player_name in the Player struct and database).

Returns None if there is no such player in the database.

Returns the Player if it is in the database.
Retrieves an user from the database by its name ( player_name in the Player struct and database ) . Returns None if there is no such player in the database . Returns the Player if it is in the database .
pub async fn query_player_by_name(connection: &PgPool, player_name: &PlayerName) -> Option<Player> {
    sqlx::query_as::<_, Player>("SELECT * FROM players WHERE player_name = $1;")
        .bind(&player_name.name())
        .fetch_optional(connection)
        .await
        .unwrap_or(None)
}
pub async fn query_player_by_name ( connection : & PgPool , player_name : & PlayerName ) -> Option < Player > { sqlx :: query_as :: < _ , Player > ( " " ) . bind ( & player_name . name ( ) ) . fetch_optional ( connection ) . await . unwrap_or ( None ) }
Retrieves an user from the database by its name
(player_name in the Player struct and database).
Retrieves an user from the database by its name ( player_name in the Player struct and database ) .
connection
&PgPool
player_name
&PlayerName