Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/skade

skade-flight/src/lib.rs

//! skade-flight — skade REMOTE. Apache Arrow Flight SQL over a skade Iceberg
//! warehouse: DataFusion SQL in, streamed Arrow out. The door Power BI, the
//! Flight SQL ODBC driver, ADBC and DataFusion clients connect to.
//!
//! - [`engine::Engine`] — the ONE long-lived DataFusion session (lock-free
//!   reads, timed refresh, streaming execution).
//! - [`service::SkadeFlightService`] — the `FlightSqlService` impl.
//! - [`sqlinfo`] — the generated `GetSqlInfo` / `GetXdbcTypeInfo` tables.
//! - [`auth::Auth`] — Basic → bearer handshake over the nordisk token ladder.
//! - [`server::serve`] — bind and run.
//!
//! Library consumers (korp) build an [`Engine`] over their warehouse and add
//! [`SkadeFlightService`] to their own tonic router; the `skade-flight` binary
//! is the standalone service with its skidbladnir lifecycle door.

pub mod auth;
pub mod columns;
pub mod dataroot;
pub mod encode;
pub mod engine;
pub mod error;
pub mod keys;
pub mod namespaces;
pub mod odbc;
pub mod server;
pub mod service;
pub mod sqlinfo;
pub mod ticket;
pub mod time_literal;
pub mod views;

pub use auth::Auth;
pub use engine::{CATALOG, Engine, PlanCounts, Planned, Statement, TableRef};
pub use error::{Error, Result};
pub use server::{ServeOptions, serve, serve_on};
pub use service::SkadeFlightService;

// Re-exports so a consumer's arrow/datafusion are ours (one arrow major).
pub use arrow_array;
pub use arrow_flight;
pub use arrow_schema;
pub use datafusion;
pub use skade;

/// **Introspection / emit marker** — record one functional-status row for the
/// nornir test matrix. Wraps `nornir_testmatrix::functional_status` behind the
/// `testmatrix` feature (a compiled-out `#[inline]` no-op otherwise). The
/// Flight SQL handlers and the datatype matrix call this so
/// `cargo test --features testmatrix` SEES each surface's health.
#[inline]
pub fn functional_status(component: &str, check: &str, ok: bool, detail: &str) {
    #[cfg(feature = "testmatrix")]
    nornir_testmatrix::functional_status(component, check, ok, detail);
    #[cfg(not(feature = "testmatrix"))]
    {
        let _ = (component, check, ok, detail);
    }
}

/// Drain the rows recorded so far (empty without the `testmatrix` feature).
#[cfg(feature = "testmatrix")]
pub fn drain_functional_rows() -> Vec<nornir_testmatrix::TestResultRow> {
    nornir_testmatrix::drain_functional_rows()
}