class_docstr: The SQLStorageAdapter allows ChatterBot to store conversation
  data in any database supported by the SQL Alchemy ORM.
  
  All parameters are optional, by default a sqlite database is used.
  
  It will check if tables are present, if they are not, it will attempt
  to create the required tables.
  
  :keyword database_uri: eg: sqlite:///database_test.sqlite3',
      The database_uri can be specified to choose database driver.
  :type database_uri: str
class_docstr_tok: ["The","SQLStorageAdapter","allows","ChatterBot","to","store","conversation","data","in","any","database","supported","by","the","SQL","Alchemy","ORM",".","All","parameters","are","optional",",","by","default","a","sqlite","database","is","used",".","It","will","check","if","tables","are","present",",","if","they","are","not",",","it","will","attempt","to","create","the","required","tables",".",":","keyword","database_uri",":","eg",":","sqlite",":","\/\/\/database_test.sqlite3","'",",","The","database_uri","can","be","specified","to","choose","database","driver",".",":","type","database_uri",":","str"]
docstr: Modifies an entry in the database.
  Creates an entry if one does not exist.
docstr_tok: ["Modifies","an","entry","in","the","database",".","Creates","an","entry","if","one","does","not","exist","."]
code: def update(self, statement):
      """
      Modifies an entry in the database.
      Creates an entry if one does not exist.
      """
      Statement = self.get_model("statement")
      Tag = self.get_model("tag")
  
      if statement is not None:
          session = self.Session()
          record = None
  
          if hasattr(statement, "id") and statement.id is not None:
              record = session.query(Statement).get(statement.id)
          else:
              record = (
                  session.query(Statement)
                  .filter(
                      Statement.text == statement.text,
                      Statement.conversation == statement.conversation,
                  )
                  .first()
              )
  
              # Create a new statement entry if one does not already exist
              if not record:
                  record = Statement(
                      text=statement.text,
                      conversation=statement.conversation,
                      persona=statement.persona,
                  )
  
          # Update the response value
          record.in_response_to = statement.in_response_to
  
          record.created_at = statement.created_at
  
          record.search_text = self.tagger.get_text_index_string(
              statement.text
          )
  
          if statement.in_response_to:
              record.search_in_response_to = (
                  self.tagger.get_text_index_string(
                      statement.in_response_to
                  )
              )
  
          for tag_name in statement.get_tags():
              tag = session.query(Tag).filter_by(name=tag_name).first()
  
              if not tag:
                  # Create the record
                  tag = Tag(name=tag_name)
  
              record.tags.append(tag)
  
          session.add(record)
  
          self._session_finish(session)
  
file_path: ChatterBot/chatterbot/storage/sql_storage.py
imports: from chatterbot.storage import StorageAdapter
label_desc: Use image node_id 10 for calling the SQLStorageAdapter obj's underlying member method code with example usage: obj.update(statement) without return types