pub async fn find_person_by_name(
    full_name: String,
    pool: &PgPool) -> sqlx::Result<Person> {

    let select_query = sqlx::query("SELECT * FROM persons WHERE full_name = $1");
    let person =
        select_query
            .bind(full_name)
            .map(|row: PgRow| {
                Person {
                    id: row.get("id"),
                    full_name: row.get("full_name"),
                }
            })
            .fetch_one(pool)
            .await?;

    tracing::info!(
        "DB find_person_by_name : Personne trouvée (nom) : {}",
        &person.full_name
    );

    Ok(person)
}
///
/// find person by name
/// returns author by name
///
find person by name
returns author by name
find person by name returns author by name
pub async fn find_person_by_name(
    full_name: String,
    pool: &PgPool) -> sqlx::Result<Person> {
    let select_query = sqlx::query("SELECT * FROM persons WHERE full_name = $1");
    let person =
        select_query
            .bind(full_name)
            .map(|row: PgRow| {
                Person {
                    id: row.get("id"),
                    full_name: row.get("full_name"),
                }
            })
            .fetch_one(pool)
            .await?;
    tracing::info!(
        "DB find_person_by_name : Personne trouvée (nom) : {}",
        &person.full_name
    );
    Ok(person)
}
pub async fn find_person_by_name ( full_name : String , pool : & PgPool ) -> sqlx :: Result < Person > { let select_query = sqlx :: query ( " " ) ; let person = select_query . bind ( full_name ) . map ( | row : PgRow | { Person { id : row . get ( " " ) , full_name : row . get ( " " ) , } } ) . fetch_one ( pool ) . await ? ; tracing :: info ! ( " , person full_name ) ; Ok ( person ) }
find person by name
returns author by name
find person by name returns author by name
full_name
String
pool
&PgPool