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 thestreaming_coordinatorsubmodule for the runtime topology. - process_
function - Keyed process functions with engine-owned state and timers.
- 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.
SUBSCRIBEsubstrate: one shared byte-bounded log per object and cursor portals.
Structs§
- Arrow
Record - Record type for Arrow-based streaming subscriptions.
- Checkpoint
Result - Checkpoint
Stats - Cluster
Topology Adoption Request - Explicit adoption of an existing sealed inventory after a coordinated binary upgrade.
- Cluster
Topology Object Plan - One catalog-bound entry of the local compatibility descriptor, sorted by canonical name.
- Cluster
Topology Request - One atomic candidate graph and the request identity reused on every retry.
- Cluster
Topology Status - Durable catalog version and this process’s independently observed runtime activation.
- Cluster
Topology Validation - Effect-free candidate validation. This is neither a durable admission nor an activation receipt.
- Committed
Query - Rows of a committed read, and the committed cut every view in it was read at.
- Committed
Vnode Frame - Per-vnode state of keyed operators, live and at the committed checkpoint. Per-vnode state of keyed operators, live and at the committed checkpoint. Per-vnode state of keyed operators, live and at the committed checkpoint. One vnode’s state frame in a committed checkpoint.
- Config
KeySpec - Re-export connector metadata types for the control-plane HTTP API (connector catalog / source-creation wizard). Specification for a configuration key.
- Connector
Info - Re-export connector metadata types for the control-plane HTTP API (connector catalog / source-creation wizard). Metadata about a connector implementation.
- Connector
Registry - 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
FROMinCREATE SOURCEorINTOinCREATE SINK. - DdlInfo
- Information about a local DDL result or durable cluster migration admission.
- Laminar
Config - Configuration for a
LaminarDBinstance. - LaminarDB
- The main
LaminarDBdatabase handle. - Laminar
DbBuilder - Fluent builder for constructing a
LaminarDBinstance. - Live
Vnode Load - Per-vnode state of keyed operators, live and at the committed checkpoint. Per-vnode state of keyed operators, live and at the committed checkpoint. Per-vnode state of keyed operators, live and at the committed checkpoint. One vnode’s state on this node at the last sample.
- Materialized
View Info - JSON-serializable projection of a
MaterializedViewfor the control-plane HTTP API. - Operator
Vnode Load - Per-vnode state of keyed operators, live and at the committed checkpoint. Per-vnode state of keyed operators, live and at the committed checkpoint. Per-vnode state of keyed operators, live and at the committed checkpoint. One operator’s state per vnode.
- Pipeline
Edge - A directed edge in the pipeline topology graph.
- Pipeline
Metrics - Pipeline-wide metrics snapshot.
- Pipeline
Node - A node in the pipeline topology graph.
- Pipeline
Topology - The complete pipeline topology: nodes and edges.
- Prepared
Topology Restore - One unstarted target state image. It owns the existing local compiler slot until dropped. It has no source/sink actors or installation/output authority. Existing fenced parent transport handles provide channel decoding context; no receiver or sender is started by preparation. Even a successful preparation requires observed predecessor retirement, fresh authority checks, Commit and coordinated target Release before it can become a runtime graph.
- Query
Handle - Handle to a running streaming query.
- Query
Info - Information about a running query.
- Query
Rows - The rows of an ad-hoc query, in order. Reading them to the end returns every row the query produced; a query that fails, or is cancelled before its last row, ends them with an error.
- ReadCut
- The committed checkpoint a read observed.
- Read
Result - The rows of an ad-hoc read and the committed cut it observed.
- Restart
Policy - Auto-restart policy for the fault supervisor (see
LaminarDB::enable_supervision). - Sink
Info - Information about a registered sink.
- Snapshot
Adoption - Cluster assignment lifecycle results.
Cluster assignment lifecycle results.
Cluster assignment lifecycle results.
Summary of a single
LaminarDB::adopt_assignment_snapshotcall. - Source
Catalog - Central registry of sources, sinks, streams, and queries.
- Source
Entry - A registered source in the catalog.
- Source
Handle - Typed handle for pushing data into a registered source.
- Source
Info - Information about a registered source.
- Source
Metrics - Metrics for a single registered source.
- Stream
Info - Metadata about a registered stream.
- Stream
Metrics - Metrics for a single registered stream.
- Typed
Subscription - Typed subscription that deserializes named-stream
RecordBatchrows. - Typed
Subscription Envelope - Typed compatibility frame plus optional durable cluster partition metadata.
- Untyped
Source Handle - Untyped handle for pushing raw
RecordBatchdata. - Vnode
Load Checkpoint - Per-vnode state of keyed operators, live and at the committed checkpoint.
Per-vnode state of keyed operators, live and at the committed checkpoint.
Per-vnode state of keyed operators, live and at the committed checkpoint.
The committed checkpoint a
VnodeLoadReport’s frame sizes come from. - Vnode
Load Entry - Per-vnode state of keyed operators, live and at the committed checkpoint. Per-vnode state of keyed operators, live and at the committed checkpoint. Per-vnode state of keyed operators, live and at the committed checkpoint. One vnode of one operator.
- Vnode
Load Report - Per-vnode state of keyed operators, live and at the committed checkpoint. Per-vnode state of keyed operators, live and at the committed checkpoint. Per-vnode state of keyed operators, live and at the committed checkpoint. How keyed operator state spreads over vnodes, as one cluster node sees it.
Enums§
- Backpressure
Policy - What to do when an operator’s input buffer exceeds its cap.
- Checkpoint
Failure Disposition - Checkpoint
Phase - Cluster
Startup Disposition - Cluster assignment lifecycle results. Cluster assignment lifecycle results. Cluster assignment lifecycle results. Result of certifying a clustered process at startup.
- Cluster
Topology Object Transition - Supported catalog-object transitions at an exact checkpoint cut.
- Committed
Read - Which committed cut a read observes.
- Committed
Read Error - Why a committed read could not be served.
- DbError
- Errors from database operations.
- Delivery
Guarantee - Delivery guarantee level for the pipeline.
- Execute
Result - Result of executing a SQL statement.
- Pipeline
Node Type - Type of a node in the pipeline topology.
- Pipeline
State - The state of a streaming pipeline.
- Prepared
Topology Source Position - A source’s preparation boundary. A sealed new-source cursor is never processing history.
- Read
Level - How an ad-hoc query reads the materialized views it scans.
- Subscription
Error - Terminal failure from a named subscription.
- Topology
Activation Requirement - Authorization still needed before this local plan can activate a target graph.
- Topology
Initialization - Required initialization semantics. These are requirements, never concrete cut positions.
- Topology
Validation Scope - What a successful validation proves. Participant agreement and runtime authorization follow.
- Typed
Subscription Frame - A typed frame from a named subscription.
Constants§
- DEFAULT_
DATAFUSION_ MEMORY_ LIMIT_ BYTES - Default per-DB limit for participating
DataFusionreservations (256 MiB). This does not limit direct Arrow allocations or process RSS. - DEFAULT_
MATERIALIZED_ VIEW_ MAX_ BYTES - Default retained-memory charge limit per local materialized view (256 MiB).
- DEFAULT_
MATERIALIZED_ VIEW_ MAX_ ROWS - Default live row limit per local materialized view (distinct rows for multisets).
- DEFAULT_
MATERIALIZED_ VIEW_ READ_ CACHE_ BYTES - Default byte budget of decoded committed view state cached for reads (256 MiB).
- DEFAULT_
MAX_ MANAGED_ STATE_ BYTES - Default pipeline-wide lower-bound charge allowed for managed operator working state.
- DEFAULT_
REFERENCE_ TABLE_ MAX_ BYTES - Default retained-memory charge limit for each local reference table (256 MiB).
- DEFAULT_
REFERENCE_ TABLE_ MAX_ ROWS - Default maximum number of live rows in each local reference table.
- DEFAULT_
SOURCE_ QUEUE_ MAX_ BYTES - Default shared connector-to-coordinator Arrow-byte budget (64 MiB).
- MAX_
SOURCE_ QUEUE_ BYTES - Largest source queue budget supported by byte-sized semaphore reservations.
Traits§
- From
Batch - Deserialize rows from a
RecordBatch. Auto-generated by#[derive(FromRecordBatch)].
Functions§
- validate_
managed_ state_ max_ bytes - Validate the pipeline-wide managed operator state budget.
- validate_
materialized_ view_ limits - Validate the live row and retained-memory limits for each local materialized view.
- validate_
reference_ table_ limits - Validate per-table live row and retained-memory limits.
- validate_
source_ queue_ max_ bytes - Validates the shared source queue byte budget before connector I/O.