Documentation ¶
Index ¶
- Constants
- Variables
- func And(predicates ...predicate.Product) predicate.Product
- func CreateTime(v time.Time) predicate.Product
- func CreateTimeEQ(v time.Time) predicate.Product
- func CreateTimeGT(v time.Time) predicate.Product
- func CreateTimeGTE(v time.Time) predicate.Product
- func CreateTimeIn(vs ...time.Time) predicate.Product
- func CreateTimeLT(v time.Time) predicate.Product
- func CreateTimeLTE(v time.Time) predicate.Product
- func CreateTimeNEQ(v time.Time) predicate.Product
- func CreateTimeNotIn(vs ...time.Time) predicate.Product
- func HasIngredients() predicate.Product
- func HasIngredientsWith(preds ...predicate.Ingredient) predicate.Product
- func HasRequiredInRecipes() predicate.Product
- func HasRequiredInRecipesWith(preds ...predicate.Recipe) predicate.Product
- func ID(id uuid.UUID) predicate.Product
- func IDEQ(id uuid.UUID) predicate.Product
- func IDGT(id uuid.UUID) predicate.Product
- func IDGTE(id uuid.UUID) predicate.Product
- func IDIn(ids ...uuid.UUID) predicate.Product
- func IDLT(id uuid.UUID) predicate.Product
- func IDLTE(id uuid.UUID) predicate.Product
- func IDNEQ(id uuid.UUID) predicate.Product
- func IDNotIn(ids ...uuid.UUID) predicate.Product
- func LocaleEQ(v Locale) predicate.Product
- func LocaleIn(vs ...Locale) predicate.Product
- func LocaleNEQ(v Locale) predicate.Product
- func LocaleNotIn(vs ...Locale) predicate.Product
- func LocaleValidator(l Locale) error
- 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 Slug(v string) predicate.Product
- func SlugContains(v string) predicate.Product
- func SlugContainsFold(v string) predicate.Product
- func SlugEQ(v string) predicate.Product
- func SlugEqualFold(v string) predicate.Product
- func SlugGT(v string) predicate.Product
- func SlugGTE(v string) predicate.Product
- func SlugHasPrefix(v string) predicate.Product
- func SlugHasSuffix(v string) predicate.Product
- func SlugIn(vs ...string) predicate.Product
- func SlugLT(v string) predicate.Product
- func SlugLTE(v string) predicate.Product
- func SlugNEQ(v string) predicate.Product
- func SlugNotIn(vs ...string) predicate.Product
- func UpdateTime(v time.Time) predicate.Product
- func UpdateTimeEQ(v time.Time) predicate.Product
- func UpdateTimeGT(v time.Time) predicate.Product
- func UpdateTimeGTE(v time.Time) predicate.Product
- func UpdateTimeIn(vs ...time.Time) predicate.Product
- func UpdateTimeLT(v time.Time) predicate.Product
- func UpdateTimeLTE(v time.Time) predicate.Product
- func UpdateTimeNEQ(v time.Time) predicate.Product
- func UpdateTimeNotIn(vs ...time.Time) predicate.Product
- func ValidColumn(column string) bool
- type Locale
- type OrderOption
- func ByCreateTime(opts ...sql.OrderTermOption) OrderOption
- func ByID(opts ...sql.OrderTermOption) OrderOption
- func ByIngredients(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
- func ByIngredientsCount(opts ...sql.OrderTermOption) OrderOption
- func ByLocale(opts ...sql.OrderTermOption) OrderOption
- func ByName(opts ...sql.OrderTermOption) OrderOption
- func ByRequiredInRecipes(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
- func ByRequiredInRecipesCount(opts ...sql.OrderTermOption) OrderOption
- func BySlug(opts ...sql.OrderTermOption) OrderOption
- func ByUpdateTime(opts ...sql.OrderTermOption) 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" // FieldCreateTime holds the string denoting the create_time field in the database. FieldCreateTime = "create_time" // FieldUpdateTime holds the string denoting the update_time field in the database. FieldUpdateTime = "update_time" // FieldLocale holds the string denoting the locale field in the database. FieldLocale = "locale" // FieldName holds the string denoting the name field in the database. FieldName = "name" // FieldSlug holds the string denoting the slug field in the database. FieldSlug = "slug" // EdgeRequiredInRecipes holds the string denoting the required_in_recipes edge name in mutations. EdgeRequiredInRecipes = "required_in_recipes" // EdgeIngredients holds the string denoting the ingredients edge name in mutations. EdgeIngredients = "ingredients" // Table holds the table name of the product in the database. Table = "products" // RequiredInRecipesTable is the table that holds the required_in_recipes relation/edge. The primary key declared below. RequiredInRecipesTable = "ingredients" // RequiredInRecipesInverseTable is the table name for the Recipe entity. // It exists in this package in order to avoid circular dependency with the "recipe" package. RequiredInRecipesInverseTable = "recipes" // IngredientsTable is the table that holds the ingredients relation/edge. IngredientsTable = "ingredients" // IngredientsInverseTable is the table name for the Ingredient entity. // It exists in this package in order to avoid circular dependency with the "ingredient" package. IngredientsInverseTable = "ingredients" // IngredientsColumn is the table column denoting the ingredients relation/edge. IngredientsColumn = "product_id" )
const DefaultLocale = LocaleRu
LocaleRu is the default value of the Locale enum.
Variables ¶
var ( // DefaultCreateTime holds the default value on creation for the "create_time" field. DefaultCreateTime func() time.Time // DefaultUpdateTime holds the default value on creation for the "update_time" field. DefaultUpdateTime func() time.Time // UpdateDefaultUpdateTime holds the default value on update for the "update_time" field. UpdateDefaultUpdateTime func() time.Time // NameValidator is a validator for the "name" field. It is called by the builders before save. NameValidator func(string) error // SlugValidator is a validator for the "slug" field. It is called by the builders before save. SlugValidator func(string) error // DefaultID holds the default value on creation for the "id" field. DefaultID func() uuid.UUID )
var Columns = []string{ FieldID, FieldCreateTime, FieldUpdateTime, FieldLocale, FieldName, FieldSlug, }
Columns holds all SQL columns for product fields.
var ( // RequiredInRecipesPrimaryKey and RequiredInRecipesColumn2 are the table columns denoting the // primary key for the required_in_recipes relation (M2M). RequiredInRecipesPrimaryKey = []string{"recipe_id", "product_id"} )
Functions ¶
func CreateTime ¶
CreateTime applies equality check predicate on the "create_time" field. It's identical to CreateTimeEQ.
func CreateTimeEQ ¶
CreateTimeEQ applies the EQ predicate on the "create_time" field.
func CreateTimeGT ¶
CreateTimeGT applies the GT predicate on the "create_time" field.
func CreateTimeGTE ¶
CreateTimeGTE applies the GTE predicate on the "create_time" field.
func CreateTimeIn ¶
CreateTimeIn applies the In predicate on the "create_time" field.
func CreateTimeLT ¶
CreateTimeLT applies the LT predicate on the "create_time" field.
func CreateTimeLTE ¶
CreateTimeLTE applies the LTE predicate on the "create_time" field.
func CreateTimeNEQ ¶
CreateTimeNEQ applies the NEQ predicate on the "create_time" field.
func CreateTimeNotIn ¶
CreateTimeNotIn applies the NotIn predicate on the "create_time" field.
func HasIngredients ¶
HasIngredients applies the HasEdge predicate on the "ingredients" edge.
func HasIngredientsWith ¶
func HasIngredientsWith(preds ...predicate.Ingredient) predicate.Product
HasIngredientsWith applies the HasEdge predicate on the "ingredients" edge with a given conditions (other predicates).
func HasRequiredInRecipes ¶
HasRequiredInRecipes applies the HasEdge predicate on the "required_in_recipes" edge.
func HasRequiredInRecipesWith ¶
HasRequiredInRecipesWith applies the HasEdge predicate on the "required_in_recipes" edge with a given conditions (other predicates).
func LocaleNotIn ¶
LocaleNotIn applies the NotIn predicate on the "locale" field.
func LocaleValidator ¶
LocaleValidator is a validator for the "locale" field enum values. It is called by the builders before save.
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 SlugContains ¶
SlugContains applies the Contains predicate on the "slug" field.
func SlugContainsFold ¶
SlugContainsFold applies the ContainsFold predicate on the "slug" field.
func SlugEqualFold ¶
SlugEqualFold applies the EqualFold predicate on the "slug" field.
func SlugHasPrefix ¶
SlugHasPrefix applies the HasPrefix predicate on the "slug" field.
func SlugHasSuffix ¶
SlugHasSuffix applies the HasSuffix predicate on the "slug" field.
func UpdateTime ¶
UpdateTime applies equality check predicate on the "update_time" field. It's identical to UpdateTimeEQ.
func UpdateTimeEQ ¶
UpdateTimeEQ applies the EQ predicate on the "update_time" field.
func UpdateTimeGT ¶
UpdateTimeGT applies the GT predicate on the "update_time" field.
func UpdateTimeGTE ¶
UpdateTimeGTE applies the GTE predicate on the "update_time" field.
func UpdateTimeIn ¶
UpdateTimeIn applies the In predicate on the "update_time" field.
func UpdateTimeLT ¶
UpdateTimeLT applies the LT predicate on the "update_time" field.
func UpdateTimeLTE ¶
UpdateTimeLTE applies the LTE predicate on the "update_time" field.
func UpdateTimeNEQ ¶
UpdateTimeNEQ applies the NEQ predicate on the "update_time" field.
func UpdateTimeNotIn ¶
UpdateTimeNotIn applies the NotIn predicate on the "update_time" 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 ByCreateTime ¶
func ByCreateTime(opts ...sql.OrderTermOption) OrderOption
ByCreateTime orders the results by the create_time field.
func ByID ¶
func ByID(opts ...sql.OrderTermOption) OrderOption
ByID orders the results by the id field.
func ByIngredients ¶
func ByIngredients(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
ByIngredients orders the results by ingredients terms.
func ByIngredientsCount ¶
func ByIngredientsCount(opts ...sql.OrderTermOption) OrderOption
ByIngredientsCount orders the results by ingredients count.
func ByLocale ¶
func ByLocale(opts ...sql.OrderTermOption) OrderOption
ByLocale orders the results by the locale field.
func ByName ¶
func ByName(opts ...sql.OrderTermOption) OrderOption
ByName orders the results by the name field.
func ByRequiredInRecipes ¶
func ByRequiredInRecipes(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
ByRequiredInRecipes orders the results by required_in_recipes terms.
func ByRequiredInRecipesCount ¶
func ByRequiredInRecipesCount(opts ...sql.OrderTermOption) OrderOption
ByRequiredInRecipesCount orders the results by required_in_recipes count.
func BySlug ¶
func BySlug(opts ...sql.OrderTermOption) OrderOption
BySlug orders the results by the slug field.
func ByUpdateTime ¶
func ByUpdateTime(opts ...sql.OrderTermOption) OrderOption
ByUpdateTime orders the results by the update_time field.