netsky 0.1.6

netsky CLI: the viable system launcher and subcommand dispatcher
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! DataFusion SQL over netsky observability tables.

use netsky_db::Db;

pub fn run(sql: &str) -> netsky_core::Result<()> {
    let db = Db::open().map_err(|e| netsky_core::anyhow!("open netsky-db: {e}"))?;
    db.migrate()
        .map_err(|e| netsky_core::anyhow!("migrate netsky-db: {e}"))?;
    let output = db
        .query(sql)
        .map_err(|e| netsky_core::anyhow!("query netsky-db: {e}"))?;
    println!("{output}");
    Ok(())
}