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
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user