| Commit message (Collapse) | Author | Age | Files | Lines | |
|---|---|---|---|---|---|
| * | queryparse: fix NOT | 2021-07-27 | 1 | -7/+8 | |
| | | | | | | NOT queries are now two-step: the list is queries and then all elements in the cards table that are also in the query are discarded. | ||||
| * | add command line option for search | 2021-07-26 | 1 | -12/+19 | |
| | | | | | | As of right now NOT queries do not work correctly for cards with more than one tag. | ||||
| * | queryparse: remove literal set | 2021-07-26 | 1 | -15/+13 | |
| | | |||||
| * | queryparse: add function to build SQL queries | 2021-07-26 | 1 | -0/+42 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SQLite allows for UNIONs and INTERSECTIONs between SELECT statements, but it does not support grouping them. By recursively applying DeMorgan's laws, the parser can reduce the parse tree to only * Literals * NOT literals (i.e. "all items not belonging to this tag") * ANDs * ORs What SQLite /can/ do is have SELECT statements come from other SELECT statements. A query like (X & Y & Z) | (A & B & C) in pseudo-SQLite becomes SELECT * FROM ( SELECT * FROM tbl WHERE name IN X INTERSECTION SELECT * FROM tbl WHERE name IN Y INTERSECTION SELECT * FROM tbl WHERE name IN Z ) UNION SELECT * FROM ( SELECT * FROM tbl WHERE name IN A INTERSECTION SELECT * FROM tbl WHERE name IN B INTERSECTION SELECT * FROM tbl WHERE name IN C ) One future optimization would be to group all literals at a certain level with each other, so that there are less direct queries to the entire tag table. | ||||
| * | queryparse: use demorgan's laws to simplify parsed expression | 2021-07-26 | 1 | -1/+16 | |
| | | |||||
| * | queryparse: collect literals into set and return it | 2021-07-26 | 1 | -13/+15 | |
| | | |||||
| * | queryparse: fix tagglob and titleglob, fix encapsulating literals | 2021-07-26 | 1 | -9/+10 | |
| | | |||||
| * | queryparse: fix infinite recursion in '[' e1 ']' | 2021-07-26 | 1 | -1/+1 | |
| | | |||||
| * | queryparse: lift encapsulate() calls into loops to make cleaner parse trees | 2021-07-26 | 1 | -2/+2 | |
| | | |||||
| * | queryparse: fix error in returning from NOT | 2021-07-26 | 1 | -2/+2 | |
| | | |||||
| * | queryparse: fix mistaken command in AND | 2021-07-26 | 1 | -1/+1 | |
| | | |||||
| * | start query parser | 2021-07-26 | 1 | -0/+121 | |
