FlyQL
A lightweight, injection-proof query language that parses human-readable filter expressions into a portable AST, transpiles to SQL across ClickHouse, PostgreSQL, and StarRocks, and evaluates in-memory.
Installation
pip install flyql
Requires Python 3.10+.
Quick Start
Parse a query
from flyql import parse
result = parse("status = 200 and active")
print(result.root)
Generate SQL
from flyql import parse
from flyql.generators.clickhouse.generator import to_sql_where
from flyql.generators.clickhouse.column import Column
result = parse("status >= 400 and host like 'prod%'")
columns = {
"status": Column("status", "UInt32"),
"host": Column("host", "String"),
}
sql = to_sql_where(result.root, columns)
print(sql)
Generators are available for ClickHouse, PostgreSQL, and StarRocks:
from flyql.generators.clickhouse.generator import to_sql_where
from flyql.generators.postgresql.generator import to_sql_where
from flyql.generators.starrocks.generator import to_sql_where
Match in-memory data
from flyql import parse
from flyql.matcher import Evaluator, Record
result = parse("status = 200 and active")
data = {
"status": 200,
"active": True,
"host": "prod-api-01",
}
evaluator = Evaluator()
matches = evaluator.evaluate(result.root, Record(data))
print(f"Matches: {matches}") # True
Transformers
from flyql import parse
from flyql.generators.clickhouse.generator import to_sql_where
from flyql.generators.clickhouse.column import Column
result = parse("message|upper = 'ERROR'")
columns = {"message": Column("message", "String")}
sql = to_sql_where(result.root, columns)
print(sql) # equals(upper(message), 'ERROR')
Column parsing
from flyql.columns import parse, parse_to_json
parsed = parse("message, status")
for col in parsed:
print(f"{col.name} (display: {col.display_name!r}, segments: {col.segments})")
# Enable transformers
with_transforms = parse(
"message|chars(25) as msg, status", capabilities={"transformers": True}
)
# Serialize to JSON
json_str = parse_to_json("message, status|upper", capabilities={"transformers": True})
print(json_str)
Query Syntax
Queries consist of conditions connected by boolean operators (and, or, not):
status=200 and active and not archived
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']
Operators
| Operator | Syntax |
|---|---|
| Equals | = |
| Not equals | != |
| Regex match | ~ |
| Not regex match | !~ |
| Greater than | > |
| Less than | < |
| Greater or equals | >= |
| Less or equals | <= |
| In list | in |
| Not in list | not in |
| Like | like |
| Not like | not like |
| Case-insensitive like | ilike |
| Case-insensitive not like | not ilike |
Documentation
Full documentation: docs.flyql.dev
License
MIT
Metadata
Release files for flyql 1.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flyql-1.4.0.tar.gz | 154.7 kB | With provenance | Details for flyql-1.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flyql-1.4.0-py3-none-any.whl | Python 3 | none | any | Details for flyql-1.4.0-py3-none-any.whl |
Total release size: 285.3 kB
Release files / flyql-1.4.0.tar.gz
| Download URL | flyql-1.4.0.tar.gz |
|---|---|
| Size | 154.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8e92d4ef0d96f85023fa7c4c5f24b5a665758e0a5c015e11004fec9be3bff5f
|
|
BLAKE2b-256 checksum How to use checksums |
3ba7b462bc36ff193e105b783e12168cdea2b323bf4c2c71eeced8b8a4d158ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency logRelease files / flyql-1.4.0-py3-none-any.whl
| Download URL | flyql-1.4.0-py3-none-any.whl |
|---|---|
| Size | 130.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dc6fba722b39e18a10665c999aa65a52caa8f7a2b6a260c90391e1ae6495f690
|
|
BLAKE2b-256 checksum How to use checksums |
93167d1964f24b72eaf6cc7fac1478b1fd4ca6de2e5301064b98e6c427c8019a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency logSecurity for flyql 1.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for flyql-1.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.