Skip to main content

init

Initializes the database connection by attempting to execute a simple query to verify the database is responsive. This function performs network I/O, logs connection attempts, and utilizes a retry mechanism with fixed wait intervals before raising an exception if the connection fails.

def init(
db_engine: Engine
) - > None

Verifies the database connection by attempting to execute a simple query and retries upon failure. This function ensures the database is responsive before the application proceeds with further operations.

Parameters

NameTypeDescription
db_engineEngineThe SQLAlchemy or SQLModel engine instance used to establish a connection with the target database.

Returns

TypeDescription
NoneNothing is returned upon a successful connection check.