iridium-db 0.2.0

A high-performance vector-graph hybrid storage and indexing engine
use super::*;
use crate::features::query::{parse, validate, Catalog};
use crate::features::storage::api as storage_api;
use std::path::PathBuf;
use std::sync::{Mutex, OnceLock};

fn temp_dir(prefix: &str) -> PathBuf {
    let mut dir = std::env::temp_dir();
    let stamp = format!(
        "{}_{}_{}",
        prefix,
        std::process::id(),
        std::time::SystemTime::now()
            .duration_since(std::time::UNIX_EPOCH)
            .unwrap()
            .as_nanos()
    );
    dir.push(stamp);
    std::fs::create_dir_all(&dir).expect("create temp dir");
    dir
}

fn encode_vector_payload(values: &[f32]) -> Vec<u8> {
    storage_api::encode_vector_payload_f32(1, storage_api::VectorMetric::Cosine, values, false)
}

fn planner_test_lock() -> &'static Mutex<()> {
    static LOCK: OnceLock<Mutex<()>> = OnceLock::new();
    LOCK.get_or_init(|| Mutex::new(()))
}

mod execute_paths;
mod fanout;
mod planning;
mod plexus_conformance;
mod plexus_paths;
mod vector_paths;