pub fn establish_connection() -> MysqlConnectionExpand description
This function establishes a connection to the MySQL database.
Note that the connection has to be set in a configuration file called .env, with the following format:
DATABASE_URL=mysql://username:password@localhost/database_name§Returns
A MysqlConnection object representing the connection to the database.
§Usage
This function is used to establish a connection to the MySQL database. It is usually called with:
let connection = &mut establish_connection();