query

module of dascore.io.index source

Query model and SQL generation for the spool index.

Implements the selector semantics spec (see .scratch/selector_semantics_spec.md): the index only produces candidates — predicates the summary cannot evaluate exactly are the caller’s responsibility at patch-load time. Predicates SQLite cannot evaluate exactly are applied as pandas residual filters.

Functions

Name Description
apply_residuals Apply regex residual filters to the flat relation.
build_attr_clause Add SQL for one attr predicate; return a residual pattern if the
build_coord_clause Add a patch_coords/coord_defs semi-join clause for one coord
build_sql Build SQL for one or more AND-composed queries.
evaluate_attr_predicate Evaluate one attr selector against values held in memory.
glob_to_regex Translate a glob to the regex which matches what SQLite’s GLOB does.
resolve_query Resolve bare kwargs into a Query: attrs first, then coords.

Classes

Name Description
Query A resolved spool query.