File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments