TomMalkin / SimQLe

The simplest way to use SQL in Python
MIT License
30 stars 5 forks source link

Build in retries with intervals into connection settings #61

Open TomMalkin opened 5 years ago

TomMalkin commented 5 years ago

as per https://docs.docker.com/compose/startup-order/

regarding compose dependencies:

To handle this, design your application to attempt to re-establish a connection to the database after a failure. If the application retries the connection, it can eventually connect to the database.

TomMalkin commented 5 years ago

Maybe build in a "health check" into the ConnectionManager, with a command built into the .connections.yaml file, and you can

ConnectionManager().wait_for_health(con_name, health_check=None, interval=None, retries=None, timeout=None)

with these values either set here or passed as part of the .connections.yaml file.

TomMalkin commented 5 years ago

could add a default sql parameter which would generically check health, like sql='select 1' which would work on most databases, but can be overridden