Driver Support
ROSQL compiles to SQL and other database languages and executes against your existing telemetry database. Each backend is enabled via a Cargo feature flag.
Supported backends
| Backend | Feature flag | Status |
|---|---|---|
| PostgreSQL / TimescaleDB | postgres | ✅ v0.1 |
| MySQL / MariaDB | mysql | ✅ v0.1 |
| DuckDB (embedded) | duckdb | ✅ v0.2 |
| AWS Athena | athena | 📋 Planned |
| Google BigQuery | bigquery | 📋 Planned |
Feature flags
| Feature | What it enables | Runtime deps |
|---|---|---|
| (default) | Parser, AST, unit system, SQL compiler, proto types | logos, serde, prost |
postgres | PostgreSQL / TimescaleDB driver | sqlx, tokio |
mysql | MySQL / MariaDB driver | sqlx, tokio |
duckdb | DuckDB embedded driver | duckdb (bundled), tokio |
server | rosql CLI binary + gRPC server | tonic, tokio, clap |
wasm | WASM exports for browser editors | wasm-bindgen |
Installing with a specific backend
# PostgreSQL driver + CLI
cargo install rosql --features server,postgres
# MySQL driver + CLI
cargo install rosql --features server,mysql
# DuckDB driver + CLI (no external database required)
cargo install rosql --features server,duckdb
# Multiple drivers
cargo install rosql --features server,postgres,mysql,duckdb
# Library only (no CLI, no runtime)
cargo add rosql
Connection strings
PostgreSQL / TimescaleDB
rosql query "FROM traces WHERE status = 'ERROR'" \
--backend postgres \
--url postgresql://user:pass@localhost:5432/telemetry
Connection string format: postgresql://[user[:password]@][host][:port]/database
TimescaleDB is fully supported — ROSQL uses standard PostgreSQL queries that work transparently with hypertables.
MySQL / MariaDB
rosql query "FROM traces WHERE status = 'ERROR'" \
--backend mysql \
--url mysql://user:pass@localhost:3306/telemetry
Connection string format: mysql://[user[:password]@][host][:port]/database
DuckDB
DuckDB runs embedded — no external server required. The database is compiled into the binary.
# In-memory database (data is lost when the process exits)
rosql query "FROM traces WHERE status = 'ERROR'" \
--backend duckdb \
--url duckdb://
# File-based persistent database
rosql query "FROM traces WHERE status = 'ERROR'" \
--backend duckdb \
--url duckdb:///path/to/telemetry.db
Connection string formats:
duckdb://— in-memory databaseduckdb:///absolute/path/to/file.db— file-based databasemd:my_database— MotherDuck (cloud DuckDB)
DuckDB is particularly useful for:
- Local analytics on MCAP/bag files converted to Parquet
- CI/testing — no Docker or external service required
- Offline environments where a database server is unavailable
- Embedded robotics systems with local telemetry storage
Schema profiles
Different OTel Collector exporters use different column naming conventions. Select the profile matching your exporter:
| Profile | Column convention | Example | Default for |
|---|---|---|---|
otel-postgres | lowercase | trace_id, status_code | PostgreSQL, MySQL |
otel-clickhouse | PascalCase | TraceId, StatusCode | ClickHouse |
# Explicit schema profile
rosql compile "FROM traces WHERE status = 'ERROR'" \
--backend postgres \
--schema otel-postgres
rosql compile "FROM traces WHERE status = 'ERROR'" \
--backend clickhouse \
--schema otel-clickhouse
If your column names don't match either profile, custom schema profiles are tracked in #22.
Schema requirements
Your database must have the OTel tables ROSQL expects. See the Schema Reference → for complete DDL.
Required tables for basic functionality:
otel_tracesotel_logsotel_metrics
Optional tables for advanced features:
topic_messages— enablesFROM topics,PATH DEVIATION, topic aliasesmcap_metadata— enablesSHOW RECORDING