code: def add(self, instance):
          '''
          Insert a record to the table 
          emp = Employee(emp_id=1, name='Jane Doe', sex='Female')
          inserted = Session().add(emp)
          Returns a bool or raises mysql.Error exception
          '''
  
          table = instance.__class__.__name__.lower()
          keys = ", ".join(vars(instance).keys())
          values = tuple(vars(instance).values())
  
          SQL =  % (table, keys)
          SQL += """ "%s",""" * len(values) % (values)
          SQL = SQL[:-1] + ")"
  
          if self.DEBUG: print(SQL)
  
          with Session(self.settings) as conn:
              try:
                  c = conn.cursor()
                  c.execute(SQL)
                  conn.commit()
                  return True
              except mysql.Error as e:
                  if e.errno==1062:
                      print("Already saved to the database")
                      return True
                  elif e.errno == 1146:
                      # Table does not exist
                      return True
                  else:
                      raise e
  
                  return True
docs: Insert a record to the table 
          emp = Employee(emp_id=1, name='Jane Doe', sex='Female')
          inserted = Session().add(emp)
          Returns a bool or raises mysql.Error exception