| 368 | } |
| 369 | |
| 370 | func (sfq *StorageFileQuery) sqlCount(ctx context.Context) (int, error) { |
| 371 | _spec := sfq.querySpec() |
| 372 | if len(sfq.modifiers) > 0 { |
| 373 | _spec.Modifiers = sfq.modifiers |
| 374 | } |
| 375 | _spec.Node.Columns = sfq.ctx.Fields |
| 376 | if len(sfq.ctx.Fields) > 0 { |
| 377 | _spec.Unique = sfq.ctx.Unique != nil && *sfq.ctx.Unique |
| 378 | } |
| 379 | return sqlgraph.CountNodes(ctx, sfq.driver, _spec) |
| 380 | } |
| 381 | |
| 382 | func (sfq *StorageFileQuery) querySpec() *sqlgraph.QuerySpec { |
| 383 | _spec := sqlgraph.NewQuerySpec(storagefile.Table, storagefile.Columns, sqlgraph.NewFieldSpec(storagefile.FieldID, field.TypeUUID)) |