entc/gen: returns affected rows in delete

Summary: Pull Request resolved: https://github.com/facebookexternal/fbc/pull/1455

Reviewed By: alexsn

Differential Revision: D17396880

fbshipit-source-id: 3a3a9849b816777bd0ef94cf55b2291705a37df6
This commit is contained in:
Ariel Mashraki
2019-09-16 08:45:45 -07:00
committed by Facebook Github Bot
parent 2b1ff377b5
commit 83d0063437
82 changed files with 1566 additions and 712 deletions

View File

@@ -86,20 +86,6 @@ func (gq *GroupQuery) QueryAdmin() *UserQuery {
return query
}
// Get returns a Group entity by its id.
func (gq *GroupQuery) Get(ctx context.Context, id int) (*Group, error) {
return gq.Where(group.ID(id)).Only(ctx)
}
// GetX is like Get, but panics if an error occurs.
func (gq *GroupQuery) GetX(ctx context.Context, id int) *Group {
gr, err := gq.Get(ctx, id)
if err != nil {
panic(err)
}
return gr
}
// First returns the first Group entity in the query. Returns *ErrNotFound when no group was found.
func (gq *GroupQuery) First(ctx context.Context) (*Group, error) {
grs, err := gq.Limit(1).All(ctx)