code: def add(self, name, project_name, table, query_str, columns=None):
      name = name.lower()
  
      if project_name is None:
          project_name = "mindsdb"
      project_controller = ProjectController()
      project = project_controller.get(name=project_name)
  
      from mindsdb.api.executor.controllers.session_controller import (
          SessionController,
      )
  
      session = SessionController()
  
      # check exists
      trigger = self.get_trigger_record(name, project_name)
      if trigger is not None:
          raise Exception(f"Trigger already exists: {name}")
  
      # check table
      if len(table.parts) < 2:
          raise Exception(f"Database or table not found: {table}")
  
      table_name = Identifier(parts=table.parts[1:]).to_string()
      db_name = table.parts[0]
  
      db_integration = session.integration_controller.get(db_name)
      db_handler = session.integration_controller.get_handler(db_name)
  
      if not hasattr(db_handler, "subscribe"):
          raise Exception(
              f'Handler {db_integration["engine"]} does'
              "t support subscription"
          )
  
      df = db_handler.get_tables().data_frame
      tables = list(df[df.columns[0]])
  
      # check only if tables are visible
      if len(tables) > 0 and table_name not in tables:
          raise Exception(f"Table {table_name} not found in {db_name}")
  
      columns_str = None
      if columns is not None and len(columns) > 0:
          # join to string with delimiter
          columns_str = "|".join([col.parts[-1] for col in columns])
  
      # check sql
      try:
          parse_sql(query_str, dialect="mindsdb")
      except ParsingException as e:
          raise ParsingException(f"Unable to parse: {query_str}: {e}")
  
      # create job record
      record = db.Triggers(
          name=name,
          project_id=project.id,
          database_id=db_integration["id"],
          table_name=table_name,
          query_str=query_str,
          columns=columns_str,
      )
      db.session.add(record)
      db.session.flush()
  
      task_record = db.Tasks(
          company_id=ctx.company_id,
          user_class=ctx.user_class,
          object_type=self.OBJECT_TYPE,
          object_id=record.id,
      )
      db.session.add(task_record)
      db.session.commit()
  
file_path: mindsdb/mindsdb/interfaces/triggers/triggers_controller.py
imports: from mindsdb_sql.parser.ast import Identifier
  from mindsdb_sql import parse_sql, ParsingException
  from mindsdb.interfaces.storage import db
  from mindsdb.interfaces.database.projects import ProjectController
  from mindsdb.utilities.context import context
  from mindsdb.api.executor.controllers.session_controller import SessionController
label_desc: Use image node_id 1 for calling the TriggersController obj's underlying member method code with example usage: obj.add(name, project_name, table, query_str, columns) without return types