product

package
v0.0.0-...-5e3f0a1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: CC-BY-SA-4.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateParams

type CreateParams struct {
	Name  string
	Price pgtype.Numeric
}

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 Product

type Product struct {
	ID    int64
	Name  string
	Price pgtype.Numeric
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) Create

func (q *Queries) Create(ctx context.Context, arg CreateParams) (Product, error)

func (*Queries) Delete

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

func (*Queries) GetAll

func (q *Queries) GetAll(ctx context.Context) ([]Product, error)

func (*Queries) GetByID

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

func (*Queries) Update

func (q *Queries) Update(ctx context.Context, arg UpdateParams) error

func (*Queries) WithTx

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

type UpdateParams

type UpdateParams struct {
	ID    int64
	Name  string
	Price pgtype.Numeric
}

Jump to

Keyboard shortcuts

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