athena_rs 0.75.4

WIP Database API gateway
Documentation
//! Public HTTP API routes for Athena RS.
//!
//! This module wires REST endpoints for the router registry and query execution.
//!
//! ## Endpoints
//!
//! - `GET /router/registry` - Retrieve all Athena router registry entries

use actix_web::{Responder, get};
// use tracing::info;

pub mod cache;
pub mod gateway;
pub mod headers;
pub mod pipelines;
pub mod query;
pub mod registry;
pub mod response;
pub mod schema;
pub mod supabase;

// crate imports
use crate::data::athena_router::list_athena_router_entries;
use response::{api_ok, internal_error};

/// List Athena router registry entries.
///
/// Fetches all router entries from the Athena router registry and returns them as a JSON response.
///
/// # Returns
///
/// Returns an HTTP response containing either:
/// - Success (200): A JSON array of all router entries
/// - Error (500): An error message if the fetch operation fails
#[get("/router/registry")]
async fn athena_router_registry() -> impl Responder {
    match list_athena_router_entries().await {
        Ok(entries) => api_ok(entries),
        Err(err) => internal_error("Failed to list router entries", err),
    }
}