postgresql

package
v0.0.0-...-cf22472 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Basket

type Basket struct {
	ID      int64
	BuyerID pgtype.Int8
}

type BasketItem

type BasketItem struct {
	ID       int64
	BasketID pgtype.Int8
	PetID    pgtype.Int8
}

type Buyer

type Buyer struct {
	ID       int64
	UserID   pgtype.Int8
	Username string
}

type Category

type Category struct {
	ID   int64
	Name string
}

type CreatePetParams

type CreatePetParams struct {
	Name     string
	PhotoUrl string
}

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 ListPetsParams

type ListPetsParams struct {
	Offset int32
	Limit  int32
}

type NullOauthProvider

type NullOauthProvider struct {
	OauthProvider OauthProvider
	Valid         bool // Valid is true if OauthProvider is not NULL
}

func (*NullOauthProvider) Scan

func (ns *NullOauthProvider) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullOauthProvider) Value

func (ns NullOauthProvider) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullOrderStatus

type NullOrderStatus struct {
	OrderStatus OrderStatus
	Valid       bool // Valid is true if OrderStatus is not NULL
}

func (*NullOrderStatus) Scan

func (ns *NullOrderStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullOrderStatus) Value

func (ns NullOrderStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type OauthProvider

type OauthProvider string
const (
	OauthProviderGoogle OauthProvider = "google"
)

func (*OauthProvider) Scan

func (e *OauthProvider) Scan(src interface{}) error

type Order

type Order struct {
	ID              int64
	BuyerID         pgtype.Int8
	Status          OrderStatus
	Description     pgtype.Text
	ShippingAddress string
}

type OrderItem

type OrderItem struct {
	ID       int64
	Name     string
	PhotoUrl string
	Category string
}

type OrderStatus

type OrderStatus string
const (
	OrderStatusSubmitted OrderStatus = "Submitted"
	OrderStatusPaid      OrderStatus = "Paid"
	OrderStatusShipped   OrderStatus = "Shipped"
	OrderStatusCancelled OrderStatus = "Cancelled"
)

func (*OrderStatus) Scan

func (e *OrderStatus) Scan(src interface{}) error

type Pet

type Pet struct {
	ID       int64
	Name     string
	PhotoUrl string
	Sold     bool
}

type PetTag

type PetTag struct {
	PetID pgtype.Int8
	TagID pgtype.Int8
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CountPets

func (q *Queries) CountPets(ctx context.Context) (int64, error)

func (*Queries) CreatePet

func (q *Queries) CreatePet(ctx context.Context, arg CreatePetParams) (int64, error)

func (*Queries) DeletePet

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

func (*Queries) GetPet

func (q *Queries) GetPet(ctx context.Context, id int64) (Pet, error)

func (*Queries) ListPets

func (q *Queries) ListPets(ctx context.Context, arg ListPetsParams) ([]Pet, error)

func (*Queries) UpdatePet

func (q *Queries) UpdatePet(ctx context.Context, arg UpdatePetParams) error

func (*Queries) WithTx

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

type Tag

type Tag struct {
	ID   int32
	Name string
}

type UpdatePetParams

type UpdatePetParams struct {
	ID   int64
	Name string
}

type User

type User struct {
	ID       int64
	Email    string
	Username string
	Provider OauthProvider
}

Jump to

Keyboard shortcuts

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