Commit graph

4 commits

Author SHA1 Message Date
Kacper
c038366783
feat: add TAGS() macro and auto-detection for multi-tag AND queries (#202)
* feat: add TAGS() macro and auto-detection for multi-tag AND queries

Introduces two complementary solutions for the common mistake of filtering
by multiple tags with AND (which always returns zero results):

1. TAGS() macro: explicit opt-in syntax
   WHERE TAGS('#project', '#active')
   → path IN (SELECT path FROM tags WHERE tag = '#project'
              INTERSECT SELECT path FROM tags WHERE tag = '#active')

2. Auto-detection: transparently rewrites the broken pattern
   WHERE tag = '#a' AND tag = '#b'
   → path IN (...INTERSECT...)
   Mixed conditions (AND name = 'test') are preserved correctly.

Both use INTERSECT subqueries which are more flexible than an EXISTS
approach (no hardcoded table reference required).

Adds disableTagAutoDetection setting so advanced users can opt out of
the transparent rewrite and handle the SQL themselves.

Docs updated in query-vault-content.md and faq/understanding-tags.md.

* chore: adding changeset
2026-04-06 12:50:00 +01:00
Kacper Kula
1973789308 chore: documentation describing issue with obsidian-sync 2025-04-09 11:37:04 +01:00
Kelly Sizer
07f729ffc5 Adding documentation for tags behavior 2025-03-18 23:19:04 -05:00
Kacper Kula
c7a319651c docs: updating docs based on feedback 2025-01-15 14:30:09 +00:00