gluex-ccdb

Crates.iogluex-ccdb
lib.rsgluex-ccdb
version0.1.3
created_at2025-12-14 22:10:26.281209+00
updated_at2026-01-22 18:32:42.939405+00
descriptionA Rust interface to the GlueX Calibration and Conditions Database (CCDB)
homepagehttps://github.com/denehoffman/gluex-rs
repositoryhttps://github.com/denehoffman/gluex-rs
max_upload_size
id1985183
size123,145
Nathaniel D. Hoffman (denehoffman)

documentation

https://docs.rs/gluex-ccdb

README

gluex-ccdb

Typed Rust bindings for the GlueX Calibration and Conditions Database (CCDB). The library performs read-only queries against SQLite snapshots, caches table metadata, and exposes ergonomic accessors for run-dependent payloads.

Installation

cargo add gluex-ccdb

Example

use gluex_ccdb::prelude::*;

fn main() -> CCDBResult<()> {
    let ccdb = CCDB::open("/path/to/ccdb.sqlite")?;
    let ctx = Context::default().with_run_range(55_000..=55_010);
    let tables = ccdb.fetch("/PHOTON_BEAM/pair_spectrometer/lumi/trig_live", &ctx)?;

    for (run, dataset) in tables {
        if let Some(livetime) = dataset.double(1, 0) {
            println!("run {run}: livetime = {livetime:.3}");
        }
    }
    Ok(())
}

License

Dual-licensed under Apache-2.0 or MIT.

Commit count: 77

cargo fmt