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

@@ -72,20 +72,6 @@ func (uq *UserQuery) QueryFriends() *UserQuery {
return query
}
// Get returns a User entity by its id.
func (uq *UserQuery) Get(ctx context.Context, id int) (*User, error) {
return uq.Where(user.ID(id)).Only(ctx)
}
// GetX is like Get, but panics if an error occurs.
func (uq *UserQuery) GetX(ctx context.Context, id int) *User {
u, err := uq.Get(ctx, id)
if err != nil {
panic(err)
}
return u
}
// First returns the first User entity in the query. Returns *ErrNotFound when no user was found.
func (uq *UserQuery) First(ctx context.Context) (*User, error) {
us, err := uq.Limit(1).All(ctx)