sqlc

package
v0.0.0-...-a263ec7 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 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 Category

type Category struct {
	ID        string
	Name      string
	Active    sql.NullBool
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt sql.NullTime
}

func (*Category) BatchToDomain

func (c *Category) BatchToDomain(categories []Category) (output []entity.Category)

func (*Category) ToDomain

func (c *Category) ToDomain() (output entity.Category)

type CreateCategoryParams

type CreateCategoryParams struct {
	ID     string
	Name   string
	Active sql.NullBool
}

type CreateOrderItemsParams

type CreateOrderItemsParams struct {
	ID           string
	ProductID    string
	Quantity     int32
	ProductPrice int32
	OrderID      string
}

type CreateOrderParams

type CreateOrderParams struct {
	ID         string
	TotalPrice int32
	DeliveryID string
	Status     string
}

type CreateProductParams

type CreateProductParams struct {
	ID          string
	Code        sql.NullString
	Name        string
	ImageUrl    sql.NullString
	Price       int32
	Description sql.NullString
	Active      sql.NullBool
	CategoryID  sql.NullString
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type Delivery

type Delivery struct {
	ID            string
	CEP           string
	Address       sql.NullString
	Number        sql.NullString
	Country       sql.NullString
	District      sql.NullString
	City          sql.NullString
	DeliveryPrice int32
	CreatedAt     time.Time
	UpdatedAt     time.Time
	DeletedAt     sql.NullTime
}

type GetProductByIDRow

type GetProductByIDRow struct {
	ID           string
	Code         sql.NullString
	Name         string
	ImageUrl     sql.NullString
	Price        int32
	Description  sql.NullString
	Active       sql.NullBool
	CategoryID   sql.NullString
	CreatedAt    time.Time
	UpdatedAt    time.Time
	DeletedAt    sql.NullTime
	CategoryName string
}

type GetProductsRow

type GetProductsRow struct {
	ID           string
	Code         sql.NullString
	Name         string
	ImageUrl     sql.NullString
	Price        int32
	Description  sql.NullString
	Active       sql.NullBool
	CategoryID   sql.NullString
	CreatedAt    time.Time
	UpdatedAt    time.Time
	DeletedAt    sql.NullTime
	CategoryName string
}

type Order

type Order struct {
	ID         string
	TotalPrice int32
	DeliveryID string
	Status     string
	CreatedAt  time.Time
	UpdatedAt  time.Time
	DeletedAt  sql.NullTime
}

type OrderItem

type OrderItem struct {
	ID           string
	ProductID    string
	Quantity     int32
	ProductPrice int32
	OrderID      string
	CreatedAt    time.Time
	UpdatedAt    time.Time
	DeletedAt    sql.NullTime
}

type Product

type Product struct {
	ID          string
	Code        sql.NullString
	Name        string
	ImageUrl    sql.NullString
	Price       int32
	Description sql.NullString
	Active      sql.NullBool
	CategoryID  sql.NullString
	CreatedAt   time.Time
	UpdatedAt   time.Time
	DeletedAt   sql.NullTime
}

func (*Product) BatchToDomain

func (c *Product) BatchToDomain(products []Product) (output []entity.Product)

func (*Product) ToDomain

func (p *Product) ToDomain() (output entity.Product)

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateCategory

func (q *Queries) CreateCategory(ctx context.Context, arg CreateCategoryParams) error

func (*Queries) CreateOrder

func (q *Queries) CreateOrder(ctx context.Context, arg CreateOrderParams) error

func (*Queries) CreateOrderItems

func (q *Queries) CreateOrderItems(ctx context.Context, arg CreateOrderItemsParams) error

func (*Queries) CreateProduct

func (q *Queries) CreateProduct(ctx context.Context, arg CreateProductParams) error

func (*Queries) GetAllCategories

func (q *Queries) GetAllCategories(ctx context.Context, limit int32) ([]Category, error)

func (*Queries) GetCategoryByID

func (q *Queries) GetCategoryByID(ctx context.Context, id string) (Category, error)

func (*Queries) GetProductByID

func (q *Queries) GetProductByID(ctx context.Context, id string) (GetProductByIDRow, error)

func (*Queries) GetProducts

func (q *Queries) GetProducts(ctx context.Context, limit int32) ([]GetProductsRow, error)

func (*Queries) RegistryDelivery

func (q *Queries) RegistryDelivery(ctx context.Context, arg RegistryDeliveryParams) error

func (*Queries) WithTx

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

type RegistryDeliveryParams

type RegistryDeliveryParams struct {
	ID            string
	CEP           string
	Address       sql.NullString
	Number        sql.NullString
	Country       sql.NullString
	District      sql.NullString
	City          sql.NullString
	DeliveryPrice int32
}

Jump to

Keyboard shortcuts

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