trait

package
v0.0.0-...-c5055fb Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the trait type in the database.
	Label = "trait"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldIndx holds the string denoting the indx field in the database.
	FieldIndx = "indx"
	// FieldName holds the string denoting the name field in the database.
	FieldName = "name"
	// FieldDesc holds the string denoting the desc field in the database.
	FieldDesc = "desc"
	// EdgeRaces holds the string denoting the races edge name in mutations.
	EdgeRaces = "races"
	// EdgeSubraces holds the string denoting the subraces edge name in mutations.
	EdgeSubraces = "subraces"
	// Table holds the table name of the trait in the database.
	Table = "traits"
	// RacesTable is the table that holds the races relation/edge. The primary key declared below.
	RacesTable = "race_traits"
	// RacesInverseTable is the table name for the Race entity.
	// It exists in this package in order to avoid circular dependency with the "race" package.
	RacesInverseTable = "races"
	// SubracesTable is the table that holds the subraces relation/edge. The primary key declared below.
	SubracesTable = "subrace_traits"
	// SubracesInverseTable is the table name for the Subrace entity.
	// It exists in this package in order to avoid circular dependency with the "subrace" package.
	SubracesInverseTable = "subraces"
)

Variables

View Source
var (
	// RacesPrimaryKey and RacesColumn2 are the table columns denoting the
	// primary key for the races relation (M2M).
	RacesPrimaryKey = []string{"race_id", "trait_id"}
	// SubracesPrimaryKey and SubracesColumn2 are the table columns denoting the
	// primary key for the subraces relation (M2M).
	SubracesPrimaryKey = []string{"subrace_id", "trait_id"}
)
View Source
var (
	// IndxValidator is a validator for the "indx" field. It is called by the builders before save.
	IndxValidator func(string) error
	// NameValidator is a validator for the "name" field. It is called by the builders before save.
	NameValidator func(string) error
)

Columns holds all SQL columns for trait fields.

Functions

func And

func And(predicates ...predicate.Trait) predicate.Trait

And groups predicates with the AND operator between them.

func HasRaces

func HasRaces() predicate.Trait

HasRaces applies the HasEdge predicate on the "races" edge.

func HasRacesWith

func HasRacesWith(preds ...predicate.Race) predicate.Trait

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

func HasSubraces

func HasSubraces() predicate.Trait

HasSubraces applies the HasEdge predicate on the "subraces" edge.

func HasSubracesWith

func HasSubracesWith(preds ...predicate.Subrace) predicate.Trait

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

func ID

func ID(id int) predicate.Trait

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id int) predicate.Trait

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id int) predicate.Trait

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id int) predicate.Trait

IDGTE applies the GTE predicate on the ID field.

func IDIn

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

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id int) predicate.Trait

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id int) predicate.Trait

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id int) predicate.Trait

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

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

IDNotIn applies the NotIn predicate on the ID field.

func Indx

func Indx(v string) predicate.Trait

Indx applies equality check predicate on the "indx" field. It's identical to IndxEQ.

func IndxContains

func IndxContains(v string) predicate.Trait

IndxContains applies the Contains predicate on the "indx" field.

func IndxContainsFold

func IndxContainsFold(v string) predicate.Trait

IndxContainsFold applies the ContainsFold predicate on the "indx" field.

func IndxEQ

func IndxEQ(v string) predicate.Trait

IndxEQ applies the EQ predicate on the "indx" field.

func IndxEqualFold

func IndxEqualFold(v string) predicate.Trait

IndxEqualFold applies the EqualFold predicate on the "indx" field.

func IndxGT

func IndxGT(v string) predicate.Trait

IndxGT applies the GT predicate on the "indx" field.

func IndxGTE

func IndxGTE(v string) predicate.Trait

IndxGTE applies the GTE predicate on the "indx" field.

func IndxHasPrefix

func IndxHasPrefix(v string) predicate.Trait

IndxHasPrefix applies the HasPrefix predicate on the "indx" field.

func IndxHasSuffix

func IndxHasSuffix(v string) predicate.Trait

IndxHasSuffix applies the HasSuffix predicate on the "indx" field.

func IndxIn

func IndxIn(vs ...string) predicate.Trait

IndxIn applies the In predicate on the "indx" field.

func IndxLT

func IndxLT(v string) predicate.Trait

IndxLT applies the LT predicate on the "indx" field.

func IndxLTE

func IndxLTE(v string) predicate.Trait

IndxLTE applies the LTE predicate on the "indx" field.

func IndxNEQ

func IndxNEQ(v string) predicate.Trait

IndxNEQ applies the NEQ predicate on the "indx" field.

func IndxNotIn

func IndxNotIn(vs ...string) predicate.Trait

IndxNotIn applies the NotIn predicate on the "indx" field.

func Name

func Name(v string) predicate.Trait

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

func NameContains

func NameContains(v string) predicate.Trait

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

func NameContainsFold

func NameContainsFold(v string) predicate.Trait

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

func NameEQ

func NameEQ(v string) predicate.Trait

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

func NameEqualFold

func NameEqualFold(v string) predicate.Trait

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

func NameGT

func NameGT(v string) predicate.Trait

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

func NameGTE

func NameGTE(v string) predicate.Trait

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

func NameHasPrefix

func NameHasPrefix(v string) predicate.Trait

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

func NameHasSuffix

func NameHasSuffix(v string) predicate.Trait

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

func NameIn

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

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

func NameLT

func NameLT(v string) predicate.Trait

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

func NameLTE

func NameLTE(v string) predicate.Trait

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

func NameNEQ

func NameNEQ(v string) predicate.Trait

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

func NameNotIn

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

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

Or groups predicates with the OR operator between them.

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 Trait queries.

func ByID

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

ByID orders the results by the id field.

func ByIndx

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

ByIndx orders the results by the indx field.

func ByName

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

ByName orders the results by the name field.

func ByRaces

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

ByRaces orders the results by races terms.

func ByRacesCount

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

ByRacesCount orders the results by races count.

func BySubraces

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

BySubraces orders the results by subraces terms.

func BySubracesCount

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

BySubracesCount orders the results by subraces count.

Jump to

Keyboard shortcuts

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