Syntax Overview
FlyQL queries consist of one or more conditions joined by and / or, optionally negated with not. Each condition is either a comparison or a truthy check.
Basic Query Structure
Section titled “Basic Query Structure”status = 200 and active and not archived
status = 200—statusfield equals200active—activefield has a truthy valuenot archived—archivedfield is falsy (null, empty, zero, or false)
More Examples
Section titled “More Examples”service != 'api' or user = "john doe"
message ~ "error.*" and not debug
(a = 1 or b = 2) and not (c = 3 and d = 4)
status in [200, 201] and method not in ['DELETE', 'PUT']
message has 'error' and tags not has 'debug'
General Rules
Section titled “General Rules”- Standalone keys — A key without an operator is treated as a truthy check:
active - Comparisons — A key with an operator must have a corresponding value:
status = 200 - Whitespace — Spaces around operators are optional:
status=200andstatus = 200are equivalent - Standard operator precedence —
notbinds tightest, thenand, thenor(same as SQL, Python, JavaScript, Go):a = 1 or b = 2 and c = 3is parsed asa = 1 or (b = 2 and c = 3) - Parentheses — Use
( )to override the default precedence:(a = 1 or b = 2) and c = 3
Syntax Sections
Section titled “Syntax Sections”- Operators — Comparison, regex, list membership, pattern matching, and containment
- Boolean Logic —
and,or,not, standard precedence, parenthesized grouping - Pattern Matching — Regex (
~,!~) andlike/ilikewith SQL wildcards (%,_) - Lists —
inandnot inwith list values - Containment —
hasandnot hasfor substring, key existence, and item membership - Values & Expressions — Truthy/falsy, strings, numbers, booleans, null, columns, arrays, temporal functions
- Nested Keys — Dot-separated paths and quoted key segments
- Parameters —
$nameand$1placeholders resolved at runtime viabindParams() - Reserved Words — Using keyword-named columns (
not,has,in, etc.) and when quoting is needed - Dates — String-literal date comparisons and when to reach for temporal functions instead
- Query Recipes — Common query patterns with full parse → generate → run examples in Python, Go, and JavaScript