rust/lance-namespace-impls/README.md
Lance Namespace implementation backends.
This crate provides concrete implementations of the Lance namespace trait:
rest)rest)The REST namespace implementation provides a client for connecting to remote Lance namespace servers via REST API.
The directory namespace implementation stores tables as Lance datasets in a directory structure on local or cloud storage.
Supported storage backends:
dir-aws)dir-gcp)dir-azure)dir-oss)use lance_namespace_impls::connect;
use std::collections::HashMap;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Connect to REST implementation
let mut props = HashMap::new();
props.insert("uri".to_string(), "http://localhost:8080".to_string());
let namespace = connect("rest", props).await?;
Ok(())
}
use lance_namespace_impls::connect;
use std::collections::HashMap;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Connect to local directory
let mut props = HashMap::new();
props.insert("root".to_string(), "/path/to/data".to_string());
let namespace = connect("dir", props).await?;
// Connect to S3
let mut props = HashMap::new();
props.insert("root".to_string(), "s3://my-bucket/path".to_string());
props.insert("storage.region".to_string(), "us-west-2".to_string());
let namespace = connect("dir", props).await?;
Ok(())
}
root - Root path for the namespace (local path or cloud storage URI)storage.* - Storage-specific options (e.g., storage.region, storage.access_key_id)For more information about Lance and its namespace system, see the Lance Namespace documentation.