Skip to main content
`Ctrl`+`K`

# AndQuery

class beets.dbcore.query.AndQuery(subqueries: Sequence[Query] = ())

  Bases: `MutableCollectionQuery`

  A conjunction of a list of other queries.

  __init__(subqueries: Sequence[Query] = ()) → None

  Public methods summary

  `clause`() | Generate an SQLite expression implementing the query.
  `clause_with_joiner`(joiner) | Return a clause created by joining together the clauses of all subqueries with the string joiner (padded by spaces).
  `match`(obj) | Check whether this query matches a given Model.

  Methods definition

  clause() → tuple[str | None, Sequence[str | bytes | float | int | memoryview | None]]

    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().

  match(obj: Model) → bool

    Check whether this query matches a given Model. Can be used to perform queries on arbitrary sets of Model.

  clause_with_joiner(joiner: str) → tuple[str | None, Sequence[str | bytes | float | int | memoryview | None]]

    Return a clause created by joining together the clauses of all subqueries with the string joiner (padded by spaces).

  property field_names: set[str]

    Return a set with field names that this query operates on.