geode_client/lib.rs
1//! Geode Rust Client Library
2//!
3//! A high-performance async Rust client for Geode graph database with full GQL support.
4//! Supports both QUIC and gRPC transports using protobuf wire protocol.
5//!
6//! # Features
7//!
8//! - 🚀 Fully async using tokio with type safety
9//! - 🔒 QUIC + TLS 1.3 or gRPC for flexible networking
10//! - 📝 Full GQL (ISO/IEC 39075:2024) support
11//! - 🏗️ Query builders for programmatic query construction
12//! - 🔐 Authentication & RBAC with RLS policies
13//! - 🏊 Connection pooling for concurrent workloads
14//! - 📊 Rich type system with Decimal, temporal types
15//!
16//! # Transport Options
17//!
18//! ## QUIC Transport (default)
19//!
20//! ```no_run
21//! use geode_client::{Client, Result};
22//!
23//! #[tokio::main]
24//! async fn main() -> Result<()> {
25//! // Connect via QUIC using DSN
26//! let client = Client::from_dsn("quic://127.0.0.1:3141?insecure=true")?;
27//! let mut conn = client.connect().await?;
28//! let (page, _) = conn.query("RETURN 1 AS x").await?;
29//! conn.close()?;
30//! Ok(())
31//! }
32//! ```
33//!
34//! ## gRPC Transport
35//!
36//! ```no_run
37//! use geode_client::{Client, Result};
38//!
39//! #[tokio::main]
40//! async fn main() -> Result<()> {
41//! // Connect via gRPC using DSN
42//! let client = Client::from_dsn("grpc://127.0.0.1:50051")?;
43//! let mut conn = client.connect().await?;
44//! let (page, _) = conn.query("RETURN 1 AS x").await?;
45//! conn.close()?;
46//! Ok(())
47//! }
48//! ```
49//!
50//! # DSN Formats
51//!
52//! - `quic://host:port?options` - QUIC transport (default port: 3141)
53//! - `grpc://host:port?options` - gRPC transport
54//! - `host:port?options` - Legacy format, defaults to QUIC
55
56pub mod auth;
57pub mod client;
58pub mod dsn;
59pub mod error;
60pub mod pool;
61pub mod proto;
62pub mod query_builder;
63pub mod types;
64pub mod validate;
65
66// gRPC transport module
67#[cfg(feature = "grpc")]
68pub mod grpc;
69
70// Re-export main types
71pub use auth::{AuthClient, Permission, RLSPolicy, Role, SessionInfo, User};
72pub use client::{
73 Client, Column, Connection, Page, PlanOperation, PreparedStatement, QueryPlan, QueryProfile,
74 Savepoint,
75};
76pub use dsn::{DEFAULT_PORT, Dsn, Transport};
77pub use error::{Error, Result};
78pub use pool::ConnectionPool;
79pub use query_builder::{EdgeDirection, PatternBuilder, PredicateBuilder, QueryBuilder};
80pub use types::{Range, Value, ValueKind};
81
82/// Library version
83pub const VERSION: &str = env!("CARGO_PKG_VERSION");