class_docstr: This handler handles connection and execution of the SurrealDB statements.
class_docstr_tok: ["This","handler","handles","connection","and","execution","of","the","SurrealDB","statements","."]
docstr: Receive query as AST (abstract syntax tree) and act upon it somehow.
  Args:
      query (ASTNode): sql query represented as AST. It may be any kind
          of query: SELECT, INSERT, DELETE, etc
  Returns:
      HandlerResponse
docstr_tok: ["Receive","query","as","AST","(","abstract","syntax","tree",")","and","act","upon","it","somehow",".","Args",":","query","(","ASTNode",")",":","sql","query","represented","as","AST",".","It","may","be","any","kind","of","query",":","SELECT",",","INSERT",",","DELETE",",","etc","Returns",":","HandlerResponse"]
code: def query(self, query: ASTNode) -> Response:
      """
      Receive query as AST (abstract syntax tree) and act upon it somehow.
      Args:
          query (ASTNode): sql query represented as AST. It may be any kind
              of query: SELECT, INSERT, DELETE, etc
      Returns:
          HandlerResponse
      """
      query_string = query.to_string()
  
      # ensure the correct query is passed
      last_word = query_string.split()[-1]
      query_string = query_string.replace(last_word + ".", "")
      return self.native_query(query_string)
  
imports: from collections import OrderedDict
  from typing import Optional
  from mindsdb_sql.parser.ast.base import ASTNode
  from mindsdb.integrations.libs.base import DatabaseHandler
  from mindsdb.utilities import log
  from mindsdb_sql import parse_sql
  from mindsdb.integrations.libs.response import HandlerStatusResponse, HandlerResponse, RESPONSE_TYPE
  from mindsdb.integrations.libs.const import HANDLER_CONNECTION_ARG_TYPE
  from .utils.surreal_get_info import *
  import pysurrealdb
  import pandas
label_desc: Use image node_id 6 for calling the SurrealDBHandler obj's underlying member method code with example usage: obj.query(query) and returns: self