Redis Graph - Graph Database Capability Provider

This repository contains a shared library of types and protocol definitions, a graph-guest library that can be used by any actor that wants to consume any graph database capability (not just RedisGraph), a sample actor, and the main capability provider library.

While the actor and common libraries should be usable across different types of graph databases, this provider is build on top of Redis Graph.

The following sample shows just how few lines of code are required to build an actor that responds to HTTP requests, reads and writes graph data, and exposes results over HTTP as JSON:

```rust actorhandlers! { codec::http::OPHANDLEREQUEST => handlehttprequest, codec::core::OPHEALTH_REQUEST => health }

fn handlehttprequest(req: codec::http::Request) -> HandlerResult {
if req.method.touppercase() == "POST" { createdata() } else { query_data() } }

// Execute a Cypher query to return data values fn querydata() -> HandlerResult { let (name, birthyear): (String, u32) = graph::default().graph("MotoGP") .query("MATCH (r:Rider)-[:rides]->(t:Team) WHERE t.name = 'Yamaha' RETURN r.name, r.birth_year")?;

let result = json!({
    "name": name,
    "birth_year": birth_year
});
Ok(codec::http::Response::json(result, 200, "OK"))

}

fn health(_req: codec::core::HealthRequest) -> HandlerResult<()> { Ok(()) } ```