onetomany

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
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

Columns holds all SQL columns for onetomany fields.

View Source
var (
	// NameValidator is a validator for the "name" field. It is called by the builders before save.
	NameValidator func(string) error
)

Functions

func And

func And(predicates ...predicate.OneToMany) predicate.OneToMany

And groups predicates with the AND operator between them.

func Field2

func Field2(v string) predicate.OneToMany

Field2 applies equality check predicate on the "field2" field. It's identical to Field2EQ.

func Field2Contains

func Field2Contains(v string) predicate.OneToMany

Field2Contains applies the Contains predicate on the "field2" field.

func Field2ContainsFold

func Field2ContainsFold(v string) predicate.OneToMany

Field2ContainsFold applies the ContainsFold predicate on the "field2" field.

func Field2EQ

func Field2EQ(v string) predicate.OneToMany

Field2EQ applies the EQ predicate on the "field2" field.

func Field2EqualFold

func Field2EqualFold(v string) predicate.OneToMany

Field2EqualFold applies the EqualFold predicate on the "field2" field.

func Field2GT

func Field2GT(v string) predicate.OneToMany

Field2GT applies the GT predicate on the "field2" field.

func Field2GTE

func Field2GTE(v string) predicate.OneToMany

Field2GTE applies the GTE predicate on the "field2" field.

func Field2HasPrefix

func Field2HasPrefix(v string) predicate.OneToMany

Field2HasPrefix applies the HasPrefix predicate on the "field2" field.

func Field2HasSuffix

func Field2HasSuffix(v string) predicate.OneToMany

Field2HasSuffix applies the HasSuffix predicate on the "field2" field.

func Field2In

func Field2In(vs ...string) predicate.OneToMany

Field2In applies the In predicate on the "field2" field.

func Field2IsNil

func Field2IsNil() predicate.OneToMany

Field2IsNil applies the IsNil predicate on the "field2" field.

func Field2LT

func Field2LT(v string) predicate.OneToMany

Field2LT applies the LT predicate on the "field2" field.

func Field2LTE

func Field2LTE(v string) predicate.OneToMany

Field2LTE applies the LTE predicate on the "field2" field.

func Field2NEQ

func Field2NEQ(v string) predicate.OneToMany

Field2NEQ applies the NEQ predicate on the "field2" field.

func Field2NotIn

func Field2NotIn(vs ...string) predicate.OneToMany

Field2NotIn applies the NotIn predicate on the "field2" field.

func Field2NotNil

func Field2NotNil() predicate.OneToMany

Field2NotNil applies the NotNil predicate on the "field2" field.

func HasChildren

func HasChildren() predicate.OneToMany

HasChildren applies the HasEdge predicate on the "children" edge.

func HasChildrenWith

func HasChildrenWith(preds ...predicate.OneToMany) predicate.OneToMany

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

func HasParent

func HasParent() predicate.OneToMany

HasParent applies the HasEdge predicate on the "parent" edge.

func HasParentWith

func HasParentWith(preds ...predicate.OneToMany) predicate.OneToMany

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

func ID

func ID(id int) predicate.OneToMany

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id int) predicate.OneToMany

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id int) predicate.OneToMany

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id int) predicate.OneToMany

IDGTE applies the GTE predicate on the ID field.

func IDIn

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

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id int) predicate.OneToMany

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id int) predicate.OneToMany

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id int) predicate.OneToMany

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

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

IDNotIn applies the NotIn predicate on the ID field.

func Name

func Name(v string) predicate.OneToMany

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

func NameContains

func NameContains(v string) predicate.OneToMany

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

func NameContainsFold

func NameContainsFold(v string) predicate.OneToMany

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

func NameEQ

func NameEQ(v string) predicate.OneToMany

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

func NameEqualFold

func NameEqualFold(v string) predicate.OneToMany

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

func NameGT

func NameGT(v string) predicate.OneToMany

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

func NameGTE

func NameGTE(v string) predicate.OneToMany

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

func NameHasPrefix

func NameHasPrefix(v string) predicate.OneToMany

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

func NameHasSuffix

func NameHasSuffix(v string) predicate.OneToMany

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

func NameIn

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

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

func NameLT

func NameLT(v string) predicate.OneToMany

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

func NameLTE

func NameLTE(v string) predicate.OneToMany

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

func NameNEQ

func NameNEQ(v string) predicate.OneToMany

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

func NameNotIn

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

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.OneToMany) predicate.OneToMany

Or groups predicates with the OR operator between them.

func ParentID

func ParentID(v int) predicate.OneToMany

ParentID applies equality check predicate on the "parent_id" field. It's identical to ParentIDEQ.

func ParentIDEQ

func ParentIDEQ(v int) predicate.OneToMany

ParentIDEQ applies the EQ predicate on the "parent_id" field.

func ParentIDIn

func ParentIDIn(vs ...int) predicate.OneToMany

ParentIDIn applies the In predicate on the "parent_id" field.

func ParentIDIsNil

func ParentIDIsNil() predicate.OneToMany

ParentIDIsNil applies the IsNil predicate on the "parent_id" field.

func ParentIDNEQ

func ParentIDNEQ(v int) predicate.OneToMany

ParentIDNEQ applies the NEQ predicate on the "parent_id" field.

func ParentIDNotIn

func ParentIDNotIn(vs ...int) predicate.OneToMany

ParentIDNotIn applies the NotIn predicate on the "parent_id" field.

func ParentIDNotNil

func ParentIDNotNil() predicate.OneToMany

ParentIDNotNil applies the NotNil predicate on the "parent_id" 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 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.

Jump to

Keyboard shortcuts

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