entc/gen: use named fields on client creations (#359)

This commit is contained in:
Ariel Mashraki
2020-02-25 11:15:38 +02:00
committed by GitHub
parent dc222c0b15
commit 332cfe5c6e
62 changed files with 164 additions and 164 deletions

View File

@@ -74,14 +74,14 @@ func (gr *Group) assignValues(values ...interface{}) error {
// QueryUsers queries the users edge of the Group.
func (gr *Group) QueryUsers() *UserQuery {
return (&GroupClient{gr.config}).QueryUsers(gr)
return (&GroupClient{config: gr.config}).QueryUsers(gr)
}
// Update returns a builder for updating this Group.
// Note that, you need to call Group.Unwrap() before calling this method, if this Group
// was returned from a transaction, and the transaction was committed or rolled back.
func (gr *Group) Update() *GroupUpdateOne {
return (&GroupClient{gr.config}).UpdateOne(gr)
return (&GroupClient{config: gr.config}).UpdateOne(gr)
}
// Unwrap unwraps the entity that was returned from a transaction after it was closed,

View File

@@ -82,14 +82,14 @@ func (u *User) assignValues(values ...interface{}) error {
// QueryGroups queries the groups edge of the User.
func (u *User) QueryGroups() *GroupQuery {
return (&UserClient{u.config}).QueryGroups(u)
return (&UserClient{config: u.config}).QueryGroups(u)
}
// Update returns a builder for updating this User.
// Note that, you need to call User.Unwrap() before calling this method, if this User
// was returned from a transaction, and the transaction was committed or rolled back.
func (u *User) Update() *UserUpdateOne {
return (&UserClient{u.config}).UpdateOne(u)
return (&UserClient{config: u.config}).UpdateOne(u)
}
// Unwrap unwraps the entity that was returned from a transaction after it was closed,