for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import abc
from mysql.connector import MySQLConnection
class MySqlConnector:
"""
Interface for classes for connecting to a MySql instances.
# ------------------------------------------------------------------------------------------------------------------
@abc.abstractmethod
def connect(self) -> MySQLConnection:
Connects to the MySql instance.
raise NotImplementedError()
def disconnect(self) -> None:
Disconnects from the MySql instance.
def is_alive(self) -> bool:
Returns whether Python is (still) connected to a MySQL or MariaDB instance.
:rtype: bool
# ----------------------------------------------------------------------------------------------------------------------