Skip to main content

downloaded_sql

Function downloaded_sql 

Source
fn downloaded_sql(alias: &str, playable: &str, containers: &str) -> String
Expand description

SQL predicate: the row alias is on the device — a playable item with a completed download, or a container with a downloaded descendant.

Evaluated per row, with EXISTS, on whatever rows the query has already narrowed to. Every query used to build the set of all downloaded items in a CTE first and join against it, paying for the whole table on every call however few rows it wanted (see 08-database-design.md → “Listing query shape”). Descendants are found through all four link columns on purpose: a series is available through an episode two levels down.

TRACES: UR-002, UR-055 | DR-013, DR-082