code: func (s *SQLStore) AddClient(info *spb.ClientInfo) (*Client, error) {
  	s.Lock()
  	defer s.Unlock()
  	var (
  		protoBytes []byte
  		err        error
  	)
  	protoBytes, err = info.Marshal()
  	if err != nil {
  		return nil, err
  	}
  	client := &Client{*info}
  	for i := 0; i < 2; i++ {
  		_, err = s.preparedStmts[sqlAddClient].Exec(client.ID, client.HbInbox, protoBytes)
  		if err == nil {
  			break
  		}
  		// We stop if this is the second AddClient failed attempt.
  		if i > 0 {
  			err = sqlStmtError(sqlAddClient, err)
  			break
  		}
  		// This is the first AddClient failed attempt. It could be because
  		// client was already in db, so delete now and try again.
  		_, err = s.preparedStmts[sqlDeleteClient].Exec(client.ID)
  		if err != nil {
  			err = sqlStmtError(sqlDeleteClient, err)
  			break
  		}
  	}
  	if err != nil {
  		return nil, err
  	}
  	return client, nil
  }
docs: // AddClient implements the Store interface