diff --git a/store/datastore/repos.go b/store/datastore/repos.go index ec800338b..6d053ca56 100644 --- a/store/datastore/repos.go +++ b/store/datastore/repos.go @@ -24,6 +24,7 @@ func (db *datastore) GetRepoListOf(listof []*model.RepoLite) ([]*model.Repo, err repos []*model.Repo args []interface{} stmt string + err error ) switch meddler.Default { case meddler.PostgreSQL: @@ -31,7 +32,9 @@ func (db *datastore) GetRepoListOf(listof []*model.RepoLite) ([]*model.Repo, err default: stmt, args = toList(listof) } - err := meddler.QueryAll(db, &repos, fmt.Sprintf(repoListOfQuery, stmt), args...) + if len(args) > 0 { + err = meddler.QueryAll(db, &repos, fmt.Sprintf(repoListOfQuery, stmt), args...) + } return repos, err } diff --git a/store/datastore/users.go b/store/datastore/users.go index d448e25c5..bf721005f 100644 --- a/store/datastore/users.go +++ b/store/datastore/users.go @@ -30,6 +30,7 @@ func (db *datastore) GetUserFeed(listof []*model.RepoLite) ([]*model.Feed, error feed []*model.Feed args []interface{} stmt string + err error ) switch meddler.Default { case meddler.PostgreSQL: @@ -37,7 +38,9 @@ func (db *datastore) GetUserFeed(listof []*model.RepoLite) ([]*model.Feed, error default: stmt, args = toList(listof) } - err := meddler.QueryAll(db, &feed, fmt.Sprintf(userFeedQuery, stmt), args...) + if len(args) > 0 { + err = meddler.QueryAll(db, &feed, fmt.Sprintf(userFeedQuery, stmt), args...) + } return feed, err } @@ -46,6 +49,7 @@ func (db *datastore) GetUserFeedLatest(listof []*model.RepoLite) ([]*model.Feed, feed []*model.Feed args []interface{} stmt string + err error ) switch meddler.Default { case meddler.PostgreSQL: @@ -53,7 +57,9 @@ func (db *datastore) GetUserFeedLatest(listof []*model.RepoLite) ([]*model.Feed, default: stmt, args = toList(listof) } - err := meddler.QueryAll(db, &feed, fmt.Sprintf(userFeedLatest, stmt), args...) + if len(args) > 0 { + err = meddler.QueryAll(db, &feed, fmt.Sprintf(userFeedLatest, stmt), args...) + } return feed, err }