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

    let mut name = full_name.clone();
    name.push('%');

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

    /*    tracing::info!(
            "db find_person_by_name : Personne(s) trouvée(s) (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<Vec<Person>> {
    let mut name = full_name.clone();
    name.push('%');
    let select_query =
        sqlx::query("SELECT * FROM persons \
                         WHERE full_name LIKE $1");
    let person =
        select_query
            .bind(name)
            .map(|row: PgRow| {
                Person {
                    id: row.get("id"),
                    full_name: row.get("full_name"),
                }
            })
            .fetch_all(pool)
            .await?;
    /*    tracing::info!(
            "db find_person_by_name : Personne(s) trouvée(s) (nom) : {}",
            &person.full_name
        );
    */
    Ok(person)
}
pub async fn find_person_by_name ( full_name : String , pool : & PgPool ) -> sqlx :: Result < Vec < Person > > { let mut name = full_name . clone ( ) ; name . push ( '%' ) ; let select_query = sqlx :: query ( " \
 " ) ; let person = select_query . bind ( name ) . map ( | row : PgRow | { Person { id : row . get ( " " ) , full_name : row . get ( " " ) , } } ) . fetch_all ( pool ) . await ? ; /*    tracing::info!(
            "db find_person_by_name : Personne(s) trouvée(s) (nom) : {}",
            &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