// Code generated by sqlc. DO NOT EDIT.
// versions:
//   sqlc v1.29.0
// source: copyfrom.go

package dbgen

import (
	"context"
)

// iteratorForCreateBetOutcome implements pgx.CopyFromSource.
type iteratorForCreateBetOutcome struct {
	rows                 []CreateBetOutcomeParams
	skippedFirstNextCall bool
}

func (r *iteratorForCreateBetOutcome) Next() bool {
	if len(r.rows) == 0 {
		return false
	}
	if !r.skippedFirstNextCall {
		r.skippedFirstNextCall = true
		return true
	}
	r.rows = r.rows[1:]
	return len(r.rows) > 0
}

func (r iteratorForCreateBetOutcome) Values() ([]interface{}, error) {
	return []interface{}{
		r.rows[0].BetID,
		r.rows[0].SportID,
		r.rows[0].EventID,
		r.rows[0].OddID,
		r.rows[0].HomeTeamName,
		r.rows[0].AwayTeamName,
		r.rows[0].MarketID,
		r.rows[0].MarketName,
		r.rows[0].Odd,
		r.rows[0].OddName,
		r.rows[0].OddHeader,
		r.rows[0].OddHandicap,
		r.rows[0].Expires,
	}, nil
}

func (r iteratorForCreateBetOutcome) Err() error {
	return nil
}

func (q *Queries) CreateBetOutcome(ctx context.Context, arg []CreateBetOutcomeParams) (int64, error) {
	return q.db.CopyFrom(ctx, []string{"bet_outcomes"}, []string{"bet_id", "sport_id", "event_id", "odd_id", "home_team_name", "away_team_name", "market_id", "market_name", "odd", "odd_name", "odd_header", "odd_handicap", "expires"}, &iteratorForCreateBetOutcome{rows: arg})
}

// iteratorForCreateTicketOutcome implements pgx.CopyFromSource.
type iteratorForCreateTicketOutcome struct {
	rows                 []CreateTicketOutcomeParams
	skippedFirstNextCall bool
}

func (r *iteratorForCreateTicketOutcome) Next() bool {
	if len(r.rows) == 0 {
		return false
	}
	if !r.skippedFirstNextCall {
		r.skippedFirstNextCall = true
		return true
	}
	r.rows = r.rows[1:]
	return len(r.rows) > 0
}

func (r iteratorForCreateTicketOutcome) Values() ([]interface{}, error) {
	return []interface{}{
		r.rows[0].TicketID,
		r.rows[0].EventID,
		r.rows[0].OddID,
		r.rows[0].HomeTeamName,
		r.rows[0].AwayTeamName,
		r.rows[0].MarketID,
		r.rows[0].MarketName,
		r.rows[0].Odd,
		r.rows[0].OddName,
		r.rows[0].OddHeader,
		r.rows[0].OddHandicap,
		r.rows[0].Expires,
	}, nil
}

func (r iteratorForCreateTicketOutcome) Err() error {
	return nil
}

func (q *Queries) CreateTicketOutcome(ctx context.Context, arg []CreateTicketOutcomeParams) (int64, error) {
	return q.db.CopyFrom(ctx, []string{"ticket_outcomes"}, []string{"ticket_id", "event_id", "odd_id", "home_team_name", "away_team_name", "market_id", "market_name", "odd", "odd_name", "odd_header", "odd_handicap", "expires"}, &iteratorForCreateTicketOutcome{rows: arg})
}
