package sample

import "context"

type Rows interface{}

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

func Load(ctx context.Context, db DB, id int) error {
	_, err := db.QueryContext(ctx, "SELECT id, name FROM widgets WHERE id = $1 LIMIT 1", id)
	if err != nil {
		return err
	}

	return nil
}