6 releases (breaking)
Uses old Rust 2015
0.4.0 | Dec 6, 2017 |
---|---|
0.3.0 | Apr 27, 2017 |
0.2.0 | Mar 10, 2017 |
0.1.0 | Jan 21, 2017 |
0.0.2 | Oct 26, 2015 |
#14 in #cypher
57 downloads per month
Used in rocket_contrib
5KB
r2d2_cypher
r2d2-cypher is a r2d2 connection pool for rusted-cypher.
Example
extern crate r2d2;
extern crate r2d2_cypher;
use r2d2::{Config, Pool};
use r2d2_cypher::CypherConnectionManager;
pub fn main() {
let db_url = "http://neo4j:neo4j@127.0.0.1:7474/db/data";
let manager = CypherConnectionManager{url:db_url.to_owned()};
let config = Config::builder().pool_size(5).build();
let pool = Pool::new(config, manager).unwrap();
let client = pool.clone().get().unwrap();
let result = client.cypher().exec("MATCH (n)-[r]->() RETURN n");
}
License
This project is licensed under the MIT license.
lib.rs
:
r2d2-cypher is a r2d2 connection pool for rusted-cypher.
Example
extern crate r2d2;
extern crate r2d2_cypher;
use r2d2::Pool;
use r2d2_cypher::CypherConnectionManager;
pub fn main() {
let db_url = "http://neo4j:neo4j@127.0.0.1:7474/db/data";
let manager = CypherConnectionManager{url:db_url.to_owned()};
let pool = Pool::builder().max_size(5).build(manager).unwrap();
let client = pool.clone().get().unwrap();
let result = client.cypher().exec("MATCH (n)-[r]->() RETURN n");
}
Dependencies
~9–14MB
~223K SLoC