44 releases (4 breaking)

0.5.9 Sep 9, 2021
0.5.8 Jan 10, 2021
0.4.9 Jan 2, 2021
0.4.4 Dec 31, 2020
0.1.0 Oct 22, 2020

#216 in Network programming

Download history 9/week @ 2021-06-02 55/week @ 2021-06-09 9/week @ 2021-06-16 13/week @ 2021-06-23 17/week @ 2021-06-30 14/week @ 2021-07-07 59/week @ 2021-07-14 10/week @ 2021-07-21 91/week @ 2021-07-28 54/week @ 2021-08-04 91/week @ 2021-08-11 14/week @ 2021-08-18 5/week @ 2021-08-25 2/week @ 2021-09-01 25/week @ 2021-09-08 6/week @ 2021-09-15

130 downloads per month

MIT license

145KB
3.5K SLoC

Neo4rs CI Status Crates.io

Neo4rs is a Neo4j rust driver implemented using bolt specification

This driver is compatible with neo4j 4.x versions

API Documentation: Docs.rs

Example

    // concurrent queries
    let uri = "127.0.0.1:7687";
    let user = "neo4j";
    let pass = "neo";
    let graph = Arc::new(Graph::new(&uri, user, pass).await.unwrap());
    for _ in 1..=42 {
        let graph = graph.clone();
        tokio::spawn(async move {
            let mut result = graph.execute(
	       query("MATCH (p:Person {name: $name}) RETURN p").param("name", "Mark")
	    ).await.unwrap();
            while let Ok(Some(row)) = result.next().await {
        	let node: Node = row.get("p").unwrap();
        	let name: String = node.get("name").unwrap();
                println!("{}", name);
            }
        });
    }
    
    //Transactions
    let mut txn = graph.start_txn().await.unwrap();
    txn.run_queries(vec![
        query("CREATE (p:Person {name: 'mark'})"),
        query("CREATE (p:Person {name: 'jake'})"),
        query("CREATE (p:Person {name: 'luke'})"),
    ])
    .await
    .unwrap();
    txn.commit().await.unwrap(); //or txn.rollback().await.unwrap();
    

License

Neo4rs is licensed under either of the following, at your option:

Dependencies

~6.5MB
~115K SLoC