Skip to main content

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

BackendFeature flagStatus
PostgreSQL / TimescaleDBpostgres✅ v0.1
MySQL / MariaDBmysql✅ v0.1
DuckDB (embedded)duckdb✅ v0.2
AWS Athenaathena📋 Planned
Google BigQuerybigquery📋 Planned

Feature flags

FeatureWhat it enablesRuntime deps
(default)Parser, AST, unit system, SQL compiler, proto typeslogos, serde, prost
postgresPostgreSQL / TimescaleDB driversqlx, tokio
mysqlMySQL / MariaDB driversqlx, tokio
duckdbDuckDB embedded driverduckdb (bundled), tokio
serverrosql CLI binary + gRPC servertonic, tokio, clap
wasmWASM exports for browser editorswasm-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 database
  • duckdb:///absolute/path/to/file.db — file-based database
  • md:my_databaseMotherDuck (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:

ProfileColumn conventionExampleDefault for
otel-postgreslowercasetrace_id, status_codePostgreSQL, MySQL
otel-clickhousePascalCaseTraceId, StatusCodeClickHouse
# 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_traces
  • otel_logs
  • otel_metrics

Optional tables for advanced features:

  • topic_messages — enables FROM topics, PATH DEVIATION, topic aliases
  • mcap_metadata — enables SHOW RECORDING