db

package
v0.0.0-...-7544875 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: Apache-2.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 CreateOrdersDetailParams

type CreateOrdersDetailParams struct {
	OrderID  int32          `json:"order_id"`
	Name     string         `json:"name"`
	Quantity int32          `json:"quantity"`
	Price    pgtype.Numeric `json:"price"`
}

type CreateOrdersParams

type CreateOrdersParams struct {
	TrxID           string      `json:"trx_id"`
	PaymentTrxID    string      `json:"payment_trx_id"`
	LockItems       pgtype.JSON `json:"lock_items"`
	Status          string      `json:"status"`
	CustomerName    string      `json:"customer_name"`
	CustomerAddress string      `json:"customer_address"`
}

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 Order

type Order struct {
	ID              int32       `json:"id"`
	TrxID           string      `json:"trx_id"`
	PaymentTrxID    string      `json:"payment_trx_id"`
	LockItems       pgtype.JSON `json:"lock_items"`
	Status          string      `json:"status"`
	CustomerName    string      `json:"customer_name"`
	CustomerAddress string      `json:"customer_address"`
}

type OrderDetail

type OrderDetail struct {
	ID       int32          `json:"id"`
	OrderID  int32          `json:"order_id"`
	Name     string         `json:"name"`
	Quantity int32          `json:"quantity"`
	Price    pgtype.Numeric `json:"price"`
}

type OrderPlacedParams

type OrderPlacedParams struct {
	Status       string `json:"status"`
	PaymentTrxID string `json:"payment_trx_id"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateOrders

func (q *Queries) CreateOrders(ctx context.Context, arg CreateOrdersParams) (int32, error)

func (*Queries) CreateOrdersDetail

func (q *Queries) CreateOrdersDetail(ctx context.Context, arg CreateOrdersDetailParams) (int32, error)

func (*Queries) OrderPlaced

func (q *Queries) OrderPlaced(ctx context.Context, arg OrderPlacedParams) (int32, error)

func (*Queries) SelectPayloads

func (q *Queries) SelectPayloads(ctx context.Context, paymentTrxID string) (SelectPayloadsRow, error)

func (*Queries) WithTx

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

type SelectPayloadsRow

type SelectPayloadsRow struct {
	ID        int32       `json:"id"`
	LockItems pgtype.JSON `json:"lock_items"`
}

Jump to

Keyboard shortcuts

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