Backends.DatabaseConfig¶
Classes
DatabaseConfig(user: str, password: str, ...) |
Container class representing the configuration for a SQL database connexion. |
-
class
Backends.DatabaseConfig.DatabaseConfig(user: str, password: str, host: str, port: int, database: str)[source]¶ Container class representing the configuration for a SQL database connexion.
Parameters: user : str
The username used for the connexion credentials.
password : str
The password used for the connexion credentials.
host : str
The host of the connexion
port : int
The port used for the connexion
database : str
The name of the database one wishes to access
Methods
to_dict()Method to convert the instance in a dictionary format. -
to_dict()[source]¶ Method to convert the instance in a dictionary format.
Examples
>>> from Backends.DatabaseConfig import DatabaseConfig >>> db_config = DatabaseConfig("user9715","A21u?cs","localhost", 22, "MyDataBase") >>> dict = db_config.to_dict() >>> print(dict['user']) user9715 >>> print(dict['password']) A21u?cs >>> print(dict['port']) 22
-