Quick guide to writing FiTL queries
Simple Queries
At it's very root, FiTL filters down rows based on columns and conditional statements for described columns.
Base form of a query can be described as:
*column name* *operatorion* *comparison value*
For example
artist = JDilla
Which in a playlist, returns a table where in all the rows the "artist" column is equal to "JDilla"
You can inverse this statement by an "!", like:
artist != JDilla
or:
! artist = JDilla
Which filters out all the songs from a playlist where the "artist" column is equal to JDilla (idk why anyone would want to do that)
Other common comparison values
Naturally comparisons are case case-insensitive. To make them case sensitive, add a "^" in front of the operation (but not before the negate value "!")
artist ^= JDilla
For a more rough estimate in string matching, you can do one of either two operations.
The one that you'll probably be using the most often is the "contains" operation: "=:" which instead of checking for exact matches like the "=" operation, checks to see if the column in that specific row contains the comparitive value like such:
artist =: dilla
Tip: the colon is on the side of the smaller side
The inverse of this is the "isin" operation: ":=". This checks to see if the comparison value contains the column value like such:
artist := "JDilla and Slumvillage"
Combining Queries together
You can combine multiple queries together with either a "&" (and) or an "|" (or) symble
The "&" symbole is an "and" operation, meaning that both statements on each side of the "&" must be true in order for the query to pass for that row. For example:
artist = "Michael Giacchino" & album =: soundtrack
The above statement only returns rows where the artist name is "Michael Giacchino" AND the album title contains the word "soundtrack" in it.
The "|" symbol is an "or" operation, meaning only one statement on each side of the "|" symbol have to be true in order for the query to pass for that row. For example:
artist = "black thought" | artist =: roots
The above statement returns rows where the artist is equal to "black thought" or the artist contains the string "roots" so we can filter through a playlist and get all of Black Thoughts solo catalog and also his catalog with The Roots.
If you're really advanced (or you don't touch grass), you can get really specific and add parenthesis to your queries, which work exactly like they do in math
(artist = "black thought" & album = "Streams of Thought Vol. 1") | artist =: roots
This query returns any Roots song, or if it's a Black Thought song the album is only "Streams of Thought Vol. 1".
Add as many and nest as many parenthesis as you want. Get crazy with it, I won't care but the compiler might yell at you.
((((((((((artist = "black thought" & album = "Streams of Thought Vol. 1")))))) | (((artist =: roots)))))
Symbol Table
Word | Symbol | Description |
---|---|---|
not | !T | Negates Operation |
is / equals | = | Exact match |
contains | =: | Left contains right (Nickolas Picklous =: Nick) |
isin | := | Right contains left (Nick := Nickolas Picklous) |
lessthan | < | "Less than" comparison of numbers or characters based on ASCII value of characters |
morethan | > | "Greater than" comparison of numbers or characters based on ASCII value of characters |
lessthanequals | <= | "Less than or equals" comparison of numbers or characters based on ASCII value of characters |
morethanequals | >= | "Greater than or equals" comparison of numbers or characters based on ASCII value of characters |
or | | | Or boolean operation |
and | & | And boolean operation |
Parenthesis | () | Prioritizes statements inside parenthesis |
NA | "<value>" | Combines multiple words into single string. Necessary for multi-worded tokens, optional for single-worded tokens |
NA | ^T | Makes statement case-sensitive; queries are case-insensitive by default |