fix: DB error detection API usage
fix: DB error detection API usage

* Make all methods static
* Add typing hints
* Don't safe fetch attribute value for errno - MariaDB exceptions if
  raised will have errno attr in them. If the class doesn't have one,
  it's not meant to be passed in these methods.

frappe/frappe,frappe/frappe,frappe/frappe,StrellaGroup/frappe,StrellaGroup/frappe,StrellaGroup/frappe