llkv_result/lib.rs
1//! Error types and result definitions for the LLKV database system.
2//!
3//! Ideally, this crate would provide a unified error type ([`Error`]) and result type alias ([`Result<T>`])
4//! used throughout all LLKV crates. All operations that could fail return `Result<T>`, where
5//! the error variant contains detailed information about what went wrong. However, some of the crates do
6//! still have their own error types, which is a work in progress to unify.
7//!
8//! # Error Philosophy (still a work in progress to implement fully across all crates)
9//!
10//! LLKV uses a single error enum ([`Error`]) rather than crate-specific error types.
11//!
12//! This approach:
13//! - Simplifies error handling across crate boundaries
14//! - Allows errors to propagate naturally with `?` operator
15//! - Provides clear error messages for end users
16//! - Enables structured error matching for programmatic handling
17//!
18//! # Error Categories
19//!
20//! Errors are organized into several categories:
21//!
22//! - **I/O errors** ([`Error::Io`]): Disk operations, file access
23//! - **Data format errors** ([`Error::Arrow`]): Arrow/Parquet serialization issues
24//! - **Lookup failures** ([`Error::NotFound`]): Missing tables, columns, rows
25//! - **User input errors** ([`Error::InvalidArgumentError`]): Invalid SQL, bad parameters
26//! - **Constraint violations** ([`Error::ConstraintError`]): Primary key conflicts, type mismatches
27//! - **Transaction errors** ([`Error::TransactionContextError`]): Isolation violations, conflicts
28//! - **Catalog errors** ([`Error::CatalogError`]): Metadata corruption or inconsistency
29//! - **Internal errors** ([`Error::Internal`]): Bugs or unexpected states
30
31pub mod error;
32pub mod result;
33
34pub use error::Error;
35pub use result::Result;