-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DB API refresh part 2 #5508
DB API refresh part 2 #5508
Conversation
This PR updates most of the remaining call sites.
@@ -8,6 +8,7 @@ import ( | |||
"errors" | |||
"flag" | |||
"fmt" | |||
"github.com/buildbuddy-io/buildbuddy/server/util/db" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: move down
@@ -2,6 +2,7 @@ package execution_service | |||
|
|||
import ( | |||
"context" | |||
"github.com/buildbuddy-io/buildbuddy/server/util/db" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: move down
@@ -6,6 +6,7 @@ import ( | |||
"crypto/x509" | |||
"encoding/pem" | |||
"fmt" | |||
"github.com/buildbuddy-io/buildbuddy/server/interfaces" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: move down
enterprise/server/iprules/iprules.go
Outdated
@@ -3,6 +3,7 @@ package iprules | |||
import ( | |||
"context" | |||
"flag" | |||
"github.com/buildbuddy-io/buildbuddy/server/util/db" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too
@@ -3,6 +3,7 @@ package usage_test | |||
import ( | |||
"context" | |||
"fmt" | |||
"github.com/buildbuddy-io/buildbuddy/server/util/db" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here as well
@@ -3,6 +3,7 @@ package invocationdb | |||
import ( | |||
"context" | |||
"errors" | |||
"github.com/buildbuddy-io/buildbuddy/server/util/db" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line, in addition
// foos, err := db.All(rq, &tables.Foo{}) | ||
// | ||
// TODO(vadim): check if there are any ScanRows calls that can be converted to ScanAll. | ||
func ScanAll[T any](rq interfaces.DBRawQuery, t *T) ([]*T, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo having two funcs ScanRows
and ScanAll
is a bit confusing since they sound sort of the same - maybe naming this something like CollectRows
or ScanToSlice
could make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed ScanRows to ScanEach. Hope that differentiates it enough.
This PR updates most of the remaining call sites.
Related issues: N/A