Skip to main content

uni_bulk/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2024-2026 Dragonscale Team
3
4//! High-throughput bulk ingestion engine for uni-db.
5//!
6//! This crate provides the standalone write path that powers
7//! `uni_db::Transaction::bulk_writer()` and `appender()`:
8//!
9//! - [`BulkWriter`] / [`BulkWriterBuilder`] — buffered, index-deferred bulk
10//!   loading of vertices and edges with constraint validation, automatic
11//!   checkpointing, async or blocking index rebuild, and version-based
12//!   abort/rollback.
13//! - [`StreamingAppender`] / [`AppenderBuilder`] — an ergonomic row-by-row
14//!   append API for a single label, layered over [`BulkWriter`].
15//!
16//! The engine takes its storage/schema/writer handles via [`BulkBackend`],
17//! a plain dependency-injection bundle constructed by the uni-db driver. No
18//! trait indirection is used on the hot batch-write path.
19//!
20//! The shutdown coordinator ([`uni_plugin_host::shutdown::ShutdownHandle`])
21//! lives in `uni-plugin-host`; the async index-rebuild path subscribes to it
22//! via [`BulkBackend::shutdown`].
23
24pub mod appender;
25pub mod bulk;
26
27pub use appender::{AppenderBuilder, StreamingAppender};
28pub use bulk::{
29    BulkBackend, BulkConfig, BulkPhase, BulkProgress, BulkStats, BulkWriter, BulkWriterBuilder,
30    EdgeData, IntoArrow, record_batch_to_property_maps,
31};