Rewrite raw queries#136
Merged
andreynering merged 3 commits intoNov 10, 2016
Merged
Conversation
…orm-queries # Conflicts: # models/git_diff.go # models/issue.go # models/org.go # models/pull.go # models/repo.go
Current coverage is 3.03% (diff: 0.00%)@@ master #136 diff @@
========================================
Files 33 33
Lines 7845 8096 +251
Methods 0 0
Messages 0 0
Branches 0 0
========================================
Hits 246 246
- Misses 7579 7830 +251
Partials 20 20
|
metalmatze
reviewed
Nov 10, 2016
| Where("(`repository`.owner_id=? AND `repository`.is_private=?)", org.ID, false). | ||
| Or("team_repo.team_id IN (?)", strings.Join(base.Int64sToStrings(teamIDs), ",")). | ||
| GroupBy("`repository`.id"). | ||
| Count(&Repository{}) |
metalmatze
reviewed
Nov 10, 2016
| func GetReleaseByID(id int64) (*Release, error) { | ||
| rel := new(Release) | ||
| has, err := x.Id(id).Get(rel) | ||
| has, err := x. |
Contributor
There was a problem hiding this comment.
I think this could have be left on line, it's not that long. But it's nitpicking.
Contributor
|
Overall really awesome changes! My only comment is one may lines that could have been left one-liners. There's really no need to write err = x.
Where("org_id=?", orgID).
And("is_active=?", true).
Find(&ws)instead of: err = x.Where("org_id=?", orgID).And("is_active=?", true).Find(&ws)It's not that much. LGTM |
Contributor
Somethings fall to personal preference. I prefer it in multiple lines, but I'm OK with any style. I'd also prefer some more spaces inside SQLs: x.Where("org_id = ?", orgID)
// instead of
x.Where("org_id=?", orgID) |
Contributor
|
LGTM |
lunny
added a commit
to lunny/gitea
that referenced
this pull request
Feb 7, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gofmton all model files