mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
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:
committed by
Facebook Github Bot
parent
2b1ff377b5
commit
83d0063437
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user