sqlite_vtable_opendal/lib.rs
1//! # sqlite-vtable-opendal
2//!
3//! Federated SQLite Virtual Tables for Cloud Object Stores using OpenDAL
4//!
5//! This library provides a lightweight way to query metadata from cloud object stores
6//! (Dropbox, S3, Google Drive, PostgreSQL, HTTP) using SQL without ingesting the data.
7//! It uses OpenDAL as the storage abstraction layer and SQLite's virtual table interface.
8//!
9//! ## Features
10//!
11//! - **Metadata-only queries**: Query file metadata without downloading content
12//! - **6 storage backends**: Local FS, S3, Dropbox, Google Drive, PostgreSQL, HTTP
13//! - **Standard SQL**: Use familiar SQL syntax for cloud storage queries
14//! - **Pagination support**: Handle large directories efficiently with limit/offset
15//! - **Zero data ingestion**: Query directly from storage without materialization
16//! - **Async support**: Non-blocking operations via Tokio runtime
17//!
18//! ## Quick Start
19//!
20//! ```rust,no_run
21//! use rusqlite::Connection;
22//! use sqlite_vtable_opendal::backends::local_fs;
23//!
24//! # fn main() -> rusqlite::Result<()> {
25//! let conn = Connection::open_in_memory()?;
26//!
27//! // Register virtual table for local filesystem
28//! local_fs::register(&conn, "my_files", "/tmp")?;
29//!
30//! // Query using standard SQL
31//! let mut stmt = conn.prepare(
32//! "SELECT path, size FROM my_files
33//! WHERE size > 1000000
34//! ORDER BY size DESC"
35//! )?;
36//!
37//! let files = stmt.query_map([], |row| {
38//! Ok((row.get::<_, String>(0)?, row.get::<_, i64>(1)?))
39//! })?;
40//!
41//! for file in files {
42//! let (path, size) = file?;
43//! println!("{}: {} bytes", path, size);
44//! }
45//! # Ok(())
46//! # }
47//! ```
48//!
49//! ## Available Backends
50//!
51//! - [`backends::local_fs`] - Local filesystem
52//! - [`backends::s3`] - AWS S3 (and compatible services)
53//! - [`backends::dropbox`] - Dropbox
54//! - [`backends::gdrive`] - Google Drive
55//! - [`backends::postgresql`] - PostgreSQL databases
56//! - [`backends::http`] - HTTP/HTTPS endpoints
57
58pub mod types;
59pub mod error;
60pub mod backends;
61pub mod vtab;
62
63// Re-export commonly used types
64pub use types::{FileMetadata, QueryConfig};
65pub use error::{VTableError, Result};