code: def update(self, id, values, key_names='all'):
          
          con = self.connection or self._connect()
          self._initialize(con)
          cur = con.cursor()
  
          pub_id = values['pub_id']
          ase_ids = values['ase_ids']
          energy_corrections = values['energy_corrections']
  
          if ase_ids is not None:
              check_ase_ids(values, ase_ids)
          else:
              ase_ids = {}
  
          key_list, value_list = get_key_value_list(key_names, values)
          N_keys = len(key_list)
  
          value_strlist = get_value_strlist(value_list)
          execute_str = ', '.join('{}={}'.format(key_list[i], value_strlist[i])
                                  for i in range(N_keys))
  
          update_command = 'UPDATE reaction SET {} WHERE id = {};'\
              .format(execute_str, id)
  
          cur.execute(update_command)
  
          delete_command = 'DELETE from reaction_system WHERE id = {}'.format(id)
          cur.execute(delete_command)
  
          reaction_structure_values = []
          for name, ase_id in ase_ids.items():
              reaction_structure_values.append([name,
                                                energy_corrections.get(name),
                                                ase_id, id])
              insert_statement = """INSERT OR IGNORE INTO
              publication_system(ase_id, pub_id) VALUES (?, ?)"""
              cur.execute(insert_statement, [ase_id, pub_id])
  
          cur.executemany('INSERT INTO reaction_system VALUES (?, ?, ?, ?)',
                          reaction_structure_values)
  
          if self.connection is None:
              con.commit()
              con.close()
          return id
docs: Update reaction info for a selected row
  
          Parameters
          ----------
          id: int
              row integer
          values: dict
              See write() method for details
          key_names: list or 'all'
              list with name of columns to update. Should match the keys-value
              pairs in values.
              default is 'all'