graphqlite-0.0.0-alpha.2 has been yanked.
GraphQLite Rust
Rust bindings for GraphQLite, a SQLite extension that adds graph database capabilities using Cypher.
Installation
Add to your Cargo.toml:
[]
= "0.0.0-alpha.1"
Quick Start
use Connection;
API
Connection::open(path)
Open a database file or in-memory database.
let conn = open?;
let conn = open?;
let conn = open_in_memory?;
Connection::from_rusqlite(conn)
Wrap an existing rusqlite connection.
let sqlite_conn = open_in_memory?;
let conn = from_rusqlite?;
Connection::cypher(query)
Execute a Cypher query.
let results = conn.cypher?;
CypherResult
Query results support iteration and indexing:
// Iterate
for row in &results
// Index access
let first = &results;
// Properties
results.len;
results.is_empty;
results.columns;
Row::get<T>(column)
Type-safe value extraction:
let name: String = row.get?;
let age: i64 = row.get?;
let score: f64 = row.get?;
let active: bool = row.get?;
let maybe: = row.get?;
Extension Path
The extension is located automatically. To specify a custom path:
let conn = open_with_extension?;
Or set the GRAPHQLITE_EXTENSION_PATH environment variable.
License
MIT