// Code generated by sqlc. DO NOT EDIT.
// versions:
//   sqlc v1.25.0
// source: sites.sql

package db

import (
	"context"
)

const ListSites = `-- name: ListSites :many
SELECT id, list_id, rank, site
FROM sites
ORDER BY rank
LIMIT $1 OFFSET $2
`

type ListSitesParams struct {
	Limit  int64
	Offset int64
}

func (q *Queries) ListSites(ctx context.Context, arg ListSitesParams) ([]Sites, error) {
	rows, err := q.db.Query(ctx, ListSites, arg.Limit, arg.Offset)
	if err != nil {
		return nil, err
	}
	defer rows.Close()
	items := []Sites{}
	for rows.Next() {
		var i Sites
		if err := rows.Scan(
			&i.ID,
			&i.ListID,
			&i.Rank,
			&i.Site,
		); err != nil {
			return nil, err
		}
		items = append(items, i)
	}
	if err := rows.Err(); err != nil {
		return nil, err
	}
	return items, nil
}
