|
53 | 53 | //! }
|
54 | 54 | //! ```
|
55 | 55 | //!
|
| 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 | +//! ``` |
56 | 86 | //!
|
57 | 87 | //! ## Nodes
|
58 | 88 | //! A simple example to create a node and consume the created node from the row stream.
|
|
88 | 118 | //! }
|
89 | 119 | //! }
|
90 | 120 | //! ```
|
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 |
| -//! ``` |
121 | 121 | //!
|
122 | 122 | //! ## Transactions
|
123 | 123 | //!
|
|
0 commit comments