pub async fn list_persons(pool: &PgPool) -> sqlx::Result<Vec<Person>> {

    //let mut persons: Vec<Person> = Vec::new();
    let recs =
        sqlx::query("SELECT id, full_name FROM persons ORDER BY full_name;")
            .map(|row: PgRow| Person {
                id: row.get("id"),
                full_name: row.get("full_name"),
            })
            .fetch_all(pool)
            .await?;
/*
    for rec in recs {
        persons.push(Person {
            id: rec.id,
            full_name: rec.full_name,
        });
    }

 */
    Ok(recs)

    /*
    let persons = sqlx::query_as!(Person,
    "SELECT id, full_name FROM persons ORDER BY full_name")
        .fetch_all(pool)
        .await?;

    Ok(persons)
    */
}
///
/// Returns a list of musicians
/// under the form of a Vec<Person>
/// or a sqlx Error
///

Returns a list of musicians
under the form of a Vec
or a sqlx Error
Returns a list of musicians under the form of a Vec or a sqlx Error
pub async fn list_persons(pool: &PgPool) -> sqlx::Result<Vec<Person>> {
    //let mut persons: Vec<Person> = Vec::new();
    let recs =
        sqlx::query("SELECT id, full_name FROM persons ORDER BY full_name;")
            .map(|row: PgRow| Person {
                id: row.get("id"),
                full_name: row.get("full_name"),
            })
            .fetch_all(pool)
            .await?;
/*
    for rec in recs {
        persons.push(Person {
            id: rec.id,
            full_name: rec.full_name,
        });
    }
 */
    Ok(recs)
    /*
    let persons = sqlx::query_as!(Person,
    "SELECT id, full_name FROM persons ORDER BY full_name")
        .fetch_all(pool)
        .await?;
    Ok(persons)
    */
}
pub async fn list_persons ( pool : & PgPool ) -> sqlx :: Result < Vec < Person > > { //let mut persons: Vec<Person> = Vec::new();
 let recs = sqlx :: query ( " " ) . map ( | row : PgRow | Person { id : row . get ( " " ) , full_name : row . get ( " " ) , } ) . fetch_all ( pool ) . await ? ; /*
    for rec in recs {
        persons.push(Person {
            id: rec.id,
            full_name: rec.full_name,
        });
    }

 */ Ok ( recs ) /*
    let persons = sqlx::query_as!(Person,
    "SELECT id, full_name FROM persons ORDER BY full_name")
        .fetch_all(pool)
        .await?;

    Ok(persons)
    */ }
Returns a list of musicians
under the form of a Vec<Person>
or a sqlx Error
Returns a list of musicians under the form of a Vec<Person > or a sqlx Error
pool
&PgPool