memos/plugin
Johnny cbf46a2988 feat(filter): add CEL list comprehension support for tag filtering
Add support for CEL exists() comprehension with startsWith, endsWith, and
contains predicates to enable powerful tag filtering patterns.

Features:
- tags.exists(t, t.startsWith("prefix")) - Match tags by prefix
- tags.exists(t, t.endsWith("suffix")) - Match tags by suffix
- tags.exists(t, t.contains("substring")) - Match tags by substring
- Negation: !tags.exists(...) to exclude matching tags
- Works with all operators (AND, OR, NOT) and other filters

Implementation:
- Added ListComprehensionCondition IR type for comprehension expressions
- Parser detects exists() macro and extracts predicates
- Renderer generates optimized SQL for SQLite, MySQL, PostgreSQL
- Proper NULL/empty array handling across all database dialects
- Helper functions reduce code duplication

Design decisions:
- Only exists() supported (all() rejected at parse time with clear error)
- Only simple predicates (matches() excluded to avoid regex complexity)
- Fail-fast validation with helpful error messages

Tests:
- Comprehensive test suite covering all predicates and edge cases
- Tests for NULL/empty arrays, combined filters, negation
- Real-world use case test for Issue #5480 (archive workflow)
- All tests pass on SQLite, MySQL, PostgreSQL

Closes #5480
2026-01-17 12:36:39 +08:00
..
cron chore: fix some typos in comments (#5332) 2025-12-11 07:50:16 +08:00
email refactor(db): rename tables for clarity - resource→attachment, system_setting→instance_setting 2026-01-06 23:36:42 +08:00
filter feat(filter): add CEL list comprehension support for tag filtering 2026-01-17 12:36:39 +08:00
httpgetter refactor: attachment service part2 2025-06-18 00:09:19 +08:00
idp chore: simplify attachment file writing 2025-12-31 21:54:37 +08:00
markdown fix(markdown): fix UTF-8 truncation for CJK characters in snippet generation 2025-11-26 07:34:28 +08:00
scheduler chore: simplify attachment file writing 2025-12-31 21:54:37 +08:00
storage/s3 perf: optimize memory usage for statistics and image processing 2025-12-30 00:06:23 +08:00
webhook chore: simplify attachment file writing 2025-12-31 21:54:37 +08:00