Skip to content

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.

status = 200 and active and not archived
  • status = 200status field equals 200
  • activeactive field has a truthy value
  • not archivedarchived field is falsy (null, empty, zero, or false)
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'
  • 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=200 and status = 200 are equivalent
  • Standard operator precedencenot binds tightest, then and, then or (same as SQL, Python, JavaScript, Go): a = 1 or b = 2 and c = 3 is parsed as a = 1 or (b = 2 and c = 3)
  • Parentheses — Use ( ) to override the default precedence: (a = 1 or b = 2) and c = 3
  • Operators — Comparison, regex, list membership, pattern matching, and containment
  • Boolean Logicand, or, not, standard precedence, parenthesized grouping
  • Pattern Matching — Regex (~, !~) and like/ilike with SQL wildcards (%, _)
  • Listsin and not in with list values
  • Containmenthas and not has for 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$name and $1 placeholders resolved at runtime via bindParams()
  • 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