game.db.config

db/config.py

Database configuration and connection management.

Populates DB_CONFIG from environment variables and provides automatically closed database connection via context manager.

Functions

get_connection()

Context manager for MySQL/MariaDB database connection.

game.db.config.get_connection()

Context manager for MySQL/MariaDB database connection.

Yields:

mysql.connector.connection.MySQLConnection – Database connection.