Answer by SS_Rebelious for How to set up a database connection from...
After a lot of experiments (as there is no specific instructions for the database and I expected something that looked more like a standard approach: ENV_PARAM=conn_string, i.e. in Diesel) I finally...
View ArticleAnswer by Stargateur for How to set up a database connection from environment...
I would like to set username, password and a database name from the environment. Didn't find relevant example for Rocket.Front page of the docRocket and Rocket libraries are configured via the...
View ArticleHow to set up a database connection from environment in Rocket?
I have following working database connection setup for my Rocket app:main.rs:#[database("my_db")]pub struct DbConn(diesel::PgConnection);Rocket.toml:[global.databases]my_db = { url =...
View ArticleAnswer by BergerBytes for How to set up a database connection from...
The accepted answer works, but if you wanted to avoid needing a special formatted environment variable for rocket, you can also update the figment prior to starting rocket.For example:#[launch]async fn...
View Article