product

package
v0.0.0-...-f15602e Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: MIT Imports: 4 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"
	// FieldCreatedAt holds the string denoting the created_at field in the database.
	FieldCreatedAt = "created_at"
	// FieldUpdatedAt holds the string denoting the updated_at field in the database.
	FieldUpdatedAt = "updated_at"
	// FieldCategoryID holds the string denoting the category_id field in the database.
	FieldCategoryID = "category_id"
	// FieldName holds the string denoting the name field in the database.
	FieldName = "name"
	// FieldDescription holds the string denoting the description field in the database.
	FieldDescription = "description"
	// FieldAmount holds the string denoting the amount field in the database.
	FieldAmount = "amount"
	// FieldPrice holds the string denoting the price field in the database.
	FieldPrice = "price"
	// EdgeCategories holds the string denoting the categories edge name in mutations.
	EdgeCategories = "categories"
	// EdgeCarts holds the string denoting the carts edge name in mutations.
	EdgeCarts = "carts"
	// EdgeProductImages holds the string denoting the product_images edge name in mutations.
	EdgeProductImages = "product_images"
	// EdgeOrderProducts holds the string denoting the order_products edge name in mutations.
	EdgeOrderProducts = "order_products"
	// Table holds the table name of the product in the database.
	Table = "products"
	// CategoriesTable is the table that holds the categories relation/edge.
	CategoriesTable = "products"
	// CategoriesInverseTable is the table name for the Category entity.
	// It exists in this package in order to avoid circular dependency with the "category" package.
	CategoriesInverseTable = "categories"
	// CategoriesColumn is the table column denoting the categories relation/edge.
	CategoriesColumn = "category_id"
	// CartsTable is the table that holds the carts relation/edge.
	CartsTable = "carts"
	// CartsInverseTable is the table name for the Cart entity.
	// It exists in this package in order to avoid circular dependency with the "cart" package.
	CartsInverseTable = "carts"
	// CartsColumn is the table column denoting the carts relation/edge.
	CartsColumn = "product_id"
	// ProductImagesTable is the table that holds the product_images relation/edge.
	ProductImagesTable = "product_images"
	// ProductImagesInverseTable is the table name for the ProductImage entity.
	// It exists in this package in order to avoid circular dependency with the "productimage" package.
	ProductImagesInverseTable = "product_images"
	// ProductImagesColumn is the table column denoting the product_images relation/edge.
	ProductImagesColumn = "product_id"
	// OrderProductsTable is the table that holds the order_products relation/edge.
	OrderProductsTable = "order_products"
	// OrderProductsInverseTable is the table name for the OrderProduct entity.
	// It exists in this package in order to avoid circular dependency with the "orderproduct" package.
	OrderProductsInverseTable = "order_products"
	// OrderProductsColumn is the table column denoting the order_products relation/edge.
	OrderProductsColumn = "product_id"
)

Variables

View Source
var (
	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
	DefaultCreatedAt func() time.Time
	// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
	DefaultUpdatedAt func() time.Time
	// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
	UpdateDefaultUpdatedAt func() time.Time
	// NameValidator is a validator for the "name" field. It is called by the builders before save.
	NameValidator func(string) error
	// DefaultAmount holds the default value on creation for the "amount" field.
	DefaultAmount int64
	// AmountValidator is a validator for the "amount" field. It is called by the builders before save.
	AmountValidator func(int64) error
	// PriceValidator is a validator for the "price" field. It is called by the builders before save.
	PriceValidator func(int64) error
)

Columns holds all SQL columns for product fields.

Functions

func Amount

func Amount(v int64) predicate.Product

Amount applies equality check predicate on the "amount" field. It's identical to AmountEQ.

func AmountEQ

func AmountEQ(v int64) predicate.Product

AmountEQ applies the EQ predicate on the "amount" field.

func AmountGT

func AmountGT(v int64) predicate.Product

AmountGT applies the GT predicate on the "amount" field.

func AmountGTE

func AmountGTE(v int64) predicate.Product

AmountGTE applies the GTE predicate on the "amount" field.

func AmountIn

func AmountIn(vs ...int64) predicate.Product

AmountIn applies the In predicate on the "amount" field.

func AmountLT

func AmountLT(v int64) predicate.Product

AmountLT applies the LT predicate on the "amount" field.

func AmountLTE

func AmountLTE(v int64) predicate.Product

AmountLTE applies the LTE predicate on the "amount" field.

func AmountNEQ

func AmountNEQ(v int64) predicate.Product

AmountNEQ applies the NEQ predicate on the "amount" field.

func AmountNotIn

func AmountNotIn(vs ...int64) predicate.Product

