code: func (m *GormCodebaseRepository) Save(ctx context.Context, codebase *Codebase) (*Codebase, error) {
  	c := Codebase{}
  	tx := m.db.Where("id=?", codebase.ID).First(&c)
  	if tx.RecordNotFound() {
  		// treating this as a not found error: the fact that we're using number internal is implementation detail
  		return nil, errors.NewNotFoundError("codebase", codebase.ID.String())
  	}
  	if err := tx.Error; err != nil {
  		return nil, errors.NewInternalError(ctx, err)
  	}
  
  	tx = tx.Save(codebase)
  	if err := tx.Error; err != nil {
  		return nil, errors.NewInternalError(ctx, err)
  	}
  	log.Debug(ctx, map[string]interface{}{"codebase_id": codebase.ID}, "codebase updated successfully")
  	return codebase, nil
  }
docs: // Save a single codebase