(_ context.Context, poolID string)
| 551 | } |
| 552 | |
| 553 | func (s *sqlDatabase) PoolInstanceCount(_ context.Context, poolID string) (int64, error) { |
| 554 | pool, err := s.getPoolByID(s.conn, poolID) |
| 555 | if err != nil { |
| 556 | return 0, fmt.Errorf("error fetching pool: %w", err) |
| 557 | } |
| 558 | |
| 559 | var cnt int64 |
| 560 | q := s.conn.Model(&Instance{}).Where("pool_id = ?", pool.ID).Count(&cnt) |
| 561 | if q.Error != nil { |
| 562 | return 0, fmt.Errorf("error fetching instance count: %w", q.Error) |
| 563 | } |
| 564 | return cnt, nil |
| 565 | } |
nothing calls this directly
no test coverage detected