db

package
v0.0.0-...-5894149 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateCaseParams

type CreateCaseParams struct {
	DateRep                 string `json:"date_rep"`
	Day                     int32  `json:"day"`
	Month                   int32  `json:"month"`
	Year                    int32  `json:"year"`
	Cases                   int64  `json:"cases"`
	Deaths                  int64  `json:"deaths"`
	CountriesAndTerritories string `json:"countries_and_territories"`
	GeoID                   string `json:"geo_id"`
	CountryTerritoryCode    string `json:"country_territory_code"`
	ContinentExp            string `json:"continent_exp"`
	LoadDate                string `json:"load_date"`
	IsoCountry              string `json:"iso_country"`
}

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
}

type EcdeCase

type EcdeCase struct {
	ID                      int64  `json:"id"`
	DateRep                 string `json:"date_rep"`
	Day                     int32  `json:"day"`
	Month                   int32  `json:"month"`
	Year                    int32  `json:"year"`
	Cases                   int64  `json:"cases"`
	Deaths                  int64  `json:"deaths"`
	CountriesAndTerritories string `json:"countries_and_territories"`
	GeoID                   string `json:"geo_id"`
	CountryTerritoryCode    string `json:"country_territory_code"`
	ContinentExp            string `json:"continent_exp"`
	LoadDate                string `json:"load_date"`
	IsoCountry              string `json:"iso_country"`
}

type ListCasesParams

type ListCasesParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type Querier

type Querier interface {
	CreateCase(ctx context.Context, arg CreateCaseParams) (EcdeCase, error)
	GetCase(ctx context.Context, id int64) (EcdeCase, error)
	ListCases(ctx context.Context, arg ListCasesParams) ([]EcdeCase, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateCase

func (q *Queries) CreateCase(ctx context.Context, arg CreateCaseParams) (EcdeCase, error)

func (*Queries) GetCase

func (q *Queries) GetCase(ctx context.Context, id int64) (EcdeCase, error)

func (*Queries) ListCases

func (q *Queries) ListCases(ctx context.Context, arg ListCasesParams) ([]EcdeCase, error)

func (*Queries) WithTx

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

type Store

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

func (*Store) CreateCaseTx

func (s *Store) CreateCaseTx(context context.Context, args CreateCaseParams) (EcdeCase, error)

type TxStore

type TxStore interface {
	Querier
	CreateCaseTx(context context.Context, args CreateCaseParams) (EcdeCase, error)
}

func NewStore

func NewStore(connPool *pgxpool.Pool) TxStore

Jump to

Keyboard shortcuts

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