fn decks_with_card(ctx: &Context, id: Uuid) -> Vec<Deck> {
        use crate::schema::deck_contents::dsl::{card, deck, deck_contents};
        use crate::schema::decks::dsl::{active, decks, id as id_};

        let conn = ctx.pool.get().expect("Unable to get DB connection.");

        let deck_ids: Vec<i32> = deck_contents
            .filter(card.eq(id))
            .select(deck)
            .distinct()
            .get_results(&conn)
            .expect("Unable to connect to DB");

        decks
            .filter(id_.eq_any(deck_ids).and(active.eq(false)))
            .get_results(&conn)
            .expect("Unable to connect to DB")
    }
/// Decks that contain the card with the given Scryfall Oracle ID.
Decks that contain the card with the given Scryfall Oracle ID.
Decks that contain the card with the given Scryfall Oracle ID .
fn decks_with_card(ctx: &Context, id: Uuid) -> Vec<Deck> {
        use crate::schema::deck_contents::dsl::{card, deck, deck_contents};
        use crate::schema::decks::dsl::{active, decks, id as id_};
        let conn = ctx.pool.get().expect("Unable to get DB connection.");
        let deck_ids: Vec<i32> = deck_contents
            .filter(card.eq(id))
            .select(deck)
            .distinct()
            .get_results(&conn)
            .expect("Unable to connect to DB");
        decks
            .filter(id_.eq_any(deck_ids).and(active.eq(false)))
            .get_results(&conn)
            .expect("Unable to connect to DB")
    }
fn decks_with_card ( ctx : & Context , id : Uuid ) -> Vec < Deck > { use crate :: schema :: deck_contents :: dsl :: { card , deck , deck_contents } ; use crate :: schema :: decks :: dsl :: { active , decks , id as id_ } ; let conn = ctx . pool . get ( ) . expect ( " " ) ; let deck_ids : Vec < i32 > = deck_contents . filter ( card . eq ( id ) ) . select ( deck ) . distinct ( ) . get_results ( & conn ) . expect ( " " ) ; decks . filter ( id_ . eq_any ( deck_ids ) . and ( active . eq ( false ) ) ) . get_results ( & conn ) . expect ( " " ) }
Decks that contain the card with the given Scryfall Oracle ID.
Decks that contain the card with the given Scryfall Oracle ID .
ctx
&Context
id
Uuid
ctx
&Context
id
Uuid