graph_d 1.3.2

A native graph database implementation in Rust with built-in JSON support and SQLite-like simplicity
Documentation
#![deny(unsafe_code)]
#![warn(missing_docs)]

//! # Graph_D: A Native Graph Database Implementation
//!
//! Graph_D is a memory-efficient, embedded graph database written in Rust with built-in JSON support.
//! It provides SQLite-like simplicity with native graph operations and O(1) traversal performance.
//!
//! ## Key Features
//!
//! - **Native Graph Storage**: Index-free adjacency for O(1) traversal performance
//! - **JSON Properties**: First-class JSON support for flexible node and relationship properties
//! - **Memory Efficiency**: Designed for embedded applications with minimal memory footprint
//! - **Thread Safety**: ACID-compliant operations with concurrent read support
//! - **Query Language**: GQL (Graph Query Language) with SQL-like syntax
//! - **Secondary Indexing**: Fast property-based lookups and range queries
//! - **Persistence**: Memory-mapped file storage for durability
//!
//! ## Quick Start
//!
//! ```rust
//! use graph_d::{Graph, Result};
//! use serde_json::json;
//! use std::collections::HashMap;
//!
//! # fn main() -> Result<()> {
//! // Create a new in-memory graph
//! let mut graph = Graph::new()?;
//!
//! // Create nodes with JSON properties
//! let mut alice_props = HashMap::new();
//! alice_props.insert("name".to_string(), json!("Alice"));
//! alice_props.insert("age".to_string(), json!(30));
//! let alice_id = graph.create_node(alice_props)?;
//!
//! let mut bob_props = HashMap::new();
//! bob_props.insert("name".to_string(), json!("Bob"));
//! bob_props.insert("age".to_string(), json!(25));
//! let bob_id = graph.create_node(bob_props)?;
//!
//! // Create a relationship between nodes
//! let mut rel_props = HashMap::new();
//! rel_props.insert("since".to_string(), json!("2020-01-01"));
//! let _rel_id = graph.create_relationship(
//!     alice_id,
//!     bob_id,
//!     "KNOWS".to_string(),
//!     rel_props
//! )?;
//!
//! // Query nodes by ID
//! if let Some(alice) = graph.get_node(alice_id)? {
//!     assert_eq!(alice.properties.get("name"), Some(&json!("Alice")));
//! }
//!
//! // Find relationships by type
//! let knows_rels = graph.find_relationships_by_type("KNOWS")?;
//! assert_eq!(knows_rels.len(), 1);
//! # Ok(())
//! # }
//! ```
//!
//! ## Persistence
//!
//! ```rust,no_run
//! use graph_d::{Graph, Result};
//! use std::path::Path;
//!
//! # fn main() -> Result<()> {
//! // Create or open a persistent graph database
//! let mut graph = Graph::open(Path::new("my_graph.db"))?;
//!
//! // All operations are automatically persisted
//! // Data will be recovered when reopening the file
//! # Ok(())
//! # }
//! ```
//!
//! ## Module Organization
//!
//! - [`graph`] - Core graph data structures and operations
//! - [`storage`] - Storage backends (in-memory and persistent)
//! - [`index`] - Secondary indexing system for fast queries
//! - [`gql`] - Graph Query Language implementation
//! - [`query`] - Query building and execution utilities
//! - [`transaction`] - Transaction management and concurrency control
//! - [`memory`] - Advanced memory management and optimization
//! - [`error`] - Error types and result handling

pub mod error;
pub mod gql;
pub mod graph;
pub mod index;
pub mod memory;
pub mod query;
pub mod storage;
pub mod transaction;

pub use error::{GraphError, Result};
pub use graph::{Graph, Node, Relationship};

/// Version information for the graph database.
///
/// This constant contains the version string from Cargo.toml and can be used
/// for compatibility checking or diagnostic purposes.
///
/// # Example
///
/// ```rust
/// use graph_d::VERSION;
/// println!("Using Graph_D version: {}", VERSION);
/// ```
pub const VERSION: &str = env!("CARGO_PKG_VERSION");