Skip to content

Commit a969f7b

Browse files
committed
update docs
1 parent 02ca3cd commit a969f7b

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

lib/src/lib.rs

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,36 @@
5353
//! }
5454
//! ```
5555
//!
56+
//! ## Configurations
57+
//!
58+
//! Use the config builder to override the default configurations like
59+
//! * `fetch_size` - number of rows to fetch in batches (default is 200)
60+
//! * `max_connections` - maximum size of the connection pool (default is 16)
61+
//! * `db` - the database to connect to (default is `neo4j`)
62+
//!
63+
//! ```
64+
//! use neo4rs::*;
65+
//! use futures::stream::*;
66+
//!
67+
//! #[tokio::main]
68+
//! async fn main() {
69+
//! let config = config()
70+
//! .uri("127.0.0.1:7687")
71+
//! .user("neo4j")
72+
//! .password("neo")
73+
//! .db("neo4j")
74+
//! .fetch_size(500)
75+
//! .max_connections(10)
76+
//! .build()
77+
//! .unwrap();
78+
//! let graph = Graph::connect(config).await.unwrap();
79+
//! let mut result = graph.execute(query("RETURN 1")).await.unwrap();
80+
//! let row = result.next().await.unwrap().unwrap();
81+
//! let value: i64 = row.get("1").unwrap();
82+
//! assert_eq!(1, value);
83+
//! assert!(result.next().await.unwrap().is_none());
84+
//! }
85+
//! ```
5686
//!
5787
//! ## Nodes
5888
//! A simple example to create a node and consume the created node from the row stream.
@@ -88,36 +118,6 @@
88118
//! }
89119
//! }
90120
//! ```
91-
//! ## Configurations
92-
//!
93-
//! Use the config builder to override the default configurations like
94-
//! * `fetch_size` - number of rows to fetch in batches (default is 200)
95-
//! * `max_connections` - maximum size of the connection pool (default is 16)
96-
//! * `db` - the database to connect to (default is `neo4j`)
97-
//!
98-
//! ```
99-
//! use neo4rs::*;
100-
//! use futures::stream::*;
101-
//!
102-
//! #[tokio::main]
103-
//! async fn main() {
104-
//! let config = config()
105-
//! .uri("127.0.0.1:7687")
106-
//! .user("neo4j")
107-
//! .password("neo")
108-
//! .db("neo4j")
109-
//! .fetch_size(500)
110-
//! .max_connections(10)
111-
//! .build()
112-
//! .unwrap();
113-
//! let graph = Graph::connect(config).await.unwrap();
114-
//! let mut result = graph.execute(query("RETURN 1")).await.unwrap();
115-
//! let row = result.next().await.unwrap().unwrap();
116-
//! let value: i64 = row.get("1").unwrap();
117-
//! assert_eq!(1, value);
118-
//! assert!(result.next().await.unwrap().is_none());
119-
//! }
120-
//! ```
121121
//!
122122
//! ## Transactions
123123
//!

0 commit comments

Comments
 (0)