[MM-62153] Avoid SELECT * in preference_store.go (#30081)
* refractored sql queries * GetBuilder to Select Builder as preferences is slice (fix failing test) * test: Add test for GetCategoryAndName preference method * fix s/GetBuilder/SelectBuilder * linting * make mocks * make store-layers --------- Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
a3f22bd349
Коммит
50258a6510
@@ -8802,11 +8802,11 @@ func (s *RetryLayerPreferenceStore) GetCategory(userID string, category string)
|
||||
|
||||
}
|
||||
|
||||
func (s *RetryLayerPreferenceStore) GetCategoryAndName(category string, nane string) (model.Preferences, error) {
|
||||
func (s *RetryLayerPreferenceStore) GetCategoryAndName(category string, name string) (model.Preferences, error) {
|
||||
|
||||
tries := 0
|
||||
for {
|
||||
result, err := s.PreferenceStore.GetCategoryAndName(category, nane)
|
||||
result, err := s.PreferenceStore.GetCategoryAndName(category, name)
|
||||
if err == nil {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user