def METHOD_NAME(self, query, connection):
    cursor = connection.cursor()
    try:
        rowcount = cursor.execute(query).rowcount
    except Exception as error:
        self.webapp_internal.log_error(str(error))
    logger().info(f'{rowcount} row(s) affected')
    connection.commit()