athena_rs 3.3.0

Database gateway API
Documentation
//! Data access helpers and Supabase clients.
//!
//! Provides functions to construct preconfigured `SupabaseClient` instances for
//! Athena and Suitsbooks projects, loaded from environment variables.
use serde::{Deserialize, Serialize};
use serde_json::Value;

pub mod admission_events;
pub mod api_keys;
pub mod api_registry;
pub mod athena_router;
pub mod calculate;
pub mod client_configs;
pub mod client_connections;
pub mod clients;
pub mod cluster;
pub mod events;
pub mod public_routes;
pub mod query_optimization;
pub mod vacuum_health;
pub mod parse {
    pub mod strip_nulls;
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DataTimeseries {
    pub data: Vec<Value>,
    pub interval: String,
    pub date_key: String,
}

impl DataTimeseries {
    /// Creates a new DataTimeseries instance
    ///
    /// # Arguments
    ///
    /// * `data` - The data to be stored in the DataTimeseries instance
    /// * `interval` - The interval of the data
    /// * `date_key` - The date key of the data
    ///
    /// # Returns
    ///
    /// A new DataTimeseries instance
    ///
    pub fn new(data: Vec<Value>, interval: String, date_key: String) -> Self {
        DataTimeseries {
            data,
            interval,
            date_key,
        }
    }
}