'multiple database pools to different databases in actix-web

How do I support multiple database pools to different databases in actix-web? I am currently using this:

// database pool for postgres db1
cfg.add_data(web::Data::new(pool.clone));

and I am able to connect to database db1. How do I add another database pool to a different database (db2 - postgres)?

I am using actix-web 4.x and deadpool-postgres.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source