database

package
v0.0.0-...-403e389 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(ctx context.Context) (*pgxpool.Pool, error)

Types

type Circuit

type Circuit struct {
	ID       int32
	Ref      string
	Name     string
	Location *string
	Country  *string
	Lat      pgtype.Numeric
	Lng      pgtype.Numeric
	Alt      *int32
	Url      string
}

type Constructor

type Constructor struct {
	ID          int32
	Ref         string
	Name        string
	Nationality *string
	Url         string
}

type ConstructorResult

type ConstructorResult struct {
	ID            int32
	RaceID        int32
	ConstructorID int32
	Points        pgtype.Numeric
	Status        *string
}

type ConstructorStanding

type ConstructorStanding struct {
	ID            int32
	RaceID        int32
	ConstructorID int32
	Points        pgtype.Numeric
	Position      *int32
	PosText       *string
	Wins          int32
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
	CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error)
}

type Driver

type Driver struct {
	ID          int32
	Ref         string
	Number      *int32
	Code        *string
	FirstName   string
	LastName    string
	DateOfBirth *time.Time
	Nationality *string
	Url         string
}

type DriverStanding

type DriverStanding struct {
	ID       int32
	RaceID   int32
	DriverID int32
	Points   pgtype.Numeric
	Position *int32
	PosText  *string
	Wins     *int32
}

type GetDriverStandingsByYearRow

type GetDriverStandingsByYearRow struct {
	DriverID  int32
	FirstName string
	LastName  string
	Points    decimal.Decimal
}

type LapTime

type LapTime struct {
	RaceID       int32
	DriverID     int32
	Lap          int32
	Position     *int32
	Time         *string
	Milliseconds *int32
}

type PitStop

type PitStop struct {
	RaceID       int32
	DriverID     int32
	Stop         int32
	Lap          int32
	Time         time.Time
	Duration     *string
	Milliseconds *int32
}

type Qualifying

type Qualifying struct {
	ID            int32
	RaceID        int32
	DriverID      int32
	ConstructorID int32
	Number        int32
	Position      *int32
	Q1            *string
	Q2            *string
	Q3            *string
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) GetDriverStandingsByYear

func (q *Queries) GetDriverStandingsByYear(ctx context.Context, year int32) ([]GetDriverStandingsByYearRow, error)

func (*Queries) SaveCircuits

func (q *Queries) SaveCircuits(ctx context.Context, arg []SaveCircuitsParams) (int64, error)

func (*Queries) SaveConstructorResults

func (q *Queries) SaveConstructorResults(ctx context.Context, arg []SaveConstructorResultsParams) (int64, error)

func (*Queries) SaveConstructorStandings

func (q *Queries) SaveConstructorStandings(ctx context.Context, arg []SaveConstructorStandingsParams) (int64, error)

func (*Queries) SaveConstructors

func (q *Queries) SaveConstructors(ctx context.Context, arg []SaveConstructorsParams) (int64, error)

func (*Queries) SaveDriverStandings

func (q *Queries) SaveDriverStandings(ctx context.Context, arg []SaveDriverStandingsParams) (int64, error)

func (*Queries) SaveDrivers

func (q *Queries) SaveDrivers(ctx context.Context, arg []SaveDriversParams) (int64, error)

func (*Queries) SaveLapTimes

func (q *Queries) SaveLapTimes(ctx context.Context, arg []SaveLapTimesParams) (int64, error)

func (*Queries) SavePitStops

func (q *Queries) SavePitStops(ctx context.Context, arg []SavePitStopsParams) (int64, error)

func (*Queries) SaveQualifyingResults

func (q *Queries) SaveQualifyingResults(ctx context.Context, arg []SaveQualifyingResultsParams) (int64, error)

func (*Queries) SaveRaces

func (q *Queries) SaveRaces(ctx context.Context, arg []SaveRacesParams) (int64, error)

func (*Queries) SaveResults

func (q *Queries) SaveResults(ctx context.Context, arg []SaveResultsParams) (int64, error)

func (*Queries) SaveSeasons

func (q *Queries) SaveSeasons(ctx context.Context, arg []SaveSeasonsParams) (int64, error)

func (*Queries) SaveSprintResults

func (q *Queries) SaveSprintResults(ctx context.Context, arg []SaveSprintResultsParams) (int64, error)

func (*Queries) SaveStatuses

