1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
//! KyuGraph — high-performance embedded property graph database.
//!
//! KyuGraph is a pure-Rust embedded graph database implementing the openCypher
//! query language. It uses columnar storage, vectorized execution, and optional
//! Cranelift JIT compilation for analytical graph workloads.
//!
//! # Quick Start
//!
//! ```no_run
//! use kyu_graph::{Database, TypedValue};
//!
//! // In-memory database
//! let db = Database::in_memory();
//! let conn = db.connect();
//!
//! // Create schema
//! conn.query("CREATE NODE TABLE Person (id INT64, name STRING, age INT64, PRIMARY KEY (id))")
//! .unwrap();
//! conn.query("CREATE REL TABLE KNOWS (FROM Person TO Person)")
//! .unwrap();
//!
//! // Insert data
//! conn.query("CREATE (p:Person {id: 1, name: 'Alice', age: 30})").unwrap();
//! conn.query("CREATE (p:Person {id: 2, name: 'Bob', age: 25})").unwrap();
//!
//! // Query
//! let result = conn.query("MATCH (p:Person) WHERE p.age > 20 RETURN p.name, p.age").unwrap();
//! for row in result.iter_rows() {
//! println!("{:?}", row);
//! }
//! ```
//!
//! # Persistent Database
//!
//! ```no_run
//! use kyu_graph::Database;
//!
//! let db = Database::open(std::path::Path::new("./my_graph")).unwrap();
//! let conn = db.connect();
//! conn.query("CREATE NODE TABLE Log (id INT64, msg STRING, PRIMARY KEY (id))").unwrap();
//! // Data is checkpointed to disk automatically.
//! ```
//!
//! # Bulk Data Import
//!
//! ```no_run
//! use kyu_graph::Database;
//!
//! let db = Database::in_memory();
//! let conn = db.connect();
//! conn.query("CREATE NODE TABLE Person (id INT64, name STRING, PRIMARY KEY (id))").unwrap();
//! conn.query("COPY Person FROM 'people.csv'").unwrap();
//! ```
//!
//! # Parameterized Queries
//!
//! Pass dynamic values safely via `$param` placeholders instead of string
//! interpolation. Use the re-exported `json!` macro and `BindContext` for
//! ergonomic construction from JSON:
//!
//! ```no_run
//! use kyu_graph::{Database, BindContext, json};
//!
//! let db = Database::in_memory();
//! let conn = db.connect();
//! conn.query("CREATE NODE TABLE Person (id INT64, name STRING, age INT64, PRIMARY KEY (id))")
//! .unwrap();
//! conn.query("CREATE (p:Person {id: 1, name: 'Alice', age: 30})").unwrap();
//!
//! // From json! macro
//! let ctx = BindContext::with_params_json(json!({"min_age": 25}));
//!
//! // From a JSON string (e.g. read from a config file or HTTP request body)
//! let ctx = BindContext::with_params_str(r#"{"min_age": 25}"#).unwrap();
//!
//! // Or use HashMap<String, TypedValue> directly
//! use std::collections::HashMap;
//! use kyu_graph::TypedValue;
//! let mut params = HashMap::new();
//! params.insert("min_age".to_string(), TypedValue::Int64(25));
//! let result = conn.query_with_params(
//! "MATCH (p:Person) WHERE p.age > $min_age RETURN p.name",
//! params,
//! ).unwrap();
//! ```
//!
//! For full VM-style execution with both parameters and environment bindings,
//! use [`Connection::execute`].
//!
//! # Extensions
//!
//! KyuGraph supports pluggable extensions for graph algorithms, full-text search,
//! vector similarity, and more. Extensions are registered on the database instance
//! before creating connections.
//!
//! ```no_run
//! use kyu_graph::{Database, Extension};
//!
//! let mut db = Database::in_memory();
//! // db.register_extension(Box::new(my_extension));
//! let conn = db.connect();
//! // conn.query("CALL ext.procedure(args)").unwrap();
//! ```
// ---- Core API ----
pub use ;
// ---- Bind-Time Context ----
pub use BindContext;
// ---- JSON ----
/// Re-export `serde_json::json!` for ergonomic construction of params and env.
pub use json;
// ---- Query Results ----
pub use QueryResult;
// ---- Storage ----
pub use NodeGroupStorage;
// ---- Data Import ----
pub use ;
// ---- Delta Fast Path ----
pub use ;
// ---- Type System ----
pub use ;
// ---- Error Handling ----
pub use ;
// ---- Configuration ----
pub use DatabaseConfig;
// ---- Extensions ----
pub use ;
// ---- Arrow Flight ----
pub use ;
/// Re-exports of types used less frequently but needed for advanced usage.