Commit a535ed1
feat: implement query language (#606)
* add files
* fix: term was parsing ANDList instead of ORList
* make mypy happy
* ruff format
* add missing todo
* add more constraint types
* add parent property to AST
* add BaseVisitor class
* make mypy happy
* add __init__.py
* Revert "make mypy happy"
This reverts commit 926d0dd.
* refactoring and fixes
* rudimentary search field integration
* fix: check for None properly
* fix: Entries without Tags are now searchable
* make mypy happy
* Revert "fix: Entries without Tags are now searchable"
This reverts commit 19b40af.
* fix: changed joins to outerjoins and added missing outerjoin
* use query lang instead of tag_id FIlterState
* add todos
* fix: remove uncecessary line that broke search when searching for exact name
* fix tag search
* refactoring
* fix: path now uses GLOB operator for proper GLOBs
* refactoring: remove FilterState.id and implement Library.get_entry_full as replacement
* fix: use default value notation instead of if None statement in __post_init__
* remove obsolete Search Mode UI and related code
* ruff fixes
* remove obsolete tests
* fix: item_thumb didn't query entries correctly
* fix: search_library now correctly returns the number of *unique* entries
* make mypy happy
* implement NOT
* remove obsolete filename search
* remove summary as it is not applicable anymore
* finish refactoring of FilterState
* implement special:untagged
* fix: make mypy happy
* Revert changes to search_tags in favor of changes from #604
* fix: also port test changes
* fix: remove unneccessary import
* fix: remove unused dataclass
* fix: AND now works correctly with tags
* simplify structure of parsed AST
* add performance logging
* perf: Improve performance of search by reducing number of required joins from 4 to 1
* perf: double NOT is now optimized out of the AST
* fix: bug where pages would show less than the configured number of entries
* Revert "add performance logging"
This reverts commit c3c7d75.
* fix: tag_id search was broken
* somewhat adapt the existing autocompletion to this PR
* perf: Use Relational Division Queries to improve Query Execution Time
* fix: raise Exception so as to not fail silently
* fix: Parser bug broke parentheses
* little bit of clean up
* remove unnecessary comment
* add library for testing search
* feat: add basic tests
* fix: and queries containing just one tag were broken
* chore: remove debug code
* feat: more tests
* refactor: more consistent name for variable
Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>
* fix: ruff check complaint over double import
---------
Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>1 parent 056e600 commit a535ed1
File tree
51 files changed
+831
-277
lines changed- tagstudio
- src
- core
- library/alchemy
- query_lang
- utils
- qt
- widgets
- tests
- fixtures/search_library
- .TagStudio
- comp colors shapes
- inherit colors shapes
- macros
- qt
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
51 files changed
+831
-277
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
5 | 8 | | |
6 | 9 | | |
7 | 10 | | |
| |||
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | 56 | | |
61 | 57 | | |
62 | 58 | | |
| |||
68 | 64 | | |
69 | 65 | | |
70 | 66 | | |
71 | | - | |
72 | | - | |
73 | | - | |
| 67 | + | |
| 68 | + | |
74 | 69 | | |
75 | 70 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
| 71 | + | |
| 72 | + | |
136 | 73 | | |
137 | 74 | | |
138 | 75 | | |
| |||
142 | 79 | | |
143 | 80 | | |
144 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
145 | 113 | | |
146 | 114 | | |
147 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| |||
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
45 | | - | |
46 | 44 | | |
47 | 45 | | |
48 | 46 | | |
| |||
54 | 52 | | |
55 | 53 | | |
56 | 54 | | |
| 55 | + | |
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
| |||
402 | 401 | | |
403 | 402 | | |
404 | 403 | | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
405 | 427 | | |
406 | 428 | | |
407 | 429 | | |
| |||
518 | 540 | | |
519 | 541 | | |
520 | 542 | | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
568 | 546 | | |
569 | 547 | | |
570 | 548 | | |
571 | 549 | | |
572 | 550 | | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
578 | 555 | | |
579 | 556 | | |
580 | 557 | | |
| |||
584 | 561 | | |
585 | 562 | | |
586 | 563 | | |
| 564 | + | |
| 565 | + | |
587 | 566 | | |
588 | 567 | | |
589 | 568 | | |
| |||
597 | 576 | | |
598 | 577 | | |
599 | 578 | | |
600 | | - | |
| 579 | + | |
601 | 580 | | |
602 | 581 | | |
603 | 582 | | |
| |||
0 commit comments