Skip to main content

Crate grafeo

Crate grafeo 

Source
Expand description

§Grafeo

A high-performance, embeddable graph database with a Rust core and no required C dependencies. Optional allocators (jemalloc/mimalloc) and TLS use C libraries for performance.

If you’re new here, start with GrafeoDB - that’s your entry point for creating databases and running queries. Grafeo uses GQL (the ISO standard) by default, but you can enable other query languages through feature flags.

§Query Languages

FeatureLanguageNotes
gqlGQLISO standard, enabled by default
cypherCypherNeo4j-style queries
sparqlSPARQLFor RDF triple stores
gremlinGremlinApache TinkerPop traversals
graphqlGraphQLSchema-based queries
sql-pgqSQL/PGQSQL:2023 GRAPH_TABLE

Use the full feature to enable everything.

§Quick Start

use grafeo::GrafeoDB;

// Create an in-memory database
let db = GrafeoDB::new_in_memory();
let mut session = db.session();

// Add a person
session.execute("INSERT (:Person {name: 'Alix', age: 30})")?;

// Find them
let result = session.execute("MATCH (p:Person) RETURN p.name")?;

§Performance Features

Enable platform-optimized memory allocators for 10-20% faster allocations:

  • jemalloc - Linux/macOS (x86_64, aarch64)
  • mimalloc-allocator - Windows

Modules§

admin
Admin API types for database inspection, backup, and maintenance.
auth
Role-based access control for Grafeo sessions.
cdc
Change Data Capture (CDC) for tracking entity mutations.
database
The main database struct and operations.
memory_usage
Hierarchical memory usage breakdown for the database.
session
Lightweight handles for database interaction.

Structs§

Catalog
The database’s schema dictionary - maps names to compact internal IDs.
Config
Database configuration.
EdgeId
Identifies an edge (relationship) in the graph.
GrafeoDB
Your handle to a Grafeo database.
Grant
A per-graph access grant.
Identity
A verified identity bound to a session.
IndexDefinition
Index definition.
MemoryUsage
Hierarchical memory usage breakdown for the entire database.
NodeId
Identifies a node in the graph.
ProjectionSpec
Defines which nodes and edges are included in a projection.
QueryResult
The result of running a query.
Session
Your handle to the database - execute queries and manage transactions.

Enums§

AccessMode
Access mode for opening a database.
CatalogError
Catalog-related errors.
ConfigError
Errors from Config::validate().
DurabilityMode
WAL durability mode controlling the trade-off between safety and speed.
Error
The main error type - covers everything that can go wrong in Grafeo.
GraphModel
The graph data model for a database.
IndexType
Type of index.
Role
Database-level roles.
StatementKind
Classification of a parsed statement for permission checking.
Value
A dynamically-typed property value.

Constants§

VERSION
The version of the grafeo-engine crate (from Cargo.toml).

Traits§

GraphStore
Read-only graph operations used by the query engine.
GraphStoreMut
Write operations for graph mutation.

Type Aliases§

Result
A type alias for Result<T, Error>.