pub struct CardQuery<'a> { /* private fields */ }Expand description
Query interface for MTG cards backed by the cards parquet view.
Implementations§
Source§impl<'a> CardQuery<'a>
impl<'a> CardQuery<'a>
Sourcepub fn new(conn: &'a Connection) -> Self
pub fn new(conn: &'a Connection) -> Self
Create a new CardQuery bound to the given connection.
Sourcepub fn get_by_uuid(&self, uuid: &str) -> Result<Option<Value>>
pub fn get_by_uuid(&self, uuid: &str) -> Result<Option<Value>>
Retrieve a single card by its UUID.
Sourcepub fn get_by_uuids(&self, uuids: &[&str]) -> Result<Vec<Value>>
pub fn get_by_uuids(&self, uuids: &[&str]) -> Result<Vec<Value>>
Retrieve multiple cards by their UUIDs (preserves order where possible).
Sourcepub fn get_by_name(
&self,
name: &str,
set_code: Option<&str>,
) -> Result<Vec<Value>>
pub fn get_by_name( &self, name: &str, set_code: Option<&str>, ) -> Result<Vec<Value>>
Get all printings of a card by exact name, optionally filtered by set code.
Sourcepub fn get_printings(&self, name: &str) -> Result<Vec<Value>>
pub fn get_printings(&self, name: &str) -> Result<Vec<Value>>
Alias for get_by_name – returns all printings of the card.
Sourcepub fn get_atomic(&self, name: &str) -> Result<Vec<Value>>
pub fn get_atomic(&self, name: &str) -> Result<Vec<Value>>
Get a de-duplicated oracle-level card by name.
De-duplicates by (name, faceName). If no results are found for an exact name
match, falls back to searching by faceName.
Sourcepub fn find_by_scryfall_id(&self, scryfall_id: &str) -> Result<Vec<Value>>
pub fn find_by_scryfall_id(&self, scryfall_id: &str) -> Result<Vec<Value>>
Find cards by their Scryfall ID (joins card_identifiers).
Sourcepub fn count(&self, filters: &HashMap<String, String>) -> Result<i64>
pub fn count(&self, filters: &HashMap<String, String>) -> Result<i64>
Count cards, optionally filtered by the supplied column/value pairs.
Sourcepub fn search(&self, params: &SearchCardsParams) -> Result<Vec<Value>>
pub fn search(&self, params: &SearchCardsParams) -> Result<Vec<Value>>
Search for cards using a rich set of optional filters.
Translates each field of SearchCardsParams into appropriate SQL conditions
(LIKE, exact match, fuzzy match, JOIN, list_contains, regexp, etc.).