pub async fn show_one_partition(partition: Partition, pool: &PgPool) -> sqlx::Result<ShowPartition> {

    let show_partition = sqlx::query(
        "
    SELECT partitions.id, partitions.title, persons.full_name, genres.name
    FROM partitions
    INNER JOIN persons
    ON partitions.person_id = persons.id
    INNER JOIN genres
    ON partitions.genre_id = genres.id
    WHERE partitions.title = $1
        "
    )
        .bind(partition.title)
        .map(|row: PgRow| ShowPartition {
            id: row.get(0),
            title: row.get(1),
            full_name: row.get(2),
            name: row.get(3),
        })
        .fetch_one(pool)
        .await?;

    Ok(show_partition)
}
///
/// Return a readable partition (ShowPartition) from a Partition
/// or sqlxError
///

Return a readable partition (ShowPartition) from a Partition
or sqlxError
Return a readable partition ( ShowPartition ) from a Partition or sqlxError
pub async fn show_one_partition(partition: Partition, pool: &PgPool) -> sqlx::Result<ShowPartition> {
    let show_partition = sqlx::query(
        "
    SELECT partitions.id, partitions.title, persons.full_name, genres.name
    FROM partitions
    INNER JOIN persons
    ON partitions.person_id = persons.id
    INNER JOIN genres
    ON partitions.genre_id = genres.id
    WHERE partitions.title = $1
        "
    )
        .bind(partition.title)
        .map(|row: PgRow| ShowPartition {
            id: row.get(0),
            title: row.get(1),
            full_name: row.get(2),
            name: row.get(3),
        })
        .fetch_one(pool)
        .await?;
    Ok(show_partition)
}
pub async fn show_one_partition ( partition : Partition , pool : & PgPool ) -> sqlx :: Result < ShowPartition > { let show_partition = sqlx :: query ( " " ) . bind ( partition . title ) . map ( | row : PgRow | ShowPartition { id : row . get ( 0 ) , title : row . get ( 1 ) , full_name : row . get ( 2 ) , name : row . get ( 3 ) , } ) . fetch_one ( pool ) . await ? ; Ok ( show_partition ) }
Return a readable partition (ShowPartition) from a Partition
or sqlxError
Return a readable partition ( ShowPartition ) from a Partition or sqlxError
partition
Partition
pool
&PgPool