| 517 | } |
| 518 | |
| 519 | func (uq *UserQuery) sqlCount(ctx context.Context) (int, error) { |
| 520 | _spec := uq.querySpec() |
| 521 | if len(uq.modifiers) > 0 { |
| 522 | _spec.Modifiers = uq.modifiers |
| 523 | } |
| 524 | _spec.Node.Columns = uq.ctx.Fields |
| 525 | if len(uq.ctx.Fields) > 0 { |
| 526 | _spec.Unique = uq.ctx.Unique != nil && *uq.ctx.Unique |
| 527 | } |
| 528 | return sqlgraph.CountNodes(ctx, uq.driver, _spec) |
| 529 | } |
| 530 | |
| 531 | func (uq *UserQuery) querySpec() *sqlgraph.QuerySpec { |
| 532 | _spec := sqlgraph.NewQuerySpec(user.Table, user.Columns, sqlgraph.NewFieldSpec(user.FieldID, field.TypeString)) |