FlexQL takes untrusted filter strings through a Validation → Lexer → Parser → AST → Adapter pipeline and emits injection-safe queries for SQL, Sequelize, MongoDB, and Prisma.
Most query helpers evaluate filter logic at runtime. FlexQL compiles it — the distinction matters deeply for safety, portability, and predictability.
Reads the filter string and directly executes it against data. Runtime and logic are coupled — you can't separate "what" from "how".
Transforms the filter string into a backend-specific query structure. Input is never executed — it's compiled.
Every query passes through a deterministic, layered compilation pipeline. No step is skipped, no raw input reaches any backend.
See how the same FlexQL expression compiles to SQL and Sequelize — both injection-safe and ready to use directly in your codebase.
FlexQL's syntax is intentionally compact. Every token has a defined role in the compilation pipeline.
| Element | Role in Pipeline | Examples | Notes |
|---|---|---|---|
| Identifier | Field name — becomes IDENTIFIER token in lexer | username, age, created_at |
No spaces allowed |
| Operator | Comparison — mapped per adapter in output | == != > < >= <= |
All 6 supported |
| ; | AND separator — higher precedence | name==x;age>18 |
Default, configurable |
| , | OR separator — lower precedence | status==a,status==b |
Default, configurable |
| Value | Literal — always bound as a parameter, never concatenated | "heja", 18, true, 2025-01-01 |
String, number, boolean, date |
; for AND and , for OR. Both are configurable.
The core compiler pipeline ships production-ready. The roadmap expands adapter coverage and adds NLP-powered natural language querying.
A real query compiler for modern APIs. Safe, portable, and extensible by design.