laminar-db 0.20.1

Unified database facade for LaminarDB
Documentation
//! Streaming connector pipeline. Each source connector runs as a tokio task
//! pushing batches via crossfire mpsc to the `StreamingCoordinator`, which
//! drives SQL execution cycles, routes results to sinks, and manages
//! checkpoint barriers. See the `streaming_coordinator` submodule for the
//! runtime topology.

pub mod callback;
pub mod config;
pub mod streaming_coordinator;

pub use callback::{PipelineCallback, SourceRegistration};
pub use config::PipelineConfig;
pub use streaming_coordinator::StreamingCoordinator;

use arrow::datatypes::SchemaRef;
use laminar_sql::parser::EmitClause;
use laminar_sql::translator::{OrderOperatorConfig, WindowOperatorConfig};

/// Control message sent from `LaminarDB` DDL handlers to the running
/// `StreamingCoordinator` for live schema changes (add/drop streams).
#[derive(Debug)]
#[allow(clippy::large_enum_variant)]
pub enum ControlMsg {
    /// Add a new streaming query to the running pipeline.
    AddStream {
        /// Stream name.
        name: String,
        /// SQL query text.
        sql: String,
        /// EMIT clause (e.g., `OnWindowClose`).
        emit_clause: Option<EmitClause>,
        /// Window configuration (tumbling, hopping, session).
        window_config: Option<WindowOperatorConfig>,
        /// ORDER BY configuration.
        order_config: Option<OrderOperatorConfig>,
    },
    /// Remove a streaming query from the running pipeline.
    DropStream {
        /// Stream name to remove.
        name: String,
    },
    /// Register a new source schema (for queries that depend on a source
    /// created after `start()`).
    AddSourceSchema {
        /// Source name.
        name: String,
        /// Arrow schema.
        schema: SchemaRef,
    },
}