Documentation
¶
Index ¶
- Constants
- Variables
- func And(predicates ...predicate.User) predicate.User
- func Bio(v string) predicate.User
- func BioContains(v string) predicate.User
- func BioContainsFold(v string) predicate.User
- func BioEQ(v string) predicate.User
- func BioEqualFold(v string) predicate.User
- func BioGT(v string) predicate.User
- func BioGTE(v string) predicate.User
- func BioHasPrefix(v string) predicate.User
- func BioHasSuffix(v string) predicate.User
- func BioIn(vs ...string) predicate.User
- func BioIsNil() predicate.User
- func BioLT(v string) predicate.User
- func BioLTE(v string) predicate.User
- func BioNEQ(v string) predicate.User
- func BioNotIn(vs ...string) predicate.User
- func BioNotNil() predicate.User
- func CreatedAt(v time.Time) predicate.User
- func CreatedAtEQ(v time.Time) predicate.User
- func CreatedAtGT(v time.Time) predicate.User
- func CreatedAtGTE(v time.Time) predicate.User
- func CreatedAtIn(vs ...time.Time) predicate.User
- func CreatedAtLT(v time.Time) predicate.User
- func CreatedAtLTE(v time.Time) predicate.User
- func CreatedAtNEQ(v time.Time) predicate.User
- func CreatedAtNotIn(vs ...time.Time) predicate.User
- func ExternalID(v uuid.UUID) predicate.User
- func ExternalIDEQ(v uuid.UUID) predicate.User
- func ExternalIDGT(v uuid.UUID) predicate.User
- func ExternalIDGTE(v uuid.UUID) predicate.User
- func ExternalIDIn(vs ...uuid.UUID) predicate.User
- func ExternalIDLT(v uuid.UUID) predicate.User
- func ExternalIDLTE(v uuid.UUID) predicate.User
- func ExternalIDNEQ(v uuid.UUID) predicate.User
- func ExternalIDNotIn(vs ...uuid.UUID) predicate.User
- func HasPinnedPost() predicate.User
- func HasPinnedPostWith(preds ...predicate.Post) predicate.User
- func HasPosts() predicate.User
- func HasPostsWith(preds ...predicate.Post) predicate.User
- func HasTags() predicate.User
- func HasTagsWith(preds ...predicate.Tag) predicate.User
- func ID(id int) predicate.User
- func IDEQ(id int) predicate.User
- func IDGT(id int) predicate.User
- func IDGTE(id int) predicate.User
- func IDIn(ids ...int) predicate.User
- func IDLT(id int) predicate.User
- func IDLTE(id int) predicate.User
- func IDNEQ(id int) predicate.User
- func IDNotIn(ids ...int) predicate.User
- func Name(v string) predicate.User
- func NameContains(v string) predicate.User
- func NameContainsFold(v string) predicate.User
- func NameEQ(v string) predicate.User
- func NameEqualFold(v string) predicate.User
- func NameGT(v string) predicate.User
- func NameGTE(v string) predicate.User
- func NameHasPrefix(v string) predicate.User
- func NameHasSuffix(v string) predicate.User
- func NameIn(vs ...string) predicate.User
- func NameLT(v string) predicate.User
- func NameLTE(v string) predicate.User
- func NameNEQ(v string) predicate.User
- func NameNotIn(vs ...string) predicate.User
- func Not(p predicate.User) predicate.User
- func Or(predicates ...predicate.User) predicate.User
- func Score(v int) predicate.User
- func ScoreEQ(v int) predicate.User
- func ScoreGT(v int) predicate.User
- func ScoreGTE(v int) predicate.User
- func ScoreIn(vs ...int) predicate.User
- func ScoreIsNil() predicate.User
- func ScoreLT(v int) predicate.User
- func ScoreLTE(v int) predicate.User
- func ScoreNEQ(v int) predicate.User
- func ScoreNotIn(vs ...int) predicate.User
- func ScoreNotNil() predicate.User
- func SettingsIsNil() predicate.User
- func SettingsNotNil() predicate.User
- func StatusEQ(v Status) predicate.User
- func StatusIn(vs ...Status) predicate.User
- func StatusNEQ(v Status) predicate.User
- func StatusNotIn(vs ...Status) predicate.User
- func StatusValidator(s Status) error
- func UpdatedAt(v time.Time) predicate.User
- func UpdatedAtEQ(v time.Time) predicate.User
- func UpdatedAtGT(v time.Time) predicate.User
- func UpdatedAtGTE(v time.Time) predicate.User
- func UpdatedAtIn(vs ...time.Time) predicate.User
- func UpdatedAtIsNil() predicate.User
- func UpdatedAtLT(v time.Time) predicate.User
- func UpdatedAtLTE(v time.Time) predicate.User
- func UpdatedAtNEQ(v time.Time) predicate.User
- func UpdatedAtNotIn(vs ...time.Time) predicate.User
- func UpdatedAtNotNil() predicate.User
- func Username(v string) predicate.User
- func UsernameContains(v string) predicate.User
- func UsernameContainsFold(v string) predicate.User
- func UsernameEQ(v string) predicate.User
- func UsernameEqualFold(v string) predicate.User
- func UsernameGT(v string) predicate.User
- func UsernameGTE(v string) predicate.User
- func UsernameHasPrefix(v string) predicate.User
- func UsernameHasSuffix(v string) predicate.User
- func UsernameIn(vs ...string) predicate.User
- func UsernameLT(v string) predicate.User
- func UsernameLTE(v string) predicate.User
- func UsernameNEQ(v string) predicate.User
- func UsernameNotIn(vs ...string) predicate.User
- func ValidColumn(column string) bool
- type Mutation
- func (m *Mutation) AddField(name string, value ent.Value) error
- func (m *Mutation) AddPostIDs(ids ...int)
- func (m *Mutation) AddScore(i int)
- func (m *Mutation) AddTagIDs(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) AddedScore() (r int, exists bool)
- func (m *Mutation) AppendTagNames(s []string)
- func (m *Mutation) AppendedTagNames() ([]string, bool)
- func (m *Mutation) Bio() (r string, exists bool)
- func (m *Mutation) BioCleared() bool
- func (m *Mutation) ClearBio()
- func (m *Mutation) ClearEdge(name string) error
- func (m *Mutation) ClearField(name string) error
- func (m *Mutation) ClearPinnedPost()
- func (m *Mutation) ClearPosts()
- func (m *Mutation) ClearScore()
- func (m *Mutation) ClearSettings()
- func (m *Mutation) ClearTags()
- func (m *Mutation) ClearUpdatedAt()
- func (m *Mutation) ClearedEdges() []string
- func (m *Mutation) ClearedFields() []string
- func (m *Mutation) CreatedAt() (r time.Time, exists bool)
- func (m *Mutation) EdgeCleared(name string) bool
- func (m *Mutation) ExternalID() (r uuid.UUID, exists 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) Labels() (r map[string]interface{}, exists bool)
- func (m *Mutation) Metadata() (r domain.UserMetadata, exists bool)
- 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) PinnedPostCleared() bool
- func (m *Mutation) PinnedPostID() (id int, exists bool)
- func (m *Mutation) PinnedPostIDs() (ids []int)
- func (m *Mutation) PostsCleared() bool
- func (m *Mutation) PostsIDs() (ids []int)
- func (m *Mutation) Predicates() []predicate.User
- func (m *Mutation) RemovePostIDs(ids ...int)
- func (m *Mutation) RemoveTagIDs(ids ...int)
- func (m *Mutation) RemovedEdges() []string
- func (m *Mutation) RemovedIDs(name string) []ent.Value
- func (m *Mutation) RemovedPostsIDs() (ids []int)
- func (m *Mutation) RemovedTagsIDs() (ids []int)
- func (m *Mutation) ResetBio()
- func (m *Mutation) ResetCreatedAt()
- func (m *Mutation) ResetEdge(name string) error
- func (m *Mutation) ResetExternalID()
- func (m *Mutation) ResetField(name string) error
- func (m *Mutation) ResetLabels()
- func (m *Mutation) ResetMetadata()
- func (m *Mutation) ResetName()
- func (m *Mutation) ResetPinnedPost()
- func (m *Mutation) ResetPosts()
- func (m *Mutation) ResetScore()
- func (m *Mutation) ResetSettings()
- func (m *Mutation) ResetStatus()
- func (m *Mutation) ResetTagNames()
- func (m *Mutation) ResetTags()
- func (m *Mutation) ResetUpdatedAt()
- func (m *Mutation) ResetUsername()
- func (m *Mutation) Score() (r int, exists bool)
- func (m *Mutation) ScoreCleared() bool
- func (m *Mutation) SetBio(s string)
- func (m *Mutation) SetCreatedAt(t time.Time)
- func (m *Mutation) SetExternalID(u uuid.UUID)
- func (m *Mutation) SetField(name string, value ent.Value) error
- func (m *Mutation) SetLabels(value map[string]interface{})
- func (m *Mutation) SetMetadata(dm domain.UserMetadata)
- func (m *Mutation) SetName(s string)
- func (m *Mutation) SetOp(op ent.Op)
- func (m *Mutation) SetPinnedPostID(id int)
- func (m *Mutation) SetScore(i int)
- func (m *Mutation) SetSettings(value map[string]interface{})
- func (m *Mutation) SetStatus(u Status)
- func (m *Mutation) SetTagNames(s []string)
- func (m *Mutation) SetUpdatedAt(t time.Time)
- func (m *Mutation) SetUsername(s string)
- func (m *Mutation) Settings() (r map[string]interface{}, exists bool)
- func (m *Mutation) SettingsCleared() bool
- func (m *Mutation) Status() (r Status, exists bool)
- func (m *Mutation) TagNames() (r []string, exists bool)
- func (m *Mutation) TagsCleared() bool
- func (m *Mutation) TagsIDs() (ids []int)
- func (m *Mutation) Type() string
- func (m *Mutation) UpdatedAt() (r time.Time, exists bool)
- func (m *Mutation) UpdatedAtCleared() bool
- func (m *Mutation) Username() (r string, exists bool)
- func (m *Mutation) Where(ps ...predicate.User)
- func (m *Mutation) WhereP(ps ...func(*sql.Selector))
- type OrderOption
- func ByBio(opts ...sql.OrderTermOption) OrderOption
- func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption
- func ByExternalID(opts ...sql.OrderTermOption) OrderOption
- func ByID(opts ...sql.OrderTermOption) OrderOption
- func ByName(opts ...sql.OrderTermOption) OrderOption
- func ByPinnedPostField(field string, opts ...sql.OrderTermOption) OrderOption
- func ByPosts(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
- func ByPostsCount(opts ...sql.OrderTermOption) OrderOption
- func ByScore(opts ...sql.OrderTermOption) OrderOption
- func ByStatus(opts ...sql.OrderTermOption) OrderOption
- func ByTags(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
- func ByTagsCount(opts ...sql.OrderTermOption) OrderOption
- func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption
- func ByUsername(opts ...sql.OrderTermOption) OrderOption
- type Status
Constants ¶
const ( // Label holds the string label denoting the user type in the database. Label = "user" // 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" // FieldBio holds the string denoting the bio field in the database. FieldBio = "bio" // FieldStatus holds the string denoting the status field in the database. FieldStatus = "status" // FieldCreatedAt holds the string denoting the created_at field in the database. FieldCreatedAt = "created_at" // FieldUsername holds the string denoting the username field in the database. FieldUsername = "username" // FieldScore holds the string denoting the score field in the database. FieldScore = "score" // FieldExternalID holds the string denoting the external_id field in the database. FieldExternalID = "external_id" // FieldUpdatedAt holds the string denoting the updated_at field in the database. FieldUpdatedAt = "updated_at" // FieldSettings holds the string denoting the settings field in the database. FieldSettings = "settings" // FieldLabels holds the string denoting the labels field in the database. FieldLabels = "labels" // FieldTagNames holds the string denoting the tag_names field in the database. FieldTagNames = "tag_names" // FieldMetadata holds the string denoting the metadata field in the database. FieldMetadata = "metadata" // EdgePosts holds the string denoting the posts edge name in mutations. EdgePosts = "posts" // EdgePinnedPost holds the string denoting the pinned_post edge name in mutations. EdgePinnedPost = "pinned_post" // EdgeTags holds the string denoting the tags edge name in mutations. EdgeTags = "tags" // Table holds the table name of the user in the database. Table = "users" // PostsTable is the table that holds the posts relation/edge. PostsTable = "posts" // PostsInverseTable is the table name for the Post entity. // It exists in this package in order to avoid circular dependency with the "post" package. PostsInverseTable = "posts" // PostsColumn is the table column denoting the posts relation/edge. PostsColumn = "user_posts" // PinnedPostTable is the table that holds the pinned_post relation/edge. PinnedPostTable = "users" // PinnedPostInverseTable is the table name for the Post entity. // It exists in this package in order to avoid circular dependency with the "post" package. PinnedPostInverseTable = "posts" // PinnedPostColumn is the table column denoting the pinned_post relation/edge. PinnedPostColumn = "user_pinned_post" // TagsTable is the table that holds the tags relation/edge. The primary key declared below. TagsTable = "user_tags" // TagsInverseTable is the table name for the Tag entity. // It exists in this package in order to avoid circular dependency with the "tag" package. TagsInverseTable = "tags" )
const DefaultStatus = StatusActive
StatusActive is the default value of the Status enum.
Variables ¶
var Columns = []string{ FieldID, FieldName, FieldBio, FieldStatus, FieldCreatedAt, FieldUsername, FieldScore, FieldExternalID, FieldUpdatedAt, FieldSettings, FieldLabels, FieldTagNames, FieldMetadata, }
Columns holds all SQL columns for user fields.
var ( // DefaultCreatedAt holds the default value on creation for the "created_at" field. DefaultCreatedAt func() time.Time )
var ForeignKeys = []string{
"user_pinned_post",
}
ForeignKeys holds the SQL foreign-keys that are owned by the "users" table and are not defined as standalone fields in the schema.
var ( // TagsPrimaryKey and TagsColumn2 are the table columns denoting the // primary key for the tags relation (M2M). TagsPrimaryKey = []string{"user_id", "tag_id"} )
Functions ¶
func BioContains ¶
BioContains applies the Contains predicate on the "bio" field.
func BioContainsFold ¶
BioContainsFold applies the ContainsFold predicate on the "bio" field.
func BioEqualFold ¶
BioEqualFold applies the EqualFold predicate on the "bio" field.
func BioHasPrefix ¶
BioHasPrefix applies the HasPrefix predicate on the "bio" field.
func BioHasSuffix ¶
BioHasSuffix applies the HasSuffix predicate on the "bio" field.
func CreatedAt ¶
CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
func CreatedAtEQ ¶
CreatedAtEQ applies the EQ predicate on the "created_at" field.
func CreatedAtGT ¶
CreatedAtGT applies the GT predicate on the "created_at" field.
func CreatedAtGTE ¶
CreatedAtGTE applies the GTE predicate on the "created_at" field.
func CreatedAtIn ¶
CreatedAtIn applies the In predicate on the "created_at" field.
func CreatedAtLT ¶
CreatedAtLT applies the LT predicate on the "created_at" field.
func CreatedAtLTE ¶
CreatedAtLTE applies the LTE predicate on the "created_at" field.
func CreatedAtNEQ ¶
CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
func CreatedAtNotIn ¶
CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
func ExternalID ¶
ExternalID applies equality check predicate on the "external_id" field. It's identical to ExternalIDEQ.
func ExternalIDEQ ¶
ExternalIDEQ applies the EQ predicate on the "external_id" field.
func ExternalIDGT ¶
ExternalIDGT applies the GT predicate on the "external_id" field.
func ExternalIDGTE ¶
ExternalIDGTE applies the GTE predicate on the "external_id" field.
func ExternalIDIn ¶
ExternalIDIn applies the In predicate on the "external_id" field.
func ExternalIDLT ¶
ExternalIDLT applies the LT predicate on the "external_id" field.
func ExternalIDLTE ¶
ExternalIDLTE applies the LTE predicate on the "external_id" field.
func ExternalIDNEQ ¶
ExternalIDNEQ applies the NEQ predicate on the "external_id" field.
func ExternalIDNotIn ¶
ExternalIDNotIn applies the NotIn predicate on the "external_id" field.
func HasPinnedPost ¶
HasPinnedPost applies the HasEdge predicate on the "pinned_post" edge.
func HasPinnedPostWith ¶
HasPinnedPostWith applies the HasEdge predicate on the "pinned_post" edge with a given conditions (other predicates).
func HasPostsWith ¶
HasPostsWith applies the HasEdge predicate on the "posts" edge with a given conditions (other predicates).
func HasTagsWith ¶
HasTagsWith applies the HasEdge predicate on the "tags" 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 Score ¶
Score applies equality check predicate on the "score" field. It's identical to ScoreEQ.
func ScoreIsNil ¶
ScoreIsNil applies the IsNil predicate on the "score" field.
func ScoreNotIn ¶
ScoreNotIn applies the NotIn predicate on the "score" field.
func ScoreNotNil ¶
ScoreNotNil applies the NotNil predicate on the "score" field.
func SettingsIsNil ¶
SettingsIsNil applies the IsNil predicate on the "settings" field.
func SettingsNotNil ¶
SettingsNotNil applies the NotNil predicate on the "settings" field.
func StatusNotIn ¶
StatusNotIn applies the NotIn predicate on the "status" field.
func StatusValidator ¶
StatusValidator is a validator for the "status" field enum values. It is called by the builders before save.
func UpdatedAt ¶
UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
func UpdatedAtEQ ¶
UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
func UpdatedAtGT ¶
UpdatedAtGT applies the GT predicate on the "updated_at" field.
func UpdatedAtGTE ¶
UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
func UpdatedAtIn ¶
UpdatedAtIn applies the In predicate on the "updated_at" field.
func UpdatedAtIsNil ¶
UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field.
func UpdatedAtLT ¶
UpdatedAtLT applies the LT predicate on the "updated_at" field.
func UpdatedAtLTE ¶
UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
func UpdatedAtNEQ ¶
UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
func UpdatedAtNotIn ¶
UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
func UpdatedAtNotNil ¶
UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field.
func Username ¶
Username applies equality check predicate on the "username" field. It's identical to UsernameEQ.
func UsernameContains ¶
UsernameContains applies the Contains predicate on the "username" field.
func UsernameContainsFold ¶
UsernameContainsFold applies the ContainsFold predicate on the "username" field.
func UsernameEQ ¶
UsernameEQ applies the EQ predicate on the "username" field.
func UsernameEqualFold ¶
UsernameEqualFold applies the EqualFold predicate on the "username" field.
func UsernameGT ¶
UsernameGT applies the GT predicate on the "username" field.
func UsernameGTE ¶
UsernameGTE applies the GTE predicate on the "username" field.
func UsernameHasPrefix ¶
UsernameHasPrefix applies the HasPrefix predicate on the "username" field.
func UsernameHasSuffix ¶
UsernameHasSuffix applies the HasSuffix predicate on the "username" field.
func UsernameIn ¶
UsernameIn applies the In predicate on the "username" field.
func UsernameLT ¶
UsernameLT applies the LT predicate on the "username" field.
func UsernameLTE ¶
UsernameLTE applies the LTE predicate on the "username" field.
func UsernameNEQ ¶
UsernameNEQ applies the NEQ predicate on the "username" field.
func UsernameNotIn ¶
UsernameNotIn applies the NotIn predicate on the "username" 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 User nodes in the graph.
func NewMutation ¶ added in v1.6.0
NewMutation creates a new Mutation for the User 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) AddPostIDs ¶ added in v1.6.0
AddPostIDs adds the "posts" edge to the Post entity by ids.
func (*Mutation) AddTagIDs ¶ added in v1.6.0
AddTagIDs adds the "tags" edge to the Tag 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) AddedScore ¶ added in v1.6.0
AddedScore returns the value that was added to the "score" field in this mutation.
func (*Mutation) AppendTagNames ¶ added in v1.6.0
AppendTagNames adds s to the "tag_names" field.
func (*Mutation) AppendedTagNames ¶ added in v1.6.0
AppendedTagNames returns the list of values that were appended to the "tag_names" field in this mutation.
func (*Mutation) BioCleared ¶ added in v1.6.0
BioCleared returns if the "bio" field was cleared in this mutation.
func (*Mutation) ClearBio ¶ added in v1.6.0
func (m *Mutation) ClearBio()
ClearBio clears the value of the "bio" field.
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) ClearPinnedPost ¶ added in v1.6.0
func (m *Mutation) ClearPinnedPost()
ClearPinnedPost clears the "pinned_post" edge to the Post entity.
func (*Mutation) ClearPosts ¶ added in v1.6.0
func (m *Mutation) ClearPosts()
ClearPosts clears the "posts" edge to the Post entity.
func (*Mutation) ClearScore ¶ added in v1.6.0
func (m *Mutation) ClearScore()
ClearScore clears the value of the "score" field.
func (*Mutation) ClearSettings ¶ added in v1.6.0
func (m *Mutation) ClearSettings()
ClearSettings clears the value of the "settings" field.
func (*Mutation) ClearTags ¶ added in v1.6.0
func (m *Mutation) ClearTags()
ClearTags clears the "tags" edge to the Tag entity.
func (*Mutation) ClearUpdatedAt ¶ added in v1.6.0
func (m *Mutation) ClearUpdatedAt()
ClearUpdatedAt clears the value of the "updated_at" field.
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) CreatedAt ¶ added in v1.6.0
CreatedAt returns the value of the "created_at" field in the 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) ExternalID ¶ added in v1.6.0
ExternalID returns the value of the "external_id" field in the 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) Labels ¶ added in v1.6.0
Labels returns the value of the "labels" field in the mutation.
func (*Mutation) Metadata ¶ added in v1.6.0
func (m *Mutation) Metadata() (r domain.UserMetadata, exists bool)
Metadata returns the value of the "metadata" field in the mutation.
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) PinnedPostCleared ¶ added in v1.6.0
PinnedPostCleared reports if the "pinned_post" edge to the Post entity was cleared.
func (*Mutation) PinnedPostID ¶ added in v1.6.0
PinnedPostID returns the "pinned_post" edge ID in the mutation.
func (*Mutation) PinnedPostIDs ¶ added in v1.6.0
PinnedPostIDs returns the "pinned_post" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use PinnedPostID instead. It exists only for internal usage by the builders.
func (*Mutation) PostsCleared ¶ added in v1.6.0
PostsCleared reports if the "posts" edge to the Post entity was cleared.
func (*Mutation) Predicates ¶ added in v1.6.0
Predicates returns the list of predicates set on the mutation.
func (*Mutation) RemovePostIDs ¶ added in v1.6.0
RemovePostIDs removes the "posts" edge to the Post entity by IDs.
func (*Mutation) RemoveTagIDs ¶ added in v1.6.0
RemoveTagIDs removes the "tags" edge to the Tag 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) RemovedPostsIDs ¶ added in v1.6.0
RemovedPosts returns the removed IDs of the "posts" edge to the Post entity.
func (*Mutation) RemovedTagsIDs ¶ added in v1.6.0
RemovedTags returns the removed IDs of the "tags" edge to the Tag entity.
func (*Mutation) ResetBio ¶ added in v1.6.0
func (m *Mutation) ResetBio()
ResetBio resets all changes to the "bio" field.
func (*Mutation) ResetCreatedAt ¶ added in v1.6.0
func (m *Mutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
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) ResetExternalID ¶ added in v1.6.0
func (m *Mutation) ResetExternalID()
ResetExternalID resets all changes to the "external_id" field.
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) ResetLabels ¶ added in v1.6.0
func (m *Mutation) ResetLabels()
ResetLabels resets all changes to the "labels" field.
func (*Mutation) ResetMetadata ¶ added in v1.6.0
func (m *Mutation) ResetMetadata()
ResetMetadata resets all changes to the "metadata" field.
func (*Mutation) ResetName ¶ added in v1.6.0
func (m *Mutation) ResetName()
ResetName resets all changes to the "name" field.
func (*Mutation) ResetPinnedPost ¶ added in v1.6.0
func (m *Mutation) ResetPinnedPost()
ResetPinnedPost resets all changes to the "pinned_post" edge.
func (*Mutation) ResetPosts ¶ added in v1.6.0
func (m *Mutation) ResetPosts()
ResetPosts resets all changes to the "posts" edge.
func (*Mutation) ResetScore ¶ added in v1.6.0
func (m *Mutation) ResetScore()
ResetScore resets all changes to the "score" field.
func (*Mutation) ResetSettings ¶ added in v1.6.0
func (m *Mutation) ResetSettings()
ResetSettings resets all changes to the "settings" field.
func (*Mutation) ResetStatus ¶ added in v1.6.0
func (m *Mutation) ResetStatus()
ResetStatus resets all changes to the "status" field.
func (*Mutation) ResetTagNames ¶ added in v1.6.0
func (m *Mutation) ResetTagNames()
ResetTagNames resets all changes to the "tag_names" field.
func (*Mutation) ResetTags ¶ added in v1.6.0
func (m *Mutation) ResetTags()
ResetTags resets all changes to the "tags" edge.
func (*Mutation) ResetUpdatedAt ¶ added in v1.6.0
func (m *Mutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*Mutation) ResetUsername ¶ added in v1.6.0
func (m *Mutation) ResetUsername()
ResetUsername resets all changes to the "username" field.
func (*Mutation) Score ¶ added in v1.6.0
Score returns the value of the "score" field in the mutation.
func (*Mutation) ScoreCleared ¶ added in v1.6.0
ScoreCleared returns if the "score" field was cleared in this mutation.
func (*Mutation) SetCreatedAt ¶ added in v1.6.0
SetCreatedAt sets the "created_at" field.
func (*Mutation) SetExternalID ¶ added in v1.6.0
SetExternalID sets the "external_id" field.
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) SetMetadata ¶ added in v1.6.0
func (m *Mutation) SetMetadata(dm domain.UserMetadata)
SetMetadata sets the "metadata" field.
func (*Mutation) SetPinnedPostID ¶ added in v1.6.0
SetPinnedPostID sets the "pinned_post" edge to the Post entity by id.
func (*Mutation) SetSettings ¶ added in v1.6.0
SetSettings sets the "settings" field.
func (*Mutation) SetTagNames ¶ added in v1.6.0
SetTagNames sets the "tag_names" field.
func (*Mutation) SetUpdatedAt ¶ added in v1.6.0
SetUpdatedAt sets the "updated_at" field.
func (*Mutation) SetUsername ¶ added in v1.6.0
SetUsername sets the "username" field.
func (*Mutation) Settings ¶ added in v1.6.0
Settings returns the value of the "settings" field in the mutation.
func (*Mutation) SettingsCleared ¶ added in v1.6.0
SettingsCleared returns if the "settings" field was cleared in this mutation.
func (*Mutation) Status ¶ added in v1.6.0
Status returns the value of the "status" field in the mutation.
func (*Mutation) TagNames ¶ added in v1.6.0
TagNames returns the value of the "tag_names" field in the mutation.
func (*Mutation) TagsCleared ¶ added in v1.6.0
TagsCleared reports if the "tags" edge to the Tag entity was cleared.
func (*Mutation) UpdatedAt ¶ added in v1.6.0
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*Mutation) UpdatedAtCleared ¶ added in v1.6.0
UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.
func (*Mutation) Username ¶ added in v1.6.0
Username returns the value of the "username" field in the mutation.
type OrderOption ¶
OrderOption defines the ordering options for the User queries.
func ByBio ¶
func ByBio(opts ...sql.OrderTermOption) OrderOption
ByBio orders the results by the bio field.
func ByCreatedAt ¶
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption
ByCreatedAt orders the results by the created_at field.
func ByExternalID ¶
func ByExternalID(opts ...sql.OrderTermOption) OrderOption
ByExternalID orders the results by the external_id 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 ByPinnedPostField ¶
func ByPinnedPostField(field string, opts ...sql.OrderTermOption) OrderOption
ByPinnedPostField orders the results by pinned_post field.
func ByPosts ¶
func ByPosts(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
ByPosts orders the results by posts terms.
func ByPostsCount ¶
func ByPostsCount(opts ...sql.OrderTermOption) OrderOption
ByPostsCount orders the results by posts count.
func ByScore ¶
func ByScore(opts ...sql.OrderTermOption) OrderOption
ByScore orders the results by the score field.
func ByStatus ¶
func ByStatus(opts ...sql.OrderTermOption) OrderOption
ByStatus orders the results by the status field.
func ByTags ¶
func ByTags(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption
ByTags orders the results by tags terms.
func ByTagsCount ¶
func ByTagsCount(opts ...sql.OrderTermOption) OrderOption
ByTagsCount orders the results by tags count.
func ByUpdatedAt ¶
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption
ByUpdatedAt orders the results by the updated_at field.
func ByUsername ¶
func ByUsername(opts ...sql.OrderTermOption) OrderOption
ByUsername orders the results by the username field.