pub async fn list_by_token(
        share: &str,
        schema: &str,
        token_id: &Uuid,
        db: &PgPool,
    ) -> Result<Vec<Table>, sqlx::Error> {
        let schema = Schema::find(&share, &schema, db).await?;

        let tables = sqlx::query_as!(
            PrimitiveTable,
            r#"
                SELECT tables.* FROM tables, tokens_for_tables
                WHERE schema_id = $1
                AND tables.id = tokens_for_tables.table_id
                AND tokens_for_tables.token_id = $2"#,
            schema.id,
            token_id
        )
        .fetch_all(db)
        .await?;

        Ok(tables
            .into_iter()
            .map(|inner| Table {
                inner,
                delta_table: None,
                schema: schema.clone(),
            })
            .collect())
    }
/**
     * List the tables specifically in the given share and schema
     */
List the tables specifically in the given share and schema
List the tables specifically in the given share and schema
pub async fn list_by_token(
        share: &str,
        schema: &str,
        token_id: &Uuid,
        db: &PgPool,
    ) -> Result<Vec<Table>, sqlx::Error> {
        let schema = Schema::find(&share, &schema, db).await?;
        let tables = sqlx::query_as!(
            PrimitiveTable,
            r#"
                SELECT tables.* FROM tables, tokens_for_tables
                WHERE schema_id = $1
                AND tables.id = tokens_for_tables.table_id
                AND tokens_for_tables.token_id = $2"#,
            schema.id,
            token_id
        )
        .fetch_all(db)
        .await?;
        Ok(tables
            .into_iter()
            .map(|inner| Table {
                inner,
                delta_table: None,
                schema: schema.clone(),
            })
            .collect())
    }
pub async fn list_by_token ( share : & str , schema : & str , token_id : & Uuid , db : & PgPool , ) -> Result < Vec < Table > , sqlx :: Error > { let schema = Schema :: find ( & share , & schema , db ) . await ? ; let tables = sqlx :: query_as ! ( PrimitiveTable r#"
                SELECT tables.* FROM tables, tokens_for_tables
                WHERE schema_id = $1
                AND tables.id = tokens_for_tables.table_id
                AND tokens_for_tables.token_id = $2"# schema id token_id ) . fetch_all ( db ) . await ? ; Ok ( tables . into_iter ( ) . map ( | inner | Table { inner , delta_table : None , schema : schema . clone ( ) , } ) . collect ( ) ) }
List the tables specifically in the given share and schema
List the tables specifically in the given share and schema
share
&str
schema
&str
token_id
&Uuid
db
&PgPool
share
&str
schema
&str
token_id
&Uuid
db
&PgPool