Query#
- class beets.dbcore.query.Query#
Bases:
ABCAn abstract class representing a query into the database.
- __init__()#
Public methods summary
clause()Generate an SQLite expression implementing the query.
match(obj)Check whether this query matches a given Model.
Methods definition
- abstractmethod clause() tuple[str | None, Sequence[Any]]#
Generate an SQLite expression implementing the query.
Return (clause, subvals) where clause is a valid sqlite WHERE clause implementing the query and subvals is a list of items to be substituted for ?s in the clause.
The default implementation returns None, falling back to a slow query using match().
- property field_names: set[str]#
Return a set with field names that this query operates on.
- abstractmethod match(obj: Model)#
Check whether this query matches a given Model. Can be used to perform queries on arbitrary sets of Model.