diff --git a/dialect/sql/builder.go b/dialect/sql/builder.go index 1bd1ead81..709352a99 100644 --- a/dialect/sql/builder.go +++ b/dialect/sql/builder.go @@ -1535,8 +1535,10 @@ func In(col string, args ...interface{}) *Predicate { // In appends the `IN` predicate. func (p *Predicate) In(col string, args ...interface{}) *Predicate { + // if no arguments were provided, append the FALSE constants, + // since we can't apply "IN ()". This will make this predicate falsy. if len(args) == 0 { - return p + return p.False() } return p.Append(func(b *Builder) { b.Ident(col).WriteOp(OpIn) diff --git a/dialect/sql/builder_test.go b/dialect/sql/builder_test.go index f2b58f401..5688f421a 100644 --- a/dialect/sql/builder_test.go +++ b/dialect/sql/builder_test.go @@ -2004,6 +2004,14 @@ func TestReusePredicates(t *testing.T) { wantQuery: `SELECT * FROM "users" WHERE "a" = $1 OR "b" = $2`, wantArgs: []interface{}{"a", "b"}, }, + { + p: Or( + EQ("a", "a"), + In("b"), + ), + wantQuery: `SELECT * FROM "users" WHERE "a" = $1 OR FALSE`, + wantArgs: []interface{}{"a"}, + }, { p: And( EQ("active", true), diff --git a/entc/gen/template/dialect/sql/predicate.tmpl b/entc/gen/template/dialect/sql/predicate.tmpl index a4af3d9e9..3c40986bd 100644 --- a/entc/gen/template/dialect/sql/predicate.tmpl +++ b/entc/gen/template/dialect/sql/predicate.tmpl @@ -18,12 +18,6 @@ in the LICENSE file in the root directory of this source tree. {{- $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 - } v := make([]interface{}, len({{ $arg }})) for i := range v { v[i] = {{ $arg }}[i] diff --git a/entc/integration/cascadelete/ent/comment/where.go b/entc/integration/cascadelete/ent/comment/where.go index 7935f62d7..67d99fe87 100644 --- a/entc/integration/cascadelete/ent/comment/where.go +++ b/entc/integration/cascadelete/ent/comment/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Comment { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Comment { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Comment { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Comment { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/cascadelete/ent/post/where.go b/entc/integration/cascadelete/ent/post/where.go index e7c72a8d8..bde56e044 100644 --- a/entc/integration/cascadelete/ent/post/where.go +++ b/entc/integration/cascadelete/ent/post/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Post { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Post { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Post { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Post { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/cascadelete/ent/user/where.go b/entc/integration/cascadelete/ent/user/where.go index e83d894e4..3067f3892 100644 --- a/entc/integration/cascadelete/ent/user/where.go +++ b/entc/integration/cascadelete/ent/user/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/config/ent/user/where.go b/entc/integration/config/ent/user/where.go index 4103cf47d..33d12747b 100644 --- a/entc/integration/config/ent/user/where.go +++ b/entc/integration/config/ent/user/where.go @@ -35,12 +35,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -52,12 +46,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/customid/ent/account/where.go b/entc/integration/customid/ent/account/where.go index 7a3cf6f8b..7f6096793 100644 --- a/entc/integration/customid/ent/account/where.go +++ b/entc/integration/customid/ent/account/where.go @@ -37,12 +37,6 @@ func IDNEQ(id sid.ID) predicate.Account { // IDIn applies the In predicate on the ID field. func IDIn(ids ...sid.ID) predicate.Account { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -54,12 +48,6 @@ func IDIn(ids ...sid.ID) predicate.Account { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...sid.ID) predicate.Account { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/customid/ent/blob/where.go b/entc/integration/customid/ent/blob/where.go index 176348b1e..a62cbfccb 100644 --- a/entc/integration/customid/ent/blob/where.go +++ b/entc/integration/customid/ent/blob/where.go @@ -37,12 +37,6 @@ func IDNEQ(id uuid.UUID) predicate.Blob { // IDIn applies the In predicate on the ID field. func IDIn(ids ...uuid.UUID) predicate.Blob { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -54,12 +48,6 @@ func IDIn(ids ...uuid.UUID) predicate.Blob { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...uuid.UUID) predicate.Blob { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/customid/ent/car/where.go b/entc/integration/customid/ent/car/where.go index aacbad600..df9044e58 100644 --- a/entc/integration/customid/ent/car/where.go +++ b/entc/integration/customid/ent/car/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Car { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Car { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Car { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Car { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/customid/ent/device/where.go b/entc/integration/customid/ent/device/where.go index 963ae020e..886eddfe4 100644 --- a/entc/integration/customid/ent/device/where.go +++ b/entc/integration/customid/ent/device/where.go @@ -37,12 +37,6 @@ func IDNEQ(id schema.ID) predicate.Device { // IDIn applies the In predicate on the ID field. func IDIn(ids ...schema.ID) predicate.Device { return predicate.Device(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -54,12 +48,6 @@ func IDIn(ids ...schema.ID) predicate.Device { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...schema.ID) predicate.Device { return predicate.Device(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/customid/ent/doc/where.go b/entc/integration/customid/ent/doc/where.go index 954eeefa8..5626a76e8 100644 --- a/entc/integration/customid/ent/doc/where.go +++ b/entc/integration/customid/ent/doc/where.go @@ -37,12 +37,6 @@ func IDNEQ(id schema.DocID) predicate.Doc { // IDIn applies the In predicate on the ID field. func IDIn(ids ...schema.DocID) predicate.Doc { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -54,12 +48,6 @@ func IDIn(ids ...schema.DocID) predicate.Doc { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...schema.DocID) predicate.Doc { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/customid/ent/group/where.go b/entc/integration/customid/ent/group/where.go index 66193d104..9554e9338 100644 --- a/entc/integration/customid/ent/group/where.go +++ b/entc/integration/customid/ent/group/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Group { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Group { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Group { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Group { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/customid/ent/intsid/where.go b/entc/integration/customid/ent/intsid/where.go index f7cc25a5e..0edcc9a8a 100644 --- a/entc/integration/customid/ent/intsid/where.go +++ b/entc/integration/customid/ent/intsid/where.go @@ -37,12 +37,6 @@ func IDNEQ(id sid.ID) predicate.IntSID { // IDIn applies the In predicate on the ID field. func IDIn(ids ...sid.ID) predicate.IntSID { return predicate.IntSID(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -54,12 +48,6 @@ func IDIn(ids ...sid.ID) predicate.IntSID { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...sid.ID) predicate.IntSID { return predicate.IntSID(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/customid/ent/mixinid/where.go b/entc/integration/customid/ent/mixinid/where.go index 70dd02f6c..4b42879d7 100644 --- a/entc/integration/customid/ent/mixinid/where.go +++ b/entc/integration/customid/ent/mixinid/where.go @@ -36,12 +36,6 @@ func IDNEQ(id uuid.UUID) predicate.MixinID { // IDIn applies the In predicate on the ID field. func IDIn(ids ...uuid.UUID) predicate.MixinID { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...uuid.UUID) predicate.MixinID { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...uuid.UUID) predicate.MixinID { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/customid/ent/note/where.go b/entc/integration/customid/ent/note/where.go index 84315faff..042bc9419 100644 --- a/entc/integration/customid/ent/note/where.go +++ b/entc/integration/customid/ent/note/where.go @@ -37,12 +37,6 @@ func IDNEQ(id schema.NoteID) predicate.Note { // IDIn applies the In predicate on the ID field. func IDIn(ids ...schema.NoteID) predicate.Note { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -54,12 +48,6 @@ func IDIn(ids ...schema.NoteID) predicate.Note { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...schema.NoteID) predicate.Note { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/customid/ent/other/where.go b/entc/integration/customid/ent/other/where.go index 295e885af..d5bea8db3 100644 --- a/entc/integration/customid/ent/other/where.go +++ b/entc/integration/customid/ent/other/where.go @@ -36,12 +36,6 @@ func IDNEQ(id sid.ID) predicate.Other { // IDIn applies the In predicate on the ID field. func IDIn(ids ...sid.ID) predicate.Other { return predicate.Other(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...sid.ID) predicate.Other { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...sid.ID) predicate.Other { return predicate.Other(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/customid/ent/pet/where.go b/entc/integration/customid/ent/pet/where.go index 79ac8202d..995458361 100644 --- a/entc/integration/customid/ent/pet/where.go +++ b/entc/integration/customid/ent/pet/where.go @@ -36,12 +36,6 @@ func IDNEQ(id string) predicate.Pet { // IDIn applies the In predicate on the ID field. func IDIn(ids ...string) predicate.Pet { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...string) predicate.Pet { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...string) predicate.Pet { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/customid/ent/revision/where.go b/entc/integration/customid/ent/revision/where.go index 82cb774ce..003da23d1 100644 --- a/entc/integration/customid/ent/revision/where.go +++ b/entc/integration/customid/ent/revision/where.go @@ -35,12 +35,6 @@ func IDNEQ(id string) predicate.Revision { // IDIn applies the In predicate on the ID field. func IDIn(ids ...string) predicate.Revision { return predicate.Revision(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -52,12 +46,6 @@ func IDIn(ids ...string) predicate.Revision { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...string) predicate.Revision { return predicate.Revision(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/customid/ent/session/where.go b/entc/integration/customid/ent/session/where.go index 2226745da..d8991ba0d 100644 --- a/entc/integration/customid/ent/session/where.go +++ b/entc/integration/customid/ent/session/where.go @@ -37,12 +37,6 @@ func IDNEQ(id schema.ID) predicate.Session { // IDIn applies the In predicate on the ID field. func IDIn(ids ...schema.ID) predicate.Session { return predicate.Session(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -54,12 +48,6 @@ func IDIn(ids ...schema.ID) predicate.Session { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...schema.ID) predicate.Session { return predicate.Session(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/customid/ent/token/where.go b/entc/integration/customid/ent/token/where.go index 473816e75..17cffd70e 100644 --- a/entc/integration/customid/ent/token/where.go +++ b/entc/integration/customid/ent/token/where.go @@ -37,12 +37,6 @@ func IDNEQ(id sid.ID) predicate.Token { // IDIn applies the In predicate on the ID field. func IDIn(ids ...sid.ID) predicate.Token { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -54,12 +48,6 @@ func IDIn(ids ...sid.ID) predicate.Token { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...sid.ID) predicate.Token { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/customid/ent/user/where.go b/entc/integration/customid/ent/user/where.go index 61e050f63..c706efa5d 100644 --- a/entc/integration/customid/ent/user/where.go +++ b/entc/integration/customid/ent/user/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/edgefield/ent/car/where.go b/entc/integration/edgefield/ent/car/where.go index e31b4840b..54040e51b 100644 --- a/entc/integration/edgefield/ent/car/where.go +++ b/entc/integration/edgefield/ent/car/where.go @@ -37,12 +37,6 @@ func IDNEQ(id uuid.UUID) predicate.Car { // IDIn applies the In predicate on the ID field. func IDIn(ids ...uuid.UUID) predicate.Car { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -54,12 +48,6 @@ func IDIn(ids ...uuid.UUID) predicate.Car { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...uuid.UUID) predicate.Car { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/edgefield/ent/card/where.go b/entc/integration/edgefield/ent/card/where.go index daf4b0d38..90924d0cf 100644 --- a/entc/integration/edgefield/ent/card/where.go +++ b/entc/integration/edgefield/ent/card/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Card { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Card { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Card { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Card { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/edgefield/ent/info/where.go b/entc/integration/edgefield/ent/info/where.go index 1089edf5d..990ffcfa6 100644 --- a/entc/integration/edgefield/ent/info/where.go +++ b/entc/integration/edgefield/ent/info/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Info { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Info { return predicate.Info(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Info { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Info { return predicate.Info(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/edgefield/ent/metadata/where.go b/entc/integration/edgefield/ent/metadata/where.go index 463ff0c3c..6f5ec3232 100644 --- a/entc/integration/edgefield/ent/metadata/where.go +++ b/entc/integration/edgefield/ent/metadata/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Metadata { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Metadata { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Metadata { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Metadata { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/edgefield/ent/node/where.go b/entc/integration/edgefield/ent/node/where.go index d97b5d5c6..13006521e 100644 --- a/entc/integration/edgefield/ent/node/where.go +++ b/entc/integration/edgefield/ent/node/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Node { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Node { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Node { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Node { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/edgefield/ent/pet/where.go b/entc/integration/edgefield/ent/pet/where.go index fc8bb96a4..88c25ca2e 100644 --- a/entc/integration/edgefield/ent/pet/where.go +++ b/entc/integration/edgefield/ent/pet/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Pet { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Pet { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Pet { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Pet { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/edgefield/ent/post/where.go b/entc/integration/edgefield/ent/post/where.go index 626a3c16c..348b497b0 100644 --- a/entc/integration/edgefield/ent/post/where.go +++ b/entc/integration/edgefield/ent/post/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Post { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Post { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Post { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Post { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/edgefield/ent/rental/where.go b/entc/integration/edgefield/ent/rental/where.go index d23be5048..a71c9cc46 100644 --- a/entc/integration/edgefield/ent/rental/where.go +++ b/entc/integration/edgefield/ent/rental/where.go @@ -39,12 +39,6 @@ func IDNEQ(id int) predicate.Rental { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Rental { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -56,12 +50,6 @@ func IDIn(ids ...int) predicate.Rental { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Rental { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/edgefield/ent/user/where.go b/entc/integration/edgefield/ent/user/where.go index d6753129b..66be16574 100644 --- a/entc/integration/edgefield/ent/user/where.go +++ b/entc/integration/edgefield/ent/user/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/edgeschema/ent/friendship/where.go b/entc/integration/edgeschema/ent/friendship/where.go index 49e5475d8..d763337a0 100644 --- a/entc/integration/edgeschema/ent/friendship/where.go +++ b/entc/integration/edgeschema/ent/friendship/where.go @@ -38,12 +38,6 @@ func IDNEQ(id int) predicate.Friendship { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Friendship { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -55,12 +49,6 @@ func IDIn(ids ...int) predicate.Friendship { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Friendship { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/edgeschema/ent/group/where.go b/entc/integration/edgeschema/ent/group/where.go index 3fb79e1d6..61e7bc62f 100644 --- a/entc/integration/edgeschema/ent/group/where.go +++ b/entc/integration/edgeschema/ent/group/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Group { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Group { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Group { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Group { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/edgeschema/ent/relationshipinfo/where.go b/entc/integration/edgeschema/ent/relationshipinfo/where.go index 4aace87aa..679e23ea6 100644 --- a/entc/integration/edgeschema/ent/relationshipinfo/where.go +++ b/entc/integration/edgeschema/ent/relationshipinfo/where.go @@ -35,12 +35,6 @@ func IDNEQ(id int) predicate.RelationshipInfo { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.RelationshipInfo { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -52,12 +46,6 @@ func IDIn(ids ...int) predicate.RelationshipInfo { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.RelationshipInfo { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/edgeschema/ent/tag/where.go b/entc/integration/edgeschema/ent/tag/where.go index c0d621647..71acfbc8b 100644 --- a/entc/integration/edgeschema/ent/tag/where.go +++ b/entc/integration/edgeschema/ent/tag/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Tag { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Tag { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Tag { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Tag { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/edgeschema/ent/tweet/where.go b/entc/integration/edgeschema/ent/tweet/where.go index b2ad7912f..150348aa5 100644 --- a/entc/integration/edgeschema/ent/tweet/where.go +++ b/entc/integration/edgeschema/ent/tweet/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Tweet { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Tweet { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Tweet { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Tweet { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/edgeschema/ent/tweettag/where.go b/entc/integration/edgeschema/ent/tweettag/where.go index a054056ed..a27f4b0f5 100644 --- a/entc/integration/edgeschema/ent/tweettag/where.go +++ b/entc/integration/edgeschema/ent/tweettag/where.go @@ -39,12 +39,6 @@ func IDNEQ(id uuid.UUID) predicate.TweetTag { // IDIn applies the In predicate on the ID field. func IDIn(ids ...uuid.UUID) predicate.TweetTag { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -56,12 +50,6 @@ func IDIn(ids ...uuid.UUID) predicate.TweetTag { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...uuid.UUID) predicate.TweetTag { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/edgeschema/ent/user/where.go b/entc/integration/edgeschema/ent/user/where.go index f2905c73e..c5d6b816c 100644 --- a/entc/integration/edgeschema/ent/user/where.go +++ b/entc/integration/edgeschema/ent/user/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/edgeschema/ent/usergroup/where.go b/entc/integration/edgeschema/ent/usergroup/where.go index 170c4d122..49fd7b709 100644 --- a/entc/integration/edgeschema/ent/usergroup/where.go +++ b/entc/integration/edgeschema/ent/usergroup/where.go @@ -38,12 +38,6 @@ func IDNEQ(id int) predicate.UserGroup { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.UserGroup { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -55,12 +49,6 @@ func IDIn(ids ...int) predicate.UserGroup { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.UserGroup { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/edgeschema/ent/usertweet/where.go b/entc/integration/edgeschema/ent/usertweet/where.go index 234d9d935..971860103 100644 --- a/entc/integration/edgeschema/ent/usertweet/where.go +++ b/entc/integration/edgeschema/ent/usertweet/where.go @@ -38,12 +38,6 @@ func IDNEQ(id int) predicate.UserTweet { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.UserTweet { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -55,12 +49,6 @@ func IDIn(ids ...int) predicate.UserTweet { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.UserTweet { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/ent/card/where.go b/entc/integration/ent/card/where.go index ba7974a1f..d97752c52 100644 --- a/entc/integration/ent/card/where.go +++ b/entc/integration/ent/card/where.go @@ -38,12 +38,6 @@ func IDNEQ(id int) predicate.Card { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Card { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -55,12 +49,6 @@ func IDIn(ids ...int) predicate.Card { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Card { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/ent/comment/where.go b/entc/integration/ent/comment/where.go index 3fb4f87c1..b1bafb137 100644 --- a/entc/integration/ent/comment/where.go +++ b/entc/integration/ent/comment/where.go @@ -35,12 +35,6 @@ func IDNEQ(id int) predicate.Comment { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Comment { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -52,12 +46,6 @@ func IDIn(ids ...int) predicate.Comment { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Comment { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/ent/fieldtype/where.go b/entc/integration/ent/fieldtype/where.go index 3d3dbd29c..5cd377397 100644 --- a/entc/integration/ent/fieldtype/where.go +++ b/entc/integration/ent/fieldtype/where.go @@ -42,12 +42,6 @@ func IDNEQ(id int) predicate.FieldType { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.FieldType { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -59,12 +53,6 @@ func IDIn(ids ...int) predicate.FieldType { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.FieldType { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/ent/file/where.go b/entc/integration/ent/file/where.go index 6b8e752a8..6cbaa1e01 100644 --- a/entc/integration/ent/file/where.go +++ b/entc/integration/ent/file/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.File { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.File { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.File { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.File { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/ent/filetype/where.go b/entc/integration/ent/filetype/where.go index 544e46192..4ec4fafa6 100644 --- a/entc/integration/ent/filetype/where.go +++ b/entc/integration/ent/filetype/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.FileType { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.FileType { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.FileType { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.FileType { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/ent/goods/where.go b/entc/integration/ent/goods/where.go index d27d6b8f0..f53d93cdc 100644 --- a/entc/integration/ent/goods/where.go +++ b/entc/integration/ent/goods/where.go @@ -35,12 +35,6 @@ func IDNEQ(id int) predicate.Goods { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Goods { return predicate.Goods(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -52,12 +46,6 @@ func IDIn(ids ...int) predicate.Goods { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Goods { return predicate.Goods(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/ent/group/where.go b/entc/integration/ent/group/where.go index ae7b8b0ec..9b8a4dccc 100644 --- a/entc/integration/ent/group/where.go +++ b/entc/integration/ent/group/where.go @@ -38,12 +38,6 @@ func IDNEQ(id int) predicate.Group { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Group { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -55,12 +49,6 @@ func IDIn(ids ...int) predicate.Group { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Group { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/ent/groupinfo/where.go b/entc/integration/ent/groupinfo/where.go index 3f24120be..58c78c6a1 100644 --- a/entc/integration/ent/groupinfo/where.go +++ b/entc/integration/ent/groupinfo/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.GroupInfo { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.GroupInfo { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.GroupInfo { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.GroupInfo { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/ent/item/where.go b/entc/integration/ent/item/where.go index 01615a65b..7b7f2746c 100644 --- a/entc/integration/ent/item/where.go +++ b/entc/integration/ent/item/where.go @@ -35,12 +35,6 @@ func IDNEQ(id string) predicate.Item { // IDIn applies the In predicate on the ID field. func IDIn(ids ...string) predicate.Item { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -52,12 +46,6 @@ func IDIn(ids ...string) predicate.Item { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...string) predicate.Item { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/ent/node/where.go b/entc/integration/ent/node/where.go index 75bd65dbe..5f8773f7c 100644 --- a/entc/integration/ent/node/where.go +++ b/entc/integration/ent/node/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Node { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Node { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Node { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Node { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/ent/pet/where.go b/entc/integration/ent/pet/where.go index d5845d446..1b39f14dd 100644 --- a/entc/integration/ent/pet/where.go +++ b/entc/integration/ent/pet/where.go @@ -37,12 +37,6 @@ func IDNEQ(id int) predicate.Pet { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Pet { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -54,12 +48,6 @@ func IDIn(ids ...int) predicate.Pet { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Pet { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/ent/spec/where.go b/entc/integration/ent/spec/where.go index 2f8575bb3..a7e85d666 100644 --- a/entc/integration/ent/spec/where.go +++ b/entc/integration/ent/spec/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Spec { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Spec { return predicate.Spec(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Spec { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Spec { return predicate.Spec(func(s *sql.Selector) { - // if not arguments were provided, append the FALSE constants, - // since we can't apply "IN ()". This will make this predicate falsy. - if len(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/ent/task/where.go b/entc/integration/ent/task/where.go index 18dfbc772..11ddd65b0 100644 --- a/entc/integration/ent/task/where.go +++ b/entc/integration/ent/task/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Task { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Task { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Task { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Task { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/ent/user/where.go b/entc/integration/ent/user/where.go index e16a2edb6..d719dbd03 100644 --- a/entc/integration/ent/user/where.go +++ b/entc/integration/ent/user/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/hooks/ent/card/where.go b/entc/integration/hooks/ent/card/where.go index 06207217c..3d4a93f8b 100644 --- a/entc/integration/hooks/ent/card/where.go +++ b/entc/integration/hooks/ent/card/where.go @@ -38,12 +38,6 @@ func IDNEQ(id int) predicate.Card { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Card { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -55,12 +49,6 @@ func IDIn(ids ...int) predicate.Card { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Card { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/hooks/ent/user/where.go b/entc/integration/hooks/ent/user/where.go index 8515c3630..b43a754d6 100644 --- a/entc/integration/hooks/ent/user/where.go +++ b/entc/integration/hooks/ent/user/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/idtype/ent/user/where.go b/entc/integration/idtype/ent/user/where.go index dd2f1eef7..e270c65b3 100644 --- a/entc/integration/idtype/ent/user/where.go +++ b/entc/integration/idtype/ent/user/where.go @@ -36,12 +36,6 @@ func IDNEQ(id uint64) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...uint64) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...uint64) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...uint64) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/json/ent/user/where.go b/entc/integration/json/ent/user/where.go index 71d552f90..846eabe71 100644 --- a/entc/integration/json/ent/user/where.go +++ b/entc/integration/json/ent/user/where.go @@ -35,12 +35,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -52,12 +46,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/migrate/entv1/car/where.go b/entc/integration/migrate/entv1/car/where.go index 5239f9e8a..16b8ee17b 100644 --- a/entc/integration/migrate/entv1/car/where.go +++ b/entc/integration/migrate/entv1/car/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Car { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Car { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Car { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Car { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/migrate/entv1/conversion/where.go b/entc/integration/migrate/entv1/conversion/where.go index 9bccc572e..675dfd523 100644 --- a/entc/integration/migrate/entv1/conversion/where.go +++ b/entc/integration/migrate/entv1/conversion/where.go @@ -35,12 +35,6 @@ func IDNEQ(id int) predicate.Conversion { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Conversion { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -52,12 +46,6 @@ func IDIn(ids ...int) predicate.Conversion { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Conversion { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/migrate/entv1/customtype/where.go b/entc/integration/migrate/entv1/customtype/where.go index e6ab2ac94..2eea7ffea 100644 --- a/entc/integration/migrate/entv1/customtype/where.go +++ b/entc/integration/migrate/entv1/customtype/where.go @@ -35,12 +35,6 @@ func IDNEQ(id int) predicate.CustomType { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.CustomType { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -52,12 +46,6 @@ func IDIn(ids ...int) predicate.CustomType { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.CustomType { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/migrate/entv1/user/where.go b/entc/integration/migrate/entv1/user/where.go index 3db503c37..5dc5124db 100644 --- a/entc/integration/migrate/entv1/user/where.go +++ b/entc/integration/migrate/entv1/user/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/migrate/entv2/car/where.go b/entc/integration/migrate/entv2/car/where.go index 97668d54b..19325cf05 100644 --- a/entc/integration/migrate/entv2/car/where.go +++ b/entc/integration/migrate/entv2/car/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Car { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Car { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Car { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Car { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/migrate/entv2/conversion/where.go b/entc/integration/migrate/entv2/conversion/where.go index 1c6862714..b334a0066 100644 --- a/entc/integration/migrate/entv2/conversion/where.go +++ b/entc/integration/migrate/entv2/conversion/where.go @@ -35,12 +35,6 @@ func IDNEQ(id int) predicate.Conversion { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Conversion { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -52,12 +46,6 @@ func IDIn(ids ...int) predicate.Conversion { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Conversion { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/migrate/entv2/customtype/where.go b/entc/integration/migrate/entv2/customtype/where.go index 5bd9f61d4..4215496fb 100644 --- a/entc/integration/migrate/entv2/customtype/where.go +++ b/entc/integration/migrate/entv2/customtype/where.go @@ -37,12 +37,6 @@ func IDNEQ(id int) predicate.CustomType { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.CustomType { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -54,12 +48,6 @@ func IDIn(ids ...int) predicate.CustomType { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.CustomType { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/migrate/entv2/group/where.go b/entc/integration/migrate/entv2/group/where.go index 19bca49de..2bc560365 100644 --- a/entc/integration/migrate/entv2/group/where.go +++ b/entc/integration/migrate/entv2/group/where.go @@ -35,12 +35,6 @@ func IDNEQ(id int) predicate.Group { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Group { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -52,12 +46,6 @@ func IDIn(ids ...int) predicate.Group { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Group { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/migrate/entv2/media/where.go b/entc/integration/migrate/entv2/media/where.go index 4c4d71dfe..93e74697a 100644 --- a/entc/integration/migrate/entv2/media/where.go +++ b/entc/integration/migrate/entv2/media/where.go @@ -35,12 +35,6 @@ func IDNEQ(id int) predicate.Media { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Media { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -52,12 +46,6 @@ func IDIn(ids ...int) predicate.Media { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Media { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/migrate/entv2/pet/where.go b/entc/integration/migrate/entv2/pet/where.go index e849e0fa1..914f710b9 100644 --- a/entc/integration/migrate/entv2/pet/where.go +++ b/entc/integration/migrate/entv2/pet/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Pet { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Pet { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Pet { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Pet { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/migrate/entv2/user/where.go b/entc/integration/migrate/entv2/user/where.go index b1cf00c92..c44f4dba6 100644 --- a/entc/integration/migrate/entv2/user/where.go +++ b/entc/integration/migrate/entv2/user/where.go @@ -38,12 +38,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -55,12 +49,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/migrate/versioned/group/where.go b/entc/integration/migrate/versioned/group/where.go index 2d5474a08..7a1ff174e 100644 --- a/entc/integration/migrate/versioned/group/where.go +++ b/entc/integration/migrate/versioned/group/where.go @@ -35,12 +35,6 @@ func IDNEQ(id int) predicate.Group { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Group { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -52,12 +46,6 @@ func IDIn(ids ...int) predicate.Group { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Group { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/migrate/versioned/user/where.go b/entc/integration/migrate/versioned/user/where.go index 9830f0275..db41950a5 100644 --- a/entc/integration/migrate/versioned/user/where.go +++ b/entc/integration/migrate/versioned/user/where.go @@ -35,12 +35,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -52,12 +46,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/multischema/ent/group/where.go b/entc/integration/multischema/ent/group/where.go index 3c592a17c..c3f5a5bab 100644 --- a/entc/integration/multischema/ent/group/where.go +++ b/entc/integration/multischema/ent/group/where.go @@ -37,12 +37,6 @@ func IDNEQ(id int) predicate.Group { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Group { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -54,12 +48,6 @@ func IDIn(ids ...int) predicate.Group { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Group { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/multischema/ent/pet/where.go b/entc/integration/multischema/ent/pet/where.go index c16f6f2b2..4d4fa02bc 100644 --- a/entc/integration/multischema/ent/pet/where.go +++ b/entc/integration/multischema/ent/pet/where.go @@ -37,12 +37,6 @@ func IDNEQ(id int) predicate.Pet { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Pet { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -54,12 +48,6 @@ func IDIn(ids ...int) predicate.Pet { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Pet { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/multischema/ent/user/where.go b/entc/integration/multischema/ent/user/where.go index 22ad68807..4ad22d13e 100644 --- a/entc/integration/multischema/ent/user/where.go +++ b/entc/integration/multischema/ent/user/where.go @@ -37,12 +37,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -54,12 +48,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/privacy/ent/task/where.go b/entc/integration/privacy/ent/task/where.go index 15e6b22b5..c728a4666 100644 --- a/entc/integration/privacy/ent/task/where.go +++ b/entc/integration/privacy/ent/task/where.go @@ -37,12 +37,6 @@ func IDNEQ(id int) predicate.Task { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Task { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -54,12 +48,6 @@ func IDIn(ids ...int) predicate.Task { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Task { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/privacy/ent/team/where.go b/entc/integration/privacy/ent/team/where.go index bcd75f70d..23ef21a8b 100644 --- a/entc/integration/privacy/ent/team/where.go +++ b/entc/integration/privacy/ent/team/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Team { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Team { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Team { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Team { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/privacy/ent/user/where.go b/entc/integration/privacy/ent/user/where.go index 76134ff8d..c9205f8a4 100644 --- a/entc/integration/privacy/ent/user/where.go +++ b/entc/integration/privacy/ent/user/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/template/ent/group/where.go b/entc/integration/template/ent/group/where.go index 7ac335cea..a1b568bf0 100644 --- a/entc/integration/template/ent/group/where.go +++ b/entc/integration/template/ent/group/where.go @@ -35,12 +35,6 @@ func IDNEQ(id int) predicate.Group { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Group { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -52,12 +46,6 @@ func IDIn(ids ...int) predicate.Group { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Group { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/template/ent/pet/where.go b/entc/integration/template/ent/pet/where.go index 0578fdfbd..ec6386759 100644 --- a/entc/integration/template/ent/pet/where.go +++ b/entc/integration/template/ent/pet/where.go @@ -38,12 +38,6 @@ func IDNEQ(id int) predicate.Pet { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Pet { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -55,12 +49,6 @@ func IDIn(ids ...int) predicate.Pet { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Pet { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/entc/integration/template/ent/user/where.go b/entc/integration/template/ent/user/where.go index 4f89f5125..269ee8642 100644 --- a/entc/integration/template/ent/user/where.go +++ b/entc/integration/template/ent/user/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/edgeindex/ent/city/where.go b/examples/edgeindex/ent/city/where.go index 83b50ef74..225a45587 100644 --- a/examples/edgeindex/ent/city/where.go +++ b/examples/edgeindex/ent/city/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.City { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.City { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.City { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.City { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/edgeindex/ent/street/where.go b/examples/edgeindex/ent/street/where.go index f271c5040..7b50a4d94 100644 --- a/examples/edgeindex/ent/street/where.go +++ b/examples/edgeindex/ent/street/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Street { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Street { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Street { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Street { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/entcpkg/ent/user/where.go b/examples/entcpkg/ent/user/where.go index cec2fbd00..ee7a6effd 100644 --- a/examples/entcpkg/ent/user/where.go +++ b/examples/entcpkg/ent/user/where.go @@ -35,12 +35,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -52,12 +46,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/fs/ent/file/where.go b/examples/fs/ent/file/where.go index 1f101b4e6..2511f2518 100644 --- a/examples/fs/ent/file/where.go +++ b/examples/fs/ent/file/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.File { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.File { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.File { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.File { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/m2m2types/ent/group/where.go b/examples/m2m2types/ent/group/where.go index 3af5805d7..8e4d9a032 100644 --- a/examples/m2m2types/ent/group/where.go +++ b/examples/m2m2types/ent/group/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Group { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Group { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Group { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Group { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/m2m2types/ent/user/where.go b/examples/m2m2types/ent/user/where.go index cb02f3c25..14cbc8387 100644 --- a/examples/m2m2types/ent/user/where.go +++ b/examples/m2m2types/ent/user/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/m2mbidi/ent/user/where.go b/examples/m2mbidi/ent/user/where.go index d9d82f1f1..0ca486b09 100644 --- a/examples/m2mbidi/ent/user/where.go +++ b/examples/m2mbidi/ent/user/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/m2mrecur/ent/user/where.go b/examples/m2mrecur/ent/user/where.go index 07e15d4c2..c9067a74d 100644 --- a/examples/m2mrecur/ent/user/where.go +++ b/examples/m2mrecur/ent/user/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/o2m2types/ent/pet/where.go b/examples/o2m2types/ent/pet/where.go index 3fb3cfd3c..a15ef9c21 100644 --- a/examples/o2m2types/ent/pet/where.go +++ b/examples/o2m2types/ent/pet/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Pet { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Pet { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Pet { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Pet { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/o2m2types/ent/user/where.go b/examples/o2m2types/ent/user/where.go index 80abcdf9b..7b854255c 100644 --- a/examples/o2m2types/ent/user/where.go +++ b/examples/o2m2types/ent/user/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/o2mrecur/ent/node/where.go b/examples/o2mrecur/ent/node/where.go index 0047fd048..363eb5cfc 100644 --- a/examples/o2mrecur/ent/node/where.go +++ b/examples/o2mrecur/ent/node/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Node { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Node { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Node { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Node { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/o2o2types/ent/card/where.go b/examples/o2o2types/ent/card/where.go index 01f101dc6..fbfce2e93 100644 --- a/examples/o2o2types/ent/card/where.go +++ b/examples/o2o2types/ent/card/where.go @@ -38,12 +38,6 @@ func IDNEQ(id int) predicate.Card { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Card { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -55,12 +49,6 @@ func IDIn(ids ...int) predicate.Card { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Card { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/o2o2types/ent/user/where.go b/examples/o2o2types/ent/user/where.go index 0b0a8a4bf..660a1b623 100644 --- a/examples/o2o2types/ent/user/where.go +++ b/examples/o2o2types/ent/user/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/o2obidi/ent/user/where.go b/examples/o2obidi/ent/user/where.go index 39053636b..1b77b0acb 100644 --- a/examples/o2obidi/ent/user/where.go +++ b/examples/o2obidi/ent/user/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/o2orecur/ent/node/where.go b/examples/o2orecur/ent/node/where.go index 8994187f9..e7052900e 100644 --- a/examples/o2orecur/ent/node/where.go +++ b/examples/o2orecur/ent/node/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Node { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Node { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Node { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Node { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/privacyadmin/ent/user/where.go b/examples/privacyadmin/ent/user/where.go index 67f950103..6cbfe9fb4 100644 --- a/examples/privacyadmin/ent/user/where.go +++ b/examples/privacyadmin/ent/user/where.go @@ -35,12 +35,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -52,12 +46,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/privacytenant/ent/group/where.go b/examples/privacytenant/ent/group/where.go index a2af9f33d..5eece4274 100644 --- a/examples/privacytenant/ent/group/where.go +++ b/examples/privacytenant/ent/group/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Group { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Group { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Group { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Group { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/privacytenant/ent/tenant/where.go b/examples/privacytenant/ent/tenant/where.go index 0841f8364..497411fc2 100644 --- a/examples/privacytenant/ent/tenant/where.go +++ b/examples/privacytenant/ent/tenant/where.go @@ -35,12 +35,6 @@ func IDNEQ(id int) predicate.Tenant { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Tenant { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -52,12 +46,6 @@ func IDIn(ids ...int) predicate.Tenant { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Tenant { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/privacytenant/ent/user/where.go b/examples/privacytenant/ent/user/where.go index 0cfa3dbd5..31a599205 100644 --- a/examples/privacytenant/ent/user/where.go +++ b/examples/privacytenant/ent/user/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/start/ent/car/where.go b/examples/start/ent/car/where.go index ba4740688..b216f1ec5 100644 --- a/examples/start/ent/car/where.go +++ b/examples/start/ent/car/where.go @@ -38,12 +38,6 @@ func IDNEQ(id int) predicate.Car { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Car { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -55,12 +49,6 @@ func IDIn(ids ...int) predicate.Car { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Car { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/start/ent/group/where.go b/examples/start/ent/group/where.go index be6cd75e0..261219595 100644 --- a/examples/start/ent/group/where.go +++ b/examples/start/ent/group/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Group { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Group { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Group { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Group { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/start/ent/user/where.go b/examples/start/ent/user/where.go index 3e2210eac..04791f5c2 100644 --- a/examples/start/ent/user/where.go +++ b/examples/start/ent/user/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/traversal/ent/group/where.go b/examples/traversal/ent/group/where.go index c2d6306be..90fff9ae6 100644 --- a/examples/traversal/ent/group/where.go +++ b/examples/traversal/ent/group/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Group { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Group { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Group { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Group { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/traversal/ent/pet/where.go b/examples/traversal/ent/pet/where.go index 4e188dda9..91f832cb1 100644 --- a/examples/traversal/ent/pet/where.go +++ b/examples/traversal/ent/pet/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.Pet { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.Pet { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.Pet { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.Pet { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/traversal/ent/user/where.go b/examples/traversal/ent/user/where.go index 157443364..98058bf87 100644 --- a/examples/traversal/ent/user/where.go +++ b/examples/traversal/ent/user/where.go @@ -36,12 +36,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -53,12 +47,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] diff --git a/examples/version/ent/user/where.go b/examples/version/ent/user/where.go index 72265d67b..8f6478853 100644 --- a/examples/version/ent/user/where.go +++ b/examples/version/ent/user/where.go @@ -35,12 +35,6 @@ func IDNEQ(id int) predicate.User { // IDIn applies the In predicate on the ID field. func IDIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i] @@ -52,12 +46,6 @@ func IDIn(ids ...int) predicate.User { // IDNotIn applies the NotIn predicate on the ID field. func IDNotIn(ids ...int) predicate.User { 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(ids) == 0 { - s.Where(sql.False()) - return - } v := make([]interface{}, len(ids)) for i := range v { v[i] = ids[i]