entc/gen: apply field selection on builer types (#1094)

This commit is contained in:
Ariel Mashraki
2020-12-28 14:38:20 +02:00
committed by GitHub
parent c4a43bc2be
commit 37f9c30a12
69 changed files with 212 additions and 2 deletions

View File

@@ -355,6 +355,9 @@ func (uq *UserQuery) querySpec() *sqlgraph.QuerySpec {
From: uq.sql,
Unique: true,
}
if fields := uq.fields; len(fields) > 0 {
_spec.Node.Columns = fields
}
if ps := uq.predicates; len(ps) > 0 {
_spec.Predicate = func(selector *sql.Selector) {
for i := range ps {