Skip to main content

Crate laminar_db

Crate laminar_db 

Source
Expand description

Unified database facade for LaminarDB.

Provides a single entry point (LaminarDB) that ties together the SQL parser, query planner, DataFusion context, and streaming API.

§Example

use laminar_db::LaminarDB;

let db = LaminarDB::open()?;

db.execute("CREATE SOURCE trades (
    symbol VARCHAR, price DOUBLE, ts TIMESTAMP,
    WATERMARK FOR ts AS ts - INTERVAL '1' SECOND
)").await?;

let query = db.execute("SELECT symbol, AVG(price)
    FROM trades GROUP BY symbol, TUMBLE(ts, INTERVAL '1' MINUTE)
").await?;

Re-exports§

pub use engine_metrics::EngineMetrics;
pub use profile::Profile;
pub use profile::ProfileError;
pub use recovery_manager::RecoveredState;
pub use recovery_manager::RecoveryManager;
pub use subscription::ClusterSubscriptionError;

Modules§

ai
AI inference module, containing model registry, provider trait, and backends. Backend-agnostic AI inference types: registry, provider trait, cache, call log, adapters, and backends. Inference runs on a Ring 1 worker, never Ring 0.
api
FFI-friendly API for language bindings.
checkpoint_timing
Bounded process-local evidence for cluster checkpoint barrier pauses. Bounded process-local evidence for cluster checkpoint barrier pauses.
engine_metrics
Prometheus metrics for the streaming engine. Prometheus metrics for the streaming engine.
ffi
C FFI layer for LaminarDB.
pipeline
Thread-per-core connector pipeline. 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.
profile
Deployment profiles. Deployment profiles for LaminarDB.
rebalance
Dynamic vnode rebalance control plane. Dynamic vnode rebalance control plane.
recovery_manager
Unified recovery manager. Exact-cut recovery from committed v10 checkpoint manifests.
subscription
External named-subscription substrate: byte-bounded shared logs and cursor portals. SUBSCRIBE substrate: one shared byte-bounded log per object and cursor portals.

Structs§

ArrowRecord
Record type for Arrow-based streaming subscriptions.
CheckpointResult
CheckpointStats
ConfigKeySpec
Re-export connector metadata types for the control-plane HTTP API (connector catalog / source-creation wizard). Specification for a configuration key.
ConnectorInfo
Re-export connector metadata types for the control-plane HTTP API (connector catalog / source-creation wizard). Metadata about a connector implementation.
ConnectorRegistry
Re-export the connector registry for custom connector registration. Registry of available connector implementations. Connectors register a factory per type string; the runtime resolves the connector named by FROM in CREATE SOURCE or INTO in CREATE SINK.
DdlInfo
Information about a completed DDL statement.
LaminarConfig
Configuration for a LaminarDB instance.
LaminarDB
The main LaminarDB database handle.
LaminarDbBuilder
Fluent builder for constructing a LaminarDB instance.
MaterializedViewInfo
JSON-serializable projection of a MaterializedView for the control-plane HTTP API.
PipelineEdge
A directed edge in the pipeline topology graph.
PipelineMetrics
Pipeline-wide metrics snapshot.
PipelineNode
A node in the pipeline topology graph.
PipelineTopology
The complete pipeline topology: nodes and edges.
QueryHandle
Handle to a running streaming query.
QueryInfo
Information about a running query.
RestartPolicy
Auto-restart policy for the fault supervisor (see LaminarDB::enable_supervision).
SinkInfo
Information about a registered sink.
SnapshotAdoption
Cluster assignment lifecycle results. Summary of a single LaminarDB::adopt_assignment_snapshot call.
SourceCatalog
Central registry of sources, sinks, streams, and queries.
SourceEntry
A registered source in the catalog.
SourceHandle
Typed handle for pushing data into a registered source.
SourceInfo
Information about a registered source.
SourceMetrics
Metrics for a single registered source.
StreamInfo
Metadata about a registered stream.
StreamMetrics
Metrics for a single registered stream.
TypedSubscription
Typed subscription that deserializes named-stream RecordBatch rows.
TypedSubscriptionEnvelope
Typed compatibility frame plus optional durable cluster partition metadata.
UntypedSourceHandle
Untyped handle for pushing raw RecordBatch data.

Enums§

BackpressurePolicy
What to do when an operator’s input buffer exceeds its cap.
CheckpointFailureDisposition
CheckpointPhase
ClusterStartupDisposition
Cluster assignment lifecycle results. Result of certifying a clustered process at startup.
DbError
Errors from database operations.
DeliveryGuarantee
Delivery guarantee level for the pipeline.
ExecuteResult
Result of executing a SQL statement.
PipelineNodeType
Type of a node in the pipeline topology.
PipelineState
The state of a streaming pipeline.
SubscriptionError
Terminal failure from a named subscription.
TypedSubscriptionFrame
A typed frame from a named subscription.

Constants§

DEFAULT_MAX_MANAGED_STATE_BYTES
Default pipeline-wide lower-bound charge allowed for managed operator working state.

Traits§

FromBatch
Deserialize rows from a RecordBatch. Auto-generated by #[derive(FromRecordBatch)].