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.
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.
You can execute queries inside a transaction or simply execute queries that commit immediately.
Serialization: serde
vs rustc-serialize
By default, rusted-cypher
supports types that implement serde
traits, Serialize
and Deserialize
, in query parameters and to retrieve result values.
If you want to use rustc-serialize
instead, just add the feature rustc-serialize
:
[]
= { = "*", = ["rustc-serialize"] }
Examples
Code in examples are assumed to be wrapped in:
extern crate rusted_cypher;
use BTreeMap;
use GraphClient;
use Statement;
Performing Queries
let mut query = graph.cypher.query;
// Statement implements From<&str>
query.add_statement;
let statement = new
.with_param;
query.add_statement;
query.send.unwrap;
graph.cypher.exec
.unwrap;
let result = graph.cypher.exec
.unwrap;
assert_eq!;
for row in result.rows
graph.cypher.exec.unwrap;
With Transactions
let transaction = graph.cypher.transaction
.with_statement;
let = transaction.begin.unwrap;
// Use `exec` to execute a single statement
transaction.exec
.unwrap;
// use `add_statement` (or `with_statement`) and `send` to executes multiple statements
let stmt = new
.with_param;
transaction.add_statement;
let results = transaction.send.unwrap;
assert_eq!;
transaction.rollback;
Statements with Macro
There is a macro to help building statements
let statement = cypher_stmt!;
graph.cypher.exec.unwrap;
let statement = cypher_stmt!;
let results = graph.cypher.exec.unwrap;
assert_eq!;
let statement = cypher_stmt!;
graph.cypher.exec.unwrap;
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.