Expand description
A query language over the catalog and over what the user wrote about it.
Options compose by AND and by nothing else. That is the ceiling no number of
new flags ever raises: there is no --genre metal OR --genre jazz, no
“everything except this label”, no “between 1990 and 1999”. A grammar has
all three for free, and having one is what turns a saved query into a smart
collection — which, since a selection is already what --csv, --m3u and
M3’s queue consume, is playable the day it is written.
genre:metal year:1990..1999 rating:>=4 -label:earache
(artist:ozzy OR artist:dio) loved
album.rating:5 played:0
work:"War Pigs" instrument:guitar
guest:"Zakk Wylde" with:"Ozzy Osbourne"It is an interface, not a storage engine. Defined on its own it works today over the vectors in memory and tomorrow over SQL. Defined as “whatever the database makes easy” it would arrive late and shaped by the wrong concerns.
Everything evaluates against a track, because a track is the finest grain and every coarser answer is a fold of it: the albums matching a query are the albums of the tracks matching it. One evaluator, not five.
Modules§
- browse
- Versioned dynamic browsing collections; audio and catalog identities remain unchanged.
Structs§
- Context
- Everything needed to answer, gathered once rather than per track.
- Query
Error - Why a query could not be read.
- Sort
- How a result is ordered.
- Term
- One condition: a field, and what it is being asked.
Enums§
- Compare
- How two numbers are compared.
- Field
- Which value of a track a term reads.
- Query
- A parsed query, ready to be run against any catalog.
- Scope
- Which entity an opinion was written on.
- SortKey
- What a result can be ordered on.
- Test
- What a term asks of a value.
Functions§
- asks_
about_ the_ track_ itself truewhen the expression asks about something the user wrote, at the track’s own scope — the case whererescopedhas anything to offer.- field_
names - The field names, for a help message or a completion.
- matches
- Whether one track satisfies a query.
- parse
- Reads a query, rejecting incomplete operators and invalid numeric bounds.
- rescoped
- The same question, asked of the album or the artist instead of the track.
- run
- The tracks a query matches, in catalog order.
- sort
- Puts a result in order.
- sort_
key_ names - The sort keys, for a help message.
- unknown_
values - Values a query names that the library has never heard of.