Expand description
DuckDB-compatible SQL export for TSDB time-series data.
Generates CREATE TABLE DDL and INSERT DML statements from TSDB metric
data so that recordings can be loaded into any SQL engine — including
DuckDB, SQLite, or PostgreSQL — without an external dependency.
§Usage
use oxirs_tsdb::analytics::sql_export::{SqlExporter, MetricSchema, DataValueType};
// Describe the schema of a metric.
let schema = MetricSchema::builder("cpu_usage")
.with_tag("host")
.with_tag("region")
.build();
// Generate SQL.
let exporter = SqlExporter::new();
let ddl = exporter.create_table_sql(&schema);
assert!(ddl.contains("CREATE TABLE"));
assert!(ddl.contains("cpu_usage"));Structs§
- Metric
Schema - Describes the SQL schema of a TSDB metric.
- Metric
Schema Builder - Fluent builder for
MetricSchema. - SqlData
Point - A single time-series point ready for SQL export.
- SqlExporter
- Generates SQL DDL and DML statements for TSDB data.
Enums§
- Data
Value Type - The SQL column type used to represent a metric’s value.