AmountNotIn applies the NotIn predicate on the "amount" field.

func And

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

And groups predicates with the AND operator between them.

func CategoryID

func CategoryID(v int64) predicate.Product

CategoryID applies equality check predicate on the "category_id" field. It's identical to CategoryIDEQ.

func CategoryIDEQ

func CategoryIDEQ(v int64) predicate.Product

CategoryIDEQ applies the EQ predicate on the "category_id" field.

func CategoryIDIn

func CategoryIDIn(vs ...int64) predicate.Product

CategoryIDIn applies the In predicate on the "category_id" field.

func CategoryIDNEQ

func CategoryIDNEQ(v int64) predicate.Product

CategoryIDNEQ applies the NEQ predicate on the "category_id" field.

func CategoryIDNotIn

func CategoryIDNotIn(vs ...int64) predicate.Product

CategoryIDNotIn applies the NotIn predicate on the "category_id" field.

func CreatedAt

func CreatedAt(v time.Time) predicate.Product

CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.

func CreatedAtEQ

func CreatedAtEQ(v time.Time) predicate.Product

CreatedAtEQ applies the EQ predicate on the "created_at" field.

func CreatedAtGT

func CreatedAtGT(v time.Time) predicate.Product

CreatedAtGT applies the GT predicate on the "created_at" field.

func CreatedAtGTE

func CreatedAtGTE(v time.Time) predicate.Product

CreatedAtGTE applies the GTE predicate on the "created_at" field.

func CreatedAtIn

func CreatedAtIn(vs ...time.Time) predicate.Product

CreatedAtIn applies the In predicate on the "created_at" field.

func CreatedAtLT

func CreatedAtLT(v time.Time) predicate.Product

CreatedAtLT applies the LT predicate on the "created_at" field.

func CreatedAtLTE

func CreatedAtLTE(v time.Time) predicate.Product

CreatedAtLTE applies the LTE predicate on the "created_at" field.

func CreatedAtNEQ

func CreatedAtNEQ(v time.Time) predicate.Product

CreatedAtNEQ applies the NEQ predicate on the "created_at" field.

func CreatedAtNotIn

func CreatedAtNotIn(vs ...time.Time) predicate.Product

CreatedAtNotIn applies the NotIn predicate on the "created_at" field.

func Description

func Description(v string) predicate.Product

Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ.

func DescriptionContains

func DescriptionContains(v string) predicate.Product

DescriptionContains applies the Contains predicate on the "description" field.

func DescriptionContainsFold

func DescriptionContainsFold(v string) predicate.Product

DescriptionContainsFold applies the ContainsFold predicate on the "description" field.

func DescriptionEQ

func DescriptionEQ(v string) predicate.Product

DescriptionEQ applies the EQ predicate on the "description" field.

func DescriptionEqualFold

func DescriptionEqualFold(v string) predicate.Product

DescriptionEqualFold applies the EqualFold predicate on the "description" field.

func DescriptionGT

func DescriptionGT(v string) predicate.Product

DescriptionGT applies the GT predicate on the "description" field.

func DescriptionGTE

func DescriptionGTE(v string) predicate.Product

DescriptionGTE applies the GTE predicate on the "description" field.

func DescriptionHasPrefix

func DescriptionHasPrefix(v string) predicate.Product

DescriptionHasPrefix applies the HasPrefix predicate on the "description" field.

func DescriptionHasSuffix

func DescriptionHasSuffix(v string) predicate.Product

DescriptionHasSuffix applies the HasSuffix predicate on the "description" field.

func DescriptionIn

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

DescriptionIn applies the In predicate on the "description" field.

func DescriptionIsNil

func DescriptionIsNil() predicate.Product

DescriptionIsNil applies the IsNil predicate on the "description" field.

func DescriptionLT

func DescriptionLT(v string) predicate.Product

DescriptionLT applies the LT predicate on the "description" field.

func DescriptionLTE

func DescriptionLTE(v string) predicate.Product

DescriptionLTE applies the LTE predicate on the "description" field.

func DescriptionNEQ

func DescriptionNEQ(v string) predicate.Product

DescriptionNEQ applies the NEQ predicate on the "description" field.

func DescriptionNotIn

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

DescriptionNotIn applies the NotIn predicate on the "description" field.

func DescriptionNotNil

func DescriptionNotNil() predicate.Product

DescriptionNotNil applies the NotNil predicate on the "description" field.

func HasCarts

func HasCarts() predicate.Product

HasCarts applies the HasEdge predicate on the "carts" edge.

func HasCartsWith

func HasCartsWith(preds ...predicate.Cart) predicate.Product

