mirror of
https://github.com/ent/ent.git
synced 2026-05-28 09:49:08 +03:00
@@ -248,6 +248,9 @@ func (gq *GroupQuery) ExistX(ctx context.Context) bool {
|
||||
// Clone returns a duplicate of the query builder, including all associated steps. It can be
|
||||
// used to prepare common query builders and use them differently after the clone is made.
|
||||
func (gq *GroupQuery) Clone() *GroupQuery {
|
||||
if gq == nil {
|
||||
return nil
|
||||
}
|
||||
return &GroupQuery{
|
||||
config: gq.config,
|
||||
limit: gq.limit,
|
||||
@@ -255,6 +258,7 @@ func (gq *GroupQuery) Clone() *GroupQuery {
|
||||
order: append([]OrderFunc{}, gq.order...),
|
||||
unique: append([]string{}, gq.unique...),
|
||||
predicates: append([]predicate.Group{}, gq.predicates...),
|
||||
withUsers: gq.withUsers.Clone(),
|
||||
// clone intermediate query.
|
||||
sql: gq.sql.Clone(),
|
||||
path: gq.path,
|
||||
|
||||
@@ -248,6 +248,9 @@ func (uq *UserQuery) ExistX(ctx context.Context) bool {
|
||||
// Clone returns a duplicate of the query builder, including all associated steps. It can be
|
||||
// used to prepare common query builders and use them differently after the clone is made.
|
||||
func (uq *UserQuery) Clone() *UserQuery {
|
||||
if uq == nil {
|
||||
return nil
|
||||
}
|
||||
return &UserQuery{
|
||||
config: uq.config,
|
||||
limit: uq.limit,
|
||||
@@ -255,6 +258,7 @@ func (uq *UserQuery) Clone() *UserQuery {
|
||||
order: append([]OrderFunc{}, uq.order...),
|
||||
unique: append([]string{}, uq.unique...),
|
||||
predicates: append([]predicate.User{}, uq.predicates...),
|
||||
withGroups: uq.withGroups.Clone(),
|
||||
// clone intermediate query.
|
||||
sql: uq.sql.Clone(),
|
||||
path: uq.path,
|
||||
|
||||
Reference in New Issue
Block a user