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

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.
IndexDefinition
Index definition.
NodeId
Identifies a node in the graph.
Session
Your handle to the database - execute queries and manage transactions.

Enums§

CatalogError
Catalog-related errors.
ConfigError
Errors from Config::validate().
DurabilityMode
WAL durability mode controlling the trade-off between safety and speed.
GraphModel
The graph data model for a database.
IndexType
Type of index.
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.