func (q *Queries) SaveStatuses(ctx context.Context, arg []SaveStatusesParams) (int64, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type Race

type Race struct {
	ID         int32
	Year       int32
	Round      int32
	CircuitID  int32
	Name       string
	Date       time.Time
	Time       *time.Time
	Url        *string
	Fp1Date    *time.Time
	Fp1Time    *time.Time
	Fp2Date    *time.Time
	Fp2Time    *time.Time
	Fp3Date    *time.Time
	Fp3Time    *time.Time
	QualiDate  *time.Time
	QualiTime  *time.Time
	SprintDate *time.Time
	SprintTime *time.Time
}

type Result

type Result struct {
	ID              int32
	RaceID          int32
	DriverID        int32
	ConstructorID   int32
	Number          *int32
	Grid            int32
	Position        *int32
	PosText         string
	PosOrder        int32
	Points          pgtype.Numeric
	Laps            int32
	Time            *string
	Milliseconds    *int32
	FastestLap      *int32
	Rank            *int32
	FastestLapTime  *string
	FastestLapSpeed *string
	StatusID        *int32
}

type SaveCircuitsParams

type SaveCircuitsParams struct {
	ID       int32
	Ref      string
	Name     string
	Location *string
	Country  *string
	Lat      *decimal.Decimal
	Lng      *decimal.Decimal
	Alt      *int32
	Url      string
}

type SaveConstructorResultsParams

type SaveConstructorResultsParams struct {
	ID            int32
	RaceID        int32
	ConstructorID int32
	Points        *decimal.Decimal
	Status        *string
}

type SaveConstructorStandingsParams

type SaveConstructorStandingsParams struct {
	ID            int32
	RaceID        int32
	ConstructorID int32
	Points        decimal.Decimal
	Position      *int32
	PosText       *string
	Wins          int32
}

type SaveConstructorsParams

type SaveConstructorsParams struct {
	ID          int32
	Ref         string
	Name        string
	Nationality *string
	Url         string
}

type SaveDriverStandingsParams

type SaveDriverStandingsParams struct {
	ID       int32
	RaceID   int32
	DriverID int32
	Points   decimal.Decimal
	Position *int32
	PosText  *string
	Wins     *int32
}

type SaveDriversParams

type SaveDriversParams struct {
	ID          int32
	Ref         string
	Number      *int32
	Code        *string
	FirstName   string
	LastName    string
	DateOfBirth *time.Time
	Nationality *string
	Url         string
}

type SaveLapTimesParams

type SaveLapTimesParams struct {
	RaceID       int32
	DriverID     int32
	Lap          int32
	Position     *int32
	Time         *string
	Milliseconds *int32
}

type SavePitStopsParams

type SavePitStopsParams struct {
	RaceID       int32
	DriverID     int32
	Stop         int32
	Lap          int32
	Time         time.Time
	Duration     *string
	Milliseconds *int32
}

type SaveQualifyingResultsParams

type SaveQualifyingResultsParams struct {
	ID            int32
	RaceID        int32
	DriverID      int32
	ConstructorID int32
	Number        int32
	Position      *int32
	Q1            *string
	Q2            *string
	Q3            *string
}

type SaveRacesParams

type SaveRacesParams struct {
	ID         int32
	Year       int32
	Round      int32
	CircuitID  int32
	Name       string
	Date       time.Time
	Time       *time.Time
	Url        *string
	Fp1Date    *time.Time
	Fp1Time    *time.Time
	Fp2Date    *time.Time
	Fp2Time    *time.Time
	Fp3Date    *time.Time
	Fp3Time    *time.Time
	QualiDate  *time.Time
	QualiTime  *time.Time
	SprintDate *time.Time
	SprintTime *time.Time
}

type SaveResultsParams

type SaveResultsParams struct {
	ID              int32
	RaceID          int32
	DriverID        int32
	ConstructorID   int32
	Number          *int32
	Grid            int32
	Position        *int32
	PosText         string
	PosOrder        int32
	Points          decimal.Decimal
	Laps            int32
	Time            *string
	Milliseconds    *int32
	FastestLap      *int32
	Rank            *int32
	FastestLapTime  *string
	FastestLapSpeed *string
	StatusID        *int32
}

type SaveSeasonsParams

type SaveSeasonsParams struct {
	Year int32
	Url  string
}

type SaveSprintResultsParams

type SaveSprintResultsParams struct {
	ID             int32
	RaceID         int32
	DriverID       int32
	ConstructorID  int32
	Number         int32
	Grid           int32
	Position       *int32
	PosText        string
	PosOrder       int32
	Points         decimal.Decimal
	Laps           int32
	Time           *string
	Milliseconds   *int32
	FastestLap     *int32
	FastestLapTime *string
	StatusID       *int32
}

type SaveStatusesParams

type SaveStatusesParams struct {
	ID     int32
	Status string
}

type Season

type Season struct {
	Year int32
	Url  string
}

type SprintResult

type SprintResult struct {
	ID             int32
	RaceID         int32
	DriverID       int32
	ConstructorID  int32
	Number         int32
	Grid           int32
	Position       *int32
	PosText        string
	PosOrder       int32
	Points         pgtype.Numeric
	Laps           int32
	Time           *string
	Milliseconds   *int32
	FastestLap     *int32
	FastestLapTime *string
	StatusID       *int32
}

type Status

type Status struct {
	ID     int32
	Status string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL