Documentation ¶
Index ¶
- Constants
- Variables
- func And(predicates ...predicate.OneToMany) predicate.OneToMany
- func Field2(v string) predicate.OneToMany
- func Field2Contains(v string) predicate.OneToMany
- func Field2ContainsFold(v string) predicate.OneToMany
- func Field2EQ(v string) predicate.OneToMany
- func Field2EqualFold(v string) predicate.OneToMany
- func Field2GT(v string) predicate.OneToMany
- func Field2GTE(v string) predicate.OneToMany
- func Field2HasPrefix(v string) predicate.OneToMany
- func Field2HasSuffix(v string) predicate.OneToMany
- func Field2In(vs ...string) predicate.OneToMany
- func Field2IsNil() predicate.OneToMany
- func Field2LT(v string) predicate.OneToMany
- func Field2LTE(v string) predicate.OneToMany
- func Field2NEQ(v string) predicate.OneToMany
- func Field2NotIn(vs ...string) predicate.OneToMany
- func Field2NotNil() predicate.OneToMany
- func HasChildren() predicate.OneToMany
- func HasChildrenWith(preds ...predicate.OneToMany) predicate.OneToMany
- func HasParent() predicate.OneToMany
- func HasParentWith(preds ...predicate.OneToMany) predicate.OneToMany
- func ID(id int) predicate.OneToMany
- func IDEQ(id int) predicate.OneToMany
- func IDGT(id int) predicate.OneToMany
- func IDGTE(id int) predicate.OneToMany
- func IDIn(ids ...int) predicate.OneToMany
- func IDLT(id int) predicate.OneToMany
- func IDLTE(id int) predicate.OneToMany
- func IDNEQ(id int) predicate.OneToMany
- func IDNotIn(ids ...int) predicate.OneToMany
- func Name(v string) predicate.OneToMany
- func NameContains(v string) predicate.OneToMany
- func NameContainsFold(v string) predicate.OneToMany
- func NameEQ(v string) predicate.OneToMany
- func NameEqualFold(v string) predicate.OneToMany
- func NameGT(v string) predicate.OneToMany
- func NameGTE(v string) predicate.OneToMany
- func NameHasPrefix(v string) predicate.OneToMany
- func NameHasSuffix(v string) predicate.OneToMany
- func NameIn(vs ...string) predicate.OneToMany
- func NameLT(v string) predicate.OneToMany
- func NameLTE(v string) predicate.OneToMany
- func NameNEQ(v string) predicate.OneToMany
- func NameNotIn(vs ...string) predicate.OneToMany
- func Not(p predicate.OneToMany) predicate.OneToMany
- func Or(predicates ...predicate.OneToMany) predicate.OneToMany
- func ParentID(v int) predicate.OneToMany
- func ParentIDEQ(v int) predicate.OneToMany
- func ParentIDIn(vs ...int) predicate.OneToMany
- func ParentIDIsNil() predicate.OneToMany
- func ParentIDNEQ(v int) predicate.OneToMany
- func ParentIDNotIn(vs ...int) predicate.OneToMany
- func ParentIDNotNil() predicate.OneToMany
- func ValidColumn(column string) bool
- type OrderOption
- func ByChildren(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
- func ByChildrenCount(opts ...sql.OrderTermOption) OrderOption
- func ByField2(opts ...sql.OrderTermOption) OrderOption
- func ByID(opts ...sql.OrderTermOption) OrderOption
- func ByName(opts ...sql.OrderTermOption) OrderOption
- func ByParentField(field string, opts ...sql.OrderTermOption) OrderOption
- func ByParentID(opts ...sql.OrderTermOption) OrderOption
Constants ¶
const ( // Label holds the string label denoting the onetomany type in the database. Label = "one_to_many" // 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" // FieldField2 holds the string denoting the field2 field in the database. FieldField2 = "field2" // FieldParentID holds the string denoting the parent_id field in the database. FieldParentID = "parent_id" // EdgeParent holds the string denoting the parent edge name in mutations. EdgeParent = "parent" // EdgeChildren holds the string denoting the children edge name in mutations. EdgeChildren = "children" // Table holds the table name of the onetomany in the database. Table = "one_to_manies" // ParentTable is the table that holds the parent relation/edge. ParentTable = "one_to_manies" // ParentColumn is the table column denoting the parent relation/edge. ParentColumn = "parent_id" // ChildrenTable is the table that holds the children relation/edge. ChildrenTable = "one_to_manies" // ChildrenColumn is the table column denoting the children relation/edge. ChildrenColumn = "parent_id" )
Variables ¶
var Columns = []string{ FieldID, FieldName, FieldField2, FieldParentID, }
Columns holds all SQL columns for onetomany fields.
var ( // NameValidator is a validator for the "name" field. It is called by the builders before save. NameValidator func(string) error )
Functions ¶
func Field2 ¶
Field2 applies equality check predicate on the "field2" field. It's identical to Field2EQ.
func Field2Contains ¶
Field2Contains applies the Contains predicate on the "field2" field.
func Field2ContainsFold ¶
Field2ContainsFold applies the ContainsFold predicate on the "field2" field.
func Field2EqualFold ¶
Field2EqualFold applies the EqualFold predicate on the "field2" field.
func Field2HasPrefix ¶
Field2HasPrefix applies the HasPrefix predicate on the "field2" field.
func Field2HasSuffix ¶
Field2HasSuffix applies the HasSuffix predicate on the "field2" field.
func Field2IsNil ¶
Field2IsNil applies the IsNil predicate on the "field2" field.
func Field2NotIn ¶
Field2NotIn applies the NotIn predicate on the "field2" field.
func Field2NotNil ¶
Field2NotNil applies the NotNil predicate on the "field2" field.
func HasChildren ¶
HasChildren applies the HasEdge predicate on the "children" edge.
func HasChildrenWith ¶
HasChildrenWith applies the HasEdge predicate on the "children" edge with a given conditions (other predicates).
func HasParentWith ¶
HasParentWith applies the HasEdge predicate on the "parent" edge with a given conditions (other predicates).
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 ParentID ¶
ParentID applies equality check predicate on the "parent_id" field. It's identical to ParentIDEQ.
func ParentIDEQ ¶
ParentIDEQ applies the EQ predicate on the "parent_id" field.
func ParentIDIn ¶
ParentIDIn applies the In predicate on the "parent_id" field.
func ParentIDIsNil ¶
ParentIDIsNil applies the IsNil predicate on the "parent_id" field.
func ParentIDNEQ ¶
ParentIDNEQ applies the NEQ predicate on the "parent_id" field.
func ParentIDNotIn ¶
ParentIDNotIn applies the NotIn predicate on the "parent_id" field.
func ParentIDNotNil ¶
ParentIDNotNil applies the NotNil predicate on the "parent_id" 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 OneToMany queries.
func ByChildren ¶
func ByChildren(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
ByChildren orders the results by children terms.
func ByChildrenCount ¶
func ByChildrenCount(opts ...sql.OrderTermOption) OrderOption
ByChildrenCount orders the results by children count.
func ByField2 ¶
func ByField2(opts ...sql.OrderTermOption) OrderOption
ByField2 orders the results by the field2 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 ByParentField ¶
func ByParentField(field string, opts ...sql.OrderTermOption) OrderOption
ByParentField orders the results by parent field.
func ByParentID ¶
func ByParentID(opts ...sql.OrderTermOption) OrderOption
ByParentID orders the results by the parent_id field.