Skip to content

Commit 2fa4e37

Browse files
committed
Readme is edited
1 parent df9dda8 commit 2fa4e37

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,34 @@ async fn main() {
129129

130130
let postgres_connection = Arc::new(postgres_connection);
131131

132-
let my_postgres = my_postgres::MyPostgres::from_connection_string(postgres_connection)
132+
let my_postgres1 = my_postgres::MyPostgres::from_connection_string(postgres_connection.clone())
133+
.build()
134+
.await;
135+
136+
let my_postgres2 = my_postgres::MyPostgres::from_connection_string(postgres_connection)
137+
.build()
138+
.await;
139+
}
140+
141+
```
142+
143+
144+
### Sql connection pool
145+
146+
```rust
147+
148+
#[tokio::main]
149+
async fn main() {
150+
let postgres_connection =
151+
PostgresConnection::new_as_multiple_connections(application_name, postgres_settings, 3);
152+
153+
let postgres_connection = Arc::new(postgres_connection);
154+
155+
let my_postgres1 = my_postgres::MyPostgres::from_connection_string(postgres_connection.clone())
156+
.build()
157+
.await;
158+
159+
let my_postgres2 = my_postgres::MyPostgres::from_connection_string(postgres_connection)
133160
.build()
134161
.await;
135162
}

0 commit comments

Comments
 (0)