From 047b804dcdb0960e200433d816504650e4728e28 Mon Sep 17 00:00:00 2001 From: Ariel Mashraki <7413593+a8m@users.noreply.github.com> Date: Fri, 15 Jul 2022 10:30:23 +0300 Subject: [PATCH] ent/gen: remove unnecessary if block in IN predicates (#2758) --- entc/gen/template/dialect/sql/predicate.tmpl | 8 - .../cascadelete/ent/comment/where.go | 24 - .../integration/cascadelete/ent/post/where.go | 24 - .../integration/cascadelete/ent/user/where.go | 12 - entc/integration/config/ent/user/where.go | 24 - .../integration/customid/ent/account/where.go | 12 - entc/integration/customid/ent/blob/where.go | 24 - .../customid/ent/bloblink/where.go | 36 - entc/integration/customid/ent/car/where.go | 36 - entc/integration/customid/ent/doc/where.go | 12 - .../integration/customid/ent/mixinid/where.go | 24 - entc/integration/customid/ent/note/where.go | 12 - entc/integration/customid/ent/token/where.go | 12 - entc/integration/edgefield/ent/car/where.go | 12 - entc/integration/edgefield/ent/card/where.go | 24 - .../edgefield/ent/metadata/where.go | 24 - entc/integration/edgefield/ent/node/where.go | 24 - entc/integration/edgefield/ent/pet/where.go | 12 - entc/integration/edgefield/ent/post/where.go | 24 - .../integration/edgefield/ent/rental/where.go | 36 - entc/integration/edgefield/ent/user/where.go | 24 - .../edgeschema/ent/friendship/where.go | 48 -- .../integration/edgeschema/ent/group/where.go | 12 - .../edgeschema/ent/relationship/where.go | 48 -- .../edgeschema/ent/relationshipinfo/where.go | 12 - entc/integration/edgeschema/ent/role/where.go | 24 - .../edgeschema/ent/roleuser/where.go | 36 - entc/integration/edgeschema/ent/tag/where.go | 12 - .../integration/edgeschema/ent/tweet/where.go | 12 - .../edgeschema/ent/tweetlike/where.go | 36 - .../edgeschema/ent/tweettag/where.go | 36 - entc/integration/edgeschema/ent/user/where.go | 12 - .../edgeschema/ent/usergroup/where.go | 36 - .../edgeschema/ent/usertweet/where.go | 36 - entc/integration/ent/card/where.go | 60 -- entc/integration/ent/comment/where.go | 48 -- entc/integration/ent/fieldtype/where.go | 732 ------------------ entc/integration/ent/file/where.go | 48 -- entc/integration/ent/filetype/where.go | 36 - entc/integration/ent/group/where.go | 48 -- entc/integration/ent/groupinfo/where.go | 24 - entc/integration/ent/item/where.go | 12 - entc/integration/ent/node/where.go | 12 - entc/integration/ent/pet/where.go | 48 -- entc/integration/ent/task/where.go | 12 - entc/integration/ent/user/where.go | 132 ---- entc/integration/hooks/ent/card/where.go | 48 -- entc/integration/hooks/ent/user/where.go | 48 -- entc/integration/idtype/ent/user/where.go | 12 - .../migrate/entv1/conversion/where.go | 108 --- .../migrate/entv1/customtype/where.go | 12 - entc/integration/migrate/entv1/user/where.go | 144 ---- entc/integration/migrate/entv2/car/where.go | 12 - .../migrate/entv2/conversion/where.go | 108 --- .../migrate/entv2/customtype/where.go | 36 - entc/integration/migrate/entv2/media/where.go | 36 - entc/integration/migrate/entv2/pet/where.go | 12 - entc/integration/migrate/entv2/user/where.go | 204 ----- .../migrate/versioned/group/where.go | 12 - .../migrate/versioned/user/where.go | 36 - .../multischema/ent/group/where.go | 12 - entc/integration/multischema/ent/pet/where.go | 24 - .../integration/multischema/ent/user/where.go | 12 - entc/integration/privacy/ent/task/where.go | 48 -- entc/integration/privacy/ent/team/where.go | 12 - entc/integration/privacy/ent/user/where.go | 24 - entc/integration/template/ent/group/where.go | 12 - entc/integration/template/ent/pet/where.go | 24 - entc/integration/template/ent/user/where.go | 12 - examples/edgeindex/ent/city/where.go | 12 - examples/edgeindex/ent/street/where.go | 12 - examples/entcpkg/ent/user/where.go | 24 - examples/fs/ent/file/where.go | 24 - examples/m2m2types/ent/group/where.go | 12 - examples/m2m2types/ent/user/where.go | 24 - examples/m2mbidi/ent/user/where.go | 24 - examples/m2mrecur/ent/user/where.go | 24 - examples/o2m2types/ent/pet/where.go | 12 - examples/o2m2types/ent/user/where.go | 24 - examples/o2mrecur/ent/node/where.go | 12 - examples/o2o2types/ent/card/where.go | 24 - examples/o2o2types/ent/user/where.go | 24 - examples/o2obidi/ent/user/where.go | 24 - examples/o2orecur/ent/node/where.go | 12 - examples/privacyadmin/ent/user/where.go | 12 - examples/privacytenant/ent/group/where.go | 24 - examples/privacytenant/ent/tenant/where.go | 12 - examples/privacytenant/ent/user/where.go | 24 - examples/start/ent/car/where.go | 24 - examples/start/ent/group/where.go | 12 - examples/start/ent/user/where.go | 24 - examples/traversal/ent/group/where.go | 12 - examples/traversal/ent/pet/where.go | 12 - examples/traversal/ent/user/where.go | 24 - examples/version/ent/user/where.go | 24 - 95 files changed, 3512 deletions(-) diff --git a/entc/gen/template/dialect/sql/predicate.tmpl b/entc/gen/template/dialect/sql/predicate.tmpl index 3c40986bd..c0684ffc7 100644 --- a/entc/gen/template/dialect/sql/predicate.tmpl +++ b/entc/gen/template/dialect/sql/predicate.tmpl @@ -41,14 +41,6 @@ in the LICENSE file in the root directory of this source tree. {{- $arg := $.Scope.Arg -}} {{- $storage := $.Scope.Storage -}} func(s *sql.Selector) { - {{- if $op.Variadic }} - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len({{ $arg }}) == 0 { - s.Where(sql.False()) - return - } - {{- end }} s.Where(sql.{{ call $storage.OpCode $op }}(s.C({{ $f.Constant }}){{ if not $op.Niladic }}, {{ $arg }}{{ if $op.Variadic }}...{{ end }}{{ end }})) } {{- end }} diff --git a/entc/integration/cascadelete/ent/comment/where.go b/entc/integration/cascadelete/ent/comment/where.go index 67d99fe87..54ea932ff 100644 --- a/entc/integration/cascadelete/ent/comment/where.go +++ b/entc/integration/cascadelete/ent/comment/where.go @@ -118,12 +118,6 @@ func TextIn(vs ...string) predicate.Comment { v[i] = vs[i] } return predicate.Comment(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldText), v...)) }) } @@ -135,12 +129,6 @@ func TextNotIn(vs ...string) predicate.Comment { v[i] = vs[i] } return predicate.Comment(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldText), v...)) }) } @@ -229,12 +217,6 @@ func PostIDIn(vs ...int) predicate.Comment { v[i] = vs[i] } return predicate.Comment(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldPostID), v...)) }) } @@ -246,12 +228,6 @@ func PostIDNotIn(vs ...int) predicate.Comment { v[i] = vs[i] } return predicate.Comment(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldPostID), v...)) }) } diff --git a/entc/integration/cascadelete/ent/post/where.go b/entc/integration/cascadelete/ent/post/where.go index bde56e044..048cf82ac 100644 --- a/entc/integration/cascadelete/ent/post/where.go +++ b/entc/integration/cascadelete/ent/post/where.go @@ -118,12 +118,6 @@ func TextIn(vs ...string) predicate.Post { v[i] = vs[i] } return predicate.Post(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldText), v...)) }) } @@ -135,12 +129,6 @@ func TextNotIn(vs ...string) predicate.Post { v[i] = vs[i] } return predicate.Post(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldText), v...)) }) } @@ -229,12 +217,6 @@ func AuthorIDIn(vs ...int) predicate.Post { v[i] = vs[i] } return predicate.Post(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAuthorID), v...)) }) } @@ -246,12 +228,6 @@ func AuthorIDNotIn(vs ...int) predicate.Post { v[i] = vs[i] } return predicate.Post(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAuthorID), v...)) }) } diff --git a/entc/integration/cascadelete/ent/user/where.go b/entc/integration/cascadelete/ent/user/where.go index 3067f3892..bc312a782 100644 --- a/entc/integration/cascadelete/ent/user/where.go +++ b/entc/integration/cascadelete/ent/user/where.go @@ -111,12 +111,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -128,12 +122,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/entc/integration/config/ent/user/where.go b/entc/integration/config/ent/user/where.go index 33d12747b..5981907ab 100644 --- a/entc/integration/config/ent/user/where.go +++ b/entc/integration/config/ent/user/where.go @@ -110,12 +110,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -127,12 +121,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } @@ -235,12 +223,6 @@ func LabelIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldLabel), v...)) }) } @@ -252,12 +234,6 @@ func LabelNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldLabel), v...)) }) } diff --git a/entc/integration/customid/ent/account/where.go b/entc/integration/customid/ent/account/where.go index 7f6096793..2e806b0aa 100644 --- a/entc/integration/customid/ent/account/where.go +++ b/entc/integration/customid/ent/account/where.go @@ -112,12 +112,6 @@ func EmailIn(vs ...string) predicate.Account { v[i] = vs[i] } return predicate.Account(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldEmail), v...)) }) } @@ -129,12 +123,6 @@ func EmailNotIn(vs ...string) predicate.Account { v[i] = vs[i] } return predicate.Account(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldEmail), v...)) }) } diff --git a/entc/integration/customid/ent/blob/where.go b/entc/integration/customid/ent/blob/where.go index b46fbc10f..83780c081 100644 --- a/entc/integration/customid/ent/blob/where.go +++ b/entc/integration/customid/ent/blob/where.go @@ -119,12 +119,6 @@ func UUIDIn(vs ...uuid.UUID) predicate.Blob { v[i] = vs[i] } return predicate.Blob(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldUUID), v...)) }) } @@ -136,12 +130,6 @@ func UUIDNotIn(vs ...uuid.UUID) predicate.Blob { v[i] = vs[i] } return predicate.Blob(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldUUID), v...)) }) } @@ -195,12 +183,6 @@ func CountIn(vs ...int) predicate.Blob { v[i] = vs[i] } return predicate.Blob(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldCount), v...)) }) } @@ -212,12 +194,6 @@ func CountNotIn(vs ...int) predicate.Blob { v[i] = vs[i] } return predicate.Blob(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldCount), v...)) }) } diff --git a/entc/integration/customid/ent/bloblink/where.go b/entc/integration/customid/ent/bloblink/where.go index 23b3f54f7..95658bba2 100644 --- a/entc/integration/customid/ent/bloblink/where.go +++ b/entc/integration/customid/ent/bloblink/where.go @@ -57,12 +57,6 @@ func CreatedAtIn(vs ...time.Time) predicate.BlobLink { v[i] = vs[i] } return predicate.BlobLink(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldCreatedAt), v...)) }) } @@ -74,12 +68,6 @@ func CreatedAtNotIn(vs ...time.Time) predicate.BlobLink { v[i] = vs[i] } return predicate.BlobLink(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldCreatedAt), v...)) }) } @@ -133,12 +121,6 @@ func BlobIDIn(vs ...uuid.UUID) predicate.BlobLink { v[i] = vs[i] } return predicate.BlobLink(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldBlobID), v...)) }) } @@ -150,12 +132,6 @@ func BlobIDNotIn(vs ...uuid.UUID) predicate.BlobLink { v[i] = vs[i] } return predicate.BlobLink(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldBlobID), v...)) }) } @@ -181,12 +157,6 @@ func LinkIDIn(vs ...uuid.UUID) predicate.BlobLink { v[i] = vs[i] } return predicate.BlobLink(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldLinkID), v...)) }) } @@ -198,12 +168,6 @@ func LinkIDNotIn(vs ...uuid.UUID) predicate.BlobLink { v[i] = vs[i] } return predicate.BlobLink(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldLinkID), v...)) }) } diff --git a/entc/integration/customid/ent/car/where.go b/entc/integration/customid/ent/car/where.go index df9044e58..60e82e9f5 100644 --- a/entc/integration/customid/ent/car/where.go +++ b/entc/integration/customid/ent/car/where.go @@ -125,12 +125,6 @@ func BeforeIDIn(vs ...float64) predicate.Car { v[i] = vs[i] } return predicate.Car(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldBeforeID), v...)) }) } @@ -142,12 +136,6 @@ func BeforeIDNotIn(vs ...float64) predicate.Car { v[i] = vs[i] } return predicate.Car(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldBeforeID), v...)) }) } @@ -215,12 +203,6 @@ func AfterIDIn(vs ...float64) predicate.Car { v[i] = vs[i] } return predicate.Car(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAfterID), v...)) }) } @@ -232,12 +214,6 @@ func AfterIDNotIn(vs ...float64) predicate.Car { v[i] = vs[i] } return predicate.Car(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAfterID), v...)) }) } @@ -305,12 +281,6 @@ func ModelIn(vs ...string) predicate.Car { v[i] = vs[i] } return predicate.Car(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldModel), v...)) }) } @@ -322,12 +292,6 @@ func ModelNotIn(vs ...string) predicate.Car { v[i] = vs[i] } return predicate.Car(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldModel), v...)) }) } diff --git a/entc/integration/customid/ent/doc/where.go b/entc/integration/customid/ent/doc/where.go index 5626a76e8..79b91b7c4 100644 --- a/entc/integration/customid/ent/doc/where.go +++ b/entc/integration/customid/ent/doc/where.go @@ -112,12 +112,6 @@ func TextIn(vs ...string) predicate.Doc { v[i] = vs[i] } return predicate.Doc(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldText), v...)) }) } @@ -129,12 +123,6 @@ func TextNotIn(vs ...string) predicate.Doc { v[i] = vs[i] } return predicate.Doc(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldText), v...)) }) } diff --git a/entc/integration/customid/ent/mixinid/where.go b/entc/integration/customid/ent/mixinid/where.go index 4b42879d7..be4717a6c 100644 --- a/entc/integration/customid/ent/mixinid/where.go +++ b/entc/integration/customid/ent/mixinid/where.go @@ -118,12 +118,6 @@ func SomeFieldIn(vs ...string) predicate.MixinID { v[i] = vs[i] } return predicate.MixinID(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldSomeField), v...)) }) } @@ -135,12 +129,6 @@ func SomeFieldNotIn(vs ...string) predicate.MixinID { v[i] = vs[i] } return predicate.MixinID(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldSomeField), v...)) }) } @@ -229,12 +217,6 @@ func MixinFieldIn(vs ...string) predicate.MixinID { v[i] = vs[i] } return predicate.MixinID(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldMixinField), v...)) }) } @@ -246,12 +228,6 @@ func MixinFieldNotIn(vs ...string) predicate.MixinID { v[i] = vs[i] } return predicate.MixinID(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldMixinField), v...)) }) } diff --git a/entc/integration/customid/ent/note/where.go b/entc/integration/customid/ent/note/where.go index 042bc9419..09e9eb659 100644 --- a/entc/integration/customid/ent/note/where.go +++ b/entc/integration/customid/ent/note/where.go @@ -112,12 +112,6 @@ func TextIn(vs ...string) predicate.Note { v[i] = vs[i] } return predicate.Note(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldText), v...)) }) } @@ -129,12 +123,6 @@ func TextNotIn(vs ...string) predicate.Note { v[i] = vs[i] } return predicate.Note(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldText), v...)) }) } diff --git a/entc/integration/customid/ent/token/where.go b/entc/integration/customid/ent/token/where.go index 17cffd70e..096990b1c 100644 --- a/entc/integration/customid/ent/token/where.go +++ b/entc/integration/customid/ent/token/where.go @@ -112,12 +112,6 @@ func BodyIn(vs ...string) predicate.Token { v[i] = vs[i] } return predicate.Token(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldBody), v...)) }) } @@ -129,12 +123,6 @@ func BodyNotIn(vs ...string) predicate.Token { v[i] = vs[i] } return predicate.Token(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldBody), v...)) }) } diff --git a/entc/integration/edgefield/ent/car/where.go b/entc/integration/edgefield/ent/car/where.go index 54040e51b..0a6074653 100644 --- a/entc/integration/edgefield/ent/car/where.go +++ b/entc/integration/edgefield/ent/car/where.go @@ -112,12 +112,6 @@ func NumberIn(vs ...string) predicate.Car { v[i] = vs[i] } return predicate.Car(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNumber), v...)) }) } @@ -129,12 +123,6 @@ func NumberNotIn(vs ...string) predicate.Car { v[i] = vs[i] } return predicate.Car(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNumber), v...)) }) } diff --git a/entc/integration/edgefield/ent/card/where.go b/entc/integration/edgefield/ent/card/where.go index 90924d0cf..db13099e1 100644 --- a/entc/integration/edgefield/ent/card/where.go +++ b/entc/integration/edgefield/ent/card/where.go @@ -118,12 +118,6 @@ func NumberIn(vs ...string) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNumber), v...)) }) } @@ -135,12 +129,6 @@ func NumberNotIn(vs ...string) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNumber), v...)) }) } @@ -243,12 +231,6 @@ func OwnerIDIn(vs ...int) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldOwnerID), v...)) }) } @@ -260,12 +242,6 @@ func OwnerIDNotIn(vs ...int) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldOwnerID), v...)) }) } diff --git a/entc/integration/edgefield/ent/metadata/where.go b/entc/integration/edgefield/ent/metadata/where.go index 6f5ec3232..1055d147e 100644 --- a/entc/integration/edgefield/ent/metadata/where.go +++ b/entc/integration/edgefield/ent/metadata/where.go @@ -118,12 +118,6 @@ func AgeIn(vs ...int) predicate.Metadata { v[i] = vs[i] } return predicate.Metadata(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAge), v...)) }) } @@ -135,12 +129,6 @@ func AgeNotIn(vs ...int) predicate.Metadata { v[i] = vs[i] } return predicate.Metadata(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAge), v...)) }) } @@ -194,12 +182,6 @@ func ParentIDIn(vs ...int) predicate.Metadata { v[i] = vs[i] } return predicate.Metadata(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldParentID), v...)) }) } @@ -211,12 +193,6 @@ func ParentIDNotIn(vs ...int) predicate.Metadata { v[i] = vs[i] } return predicate.Metadata(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldParentID), v...)) }) } diff --git a/entc/integration/edgefield/ent/node/where.go b/entc/integration/edgefield/ent/node/where.go index 13006521e..c43d7fe9e 100644 --- a/entc/integration/edgefield/ent/node/where.go +++ b/entc/integration/edgefield/ent/node/where.go @@ -118,12 +118,6 @@ func ValueIn(vs ...int) predicate.Node { v[i] = vs[i] } return predicate.Node(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldValue), v...)) }) } @@ -135,12 +129,6 @@ func ValueNotIn(vs ...int) predicate.Node { v[i] = vs[i] } return predicate.Node(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldValue), v...)) }) } @@ -194,12 +182,6 @@ func PrevIDIn(vs ...int) predicate.Node { v[i] = vs[i] } return predicate.Node(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldPrevID), v...)) }) } @@ -211,12 +193,6 @@ func PrevIDNotIn(vs ...int) predicate.Node { v[i] = vs[i] } return predicate.Node(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldPrevID), v...)) }) } diff --git a/entc/integration/edgefield/ent/pet/where.go b/entc/integration/edgefield/ent/pet/where.go index 88c25ca2e..45babb635 100644 --- a/entc/integration/edgefield/ent/pet/where.go +++ b/entc/integration/edgefield/ent/pet/where.go @@ -111,12 +111,6 @@ func OwnerIDIn(vs ...int) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldOwnerID), v...)) }) } @@ -128,12 +122,6 @@ func OwnerIDNotIn(vs ...int) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldOwnerID), v...)) }) } diff --git a/entc/integration/edgefield/ent/post/where.go b/entc/integration/edgefield/ent/post/where.go index 348b497b0..adcbc6249 100644 --- a/entc/integration/edgefield/ent/post/where.go +++ b/entc/integration/edgefield/ent/post/where.go @@ -118,12 +118,6 @@ func TextIn(vs ...string) predicate.Post { v[i] = vs[i] } return predicate.Post(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldText), v...)) }) } @@ -135,12 +129,6 @@ func TextNotIn(vs ...string) predicate.Post { v[i] = vs[i] } return predicate.Post(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldText), v...)) }) } @@ -229,12 +217,6 @@ func AuthorIDIn(vs ...int) predicate.Post { v[i] = vs[i] } return predicate.Post(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAuthorID), v...)) }) } @@ -246,12 +228,6 @@ func AuthorIDNotIn(vs ...int) predicate.Post { v[i] = vs[i] } return predicate.Post(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAuthorID), v...)) }) } diff --git a/entc/integration/edgefield/ent/rental/where.go b/entc/integration/edgefield/ent/rental/where.go index a71c9cc46..63465a372 100644 --- a/entc/integration/edgefield/ent/rental/where.go +++ b/entc/integration/edgefield/ent/rental/where.go @@ -128,12 +128,6 @@ func DateIn(vs ...time.Time) predicate.Rental { v[i] = vs[i] } return predicate.Rental(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldDate), v...)) }) } @@ -145,12 +139,6 @@ func DateNotIn(vs ...time.Time) predicate.Rental { v[i] = vs[i] } return predicate.Rental(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldDate), v...)) }) } @@ -204,12 +192,6 @@ func UserIDIn(vs ...int) predicate.Rental { v[i] = vs[i] } return predicate.Rental(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldUserID), v...)) }) } @@ -221,12 +203,6 @@ func UserIDNotIn(vs ...int) predicate.Rental { v[i] = vs[i] } return predicate.Rental(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldUserID), v...)) }) } @@ -252,12 +228,6 @@ func CarIDIn(vs ...uuid.UUID) predicate.Rental { v[i] = vs[i] } return predicate.Rental(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldCarID), v...)) }) } @@ -269,12 +239,6 @@ func CarIDNotIn(vs ...uuid.UUID) predicate.Rental { v[i] = vs[i] } return predicate.Rental(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldCarID), v...)) }) } diff --git a/entc/integration/edgefield/ent/user/where.go b/entc/integration/edgefield/ent/user/where.go index 66be16574..d48cc1013 100644 --- a/entc/integration/edgefield/ent/user/where.go +++ b/entc/integration/edgefield/ent/user/where.go @@ -118,12 +118,6 @@ func ParentIDIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldParentID), v...)) }) } @@ -135,12 +129,6 @@ func ParentIDNotIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldParentID), v...)) }) } @@ -180,12 +168,6 @@ func SpouseIDIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldSpouseID), v...)) }) } @@ -197,12 +179,6 @@ func SpouseIDNotIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldSpouseID), v...)) }) } diff --git a/entc/integration/edgeschema/ent/friendship/where.go b/entc/integration/edgeschema/ent/friendship/where.go index d763337a0..53d7f693e 100644 --- a/entc/integration/edgeschema/ent/friendship/where.go +++ b/entc/integration/edgeschema/ent/friendship/where.go @@ -134,12 +134,6 @@ func WeightIn(vs ...int) predicate.Friendship { v[i] = vs[i] } return predicate.Friendship(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldWeight), v...)) }) } @@ -151,12 +145,6 @@ func WeightNotIn(vs ...int) predicate.Friendship { v[i] = vs[i] } return predicate.Friendship(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldWeight), v...)) }) } @@ -210,12 +198,6 @@ func CreatedAtIn(vs ...time.Time) predicate.Friendship { v[i] = vs[i] } return predicate.Friendship(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldCreatedAt), v...)) }) } @@ -227,12 +209,6 @@ func CreatedAtNotIn(vs ...time.Time) predicate.Friendship { v[i] = vs[i] } return predicate.Friendship(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldCreatedAt), v...)) }) } @@ -286,12 +262,6 @@ func UserIDIn(vs ...int) predicate.Friendship { v[i] = vs[i] } return predicate.Friendship(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldUserID), v...)) }) } @@ -303,12 +273,6 @@ func UserIDNotIn(vs ...int) predicate.Friendship { v[i] = vs[i] } return predicate.Friendship(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldUserID), v...)) }) } @@ -334,12 +298,6 @@ func FriendIDIn(vs ...int) predicate.Friendship { v[i] = vs[i] } return predicate.Friendship(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldFriendID), v...)) }) } @@ -351,12 +309,6 @@ func FriendIDNotIn(vs ...int) predicate.Friendship { v[i] = vs[i] } return predicate.Friendship(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldFriendID), v...)) }) } diff --git a/entc/integration/edgeschema/ent/group/where.go b/entc/integration/edgeschema/ent/group/where.go index 61e7bc62f..953f2939c 100644 --- a/entc/integration/edgeschema/ent/group/where.go +++ b/entc/integration/edgeschema/ent/group/where.go @@ -111,12 +111,6 @@ func NameIn(vs ...string) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -128,12 +122,6 @@ func NameNotIn(vs ...string) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/entc/integration/edgeschema/ent/relationship/where.go b/entc/integration/edgeschema/ent/relationship/where.go index 36f911199..f0699ed60 100644 --- a/entc/integration/edgeschema/ent/relationship/where.go +++ b/entc/integration/edgeschema/ent/relationship/where.go @@ -61,12 +61,6 @@ func WeightIn(vs ...int) predicate.Relationship { v[i] = vs[i] } return predicate.Relationship(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldWeight), v...)) }) } @@ -78,12 +72,6 @@ func WeightNotIn(vs ...int) predicate.Relationship { v[i] = vs[i] } return predicate.Relationship(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldWeight), v...)) }) } @@ -137,12 +125,6 @@ func UserIDIn(vs ...int) predicate.Relationship { v[i] = vs[i] } return predicate.Relationship(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldUserID), v...)) }) } @@ -154,12 +136,6 @@ func UserIDNotIn(vs ...int) predicate.Relationship { v[i] = vs[i] } return predicate.Relationship(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldUserID), v...)) }) } @@ -185,12 +161,6 @@ func RelativeIDIn(vs ...int) predicate.Relationship { v[i] = vs[i] } return predicate.Relationship(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldRelativeID), v...)) }) } @@ -202,12 +172,6 @@ func RelativeIDNotIn(vs ...int) predicate.Relationship { v[i] = vs[i] } return predicate.Relationship(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldRelativeID), v...)) }) } @@ -233,12 +197,6 @@ func InfoIDIn(vs ...int) predicate.Relationship { v[i] = vs[i] } return predicate.Relationship(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldInfoID), v...)) }) } @@ -250,12 +208,6 @@ func InfoIDNotIn(vs ...int) predicate.Relationship { v[i] = vs[i] } return predicate.Relationship(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldInfoID), v...)) }) } diff --git a/entc/integration/edgeschema/ent/relationshipinfo/where.go b/entc/integration/edgeschema/ent/relationshipinfo/where.go index 679e23ea6..b2469d202 100644 --- a/entc/integration/edgeschema/ent/relationshipinfo/where.go +++ b/entc/integration/edgeschema/ent/relationshipinfo/where.go @@ -110,12 +110,6 @@ func TextIn(vs ...string) predicate.RelationshipInfo { v[i] = vs[i] } return predicate.RelationshipInfo(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldText), v...)) }) } @@ -127,12 +121,6 @@ func TextNotIn(vs ...string) predicate.RelationshipInfo { v[i] = vs[i] } return predicate.RelationshipInfo(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldText), v...)) }) } diff --git a/entc/integration/edgeschema/ent/role/where.go b/entc/integration/edgeschema/ent/role/where.go index eb97b014f..5d85f416f 100644 --- a/entc/integration/edgeschema/ent/role/where.go +++ b/entc/integration/edgeschema/ent/role/where.go @@ -120,12 +120,6 @@ func NameIn(vs ...string) predicate.Role { v[i] = vs[i] } return predicate.Role(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -137,12 +131,6 @@ func NameNotIn(vs ...string) predicate.Role { v[i] = vs[i] } return predicate.Role(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } @@ -231,12 +219,6 @@ func CreatedAtIn(vs ...time.Time) predicate.Role { v[i] = vs[i] } return predicate.Role(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldCreatedAt), v...)) }) } @@ -248,12 +230,6 @@ func CreatedAtNotIn(vs ...time.Time) predicate.Role { v[i] = vs[i] } return predicate.Role(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldCreatedAt), v...)) }) } diff --git a/entc/integration/edgeschema/ent/roleuser/where.go b/entc/integration/edgeschema/ent/roleuser/where.go index 7e62efd9f..cb9886e61 100644 --- a/entc/integration/edgeschema/ent/roleuser/where.go +++ b/entc/integration/edgeschema/ent/roleuser/where.go @@ -56,12 +56,6 @@ func CreatedAtIn(vs ...time.Time) predicate.RoleUser { v[i] = vs[i] } return predicate.RoleUser(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldCreatedAt), v...)) }) } @@ -73,12 +67,6 @@ func CreatedAtNotIn(vs ...time.Time) predicate.RoleUser { v[i] = vs[i] } return predicate.RoleUser(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldCreatedAt), v...)) }) } @@ -132,12 +120,6 @@ func RoleIDIn(vs ...int) predicate.RoleUser { v[i] = vs[i] } return predicate.RoleUser(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldRoleID), v...)) }) } @@ -149,12 +131,6 @@ func RoleIDNotIn(vs ...int) predicate.RoleUser { v[i] = vs[i] } return predicate.RoleUser(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldRoleID), v...)) }) } @@ -180,12 +156,6 @@ func UserIDIn(vs ...int) predicate.RoleUser { v[i] = vs[i] } return predicate.RoleUser(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldUserID), v...)) }) } @@ -197,12 +167,6 @@ func UserIDNotIn(vs ...int) predicate.RoleUser { v[i] = vs[i] } return predicate.RoleUser(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldUserID), v...)) }) } diff --git a/entc/integration/edgeschema/ent/tag/where.go b/entc/integration/edgeschema/ent/tag/where.go index 71acfbc8b..9e98e5f57 100644 --- a/entc/integration/edgeschema/ent/tag/where.go +++ b/entc/integration/edgeschema/ent/tag/where.go @@ -111,12 +111,6 @@ func ValueIn(vs ...string) predicate.Tag { v[i] = vs[i] } return predicate.Tag(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldValue), v...)) }) } @@ -128,12 +122,6 @@ func ValueNotIn(vs ...string) predicate.Tag { v[i] = vs[i] } return predicate.Tag(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldValue), v...)) }) } diff --git a/entc/integration/edgeschema/ent/tweet/where.go b/entc/integration/edgeschema/ent/tweet/where.go index 150348aa5..9961e03f5 100644 --- a/entc/integration/edgeschema/ent/tweet/where.go +++ b/entc/integration/edgeschema/ent/tweet/where.go @@ -111,12 +111,6 @@ func TextIn(vs ...string) predicate.Tweet { v[i] = vs[i] } return predicate.Tweet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldText), v...)) }) } @@ -128,12 +122,6 @@ func TextNotIn(vs ...string) predicate.Tweet { v[i] = vs[i] } return predicate.Tweet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldText), v...)) }) } diff --git a/entc/integration/edgeschema/ent/tweetlike/where.go b/entc/integration/edgeschema/ent/tweetlike/where.go index 887992f28..c23406cda 100644 --- a/entc/integration/edgeschema/ent/tweetlike/where.go +++ b/entc/integration/edgeschema/ent/tweetlike/where.go @@ -56,12 +56,6 @@ func LikedAtIn(vs ...time.Time) predicate.TweetLike { v[i] = vs[i] } return predicate.TweetLike(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldLikedAt), v...)) }) } @@ -73,12 +67,6 @@ func LikedAtNotIn(vs ...time.Time) predicate.TweetLike { v[i] = vs[i] } return predicate.TweetLike(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldLikedAt), v...)) }) } @@ -132,12 +120,6 @@ func UserIDIn(vs ...int) predicate.TweetLike { v[i] = vs[i] } return predicate.TweetLike(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldUserID), v...)) }) } @@ -149,12 +131,6 @@ func UserIDNotIn(vs ...int) predicate.TweetLike { v[i] = vs[i] } return predicate.TweetLike(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldUserID), v...)) }) } @@ -180,12 +156,6 @@ func TweetIDIn(vs ...int) predicate.TweetLike { v[i] = vs[i] } return predicate.TweetLike(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldTweetID), v...)) }) } @@ -197,12 +167,6 @@ func TweetIDNotIn(vs ...int) predicate.TweetLike { v[i] = vs[i] } return predicate.TweetLike(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldTweetID), v...)) }) } diff --git a/entc/integration/edgeschema/ent/tweettag/where.go b/entc/integration/edgeschema/ent/tweettag/where.go index a27f4b0f5..a0cba057d 100644 --- a/entc/integration/edgeschema/ent/tweettag/where.go +++ b/entc/integration/edgeschema/ent/tweettag/where.go @@ -128,12 +128,6 @@ func AddedAtIn(vs ...time.Time) predicate.TweetTag { v[i] = vs[i] } return predicate.TweetTag(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAddedAt), v...)) }) } @@ -145,12 +139,6 @@ func AddedAtNotIn(vs ...time.Time) predicate.TweetTag { v[i] = vs[i] } return predicate.TweetTag(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAddedAt), v...)) }) } @@ -204,12 +192,6 @@ func TagIDIn(vs ...int) predicate.TweetTag { v[i] = vs[i] } return predicate.TweetTag(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldTagID), v...)) }) } @@ -221,12 +203,6 @@ func TagIDNotIn(vs ...int) predicate.TweetTag { v[i] = vs[i] } return predicate.TweetTag(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldTagID), v...)) }) } @@ -252,12 +228,6 @@ func TweetIDIn(vs ...int) predicate.TweetTag { v[i] = vs[i] } return predicate.TweetTag(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldTweetID), v...)) }) } @@ -269,12 +239,6 @@ func TweetIDNotIn(vs ...int) predicate.TweetTag { v[i] = vs[i] } return predicate.TweetTag(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldTweetID), v...)) }) } diff --git a/entc/integration/edgeschema/ent/user/where.go b/entc/integration/edgeschema/ent/user/where.go index 97f12e7de..f391956ed 100644 --- a/entc/integration/edgeschema/ent/user/where.go +++ b/entc/integration/edgeschema/ent/user/where.go @@ -111,12 +111,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -128,12 +122,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/entc/integration/edgeschema/ent/usergroup/where.go b/entc/integration/edgeschema/ent/usergroup/where.go index 49fd7b709..ce2a569d8 100644 --- a/entc/integration/edgeschema/ent/usergroup/where.go +++ b/entc/integration/edgeschema/ent/usergroup/where.go @@ -127,12 +127,6 @@ func JoinedAtIn(vs ...time.Time) predicate.UserGroup { v[i] = vs[i] } return predicate.UserGroup(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldJoinedAt), v...)) }) } @@ -144,12 +138,6 @@ func JoinedAtNotIn(vs ...time.Time) predicate.UserGroup { v[i] = vs[i] } return predicate.UserGroup(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldJoinedAt), v...)) }) } @@ -203,12 +191,6 @@ func UserIDIn(vs ...int) predicate.UserGroup { v[i] = vs[i] } return predicate.UserGroup(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldUserID), v...)) }) } @@ -220,12 +202,6 @@ func UserIDNotIn(vs ...int) predicate.UserGroup { v[i] = vs[i] } return predicate.UserGroup(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldUserID), v...)) }) } @@ -251,12 +227,6 @@ func GroupIDIn(vs ...int) predicate.UserGroup { v[i] = vs[i] } return predicate.UserGroup(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldGroupID), v...)) }) } @@ -268,12 +238,6 @@ func GroupIDNotIn(vs ...int) predicate.UserGroup { v[i] = vs[i] } return predicate.UserGroup(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldGroupID), v...)) }) } diff --git a/entc/integration/edgeschema/ent/usertweet/where.go b/entc/integration/edgeschema/ent/usertweet/where.go index 971860103..da7d9c089 100644 --- a/entc/integration/edgeschema/ent/usertweet/where.go +++ b/entc/integration/edgeschema/ent/usertweet/where.go @@ -127,12 +127,6 @@ func CreatedAtIn(vs ...time.Time) predicate.UserTweet { v[i] = vs[i] } return predicate.UserTweet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldCreatedAt), v...)) }) } @@ -144,12 +138,6 @@ func CreatedAtNotIn(vs ...time.Time) predicate.UserTweet { v[i] = vs[i] } return predicate.UserTweet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldCreatedAt), v...)) }) } @@ -203,12 +191,6 @@ func UserIDIn(vs ...int) predicate.UserTweet { v[i] = vs[i] } return predicate.UserTweet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldUserID), v...)) }) } @@ -220,12 +202,6 @@ func UserIDNotIn(vs ...int) predicate.UserTweet { v[i] = vs[i] } return predicate.UserTweet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldUserID), v...)) }) } @@ -251,12 +227,6 @@ func TweetIDIn(vs ...int) predicate.UserTweet { v[i] = vs[i] } return predicate.UserTweet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldTweetID), v...)) }) } @@ -268,12 +238,6 @@ func TweetIDNotIn(vs ...int) predicate.UserTweet { v[i] = vs[i] } return predicate.UserTweet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldTweetID), v...)) }) } diff --git a/entc/integration/ent/card/where.go b/entc/integration/ent/card/where.go index d97752c52..0d8091f2d 100644 --- a/entc/integration/ent/card/where.go +++ b/entc/integration/ent/card/where.go @@ -141,12 +141,6 @@ func CreateTimeIn(vs ...time.Time) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldCreateTime), v...)) }) } @@ -158,12 +152,6 @@ func CreateTimeNotIn(vs ...time.Time) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldCreateTime), v...)) }) } @@ -217,12 +205,6 @@ func UpdateTimeIn(vs ...time.Time) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldUpdateTime), v...)) }) } @@ -234,12 +216,6 @@ func UpdateTimeNotIn(vs ...time.Time) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldUpdateTime), v...)) }) } @@ -293,12 +269,6 @@ func BalanceIn(vs ...float64) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldBalance), v...)) }) } @@ -310,12 +280,6 @@ func BalanceNotIn(vs ...float64) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldBalance), v...)) }) } @@ -369,12 +333,6 @@ func NumberIn(vs ...string) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNumber), v...)) }) } @@ -386,12 +344,6 @@ func NumberNotIn(vs ...string) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNumber), v...)) }) } @@ -480,12 +432,6 @@ func NameIn(vs ...string) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -497,12 +443,6 @@ func NameNotIn(vs ...string) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/entc/integration/ent/comment/where.go b/entc/integration/ent/comment/where.go index b1bafb137..c537750b8 100644 --- a/entc/integration/ent/comment/where.go +++ b/entc/integration/ent/comment/where.go @@ -124,12 +124,6 @@ func UniqueIntIn(vs ...int) predicate.Comment { v[i] = vs[i] } return predicate.Comment(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldUniqueInt), v...)) }) } @@ -141,12 +135,6 @@ func UniqueIntNotIn(vs ...int) predicate.Comment { v[i] = vs[i] } return predicate.Comment(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldUniqueInt), v...)) }) } @@ -200,12 +188,6 @@ func UniqueFloatIn(vs ...float64) predicate.Comment { v[i] = vs[i] } return predicate.Comment(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldUniqueFloat), v...)) }) } @@ -217,12 +199,6 @@ func UniqueFloatNotIn(vs ...float64) predicate.Comment { v[i] = vs[i] } return predicate.Comment(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldUniqueFloat), v...)) }) } @@ -276,12 +252,6 @@ func NillableIntIn(vs ...int) predicate.Comment { v[i] = vs[i] } return predicate.Comment(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNillableInt), v...)) }) } @@ -293,12 +263,6 @@ func NillableIntNotIn(vs ...int) predicate.Comment { v[i] = vs[i] } return predicate.Comment(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNillableInt), v...)) }) } @@ -366,12 +330,6 @@ func TableIn(vs ...string) predicate.Comment { v[i] = vs[i] } return predicate.Comment(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldTable), v...)) }) } @@ -383,12 +341,6 @@ func TableNotIn(vs ...string) predicate.Comment { v[i] = vs[i] } return predicate.Comment(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldTable), v...)) }) } diff --git a/entc/integration/ent/fieldtype/where.go b/entc/integration/ent/fieldtype/where.go index 5cd377397..53840ceee 100644 --- a/entc/integration/ent/fieldtype/where.go +++ b/entc/integration/ent/fieldtype/where.go @@ -548,12 +548,6 @@ func IntIn(vs ...int) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldInt), v...)) }) } @@ -565,12 +559,6 @@ func IntNotIn(vs ...int) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldInt), v...)) }) } @@ -624,12 +612,6 @@ func Int8In(vs ...int8) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldInt8), v...)) }) } @@ -641,12 +623,6 @@ func Int8NotIn(vs ...int8) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldInt8), v...)) }) } @@ -700,12 +676,6 @@ func Int16In(vs ...int16) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldInt16), v...)) }) } @@ -717,12 +687,6 @@ func Int16NotIn(vs ...int16) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldInt16), v...)) }) } @@ -776,12 +740,6 @@ func Int32In(vs ...int32) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldInt32), v...)) }) } @@ -793,12 +751,6 @@ func Int32NotIn(vs ...int32) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldInt32), v...)) }) } @@ -852,12 +804,6 @@ func Int64In(vs ...int64) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldInt64), v...)) }) } @@ -869,12 +815,6 @@ func Int64NotIn(vs ...int64) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldInt64), v...)) }) } @@ -928,12 +868,6 @@ func OptionalIntIn(vs ...int) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldOptionalInt), v...)) }) } @@ -945,12 +879,6 @@ func OptionalIntNotIn(vs ...int) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldOptionalInt), v...)) }) } @@ -1018,12 +946,6 @@ func OptionalInt8In(vs ...int8) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldOptionalInt8), v...)) }) } @@ -1035,12 +957,6 @@ func OptionalInt8NotIn(vs ...int8) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldOptionalInt8), v...)) }) } @@ -1108,12 +1024,6 @@ func OptionalInt16In(vs ...int16) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldOptionalInt16), v...)) }) } @@ -1125,12 +1035,6 @@ func OptionalInt16NotIn(vs ...int16) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldOptionalInt16), v...)) }) } @@ -1198,12 +1102,6 @@ func OptionalInt32In(vs ...int32) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldOptionalInt32), v...)) }) } @@ -1215,12 +1113,6 @@ func OptionalInt32NotIn(vs ...int32) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldOptionalInt32), v...)) }) } @@ -1288,12 +1180,6 @@ func OptionalInt64In(vs ...int64) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldOptionalInt64), v...)) }) } @@ -1305,12 +1191,6 @@ func OptionalInt64NotIn(vs ...int64) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldOptionalInt64), v...)) }) } @@ -1378,12 +1258,6 @@ func NillableIntIn(vs ...int) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNillableInt), v...)) }) } @@ -1395,12 +1269,6 @@ func NillableIntNotIn(vs ...int) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNillableInt), v...)) }) } @@ -1468,12 +1336,6 @@ func NillableInt8In(vs ...int8) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNillableInt8), v...)) }) } @@ -1485,12 +1347,6 @@ func NillableInt8NotIn(vs ...int8) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNillableInt8), v...)) }) } @@ -1558,12 +1414,6 @@ func NillableInt16In(vs ...int16) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNillableInt16), v...)) }) } @@ -1575,12 +1425,6 @@ func NillableInt16NotIn(vs ...int16) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNillableInt16), v...)) }) } @@ -1648,12 +1492,6 @@ func NillableInt32In(vs ...int32) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNillableInt32), v...)) }) } @@ -1665,12 +1503,6 @@ func NillableInt32NotIn(vs ...int32) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNillableInt32), v...)) }) } @@ -1738,12 +1570,6 @@ func NillableInt64In(vs ...int64) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNillableInt64), v...)) }) } @@ -1755,12 +1581,6 @@ func NillableInt64NotIn(vs ...int64) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNillableInt64), v...)) }) } @@ -1828,12 +1648,6 @@ func ValidateOptionalInt32In(vs ...int32) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldValidateOptionalInt32), v...)) }) } @@ -1845,12 +1659,6 @@ func ValidateOptionalInt32NotIn(vs ...int32) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldValidateOptionalInt32), v...)) }) } @@ -1918,12 +1726,6 @@ func OptionalUintIn(vs ...uint) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldOptionalUint), v...)) }) } @@ -1935,12 +1737,6 @@ func OptionalUintNotIn(vs ...uint) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldOptionalUint), v...)) }) } @@ -2008,12 +1804,6 @@ func OptionalUint8In(vs ...uint8) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldOptionalUint8), v...)) }) } @@ -2025,12 +1815,6 @@ func OptionalUint8NotIn(vs ...uint8) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldOptionalUint8), v...)) }) } @@ -2098,12 +1882,6 @@ func OptionalUint16In(vs ...uint16) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldOptionalUint16), v...)) }) } @@ -2115,12 +1893,6 @@ func OptionalUint16NotIn(vs ...uint16) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldOptionalUint16), v...)) }) } @@ -2188,12 +1960,6 @@ func OptionalUint32In(vs ...uint32) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldOptionalUint32), v...)) }) } @@ -2205,12 +1971,6 @@ func OptionalUint32NotIn(vs ...uint32) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldOptionalUint32), v...)) }) } @@ -2278,12 +2038,6 @@ func OptionalUint64In(vs ...uint64) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldOptionalUint64), v...)) }) } @@ -2295,12 +2049,6 @@ func OptionalUint64NotIn(vs ...uint64) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldOptionalUint64), v...)) }) } @@ -2368,12 +2116,6 @@ func StateIn(vs ...State) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldState), v...)) }) } @@ -2385,12 +2127,6 @@ func StateNotIn(vs ...State) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldState), v...)) }) } @@ -2430,12 +2166,6 @@ func OptionalFloatIn(vs ...float64) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldOptionalFloat), v...)) }) } @@ -2447,12 +2177,6 @@ func OptionalFloatNotIn(vs ...float64) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldOptionalFloat), v...)) }) } @@ -2520,12 +2244,6 @@ func OptionalFloat32In(vs ...float32) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldOptionalFloat32), v...)) }) } @@ -2537,12 +2255,6 @@ func OptionalFloat32NotIn(vs ...float32) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldOptionalFloat32), v...)) }) } @@ -2610,12 +2322,6 @@ func TextIn(vs ...string) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldText), v...)) }) } @@ -2627,12 +2333,6 @@ func TextNotIn(vs ...string) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldText), v...)) }) } @@ -2735,12 +2435,6 @@ func DatetimeIn(vs ...time.Time) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldDatetime), v...)) }) } @@ -2752,12 +2446,6 @@ func DatetimeNotIn(vs ...time.Time) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldDatetime), v...)) }) } @@ -2825,12 +2513,6 @@ func DecimalIn(vs ...float64) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldDecimal), v...)) }) } @@ -2842,12 +2524,6 @@ func DecimalNotIn(vs ...float64) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldDecimal), v...)) }) } @@ -2915,12 +2591,6 @@ func LinkOtherIn(vs ...*schema.Link) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldLinkOther), v...)) }) } @@ -2932,12 +2602,6 @@ func LinkOtherNotIn(vs ...*schema.Link) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldLinkOther), v...)) }) } @@ -3005,12 +2669,6 @@ func LinkOtherFuncIn(vs ...*schema.Link) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldLinkOtherFunc), v...)) }) } @@ -3022,12 +2680,6 @@ func LinkOtherFuncNotIn(vs ...*schema.Link) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldLinkOtherFunc), v...)) }) } @@ -3095,12 +2747,6 @@ func MACIn(vs ...schema.MAC) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldMAC), v...)) }) } @@ -3112,12 +2758,6 @@ func MACNotIn(vs ...schema.MAC) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldMAC), v...)) }) } @@ -3225,12 +2865,6 @@ func StringArrayIn(vs ...schema.Strings) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldStringArray), v...)) }) } @@ -3242,12 +2876,6 @@ func StringArrayNotIn(vs ...schema.Strings) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldStringArray), v...)) }) } @@ -3315,12 +2943,6 @@ func PasswordIn(vs ...string) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldPassword), v...)) }) } @@ -3332,12 +2954,6 @@ func PasswordNotIn(vs ...string) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldPassword), v...)) }) } @@ -3440,12 +3056,6 @@ func StringScannerIn(vs ...schema.StringScanner) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldStringScanner), v...)) }) } @@ -3457,12 +3067,6 @@ func StringScannerNotIn(vs ...schema.StringScanner) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldStringScanner), v...)) }) } @@ -3572,12 +3176,6 @@ func DurationIn(vs ...time.Duration) predicate.FieldType { v[i] = int64(vs[i]) } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldDuration), v...)) }) } @@ -3589,12 +3187,6 @@ func DurationNotIn(vs ...time.Duration) predicate.FieldType { v[i] = int64(vs[i]) } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldDuration), v...)) }) } @@ -3668,12 +3260,6 @@ func DirIn(vs ...http.Dir) predicate.FieldType { v[i] = string(vs[i]) } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldDir), v...)) }) } @@ -3685,12 +3271,6 @@ func DirNotIn(vs ...http.Dir) predicate.FieldType { v[i] = string(vs[i]) } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldDir), v...)) }) } @@ -3790,12 +3370,6 @@ func NdirIn(vs ...http.Dir) predicate.FieldType { v[i] = string(vs[i]) } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNdir), v...)) }) } @@ -3807,12 +3381,6 @@ func NdirNotIn(vs ...http.Dir) predicate.FieldType { v[i] = string(vs[i]) } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNdir), v...)) }) } @@ -3924,12 +3492,6 @@ func StrIn(vs ...sql.NullString) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldStr), v...)) }) } @@ -3941,12 +3503,6 @@ func StrNotIn(vs ...sql.NullString) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldStr), v...)) }) } @@ -4054,12 +3610,6 @@ func NullStrIn(vs ...*sql.NullString) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNullStr), v...)) }) } @@ -4071,12 +3621,6 @@ func NullStrNotIn(vs ...*sql.NullString) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNullStr), v...)) }) } @@ -4184,12 +3728,6 @@ func LinkIn(vs ...schema.Link) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldLink), v...)) }) } @@ -4201,12 +3739,6 @@ func LinkNotIn(vs ...schema.Link) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldLink), v...)) }) } @@ -4314,12 +3846,6 @@ func NullLinkIn(vs ...*schema.Link) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNullLink), v...)) }) } @@ -4331,12 +3857,6 @@ func NullLinkNotIn(vs ...*schema.Link) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNullLink), v...)) }) } @@ -4532,12 +4052,6 @@ func DeletedAtIn(vs ...*sql.NullTime) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldDeletedAt), v...)) }) } @@ -4549,12 +4063,6 @@ func DeletedAtNotIn(vs ...*sql.NullTime) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldDeletedAt), v...)) }) } @@ -4622,12 +4130,6 @@ func RawDataIn(vs ...[]byte) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldRawData), v...)) }) } @@ -4639,12 +4141,6 @@ func RawDataNotIn(vs ...[]byte) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldRawData), v...)) }) } @@ -4712,12 +4208,6 @@ func SensitiveIn(vs ...[]byte) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldSensitive), v...)) }) } @@ -4729,12 +4219,6 @@ func SensitiveNotIn(vs ...[]byte) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldSensitive), v...)) }) } @@ -4804,12 +4288,6 @@ func IPIn(vs ...net.IP) predicate.FieldType { v[i] = []byte(vs[i]) } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldIP), v...)) }) } @@ -4821,12 +4299,6 @@ func IPNotIn(vs ...net.IP) predicate.FieldType { v[i] = []byte(vs[i]) } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldIP), v...)) }) } @@ -4898,12 +4370,6 @@ func NullInt64In(vs ...*sql.NullInt64) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNullInt64), v...)) }) } @@ -4915,12 +4381,6 @@ func NullInt64NotIn(vs ...*sql.NullInt64) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNullInt64), v...)) }) } @@ -4990,12 +4450,6 @@ func SchemaIntIn(vs ...schema.Int) predicate.FieldType { v[i] = int(vs[i]) } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldSchemaInt), v...)) }) } @@ -5007,12 +4461,6 @@ func SchemaIntNotIn(vs ...schema.Int) predicate.FieldType { v[i] = int(vs[i]) } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldSchemaInt), v...)) }) } @@ -5086,12 +4534,6 @@ func SchemaInt8In(vs ...schema.Int8) predicate.FieldType { v[i] = int8(vs[i]) } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldSchemaInt8), v...)) }) } @@ -5103,12 +4545,6 @@ func SchemaInt8NotIn(vs ...schema.Int8) predicate.FieldType { v[i] = int8(vs[i]) } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldSchemaInt8), v...)) }) } @@ -5182,12 +4618,6 @@ func SchemaInt64In(vs ...schema.Int64) predicate.FieldType { v[i] = int64(vs[i]) } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldSchemaInt64), v...)) }) } @@ -5199,12 +4629,6 @@ func SchemaInt64NotIn(vs ...schema.Int64) predicate.FieldType { v[i] = int64(vs[i]) } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldSchemaInt64), v...)) }) } @@ -5278,12 +4702,6 @@ func SchemaFloatIn(vs ...schema.Float64) predicate.FieldType { v[i] = float64(vs[i]) } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldSchemaFloat), v...)) }) } @@ -5295,12 +4713,6 @@ func SchemaFloatNotIn(vs ...schema.Float64) predicate.FieldType { v[i] = float64(vs[i]) } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldSchemaFloat), v...)) }) } @@ -5374,12 +4786,6 @@ func SchemaFloat32In(vs ...schema.Float32) predicate.FieldType { v[i] = float32(vs[i]) } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldSchemaFloat32), v...)) }) } @@ -5391,12 +4797,6 @@ func SchemaFloat32NotIn(vs ...schema.Float32) predicate.FieldType { v[i] = float32(vs[i]) } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldSchemaFloat32), v...)) }) } @@ -5468,12 +4868,6 @@ func NullFloatIn(vs ...*sql.NullFloat64) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNullFloat), v...)) }) } @@ -5485,12 +4879,6 @@ func NullFloatNotIn(vs ...*sql.NullFloat64) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNullFloat), v...)) }) } @@ -5560,12 +4948,6 @@ func RoleIn(vs ...role.Role) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldRole), v...)) }) } @@ -5577,12 +4959,6 @@ func RoleNotIn(vs ...role.Role) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldRole), v...)) }) } @@ -5608,12 +4984,6 @@ func PriorityIn(vs ...role.Priority) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldPriority), v...)) }) } @@ -5625,12 +4995,6 @@ func PriorityNotIn(vs ...role.Priority) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldPriority), v...)) }) } @@ -5670,12 +5034,6 @@ func OptionalUUIDIn(vs ...uuid.UUID) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldOptionalUUID), v...)) }) } @@ -5687,12 +5045,6 @@ func OptionalUUIDNotIn(vs ...uuid.UUID) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldOptionalUUID), v...)) }) } @@ -5760,12 +5112,6 @@ func NillableUUIDIn(vs ...uuid.UUID) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNillableUUID), v...)) }) } @@ -5777,12 +5123,6 @@ func NillableUUIDNotIn(vs ...uuid.UUID) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNillableUUID), v...)) }) } @@ -5864,12 +5204,6 @@ func PairIn(vs ...schema.Pair) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldPair), v...)) }) } @@ -5881,12 +5215,6 @@ func PairNotIn(vs ...schema.Pair) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldPair), v...)) }) } @@ -5940,12 +5268,6 @@ func NilPairIn(vs ...*schema.Pair) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNilPair), v...)) }) } @@ -5957,12 +5279,6 @@ func NilPairNotIn(vs ...*schema.Pair) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNilPair), v...)) }) } @@ -6030,12 +5346,6 @@ func VstringIn(vs ...schema.VString) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldVstring), v...)) }) } @@ -6047,12 +5357,6 @@ func VstringNotIn(vs ...schema.VString) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldVstring), v...)) }) } @@ -6146,12 +5450,6 @@ func TripleIn(vs ...schema.Triple) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldTriple), v...)) }) } @@ -6163,12 +5461,6 @@ func TripleNotIn(vs ...schema.Triple) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldTriple), v...)) }) } @@ -6222,12 +5514,6 @@ func BigIntIn(vs ...schema.BigInt) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldBigInt), v...)) }) } @@ -6239,12 +5525,6 @@ func BigIntNotIn(vs ...schema.BigInt) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldBigInt), v...)) }) } @@ -6312,12 +5592,6 @@ func PasswordOtherIn(vs ...schema.Password) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldPasswordOther), v...)) }) } @@ -6329,12 +5603,6 @@ func PasswordOtherNotIn(vs ...schema.Password) predicate.FieldType { v[i] = vs[i] } return predicate.FieldType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldPasswordOther), v...)) }) } diff --git a/entc/integration/ent/file/where.go b/entc/integration/ent/file/where.go index 6cbaa1e01..bca76e9ef 100644 --- a/entc/integration/ent/file/where.go +++ b/entc/integration/ent/file/where.go @@ -139,12 +139,6 @@ func SizeIn(vs ...int) predicate.File { v[i] = vs[i] } return predicate.File(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldSize), v...)) }) } @@ -156,12 +150,6 @@ func SizeNotIn(vs ...int) predicate.File { v[i] = vs[i] } return predicate.File(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldSize), v...)) }) } @@ -215,12 +203,6 @@ func NameIn(vs ...string) predicate.File { v[i] = vs[i] } return predicate.File(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -232,12 +214,6 @@ func NameNotIn(vs ...string) predicate.File { v[i] = vs[i] } return predicate.File(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } @@ -326,12 +302,6 @@ func UserIn(vs ...string) predicate.File { v[i] = vs[i] } return predicate.File(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldUser), v...)) }) } @@ -343,12 +313,6 @@ func UserNotIn(vs ...string) predicate.File { v[i] = vs[i] } return predicate.File(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldUser), v...)) }) } @@ -451,12 +415,6 @@ func GroupIn(vs ...string) predicate.File { v[i] = vs[i] } return predicate.File(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldGroup), v...)) }) } @@ -468,12 +426,6 @@ func GroupNotIn(vs ...string) predicate.File { v[i] = vs[i] } return predicate.File(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldGroup), v...)) }) } diff --git a/entc/integration/ent/filetype/where.go b/entc/integration/ent/filetype/where.go index 4ec4fafa6..07d258d55 100644 --- a/entc/integration/ent/filetype/where.go +++ b/entc/integration/ent/filetype/where.go @@ -111,12 +111,6 @@ func NameIn(vs ...string) predicate.FileType { v[i] = vs[i] } return predicate.FileType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -128,12 +122,6 @@ func NameNotIn(vs ...string) predicate.FileType { v[i] = vs[i] } return predicate.FileType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } @@ -222,12 +210,6 @@ func TypeIn(vs ...Type) predicate.FileType { v[i] = vs[i] } return predicate.FileType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldType), v...)) }) } @@ -239,12 +221,6 @@ func TypeNotIn(vs ...Type) predicate.FileType { v[i] = vs[i] } return predicate.FileType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldType), v...)) }) } @@ -270,12 +246,6 @@ func StateIn(vs ...State) predicate.FileType { v[i] = vs[i] } return predicate.FileType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldState), v...)) }) } @@ -287,12 +257,6 @@ func StateNotIn(vs ...State) predicate.FileType { v[i] = vs[i] } return predicate.FileType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldState), v...)) }) } diff --git a/entc/integration/ent/group/where.go b/entc/integration/ent/group/where.go index 9b8a4dccc..925b5dfc5 100644 --- a/entc/integration/ent/group/where.go +++ b/entc/integration/ent/group/where.go @@ -155,12 +155,6 @@ func ExpireIn(vs ...time.Time) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldExpire), v...)) }) } @@ -172,12 +166,6 @@ func ExpireNotIn(vs ...time.Time) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldExpire), v...)) }) } @@ -231,12 +219,6 @@ func TypeIn(vs ...string) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldType), v...)) }) } @@ -248,12 +230,6 @@ func TypeNotIn(vs ...string) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldType), v...)) }) } @@ -356,12 +332,6 @@ func MaxUsersIn(vs ...int) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldMaxUsers), v...)) }) } @@ -373,12 +343,6 @@ func MaxUsersNotIn(vs ...int) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldMaxUsers), v...)) }) } @@ -446,12 +410,6 @@ func NameIn(vs ...string) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -463,12 +421,6 @@ func NameNotIn(vs ...string) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/entc/integration/ent/groupinfo/where.go b/entc/integration/ent/groupinfo/where.go index 58c78c6a1..7c05d9ee0 100644 --- a/entc/integration/ent/groupinfo/where.go +++ b/entc/integration/ent/groupinfo/where.go @@ -118,12 +118,6 @@ func DescIn(vs ...string) predicate.GroupInfo { v[i] = vs[i] } return predicate.GroupInfo(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldDesc), v...)) }) } @@ -135,12 +129,6 @@ func DescNotIn(vs ...string) predicate.GroupInfo { v[i] = vs[i] } return predicate.GroupInfo(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldDesc), v...)) }) } @@ -229,12 +217,6 @@ func MaxUsersIn(vs ...int) predicate.GroupInfo { v[i] = vs[i] } return predicate.GroupInfo(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldMaxUsers), v...)) }) } @@ -246,12 +228,6 @@ func MaxUsersNotIn(vs ...int) predicate.GroupInfo { v[i] = vs[i] } return predicate.GroupInfo(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldMaxUsers), v...)) }) } diff --git a/entc/integration/ent/item/where.go b/entc/integration/ent/item/where.go index 7b7f2746c..03e8dd685 100644 --- a/entc/integration/ent/item/where.go +++ b/entc/integration/ent/item/where.go @@ -110,12 +110,6 @@ func TextIn(vs ...string) predicate.Item { v[i] = vs[i] } return predicate.Item(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldText), v...)) }) } @@ -127,12 +121,6 @@ func TextNotIn(vs ...string) predicate.Item { v[i] = vs[i] } return predicate.Item(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldText), v...)) }) } diff --git a/entc/integration/ent/node/where.go b/entc/integration/ent/node/where.go index 5f8773f7c..12363b6b8 100644 --- a/entc/integration/ent/node/where.go +++ b/entc/integration/ent/node/where.go @@ -111,12 +111,6 @@ func ValueIn(vs ...int) predicate.Node { v[i] = vs[i] } return predicate.Node(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldValue), v...)) }) } @@ -128,12 +122,6 @@ func ValueNotIn(vs ...int) predicate.Node { v[i] = vs[i] } return predicate.Node(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldValue), v...)) }) } diff --git a/entc/integration/ent/pet/where.go b/entc/integration/ent/pet/where.go index 1b39f14dd..71ee76bdc 100644 --- a/entc/integration/ent/pet/where.go +++ b/entc/integration/ent/pet/where.go @@ -133,12 +133,6 @@ func AgeIn(vs ...float64) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAge), v...)) }) } @@ -150,12 +144,6 @@ func AgeNotIn(vs ...float64) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAge), v...)) }) } @@ -209,12 +197,6 @@ func NameIn(vs ...string) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -226,12 +208,6 @@ func NameNotIn(vs ...string) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } @@ -320,12 +296,6 @@ func UUIDIn(vs ...uuid.UUID) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldUUID), v...)) }) } @@ -337,12 +307,6 @@ func UUIDNotIn(vs ...uuid.UUID) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldUUID), v...)) }) } @@ -410,12 +374,6 @@ func NicknameIn(vs ...string) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNickname), v...)) }) } @@ -427,12 +385,6 @@ func NicknameNotIn(vs ...string) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNickname), v...)) }) } diff --git a/entc/integration/ent/task/where.go b/entc/integration/ent/task/where.go index 11ddd65b0..d3a74f8f5 100644 --- a/entc/integration/ent/task/where.go +++ b/entc/integration/ent/task/where.go @@ -114,12 +114,6 @@ func PriorityIn(vs ...task.Priority) predicate.Task { v[i] = int(vs[i]) } return predicate.Task(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldPriority), v...)) }) } @@ -131,12 +125,6 @@ func PriorityNotIn(vs ...task.Priority) predicate.Task { v[i] = int(vs[i]) } return predicate.Task(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldPriority), v...)) }) } diff --git a/entc/integration/ent/user/where.go b/entc/integration/ent/user/where.go index d719dbd03..bbe27ac80 100644 --- a/entc/integration/ent/user/where.go +++ b/entc/integration/ent/user/where.go @@ -167,12 +167,6 @@ func OptionalIntIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldOptionalInt), v...)) }) } @@ -184,12 +178,6 @@ func OptionalIntNotIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldOptionalInt), v...)) }) } @@ -257,12 +245,6 @@ func AgeIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAge), v...)) }) } @@ -274,12 +256,6 @@ func AgeNotIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAge), v...)) }) } @@ -333,12 +309,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -350,12 +320,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } @@ -444,12 +408,6 @@ func LastIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldLast), v...)) }) } @@ -461,12 +419,6 @@ func LastNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldLast), v...)) }) } @@ -555,12 +507,6 @@ func NicknameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNickname), v...)) }) } @@ -572,12 +518,6 @@ func NicknameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNickname), v...)) }) } @@ -680,12 +620,6 @@ func AddressIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAddress), v...)) }) } @@ -697,12 +631,6 @@ func AddressNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAddress), v...)) }) } @@ -805,12 +733,6 @@ func PhoneIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldPhone), v...)) }) } @@ -822,12 +744,6 @@ func PhoneNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldPhone), v...)) }) } @@ -930,12 +846,6 @@ func PasswordIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldPassword), v...)) }) } @@ -947,12 +857,6 @@ func PasswordNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldPassword), v...)) }) } @@ -1055,12 +959,6 @@ func RoleIn(vs ...Role) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldRole), v...)) }) } @@ -1072,12 +970,6 @@ func RoleNotIn(vs ...Role) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldRole), v...)) }) } @@ -1103,12 +995,6 @@ func EmploymentIn(vs ...Employment) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldEmployment), v...)) }) } @@ -1120,12 +1006,6 @@ func EmploymentNotIn(vs ...Employment) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldEmployment), v...)) }) } @@ -1151,12 +1031,6 @@ func SSOCertIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldSSOCert), v...)) }) } @@ -1168,12 +1042,6 @@ func SSOCertNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldSSOCert), v...)) }) } diff --git a/entc/integration/hooks/ent/card/where.go b/entc/integration/hooks/ent/card/where.go index 3d4a93f8b..174d01358 100644 --- a/entc/integration/hooks/ent/card/where.go +++ b/entc/integration/hooks/ent/card/where.go @@ -134,12 +134,6 @@ func NumberIn(vs ...string) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNumber), v...)) }) } @@ -151,12 +145,6 @@ func NumberNotIn(vs ...string) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNumber), v...)) }) } @@ -245,12 +233,6 @@ func NameIn(vs ...string) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -262,12 +244,6 @@ func NameNotIn(vs ...string) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } @@ -370,12 +346,6 @@ func CreatedAtIn(vs ...time.Time) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldCreatedAt), v...)) }) } @@ -387,12 +357,6 @@ func CreatedAtNotIn(vs ...time.Time) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldCreatedAt), v...)) }) } @@ -446,12 +410,6 @@ func InHookIn(vs ...string) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldInHook), v...)) }) } @@ -463,12 +421,6 @@ func InHookNotIn(vs ...string) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldInHook), v...)) }) } diff --git a/entc/integration/hooks/ent/user/where.go b/entc/integration/hooks/ent/user/where.go index b43a754d6..9b0246a9c 100644 --- a/entc/integration/hooks/ent/user/where.go +++ b/entc/integration/hooks/ent/user/where.go @@ -132,12 +132,6 @@ func VersionIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldVersion), v...)) }) } @@ -149,12 +143,6 @@ func VersionNotIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldVersion), v...)) }) } @@ -208,12 +196,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -225,12 +207,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } @@ -319,12 +295,6 @@ func WorthIn(vs ...uint) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldWorth), v...)) }) } @@ -336,12 +306,6 @@ func WorthNotIn(vs ...uint) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldWorth), v...)) }) } @@ -409,12 +373,6 @@ func PasswordIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldPassword), v...)) }) } @@ -426,12 +384,6 @@ func PasswordNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldPassword), v...)) }) } diff --git a/entc/integration/idtype/ent/user/where.go b/entc/integration/idtype/ent/user/where.go index e270c65b3..5a12bee0b 100644 --- a/entc/integration/idtype/ent/user/where.go +++ b/entc/integration/idtype/ent/user/where.go @@ -111,12 +111,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -128,12 +122,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/entc/integration/migrate/entv1/conversion/where.go b/entc/integration/migrate/entv1/conversion/where.go index 675dfd523..2d315c32c 100644 --- a/entc/integration/migrate/entv1/conversion/where.go +++ b/entc/integration/migrate/entv1/conversion/where.go @@ -166,12 +166,6 @@ func NameIn(vs ...string) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -183,12 +177,6 @@ func NameNotIn(vs ...string) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } @@ -291,12 +279,6 @@ func Int8ToStringIn(vs ...int8) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldInt8ToString), v...)) }) } @@ -308,12 +290,6 @@ func Int8ToStringNotIn(vs ...int8) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldInt8ToString), v...)) }) } @@ -381,12 +357,6 @@ func Uint8ToStringIn(vs ...uint8) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldUint8ToString), v...)) }) } @@ -398,12 +368,6 @@ func Uint8ToStringNotIn(vs ...uint8) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldUint8ToString), v...)) }) } @@ -471,12 +435,6 @@ func Int16ToStringIn(vs ...int16) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldInt16ToString), v...)) }) } @@ -488,12 +446,6 @@ func Int16ToStringNotIn(vs ...int16) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldInt16ToString), v...)) }) } @@ -561,12 +513,6 @@ func Uint16ToStringIn(vs ...uint16) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldUint16ToString), v...)) }) } @@ -578,12 +524,6 @@ func Uint16ToStringNotIn(vs ...uint16) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldUint16ToString), v...)) }) } @@ -651,12 +591,6 @@ func Int32ToStringIn(vs ...int32) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldInt32ToString), v...)) }) } @@ -668,12 +602,6 @@ func Int32ToStringNotIn(vs ...int32) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldInt32ToString), v...)) }) } @@ -741,12 +669,6 @@ func Uint32ToStringIn(vs ...uint32) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldUint32ToString), v...)) }) } @@ -758,12 +680,6 @@ func Uint32ToStringNotIn(vs ...uint32) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldUint32ToString), v...)) }) } @@ -831,12 +747,6 @@ func Int64ToStringIn(vs ...int64) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldInt64ToString), v...)) }) } @@ -848,12 +758,6 @@ func Int64ToStringNotIn(vs ...int64) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldInt64ToString), v...)) }) } @@ -921,12 +825,6 @@ func Uint64ToStringIn(vs ...uint64) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldUint64ToString), v...)) }) } @@ -938,12 +836,6 @@ func Uint64ToStringNotIn(vs ...uint64) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldUint64ToString), v...)) }) } diff --git a/entc/integration/migrate/entv1/customtype/where.go b/entc/integration/migrate/entv1/customtype/where.go index 2eea7ffea..f9e20e85f 100644 --- a/entc/integration/migrate/entv1/customtype/where.go +++ b/entc/integration/migrate/entv1/customtype/where.go @@ -110,12 +110,6 @@ func CustomIn(vs ...string) predicate.CustomType { v[i] = vs[i] } return predicate.CustomType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldCustom), v...)) }) } @@ -127,12 +121,6 @@ func CustomNotIn(vs ...string) predicate.CustomType { v[i] = vs[i] } return predicate.CustomType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldCustom), v...)) }) } diff --git a/entc/integration/migrate/entv1/user/where.go b/entc/integration/migrate/entv1/user/where.go index 5dc5124db..aa0277d6e 100644 --- a/entc/integration/migrate/entv1/user/where.go +++ b/entc/integration/migrate/entv1/user/where.go @@ -181,12 +181,6 @@ func AgeIn(vs ...int32) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAge), v...)) }) } @@ -198,12 +192,6 @@ func AgeNotIn(vs ...int32) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAge), v...)) }) } @@ -257,12 +245,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -274,12 +256,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } @@ -368,12 +344,6 @@ func DescriptionIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldDescription), v...)) }) } @@ -385,12 +355,6 @@ func DescriptionNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldDescription), v...)) }) } @@ -493,12 +457,6 @@ func NicknameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNickname), v...)) }) } @@ -510,12 +468,6 @@ func NicknameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNickname), v...)) }) } @@ -604,12 +556,6 @@ func AddressIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAddress), v...)) }) } @@ -621,12 +567,6 @@ func AddressNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAddress), v...)) }) } @@ -729,12 +669,6 @@ func RenamedIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldRenamed), v...)) }) } @@ -746,12 +680,6 @@ func RenamedNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldRenamed), v...)) }) } @@ -854,12 +782,6 @@ func OldTokenIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldOldToken), v...)) }) } @@ -871,12 +793,6 @@ func OldTokenNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldOldToken), v...)) }) } @@ -965,12 +881,6 @@ func BlobIn(vs ...[]byte) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldBlob), v...)) }) } @@ -982,12 +892,6 @@ func BlobNotIn(vs ...[]byte) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldBlob), v...)) }) } @@ -1055,12 +959,6 @@ func StateIn(vs ...State) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldState), v...)) }) } @@ -1072,12 +970,6 @@ func StateNotIn(vs ...State) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldState), v...)) }) } @@ -1117,12 +1009,6 @@ func StatusIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldStatus), v...)) }) } @@ -1134,12 +1020,6 @@ func StatusNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldStatus), v...)) }) } @@ -1242,12 +1122,6 @@ func WorkplaceIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldWorkplace), v...)) }) } @@ -1259,12 +1133,6 @@ func WorkplaceNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldWorkplace), v...)) }) } @@ -1367,12 +1235,6 @@ func DropOptionalIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldDropOptional), v...)) }) } @@ -1384,12 +1246,6 @@ func DropOptionalNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldDropOptional), v...)) }) } diff --git a/entc/integration/migrate/entv2/car/where.go b/entc/integration/migrate/entv2/car/where.go index 19325cf05..f8a106c9c 100644 --- a/entc/integration/migrate/entv2/car/where.go +++ b/entc/integration/migrate/entv2/car/where.go @@ -111,12 +111,6 @@ func NameIn(vs ...string) predicate.Car { v[i] = vs[i] } return predicate.Car(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -128,12 +122,6 @@ func NameNotIn(vs ...string) predicate.Car { v[i] = vs[i] } return predicate.Car(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/entc/integration/migrate/entv2/conversion/where.go b/entc/integration/migrate/entv2/conversion/where.go index b334a0066..13b16c296 100644 --- a/entc/integration/migrate/entv2/conversion/where.go +++ b/entc/integration/migrate/entv2/conversion/where.go @@ -166,12 +166,6 @@ func NameIn(vs ...string) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -183,12 +177,6 @@ func NameNotIn(vs ...string) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } @@ -291,12 +279,6 @@ func Int8ToStringIn(vs ...string) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldInt8ToString), v...)) }) } @@ -308,12 +290,6 @@ func Int8ToStringNotIn(vs ...string) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldInt8ToString), v...)) }) } @@ -416,12 +392,6 @@ func Uint8ToStringIn(vs ...string) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldUint8ToString), v...)) }) } @@ -433,12 +403,6 @@ func Uint8ToStringNotIn(vs ...string) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldUint8ToString), v...)) }) } @@ -541,12 +505,6 @@ func Int16ToStringIn(vs ...string) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldInt16ToString), v...)) }) } @@ -558,12 +516,6 @@ func Int16ToStringNotIn(vs ...string) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldInt16ToString), v...)) }) } @@ -666,12 +618,6 @@ func Uint16ToStringIn(vs ...string) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldUint16ToString), v...)) }) } @@ -683,12 +629,6 @@ func Uint16ToStringNotIn(vs ...string) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldUint16ToString), v...)) }) } @@ -791,12 +731,6 @@ func Int32ToStringIn(vs ...string) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldInt32ToString), v...)) }) } @@ -808,12 +742,6 @@ func Int32ToStringNotIn(vs ...string) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldInt32ToString), v...)) }) } @@ -916,12 +844,6 @@ func Uint32ToStringIn(vs ...string) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldUint32ToString), v...)) }) } @@ -933,12 +855,6 @@ func Uint32ToStringNotIn(vs ...string) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldUint32ToString), v...)) }) } @@ -1041,12 +957,6 @@ func Int64ToStringIn(vs ...string) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldInt64ToString), v...)) }) } @@ -1058,12 +968,6 @@ func Int64ToStringNotIn(vs ...string) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldInt64ToString), v...)) }) } @@ -1166,12 +1070,6 @@ func Uint64ToStringIn(vs ...string) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldUint64ToString), v...)) }) } @@ -1183,12 +1081,6 @@ func Uint64ToStringNotIn(vs ...string) predicate.Conversion { v[i] = vs[i] } return predicate.Conversion(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldUint64ToString), v...)) }) } diff --git a/entc/integration/migrate/entv2/customtype/where.go b/entc/integration/migrate/entv2/customtype/where.go index 4215496fb..81415372d 100644 --- a/entc/integration/migrate/entv2/customtype/where.go +++ b/entc/integration/migrate/entv2/customtype/where.go @@ -126,12 +126,6 @@ func CustomIn(vs ...string) predicate.CustomType { v[i] = vs[i] } return predicate.CustomType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldCustom), v...)) }) } @@ -143,12 +137,6 @@ func CustomNotIn(vs ...string) predicate.CustomType { v[i] = vs[i] } return predicate.CustomType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldCustom), v...)) }) } @@ -251,12 +239,6 @@ func Tz0In(vs ...time.Time) predicate.CustomType { v[i] = vs[i] } return predicate.CustomType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldTz0), v...)) }) } @@ -268,12 +250,6 @@ func Tz0NotIn(vs ...time.Time) predicate.CustomType { v[i] = vs[i] } return predicate.CustomType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldTz0), v...)) }) } @@ -341,12 +317,6 @@ func Tz3In(vs ...time.Time) predicate.CustomType { v[i] = vs[i] } return predicate.CustomType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldTz3), v...)) }) } @@ -358,12 +328,6 @@ func Tz3NotIn(vs ...time.Time) predicate.CustomType { v[i] = vs[i] } return predicate.CustomType(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldTz3), v...)) }) } diff --git a/entc/integration/migrate/entv2/media/where.go b/entc/integration/migrate/entv2/media/where.go index 93e74697a..00d6220ab 100644 --- a/entc/integration/migrate/entv2/media/where.go +++ b/entc/integration/migrate/entv2/media/where.go @@ -124,12 +124,6 @@ func SourceIn(vs ...string) predicate.Media { v[i] = vs[i] } return predicate.Media(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldSource), v...)) }) } @@ -141,12 +135,6 @@ func SourceNotIn(vs ...string) predicate.Media { v[i] = vs[i] } return predicate.Media(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldSource), v...)) }) } @@ -249,12 +237,6 @@ func SourceURIIn(vs ...string) predicate.Media { v[i] = vs[i] } return predicate.Media(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldSourceURI), v...)) }) } @@ -266,12 +248,6 @@ func SourceURINotIn(vs ...string) predicate.Media { v[i] = vs[i] } return predicate.Media(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldSourceURI), v...)) }) } @@ -374,12 +350,6 @@ func TextIn(vs ...string) predicate.Media { v[i] = vs[i] } return predicate.Media(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldText), v...)) }) } @@ -391,12 +361,6 @@ func TextNotIn(vs ...string) predicate.Media { v[i] = vs[i] } return predicate.Media(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldText), v...)) }) } diff --git a/entc/integration/migrate/entv2/pet/where.go b/entc/integration/migrate/entv2/pet/where.go index 914f710b9..f8c2c530e 100644 --- a/entc/integration/migrate/entv2/pet/where.go +++ b/entc/integration/migrate/entv2/pet/where.go @@ -111,12 +111,6 @@ func NameIn(vs ...string) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -128,12 +122,6 @@ func NameNotIn(vs ...string) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/entc/integration/migrate/entv2/user/where.go b/entc/integration/migrate/entv2/user/where.go index c44f4dba6..1ac3c5c5b 100644 --- a/entc/integration/migrate/entv2/user/where.go +++ b/entc/integration/migrate/entv2/user/where.go @@ -204,12 +204,6 @@ func MixedStringIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldMixedString), v...)) }) } @@ -221,12 +215,6 @@ func MixedStringNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldMixedString), v...)) }) } @@ -315,12 +303,6 @@ func MixedEnumIn(vs ...MixedEnum) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldMixedEnum), v...)) }) } @@ -332,12 +314,6 @@ func MixedEnumNotIn(vs ...MixedEnum) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldMixedEnum), v...)) }) } @@ -363,12 +339,6 @@ func AgeIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAge), v...)) }) } @@ -380,12 +350,6 @@ func AgeNotIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAge), v...)) }) } @@ -439,12 +403,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -456,12 +414,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } @@ -550,12 +502,6 @@ func DescriptionIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldDescription), v...)) }) } @@ -567,12 +513,6 @@ func DescriptionNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldDescription), v...)) }) } @@ -675,12 +615,6 @@ func NicknameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNickname), v...)) }) } @@ -692,12 +626,6 @@ func NicknameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNickname), v...)) }) } @@ -786,12 +714,6 @@ func PhoneIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldPhone), v...)) }) } @@ -803,12 +725,6 @@ func PhoneNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldPhone), v...)) }) } @@ -897,12 +813,6 @@ func BufferIn(vs ...[]byte) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldBuffer), v...)) }) } @@ -914,12 +824,6 @@ func BufferNotIn(vs ...[]byte) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldBuffer), v...)) }) } @@ -987,12 +891,6 @@ func TitleIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldTitle), v...)) }) } @@ -1004,12 +902,6 @@ func TitleNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldTitle), v...)) }) } @@ -1098,12 +990,6 @@ func NewNameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNewName), v...)) }) } @@ -1115,12 +1001,6 @@ func NewNameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNewName), v...)) }) } @@ -1223,12 +1103,6 @@ func NewTokenIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNewToken), v...)) }) } @@ -1240,12 +1114,6 @@ func NewTokenNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNewToken), v...)) }) } @@ -1334,12 +1202,6 @@ func BlobIn(vs ...[]byte) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldBlob), v...)) }) } @@ -1351,12 +1213,6 @@ func BlobNotIn(vs ...[]byte) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldBlob), v...)) }) } @@ -1424,12 +1280,6 @@ func StateIn(vs ...State) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldState), v...)) }) } @@ -1441,12 +1291,6 @@ func StateNotIn(vs ...State) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldState), v...)) }) } @@ -1486,12 +1330,6 @@ func StatusIn(vs ...Status) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldStatus), v...)) }) } @@ -1503,12 +1341,6 @@ func StatusNotIn(vs ...Status) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldStatus), v...)) }) } @@ -1548,12 +1380,6 @@ func WorkplaceIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldWorkplace), v...)) }) } @@ -1565,12 +1391,6 @@ func WorkplaceNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldWorkplace), v...)) }) } @@ -1673,12 +1493,6 @@ func CreatedAtIn(vs ...time.Time) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldCreatedAt), v...)) }) } @@ -1690,12 +1504,6 @@ func CreatedAtNotIn(vs ...time.Time) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldCreatedAt), v...)) }) } @@ -1749,12 +1557,6 @@ func DropOptionalIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldDropOptional), v...)) }) } @@ -1766,12 +1568,6 @@ func DropOptionalNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldDropOptional), v...)) }) } diff --git a/entc/integration/migrate/versioned/group/where.go b/entc/integration/migrate/versioned/group/where.go index 7a1ff174e..b86b2d840 100644 --- a/entc/integration/migrate/versioned/group/where.go +++ b/entc/integration/migrate/versioned/group/where.go @@ -110,12 +110,6 @@ func NameIn(vs ...string) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -127,12 +121,6 @@ func NameNotIn(vs ...string) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/entc/integration/migrate/versioned/user/where.go b/entc/integration/migrate/versioned/user/where.go index db41950a5..00df1e87e 100644 --- a/entc/integration/migrate/versioned/user/where.go +++ b/entc/integration/migrate/versioned/user/where.go @@ -124,12 +124,6 @@ func AgeIn(vs ...int32) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAge), v...)) }) } @@ -141,12 +135,6 @@ func AgeNotIn(vs ...int32) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAge), v...)) }) } @@ -200,12 +188,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -217,12 +199,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } @@ -311,12 +287,6 @@ func AddressIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAddress), v...)) }) } @@ -328,12 +298,6 @@ func AddressNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAddress), v...)) }) } diff --git a/entc/integration/multischema/ent/group/where.go b/entc/integration/multischema/ent/group/where.go index c3f5a5bab..159d5cd4e 100644 --- a/entc/integration/multischema/ent/group/where.go +++ b/entc/integration/multischema/ent/group/where.go @@ -112,12 +112,6 @@ func NameIn(vs ...string) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -129,12 +123,6 @@ func NameNotIn(vs ...string) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/entc/integration/multischema/ent/pet/where.go b/entc/integration/multischema/ent/pet/where.go index 4d4fa02bc..8ac60186c 100644 --- a/entc/integration/multischema/ent/pet/where.go +++ b/entc/integration/multischema/ent/pet/where.go @@ -119,12 +119,6 @@ func NameIn(vs ...string) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -136,12 +130,6 @@ func NameNotIn(vs ...string) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } @@ -230,12 +218,6 @@ func OwnerIDIn(vs ...int) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldOwnerID), v...)) }) } @@ -247,12 +229,6 @@ func OwnerIDNotIn(vs ...int) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldOwnerID), v...)) }) } diff --git a/entc/integration/multischema/ent/user/where.go b/entc/integration/multischema/ent/user/where.go index 4ad22d13e..c0d486116 100644 --- a/entc/integration/multischema/ent/user/where.go +++ b/entc/integration/multischema/ent/user/where.go @@ -112,12 +112,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -129,12 +123,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/entc/integration/privacy/ent/task/where.go b/entc/integration/privacy/ent/task/where.go index c728a4666..e568d456a 100644 --- a/entc/integration/privacy/ent/task/where.go +++ b/entc/integration/privacy/ent/task/where.go @@ -126,12 +126,6 @@ func TitleIn(vs ...string) predicate.Task { v[i] = vs[i] } return predicate.Task(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldTitle), v...)) }) } @@ -143,12 +137,6 @@ func TitleNotIn(vs ...string) predicate.Task { v[i] = vs[i] } return predicate.Task(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldTitle), v...)) }) } @@ -237,12 +225,6 @@ func DescriptionIn(vs ...string) predicate.Task { v[i] = vs[i] } return predicate.Task(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldDescription), v...)) }) } @@ -254,12 +236,6 @@ func DescriptionNotIn(vs ...string) predicate.Task { v[i] = vs[i] } return predicate.Task(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldDescription), v...)) }) } @@ -362,12 +338,6 @@ func StatusIn(vs ...Status) predicate.Task { v[i] = vs[i] } return predicate.Task(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldStatus), v...)) }) } @@ -379,12 +349,6 @@ func StatusNotIn(vs ...Status) predicate.Task { v[i] = vs[i] } return predicate.Task(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldStatus), v...)) }) } @@ -410,12 +374,6 @@ func UUIDIn(vs ...uuid.UUID) predicate.Task { v[i] = vs[i] } return predicate.Task(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldUUID), v...)) }) } @@ -427,12 +385,6 @@ func UUIDNotIn(vs ...uuid.UUID) predicate.Task { v[i] = vs[i] } return predicate.Task(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldUUID), v...)) }) } diff --git a/entc/integration/privacy/ent/team/where.go b/entc/integration/privacy/ent/team/where.go index 23ef21a8b..21cbde879 100644 --- a/entc/integration/privacy/ent/team/where.go +++ b/entc/integration/privacy/ent/team/where.go @@ -111,12 +111,6 @@ func NameIn(vs ...string) predicate.Team { v[i] = vs[i] } return predicate.Team(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -128,12 +122,6 @@ func NameNotIn(vs ...string) predicate.Team { v[i] = vs[i] } return predicate.Team(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/entc/integration/privacy/ent/user/where.go b/entc/integration/privacy/ent/user/where.go index c9205f8a4..e4f29cd1e 100644 --- a/entc/integration/privacy/ent/user/where.go +++ b/entc/integration/privacy/ent/user/where.go @@ -118,12 +118,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -135,12 +129,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } @@ -229,12 +217,6 @@ func AgeIn(vs ...uint) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAge), v...)) }) } @@ -246,12 +228,6 @@ func AgeNotIn(vs ...uint) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAge), v...)) }) } diff --git a/entc/integration/template/ent/group/where.go b/entc/integration/template/ent/group/where.go index a1b568bf0..d51e2aa53 100644 --- a/entc/integration/template/ent/group/where.go +++ b/entc/integration/template/ent/group/where.go @@ -110,12 +110,6 @@ func MaxUsersIn(vs ...int) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldMaxUsers), v...)) }) } @@ -127,12 +121,6 @@ func MaxUsersNotIn(vs ...int) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldMaxUsers), v...)) }) } diff --git a/entc/integration/template/ent/pet/where.go b/entc/integration/template/ent/pet/where.go index ec6386759..027371e96 100644 --- a/entc/integration/template/ent/pet/where.go +++ b/entc/integration/template/ent/pet/where.go @@ -120,12 +120,6 @@ func AgeIn(vs ...int) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAge), v...)) }) } @@ -137,12 +131,6 @@ func AgeNotIn(vs ...int) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAge), v...)) }) } @@ -196,12 +184,6 @@ func LicensedAtIn(vs ...time.Time) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldLicensedAt), v...)) }) } @@ -213,12 +195,6 @@ func LicensedAtNotIn(vs ...time.Time) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldLicensedAt), v...)) }) } diff --git a/entc/integration/template/ent/user/where.go b/entc/integration/template/ent/user/where.go index 269ee8642..bb90c2b32 100644 --- a/entc/integration/template/ent/user/where.go +++ b/entc/integration/template/ent/user/where.go @@ -111,12 +111,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -128,12 +122,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/examples/edgeindex/ent/city/where.go b/examples/edgeindex/ent/city/where.go index 225a45587..1a3931047 100644 --- a/examples/edgeindex/ent/city/where.go +++ b/examples/edgeindex/ent/city/where.go @@ -111,12 +111,6 @@ func NameIn(vs ...string) predicate.City { v[i] = vs[i] } return predicate.City(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -128,12 +122,6 @@ func NameNotIn(vs ...string) predicate.City { v[i] = vs[i] } return predicate.City(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/examples/edgeindex/ent/street/where.go b/examples/edgeindex/ent/street/where.go index 7b50a4d94..0e9796303 100644 --- a/examples/edgeindex/ent/street/where.go +++ b/examples/edgeindex/ent/street/where.go @@ -111,12 +111,6 @@ func NameIn(vs ...string) predicate.Street { v[i] = vs[i] } return predicate.Street(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -128,12 +122,6 @@ func NameNotIn(vs ...string) predicate.Street { v[i] = vs[i] } return predicate.Street(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/examples/entcpkg/ent/user/where.go b/examples/entcpkg/ent/user/where.go index ee7a6effd..9692ec151 100644 --- a/examples/entcpkg/ent/user/where.go +++ b/examples/entcpkg/ent/user/where.go @@ -117,12 +117,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -134,12 +128,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } @@ -242,12 +230,6 @@ func AgeIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAge), v...)) }) } @@ -259,12 +241,6 @@ func AgeNotIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAge), v...)) }) } diff --git a/examples/fs/ent/file/where.go b/examples/fs/ent/file/where.go index 2511f2518..ee13b5b15 100644 --- a/examples/fs/ent/file/where.go +++ b/examples/fs/ent/file/where.go @@ -125,12 +125,6 @@ func NameIn(vs ...string) predicate.File { v[i] = vs[i] } return predicate.File(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -142,12 +136,6 @@ func NameNotIn(vs ...string) predicate.File { v[i] = vs[i] } return predicate.File(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } @@ -250,12 +238,6 @@ func ParentIDIn(vs ...int) predicate.File { v[i] = vs[i] } return predicate.File(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldParentID), v...)) }) } @@ -267,12 +249,6 @@ func ParentIDNotIn(vs ...int) predicate.File { v[i] = vs[i] } return predicate.File(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldParentID), v...)) }) } diff --git a/examples/m2m2types/ent/group/where.go b/examples/m2m2types/ent/group/where.go index 8e4d9a032..19ef0edda 100644 --- a/examples/m2m2types/ent/group/where.go +++ b/examples/m2m2types/ent/group/where.go @@ -111,12 +111,6 @@ func NameIn(vs ...string) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -128,12 +122,6 @@ func NameNotIn(vs ...string) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/examples/m2m2types/ent/user/where.go b/examples/m2m2types/ent/user/where.go index 14cbc8387..c78cc79b1 100644 --- a/examples/m2m2types/ent/user/where.go +++ b/examples/m2m2types/ent/user/where.go @@ -118,12 +118,6 @@ func AgeIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAge), v...)) }) } @@ -135,12 +129,6 @@ func AgeNotIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAge), v...)) }) } @@ -194,12 +182,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -211,12 +193,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/examples/m2mbidi/ent/user/where.go b/examples/m2mbidi/ent/user/where.go index 0ca486b09..0684b6401 100644 --- a/examples/m2mbidi/ent/user/where.go +++ b/examples/m2mbidi/ent/user/where.go @@ -118,12 +118,6 @@ func AgeIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAge), v...)) }) } @@ -135,12 +129,6 @@ func AgeNotIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAge), v...)) }) } @@ -194,12 +182,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -211,12 +193,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/examples/m2mrecur/ent/user/where.go b/examples/m2mrecur/ent/user/where.go index c9067a74d..442d9ca7e 100644 --- a/examples/m2mrecur/ent/user/where.go +++ b/examples/m2mrecur/ent/user/where.go @@ -118,12 +118,6 @@ func AgeIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAge), v...)) }) } @@ -135,12 +129,6 @@ func AgeNotIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAge), v...)) }) } @@ -194,12 +182,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -211,12 +193,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/examples/o2m2types/ent/pet/where.go b/examples/o2m2types/ent/pet/where.go index a15ef9c21..2f422ff2b 100644 --- a/examples/o2m2types/ent/pet/where.go +++ b/examples/o2m2types/ent/pet/where.go @@ -111,12 +111,6 @@ func NameIn(vs ...string) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -128,12 +122,6 @@ func NameNotIn(vs ...string) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/examples/o2m2types/ent/user/where.go b/examples/o2m2types/ent/user/where.go index 7b854255c..4fcf535e8 100644 --- a/examples/o2m2types/ent/user/where.go +++ b/examples/o2m2types/ent/user/where.go @@ -118,12 +118,6 @@ func AgeIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAge), v...)) }) } @@ -135,12 +129,6 @@ func AgeNotIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAge), v...)) }) } @@ -194,12 +182,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -211,12 +193,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/examples/o2mrecur/ent/node/where.go b/examples/o2mrecur/ent/node/where.go index 363eb5cfc..aa79df462 100644 --- a/examples/o2mrecur/ent/node/where.go +++ b/examples/o2mrecur/ent/node/where.go @@ -111,12 +111,6 @@ func ValueIn(vs ...int) predicate.Node { v[i] = vs[i] } return predicate.Node(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldValue), v...)) }) } @@ -128,12 +122,6 @@ func ValueNotIn(vs ...int) predicate.Node { v[i] = vs[i] } return predicate.Node(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldValue), v...)) }) } diff --git a/examples/o2o2types/ent/card/where.go b/examples/o2o2types/ent/card/where.go index fbfce2e93..eb0f84c46 100644 --- a/examples/o2o2types/ent/card/where.go +++ b/examples/o2o2types/ent/card/where.go @@ -120,12 +120,6 @@ func ExpiredIn(vs ...time.Time) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldExpired), v...)) }) } @@ -137,12 +131,6 @@ func ExpiredNotIn(vs ...time.Time) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldExpired), v...)) }) } @@ -196,12 +184,6 @@ func NumberIn(vs ...string) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldNumber), v...)) }) } @@ -213,12 +195,6 @@ func NumberNotIn(vs ...string) predicate.Card { v[i] = vs[i] } return predicate.Card(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldNumber), v...)) }) } diff --git a/examples/o2o2types/ent/user/where.go b/examples/o2o2types/ent/user/where.go index 660a1b623..e60b1fa3d 100644 --- a/examples/o2o2types/ent/user/where.go +++ b/examples/o2o2types/ent/user/where.go @@ -118,12 +118,6 @@ func AgeIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAge), v...)) }) } @@ -135,12 +129,6 @@ func AgeNotIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAge), v...)) }) } @@ -194,12 +182,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -211,12 +193,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/examples/o2obidi/ent/user/where.go b/examples/o2obidi/ent/user/where.go index 1b77b0acb..00575d121 100644 --- a/examples/o2obidi/ent/user/where.go +++ b/examples/o2obidi/ent/user/where.go @@ -118,12 +118,6 @@ func AgeIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAge), v...)) }) } @@ -135,12 +129,6 @@ func AgeNotIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAge), v...)) }) } @@ -194,12 +182,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -211,12 +193,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/examples/o2orecur/ent/node/where.go b/examples/o2orecur/ent/node/where.go index e7052900e..3a300482d 100644 --- a/examples/o2orecur/ent/node/where.go +++ b/examples/o2orecur/ent/node/where.go @@ -111,12 +111,6 @@ func ValueIn(vs ...int) predicate.Node { v[i] = vs[i] } return predicate.Node(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldValue), v...)) }) } @@ -128,12 +122,6 @@ func ValueNotIn(vs ...int) predicate.Node { v[i] = vs[i] } return predicate.Node(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldValue), v...)) }) } diff --git a/examples/privacyadmin/ent/user/where.go b/examples/privacyadmin/ent/user/where.go index 6cbfe9fb4..2d5351f75 100644 --- a/examples/privacyadmin/ent/user/where.go +++ b/examples/privacyadmin/ent/user/where.go @@ -110,12 +110,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -127,12 +121,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/examples/privacytenant/ent/group/where.go b/examples/privacytenant/ent/group/where.go index 5eece4274..78ef0a403 100644 --- a/examples/privacytenant/ent/group/where.go +++ b/examples/privacytenant/ent/group/where.go @@ -118,12 +118,6 @@ func TenantIDIn(vs ...int) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldTenantID), v...)) }) } @@ -135,12 +129,6 @@ func TenantIDNotIn(vs ...int) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldTenantID), v...)) }) } @@ -166,12 +154,6 @@ func NameIn(vs ...string) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -183,12 +165,6 @@ func NameNotIn(vs ...string) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/examples/privacytenant/ent/tenant/where.go b/examples/privacytenant/ent/tenant/where.go index 497411fc2..52729ac6a 100644 --- a/examples/privacytenant/ent/tenant/where.go +++ b/examples/privacytenant/ent/tenant/where.go @@ -110,12 +110,6 @@ func NameIn(vs ...string) predicate.Tenant { v[i] = vs[i] } return predicate.Tenant(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -127,12 +121,6 @@ func NameNotIn(vs ...string) predicate.Tenant { v[i] = vs[i] } return predicate.Tenant(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/examples/privacytenant/ent/user/where.go b/examples/privacytenant/ent/user/where.go index 31a599205..110357234 100644 --- a/examples/privacytenant/ent/user/where.go +++ b/examples/privacytenant/ent/user/where.go @@ -118,12 +118,6 @@ func TenantIDIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldTenantID), v...)) }) } @@ -135,12 +129,6 @@ func TenantIDNotIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldTenantID), v...)) }) } @@ -166,12 +154,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -183,12 +165,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/examples/start/ent/car/where.go b/examples/start/ent/car/where.go index b216f1ec5..e48a914a4 100644 --- a/examples/start/ent/car/where.go +++ b/examples/start/ent/car/where.go @@ -120,12 +120,6 @@ func ModelIn(vs ...string) predicate.Car { v[i] = vs[i] } return predicate.Car(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldModel), v...)) }) } @@ -137,12 +131,6 @@ func ModelNotIn(vs ...string) predicate.Car { v[i] = vs[i] } return predicate.Car(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldModel), v...)) }) } @@ -231,12 +219,6 @@ func RegisteredAtIn(vs ...time.Time) predicate.Car { v[i] = vs[i] } return predicate.Car(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldRegisteredAt), v...)) }) } @@ -248,12 +230,6 @@ func RegisteredAtNotIn(vs ...time.Time) predicate.Car { v[i] = vs[i] } return predicate.Car(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldRegisteredAt), v...)) }) } diff --git a/examples/start/ent/group/where.go b/examples/start/ent/group/where.go index 261219595..b7c52af81 100644 --- a/examples/start/ent/group/where.go +++ b/examples/start/ent/group/where.go @@ -111,12 +111,6 @@ func NameIn(vs ...string) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -128,12 +122,6 @@ func NameNotIn(vs ...string) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/examples/start/ent/user/where.go b/examples/start/ent/user/where.go index 04791f5c2..df7597448 100644 --- a/examples/start/ent/user/where.go +++ b/examples/start/ent/user/where.go @@ -118,12 +118,6 @@ func AgeIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAge), v...)) }) } @@ -135,12 +129,6 @@ func AgeNotIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAge), v...)) }) } @@ -194,12 +182,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -211,12 +193,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/examples/traversal/ent/group/where.go b/examples/traversal/ent/group/where.go index 90fff9ae6..47d1a1427 100644 --- a/examples/traversal/ent/group/where.go +++ b/examples/traversal/ent/group/where.go @@ -111,12 +111,6 @@ func NameIn(vs ...string) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -128,12 +122,6 @@ func NameNotIn(vs ...string) predicate.Group { v[i] = vs[i] } return predicate.Group(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/examples/traversal/ent/pet/where.go b/examples/traversal/ent/pet/where.go index 91f832cb1..ccc625007 100644 --- a/examples/traversal/ent/pet/where.go +++ b/examples/traversal/ent/pet/where.go @@ -111,12 +111,6 @@ func NameIn(vs ...string) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -128,12 +122,6 @@ func NameNotIn(vs ...string) predicate.Pet { v[i] = vs[i] } return predicate.Pet(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/examples/traversal/ent/user/where.go b/examples/traversal/ent/user/where.go index 98058bf87..29591020e 100644 --- a/examples/traversal/ent/user/where.go +++ b/examples/traversal/ent/user/where.go @@ -118,12 +118,6 @@ func AgeIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldAge), v...)) }) } @@ -135,12 +129,6 @@ func AgeNotIn(vs ...int) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldAge), v...)) }) } @@ -194,12 +182,6 @@ func NameIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldName), v...)) }) } @@ -211,12 +193,6 @@ func NameNotIn(vs ...string) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldName), v...)) }) } diff --git a/examples/version/ent/user/where.go b/examples/version/ent/user/where.go index 8f6478853..d034dad3a 100644 --- a/examples/version/ent/user/where.go +++ b/examples/version/ent/user/where.go @@ -110,12 +110,6 @@ func VersionIn(vs ...int64) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldVersion), v...)) }) } @@ -127,12 +121,6 @@ func VersionNotIn(vs ...int64) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldVersion), v...)) }) } @@ -186,12 +174,6 @@ func StatusIn(vs ...Status) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.In(s.C(FieldStatus), v...)) }) } @@ -203,12 +185,6 @@ func StatusNotIn(vs ...Status) predicate.User { v[i] = vs[i] } return predicate.User(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(v) == 0 { - s.Where(sql.False()) - return - } s.Where(sql.NotIn(s.C(FieldStatus), v...)) }) }