// should raise a stronger n_plus_one_query finding when the semantic pack is enabled because QueryContext is inside nested loops.
package sample

import "context"

type Rows interface{}

type DB interface {
	QueryContext(context.Context, string, ...any) (Rows, error)
}

func Load(ctx context.Context, db DB, orgs []int, ids []int) error {
	for _, orgID := range orgs {
		for _, id := range ids {
			_, err := db.QueryContext(ctx, "SELECT * FROM widgets WHERE org_id = ? AND id = ?", orgID, id)
			if err != nil {
				return err
			}
		}
	}

	return nil
}
