mirror of
https://github.com/ent/ent.git
synced 2026-05-28 09:49:08 +03:00
entc/gen: allow selecting specific fields (#1075)
This commit is contained in:
@@ -344,19 +344,18 @@ func (gq *GroupQuery) sqlAll(ctx context.Context) ([]*Group, error) {
|
||||
gq.withUsers != nil,
|
||||
}
|
||||
)
|
||||
_spec.ScanValues = func() []interface{} {
|
||||
_spec.ScanValues = func(columns []string) ([]interface{}, error) {
|
||||
node := &Group{config: gq.config}
|
||||
nodes = append(nodes, node)
|
||||
values := node.scanValues()
|
||||
return values
|
||||
return node.scanValues(columns)
|
||||
}
|
||||
_spec.Assign = func(values ...interface{}) error {
|
||||
_spec.Assign = func(columns []string, values []interface{}) error {
|
||||
if len(nodes) == 0 {
|
||||
return fmt.Errorf("ent: Assign called without calling ScanValues")
|
||||
}
|
||||
node := nodes[len(nodes)-1]
|
||||
node.Edges.loadedTypes = loadedTypes
|
||||
return node.assignValues(values...)
|
||||
return node.assignValues(columns, values)
|
||||
}
|
||||
if err := sqlgraph.QueryNodes(ctx, gq.driver, _spec); err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user