Documentation
¶
Index ¶
- type Competition
- type CreateFixtureParams
- type CreateMatchDetailParams
- type CreateTeamParams
- type DBTX
- type Fixture
- type GetMatchDetailsByFixtureIDRow
- type ListCurrentRoundMatchDetailsByCompetitionIDRow
- type ListMatchDetailsByCompetitionIDRow
- type ListMatchDetailsRow
- type ListRoundMatchDetailsByCompetitionIDParams
- type ListRoundMatchDetailsByCompetitionIDRow
- type MatchDetail
- type Querier
- type Queries
- func (q *Queries) CreateFixture(ctx context.Context, arg CreateFixtureParams) (*Fixture, error)
- func (q *Queries) CreateMatchDetail(ctx context.Context, arg CreateMatchDetailParams) (*MatchDetail, error)
- func (q *Queries) CreateTeam(ctx context.Context, arg CreateTeamParams) (*Team, error)
- func (q *Queries) GetCompetitionByID(ctx context.Context, id int64) (*Competition, error)
- func (q *Queries) GetFixtureByID(ctx context.Context, id int64) (*Fixture, error)
- func (q *Queries) GetFixturesByCompetitionID(ctx context.Context, competitionID int64) ([]*Fixture, error)
- func (q *Queries) GetMatchDetailsByFixtureID(ctx context.Context, fixtureID int64) (*GetMatchDetailsByFixtureIDRow, error)
- func (q *Queries) GetTeamByID(ctx context.Context, id int64) (*Team, error)
- func (q *Queries) ListCompetitions(ctx context.Context) ([]*Competition, error)
- func (q *Queries) ListCurrentRoundMatchDetailsByCompetitionID(ctx context.Context, id int64) ([]*ListCurrentRoundMatchDetailsByCompetitionIDRow, error)
- func (q *Queries) ListFixtures(ctx context.Context) ([]*Fixture, error)
- func (q *Queries) ListMatchDetails(ctx context.Context) ([]*ListMatchDetailsRow, error)
- func (q *Queries) ListMatchDetailsByCompetitionID(ctx context.Context, competitionID int64) ([]*ListMatchDetailsByCompetitionIDRow, error)
- func (q *Queries) ListRoundMatchDetailsByCompetitionID(ctx context.Context, arg ListRoundMatchDetailsByCompetitionIDParams) ([]*ListRoundMatchDetailsByCompetitionIDRow, error)
- func (q *Queries) ListTeams(ctx context.Context) ([]*Team, error)
- func (q *Queries) UpdateCompetitionRound(ctx context.Context, arg UpdateCompetitionRoundParams) (*Competition, error)
- func (q *Queries) UpdateFixture(ctx context.Context, arg UpdateFixtureParams) (*Fixture, error)
- func (q *Queries) UpdateMatchDetail(ctx context.Context, arg UpdateMatchDetailParams) (*MatchDetail, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type Team
- type UpdateCompetitionRoundParams
- type UpdateFixtureParams
- type UpdateMatchDetailParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Competition ¶
type CreateFixtureParams ¶
type CreateMatchDetailParams ¶
type CreateTeamParams ¶
type Fixture ¶
type Fixture struct { // Unique identifier for each fixture ID int64 // Foreign key referencing competitions table CompetitionID int64 // Title of the round (e.g., Round 1) Roundtitle string // Current state of the match (e.g., Upcoming, Completed) Matchstate string // Venue name where the match will take place Venue string // City where the venue is located Venuecity string // URL to the match center page Matchcentreurl string // Scheduled kickoff time of the match Kickofftime pgtype.Timestamp }
type GetMatchDetailsByFixtureIDRow ¶
type GetMatchDetailsByFixtureIDRow struct { MatchDetail MatchDetail Fixture Fixture Team Team Team_2 Team }
type ListCurrentRoundMatchDetailsByCompetitionIDRow ¶
type ListCurrentRoundMatchDetailsByCompetitionIDRow struct { MatchDetail MatchDetail Fixture Fixture Team Team Team_2 Team }
type ListMatchDetailsByCompetitionIDRow ¶
type ListMatchDetailsByCompetitionIDRow struct { MatchDetail MatchDetail Fixture Fixture Team Team Team_2 Team }
type ListMatchDetailsRow ¶
type ListMatchDetailsRow struct { MatchDetail MatchDetail Fixture Fixture Team Team Team_2 Team }
type ListRoundMatchDetailsByCompetitionIDRow ¶
type ListRoundMatchDetailsByCompetitionIDRow struct { MatchDetail MatchDetail Fixture Fixture Team Team Team_2 Team }
type MatchDetail ¶
type MatchDetail struct { // Foreign key referencing fixtures table FixtureID int64 // Foreign key for home team referencing teams table HometeamID int64 // Foreign key for away team referencing teams table AwayteamID int64 // Odds for the home team winning HometeamOdds *float64 // Odds for the away team winning AwayteamOdds *float64 // Score of the home team HometeamScore *int32 // Score of the away team AwayteamScore *int32 // Recent form of the home team (e.g., WLWWL) HometeamForm string // Recent form of the away team (e.g., LWWLL) AwayteamForm string // Foreign key referencing the winning team WinnerTeamid *int64 }
type Querier ¶
type Querier interface { // Insert a new fixture into the fixtures table. // This query adds a new fixture record with the specified details, such as // competition ID, round title, match state, venue, venue city, match center URL, // and kickoff time. CreateFixture(ctx context.Context, arg CreateFixtureParams) (*Fixture, error) // Insert a new match detail record into the match_details table. // If a match detail with the same fixture_id already exists, do nothing. CreateMatchDetail(ctx context.Context, arg CreateMatchDetailParams) (*MatchDetail, error) // Insert a new team into the teams table. // If a team with the same team_id already exists, do nothing. CreateTeam(ctx context.Context, arg CreateTeamParams) (*Team, error) // Retrieve a specific competition by its unique identifier. GetCompetitionByID(ctx context.Context, id int64) (*Competition, error) // Retrieve a specific fixture by its unique identifier. // Useful for fetching details about a single fixture based on its ID. GetFixtureByID(ctx context.Context, id int64) (*Fixture, error) // Retrieve fixtures for a specific competition, ordered by kickoff time. // This query fetches all fixtures for a given competition ID, ordered by their // kickoff time to display them in chronological order. GetFixturesByCompetitionID(ctx context.Context, competitionID int64) ([]*Fixture, error) // Retrieve match details for a specific fixture by its unique fixture ID. GetMatchDetailsByFixtureID(ctx context.Context, fixtureID int64) (*GetMatchDetailsByFixtureIDRow, error) // Retrieve a specific team by its unique identifier. GetTeamByID(ctx context.Context, id int64) (*Team, error) // The competitions table is a static table that stores information about the // competitions that are available in the system. Other tables in the system // reference this table to establish a relationship. // Retrieve all competitions available in the system. ListCompetitions(ctx context.Context) ([]*Competition, error) // Retrieve all match details for a specific competition ID. // This query performs a JOIN between match_details and fixtures to get all // match details that are part of a specific competition and round. ListCurrentRoundMatchDetailsByCompetitionID(ctx context.Context, id int64) ([]*ListCurrentRoundMatchDetailsByCompetitionIDRow, error) // Retrieve all fixtures available in the system. // This query is used to list all fixtures without filtering by any criteria. ListFixtures(ctx context.Context) ([]*Fixture, error) // Retrieve all match details available in the system. ListMatchDetails(ctx context.Context) ([]*ListMatchDetailsRow, error) // Retrieve all match details for a specific competition ID. // This query performs a JOIN between match_details and fixtures to get all // match details that are part of a specific competition. ListMatchDetailsByCompetitionID(ctx context.Context, competitionID int64) ([]*ListMatchDetailsByCompetitionIDRow, error) // Retrieve all match details for a specific competition ID. // This query performs a JOIN between match_details and fixtures to get all // match details that are part of a specific competition and round. ListRoundMatchDetailsByCompetitionID(ctx context.Context, arg ListRoundMatchDetailsByCompetitionIDParams) ([]*ListRoundMatchDetailsByCompetitionIDRow, error) // Retrieve all teams available in the system. ListTeams(ctx context.Context) ([]*Team, error) // The following commands for creating, updating, and deleting competitions // are not required since this is a static table with fixed records: // - NRL (111) // - NRLW (161) // - State of Origin (116) // - State of Origin Womens (156) // // However, if future updates to this table are needed (e.g., new competitions), // you may add additional commands to handle such changes. // Update the current round for a competition. // This query updates the round field for a specific competition based on the // provided competition ID. UpdateCompetitionRound(ctx context.Context, arg UpdateCompetitionRoundParams) (*Competition, error) // Conditionally update fixture details based on provided arguments. // This query updates the fields of a fixture record where the provided arguments // are not NULL. It uses the COALESCE function to retain the existing value if // the argument is NULL. UpdateFixture(ctx context.Context, arg UpdateFixtureParams) (*Fixture, error) // Conditionally update match detail fields based on provided arguments. // Only updates fields where the argument is not NULL. UpdateMatchDetail(ctx context.Context, arg UpdateMatchDetailParams) (*MatchDetail, error) }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CreateFixture ¶
Insert a new fixture into the fixtures table. This query adds a new fixture record with the specified details, such as competition ID, round title, match state, venue, venue city, match center URL, and kickoff time.
func (*Queries) CreateMatchDetail ¶
func (q *Queries) CreateMatchDetail(ctx context.Context, arg CreateMatchDetailParams) (*MatchDetail, error)
Insert a new match detail record into the match_details table. If a match detail with the same fixture_id already exists, do nothing.
func (*Queries) CreateTeam ¶
Insert a new team into the teams table. If a team with the same team_id already exists, do nothing.
func (*Queries) GetCompetitionByID ¶
Retrieve a specific competition by its unique identifier.
func (*Queries) GetFixtureByID ¶
Retrieve a specific fixture by its unique identifier. Useful for fetching details about a single fixture based on its ID.
func (*Queries) GetFixturesByCompetitionID ¶
func (q *Queries) GetFixturesByCompetitionID(ctx context.Context, competitionID int64) ([]*Fixture, error)
Retrieve fixtures for a specific competition, ordered by kickoff time. This query fetches all fixtures for a given competition ID, ordered by their kickoff time to display them in chronological order.
func (*Queries) GetMatchDetailsByFixtureID ¶
func (q *Queries) GetMatchDetailsByFixtureID(ctx context.Context, fixtureID int64) (*GetMatchDetailsByFixtureIDRow, error)
Retrieve match details for a specific fixture by its unique fixture ID.
func (*Queries) GetTeamByID ¶
Retrieve a specific team by its unique identifier.
func (*Queries) ListCompetitions ¶
func (q *Queries) ListCompetitions(ctx context.Context) ([]*Competition, error)
The competitions table is a static table that stores information about the competitions that are available in the system. Other tables in the system reference this table to establish a relationship. Retrieve all competitions available in the system.
func (*Queries) ListCurrentRoundMatchDetailsByCompetitionID ¶
func (q *Queries) ListCurrentRoundMatchDetailsByCompetitionID(ctx context.Context, id int64) ([]*ListCurrentRoundMatchDetailsByCompetitionIDRow, error)
Retrieve all match details for a specific competition ID. This query performs a JOIN between match_details and fixtures to get all match details that are part of a specific competition and round.
func (*Queries) ListFixtures ¶
Retrieve all fixtures available in the system. This query is used to list all fixtures without filtering by any criteria.
func (*Queries) ListMatchDetails ¶
func (q *Queries) ListMatchDetails(ctx context.Context) ([]*ListMatchDetailsRow, error)
Retrieve all match details available in the system.
func (*Queries) ListMatchDetailsByCompetitionID ¶
func (q *Queries) ListMatchDetailsByCompetitionID(ctx context.Context, competitionID int64) ([]*ListMatchDetailsByCompetitionIDRow, error)
Retrieve all match details for a specific competition ID. This query performs a JOIN between match_details and fixtures to get all match details that are part of a specific competition.
func (*Queries) ListRoundMatchDetailsByCompetitionID ¶
func (q *Queries) ListRoundMatchDetailsByCompetitionID(ctx context.Context, arg ListRoundMatchDetailsByCompetitionIDParams) ([]*ListRoundMatchDetailsByCompetitionIDRow, error)
Retrieve all match details for a specific competition ID. This query performs a JOIN between match_details and fixtures to get all match details that are part of a specific competition and round.
func (*Queries) UpdateCompetitionRound ¶
func (q *Queries) UpdateCompetitionRound(ctx context.Context, arg UpdateCompetitionRoundParams) (*Competition, error)
The following commands for creating, updating, and deleting competitions are not required since this is a static table with fixed records: - NRL (111) - NRLW (161) - State of Origin (116) - State of Origin Womens (156)
However, if future updates to this table are needed (e.g., new competitions), you may add additional commands to handle such changes. Update the current round for a competition. This query updates the round field for a specific competition based on the provided competition ID.
func (*Queries) UpdateFixture ¶
Conditionally update fixture details based on provided arguments. This query updates the fields of a fixture record where the provided arguments are not NULL. It uses the COALESCE function to retain the existing value if the argument is NULL.
func (*Queries) UpdateMatchDetail ¶
func (q *Queries) UpdateMatchDetail(ctx context.Context, arg UpdateMatchDetailParams) (*MatchDetail, error)
Conditionally update match detail fields based on provided arguments. Only updates fields where the argument is not NULL.