MysqlHandler class is a context manager, use thus:
This
- opens connection to MySQL
- Provides methods simplify executing queries (delete, insert, select, update) and getting results.
- Closes the connection reliably on exit from scope
Simple: insert ... on duplicate key update