HasCartsWith applies the HasEdge predicate on the "carts" edge with a given conditions (other predicates).

func HasCategories

func HasCategories() predicate.Product

HasCategories applies the HasEdge predicate on the "categories" edge.

func HasCategoriesWith

func HasCategoriesWith(preds ...predicate.Category) predicate.Product

HasCategoriesWith applies the HasEdge predicate on the "categories" edge with a given conditions (other predicates).

func HasOrderProducts

func HasOrderProducts() predicate.Product

HasOrderProducts applies the HasEdge predicate on the "order_products" edge.

func HasOrderProductsWith

func HasOrderProductsWith(preds ...predicate.OrderProduct) predicate.Product

HasOrderProductsWith applies the HasEdge predicate on the "order_products" edge with a given conditions (other predicates).

func HasProductImages

func HasProductImages() predicate.Product

HasProductImages applies the HasEdge predicate on the "product_images" edge.

func HasProductImagesWith

func HasProductImagesWith(preds ...predicate.ProductImage) predicate.Product

HasProductImagesWith applies the HasEdge predicate on the "product_images" edge with a given conditions (other predicates).

func ID

func ID(id int64) predicate.Product

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id int64) predicate.Product

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id int64) predicate.Product

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id int64) predicate.Product

IDGTE applies the GTE predicate on the ID field.

func IDIn

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

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id int64) predicate.Product

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id int64) predicate.Product

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id int64) predicate.Product

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

func IDNotIn(ids ...int64) 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

func Price(v int64) predicate.Product

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

func PriceEQ

func PriceEQ(v int64) predicate.Product

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

func PriceGT

func PriceGT(v int64) predicate.Product

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

func PriceGTE

func PriceGTE(v int64) predicate.Product

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

func PriceIn

func PriceIn(vs ...int64) predicate.Product

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

func PriceLT

func PriceLT(v int64) predicate.Product

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

func PriceLTE

func PriceLTE(v int64) predicate.Product

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

func PriceNEQ

func PriceNEQ(v int64) predicate.Product

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

func PriceNotIn

func PriceNotIn(vs ...int64) predicate.Product

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

func UpdatedAt

func UpdatedAt(v time.Time) predicate.Product

UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.

func UpdatedAtEQ

func UpdatedAtEQ(v time.Time) predicate.Product

UpdatedAtEQ applies the EQ predicate on the "updated_at" field.

func UpdatedAtGT

func UpdatedAtGT(v time.Time) predicate.Product

UpdatedAtGT applies the GT predicate on the "updated_at" field.

func UpdatedAtGTE

func UpdatedAtGTE(v time.Time) predicate.Product

UpdatedAtGTE applies the GTE predicate on the "updated_at" field.

func UpdatedAtIn

func UpdatedAtIn(vs ...time.Time) predicate.Product

UpdatedAtIn applies the In predicate on the "updated_at" field.

func UpdatedAtLT

func UpdatedAtLT(v time.Time) predicate.Product

UpdatedAtLT applies the LT predicate on the "updated_at" field.

func UpdatedAtLTE

func UpdatedAtLTE(v time.Time) predicate.Product

UpdatedAtLTE applies the LTE predicate on the "updated_at" field.

func UpdatedAtNEQ

func UpdatedAtNEQ(v time.Time) predicate.Product

UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.

func UpdatedAtNotIn

func UpdatedAtNotIn(vs ...time.Time) predicate.Product

UpdatedAtNotIn applies the NotIn predicate on the "updated_at" 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 ByAmount

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

ByAmount orders the results by the amount field.

func ByCarts

func ByCarts(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByCarts orders the results by carts terms.

func ByCartsCount

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

ByCartsCount orders the results by carts count.

func ByCategoriesField

func ByCategoriesField(field string, opts ...sql.OrderTermOption) OrderOption

ByCategoriesField orders the results by categories field.

func ByCategoryID

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

ByCategoryID orders the results by the category_id field.

func ByCreatedAt

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

ByCreatedAt orders the results by the created_at field.

func ByDescription

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

ByDescription orders the results by the description field.

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 ByOrderProducts

func ByOrderProducts(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByOrderProducts orders the results by order_products terms.

func ByOrderProductsCount

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

ByOrderProductsCount orders the results by order_products count.

func ByPrice

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

ByPrice orders the results by the price field.

func ByProductImages

func ByProductImages(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByProductImages orders the results by product_images terms.

func ByProductImagesCount

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

ByProductImagesCount orders the results by product_images count.

func ByUpdatedAt

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

ByUpdatedAt orders the results by the updated_at field.

Jump to

Keyboard shortcuts

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