Skip to main content

Crate geode_client

Crate geode_client 

Source
Expand description

Geode Rust Client Library

A high-performance async Rust client for Geode graph database with full GQL support. Supports both QUIC and gRPC transports using protobuf wire protocol.

§Features

  • 🚀 Fully async using tokio with type safety
  • 🔒 QUIC + TLS 1.3 or gRPC for flexible networking
  • 📝 Full GQL (ISO/IEC 39075:2024) support
  • 🏗️ Query builders for programmatic query construction
  • 🔐 Authentication & RBAC with RLS policies
  • 🏊 Connection pooling for concurrent workloads
  • 📊 Rich type system with Decimal, temporal types

§Transport Options

§QUIC Transport (default)

use geode_client::{Client, Result};

#[tokio::main]
async fn main() -> Result<()> {
    // Connect via QUIC using DSN
    let client = Client::from_dsn("quic://127.0.0.1:3141?insecure=true")?;
    let mut conn = client.connect().await?;
    let (page, _) = conn.query("RETURN 1 AS x").await?;
    conn.close()?;
    Ok(())
}

§gRPC Transport

use geode_client::{Client, Result};

#[tokio::main]
async fn main() -> Result<()> {
    // Connect via gRPC using DSN
    let client = Client::from_dsn("grpc://127.0.0.1:50051")?;
    let mut conn = client.connect().await?;
    let (page, _) = conn.query("RETURN 1 AS x").await?;
    conn.close()?;
    Ok(())
}

§DSN Formats

  • quic://host:port?options - QUIC transport (default port: 3141)
  • grpc://host:port?options - gRPC transport
  • host:port?options - Legacy format, defaults to QUIC

Re-exports§

pub use auth::AuthClient;
pub use auth::Permission;
pub use auth::RLSPolicy;
pub use auth::Role;
pub use auth::SessionInfo;
pub use auth::User;
pub use client::Client;
pub use client::Column;
pub use client::Connection;
pub use client::Page;
pub use client::PlanOperation;
pub use client::PreparedStatement;
pub use client::QueryPlan;
pub use client::QueryProfile;
pub use client::Savepoint;
pub use client::redact_dsn;
pub use crypto::Cipher;
pub use dsn::DEFAULT_PORT;
pub use dsn::Dsn;
pub use dsn::Transport;
pub use error::Error;
pub use error::Result;
pub use graph::Edge;
pub use graph::Node;
pub use graph::Path;
pub use graph::as_edge;
pub use graph::as_node;
pub use graph::as_path;
pub use pool::ConnectionPool;
pub use query_builder::EdgeDirection;
pub use query_builder::PatternBuilder;
pub use query_builder::PredicateBuilder;
pub use query_builder::QueryBuilder;
pub use quote::quote_ident;
pub use quote::quote_string;
pub use quote::sanitize_graph_name;
pub use retry::RetryPolicy;
pub use retry::retry;
pub use schema::Statement;
pub use schema::parse_schema_fs;
pub use types::Range;
pub use types::Value;
pub use types::ValueKind;

Modules§

auth
Authentication and authorization client.
batch
Batch and pipelined statement execution (port of Go batch.go).
client
Geode client implementation supporting both QUIC and gRPC transports. Uses protobuf wire protocol with 4-byte big-endian length prefix for QUIC.
crypto
Field-level encryption (FLE): AES-256-GCM with HKDF-SHA256 key derivation. Port of the Go driver’s crypto/cipher.go.
dsn
DSN (Data Source Name) parsing for Geode connections.
error
Error types for the Geode client.
graph
Graph-native entity types: Node, Edge, and Path.
grpc
gRPC transport implementation for Geode.
pool
Connection pooling for Geode connections.
proto
Protobuf types generated from geode.proto via prost-build/tonic-build.
query_builder
Query builder for constructing GQL queries programmatically.
quote
GQL quoting and sanitization helpers.
retry
Retry policy with exponential backoff for transient errors.
schema
Schema file parsing, port of the Go driver’s ParseSchemaFS.
types
Type system for Geode values.
validate
Input validation utilities for the Geode client.

Constants§

VERSION
Library version