176 lines
4.7 KiB
Go
176 lines
4.7 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.25.0
|
|
// source: copyfrom.go
|
|
|
|
package model
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
// iteratorForCreateCountries implements pgx.CopyFromSource.
|
|
type iteratorForCreateCountries struct {
|
|
rows []CreateCountriesParams
|
|
skippedFirstNextCall bool
|
|
}
|
|
|
|
func (r *iteratorForCreateCountries) 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 iteratorForCreateCountries) Values() ([]interface{}, error) {
|
|
return []interface{}{
|
|
r.rows[0].Slug,
|
|
r.rows[0].Code,
|
|
r.rows[0].DisplayName,
|
|
r.rows[0].ThreeLetterCode,
|
|
r.rows[0].FlagFlat64Url,
|
|
r.rows[0].FlagFlat32Url,
|
|
r.rows[0].FlagRound64Url,
|
|
r.rows[0].FlagRound32Url,
|
|
}, nil
|
|
}
|
|
|
|
func (r iteratorForCreateCountries) Err() error {
|
|
return nil
|
|
}
|
|
|
|
func (q *Queries) CreateCountries(ctx context.Context, arg []CreateCountriesParams) (int64, error) {
|
|
return q.db.CopyFrom(ctx, []string{"countries"}, []string{"slug", "code", "display_name", "three_letter_code", "flag_flat_64_url", "flag_flat_32_url", "flag_round_64_url", "flag_round_32_url"}, &iteratorForCreateCountries{rows: arg})
|
|
}
|
|
|
|
// iteratorForCreateFixtures implements pgx.CopyFromSource.
|
|
type iteratorForCreateFixtures struct {
|
|
rows []CreateFixturesParams
|
|
skippedFirstNextCall bool
|
|
}
|
|
|
|
func (r *iteratorForCreateFixtures) 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 iteratorForCreateFixtures) Values() ([]interface{}, error) {
|
|
return []interface{}{
|
|
r.rows[0].Slug,
|
|
r.rows[0].DisplayName,
|
|
r.rows[0].State,
|
|
r.rows[0].StartDate,
|
|
r.rows[0].EndDate,
|
|
r.rows[0].GameWeek,
|
|
}, nil
|
|
}
|
|
|
|
func (r iteratorForCreateFixtures) Err() error {
|
|
return nil
|
|
}
|
|
|
|
// Active: 1709890109198@@192.168.1.250@5436@sorare
|
|
func (q *Queries) CreateFixtures(ctx context.Context, arg []CreateFixturesParams) (int64, error) {
|
|
return q.db.CopyFrom(ctx, []string{"fixtures"}, []string{"slug", "display_name", "state", "start_date", "end_date", "game_week"}, &iteratorForCreateFixtures{rows: arg})
|
|
}
|
|
|
|
// iteratorForCreateGames implements pgx.CopyFromSource.
|
|
type iteratorForCreateGames struct {
|
|
rows []CreateGamesParams
|
|
skippedFirstNextCall bool
|
|
}
|
|
|
|
func (r *iteratorForCreateGames) 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 iteratorForCreateGames) Values() ([]interface{}, error) {
|
|
return []interface{}{
|
|
r.rows[0].ID,
|
|
r.rows[0].Date,
|
|
r.rows[0].CoverageStatus,
|
|
r.rows[0].LowCoverage,
|
|
r.rows[0].Minutes,
|
|
r.rows[0].PeriodType,
|
|
r.rows[0].Scored,
|
|
r.rows[0].Status,
|
|
r.rows[0].CompetitionSlug,
|
|
r.rows[0].FixtureSlug,
|
|
r.rows[0].AwayTeamSlug,
|
|
r.rows[0].AwayGoals,
|
|
r.rows[0].AwayExtraTimeScore,
|
|
r.rows[0].AwayPenaltyScore,
|
|
r.rows[0].HomeTeamSlug,
|
|
r.rows[0].HomeGoals,
|
|
r.rows[0].HomeExtraTimeScore,
|
|
r.rows[0].HomePenaltyScore,
|
|
r.rows[0].WinnerTeamSlug,
|
|
}, nil
|
|
}
|
|
|
|
func (r iteratorForCreateGames) Err() error {
|
|
return nil
|
|
}
|
|
|
|
func (q *Queries) CreateGames(ctx context.Context, arg []CreateGamesParams) (int64, error) {
|
|
return q.db.CopyFrom(ctx, []string{"games"}, []string{"id", "date", "coverage_status", "low_coverage", "minutes", "period_type", "scored", "status", "competition_slug", "fixture_slug", "away_team_slug", "away_goals", "away_extra_time_score", "away_penalty_score", "home_team_slug", "home_goals", "home_extra_time_score", "home_penalty_score", "winner_team_slug"}, &iteratorForCreateGames{rows: arg})
|
|
}
|
|
|
|
// iteratorForCreateTeams implements pgx.CopyFromSource.
|
|
type iteratorForCreateTeams struct {
|
|
rows []CreateTeamsParams
|
|
skippedFirstNextCall bool
|
|
}
|
|
|
|
func (r *iteratorForCreateTeams) 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 iteratorForCreateTeams) Values() ([]interface{}, error) {
|
|
return []interface{}{
|
|
r.rows[0].Slug,
|
|
r.rows[0].DisplayName,
|
|
r.rows[0].CountrySlug,
|
|
r.rows[0].DomesticLeagueSlug,
|
|
r.rows[0].ShortName,
|
|
r.rows[0].PictureUrl,
|
|
r.rows[0].TeamType,
|
|
}, nil
|
|
}
|
|
|
|
func (r iteratorForCreateTeams) Err() error {
|
|
return nil
|
|
}
|
|
|
|
func (q *Queries) CreateTeams(ctx context.Context, arg []CreateTeamsParams) (int64, error) {
|
|
return q.db.CopyFrom(ctx, []string{"teams"}, []string{"slug", "display_name", "country_slug", "domestic_league_slug", "short_name", "picture_url", "team_type"}, &iteratorForCreateTeams{rows: arg})
|
|
}
|