schema/field: add GoType option for string fields (#500)

This commit is contained in:
Ariel Mashraki
2020-05-25 20:05:17 +03:00
committed by GitHub
parent 31690c7e60
commit 100d300094
58 changed files with 845 additions and 273 deletions

View File

@@ -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
}