pub async fn list_by_token(token_id: &Uuid, db: &PgPool) -> Result<Vec<Share>, sqlx::Error> {
        sqlx::query_as!(
            Share,
            r#"
            SELECT shares.* FROM shares, schemas
                WHERE shares.id = schemas.share_id
                AND schemas.id IN
                    (SELECT schema_id FROM tables, tokens_for_tables
                        WHERE tables.id = tokens_for_tables.table_id
                        AND tokens_for_tables.token_id = $1)
            "#,
            token_id
        )
        .fetch_all(db)
        .await
    }
/**
     * This function will return all the Shares that are visible to the given token
     */
This function will return all the Shares that are visible to the given token
This function will return all the Shares that are visible to the given token
pub async fn list_by_token(token_id: &Uuid, db: &PgPool) -> Result<Vec<Share>, sqlx::Error> {
        sqlx::query_as!(
            Share,
            r#"
            SELECT shares.* FROM shares, schemas
                WHERE shares.id = schemas.share_id
                AND schemas.id IN
                    (SELECT schema_id FROM tables, tokens_for_tables
                        WHERE tables.id = tokens_for_tables.table_id
                        AND tokens_for_tables.token_id = $1)
            "#,
            token_id
        )
        .fetch_all(db)
        .await
    }
pub async fn list_by_token ( token_id : & Uuid , db : & PgPool ) -> Result < Vec < Share > , sqlx :: Error > { sqlx :: query_as ! ( Share r#"
            SELECT shares.* FROM shares, schemas
                WHERE shares.id = schemas.share_id
                AND schemas.id IN
                    (SELECT schema_id FROM tables, tokens_for_tables
                        WHERE tables.id = tokens_for_tables.table_id
                        AND tokens_for_tables.token_id = $1)
            "# token_id ) . fetch_all ( db ) . await }
This function will return all the Shares that are visible to the given token
This function will return all the Shares that are visible to the given token
token_id
&Uuid
db
&PgPool
token_id
&Uuid
db
&PgPool