Documentation
¶
Index ¶
- Constants
- Variables
- func And(predicates ...predicate.Tag) predicate.Tag
- func HasUsers() predicate.Tag
- func HasUsersWith(preds ...predicate.User) predicate.Tag
- func ID(id int) predicate.Tag
- func IDEQ(id int) predicate.Tag
- func IDGT(id int) predicate.Tag
- func IDGTE(id int) predicate.Tag
- func IDIn(ids ...int) predicate.Tag
- func IDLT(id int) predicate.Tag
- func IDLTE(id int) predicate.Tag
- func IDNEQ(id int) predicate.Tag
- func IDNotIn(ids ...int) predicate.Tag
- func Name(v string) predicate.Tag
- func NameContains(v string) predicate.Tag
- func NameContainsFold(v string) predicate.Tag
- func NameEQ(v string) predicate.Tag
- func NameEqualFold(v string) predicate.Tag
- func NameGT(v string) predicate.Tag
- func NameGTE(v string) predicate.Tag
- func NameHasPrefix(v string) predicate.Tag
- func NameHasSuffix(v string) predicate.Tag
- func NameIn(vs ...string) predicate.Tag
- func NameLT(v string) predicate.Tag
- func NameLTE(v string) predicate.Tag
- func NameNEQ(v string) predicate.Tag
- func NameNotIn(vs ...string) predicate.Tag
- func Not(p predicate.Tag) predicate.Tag
- func Or(predicates ...predicate.Tag) predicate.Tag
- func ValidColumn(column string) bool
- type Mutation
- func (m *Mutation) AddField(name string, value ent.Value) error
- func (m *Mutation) AddUserIDs(ids ...int)
- func (m *Mutation) AddedEdges() []string
- func (m *Mutation) AddedField(name string) (ent.Value, bool)
- func (m *Mutation) AddedFields() []string
- func (m *Mutation) AddedIDs(name string) []ent.Value
- func (m *Mutation) ClearEdge(name string) error
- func (m *Mutation) ClearField(name string) error
- func (m *Mutation) ClearUsers()
- func (m *Mutation) ClearedEdges() []string
- func (m *Mutation) ClearedFields() []string
- func (m *Mutation) EdgeCleared(name string) bool
- func (m *Mutation) Field(name string) (ent.Value, bool)
- func (m *Mutation) FieldCleared(name string) bool
- func (m *Mutation) Fields() []string
- func (m *Mutation) Name() (r string, exists bool)
- func (m *Mutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *Mutation) Op() ent.Op
- func (m *Mutation) Predicates() []predicate.Tag
- func (m *Mutation) RemoveUserIDs(ids ...int)
- func (m *Mutation) RemovedEdges() []string
- func (m *Mutation) RemovedIDs(name string) []ent.Value
- func (m *Mutation) RemovedUsersIDs() (ids []int)
- func (m *Mutation) ResetEdge(name string) error
- func (m *Mutation) ResetField(name string) error
- func (m *Mutation) ResetName()
- func (m *Mutation) ResetUsers()
- func (m *Mutation) SetField(name string, value ent.Value) error
- func (m *Mutation) SetName(s string)
- func (m *Mutation) SetOp(op ent.Op)
- func (m *Mutation) Type() string
- func (m *Mutation) UsersCleared() bool
- func (m *Mutation) UsersIDs() (ids []int)
- func (m *Mutation) Where(ps ...predicate.Tag)
- func (m *Mutation) WhereP(ps ...func(*sql.Selector))
- type OrderOption
Constants ¶
const ( // Label holds the string label denoting the tag type in the database. Label = "tag" // 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" // EdgeUsers holds the string denoting the users edge name in mutations. EdgeUsers = "users" // Table holds the table name of the tag in the database. Table = "tags" // UsersTable is the table that holds the users relation/edge. The primary key declared below. UsersTable = "user_tags" // UsersInverseTable is the table name for the User entity. // It exists in this package in order to avoid circular dependency with the "user" package. UsersInverseTable = "users" )
Variables ¶
var Columns = []string{ FieldID, FieldName, }
Columns holds all SQL columns for tag fields.
var ( // UsersPrimaryKey and UsersColumn2 are the table columns denoting the // primary key for the users relation (M2M). UsersPrimaryKey = []string{"user_id", "tag_id"} )
Functions ¶
func HasUsersWith ¶
HasUsersWith applies the HasEdge predicate on the "users" 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 ValidColumn ¶
ValidColumn reports if the column name is valid (part of the table columns).
Types ¶
type Mutation ¶ added in v1.6.0
type Mutation struct {
// contains filtered or unexported fields
}
Mutation represents an operation that mutates the Tag nodes in the graph.
func NewMutation ¶ added in v1.6.0
NewMutation creates a new Mutation for the Tag entity.
func (*Mutation) AddField ¶ added in v1.6.0
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*Mutation) AddUserIDs ¶ added in v1.6.0
AddUserIDs adds the "users" edge to the User entity by ids.
func (*Mutation) AddedEdges ¶ added in v1.6.0
AddedEdges returns all edge names that were set/added in this mutation.
func (*Mutation) AddedField ¶ added in v1.6.0
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*Mutation) AddedFields ¶ added in v1.6.0
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*Mutation) AddedIDs ¶ added in v1.6.0
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*Mutation) ClearEdge ¶ added in v1.6.0
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*Mutation) ClearField ¶ added in v1.6.0
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*Mutation) ClearUsers ¶ added in v1.6.0
func (m *Mutation) ClearUsers()
ClearUsers clears the "users" edge to the User entity.
func (*Mutation) ClearedEdges ¶ added in v1.6.0
ClearedEdges returns all edge names that were cleared in this mutation.
func (*Mutation) ClearedFields ¶ added in v1.6.0
ClearedFields returns all nullable fields that were cleared during this mutation.
func (*Mutation) EdgeCleared ¶ added in v1.6.0
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*Mutation) Field ¶ added in v1.6.0
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*Mutation) FieldCleared ¶ added in v1.6.0
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*Mutation) Fields ¶ added in v1.6.0
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*Mutation) OldField ¶ added in v1.6.0
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*Mutation) Predicates ¶ added in v1.6.0
Predicates returns the list of predicates set on the mutation.
func (*Mutation) RemoveUserIDs ¶ added in v1.6.0
RemoveUserIDs removes the "users" edge to the User entity by IDs.
func (*Mutation) RemovedEdges ¶ added in v1.6.0
RemovedEdges returns all edge names that were removed in this mutation.
func (*Mutation) RemovedIDs ¶ added in v1.6.0
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*Mutation) RemovedUsersIDs ¶ added in v1.6.0
RemovedUsers returns the removed IDs of the "users" edge to the User entity.
func (*Mutation) ResetEdge ¶ added in v1.6.0
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*Mutation) ResetField ¶ added in v1.6.0
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*Mutation) ResetName ¶ added in v1.6.0
func (m *Mutation) ResetName()
ResetName resets all changes to the "name" field.
func (*Mutation) ResetUsers ¶ added in v1.6.0
func (m *Mutation) ResetUsers()
ResetUsers resets all changes to the "users" edge.
func (*Mutation) SetField ¶ added in v1.6.0
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*Mutation) UsersCleared ¶ added in v1.6.0
UsersCleared reports if the "users" edge to the User entity was cleared.
type OrderOption ¶
OrderOption defines the ordering options for the Tag queries.
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 ByUsers ¶
func ByUsers(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
ByUsers orders the results by users terms.
func ByUsersCount ¶
func ByUsersCount(opts ...sql.OrderTermOption) OrderOption
ByUsersCount orders the results by users count.