Function limiting_factor::database::test_database_connection [−][src]
pub fn test_database_connection(database_url: &str) -> ErrorResult<()>
Expand description
Allows to test if it’s possible to establish a connection to the database.
The goal is to test early any issue with the connection, and loudly warn or fail if the database can’t be reached.
Examples
// Initial connection to test if the database configuration works
{
test_database_connection(&config.database_url)?;
info!(target: "runner", "Connection to database established.");
}