def METHOD_NAME(request, design_id=None, query_history_id=None):
  """
  View function for executing an arbitrary synchronously query.
  """
  action = request.path
  app_name = get_app_name(request)
  query_type = beeswax_models.SavedQuery.TYPES_MAPPING[app_name]
  design = safe_get_design(request, query_type, design_id)
  return render('execute.mako', request, {
    'action': action,
    'doc_id': json.dumps(design.id and design.doc.get().id or -1),
    'design': design,
    'autocomplete_base_url': reverse('rdbms:api_autocomplete_databases', kwargs={}),
    'can_edit_name': design.id and not design.is_auto,
  })