rusted_cypher 0.1.0

Send cypher queries to a neo4j database
docs.rs failed to build rusted_cypher-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: rusted_cypher-1.1.0

rusted-cypher

Rust crate for accessing the cypher endpoint of a neo4j server

This is a prototype for accessing the cypher endpoint of a neo4j server, like a sql driver for a relational database.

The main goal of this project is to provide a way to send cypher queries to a neo4j server and retrieve the results. The second goal is to manage transactions through the transaction endpoint.

It MAY be extended to support other resources of the neo4j REST api.

At this moment, it is only possible to send one or more cypher queries, closing the transaction immediatly. Managing an open transaction still needs to be done, but eventually will.

Examples

extern crate rusted_cypher;

use std::collections::BTreeMap;
use rusted_cypher::GraphClient;
use rusted_cypher::cypher::Statement;

fn main() {
    let graph = GraphClient::connect("http://neo4j:neo4j@localhost:7474/db/data").unwrap();

    let mut query = graph.cypher().query();
    query.add_simple_statement("CREATE (n:LANG { name: 'Rust', level: 'low', safe: true })");

    let mut params = BTreeMap::new();
    params.insert("safeness", false);
    query.add_statement(Statement::new("CREATE (n:LANG { name: 'C++', level: 'low', safe: {safeness} })", &params));

    query.send().unwrap();

    graph.cypher().exec("CREATE (n:LANG { name: 'Python', level: 'High', safe: true })").unwrap();

    let result = graph.cypher().exec("MATCH (n:LANG) RETURN n").unwrap();

    for row in result.iter() {
        println!("{:?}", row);
    }

    graph.cypher().exec("MATCH (n:LANG) DELETE n").unwrap();
}