product

package
v0.0.0-...-24e078b Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the product type in the database.
	Label = "product"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldName holds the string denoting the name field in the database.
	FieldName = "name"
	// FieldPrice holds the string denoting the price field in the database.
	FieldPrice = "price"
	// FieldStock holds the string denoting the stock field in the database.
	FieldStock = "stock"
	// Table holds the table name of the product in the database.
	Table = "products"
)

Variables

View Source
var (
	// DefaultStock holds the default value on creation for the "stock" field.
	DefaultStock int
	// StockValidator is a validator for the "stock" field. It is called by the builders before save.
	StockValidator func(int) error
)

Columns holds all SQL columns for product fields.

Functions

func And

func And(predicates ...predicate.Product) predicate.Product

And groups predicates with the AND operator between them.

func ID

func ID(id int) predicate.Product

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id int) predicate.Product

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id int) predicate.Product

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id int) predicate.Product

IDGTE applies the GTE predicate on the ID field.

func IDIn

func IDIn(ids ...int) predicate.Product

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id int) predicate.Product

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id int) predicate.Product

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id int) predicate.Product

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

func IDNotIn(ids ...int) predicate.Product

IDNotIn applies the NotIn predicate on the ID field.

func Name

func Name(v string) predicate.Product

Name applies equality check predicate on the "name" field. It's identical to NameEQ.

func NameContains

func NameContains(v string) predicate.Product

NameContains applies the Contains predicate on the "name" field.

func NameContainsFold

func NameContainsFold(v string) predicate.Product

NameContainsFold applies the ContainsFold predicate on the "name" field.

func NameEQ

func NameEQ(v string) predicate.Product

NameEQ applies the EQ predicate on the "name" field.

func NameEqualFold

func NameEqualFold(v string) predicate.Product

NameEqualFold applies the EqualFold predicate on the "name" field.

func NameGT

func NameGT(v string) predicate.Product

NameGT applies the GT predicate on the "name" field.

func NameGTE

func NameGTE(v string) predicate.Product

NameGTE applies the GTE predicate on the "name" field.

func NameHasPrefix

func NameHasPrefix(v string) predicate.Product

NameHasPrefix applies the HasPrefix predicate on the "name" field.

func NameHasSuffix

func NameHasSuffix(v string) predicate.Product

NameHasSuffix applies the HasSuffix predicate on the "name" field.

func NameIn

func NameIn(vs ...string) predicate.Product

NameIn applies the In predicate on the "name" field.

func NameLT

func NameLT(v string) predicate.Product

NameLT applies the LT predicate on the "name" field.

func NameLTE

func NameLTE(v string) predicate.Product

NameLTE applies the LTE predicate on the "name" field.

func NameNEQ

func NameNEQ(v string) predicate.Product

NameNEQ applies the NEQ predicate on the "name" field.

func NameNotIn

func NameNotIn(vs ...string) predicate.Product

NameNotIn applies the NotIn predicate on the "name" field.

func Not

Not applies the not operator on the given predicate.

func Or

func Or(predicates ...predicate.Product) predicate.Product

Or groups predicates with the OR operator between them.

func Price

Price applies equality check predicate on the "price" field. It's identical to PriceEQ.

func PriceEQ

func PriceEQ(v decimal.Decimal) predicate.Product

PriceEQ applies the EQ predicate on the "price" field.

func PriceGT

func PriceGT(v decimal.Decimal) predicate.Product

PriceGT applies the GT predicate on the "price" field.

func PriceGTE

func PriceGTE(v decimal.Decimal) predicate.Product

PriceGTE applies the GTE predicate on the "price" field.

func PriceIn

func PriceIn(vs ...decimal.Decimal) predicate.Product

PriceIn applies the In predicate on the "price" field.

func PriceLT

func PriceLT(v decimal.Decimal) predicate.Product

PriceLT applies the LT predicate on the "price" field.

func PriceLTE

func PriceLTE(v decimal.Decimal) predicate.Product

PriceLTE applies the LTE predicate on the "price" field.

func PriceNEQ

func PriceNEQ(v decimal.Decimal) predicate.Product

PriceNEQ applies the NEQ predicate on the "price" field.

func PriceNotIn

func PriceNotIn(vs ...decimal.Decimal) predicate.Product

PriceNotIn applies the NotIn predicate on the "price" field.

func Stock

func Stock(v int) predicate.Product

Stock applies equality check predicate on the "stock" field. It's identical to StockEQ.

func StockEQ

func StockEQ(v int) predicate.Product

StockEQ applies the EQ predicate on the "stock" field.

func StockGT

func StockGT(v int) predicate.Product

StockGT applies the GT predicate on the "stock" field.

func StockGTE

func StockGTE(v int) predicate.Product

StockGTE applies the GTE predicate on the "stock" field.

func StockIn

func StockIn(vs ...int) predicate.Product

StockIn applies the In predicate on the "stock" field.

func StockLT

func StockLT(v int) predicate.Product

StockLT applies the LT predicate on the "stock" field.

func StockLTE

func StockLTE(v int) predicate.Product

StockLTE applies the LTE predicate on the "stock" field.

func StockNEQ

func StockNEQ(v int) predicate.Product

StockNEQ applies the NEQ predicate on the "stock" field.

func StockNotIn

func StockNotIn(vs ...int) predicate.Product

StockNotIn applies the NotIn predicate on the "stock" field.

func ValidColumn

func ValidColumn(column string) bool

ValidColumn reports if the column name is valid (part of the table columns).

Types

type OrderOption

type OrderOption func(*sql.Selector)

OrderOption defines the ordering options for the Product queries.

func ByID

func ByID(opts ...sql.OrderTermOption) OrderOption

ByID orders the results by the id field.

func ByName

func ByName(opts ...sql.OrderTermOption) OrderOption

ByName orders the results by the name field.

func ByPrice

func ByPrice(opts ...sql.OrderTermOption) OrderOption

ByPrice orders the results by the price field.

func ByStock

func ByStock(opts ...sql.OrderTermOption) OrderOption

ByStock orders the results by the stock field.

Jump to

Keyboard shortcuts

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