Neo4rs
Neo4rs is a native rust driver implemented using bolt 4.1 specification
Getting Started
Run a simple query, discard the response data
let uri = "127.0.0.1:7687".to_owned;
let user = "neo4j";
let pass = "neo4j";
let graph = connect.await.unwrap;
assert!;
Create a node and process the response
let graph = connect.await.unwrap;
let mut result = graph
.query
.param
.execute
.await
.unwrap;
let row = result.next.await.unwrap;
let node: Node = row.get.unwrap;
let id = node.id;
let labels = node.labels;
let name: String = node.get.unwrap;
assert_eq!;
assert_eq!;
Drain the result stream
let graph = connect.await.unwrap;
let mut result = graph
.query
.execute
.await
.unwrap;
while let Some = result.next.await
Create explicit transactions
let graph = connect.await.unwrap;
let txn = graph.begin_txn.await.unwrap;
graph.query.run.await.unwrap;
txn.commit.await.unwrap;
//Rollback a transaction
//txn.rollback().await.unwrap();
Create and parse relationship
let graph = connect.await.unwrap;
let mut result = graph
.query
.execute
.await
.unwrap;
let row = result.next.await.unwrap;
let relation: Relation = row.get.unwrap;
assert!;
assert!;
assert!;
assert_eq!;
assert_eq!;
Installation
neo4rs is available on crates.io and can be included in your Cargo enabled project like this:
[]
= "0.1.1"
Roadmap
- bolt protocol
- stream abstraction
- query.run() vs query.execute() abstraction
- explicit transactions
- use buffered TCP streams
- connection pooling & multiplexing
- multi db support
- support data types
- Float
- Bytes
- support structures
- Relationship
- UnboundedRelationship
- Path
- Date
- Time
- LocalTime
- DateTime
- DateTimeZoneId
- LocalDateTime
- Duration
- Point2D
- Point3D
- batch queries/pipelining
- add support for older versions of the protocol
- Secure connection
- documentation