mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: wrap nillable fields with custom go-type with sql.nullscanner
This commit is contained in:
committed by
Ariel Mashraki
parent
762e6aeff9
commit
2480b5c0ef
@@ -444,7 +444,7 @@ func (gq *GroupQuery) sqlAll(ctx context.Context) ([]*Group, error) {
|
||||
s.Where(sql.InValues(group.UsersPrimaryKey[0], fks...))
|
||||
},
|
||||
ScanValues: func() [2]interface{} {
|
||||
return [2]interface{}{&sql.NullInt64{}, &sql.NullInt64{}}
|
||||
return [2]interface{}{new(sql.NullInt64), new(sql.NullInt64)}
|
||||
},
|
||||
Assign: func(out, in interface{}) error {
|
||||
eout, ok := out.(*sql.NullInt64)
|
||||
|
||||
@@ -444,7 +444,7 @@ func (pq *PetQuery) sqlAll(ctx context.Context) ([]*Pet, error) {
|
||||
s.Where(sql.InValues(pet.FriendsPrimaryKey[0], fks...))
|
||||
},
|
||||
ScanValues: func() [2]interface{} {
|
||||
return [2]interface{}{&sql.NullInt64{}, &sql.NullInt64{}}
|
||||
return [2]interface{}{new(sql.NullInt64), new(sql.NullInt64)}
|
||||
},
|
||||
Assign: func(out, in interface{}) error {
|
||||
eout, ok := out.(*sql.NullInt64)
|
||||
|
||||
@@ -538,7 +538,7 @@ func (uq *UserQuery) sqlAll(ctx context.Context) ([]*User, error) {
|
||||
s.Where(sql.InValues(user.FriendsPrimaryKey[0], fks...))
|
||||
},
|
||||
ScanValues: func() [2]interface{} {
|
||||
return [2]interface{}{&sql.NullInt64{}, &sql.NullInt64{}}
|
||||
return [2]interface{}{new(sql.NullInt64), new(sql.NullInt64)}
|
||||
},
|
||||
Assign: func(out, in interface{}) error {
|
||||
eout, ok := out.(*sql.NullInt64)
|
||||
@@ -603,7 +603,7 @@ func (uq *UserQuery) sqlAll(ctx context.Context) ([]*User, error) {
|
||||
s.Where(sql.InValues(user.GroupsPrimaryKey[1], fks...))
|
||||
},
|
||||
ScanValues: func() [2]interface{} {
|
||||
return [2]interface{}{&sql.NullInt64{}, &sql.NullInt64{}}
|
||||
return [2]interface{}{new(sql.NullInt64), new(sql.NullInt64)}
|
||||
},
|
||||
Assign: func(out, in interface{}) error {
|
||||
eout, ok := out.(*sql.NullInt64)
|
||||
|
||||
Reference in New Issue
Block a user