mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
schema/field: add GoType option for string fields (#500)
This commit is contained in:
@@ -122,10 +122,11 @@ func ValueIn(vs ...int) predicate.Node {
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
|
||||
return predicate.Node(func(s *sql.Selector) {
|
||||
// if not arguments were provided, append the FALSE constants,
|
||||
// since we can't apply "IN ()". This will make this predicate falsy.
|
||||
if len(vs) == 0 {
|
||||
if len(v) == 0 {
|
||||
s.Where(sql.False())
|
||||
return
|
||||
}
|
||||
@@ -139,10 +140,11 @@ func ValueNotIn(vs ...int) predicate.Node {
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
|
||||
return predicate.Node(func(s *sql.Selector) {
|
||||
// if not arguments were provided, append the FALSE constants,
|
||||
// since we can't apply "IN ()". This will make this predicate falsy.
|
||||
if len(vs) == 0 {
|
||||
if len(v) == 0 {
|
||||
s.Where(sql.False())
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user