Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/slad3/filtertablequerylanguage
A simple easy to learn and remember language used to filter down a table of data within a simple string
https://github.com/slad3/filtertablequerylanguage
query-language rust tables wasm wasm-bindgen
Last synced: 9 days ago
JSON representation
A simple easy to learn and remember language used to filter down a table of data within a simple string
- Host: GitHub
- URL: https://github.com/slad3/filtertablequerylanguage
- Owner: Slad3
- License: mit
- Created: 2024-09-25T09:04:13.000Z (about 1 month ago)
- Default Branch: master
- Last Pushed: 2024-10-29T06:10:59.000Z (10 days ago)
- Last Synced: 2024-10-29T07:19:10.520Z (10 days ago)
- Topics: query-language, rust, tables, wasm, wasm-bindgen
- Language: Rust
- Homepage:
- Size: 574 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FiTL (Filter Table (Query) Language)
### Pronounced like "Fiddle"
A simple easy to learn and remember language used to filter down a table of data within a simple string. Easy to implement, easy to write, but also easy to specify and detail.
## How does it differ from SQL?
- Designed specifically to write quickly in the moment
- Filters single tables only (no joining tables or referencing other tables)
- Super easy for non-programmer people to learn, though deep enough to master and create complex and detailed queries
- Easy to quickly write within a text box, even on mobile (looking at you regex)## Real World Examples of Where This Would Be Implemented
- Spotify Playlist/Liked Songs Search Box
- Query example: ```artist = Outkast & album != Idlewild```
- Product search pages
- Query example ```brand != Apple & (ram = 32GB | resolution = "2560x1440")```## Writing queries
### For programmers: writing queries is similar to writing boolean conditionals
### For people who touch grass:
The simplest query is based on the base operation schema:
```
```For example
```
artist = Prince
```From a data table (for example a song playlist), will only return the rows where the `artist`() is equal to
`Prince`This can be expanded upon with a boolean operator to combine operations
```
artist = Prince & title = "When Doves Cry"
```You can inverse this filter by an exclamation point (parentheses are recommended, but not required)
```
!(artist = Prince & title = "When Doves Cry")
```Like in PEMDAS, Operations are executed from left to right. Parentheses, like in math, will prioritize operations in a
specified order.```
album = 1999 | (artist = Prince & title = "When Doves Cry")
```Also on the topic of word odering: no, Yodaing is not allowed
```
Prince = artist // Will not work
```A somewhat extreme example:
```
artist ^= 2Pac | artist =: pac | artist = Makaveli & (album =: theory or title =: "Ain't Hard 2 Find")
```## Symbols Dictionary
T -> Generic Symbol (For below chart purposes only)
\ -> inputted value
| 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 of characters/strings based on ASCII value of characters |
| morethan | \> | "greater than" comparison of numbers or of characters/strings based on ASCII value of characters |
| lessthanequals | <= | "Less than or equals" comparison of numbers or of characters/strings based on ASCII value of characters |
| morethan | \>= | "greater than or equals" comparison of numbers or of characters/strings based on ASCII value of characters |
| or | \| | Or boolean operation |
| and | & | And boolean operation |
| *Parenthesis* | () | Prioritizes statements inside parenthesis |
| *NA* | "" | 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 |