Documentation ¶
Index ¶
- Constants
- Variables
- func And(predicates ...predicate.Product) predicate.Product
- func ID(id int) predicate.Product
- func IDEQ(id int) predicate.Product
- func IDGT(id int) predicate.Product
- func IDGTE(id int) predicate.Product
- func IDIn(ids ...int) predicate.Product
- func IDLT(id int) predicate.Product
- func IDLTE(id int) predicate.Product
- func IDNEQ(id int) predicate.Product
- func IDNotIn(ids ...int) predicate.Product
- func Name(v string) predicate.Product
- func NameContains(v string) predicate.Product
- func NameContainsFold(v string) predicate.Product
- func NameEQ(v string) predicate.Product
- func NameEqualFold(v string) predicate.Product
- func NameGT(v string) predicate.Product
- func NameGTE(v string) predicate.Product
- func NameHasPrefix(v string) predicate.Product
- func NameHasSuffix(v string) predicate.Product
- func NameIn(vs ...string) predicate.Product
- func NameLT(v string) predicate.Product
- func NameLTE(v string) predicate.Product
- func NameNEQ(v string) predicate.Product
- func NameNotIn(vs ...string) predicate.Product
- func Not(p predicate.Product) predicate.Product
- func Or(predicates ...predicate.Product) predicate.Product
- func Price(v decimal.Decimal) predicate.Product
- func PriceEQ(v decimal.Decimal) predicate.Product
- func PriceGT(v decimal.Decimal) predicate.Product
- func PriceGTE(v decimal.Decimal) predicate.Product
- func PriceIn(vs ...decimal.Decimal) predicate.Product
- func PriceLT(v decimal.Decimal) predicate.Product
- func PriceLTE(v decimal.Decimal) predicate.Product
- func PriceNEQ(v decimal.Decimal) predicate.Product
- func PriceNotIn(vs ...decimal.Decimal) predicate.Product
- func Stock(v int) predicate.Product
- func StockEQ(v int) predicate.Product
- func StockGT(v int) predicate.Product
- func StockGTE(v int) predicate.Product
- func StockIn(vs ...int) predicate.Product
- func StockLT(v int) predicate.Product
- func StockLTE(v int) predicate.Product
- func StockNEQ(v int) predicate.Product
- func StockNotIn(vs ...int) predicate.Product
- func ValidColumn(column string) bool
- type OrderOption
Constants ¶
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 ¶
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 )
var Columns = []string{ FieldID, FieldName, FieldPrice, FieldStock, }
Columns holds all SQL columns for product fields.
Functions ¶
func NameContains ¶
NameContains applies the Contains predicate on the "name" field.
func NameContainsFold ¶
NameContainsFold applies the ContainsFold predicate on the "name" field.
func NameEqualFold ¶
NameEqualFold applies the EqualFold predicate on the "name" field.
func NameHasPrefix ¶
NameHasPrefix applies the HasPrefix predicate on the "name" field.
func NameHasSuffix ¶
NameHasSuffix applies the HasSuffix predicate on the "name" field.
func Price ¶
Price applies equality check predicate on the "price" field. It's identical to PriceEQ.
func PriceNotIn ¶
PriceNotIn applies the NotIn predicate on the "price" field.
func Stock ¶
Stock applies equality check predicate on the "stock" field. It's identical to StockEQ.
func StockNotIn ¶
StockNotIn applies the NotIn predicate on the "stock" field.
func ValidColumn ¶
ValidColumn reports if the column name is valid (part of the table columns).
Types ¶
type OrderOption ¶
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.