lance_namespace_impls/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright The Lance Authors
3
4//! Lance Namespace implementations.
5//!
6//! This crate provides various implementations of the Lance Namespace trait.
7//!
8//! ## Features
9//!
10//! - `rest`: REST API-based namespace implementation
11//! - `rest-adapter`: REST server adapter that exposes any namespace via HTTP
12//! - `dir-aws`, `dir-azure`, `dir-gcp`, `dir-oss`: Cloud storage backend support for directory namespace (via lance-io)
13//!
14//! ## Implementations
15//!
16//! - `DirectoryNamespace`: Directory-based implementation (always available)
17//! - `RestNamespace`: REST API-based implementation (requires `rest` feature)
18//!
19//! ## Usage
20//!
21//! The recommended way to connect to a namespace is using [`ConnectBuilder`]:
22//!
23//! ```no_run
24//! # use lance_namespace_impls::ConnectBuilder;
25//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
26//! let namespace = ConnectBuilder::new("dir")
27//!     .property("root", "/path/to/data")
28//!     .connect()
29//!     .await?;
30//! # Ok(())
31//! # }
32//! ```
33
34pub mod connect;
35pub mod dir;
36
37#[cfg(feature = "rest")]
38pub mod rest;
39
40#[cfg(feature = "rest-adapter")]
41pub mod rest_adapter;
42
43// Re-export connect builder
44pub use connect::ConnectBuilder;
45pub use dir::{manifest::ManifestNamespace, DirectoryNamespace, DirectoryNamespaceBuilder};
46
47#[cfg(feature = "rest")]
48pub use rest::{RestNamespace, RestNamespaceBuilder};
49
50#[cfg(feature = "rest-adapter")]
51pub use rest_adapter::{RestAdapter, RestAdapterConfig, RestAdapterHandle};