I’ve been working on a UI pattern that shows up a lot in business applications: filtering structured data.
Most systems solve this with visual filter builders—rows of conditions, dropdowns, nested logic, etc.
They’re flexible, but once queries get complex, they tend to become:
- slow to construct
- hard to read at a glance
- annoying to reuse or modify
So I experimented with a different approach: a lightweight query language embedded directly into the search bar.
Example:
name = 'Azure Interior' and price > 1000
Under the hood, this is parsed into a simple AST and translated into the existing backend filtering system.
Design goals
- Keep the existing UI (no replacement of filter builder)
- Add a textual DSL layer on top of structured data
- Make queries reusable and easy to share
Why not just use SQL?
Because this runs inside a constrained UI environment where end users are not expected to write full queries. It’s closer to a domain-specific mini-language than general-purpose querying.
Tradeoffs I ran into
- Text-based queries are faster and more composable
- But GUI builders are more discoverable for non-technical users
This was originally implemented inside an Odoo-based system, but the pattern itself is framework-agnostic.
Curious what others think:
- Have you seen good examples of hybrid GUI + DSL filtering systems?
- Do textual query layers actually improve UX, or just shift complexity?
- Where is the right boundary between GUI builders and query languages?
Happy to share implementation details if anyone’s interested.