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 dsn::DEFAULT_PORT;
pub use dsn::Dsn;
pub use dsn::Transport;
pub use error::Error;
pub use error::Result;
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 types::Range;
pub use types::Value;
pub use types::ValueKind;

Modulesยง

auth
Authentication and authorization client.
client
Geode client implementation supporting both QUIC and gRPC transports. Uses protobuf wire protocol with 4-byte big-endian length prefix for QUIC.
dsn
DSN (Data Source Name) parsing for Geode connections.
error
Error types for the Geode client.
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.
types
Type system for Geode values.
validate
Input validation utilities for the Geode client.

Constantsยง

VERSION
Library version