yasuki_core.database#
Functions
Every card id in the card database — the valid-id universe for deck-storage integrity checks. |
|
|
Append an |
|
Compile a search-box query string into |
|
Map each card id to its display name (extended title, else name). |
Close the connection pool and release all connections. |
|
|
Compile a boolean-query AST into one SQL predicate and its params, or None for no constraint. |
|
Compile one search term (a boolean-AST leaf) into a single SQL predicate and its params. |
|
Count cards matching filters without fetching row data. |
Fetch the generic card backs. |
|
|
Fetch a single card by ID. |
|
Fetch a card's rules-text revision history, oldest first. |
|
Fetch cards matching a list of names, including their prints. |
Get PostgreSQL connection string from environment or use default. |
|
|
Resolve the tokens the given creator cards can create, plus each token's full record. |
Context manager for database connections from the pool. |
|
|
Fetch all prints for a specific card. |
|
Initialize the module-level connection pool. |
|
Replace the password portion of a DSN with |
Fetch every card with its multi-valued attributes and front image, ordered by name. |
|
Fetch all unique clans. |
|
Fetch all unique deck types from cards. |
|
Fetch all format names from database. |
|
Fetch all card prints from database with their set information. |
|
Fetch all unique rarities from prints. |
|
Fetch all unique set names from the prints table. |
|
Query all stat-to-type/deck mappings in a single database call. |
|
Fetch all unique card types from cards. |
|
|
Fetch the ids of cards legal in a format. |
|
Query cards with dynamic SQL-based filtering. |
|
Query a single page of cards with SQL-level pagination. |
|
Fetch the distinct clans among cards matching the given filters. |
Fetch formats with their chronological |
|
|
Fetch random cards using SQL-level sampling. |
|
Fetch the set names that belong to a format's arc/era. |
Fetch min and max values for all numeric card statistics. |
|
|
Fetch card types filtered by deck type(s). |
|
Find which card types and deck types have a specific statistic. |
|
Search for cards by name or text. |