sql

package
v0.0.0-...-68bd8a1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const CardsTable = "cards"

Variables

This section is empty.

Functions

This section is empty.

Types

type Card

type Card struct {
	ID         uuid.UUID `db:"id"`
	Name       string    `db:"name"`
	Language   string    `db:"language"`
	URL        string    `db:"url"`
	SetName    string    `db:"set_name"`
	Rarity     string    `db:"rarity"`
	ManaCost   string    `db:"mana_cost"`
	Reprint    bool      `db:"reprint"`
	Price      string    `db:"price"`
	ReleasedAt time.Time `db:"released_at"`
	Opts       int       `db:"opts"`
	Quantity   int       `db:"quantity"`
	Condition  string    `db:"condition"`
}

type CardsRepository

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

func NewCardsRepository

func NewCardsRepository(session db.Session) *CardsRepository

func (*CardsRepository) GetAll

func (c *CardsRepository) GetAll(ctx context.Context) ([]domain.Card, error)

func (*CardsRepository) GetByID

func (c *CardsRepository) GetByID(ctx context.Context, id uuid.UUID) (domain.Card, error)

func (*CardsRepository) Insert

func (c *CardsRepository) Insert(ctx context.Context, card domain.Card) error

func (*CardsRepository) Update

func (c *CardsRepository) Update(ctx context.Context, card domain.Card) error

type Config

type Config struct {
	URL string
}

Config defines the SQL connection configuration

func (*Config) DatabaseURL

func (c *Config) DatabaseURL() string

DatabaseURL returns the url prepared with its param values.

Jump to

Keyboard shortcuts

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