code: def add(self, name, query, project_name):
      from mindsdb.interfaces.database.database import (
          DatabaseController,
      )
  
      database_controller = DatabaseController()
      project_databases_dict = database_controller.get_dict(
          filter_type="project"
      )
  
      if project_name not in project_databases_dict:
          raise EntityNotExistsError(
              "Can not find project", project_name
          )
  
      project_id = project_databases_dict[project_name]["id"]
      view_record = (
          db.session.query(db.View.id)
          .filter_by(
              name=name,
              company_id=ctx.company_id,
              project_id=project_id,
          )
          .first()
      )
      if view_record is not None:
          raise EntityExistsError("View already exists", name)
  
      view_record = db.View(
          name=name,
          company_id=ctx.company_id,
          query=query,
          project_id=project_id,
      )
      db.session.add(view_record)
      db.session.commit()
  
file_path: mindsdb/mindsdb/interfaces/database/views.py
imports: from mindsdb.interfaces.storage import db
  from mindsdb.interfaces.query_context.context_controller import query_context_controller
  from mindsdb.utilities.context import context
  from mindsdb.utilities.exception import EntityExistsError, EntityNotExistsError
label_desc: Use image node_id 1 for calling the ViewController obj's underlying member method code with example usage: obj.add(name, query, project_name) without return types