Documentation
¶
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Note
- type NoteClient
- func (c *NoteClient) Create() *NoteCreate
- func (c *NoteClient) CreateBulk(builders ...*NoteCreate) *NoteCreateBulk
- func (c *NoteClient) Delete() *NoteDelete
- func (c *NoteClient) DeleteOne(n *Note) *NoteDeleteOne
- func (c *NoteClient) DeleteOneID(id int) *NoteDeleteOne
- func (c *NoteClient) Get(ctx context.Context, id int) (*Note, error)
- func (c *NoteClient) GetX(ctx context.Context, id int) *Note
- func (c *NoteClient) Hooks() []Hook
- func (c *NoteClient) Intercept(interceptors ...Interceptor)
- func (c *NoteClient) Interceptors() []Interceptor
- func (c *NoteClient) MapCreateBulk(slice any, setFunc func(*NoteCreate, int)) *NoteCreateBulk
- func (c *NoteClient) Query() *NoteQuery
- func (c *NoteClient) QueryLikes(n *Note) *NoteLikeQuery
- func (c *NoteClient) QueryOwner(n *Note) *UserQuery
- func (c *NoteClient) QueryReposts(n *Note) *NoteRepostQuery
- func (c *NoteClient) Update() *NoteUpdate
- func (c *NoteClient) UpdateOne(n *Note) *NoteUpdateOne
- func (c *NoteClient) UpdateOneID(id int) *NoteUpdateOne
- func (c *NoteClient) Use(hooks ...Hook)
- type NoteCreate
- func (nc *NoteCreate) AddLikeIDs(ids ...int) *NoteCreate
- func (nc *NoteCreate) AddLikes(n ...*NoteLike) *NoteCreate
- func (nc *NoteCreate) AddRepostIDs(ids ...int) *NoteCreate
- func (nc *NoteCreate) AddReposts(n ...*NoteRepost) *NoteCreate
- func (nc *NoteCreate) Exec(ctx context.Context) error
- func (nc *NoteCreate) ExecX(ctx context.Context)
- func (nc *NoteCreate) Mutation() *NoteMutation
- func (nc *NoteCreate) Save(ctx context.Context) (*Note, error)
- func (nc *NoteCreate) SaveX(ctx context.Context) *Note
- func (nc *NoteCreate) SetAiCurriculum(s string) *NoteCreate
- func (nc *NoteCreate) SetAiProcessing(b bool) *NoteCreate
- func (nc *NoteCreate) SetContent(s string) *NoteCreate
- func (nc *NoteCreate) SetCreatedAt(t time.Time) *NoteCreate
- func (nc *NoteCreate) SetDescription(s string) *NoteCreate
- func (nc *NoteCreate) SetNillableAiCurriculum(s *string) *NoteCreate
- func (nc *NoteCreate) SetNillableAiProcessing(b *bool) *NoteCreate
- func (nc *NoteCreate) SetNillableContent(s *string) *NoteCreate
- func (nc *NoteCreate) SetNillableCreatedAt(t *time.Time) *NoteCreate
- func (nc *NoteCreate) SetNillableDescription(s *string) *NoteCreate
- func (nc *NoteCreate) SetNillablePermissionLevel(nl *note.PermissionLevel) *NoteCreate
- func (nc *NoteCreate) SetNillableShareToken(s *string) *NoteCreate
- func (nc *NoteCreate) SetNillableUpdatedAt(t *time.Time) *NoteCreate
- func (nc *NoteCreate) SetNillableVisibility(n *note.Visibility) *NoteCreate
- func (nc *NoteCreate) SetOwner(u *User) *NoteCreate
- func (nc *NoteCreate) SetOwnerID(id int) *NoteCreate
- func (nc *NoteCreate) SetPermissionLevel(nl note.PermissionLevel) *NoteCreate
- func (nc *NoteCreate) SetResources(t []types.Resource) *NoteCreate
- func (nc *NoteCreate) SetShareToken(s string) *NoteCreate
- func (nc *NoteCreate) SetTitle(s string) *NoteCreate
- func (nc *NoteCreate) SetUpdatedAt(t time.Time) *NoteCreate
- func (nc *NoteCreate) SetVisibility(n note.Visibility) *NoteCreate
- type NoteCreateBulk
- type NoteDelete
- type NoteDeleteOne
- type NoteEdges
- type NoteGroupBy
- func (ngb *NoteGroupBy) Aggregate(fns ...AggregateFunc) *NoteGroupBy
- func (s *NoteGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *NoteGroupBy) BoolX(ctx context.Context) bool
- func (s *NoteGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *NoteGroupBy) BoolsX(ctx context.Context) []bool
- func (s *NoteGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *NoteGroupBy) Float64X(ctx context.Context) float64
- func (s *NoteGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *NoteGroupBy) Float64sX(ctx context.Context) []float64
- func (s *NoteGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *NoteGroupBy) IntX(ctx context.Context) int
- func (s *NoteGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *NoteGroupBy) IntsX(ctx context.Context) []int
- func (ngb *NoteGroupBy) Scan(ctx context.Context, v any) error
- func (s *NoteGroupBy) ScanX(ctx context.Context, v any)
- func (s *NoteGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *NoteGroupBy) StringX(ctx context.Context) string
- func (s *NoteGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *NoteGroupBy) StringsX(ctx context.Context) []string
- type NoteLike
- type NoteLikeClient
- func (c *NoteLikeClient) Create() *NoteLikeCreate
- func (c *NoteLikeClient) CreateBulk(builders ...*NoteLikeCreate) *NoteLikeCreateBulk
- func (c *NoteLikeClient) Delete() *NoteLikeDelete
- func (c *NoteLikeClient) DeleteOne(nl *NoteLike) *NoteLikeDeleteOne
- func (c *NoteLikeClient) DeleteOneID(id int) *NoteLikeDeleteOne
- func (c *NoteLikeClient) Get(ctx context.Context, id int) (*NoteLike, error)
- func (c *NoteLikeClient) GetX(ctx context.Context, id int) *NoteLike
- func (c *NoteLikeClient) Hooks() []Hook
- func (c *NoteLikeClient) Intercept(interceptors ...Interceptor)
- func (c *NoteLikeClient) Interceptors() []Interceptor
- func (c *NoteLikeClient) MapCreateBulk(slice any, setFunc func(*NoteLikeCreate, int)) *NoteLikeCreateBulk
- func (c *NoteLikeClient) Query() *NoteLikeQuery
- func (c *NoteLikeClient) QueryNote(nl *NoteLike) *NoteQuery
- func (c *NoteLikeClient) QueryUser(nl *NoteLike) *UserQuery
- func (c *NoteLikeClient) Update() *NoteLikeUpdate
- func (c *NoteLikeClient) UpdateOne(nl *NoteLike) *NoteLikeUpdateOne
- func (c *NoteLikeClient) UpdateOneID(id int) *NoteLikeUpdateOne
- func (c *NoteLikeClient) Use(hooks ...Hook)
- type NoteLikeCreate
- func (nlc *NoteLikeCreate) Exec(ctx context.Context) error
- func (nlc *NoteLikeCreate) ExecX(ctx context.Context)
- func (nlc *NoteLikeCreate) Mutation() *NoteLikeMutation
- func (nlc *NoteLikeCreate) Save(ctx context.Context) (*NoteLike, error)
- func (nlc *NoteLikeCreate) SaveX(ctx context.Context) *NoteLike
- func (nlc *NoteLikeCreate) SetCreatedAt(t time.Time) *NoteLikeCreate
- func (nlc *NoteLikeCreate) SetNillableCreatedAt(t *time.Time) *NoteLikeCreate
- func (nlc *NoteLikeCreate) SetNote(n *Note) *NoteLikeCreate
- func (nlc *NoteLikeCreate) SetNoteID(id int) *NoteLikeCreate
- func (nlc *NoteLikeCreate) SetUser(u *User) *NoteLikeCreate
- func (nlc *NoteLikeCreate) SetUserID(id int) *NoteLikeCreate
- type NoteLikeCreateBulk
- type NoteLikeDelete
- type NoteLikeDeleteOne
- type NoteLikeEdges
- type NoteLikeGroupBy
- func (nlgb *NoteLikeGroupBy) Aggregate(fns ...AggregateFunc) *NoteLikeGroupBy
- func (s *NoteLikeGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *NoteLikeGroupBy) BoolX(ctx context.Context) bool
- func (s *NoteLikeGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *NoteLikeGroupBy) BoolsX(ctx context.Context) []bool
- func (s *NoteLikeGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *NoteLikeGroupBy) Float64X(ctx context.Context) float64
- func (s *NoteLikeGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *NoteLikeGroupBy) Float64sX(ctx context.Context) []float64
- func (s *NoteLikeGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *NoteLikeGroupBy) IntX(ctx context.Context) int
- func (s *NoteLikeGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *NoteLikeGroupBy) IntsX(ctx context.Context) []int
- func (nlgb *NoteLikeGroupBy) Scan(ctx context.Context, v any) error
- func (s *NoteLikeGroupBy) ScanX(ctx context.Context, v any)
- func (s *NoteLikeGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *NoteLikeGroupBy) StringX(ctx context.Context) string
- func (s *NoteLikeGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *NoteLikeGroupBy) StringsX(ctx context.Context) []string
- type NoteLikeMutation
- func (m *NoteLikeMutation) AddField(name string, value ent.Value) error
- func (m *NoteLikeMutation) AddedEdges() []string
- func (m *NoteLikeMutation) AddedField(name string) (ent.Value, bool)
- func (m *NoteLikeMutation) AddedFields() []string
- func (m *NoteLikeMutation) AddedIDs(name string) []ent.Value
- func (m *NoteLikeMutation) ClearEdge(name string) error
- func (m *NoteLikeMutation) ClearField(name string) error
- func (m *NoteLikeMutation) ClearNote()
- func (m *NoteLikeMutation) ClearUser()
- func (m *NoteLikeMutation) ClearedEdges() []string
- func (m *NoteLikeMutation) ClearedFields() []string
- func (m NoteLikeMutation) Client() *Client
- func (m *NoteLikeMutation) CreatedAt() (r time.Time, exists bool)
- func (m *NoteLikeMutation) EdgeCleared(name string) bool
- func (m *NoteLikeMutation) Field(name string) (ent.Value, bool)
- func (m *NoteLikeMutation) FieldCleared(name string) bool
- func (m *NoteLikeMutation) Fields() []string
- func (m *NoteLikeMutation) ID() (id int, exists bool)
- func (m *NoteLikeMutation) IDs(ctx context.Context) ([]int, error)
- func (m *NoteLikeMutation) NoteCleared() bool
- func (m *NoteLikeMutation) NoteID() (id int, exists bool)
- func (m *NoteLikeMutation) NoteIDs() (ids []int)
- func (m *NoteLikeMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *NoteLikeMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *NoteLikeMutation) Op() Op
- func (m *NoteLikeMutation) RemovedEdges() []string
- func (m *NoteLikeMutation) RemovedIDs(name string) []ent.Value
- func (m *NoteLikeMutation) ResetCreatedAt()
- func (m *NoteLikeMutation) ResetEdge(name string) error
- func (m *NoteLikeMutation) ResetField(name string) error
- func (m *NoteLikeMutation) ResetNote()
- func (m *NoteLikeMutation) ResetUser()
- func (m *NoteLikeMutation) SetCreatedAt(t time.Time)
- func (m *NoteLikeMutation) SetField(name string, value ent.Value) error
- func (m *NoteLikeMutation) SetNoteID(id int)
- func (m *NoteLikeMutation) SetOp(op Op)
- func (m *NoteLikeMutation) SetUserID(id int)
- func (m NoteLikeMutation) Tx() (*Tx, error)
- func (m *NoteLikeMutation) Type() string
- func (m *NoteLikeMutation) UserCleared() bool
- func (m *NoteLikeMutation) UserID() (id int, exists bool)
- func (m *NoteLikeMutation) UserIDs() (ids []int)
- func (m *NoteLikeMutation) Where(ps ...predicate.NoteLike)
- func (m *NoteLikeMutation) WhereP(ps ...func(*sql.Selector))
- type NoteLikeQuery
- func (nlq *NoteLikeQuery) Aggregate(fns ...AggregateFunc) *NoteLikeSelect
- func (nlq *NoteLikeQuery) All(ctx context.Context) ([]*NoteLike, error)
- func (nlq *NoteLikeQuery) AllX(ctx context.Context) []*NoteLike
- func (nlq *NoteLikeQuery) Clone() *NoteLikeQuery
- func (nlq *NoteLikeQuery) Count(ctx context.Context) (int, error)
- func (nlq *NoteLikeQuery) CountX(ctx context.Context) int
- func (nlq *NoteLikeQuery) Exist(ctx context.Context) (bool, error)
- func (nlq *NoteLikeQuery) ExistX(ctx context.Context) bool
- func (nlq *NoteLikeQuery) First(ctx context.Context) (*NoteLike, error)
- func (nlq *NoteLikeQuery) FirstID(ctx context.Context) (id int, err error)
- func (nlq *NoteLikeQuery) FirstIDX(ctx context.Context) int
- func (nlq *NoteLikeQuery) FirstX(ctx context.Context) *NoteLike
- func (nlq *NoteLikeQuery) GroupBy(field string, fields ...string) *NoteLikeGroupBy
- func (nlq *NoteLikeQuery) IDs(ctx context.Context) (ids []int, err error)
- func (nlq *NoteLikeQuery) IDsX(ctx context.Context) []int
- func (nlq *NoteLikeQuery) Limit(limit int) *NoteLikeQuery
- func (nlq *NoteLikeQuery) Offset(offset int) *NoteLikeQuery
- func (nlq *NoteLikeQuery) Only(ctx context.Context) (*NoteLike, error)
- func (nlq *NoteLikeQuery) OnlyID(ctx context.Context) (id int, err error)
- func (nlq *NoteLikeQuery) OnlyIDX(ctx context.Context) int
- func (nlq *NoteLikeQuery) OnlyX(ctx context.Context) *NoteLike
- func (nlq *NoteLikeQuery) Order(o ...notelike.OrderOption) *NoteLikeQuery
- func (nlq *NoteLikeQuery) QueryNote() *NoteQuery
- func (nlq *NoteLikeQuery) QueryUser() *UserQuery
- func (nlq *NoteLikeQuery) Select(fields ...string) *NoteLikeSelect
- func (nlq *NoteLikeQuery) Unique(unique bool) *NoteLikeQuery
- func (nlq *NoteLikeQuery) Where(ps ...predicate.NoteLike) *NoteLikeQuery
- func (nlq *NoteLikeQuery) WithNote(opts ...func(*NoteQuery)) *NoteLikeQuery
- func (nlq *NoteLikeQuery) WithUser(opts ...func(*UserQuery)) *NoteLikeQuery
- type NoteLikeSelect
- func (nls *NoteLikeSelect) Aggregate(fns ...AggregateFunc) *NoteLikeSelect
- func (s *NoteLikeSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *NoteLikeSelect) BoolX(ctx context.Context) bool
- func (s *NoteLikeSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *NoteLikeSelect) BoolsX(ctx context.Context) []bool
- func (s *NoteLikeSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *NoteLikeSelect) Float64X(ctx context.Context) float64
- func (s *NoteLikeSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *NoteLikeSelect) Float64sX(ctx context.Context) []float64
- func (s *NoteLikeSelect) Int(ctx context.Context) (_ int, err error)
- func (s *NoteLikeSelect) IntX(ctx context.Context) int
- func (s *NoteLikeSelect) Ints(ctx context.Context) ([]int, error)
- func (s *NoteLikeSelect) IntsX(ctx context.Context) []int
- func (nls *NoteLikeSelect) Scan(ctx context.Context, v any) error
- func (s *NoteLikeSelect) ScanX(ctx context.Context, v any)
- func (s *NoteLikeSelect) String(ctx context.Context) (_ string, err error)
- func (s *NoteLikeSelect) StringX(ctx context.Context) string
- func (s *NoteLikeSelect) Strings(ctx context.Context) ([]string, error)
- func (s *NoteLikeSelect) StringsX(ctx context.Context) []string
- type NoteLikeUpdate
- func (nlu *NoteLikeUpdate) ClearNote() *NoteLikeUpdate
- func (nlu *NoteLikeUpdate) ClearUser() *NoteLikeUpdate
- func (nlu *NoteLikeUpdate) Exec(ctx context.Context) error
- func (nlu *NoteLikeUpdate) ExecX(ctx context.Context)
- func (nlu *NoteLikeUpdate) Mutation() *NoteLikeMutation
- func (nlu *NoteLikeUpdate) Save(ctx context.Context) (int, error)
- func (nlu *NoteLikeUpdate) SaveX(ctx context.Context) int
- func (nlu *NoteLikeUpdate) SetNote(n *Note) *NoteLikeUpdate
- func (nlu *NoteLikeUpdate) SetNoteID(id int) *NoteLikeUpdate
- func (nlu *NoteLikeUpdate) SetUser(u *User) *NoteLikeUpdate
- func (nlu *NoteLikeUpdate) SetUserID(id int) *NoteLikeUpdate
- func (nlu *NoteLikeUpdate) Where(ps ...predicate.NoteLike) *NoteLikeUpdate
- type NoteLikeUpdateOne
- func (nluo *NoteLikeUpdateOne) ClearNote() *NoteLikeUpdateOne
- func (nluo *NoteLikeUpdateOne) ClearUser() *NoteLikeUpdateOne
- func (nluo *NoteLikeUpdateOne) Exec(ctx context.Context) error
- func (nluo *NoteLikeUpdateOne) ExecX(ctx context.Context)
- func (nluo *NoteLikeUpdateOne) Mutation() *NoteLikeMutation
- func (nluo *NoteLikeUpdateOne) Save(ctx context.Context) (*NoteLike, error)
- func (nluo *NoteLikeUpdateOne) SaveX(ctx context.Context) *NoteLike
- func (nluo *NoteLikeUpdateOne) Select(field string, fields ...string) *NoteLikeUpdateOne
- func (nluo *NoteLikeUpdateOne) SetNote(n *Note) *NoteLikeUpdateOne
- func (nluo *NoteLikeUpdateOne) SetNoteID(id int) *NoteLikeUpdateOne
- func (nluo *NoteLikeUpdateOne) SetUser(u *User) *NoteLikeUpdateOne
- func (nluo *NoteLikeUpdateOne) SetUserID(id int) *NoteLikeUpdateOne
- func (nluo *NoteLikeUpdateOne) Where(ps ...predicate.NoteLike) *NoteLikeUpdateOne
- type NoteLikes
- type NoteMutation
- func (m *NoteMutation) AddField(name string, value ent.Value) error
- func (m *NoteMutation) AddLikeIDs(ids ...int)
- func (m *NoteMutation) AddRepostIDs(ids ...int)
- func (m *NoteMutation) AddedEdges() []string
- func (m *NoteMutation) AddedField(name string) (ent.Value, bool)
- func (m *NoteMutation) AddedFields() []string
- func (m *NoteMutation) AddedIDs(name string) []ent.Value
- func (m *NoteMutation) AiCurriculum() (r string, exists bool)
- func (m *NoteMutation) AiCurriculumCleared() bool
- func (m *NoteMutation) AiProcessing() (r bool, exists bool)
- func (m *NoteMutation) AppendResources(t []types.Resource)
- func (m *NoteMutation) AppendedResources() ([]types.Resource, bool)
- func (m *NoteMutation) ClearAiCurriculum()
- func (m *NoteMutation) ClearContent()
- func (m *NoteMutation) ClearDescription()
- func (m *NoteMutation) ClearEdge(name string) error
- func (m *NoteMutation) ClearField(name string) error
- func (m *NoteMutation) ClearLikes()
- func (m *NoteMutation) ClearOwner()
- func (m *NoteMutation) ClearReposts()
- func (m *NoteMutation) ClearResources()
- func (m *NoteMutation) ClearShareToken()
- func (m *NoteMutation) ClearedEdges() []string
- func (m *NoteMutation) ClearedFields() []string
- func (m NoteMutation) Client() *Client
- func (m *NoteMutation) Content() (r string, exists bool)
- func (m *NoteMutation) ContentCleared() bool
- func (m *NoteMutation) CreatedAt() (r time.Time, exists bool)
- func (m *NoteMutation) Description() (r string, exists bool)
- func (m *NoteMutation) DescriptionCleared() bool
- func (m *NoteMutation) EdgeCleared(name string) bool
- func (m *NoteMutation) Field(name string) (ent.Value, bool)
- func (m *NoteMutation) FieldCleared(name string) bool
- func (m *NoteMutation) Fields() []string
- func (m *NoteMutation) ID() (id int, exists bool)
- func (m *NoteMutation) IDs(ctx context.Context) ([]int, error)
- func (m *NoteMutation) LikesCleared() bool
- func (m *NoteMutation) LikesIDs() (ids []int)
- func (m *NoteMutation) OldAiCurriculum(ctx context.Context) (v string, err error)
- func (m *NoteMutation) OldAiProcessing(ctx context.Context) (v bool, err error)
- func (m *NoteMutation) OldContent(ctx context.Context) (v string, err error)
- func (m *NoteMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *NoteMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *NoteMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *NoteMutation) OldPermissionLevel(ctx context.Context) (v note.PermissionLevel, err error)
- func (m *NoteMutation) OldResources(ctx context.Context) (v []types.Resource, err error)
- func (m *NoteMutation) OldShareToken(ctx context.Context) (v string, err error)
- func (m *NoteMutation) OldTitle(ctx context.Context) (v string, err error)
- func (m *NoteMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *NoteMutation) OldVisibility(ctx context.Context) (v note.Visibility, err error)
- func (m *NoteMutation) Op() Op
- func (m *NoteMutation) OwnerCleared() bool
- func (m *NoteMutation) OwnerID() (id int, exists bool)
- func (m *NoteMutation) OwnerIDs() (ids []int)
- func (m *NoteMutation) PermissionLevel() (r note.PermissionLevel, exists bool)
- func (m *NoteMutation) RemoveLikeIDs(ids ...int)
- func (m *NoteMutation) RemoveRepostIDs(ids ...int)
- func (m *NoteMutation) RemovedEdges() []string
- func (m *NoteMutation) RemovedIDs(name string) []ent.Value
- func (m *NoteMutation) RemovedLikesIDs() (ids []int)
- func (m *NoteMutation) RemovedRepostsIDs() (ids []int)
- func (m *NoteMutation) RepostsCleared() bool
- func (m *NoteMutation) RepostsIDs() (ids []int)
- func (m *NoteMutation) ResetAiCurriculum()
- func (m *NoteMutation) ResetAiProcessing()
- func (m *NoteMutation) ResetContent()
- func (m *NoteMutation) ResetCreatedAt()
- func (m *NoteMutation) ResetDescription()
- func (m *NoteMutation) ResetEdge(name string) error
- func (m *NoteMutation) ResetField(name string) error
- func (m *NoteMutation) ResetLikes()
- func (m *NoteMutation) ResetOwner()
- func (m *NoteMutation) ResetPermissionLevel()
- func (m *NoteMutation) ResetReposts()
- func (m *NoteMutation) ResetResources()
- func (m *NoteMutation) ResetShareToken()
- func (m *NoteMutation) ResetTitle()
- func (m *NoteMutation) ResetUpdatedAt()
- func (m *NoteMutation) ResetVisibility()
- func (m *NoteMutation) Resources() (r []types.Resource, exists bool)
- func (m *NoteMutation) ResourcesCleared() bool
- func (m *NoteMutation) SetAiCurriculum(s string)
- func (m *NoteMutation) SetAiProcessing(b bool)
- func (m *NoteMutation) SetContent(s string)
- func (m *NoteMutation) SetCreatedAt(t time.Time)
- func (m *NoteMutation) SetDescription(s string)
- func (m *NoteMutation) SetField(name string, value ent.Value) error
- func (m *NoteMutation) SetOp(op Op)
- func (m *NoteMutation) SetOwnerID(id int)
- func (m *NoteMutation) SetPermissionLevel(nl note.PermissionLevel)
- func (m *NoteMutation) SetResources(t []types.Resource)
- func (m *NoteMutation) SetShareToken(s string)
- func (m *NoteMutation) SetTitle(s string)
- func (m *NoteMutation) SetUpdatedAt(t time.Time)
- func (m *NoteMutation) SetVisibility(n note.Visibility)
- func (m *NoteMutation) ShareToken() (r string, exists bool)
- func (m *NoteMutation) ShareTokenCleared() bool
- func (m *NoteMutation) Title() (r string, exists bool)
- func (m NoteMutation) Tx() (*Tx, error)
- func (m *NoteMutation) Type() string
- func (m *NoteMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *NoteMutation) Visibility() (r note.Visibility, exists bool)
- func (m *NoteMutation) Where(ps ...predicate.Note)
- func (m *NoteMutation) WhereP(ps ...func(*sql.Selector))
- type NoteQuery
- func (nq *NoteQuery) Aggregate(fns ...AggregateFunc) *NoteSelect
- func (nq *NoteQuery) All(ctx context.Context) ([]*Note, error)
- func (nq *NoteQuery) AllX(ctx context.Context) []*Note
- func (nq *NoteQuery) Clone() *NoteQuery
- func (nq *NoteQuery) Count(ctx context.Context) (int, error)
- func (nq *NoteQuery) CountX(ctx context.Context) int
- func (nq *NoteQuery) Exist(ctx context.Context) (bool, error)
- func (nq *NoteQuery) ExistX(ctx context.Context) bool
- func (nq *NoteQuery) First(ctx context.Context) (*Note, error)
- func (nq *NoteQuery) FirstID(ctx context.Context) (id int, err error)
- func (nq *NoteQuery) FirstIDX(ctx context.Context) int
- func (nq *NoteQuery) FirstX(ctx context.Context) *Note
- func (nq *NoteQuery) GroupBy(field string, fields ...string) *NoteGroupBy
- func (nq *NoteQuery) IDs(ctx context.Context) (ids []int, err error)
- func (nq *NoteQuery) IDsX(ctx context.Context) []int
- func (nq *NoteQuery) Limit(limit int) *NoteQuery
- func (nq *NoteQuery) Offset(offset int) *NoteQuery
- func (nq *NoteQuery) Only(ctx context.Context) (*Note, error)
- func (nq *NoteQuery) OnlyID(ctx context.Context) (id int, err error)
- func (nq *NoteQuery) OnlyIDX(ctx context.Context) int
- func (nq *NoteQuery) OnlyX(ctx context.Context) *Note
- func (nq *NoteQuery) Order(o ...note.OrderOption) *NoteQuery
- func (nq *NoteQuery) QueryLikes() *NoteLikeQuery
- func (nq *NoteQuery) QueryOwner() *UserQuery
- func (nq *NoteQuery) QueryReposts() *NoteRepostQuery
- func (nq *NoteQuery) Select(fields ...string) *NoteSelect
- func (nq *NoteQuery) Unique(unique bool) *NoteQuery
- func (nq *NoteQuery) Where(ps ...predicate.Note) *NoteQuery
- func (nq *NoteQuery) WithLikes(opts ...func(*NoteLikeQuery)) *NoteQuery
- func (nq *NoteQuery) WithOwner(opts ...func(*UserQuery)) *NoteQuery
- func (nq *NoteQuery) WithReposts(opts ...func(*NoteRepostQuery)) *NoteQuery
- type NoteRepost
- type NoteRepostClient
- func (c *NoteRepostClient) Create() *NoteRepostCreate
- func (c *NoteRepostClient) CreateBulk(builders ...*NoteRepostCreate) *NoteRepostCreateBulk
- func (c *NoteRepostClient) Delete() *NoteRepostDelete
- func (c *NoteRepostClient) DeleteOne(nr *NoteRepost) *NoteRepostDeleteOne
- func (c *NoteRepostClient) DeleteOneID(id int) *NoteRepostDeleteOne
- func (c *NoteRepostClient) Get(ctx context.Context, id int) (*NoteRepost, error)
- func (c *NoteRepostClient) GetX(ctx context.Context, id int) *NoteRepost
- func (c *NoteRepostClient) Hooks() []Hook
- func (c *NoteRepostClient) Intercept(interceptors ...Interceptor)
- func (c *NoteRepostClient) Interceptors() []Interceptor
- func (c *NoteRepostClient) MapCreateBulk(slice any, setFunc func(*NoteRepostCreate, int)) *NoteRepostCreateBulk
- func (c *NoteRepostClient) Query() *NoteRepostQuery
- func (c *NoteRepostClient) QueryNote(nr *NoteRepost) *NoteQuery
- func (c *NoteRepostClient) QueryUser(nr *NoteRepost) *UserQuery
- func (c *NoteRepostClient) Update() *NoteRepostUpdate
- func (c *NoteRepostClient) UpdateOne(nr *NoteRepost) *NoteRepostUpdateOne
- func (c *NoteRepostClient) UpdateOneID(id int) *NoteRepostUpdateOne
- func (c *NoteRepostClient) Use(hooks ...Hook)
- type NoteRepostCreate
- func (nrc *NoteRepostCreate) Exec(ctx context.Context) error
- func (nrc *NoteRepostCreate) ExecX(ctx context.Context)
- func (nrc *NoteRepostCreate) Mutation() *NoteRepostMutation
- func (nrc *NoteRepostCreate) Save(ctx context.Context) (*NoteRepost, error)
- func (nrc *NoteRepostCreate) SaveX(ctx context.Context) *NoteRepost
- func (nrc *NoteRepostCreate) SetComment(s string) *NoteRepostCreate
- func (nrc *NoteRepostCreate) SetCreatedAt(t time.Time) *NoteRepostCreate
- func (nrc *NoteRepostCreate) SetNillableComment(s *string) *NoteRepostCreate
- func (nrc *NoteRepostCreate) SetNillableCreatedAt(t *time.Time) *NoteRepostCreate
- func (nrc *NoteRepostCreate) SetNote(n *Note) *NoteRepostCreate
- func (nrc *NoteRepostCreate) SetNoteID(id int) *NoteRepostCreate
- func (nrc *NoteRepostCreate) SetUser(u *User) *NoteRepostCreate
- func (nrc *NoteRepostCreate) SetUserID(id int) *NoteRepostCreate
- type NoteRepostCreateBulk
- type NoteRepostDelete
- type NoteRepostDeleteOne
- type NoteRepostEdges
- type NoteRepostGroupBy
- func (nrgb *NoteRepostGroupBy) Aggregate(fns ...AggregateFunc) *NoteRepostGroupBy
- func (s *NoteRepostGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *NoteRepostGroupBy) BoolX(ctx context.Context) bool
- func (s *NoteRepostGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *NoteRepostGroupBy) BoolsX(ctx context.Context) []bool
- func (s *NoteRepostGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *NoteRepostGroupBy) Float64X(ctx context.Context) float64
- func (s *NoteRepostGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *NoteRepostGroupBy) Float64sX(ctx context.Context) []float64
- func (s *NoteRepostGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *NoteRepostGroupBy) IntX(ctx context.Context) int
- func (s *NoteRepostGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *NoteRepostGroupBy) IntsX(ctx context.Context) []int
- func (nrgb *NoteRepostGroupBy) Scan(ctx context.Context, v any) error
- func (s *NoteRepostGroupBy) ScanX(ctx context.Context, v any)
- func (s *NoteRepostGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *NoteRepostGroupBy) StringX(ctx context.Context) string
- func (s *NoteRepostGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *NoteRepostGroupBy) StringsX(ctx context.Context) []string
- type NoteRepostMutation
- func (m *NoteRepostMutation) AddField(name string, value ent.Value) error
- func (m *NoteRepostMutation) AddedEdges() []string
- func (m *NoteRepostMutation) AddedField(name string) (ent.Value, bool)
- func (m *NoteRepostMutation) AddedFields() []string
- func (m *NoteRepostMutation) AddedIDs(name string) []ent.Value
- func (m *NoteRepostMutation) ClearComment()
- func (m *NoteRepostMutation) ClearEdge(name string) error
- func (m *NoteRepostMutation) ClearField(name string) error
- func (m *NoteRepostMutation) ClearNote()
- func (m *NoteRepostMutation) ClearUser()
- func (m *NoteRepostMutation) ClearedEdges() []string
- func (m *NoteRepostMutation) ClearedFields() []string
- func (m NoteRepostMutation) Client() *Client
- func (m *NoteRepostMutation) Comment() (r string, exists bool)
- func (m *NoteRepostMutation) CommentCleared() bool
- func (m *NoteRepostMutation) CreatedAt() (r time.Time, exists bool)
- func (m *NoteRepostMutation) EdgeCleared(name string) bool
- func (m *NoteRepostMutation) Field(name string) (ent.Value, bool)
- func (m *NoteRepostMutation) FieldCleared(name string) bool
- func (m *NoteRepostMutation) Fields() []string
- func (m *NoteRepostMutation) ID() (id int, exists bool)
- func (m *NoteRepostMutation) IDs(ctx context.Context) ([]int, error)
- func (m *NoteRepostMutation) NoteCleared() bool
- func (m *NoteRepostMutation) NoteID() (id int, exists bool)
- func (m *NoteRepostMutation) NoteIDs() (ids []int)
- func (m *NoteRepostMutation) OldComment(ctx context.Context) (v string, err error)
- func (m *NoteRepostMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *NoteRepostMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *NoteRepostMutation) Op() Op
- func (m *NoteRepostMutation) RemovedEdges() []string
- func (m *NoteRepostMutation) RemovedIDs(name string) []ent.Value
- func (m *NoteRepostMutation) ResetComment()
- func (m *NoteRepostMutation) ResetCreatedAt()
- func (m *NoteRepostMutation) ResetEdge(name string) error
- func (m *NoteRepostMutation) ResetField(name string) error
- func (m *NoteRepostMutation) ResetNote()
- func (m *NoteRepostMutation) ResetUser()
- func (m *NoteRepostMutation) SetComment(s string)
- func (m *NoteRepostMutation) SetCreatedAt(t time.Time)
- func (m *NoteRepostMutation) SetField(name string, value ent.Value) error
- func (m *NoteRepostMutation) SetNoteID(id int)
- func (m *NoteRepostMutation) SetOp(op Op)
- func (m *NoteRepostMutation) SetUserID(id int)
- func (m NoteRepostMutation) Tx() (*Tx, error)
- func (m *NoteRepostMutation) Type() string
- func (m *NoteRepostMutation) UserCleared() bool
- func (m *NoteRepostMutation) UserID() (id int, exists bool)
- func (m *NoteRepostMutation) UserIDs() (ids []int)
- func (m *NoteRepostMutation) Where(ps ...predicate.NoteRepost)
- func (m *NoteRepostMutation) WhereP(ps ...func(*sql.Selector))
- type NoteRepostQuery
- func (nrq *NoteRepostQuery) Aggregate(fns ...AggregateFunc) *NoteRepostSelect
- func (nrq *NoteRepostQuery) All(ctx context.Context) ([]*NoteRepost, error)
- func (nrq *NoteRepostQuery) AllX(ctx context.Context) []*NoteRepost
- func (nrq *NoteRepostQuery) Clone() *NoteRepostQuery
- func (nrq *NoteRepostQuery) Count(ctx context.Context) (int, error)
- func (nrq *NoteRepostQuery) CountX(ctx context.Context) int
- func (nrq *NoteRepostQuery) Exist(ctx context.Context) (bool, error)
- func (nrq *NoteRepostQuery) ExistX(ctx context.Context) bool
- func (nrq *NoteRepostQuery) First(ctx context.Context) (*NoteRepost, error)
- func (nrq *NoteRepostQuery) FirstID(ctx context.Context) (id int, err error)
- func (nrq *NoteRepostQuery) FirstIDX(ctx context.Context) int
- func (nrq *NoteRepostQuery) FirstX(ctx context.Context) *NoteRepost
- func (nrq *NoteRepostQuery) GroupBy(field string, fields ...string) *NoteRepostGroupBy
- func (nrq *NoteRepostQuery) IDs(ctx context.Context) (ids []int, err error)
- func (nrq *NoteRepostQuery) IDsX(ctx context.Context) []int
- func (nrq *NoteRepostQuery) Limit(limit int) *NoteRepostQuery
- func (nrq *NoteRepostQuery) Offset(offset int) *NoteRepostQuery
- func (nrq *NoteRepostQuery) Only(ctx context.Context) (*NoteRepost, error)
- func (nrq *NoteRepostQuery) OnlyID(ctx context.Context) (id int, err error)
- func (nrq *NoteRepostQuery) OnlyIDX(ctx context.Context) int
- func (nrq *NoteRepostQuery) OnlyX(ctx context.Context) *NoteRepost
- func (nrq *NoteRepostQuery) Order(o ...noterepost.OrderOption) *NoteRepostQuery
- func (nrq *NoteRepostQuery) QueryNote() *NoteQuery
- func (nrq *NoteRepostQuery) QueryUser() *UserQuery
- func (nrq *NoteRepostQuery) Select(fields ...string) *NoteRepostSelect
- func (nrq *NoteRepostQuery) Unique(unique bool) *NoteRepostQuery
- func (nrq *NoteRepostQuery) Where(ps ...predicate.NoteRepost) *NoteRepostQuery
- func (nrq *NoteRepostQuery) WithNote(opts ...func(*NoteQuery)) *NoteRepostQuery
- func (nrq *NoteRepostQuery) WithUser(opts ...func(*UserQuery)) *NoteRepostQuery
- type NoteRepostSelect
- func (nrs *NoteRepostSelect) Aggregate(fns ...AggregateFunc) *NoteRepostSelect
- func (s *NoteRepostSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *NoteRepostSelect) BoolX(ctx context.Context) bool
- func (s *NoteRepostSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *NoteRepostSelect) BoolsX(ctx context.Context) []bool
- func (s *NoteRepostSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *NoteRepostSelect) Float64X(ctx context.Context) float64
- func (s *NoteRepostSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *NoteRepostSelect) Float64sX(ctx context.Context) []float64
- func (s *NoteRepostSelect) Int(ctx context.Context) (_ int, err error)
- func (s *NoteRepostSelect) IntX(ctx context.Context) int
- func (s *NoteRepostSelect) Ints(ctx context.Context) ([]int, error)
- func (s *NoteRepostSelect) IntsX(ctx context.Context) []int
- func (nrs *NoteRepostSelect) Scan(ctx context.Context, v any) error
- func (s *NoteRepostSelect) ScanX(ctx context.Context, v any)
- func (s *NoteRepostSelect) String(ctx context.Context) (_ string, err error)
- func (s *NoteRepostSelect) StringX(ctx context.Context) string
- func (s *NoteRepostSelect) Strings(ctx context.Context) ([]string, error)
- func (s *NoteRepostSelect) StringsX(ctx context.Context) []string
- type NoteRepostUpdate
- func (nru *NoteRepostUpdate) ClearComment() *NoteRepostUpdate
- func (nru *NoteRepostUpdate) ClearNote() *NoteRepostUpdate
- func (nru *NoteRepostUpdate) ClearUser() *NoteRepostUpdate
- func (nru *NoteRepostUpdate) Exec(ctx context.Context) error
- func (nru *NoteRepostUpdate) ExecX(ctx context.Context)
- func (nru *NoteRepostUpdate) Mutation() *NoteRepostMutation
- func (nru *NoteRepostUpdate) Save(ctx context.Context) (int, error)
- func (nru *NoteRepostUpdate) SaveX(ctx context.Context) int
- func (nru *NoteRepostUpdate) SetComment(s string) *NoteRepostUpdate
- func (nru *NoteRepostUpdate) SetNillableComment(s *string) *NoteRepostUpdate
- func (nru *NoteRepostUpdate) SetNote(n *Note) *NoteRepostUpdate
- func (nru *NoteRepostUpdate) SetNoteID(id int) *NoteRepostUpdate
- func (nru *NoteRepostUpdate) SetUser(u *User) *NoteRepostUpdate
- func (nru *NoteRepostUpdate) SetUserID(id int) *NoteRepostUpdate
- func (nru *NoteRepostUpdate) Where(ps ...predicate.NoteRepost) *NoteRepostUpdate
- type NoteRepostUpdateOne
- func (nruo *NoteRepostUpdateOne) ClearComment() *NoteRepostUpdateOne
- func (nruo *NoteRepostUpdateOne) ClearNote() *NoteRepostUpdateOne
- func (nruo *NoteRepostUpdateOne) ClearUser() *NoteRepostUpdateOne
- func (nruo *NoteRepostUpdateOne) Exec(ctx context.Context) error
- func (nruo *NoteRepostUpdateOne) ExecX(ctx context.Context)
- func (nruo *NoteRepostUpdateOne) Mutation() *NoteRepostMutation
- func (nruo *NoteRepostUpdateOne) Save(ctx context.Context) (*NoteRepost, error)
- func (nruo *NoteRepostUpdateOne) SaveX(ctx context.Context) *NoteRepost
- func (nruo *NoteRepostUpdateOne) Select(field string, fields ...string) *NoteRepostUpdateOne
- func (nruo *NoteRepostUpdateOne) SetComment(s string) *NoteRepostUpdateOne
- func (nruo *NoteRepostUpdateOne) SetNillableComment(s *string) *NoteRepostUpdateOne
- func (nruo *NoteRepostUpdateOne) SetNote(n *Note) *NoteRepostUpdateOne
- func (nruo *NoteRepostUpdateOne) SetNoteID(id int) *NoteRepostUpdateOne
- func (nruo *NoteRepostUpdateOne) SetUser(u *User) *NoteRepostUpdateOne
- func (nruo *NoteRepostUpdateOne) SetUserID(id int) *NoteRepostUpdateOne
- func (nruo *NoteRepostUpdateOne) Where(ps ...predicate.NoteRepost) *NoteRepostUpdateOne
- type NoteReposts
- type NoteSelect
- func (ns *NoteSelect) Aggregate(fns ...AggregateFunc) *NoteSelect
- func (s *NoteSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *NoteSelect) BoolX(ctx context.Context) bool
- func (s *NoteSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *NoteSelect) BoolsX(ctx context.Context) []bool
- func (s *NoteSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *NoteSelect) Float64X(ctx context.Context) float64
- func (s *NoteSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *NoteSelect) Float64sX(ctx context.Context) []float64
- func (s *NoteSelect) Int(ctx context.Context) (_ int, err error)
- func (s *NoteSelect) IntX(ctx context.Context) int
- func (s *NoteSelect) Ints(ctx context.Context) ([]int, error)
- func (s *NoteSelect) IntsX(ctx context.Context) []int
- func (ns *NoteSelect) Scan(ctx context.Context, v any) error
- func (s *NoteSelect) ScanX(ctx context.Context, v any)
- func (s *NoteSelect) String(ctx context.Context) (_ string, err error)
- func (s *NoteSelect) StringX(ctx context.Context) string
- func (s *NoteSelect) Strings(ctx context.Context) ([]string, error)
- func (s *NoteSelect) StringsX(ctx context.Context) []string
- type NoteUpdate
- func (nu *NoteUpdate) AddLikeIDs(ids ...int) *NoteUpdate
- func (nu *NoteUpdate) AddLikes(n ...*NoteLike) *NoteUpdate
- func (nu *NoteUpdate) AddRepostIDs(ids ...int) *NoteUpdate
- func (nu *NoteUpdate) AddReposts(n ...*NoteRepost) *NoteUpdate
- func (nu *NoteUpdate) AppendResources(t []types.Resource) *NoteUpdate
- func (nu *NoteUpdate) ClearAiCurriculum() *NoteUpdate
- func (nu *NoteUpdate) ClearContent() *NoteUpdate
- func (nu *NoteUpdate) ClearDescription() *NoteUpdate
- func (nu *NoteUpdate) ClearLikes() *NoteUpdate
- func (nu *NoteUpdate) ClearOwner() *NoteUpdate
- func (nu *NoteUpdate) ClearReposts() *NoteUpdate
- func (nu *NoteUpdate) ClearResources() *NoteUpdate
- func (nu *NoteUpdate) ClearShareToken() *NoteUpdate
- func (nu *NoteUpdate) Exec(ctx context.Context) error
- func (nu *NoteUpdate) ExecX(ctx context.Context)
- func (nu *NoteUpdate) Mutation() *NoteMutation
- func (nu *NoteUpdate) RemoveLikeIDs(ids ...int) *NoteUpdate
- func (nu *NoteUpdate) RemoveLikes(n ...*NoteLike) *NoteUpdate
- func (nu *NoteUpdate) RemoveRepostIDs(ids ...int) *NoteUpdate
- func (nu *NoteUpdate) RemoveReposts(n ...*NoteRepost) *NoteUpdate
- func (nu *NoteUpdate) Save(ctx context.Context) (int, error)
- func (nu *NoteUpdate) SaveX(ctx context.Context) int
- func (nu *NoteUpdate) SetAiCurriculum(s string) *NoteUpdate
- func (nu *NoteUpdate) SetAiProcessing(b bool) *NoteUpdate
- func (nu *NoteUpdate) SetContent(s string) *NoteUpdate
- func (nu *NoteUpdate) SetDescription(s string) *NoteUpdate
- func (nu *NoteUpdate) SetNillableAiCurriculum(s *string) *NoteUpdate
- func (nu *NoteUpdate) SetNillableAiProcessing(b *bool) *NoteUpdate
- func (nu *NoteUpdate) SetNillableContent(s *string) *NoteUpdate
- func (nu *NoteUpdate) SetNillableDescription(s *string) *NoteUpdate
- func (nu *NoteUpdate) SetNillablePermissionLevel(nl *note.PermissionLevel) *NoteUpdate
- func (nu *NoteUpdate) SetNillableShareToken(s *string) *NoteUpdate
- func (nu *NoteUpdate) SetNillableTitle(s *string) *NoteUpdate
- func (nu *NoteUpdate) SetNillableVisibility(n *note.Visibility) *NoteUpdate
- func (nu *NoteUpdate) SetOwner(u *User) *NoteUpdate
- func (nu *NoteUpdate) SetOwnerID(id int) *NoteUpdate
- func (nu *NoteUpdate) SetPermissionLevel(nl note.PermissionLevel) *NoteUpdate
- func (nu *NoteUpdate) SetResources(t []types.Resource) *NoteUpdate
- func (nu *NoteUpdate) SetShareToken(s string) *NoteUpdate
- func (nu *NoteUpdate) SetTitle(s string) *NoteUpdate
- func (nu *NoteUpdate) SetUpdatedAt(t time.Time) *NoteUpdate
- func (nu *NoteUpdate) SetVisibility(n note.Visibility) *NoteUpdate
- func (nu *NoteUpdate) Where(ps ...predicate.Note) *NoteUpdate
- type NoteUpdateOne
- func (nuo *NoteUpdateOne) AddLikeIDs(ids ...int) *NoteUpdateOne
- func (nuo *NoteUpdateOne) AddLikes(n ...*NoteLike) *NoteUpdateOne
- func (nuo *NoteUpdateOne) AddRepostIDs(ids ...int) *NoteUpdateOne
- func (nuo *NoteUpdateOne) AddReposts(n ...*NoteRepost) *NoteUpdateOne
- func (nuo *NoteUpdateOne) AppendResources(t []types.Resource) *NoteUpdateOne
- func (nuo *NoteUpdateOne) ClearAiCurriculum() *NoteUpdateOne
- func (nuo *NoteUpdateOne) ClearContent() *NoteUpdateOne
- func (nuo *NoteUpdateOne) ClearDescription() *NoteUpdateOne
- func (nuo *NoteUpdateOne) ClearLikes() *NoteUpdateOne
- func (nuo *NoteUpdateOne) ClearOwner() *NoteUpdateOne
- func (nuo *NoteUpdateOne) ClearReposts() *NoteUpdateOne
- func (nuo *NoteUpdateOne) ClearResources() *NoteUpdateOne
- func (nuo *NoteUpdateOne) ClearShareToken() *NoteUpdateOne
- func (nuo *NoteUpdateOne) Exec(ctx context.Context) error
- func (nuo *NoteUpdateOne) ExecX(ctx context.Context)
- func (nuo *NoteUpdateOne) Mutation() *NoteMutation
- func (nuo *NoteUpdateOne) RemoveLikeIDs(ids ...int) *NoteUpdateOne
- func (nuo *NoteUpdateOne) RemoveLikes(n ...*NoteLike) *NoteUpdateOne
- func (nuo *NoteUpdateOne) RemoveRepostIDs(ids ...int) *NoteUpdateOne
- func (nuo *NoteUpdateOne) RemoveReposts(n ...*NoteRepost) *NoteUpdateOne
- func (nuo *NoteUpdateOne) Save(ctx context.Context) (*Note, error)
- func (nuo *NoteUpdateOne) SaveX(ctx context.Context) *Note
- func (nuo *NoteUpdateOne) Select(field string, fields ...string) *NoteUpdateOne
- func (nuo *NoteUpdateOne) SetAiCurriculum(s string) *NoteUpdateOne
- func (nuo *NoteUpdateOne) SetAiProcessing(b bool) *NoteUpdateOne
- func (nuo *NoteUpdateOne) SetContent(s string) *NoteUpdateOne
- func (nuo *NoteUpdateOne) SetDescription(s string) *NoteUpdateOne
- func (nuo *NoteUpdateOne) SetNillableAiCurriculum(s *string) *NoteUpdateOne
- func (nuo *NoteUpdateOne) SetNillableAiProcessing(b *bool) *NoteUpdateOne
- func (nuo *NoteUpdateOne) SetNillableContent(s *string) *NoteUpdateOne
- func (nuo *NoteUpdateOne) SetNillableDescription(s *string) *NoteUpdateOne
- func (nuo *NoteUpdateOne) SetNillablePermissionLevel(nl *note.PermissionLevel) *NoteUpdateOne
- func (nuo *NoteUpdateOne) SetNillableShareToken(s *string) *NoteUpdateOne
- func (nuo *NoteUpdateOne) SetNillableTitle(s *string) *NoteUpdateOne
- func (nuo *NoteUpdateOne) SetNillableVisibility(n *note.Visibility) *NoteUpdateOne
- func (nuo *NoteUpdateOne) SetOwner(u *User) *NoteUpdateOne
- func (nuo *NoteUpdateOne) SetOwnerID(id int) *NoteUpdateOne
- func (nuo *NoteUpdateOne) SetPermissionLevel(nl note.PermissionLevel) *NoteUpdateOne
- func (nuo *NoteUpdateOne) SetResources(t []types.Resource) *NoteUpdateOne
- func (nuo *NoteUpdateOne) SetShareToken(s string) *NoteUpdateOne
- func (nuo *NoteUpdateOne) SetTitle(s string) *NoteUpdateOne
- func (nuo *NoteUpdateOne) SetUpdatedAt(t time.Time) *NoteUpdateOne
- func (nuo *NoteUpdateOne) SetVisibility(n note.Visibility) *NoteUpdateOne
- func (nuo *NoteUpdateOne) Where(ps ...predicate.Note) *NoteUpdateOne
- type Notes
- type Op
- type Option
- type OrderFunc
- type PasswordToken
- type PasswordTokenClient
- func (c *PasswordTokenClient) Create() *PasswordTokenCreate
- func (c *PasswordTokenClient) CreateBulk(builders ...*PasswordTokenCreate) *PasswordTokenCreateBulk
- func (c *PasswordTokenClient) Delete() *PasswordTokenDelete
- func (c *PasswordTokenClient) DeleteOne(pt *PasswordToken) *PasswordTokenDeleteOne
- func (c *PasswordTokenClient) DeleteOneID(id int) *PasswordTokenDeleteOne
- func (c *PasswordTokenClient) Get(ctx context.Context, id int) (*PasswordToken, error)
- func (c *PasswordTokenClient) GetX(ctx context.Context, id int) *PasswordToken
- func (c *PasswordTokenClient) Hooks() []Hook
- func (c *PasswordTokenClient) Intercept(interceptors ...Interceptor)
- func (c *PasswordTokenClient) Interceptors() []Interceptor
- func (c *PasswordTokenClient) MapCreateBulk(slice any, setFunc func(*PasswordTokenCreate, int)) *PasswordTokenCreateBulk
- func (c *PasswordTokenClient) Query() *PasswordTokenQuery
- func (c *PasswordTokenClient) QueryUser(pt *PasswordToken) *UserQuery
- func (c *PasswordTokenClient) Update() *PasswordTokenUpdate
- func (c *PasswordTokenClient) UpdateOne(pt *PasswordToken) *PasswordTokenUpdateOne
- func (c *PasswordTokenClient) UpdateOneID(id int) *PasswordTokenUpdateOne
- func (c *PasswordTokenClient) Use(hooks ...Hook)
- type PasswordTokenCreate
- func (ptc *PasswordTokenCreate) Exec(ctx context.Context) error
- func (ptc *PasswordTokenCreate) ExecX(ctx context.Context)
- func (ptc *PasswordTokenCreate) Mutation() *PasswordTokenMutation
- func (ptc *PasswordTokenCreate) Save(ctx context.Context) (*PasswordToken, error)
- func (ptc *PasswordTokenCreate) SaveX(ctx context.Context) *PasswordToken
- func (ptc *PasswordTokenCreate) SetCreatedAt(t time.Time) *PasswordTokenCreate
- func (ptc *PasswordTokenCreate) SetNillableCreatedAt(t *time.Time) *PasswordTokenCreate
- func (ptc *PasswordTokenCreate) SetToken(s string) *PasswordTokenCreate
- func (ptc *PasswordTokenCreate) SetUser(u *User) *PasswordTokenCreate
- func (ptc *PasswordTokenCreate) SetUserID(i int) *PasswordTokenCreate
- type PasswordTokenCreateBulk
- func (ptcb *PasswordTokenCreateBulk) Exec(ctx context.Context) error
- func (ptcb *PasswordTokenCreateBulk) ExecX(ctx context.Context)
- func (ptcb *PasswordTokenCreateBulk) Save(ctx context.Context) ([]*PasswordToken, error)
- func (ptcb *PasswordTokenCreateBulk) SaveX(ctx context.Context) []*PasswordToken
- type PasswordTokenDelete
- type PasswordTokenDeleteOne
- type PasswordTokenEdges
- type PasswordTokenGroupBy
- func (ptgb *PasswordTokenGroupBy) Aggregate(fns ...AggregateFunc) *PasswordTokenGroupBy
- func (s *PasswordTokenGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *PasswordTokenGroupBy) BoolX(ctx context.Context) bool
- func (s *PasswordTokenGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *PasswordTokenGroupBy) BoolsX(ctx context.Context) []bool
- func (s *PasswordTokenGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *PasswordTokenGroupBy) Float64X(ctx context.Context) float64
- func (s *PasswordTokenGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *PasswordTokenGroupBy) Float64sX(ctx context.Context) []float64
- func (s *PasswordTokenGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *PasswordTokenGroupBy) IntX(ctx context.Context) int
- func (s *PasswordTokenGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *PasswordTokenGroupBy) IntsX(ctx context.Context) []int
- func (ptgb *PasswordTokenGroupBy) Scan(ctx context.Context, v any) error
- func (s *PasswordTokenGroupBy) ScanX(ctx context.Context, v any)
- func (s *PasswordTokenGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *PasswordTokenGroupBy) StringX(ctx context.Context) string
- func (s *PasswordTokenGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *PasswordTokenGroupBy) StringsX(ctx context.Context) []string
- type PasswordTokenMutation
- func (m *PasswordTokenMutation) AddField(name string, value ent.Value) error
- func (m *PasswordTokenMutation) AddedEdges() []string
- func (m *PasswordTokenMutation) AddedField(name string) (ent.Value, bool)
- func (m *PasswordTokenMutation) AddedFields() []string
- func (m *PasswordTokenMutation) AddedIDs(name string) []ent.Value
- func (m *PasswordTokenMutation) ClearEdge(name string) error
- func (m *PasswordTokenMutation) ClearField(name string) error
- func (m *PasswordTokenMutation) ClearUser()
- func (m *PasswordTokenMutation) ClearedEdges() []string
- func (m *PasswordTokenMutation) ClearedFields() []string
- func (m PasswordTokenMutation) Client() *Client
- func (m *PasswordTokenMutation) CreatedAt() (r time.Time, exists bool)
- func (m *PasswordTokenMutation) EdgeCleared(name string) bool
- func (m *PasswordTokenMutation) Field(name string) (ent.Value, bool)
- func (m *PasswordTokenMutation) FieldCleared(name string) bool
- func (m *PasswordTokenMutation) Fields() []string
- func (m *PasswordTokenMutation) ID() (id int, exists bool)
- func (m *PasswordTokenMutation) IDs(ctx context.Context) ([]int, error)
- func (m *PasswordTokenMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *PasswordTokenMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *PasswordTokenMutation) OldToken(ctx context.Context) (v string, err error)
- func (m *PasswordTokenMutation) OldUserID(ctx context.Context) (v int, err error)
- func (m *PasswordTokenMutation) Op() Op
- func (m *PasswordTokenMutation) RemovedEdges() []string
- func (m *PasswordTokenMutation) RemovedIDs(name string) []ent.Value
- func (m *PasswordTokenMutation) ResetCreatedAt()
- func (m *PasswordTokenMutation) ResetEdge(name string) error
- func (m *PasswordTokenMutation) ResetField(name string) error
- func (m *PasswordTokenMutation) ResetToken()
- func (m *PasswordTokenMutation) ResetUser()
- func (m *PasswordTokenMutation) ResetUserID()
- func (m *PasswordTokenMutation) SetCreatedAt(t time.Time)
- func (m *PasswordTokenMutation) SetField(name string, value ent.Value) error
- func (m *PasswordTokenMutation) SetOp(op Op)
- func (m *PasswordTokenMutation) SetToken(s string)
- func (m *PasswordTokenMutation) SetUserID(i int)
- func (m *PasswordTokenMutation) Token() (r string, exists bool)
- func (m PasswordTokenMutation) Tx() (*Tx, error)
- func (m *PasswordTokenMutation) Type() string
- func (m *PasswordTokenMutation) UserCleared() bool
- func (m *PasswordTokenMutation) UserID() (r int, exists bool)
- func (m *PasswordTokenMutation) UserIDs() (ids []int)
- func (m *PasswordTokenMutation) Where(ps ...predicate.PasswordToken)
- func (m *PasswordTokenMutation) WhereP(ps ...func(*sql.Selector))
- type PasswordTokenQuery
- func (ptq *PasswordTokenQuery) Aggregate(fns ...AggregateFunc) *PasswordTokenSelect
- func (ptq *PasswordTokenQuery) All(ctx context.Context) ([]*PasswordToken, error)
- func (ptq *PasswordTokenQuery) AllX(ctx context.Context) []*PasswordToken
- func (ptq *PasswordTokenQuery) Clone() *PasswordTokenQuery
- func (ptq *PasswordTokenQuery) Count(ctx context.Context) (int, error)
- func (ptq *PasswordTokenQuery) CountX(ctx context.Context) int
- func (ptq *PasswordTokenQuery) Exist(ctx context.Context) (bool, error)
- func (ptq *PasswordTokenQuery) ExistX(ctx context.Context) bool
- func (ptq *PasswordTokenQuery) First(ctx context.Context) (*PasswordToken, error)
- func (ptq *PasswordTokenQuery) FirstID(ctx context.Context) (id int, err error)
- func (ptq *PasswordTokenQuery) FirstIDX(ctx context.Context) int
- func (ptq *PasswordTokenQuery) FirstX(ctx context.Context) *PasswordToken
- func (ptq *PasswordTokenQuery) GroupBy(field string, fields ...string) *PasswordTokenGroupBy
- func (ptq *PasswordTokenQuery) IDs(ctx context.Context) (ids []int, err error)
- func (ptq *PasswordTokenQuery) IDsX(ctx context.Context) []int
- func (ptq *PasswordTokenQuery) Limit(limit int) *PasswordTokenQuery
- func (ptq *PasswordTokenQuery) Offset(offset int) *PasswordTokenQuery
- func (ptq *PasswordTokenQuery) Only(ctx context.Context) (*PasswordToken, error)
- func (ptq *PasswordTokenQuery) OnlyID(ctx context.Context) (id int, err error)
- func (ptq *PasswordTokenQuery) OnlyIDX(ctx context.Context) int
- func (ptq *PasswordTokenQuery) OnlyX(ctx context.Context) *PasswordToken
- func (ptq *PasswordTokenQuery) Order(o ...passwordtoken.OrderOption) *PasswordTokenQuery
- func (ptq *PasswordTokenQuery) QueryUser() *UserQuery
- func (ptq *PasswordTokenQuery) Select(fields ...string) *PasswordTokenSelect
- func (ptq *PasswordTokenQuery) Unique(unique bool) *PasswordTokenQuery
- func (ptq *PasswordTokenQuery) Where(ps ...predicate.PasswordToken) *PasswordTokenQuery
- func (ptq *PasswordTokenQuery) WithUser(opts ...func(*UserQuery)) *PasswordTokenQuery
- type PasswordTokenSelect
- func (pts *PasswordTokenSelect) Aggregate(fns ...AggregateFunc) *PasswordTokenSelect
- func (s *PasswordTokenSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *PasswordTokenSelect) BoolX(ctx context.Context) bool
- func (s *PasswordTokenSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *PasswordTokenSelect) BoolsX(ctx context.Context) []bool
- func (s *PasswordTokenSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *PasswordTokenSelect) Float64X(ctx context.Context) float64
- func (s *PasswordTokenSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *PasswordTokenSelect) Float64sX(ctx context.Context) []float64
- func (s *PasswordTokenSelect) Int(ctx context.Context) (_ int, err error)
- func (s *PasswordTokenSelect) IntX(ctx context.Context) int
- func (s *PasswordTokenSelect) Ints(ctx context.Context) ([]int, error)
- func (s *PasswordTokenSelect) IntsX(ctx context.Context) []int
- func (pts *PasswordTokenSelect) Scan(ctx context.Context, v any) error
- func (s *PasswordTokenSelect) ScanX(ctx context.Context, v any)
- func (s *PasswordTokenSelect) String(ctx context.Context) (_ string, err error)
- func (s *PasswordTokenSelect) StringX(ctx context.Context) string
- func (s *PasswordTokenSelect) Strings(ctx context.Context) ([]string, error)
- func (s *PasswordTokenSelect) StringsX(ctx context.Context) []string
- type PasswordTokenUpdate
- func (ptu *PasswordTokenUpdate) ClearUser() *PasswordTokenUpdate
- func (ptu *PasswordTokenUpdate) Exec(ctx context.Context) error
- func (ptu *PasswordTokenUpdate) ExecX(ctx context.Context)
- func (ptu *PasswordTokenUpdate) Mutation() *PasswordTokenMutation
- func (ptu *PasswordTokenUpdate) Save(ctx context.Context) (int, error)
- func (ptu *PasswordTokenUpdate) SaveX(ctx context.Context) int
- func (ptu *PasswordTokenUpdate) SetCreatedAt(t time.Time) *PasswordTokenUpdate
- func (ptu *PasswordTokenUpdate) SetNillableCreatedAt(t *time.Time) *PasswordTokenUpdate
- func (ptu *PasswordTokenUpdate) SetNillableToken(s *string) *PasswordTokenUpdate
- func (ptu *PasswordTokenUpdate) SetNillableUserID(i *int) *PasswordTokenUpdate
- func (ptu *PasswordTokenUpdate) SetToken(s string) *PasswordTokenUpdate
- func (ptu *PasswordTokenUpdate) SetUser(u *User) *PasswordTokenUpdate
- func (ptu *PasswordTokenUpdate) SetUserID(i int) *PasswordTokenUpdate
- func (ptu *PasswordTokenUpdate) Where(ps ...predicate.PasswordToken) *PasswordTokenUpdate
- type PasswordTokenUpdateOne
- func (ptuo *PasswordTokenUpdateOne) ClearUser() *PasswordTokenUpdateOne
- func (ptuo *PasswordTokenUpdateOne) Exec(ctx context.Context) error
- func (ptuo *PasswordTokenUpdateOne) ExecX(ctx context.Context)
- func (ptuo *PasswordTokenUpdateOne) Mutation() *PasswordTokenMutation
- func (ptuo *PasswordTokenUpdateOne) Save(ctx context.Context) (*PasswordToken, error)
- func (ptuo *PasswordTokenUpdateOne) SaveX(ctx context.Context) *PasswordToken
- func (ptuo *PasswordTokenUpdateOne) Select(field string, fields ...string) *PasswordTokenUpdateOne
- func (ptuo *PasswordTokenUpdateOne) SetCreatedAt(t time.Time) *PasswordTokenUpdateOne
- func (ptuo *PasswordTokenUpdateOne) SetNillableCreatedAt(t *time.Time) *PasswordTokenUpdateOne
- func (ptuo *PasswordTokenUpdateOne) SetNillableToken(s *string) *PasswordTokenUpdateOne
- func (ptuo *PasswordTokenUpdateOne) SetNillableUserID(i *int) *PasswordTokenUpdateOne
- func (ptuo *PasswordTokenUpdateOne) SetToken(s string) *PasswordTokenUpdateOne
- func (ptuo *PasswordTokenUpdateOne) SetUser(u *User) *PasswordTokenUpdateOne
- func (ptuo *PasswordTokenUpdateOne) SetUserID(i int) *PasswordTokenUpdateOne
- func (ptuo *PasswordTokenUpdateOne) Where(ps ...predicate.PasswordToken) *PasswordTokenUpdateOne
- type PasswordTokens
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type TraverseFunc
- type Traverser
- type Tx
- type User
- func (u *User) QueryNoteLikes() *NoteLikeQuery
- func (u *User) QueryNoteReposts() *NoteRepostQuery
- func (u *User) QueryNotes() *NoteQuery
- func (u *User) QueryOwner() *PasswordTokenQuery
- func (u *User) String() string
- func (u *User) Unwrap() *User
- func (u *User) Update() *UserUpdateOne
- func (u *User) Value(name string) (ent.Value, error)
- type UserClient
- func (c *UserClient) Create() *UserCreate
- func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
- func (c *UserClient) Delete() *UserDelete
- func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
- func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id int) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id int) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Intercept(interceptors ...Interceptor)
- func (c *UserClient) Interceptors() []Interceptor
- func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) QueryNoteLikes(u *User) *NoteLikeQuery
- func (c *UserClient) QueryNoteReposts(u *User) *NoteRepostQuery
- func (c *UserClient) QueryNotes(u *User) *NoteQuery
- func (c *UserClient) QueryOwner(u *User) *PasswordTokenQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- func (uc *UserCreate) AddNoteIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddNoteLikeIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddNoteLikes(n ...*NoteLike) *UserCreate
- func (uc *UserCreate) AddNoteRepostIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddNoteReposts(n ...*NoteRepost) *UserCreate
- func (uc *UserCreate) AddNotes(n ...*Note) *UserCreate
- func (uc *UserCreate) AddOwner(p ...*PasswordToken) *UserCreate
- func (uc *UserCreate) AddOwnerIDs(ids ...int) *UserCreate
- func (uc *UserCreate) Exec(ctx context.Context) error
- func (uc *UserCreate) ExecX(ctx context.Context)
- func (uc *UserCreate) Mutation() *UserMutation
- func (uc *UserCreate) Save(ctx context.Context) (*User, error)
- func (uc *UserCreate) SaveX(ctx context.Context) *User
- func (uc *UserCreate) SetAdmin(b bool) *UserCreate
- func (uc *UserCreate) SetBio(s string) *UserCreate
- func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate
- func (uc *UserCreate) SetDarkMode(b bool) *UserCreate
- func (uc *UserCreate) SetEmail(s string) *UserCreate
- func (uc *UserCreate) SetEmailNotifications(b bool) *UserCreate
- func (uc *UserCreate) SetIsActive(b bool) *UserCreate
- func (uc *UserCreate) SetLastLogin(t time.Time) *UserCreate
- func (uc *UserCreate) SetName(s string) *UserCreate
- func (uc *UserCreate) SetNillableAdmin(b *bool) *UserCreate
- func (uc *UserCreate) SetNillableBio(s *string) *UserCreate
- func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillableDarkMode(b *bool) *UserCreate
- func (uc *UserCreate) SetNillableEmail(s *string) *UserCreate
- func (uc *UserCreate) SetNillableEmailNotifications(b *bool) *UserCreate
- func (uc *UserCreate) SetNillableIsActive(b *bool) *UserCreate
- func (uc *UserCreate) SetNillableLastLogin(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillablePassword(s *string) *UserCreate
- func (uc *UserCreate) SetNillableProfilePicture(s *string) *UserCreate
- func (uc *UserCreate) SetNillableRegistrationMethod(um *user.RegistrationMethod) *UserCreate
- func (uc *UserCreate) SetNillableSmsNotifications(b *bool) *UserCreate
- func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillableVerificationCode(s *string) *UserCreate
- func (uc *UserCreate) SetNillableVerified(b *bool) *UserCreate
- func (uc *UserCreate) SetPassword(s string) *UserCreate
- func (uc *UserCreate) SetPhoneNumber(s string) *UserCreate
- func (uc *UserCreate) SetProfilePicture(s string) *UserCreate
- func (uc *UserCreate) SetRegistrationMethod(um user.RegistrationMethod) *UserCreate
- func (uc *UserCreate) SetSmsNotifications(b bool) *UserCreate
- func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate
- func (uc *UserCreate) SetVerificationCode(s string) *UserCreate
- func (uc *UserCreate) SetVerified(b bool) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserEdges
- type UserGroupBy
- func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserGroupBy) BoolX(ctx context.Context) bool
- func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserGroupBy) Float64X(ctx context.Context) float64
- func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserGroupBy) IntX(ctx context.Context) int
- func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
- func (s *UserGroupBy) ScanX(ctx context.Context, v any)
- func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserGroupBy) StringX(ctx context.Context) string
- func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddNoteIDs(ids ...int)
- func (m *UserMutation) AddNoteLikeIDs(ids ...int)
- func (m *UserMutation) AddNoteRepostIDs(ids ...int)
- func (m *UserMutation) AddOwnerIDs(ids ...int)
- func (m *UserMutation) AddedEdges() []string
- func (m *UserMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserMutation) AddedFields() []string
- func (m *UserMutation) AddedIDs(name string) []ent.Value
- func (m *UserMutation) Admin() (r bool, exists bool)
- func (m *UserMutation) Bio() (r string, exists bool)
- func (m *UserMutation) BioCleared() bool
- func (m *UserMutation) ClearBio()
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearEmail()
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearLastLogin()
- func (m *UserMutation) ClearNoteLikes()
- func (m *UserMutation) ClearNoteReposts()
- func (m *UserMutation) ClearNotes()
- func (m *UserMutation) ClearOwner()
- func (m *UserMutation) ClearPassword()
- func (m *UserMutation) ClearProfilePicture()
- func (m *UserMutation) ClearUpdatedAt()
- func (m *UserMutation) ClearVerificationCode()
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) CreatedAt() (r time.Time, exists bool)
- func (m *UserMutation) DarkMode() (r bool, exists bool)
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) Email() (r string, exists bool)
- func (m *UserMutation) EmailCleared() bool
- func (m *UserMutation) EmailNotifications() (r bool, exists bool)
- func (m *UserMutation) Field(name string) (ent.Value, bool)
- func (m *UserMutation) FieldCleared(name string) bool
- func (m *UserMutation) Fields() []string
- func (m *UserMutation) ID() (id int, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
- func (m *UserMutation) IsActive() (r bool, exists bool)
- func (m *UserMutation) LastLogin() (r time.Time, exists bool)
- func (m *UserMutation) LastLoginCleared() bool
- func (m *UserMutation) Name() (r string, exists bool)
- func (m *UserMutation) NoteLikesCleared() bool
- func (m *UserMutation) NoteLikesIDs() (ids []int)
- func (m *UserMutation) NoteRepostsCleared() bool
- func (m *UserMutation) NoteRepostsIDs() (ids []int)
- func (m *UserMutation) NotesCleared() bool
- func (m *UserMutation) NotesIDs() (ids []int)
- func (m *UserMutation) OldAdmin(ctx context.Context) (v bool, err error)
- func (m *UserMutation) OldBio(ctx context.Context) (v *string, err error)
- func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldDarkMode(ctx context.Context) (v bool, err error)
- func (m *UserMutation) OldEmail(ctx context.Context) (v *string, err error)
- func (m *UserMutation) OldEmailNotifications(ctx context.Context) (v bool, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldIsActive(ctx context.Context) (v bool, err error)
- func (m *UserMutation) OldLastLogin(ctx context.Context) (v *time.Time, err error)
- func (m *UserMutation) OldName(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldPhoneNumber(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldProfilePicture(ctx context.Context) (v *string, err error)
- func (m *UserMutation) OldRegistrationMethod(ctx context.Context) (v user.RegistrationMethod, err error)
- func (m *UserMutation) OldSmsNotifications(ctx context.Context) (v bool, err error)
- func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v *time.Time, err error)
- func (m *UserMutation) OldVerificationCode(ctx context.Context) (v *string, err error)
- func (m *UserMutation) OldVerified(ctx context.Context) (v bool, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) OwnerCleared() bool
- func (m *UserMutation) OwnerIDs() (ids []int)
- func (m *UserMutation) Password() (r string, exists bool)
- func (m *UserMutation) PasswordCleared() bool
- func (m *UserMutation) PhoneNumber() (r string, exists bool)
- func (m *UserMutation) ProfilePicture() (r string, exists bool)
- func (m *UserMutation) ProfilePictureCleared() bool
- func (m *UserMutation) RegistrationMethod() (r user.RegistrationMethod, exists bool)
- func (m *UserMutation) RemoveNoteIDs(ids ...int)
- func (m *UserMutation) RemoveNoteLikeIDs(ids ...int)
- func (m *UserMutation) RemoveNoteRepostIDs(ids ...int)
- func (m *UserMutation) RemoveOwnerIDs(ids ...int)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedNoteLikesIDs() (ids []int)
- func (m *UserMutation) RemovedNoteRepostsIDs() (ids []int)
- func (m *UserMutation) RemovedNotesIDs() (ids []int)
- func (m *UserMutation) RemovedOwnerIDs() (ids []int)
- func (m *UserMutation) ResetAdmin()
- func (m *UserMutation) ResetBio()
- func (m *UserMutation) ResetCreatedAt()
- func (m *UserMutation) ResetDarkMode()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetEmail()
- func (m *UserMutation) ResetEmailNotifications()
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetIsActive()
- func (m *UserMutation) ResetLastLogin()
- func (m *UserMutation) ResetName()
- func (m *UserMutation) ResetNoteLikes()
- func (m *UserMutation) ResetNoteReposts()
- func (m *UserMutation) ResetNotes()
- func (m *UserMutation) ResetOwner()
- func (m *UserMutation) ResetPassword()
- func (m *UserMutation) ResetPhoneNumber()
- func (m *UserMutation) ResetProfilePicture()
- func (m *UserMutation) ResetRegistrationMethod()
- func (m *UserMutation) ResetSmsNotifications()
- func (m *UserMutation) ResetUpdatedAt()
- func (m *UserMutation) ResetVerificationCode()
- func (m *UserMutation) ResetVerified()
- func (m *UserMutation) SetAdmin(b bool)
- func (m *UserMutation) SetBio(s string)
- func (m *UserMutation) SetCreatedAt(t time.Time)
- func (m *UserMutation) SetDarkMode(b bool)
- func (m *UserMutation) SetEmail(s string)
- func (m *UserMutation) SetEmailNotifications(b bool)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetIsActive(b bool)
- func (m *UserMutation) SetLastLogin(t time.Time)
- func (m *UserMutation) SetName(s string)
- func (m *UserMutation) SetOp(op Op)
- func (m *UserMutation) SetPassword(s string)
- func (m *UserMutation) SetPhoneNumber(s string)
- func (m *UserMutation) SetProfilePicture(s string)
- func (m *UserMutation) SetRegistrationMethod(um user.RegistrationMethod)
- func (m *UserMutation) SetSmsNotifications(b bool)
- func (m *UserMutation) SetUpdatedAt(t time.Time)
- func (m *UserMutation) SetVerificationCode(s string)
- func (m *UserMutation) SetVerified(b bool)
- func (m *UserMutation) SmsNotifications() (r bool, exists bool)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *UserMutation) UpdatedAtCleared() bool
- func (m *UserMutation) VerificationCode() (r string, exists bool)
- func (m *UserMutation) VerificationCodeCleared() bool
- func (m *UserMutation) Verified() (r bool, exists bool)
- func (m *UserMutation) Where(ps ...predicate.User)
- func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
- type UserQuery
- func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
- func (uq *UserQuery) All(ctx context.Context) ([]*User, error)
- func (uq *UserQuery) AllX(ctx context.Context) []*User
- func (uq *UserQuery) Clone() *UserQuery
- func (uq *UserQuery) Count(ctx context.Context) (int, error)
- func (uq *UserQuery) CountX(ctx context.Context) int
- func (uq *UserQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UserQuery) ExistX(ctx context.Context) bool
- func (uq *UserQuery) First(ctx context.Context) (*User, error)
- func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) int
- func (uq *UserQuery) FirstX(ctx context.Context) *User
- func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (uq *UserQuery) IDs(ctx context.Context) (ids []int, err error)
- func (uq *UserQuery) IDsX(ctx context.Context) []int
- func (uq *UserQuery) Limit(limit int) *UserQuery
- func (uq *UserQuery) Offset(offset int) *UserQuery
- func (uq *UserQuery) Only(ctx context.Context) (*User, error)
- func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) int
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
- func (uq *UserQuery) QueryNoteLikes() *NoteLikeQuery
- func (uq *UserQuery) QueryNoteReposts() *NoteRepostQuery
- func (uq *UserQuery) QueryNotes() *NoteQuery
- func (uq *UserQuery) QueryOwner() *PasswordTokenQuery
- func (uq *UserQuery) Select(fields ...string) *UserSelect
- func (uq *UserQuery) Unique(unique bool) *UserQuery
- func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery
- func (uq *UserQuery) WithNoteLikes(opts ...func(*NoteLikeQuery)) *UserQuery
- func (uq *UserQuery) WithNoteReposts(opts ...func(*NoteRepostQuery)) *UserQuery
- func (uq *UserQuery) WithNotes(opts ...func(*NoteQuery)) *UserQuery
- func (uq *UserQuery) WithOwner(opts ...func(*PasswordTokenQuery)) *UserQuery
- type UserSelect
- func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
- func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserSelect) BoolX(ctx context.Context) bool
- func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserSelect) BoolsX(ctx context.Context) []bool
- func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserSelect) Float64X(ctx context.Context) float64
- func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserSelect) Float64sX(ctx context.Context) []float64
- func (s *UserSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserSelect) IntX(ctx context.Context) int
- func (s *UserSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserSelect) IntsX(ctx context.Context) []int
- func (us *UserSelect) Scan(ctx context.Context, v any) error
- func (s *UserSelect) ScanX(ctx context.Context, v any)
- func (s *UserSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserSelect) StringX(ctx context.Context) string
- func (s *UserSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserSelect) StringsX(ctx context.Context) []string
- type UserUpdate
- func (uu *UserUpdate) AddNoteIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddNoteLikeIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddNoteLikes(n ...*NoteLike) *UserUpdate
- func (uu *UserUpdate) AddNoteRepostIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddNoteReposts(n ...*NoteRepost) *UserUpdate
- func (uu *UserUpdate) AddNotes(n ...*Note) *UserUpdate
- func (uu *UserUpdate) AddOwner(p ...*PasswordToken) *UserUpdate
- func (uu *UserUpdate) AddOwnerIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) ClearBio() *UserUpdate
- func (uu *UserUpdate) ClearEmail() *UserUpdate
- func (uu *UserUpdate) ClearLastLogin() *UserUpdate
- func (uu *UserUpdate) ClearNoteLikes() *UserUpdate
- func (uu *UserUpdate) ClearNoteReposts() *UserUpdate
- func (uu *UserUpdate) ClearNotes() *UserUpdate
- func (uu *UserUpdate) ClearOwner() *UserUpdate
- func (uu *UserUpdate) ClearPassword() *UserUpdate
- func (uu *UserUpdate) ClearProfilePicture() *UserUpdate
- func (uu *UserUpdate) ClearUpdatedAt() *UserUpdate
- func (uu *UserUpdate) ClearVerificationCode() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) RemoveNoteIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveNoteLikeIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveNoteLikes(n ...*NoteLike) *UserUpdate
- func (uu *UserUpdate) RemoveNoteRepostIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveNoteReposts(n ...*NoteRepost) *UserUpdate
- func (uu *UserUpdate) RemoveNotes(n ...*Note) *UserUpdate
- func (uu *UserUpdate) RemoveOwner(p ...*PasswordToken) *UserUpdate
- func (uu *UserUpdate) RemoveOwnerIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetAdmin(b bool) *UserUpdate
- func (uu *UserUpdate) SetBio(s string) *UserUpdate
- func (uu *UserUpdate) SetDarkMode(b bool) *UserUpdate
- func (uu *UserUpdate) SetEmail(s string) *UserUpdate
- func (uu *UserUpdate) SetEmailNotifications(b bool) *UserUpdate
- func (uu *UserUpdate) SetIsActive(b bool) *UserUpdate
- func (uu *UserUpdate) SetLastLogin(t time.Time) *UserUpdate
- func (uu *UserUpdate) SetName(s string) *UserUpdate
- func (uu *UserUpdate) SetNillableAdmin(b *bool) *UserUpdate
- func (uu *UserUpdate) SetNillableBio(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableDarkMode(b *bool) *UserUpdate
- func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableEmailNotifications(b *bool) *UserUpdate
- func (uu *UserUpdate) SetNillableIsActive(b *bool) *UserUpdate
- func (uu *UserUpdate) SetNillableLastLogin(t *time.Time) *UserUpdate
- func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillablePhoneNumber(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableProfilePicture(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableRegistrationMethod(um *user.RegistrationMethod) *UserUpdate
- func (uu *UserUpdate) SetNillableSmsNotifications(b *bool) *UserUpdate
- func (uu *UserUpdate) SetNillableVerificationCode(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableVerified(b *bool) *UserUpdate
- func (uu *UserUpdate) SetPassword(s string) *UserUpdate
- func (uu *UserUpdate) SetPhoneNumber(s string) *UserUpdate
- func (uu *UserUpdate) SetProfilePicture(s string) *UserUpdate
- func (uu *UserUpdate) SetRegistrationMethod(um user.RegistrationMethod) *UserUpdate
- func (uu *UserUpdate) SetSmsNotifications(b bool) *UserUpdate
- func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate
- func (uu *UserUpdate) SetVerificationCode(s string) *UserUpdate
- func (uu *UserUpdate) SetVerified(b bool) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddNoteIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddNoteLikeIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddNoteLikes(n ...*NoteLike) *UserUpdateOne
- func (uuo *UserUpdateOne) AddNoteRepostIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddNoteReposts(n ...*NoteRepost) *UserUpdateOne
- func (uuo *UserUpdateOne) AddNotes(n ...*Note) *UserUpdateOne
- func (uuo *UserUpdateOne) AddOwner(p ...*PasswordToken) *UserUpdateOne
- func (uuo *UserUpdateOne) AddOwnerIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearBio() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearEmail() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearLastLogin() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearNoteLikes() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearNoteReposts() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearNotes() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearOwner() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearPassword() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearProfilePicture() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearUpdatedAt() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearVerificationCode() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) RemoveNoteIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveNoteLikeIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveNoteLikes(n ...*NoteLike) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveNoteRepostIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveNoteReposts(n ...*NoteRepost) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveNotes(n ...*Note) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveOwner(p ...*PasswordToken) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveOwnerIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetAdmin(b bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetBio(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetDarkMode(b bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetEmailNotifications(b bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetIsActive(b bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetLastLogin(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableAdmin(b *bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableBio(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableDarkMode(b *bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableEmailNotifications(b *bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableIsActive(b *bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableLastLogin(t *time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillablePhoneNumber(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableProfilePicture(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableRegistrationMethod(um *user.RegistrationMethod) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableSmsNotifications(b *bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableVerificationCode(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableVerified(b *bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetPhoneNumber(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetProfilePicture(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetRegistrationMethod(um user.RegistrationMethod) *UserUpdateOne
- func (uuo *UserUpdateOne) SetSmsNotifications(b bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetVerificationCode(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetVerified(b bool) *UserUpdateOne
- func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
- type Users
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeNote = "Note" TypeNoteLike = "NoteLike" TypeNoteRepost = "NoteRepost" TypePasswordToken = "PasswordToken" TypeUser = "User" )
Variables ¶
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Client ¶
type Client struct {
// Schema is the client for creating, migrating and dropping schema.
Schema *migrate.Schema
// Note is the client for interacting with the Note builders.
Note *NoteClient
// NoteLike is the client for interacting with the NoteLike builders.
NoteLike *NoteLikeClient
// NoteRepost is the client for interacting with the NoteRepost builders.
NoteRepost *NoteRepostClient
// PasswordToken is the client for interacting with the PasswordToken builders.
PasswordToken *PasswordTokenClient
// User is the client for interacting with the User builders.
User *UserClient
// contains filtered or unexported fields
}
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.
func (*Client) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). Note. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer {
return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
// Do some stuff before.
if err := next.Commit(ctx, tx); err != nil {
return err
}
// Do some stuff after.
return nil
})
}
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type Note ¶
type Note struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// Title of the note
Title string `json:"title,omitempty"`
// Brief description of the note
Description string `json:"description,omitempty"`
// Main text content of the note
Content string `json:"content,omitempty"`
// Array of attached resources (files, links, etc.)
Resources []types.Resource `json:"resources,omitempty"`
// AI-generated curriculum based on note content
AiCurriculum string `json:"ai_curriculum,omitempty"`
// Note visibility setting
Visibility note.Visibility `json:"visibility,omitempty"`
// Permission level for public notes
PermissionLevel note.PermissionLevel `json:"permission_level,omitempty"`
ShareToken string `json:"share_token,omitempty"`
// Whether AI is currently processing this note
AiProcessing bool `json:"ai_processing,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// UpdatedAt holds the value of the "updated_at" field.
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the NoteQuery when eager-loading is set.
Edges NoteEdges `json:"edges"`
// contains filtered or unexported fields
}
Note is the model entity for the Note schema.
func (*Note) QueryLikes ¶
func (n *Note) QueryLikes() *NoteLikeQuery
QueryLikes queries the "likes" edge of the Note entity.
func (*Note) QueryOwner ¶
QueryOwner queries the "owner" edge of the Note entity.
func (*Note) QueryReposts ¶
func (n *Note) QueryReposts() *NoteRepostQuery
QueryReposts queries the "reposts" edge of the Note entity.
func (*Note) Unwrap ¶
Unwrap unwraps the Note entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Note) Update ¶
func (n *Note) Update() *NoteUpdateOne
Update returns a builder for updating this Note. Note that you need to call Note.Unwrap() before calling this method if this Note was returned from a transaction, and the transaction was committed or rolled back.
type NoteClient ¶
type NoteClient struct {
// contains filtered or unexported fields
}
NoteClient is a client for the Note schema.
func NewNoteClient ¶
func NewNoteClient(c config) *NoteClient
NewNoteClient returns a client for the Note from the given config.
func (*NoteClient) Create ¶
func (c *NoteClient) Create() *NoteCreate
Create returns a builder for creating a Note entity.
func (*NoteClient) CreateBulk ¶
func (c *NoteClient) CreateBulk(builders ...*NoteCreate) *NoteCreateBulk
CreateBulk returns a builder for creating a bulk of Note entities.
func (*NoteClient) Delete ¶
func (c *NoteClient) Delete() *NoteDelete
Delete returns a delete builder for Note.
func (*NoteClient) DeleteOne ¶
func (c *NoteClient) DeleteOne(n *Note) *NoteDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*NoteClient) DeleteOneID ¶
func (c *NoteClient) DeleteOneID(id int) *NoteDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*NoteClient) GetX ¶
func (c *NoteClient) GetX(ctx context.Context, id int) *Note
GetX is like Get, but panics if an error occurs.
func (*NoteClient) Intercept ¶
func (c *NoteClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `note.Intercept(f(g(h())))`.
func (*NoteClient) Interceptors ¶
func (c *NoteClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*NoteClient) MapCreateBulk ¶
func (c *NoteClient) MapCreateBulk(slice any, setFunc func(*NoteCreate, int)) *NoteCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*NoteClient) Query ¶
func (c *NoteClient) Query() *NoteQuery
Query returns a query builder for Note.
func (*NoteClient) QueryLikes ¶
func (c *NoteClient) QueryLikes(n *Note) *NoteLikeQuery
QueryLikes queries the likes edge of a Note.
func (*NoteClient) QueryOwner ¶
func (c *NoteClient) QueryOwner(n *Note) *UserQuery
QueryOwner queries the owner edge of a Note.
func (*NoteClient) QueryReposts ¶
func (c *NoteClient) QueryReposts(n *Note) *NoteRepostQuery
QueryReposts queries the reposts edge of a Note.
func (*NoteClient) Update ¶
func (c *NoteClient) Update() *NoteUpdate
Update returns an update builder for Note.
func (*NoteClient) UpdateOne ¶
func (c *NoteClient) UpdateOne(n *Note) *NoteUpdateOne
UpdateOne returns an update builder for the given entity.
func (*NoteClient) UpdateOneID ¶
func (c *NoteClient) UpdateOneID(id int) *NoteUpdateOne
UpdateOneID returns an update builder for the given id.
func (*NoteClient) Use ¶
func (c *NoteClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `note.Hooks(f(g(h())))`.
type NoteCreate ¶
type NoteCreate struct {
// contains filtered or unexported fields
}
NoteCreate is the builder for creating a Note entity.
func (*NoteCreate) AddLikeIDs ¶
func (nc *NoteCreate) AddLikeIDs(ids ...int) *NoteCreate
AddLikeIDs adds the "likes" edge to the NoteLike entity by IDs.
func (*NoteCreate) AddLikes ¶
func (nc *NoteCreate) AddLikes(n ...*NoteLike) *NoteCreate
AddLikes adds the "likes" edges to the NoteLike entity.
func (*NoteCreate) AddRepostIDs ¶
func (nc *NoteCreate) AddRepostIDs(ids ...int) *NoteCreate
AddRepostIDs adds the "reposts" edge to the NoteRepost entity by IDs.
func (*NoteCreate) AddReposts ¶
func (nc *NoteCreate) AddReposts(n ...*NoteRepost) *NoteCreate
AddReposts adds the "reposts" edges to the NoteRepost entity.
func (*NoteCreate) Exec ¶
func (nc *NoteCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*NoteCreate) ExecX ¶
func (nc *NoteCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NoteCreate) Mutation ¶
func (nc *NoteCreate) Mutation() *NoteMutation
Mutation returns the NoteMutation object of the builder.
func (*NoteCreate) Save ¶
func (nc *NoteCreate) Save(ctx context.Context) (*Note, error)
Save creates the Note in the database.
func (*NoteCreate) SaveX ¶
func (nc *NoteCreate) SaveX(ctx context.Context) *Note
SaveX calls Save and panics if Save returns an error.
func (*NoteCreate) SetAiCurriculum ¶
func (nc *NoteCreate) SetAiCurriculum(s string) *NoteCreate
SetAiCurriculum sets the "ai_curriculum" field.
func (*NoteCreate) SetAiProcessing ¶
func (nc *NoteCreate) SetAiProcessing(b bool) *NoteCreate
SetAiProcessing sets the "ai_processing" field.
func (*NoteCreate) SetContent ¶
func (nc *NoteCreate) SetContent(s string) *NoteCreate
SetContent sets the "content" field.
func (*NoteCreate) SetCreatedAt ¶
func (nc *NoteCreate) SetCreatedAt(t time.Time) *NoteCreate
SetCreatedAt sets the "created_at" field.
func (*NoteCreate) SetDescription ¶
func (nc *NoteCreate) SetDescription(s string) *NoteCreate
SetDescription sets the "description" field.
func (*NoteCreate) SetNillableAiCurriculum ¶
func (nc *NoteCreate) SetNillableAiCurriculum(s *string) *NoteCreate
SetNillableAiCurriculum sets the "ai_curriculum" field if the given value is not nil.
func (*NoteCreate) SetNillableAiProcessing ¶
func (nc *NoteCreate) SetNillableAiProcessing(b *bool) *NoteCreate
SetNillableAiProcessing sets the "ai_processing" field if the given value is not nil.
func (*NoteCreate) SetNillableContent ¶
func (nc *NoteCreate) SetNillableContent(s *string) *NoteCreate
SetNillableContent sets the "content" field if the given value is not nil.
func (*NoteCreate) SetNillableCreatedAt ¶
func (nc *NoteCreate) SetNillableCreatedAt(t *time.Time) *NoteCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*NoteCreate) SetNillableDescription ¶
func (nc *NoteCreate) SetNillableDescription(s *string) *NoteCreate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*NoteCreate) SetNillablePermissionLevel ¶
func (nc *NoteCreate) SetNillablePermissionLevel(nl *note.PermissionLevel) *NoteCreate
SetNillablePermissionLevel sets the "permission_level" field if the given value is not nil.
func (*NoteCreate) SetNillableShareToken ¶
func (nc *NoteCreate) SetNillableShareToken(s *string) *NoteCreate
SetNillableShareToken sets the "share_token" field if the given value is not nil.
func (*NoteCreate) SetNillableUpdatedAt ¶
func (nc *NoteCreate) SetNillableUpdatedAt(t *time.Time) *NoteCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*NoteCreate) SetNillableVisibility ¶
func (nc *NoteCreate) SetNillableVisibility(n *note.Visibility) *NoteCreate
SetNillableVisibility sets the "visibility" field if the given value is not nil.
func (*NoteCreate) SetOwner ¶
func (nc *NoteCreate) SetOwner(u *User) *NoteCreate
SetOwner sets the "owner" edge to the User entity.
func (*NoteCreate) SetOwnerID ¶
func (nc *NoteCreate) SetOwnerID(id int) *NoteCreate
SetOwnerID sets the "owner" edge to the User entity by ID.
func (*NoteCreate) SetPermissionLevel ¶
func (nc *NoteCreate) SetPermissionLevel(nl note.PermissionLevel) *NoteCreate
SetPermissionLevel sets the "permission_level" field.
func (*NoteCreate) SetResources ¶
func (nc *NoteCreate) SetResources(t []types.Resource) *NoteCreate
SetResources sets the "resources" field.
func (*NoteCreate) SetShareToken ¶
func (nc *NoteCreate) SetShareToken(s string) *NoteCreate
SetShareToken sets the "share_token" field.
func (*NoteCreate) SetTitle ¶
func (nc *NoteCreate) SetTitle(s string) *NoteCreate
SetTitle sets the "title" field.
func (*NoteCreate) SetUpdatedAt ¶
func (nc *NoteCreate) SetUpdatedAt(t time.Time) *NoteCreate
SetUpdatedAt sets the "updated_at" field.
func (*NoteCreate) SetVisibility ¶
func (nc *NoteCreate) SetVisibility(n note.Visibility) *NoteCreate
SetVisibility sets the "visibility" field.
type NoteCreateBulk ¶
type NoteCreateBulk struct {
// contains filtered or unexported fields
}
NoteCreateBulk is the builder for creating many Note entities in bulk.
func (*NoteCreateBulk) Exec ¶
func (ncb *NoteCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*NoteCreateBulk) ExecX ¶
func (ncb *NoteCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type NoteDelete ¶
type NoteDelete struct {
// contains filtered or unexported fields
}
NoteDelete is the builder for deleting a Note entity.
func (*NoteDelete) Exec ¶
func (nd *NoteDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*NoteDelete) ExecX ¶
func (nd *NoteDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*NoteDelete) Where ¶
func (nd *NoteDelete) Where(ps ...predicate.Note) *NoteDelete
Where appends a list predicates to the NoteDelete builder.
type NoteDeleteOne ¶
type NoteDeleteOne struct {
// contains filtered or unexported fields
}
NoteDeleteOne is the builder for deleting a single Note entity.
func (*NoteDeleteOne) Exec ¶
func (ndo *NoteDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*NoteDeleteOne) ExecX ¶
func (ndo *NoteDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NoteDeleteOne) Where ¶
func (ndo *NoteDeleteOne) Where(ps ...predicate.Note) *NoteDeleteOne
Where appends a list predicates to the NoteDelete builder.
type NoteEdges ¶
type NoteEdges struct {
// Owner holds the value of the owner edge.
Owner *User `json:"owner,omitempty"`
// Likes holds the value of the likes edge.
Likes []*NoteLike `json:"likes,omitempty"`
// Reposts holds the value of the reposts edge.
Reposts []*NoteRepost `json:"reposts,omitempty"`
// contains filtered or unexported fields
}
NoteEdges holds the relations/edges for other nodes in the graph.
func (NoteEdges) LikesOrErr ¶
LikesOrErr returns the Likes value or an error if the edge was not loaded in eager-loading.
func (NoteEdges) OwnerOrErr ¶
OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (NoteEdges) RepostsOrErr ¶
func (e NoteEdges) RepostsOrErr() ([]*NoteRepost, error)
RepostsOrErr returns the Reposts value or an error if the edge was not loaded in eager-loading.
type NoteGroupBy ¶
type NoteGroupBy struct {
// contains filtered or unexported fields
}
NoteGroupBy is the group-by builder for Note entities.
func (*NoteGroupBy) Aggregate ¶
func (ngb *NoteGroupBy) Aggregate(fns ...AggregateFunc) *NoteGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*NoteGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*NoteGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*NoteGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*NoteGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*NoteGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*NoteGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*NoteGroupBy) Scan ¶
func (ngb *NoteGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*NoteGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type NoteLike ¶
type NoteLike struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the NoteLikeQuery when eager-loading is set.
Edges NoteLikeEdges `json:"edges"`
// contains filtered or unexported fields
}
NoteLike is the model entity for the NoteLike schema.
func (*NoteLike) Unwrap ¶
Unwrap unwraps the NoteLike entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*NoteLike) Update ¶
func (nl *NoteLike) Update() *NoteLikeUpdateOne
Update returns a builder for updating this NoteLike. Note that you need to call NoteLike.Unwrap() before calling this method if this NoteLike was returned from a transaction, and the transaction was committed or rolled back.
type NoteLikeClient ¶
type NoteLikeClient struct {
// contains filtered or unexported fields
}
NoteLikeClient is a client for the NoteLike schema.
func NewNoteLikeClient ¶
func NewNoteLikeClient(c config) *NoteLikeClient
NewNoteLikeClient returns a client for the NoteLike from the given config.
func (*NoteLikeClient) Create ¶
func (c *NoteLikeClient) Create() *NoteLikeCreate
Create returns a builder for creating a NoteLike entity.
func (*NoteLikeClient) CreateBulk ¶
func (c *NoteLikeClient) CreateBulk(builders ...*NoteLikeCreate) *NoteLikeCreateBulk
CreateBulk returns a builder for creating a bulk of NoteLike entities.
func (*NoteLikeClient) Delete ¶
func (c *NoteLikeClient) Delete() *NoteLikeDelete
Delete returns a delete builder for NoteLike.
func (*NoteLikeClient) DeleteOne ¶
func (c *NoteLikeClient) DeleteOne(nl *NoteLike) *NoteLikeDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*NoteLikeClient) DeleteOneID ¶
func (c *NoteLikeClient) DeleteOneID(id int) *NoteLikeDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*NoteLikeClient) GetX ¶
func (c *NoteLikeClient) GetX(ctx context.Context, id int) *NoteLike
GetX is like Get, but panics if an error occurs.
func (*NoteLikeClient) Hooks ¶
func (c *NoteLikeClient) Hooks() []Hook
Hooks returns the client hooks.
func (*NoteLikeClient) Intercept ¶
func (c *NoteLikeClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `notelike.Intercept(f(g(h())))`.
func (*NoteLikeClient) Interceptors ¶
func (c *NoteLikeClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*NoteLikeClient) MapCreateBulk ¶
func (c *NoteLikeClient) MapCreateBulk(slice any, setFunc func(*NoteLikeCreate, int)) *NoteLikeCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*NoteLikeClient) Query ¶
func (c *NoteLikeClient) Query() *NoteLikeQuery
Query returns a query builder for NoteLike.
func (*NoteLikeClient) QueryNote ¶
func (c *NoteLikeClient) QueryNote(nl *NoteLike) *NoteQuery
QueryNote queries the note edge of a NoteLike.
func (*NoteLikeClient) QueryUser ¶
func (c *NoteLikeClient) QueryUser(nl *NoteLike) *UserQuery
QueryUser queries the user edge of a NoteLike.
func (*NoteLikeClient) Update ¶
func (c *NoteLikeClient) Update() *NoteLikeUpdate
Update returns an update builder for NoteLike.
func (*NoteLikeClient) UpdateOne ¶
func (c *NoteLikeClient) UpdateOne(nl *NoteLike) *NoteLikeUpdateOne
UpdateOne returns an update builder for the given entity.
func (*NoteLikeClient) UpdateOneID ¶
func (c *NoteLikeClient) UpdateOneID(id int) *NoteLikeUpdateOne
UpdateOneID returns an update builder for the given id.
func (*NoteLikeClient) Use ¶
func (c *NoteLikeClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `notelike.Hooks(f(g(h())))`.
type NoteLikeCreate ¶
type NoteLikeCreate struct {
// contains filtered or unexported fields
}
NoteLikeCreate is the builder for creating a NoteLike entity.
func (*NoteLikeCreate) Exec ¶
func (nlc *NoteLikeCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*NoteLikeCreate) ExecX ¶
func (nlc *NoteLikeCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NoteLikeCreate) Mutation ¶
func (nlc *NoteLikeCreate) Mutation() *NoteLikeMutation
Mutation returns the NoteLikeMutation object of the builder.
func (*NoteLikeCreate) Save ¶
func (nlc *NoteLikeCreate) Save(ctx context.Context) (*NoteLike, error)
Save creates the NoteLike in the database.
func (*NoteLikeCreate) SaveX ¶
func (nlc *NoteLikeCreate) SaveX(ctx context.Context) *NoteLike
SaveX calls Save and panics if Save returns an error.
func (*NoteLikeCreate) SetCreatedAt ¶
func (nlc *NoteLikeCreate) SetCreatedAt(t time.Time) *NoteLikeCreate
SetCreatedAt sets the "created_at" field.
func (*NoteLikeCreate) SetNillableCreatedAt ¶
func (nlc *NoteLikeCreate) SetNillableCreatedAt(t *time.Time) *NoteLikeCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*NoteLikeCreate) SetNote ¶
func (nlc *NoteLikeCreate) SetNote(n *Note) *NoteLikeCreate
SetNote sets the "note" edge to the Note entity.
func (*NoteLikeCreate) SetNoteID ¶
func (nlc *NoteLikeCreate) SetNoteID(id int) *NoteLikeCreate
SetNoteID sets the "note" edge to the Note entity by ID.
func (*NoteLikeCreate) SetUser ¶
func (nlc *NoteLikeCreate) SetUser(u *User) *NoteLikeCreate
SetUser sets the "user" edge to the User entity.
func (*NoteLikeCreate) SetUserID ¶
func (nlc *NoteLikeCreate) SetUserID(id int) *NoteLikeCreate
SetUserID sets the "user" edge to the User entity by ID.
type NoteLikeCreateBulk ¶
type NoteLikeCreateBulk struct {
// contains filtered or unexported fields
}
NoteLikeCreateBulk is the builder for creating many NoteLike entities in bulk.
func (*NoteLikeCreateBulk) Exec ¶
func (nlcb *NoteLikeCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*NoteLikeCreateBulk) ExecX ¶
func (nlcb *NoteLikeCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type NoteLikeDelete ¶
type NoteLikeDelete struct {
// contains filtered or unexported fields
}
NoteLikeDelete is the builder for deleting a NoteLike entity.
func (*NoteLikeDelete) Exec ¶
func (nld *NoteLikeDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*NoteLikeDelete) ExecX ¶
func (nld *NoteLikeDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*NoteLikeDelete) Where ¶
func (nld *NoteLikeDelete) Where(ps ...predicate.NoteLike) *NoteLikeDelete
Where appends a list predicates to the NoteLikeDelete builder.
type NoteLikeDeleteOne ¶
type NoteLikeDeleteOne struct {
// contains filtered or unexported fields
}
NoteLikeDeleteOne is the builder for deleting a single NoteLike entity.
func (*NoteLikeDeleteOne) Exec ¶
func (nldo *NoteLikeDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*NoteLikeDeleteOne) ExecX ¶
func (nldo *NoteLikeDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NoteLikeDeleteOne) Where ¶
func (nldo *NoteLikeDeleteOne) Where(ps ...predicate.NoteLike) *NoteLikeDeleteOne
Where appends a list predicates to the NoteLikeDelete builder.
type NoteLikeEdges ¶
type NoteLikeEdges struct {
// User holds the value of the user edge.
User *User `json:"user,omitempty"`
// Note holds the value of the note edge.
Note *Note `json:"note,omitempty"`
// contains filtered or unexported fields
}
NoteLikeEdges holds the relations/edges for other nodes in the graph.
func (NoteLikeEdges) NoteOrErr ¶
func (e NoteLikeEdges) NoteOrErr() (*Note, error)
NoteOrErr returns the Note value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (NoteLikeEdges) UserOrErr ¶
func (e NoteLikeEdges) UserOrErr() (*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type NoteLikeGroupBy ¶
type NoteLikeGroupBy struct {
// contains filtered or unexported fields
}
NoteLikeGroupBy is the group-by builder for NoteLike entities.
func (*NoteLikeGroupBy) Aggregate ¶
func (nlgb *NoteLikeGroupBy) Aggregate(fns ...AggregateFunc) *NoteLikeGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*NoteLikeGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*NoteLikeGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*NoteLikeGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*NoteLikeGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*NoteLikeGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*NoteLikeGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*NoteLikeGroupBy) Scan ¶
func (nlgb *NoteLikeGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*NoteLikeGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type NoteLikeMutation ¶
type NoteLikeMutation struct {
// contains filtered or unexported fields
}
NoteLikeMutation represents an operation that mutates the NoteLike nodes in the graph.
func (*NoteLikeMutation) AddField ¶
func (m *NoteLikeMutation) AddField(name string, value ent.Value) error
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 (*NoteLikeMutation) AddedEdges ¶
func (m *NoteLikeMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*NoteLikeMutation) AddedField ¶
func (m *NoteLikeMutation) AddedField(name string) (ent.Value, bool)
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 (*NoteLikeMutation) AddedFields ¶
func (m *NoteLikeMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*NoteLikeMutation) AddedIDs ¶
func (m *NoteLikeMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*NoteLikeMutation) ClearEdge ¶
func (m *NoteLikeMutation) ClearEdge(name string) error
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 (*NoteLikeMutation) ClearField ¶
func (m *NoteLikeMutation) ClearField(name string) error
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 (*NoteLikeMutation) ClearNote ¶
func (m *NoteLikeMutation) ClearNote()
ClearNote clears the "note" edge to the Note entity.
func (*NoteLikeMutation) ClearUser ¶
func (m *NoteLikeMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*NoteLikeMutation) ClearedEdges ¶
func (m *NoteLikeMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*NoteLikeMutation) ClearedFields ¶
func (m *NoteLikeMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (NoteLikeMutation) Client ¶
func (m NoteLikeMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*NoteLikeMutation) CreatedAt ¶
func (m *NoteLikeMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*NoteLikeMutation) EdgeCleared ¶
func (m *NoteLikeMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*NoteLikeMutation) Field ¶
func (m *NoteLikeMutation) Field(name string) (ent.Value, bool)
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 (*NoteLikeMutation) FieldCleared ¶
func (m *NoteLikeMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*NoteLikeMutation) Fields ¶
func (m *NoteLikeMutation) Fields() []string
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 (*NoteLikeMutation) ID ¶
func (m *NoteLikeMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*NoteLikeMutation) IDs ¶
func (m *NoteLikeMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*NoteLikeMutation) NoteCleared ¶
func (m *NoteLikeMutation) NoteCleared() bool
NoteCleared reports if the "note" edge to the Note entity was cleared.
func (*NoteLikeMutation) NoteID ¶
func (m *NoteLikeMutation) NoteID() (id int, exists bool)
NoteID returns the "note" edge ID in the mutation.
func (*NoteLikeMutation) NoteIDs ¶
func (m *NoteLikeMutation) NoteIDs() (ids []int)
NoteIDs returns the "note" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use NoteID instead. It exists only for internal usage by the builders.
func (*NoteLikeMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the NoteLike entity. If the NoteLike object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*NoteLikeMutation) OldField ¶
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 (*NoteLikeMutation) RemovedEdges ¶
func (m *NoteLikeMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*NoteLikeMutation) RemovedIDs ¶
func (m *NoteLikeMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*NoteLikeMutation) ResetCreatedAt ¶
func (m *NoteLikeMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*NoteLikeMutation) ResetEdge ¶
func (m *NoteLikeMutation) ResetEdge(name string) error
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 (*NoteLikeMutation) ResetField ¶
func (m *NoteLikeMutation) ResetField(name string) error
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 (*NoteLikeMutation) ResetNote ¶
func (m *NoteLikeMutation) ResetNote()
ResetNote resets all changes to the "note" edge.
func (*NoteLikeMutation) ResetUser ¶
func (m *NoteLikeMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*NoteLikeMutation) SetCreatedAt ¶
func (m *NoteLikeMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*NoteLikeMutation) SetField ¶
func (m *NoteLikeMutation) SetField(name string, value ent.Value) error
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 (*NoteLikeMutation) SetNoteID ¶
func (m *NoteLikeMutation) SetNoteID(id int)
SetNoteID sets the "note" edge to the Note entity by id.
func (*NoteLikeMutation) SetOp ¶
func (m *NoteLikeMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*NoteLikeMutation) SetUserID ¶
func (m *NoteLikeMutation) SetUserID(id int)
SetUserID sets the "user" edge to the User entity by id.
func (NoteLikeMutation) Tx ¶
func (m NoteLikeMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*NoteLikeMutation) Type ¶
func (m *NoteLikeMutation) Type() string
Type returns the node type of this mutation (NoteLike).
func (*NoteLikeMutation) UserCleared ¶
func (m *NoteLikeMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*NoteLikeMutation) UserID ¶
func (m *NoteLikeMutation) UserID() (id int, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*NoteLikeMutation) UserIDs ¶
func (m *NoteLikeMutation) UserIDs() (ids []int)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*NoteLikeMutation) Where ¶
func (m *NoteLikeMutation) Where(ps ...predicate.NoteLike)
Where appends a list predicates to the NoteLikeMutation builder.
func (*NoteLikeMutation) WhereP ¶
func (m *NoteLikeMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the NoteLikeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type NoteLikeQuery ¶
type NoteLikeQuery struct {
// contains filtered or unexported fields
}
NoteLikeQuery is the builder for querying NoteLike entities.
func (*NoteLikeQuery) Aggregate ¶
func (nlq *NoteLikeQuery) Aggregate(fns ...AggregateFunc) *NoteLikeSelect
Aggregate returns a NoteLikeSelect configured with the given aggregations.
func (*NoteLikeQuery) All ¶
func (nlq *NoteLikeQuery) All(ctx context.Context) ([]*NoteLike, error)
All executes the query and returns a list of NoteLikes.
func (*NoteLikeQuery) AllX ¶
func (nlq *NoteLikeQuery) AllX(ctx context.Context) []*NoteLike
AllX is like All, but panics if an error occurs.
func (*NoteLikeQuery) Clone ¶
func (nlq *NoteLikeQuery) Clone() *NoteLikeQuery
Clone returns a duplicate of the NoteLikeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*NoteLikeQuery) Count ¶
func (nlq *NoteLikeQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*NoteLikeQuery) CountX ¶
func (nlq *NoteLikeQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*NoteLikeQuery) Exist ¶
func (nlq *NoteLikeQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*NoteLikeQuery) ExistX ¶
func (nlq *NoteLikeQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*NoteLikeQuery) First ¶
func (nlq *NoteLikeQuery) First(ctx context.Context) (*NoteLike, error)
First returns the first NoteLike entity from the query. Returns a *NotFoundError when no NoteLike was found.
func (*NoteLikeQuery) FirstID ¶
func (nlq *NoteLikeQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first NoteLike ID from the query. Returns a *NotFoundError when no NoteLike ID was found.
func (*NoteLikeQuery) FirstIDX ¶
func (nlq *NoteLikeQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*NoteLikeQuery) FirstX ¶
func (nlq *NoteLikeQuery) FirstX(ctx context.Context) *NoteLike
FirstX is like First, but panics if an error occurs.
func (*NoteLikeQuery) GroupBy ¶
func (nlq *NoteLikeQuery) GroupBy(field string, fields ...string) *NoteLikeGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct {
CreatedAt time.Time `json:"created_at,omitempty"`
Count int `json:"count,omitempty"`
}
client.NoteLike.Query().
GroupBy(notelike.FieldCreatedAt).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*NoteLikeQuery) IDs ¶
func (nlq *NoteLikeQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of NoteLike IDs.
func (*NoteLikeQuery) IDsX ¶
func (nlq *NoteLikeQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*NoteLikeQuery) Limit ¶
func (nlq *NoteLikeQuery) Limit(limit int) *NoteLikeQuery
Limit the number of records to be returned by this query.
func (*NoteLikeQuery) Offset ¶
func (nlq *NoteLikeQuery) Offset(offset int) *NoteLikeQuery
Offset to start from.
func (*NoteLikeQuery) Only ¶
func (nlq *NoteLikeQuery) Only(ctx context.Context) (*NoteLike, error)
Only returns a single NoteLike entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one NoteLike entity is found. Returns a *NotFoundError when no NoteLike entities are found.
func (*NoteLikeQuery) OnlyID ¶
func (nlq *NoteLikeQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only NoteLike ID in the query. Returns a *NotSingularError when more than one NoteLike ID is found. Returns a *NotFoundError when no entities are found.
func (*NoteLikeQuery) OnlyIDX ¶
func (nlq *NoteLikeQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*NoteLikeQuery) OnlyX ¶
func (nlq *NoteLikeQuery) OnlyX(ctx context.Context) *NoteLike
OnlyX is like Only, but panics if an error occurs.
func (*NoteLikeQuery) Order ¶
func (nlq *NoteLikeQuery) Order(o ...notelike.OrderOption) *NoteLikeQuery
Order specifies how the records should be ordered.
func (*NoteLikeQuery) QueryNote ¶
func (nlq *NoteLikeQuery) QueryNote() *NoteQuery
QueryNote chains the current query on the "note" edge.
func (*NoteLikeQuery) QueryUser ¶
func (nlq *NoteLikeQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*NoteLikeQuery) Select ¶
func (nlq *NoteLikeQuery) Select(fields ...string) *NoteLikeSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct {
CreatedAt time.Time `json:"created_at,omitempty"`
}
client.NoteLike.Query().
Select(notelike.FieldCreatedAt).
Scan(ctx, &v)
func (*NoteLikeQuery) Unique ¶
func (nlq *NoteLikeQuery) Unique(unique bool) *NoteLikeQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*NoteLikeQuery) Where ¶
func (nlq *NoteLikeQuery) Where(ps ...predicate.NoteLike) *NoteLikeQuery
Where adds a new predicate for the NoteLikeQuery builder.
func (*NoteLikeQuery) WithNote ¶
func (nlq *NoteLikeQuery) WithNote(opts ...func(*NoteQuery)) *NoteLikeQuery
WithNote tells the query-builder to eager-load the nodes that are connected to the "note" edge. The optional arguments are used to configure the query builder of the edge.
func (*NoteLikeQuery) WithUser ¶
func (nlq *NoteLikeQuery) WithUser(opts ...func(*UserQuery)) *NoteLikeQuery
WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.
type NoteLikeSelect ¶
type NoteLikeSelect struct {
*NoteLikeQuery
// contains filtered or unexported fields
}
NoteLikeSelect is the builder for selecting fields of NoteLike entities.
func (*NoteLikeSelect) Aggregate ¶
func (nls *NoteLikeSelect) Aggregate(fns ...AggregateFunc) *NoteLikeSelect
Aggregate adds the given aggregation functions to the selector query.
func (*NoteLikeSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*NoteLikeSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*NoteLikeSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*NoteLikeSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*NoteLikeSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*NoteLikeSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*NoteLikeSelect) Scan ¶
func (nls *NoteLikeSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*NoteLikeSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type NoteLikeUpdate ¶
type NoteLikeUpdate struct {
// contains filtered or unexported fields
}
NoteLikeUpdate is the builder for updating NoteLike entities.
func (*NoteLikeUpdate) ClearNote ¶
func (nlu *NoteLikeUpdate) ClearNote() *NoteLikeUpdate
ClearNote clears the "note" edge to the Note entity.
func (*NoteLikeUpdate) ClearUser ¶
func (nlu *NoteLikeUpdate) ClearUser() *NoteLikeUpdate
ClearUser clears the "user" edge to the User entity.
func (*NoteLikeUpdate) Exec ¶
func (nlu *NoteLikeUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*NoteLikeUpdate) ExecX ¶
func (nlu *NoteLikeUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NoteLikeUpdate) Mutation ¶
func (nlu *NoteLikeUpdate) Mutation() *NoteLikeMutation
Mutation returns the NoteLikeMutation object of the builder.
func (*NoteLikeUpdate) Save ¶
func (nlu *NoteLikeUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*NoteLikeUpdate) SaveX ¶
func (nlu *NoteLikeUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*NoteLikeUpdate) SetNote ¶
func (nlu *NoteLikeUpdate) SetNote(n *Note) *NoteLikeUpdate
SetNote sets the "note" edge to the Note entity.
func (*NoteLikeUpdate) SetNoteID ¶
func (nlu *NoteLikeUpdate) SetNoteID(id int) *NoteLikeUpdate
SetNoteID sets the "note" edge to the Note entity by ID.
func (*NoteLikeUpdate) SetUser ¶
func (nlu *NoteLikeUpdate) SetUser(u *User) *NoteLikeUpdate
SetUser sets the "user" edge to the User entity.
func (*NoteLikeUpdate) SetUserID ¶
func (nlu *NoteLikeUpdate) SetUserID(id int) *NoteLikeUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*NoteLikeUpdate) Where ¶
func (nlu *NoteLikeUpdate) Where(ps ...predicate.NoteLike) *NoteLikeUpdate
Where appends a list predicates to the NoteLikeUpdate builder.
type NoteLikeUpdateOne ¶
type NoteLikeUpdateOne struct {
// contains filtered or unexported fields
}
NoteLikeUpdateOne is the builder for updating a single NoteLike entity.
func (*NoteLikeUpdateOne) ClearNote ¶
func (nluo *NoteLikeUpdateOne) ClearNote() *NoteLikeUpdateOne
ClearNote clears the "note" edge to the Note entity.
func (*NoteLikeUpdateOne) ClearUser ¶
func (nluo *NoteLikeUpdateOne) ClearUser() *NoteLikeUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*NoteLikeUpdateOne) Exec ¶
func (nluo *NoteLikeUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*NoteLikeUpdateOne) ExecX ¶
func (nluo *NoteLikeUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NoteLikeUpdateOne) Mutation ¶
func (nluo *NoteLikeUpdateOne) Mutation() *NoteLikeMutation
Mutation returns the NoteLikeMutation object of the builder.
func (*NoteLikeUpdateOne) Save ¶
func (nluo *NoteLikeUpdateOne) Save(ctx context.Context) (*NoteLike, error)
Save executes the query and returns the updated NoteLike entity.
func (*NoteLikeUpdateOne) SaveX ¶
func (nluo *NoteLikeUpdateOne) SaveX(ctx context.Context) *NoteLike
SaveX is like Save, but panics if an error occurs.
func (*NoteLikeUpdateOne) Select ¶
func (nluo *NoteLikeUpdateOne) Select(field string, fields ...string) *NoteLikeUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*NoteLikeUpdateOne) SetNote ¶
func (nluo *NoteLikeUpdateOne) SetNote(n *Note) *NoteLikeUpdateOne
SetNote sets the "note" edge to the Note entity.
func (*NoteLikeUpdateOne) SetNoteID ¶
func (nluo *NoteLikeUpdateOne) SetNoteID(id int) *NoteLikeUpdateOne
SetNoteID sets the "note" edge to the Note entity by ID.
func (*NoteLikeUpdateOne) SetUser ¶
func (nluo *NoteLikeUpdateOne) SetUser(u *User) *NoteLikeUpdateOne
SetUser sets the "user" edge to the User entity.
func (*NoteLikeUpdateOne) SetUserID ¶
func (nluo *NoteLikeUpdateOne) SetUserID(id int) *NoteLikeUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*NoteLikeUpdateOne) Where ¶
func (nluo *NoteLikeUpdateOne) Where(ps ...predicate.NoteLike) *NoteLikeUpdateOne
Where appends a list predicates to the NoteLikeUpdate builder.
type NoteMutation ¶
type NoteMutation struct {
// contains filtered or unexported fields
}
NoteMutation represents an operation that mutates the Note nodes in the graph.
func (*NoteMutation) AddField ¶
func (m *NoteMutation) AddField(name string, value ent.Value) error
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 (*NoteMutation) AddLikeIDs ¶
func (m *NoteMutation) AddLikeIDs(ids ...int)
AddLikeIDs adds the "likes" edge to the NoteLike entity by ids.
func (*NoteMutation) AddRepostIDs ¶
func (m *NoteMutation) AddRepostIDs(ids ...int)
AddRepostIDs adds the "reposts" edge to the NoteRepost entity by ids.
func (*NoteMutation) AddedEdges ¶
func (m *NoteMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*NoteMutation) AddedField ¶
func (m *NoteMutation) AddedField(name string) (ent.Value, bool)
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 (*NoteMutation) AddedFields ¶
func (m *NoteMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*NoteMutation) AddedIDs ¶
func (m *NoteMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*NoteMutation) AiCurriculum ¶
func (m *NoteMutation) AiCurriculum() (r string, exists bool)
AiCurriculum returns the value of the "ai_curriculum" field in the mutation.
func (*NoteMutation) AiCurriculumCleared ¶
func (m *NoteMutation) AiCurriculumCleared() bool
AiCurriculumCleared returns if the "ai_curriculum" field was cleared in this mutation.
func (*NoteMutation) AiProcessing ¶
func (m *NoteMutation) AiProcessing() (r bool, exists bool)
AiProcessing returns the value of the "ai_processing" field in the mutation.
func (*NoteMutation) AppendResources ¶
func (m *NoteMutation) AppendResources(t []types.Resource)
AppendResources adds t to the "resources" field.
func (*NoteMutation) AppendedResources ¶
func (m *NoteMutation) AppendedResources() ([]types.Resource, bool)
AppendedResources returns the list of values that were appended to the "resources" field in this mutation.
func (*NoteMutation) ClearAiCurriculum ¶
func (m *NoteMutation) ClearAiCurriculum()
ClearAiCurriculum clears the value of the "ai_curriculum" field.
func (*NoteMutation) ClearContent ¶
func (m *NoteMutation) ClearContent()
ClearContent clears the value of the "content" field.
func (*NoteMutation) ClearDescription ¶
func (m *NoteMutation) ClearDescription()
ClearDescription clears the value of the "description" field.
func (*NoteMutation) ClearEdge ¶
func (m *NoteMutation) ClearEdge(name string) error
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 (*NoteMutation) ClearField ¶
func (m *NoteMutation) ClearField(name string) error
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 (*NoteMutation) ClearLikes ¶
func (m *NoteMutation) ClearLikes()
ClearLikes clears the "likes" edge to the NoteLike entity.
func (*NoteMutation) ClearOwner ¶
func (m *NoteMutation) ClearOwner()
ClearOwner clears the "owner" edge to the User entity.
func (*NoteMutation) ClearReposts ¶
func (m *NoteMutation) ClearReposts()
ClearReposts clears the "reposts" edge to the NoteRepost entity.
func (*NoteMutation) ClearResources ¶
func (m *NoteMutation) ClearResources()
ClearResources clears the value of the "resources" field.
func (*NoteMutation) ClearShareToken ¶
func (m *NoteMutation) ClearShareToken()
ClearShareToken clears the value of the "share_token" field.
func (*NoteMutation) ClearedEdges ¶
func (m *NoteMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*NoteMutation) ClearedFields ¶
func (m *NoteMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (NoteMutation) Client ¶
func (m NoteMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*NoteMutation) Content ¶
func (m *NoteMutation) Content() (r string, exists bool)
Content returns the value of the "content" field in the mutation.
func (*NoteMutation) ContentCleared ¶
func (m *NoteMutation) ContentCleared() bool
ContentCleared returns if the "content" field was cleared in this mutation.
func (*NoteMutation) CreatedAt ¶
func (m *NoteMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*NoteMutation) Description ¶
func (m *NoteMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*NoteMutation) DescriptionCleared ¶
func (m *NoteMutation) DescriptionCleared() bool
DescriptionCleared returns if the "description" field was cleared in this mutation.
func (*NoteMutation) EdgeCleared ¶
func (m *NoteMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*NoteMutation) Field ¶
func (m *NoteMutation) Field(name string) (ent.Value, bool)
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 (*NoteMutation) FieldCleared ¶
func (m *NoteMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*NoteMutation) Fields ¶
func (m *NoteMutation) Fields() []string
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 (*NoteMutation) ID ¶
func (m *NoteMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*NoteMutation) IDs ¶
func (m *NoteMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*NoteMutation) LikesCleared ¶
func (m *NoteMutation) LikesCleared() bool
LikesCleared reports if the "likes" edge to the NoteLike entity was cleared.
func (*NoteMutation) LikesIDs ¶
func (m *NoteMutation) LikesIDs() (ids []int)
LikesIDs returns the "likes" edge IDs in the mutation.
func (*NoteMutation) OldAiCurriculum ¶
func (m *NoteMutation) OldAiCurriculum(ctx context.Context) (v string, err error)
OldAiCurriculum returns the old "ai_curriculum" field's value of the Note entity. If the Note object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*NoteMutation) OldAiProcessing ¶
func (m *NoteMutation) OldAiProcessing(ctx context.Context) (v bool, err error)
OldAiProcessing returns the old "ai_processing" field's value of the Note entity. If the Note object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*NoteMutation) OldContent ¶
func (m *NoteMutation) OldContent(ctx context.Context) (v string, err error)
OldContent returns the old "content" field's value of the Note entity. If the Note object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*NoteMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Note entity. If the Note object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*NoteMutation) OldDescription ¶
func (m *NoteMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the Note entity. If the Note object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*NoteMutation) OldField ¶
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 (*NoteMutation) OldPermissionLevel ¶
func (m *NoteMutation) OldPermissionLevel(ctx context.Context) (v note.PermissionLevel, err error)
OldPermissionLevel returns the old "permission_level" field's value of the Note entity. If the Note object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*NoteMutation) OldResources ¶
OldResources returns the old "resources" field's value of the Note entity. If the Note object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*NoteMutation) OldShareToken ¶
func (m *NoteMutation) OldShareToken(ctx context.Context) (v string, err error)
OldShareToken returns the old "share_token" field's value of the Note entity. If the Note object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*NoteMutation) OldTitle ¶
func (m *NoteMutation) OldTitle(ctx context.Context) (v string, err error)
OldTitle returns the old "title" field's value of the Note entity. If the Note object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*NoteMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Note entity. If the Note object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*NoteMutation) OldVisibility ¶
func (m *NoteMutation) OldVisibility(ctx context.Context) (v note.Visibility, err error)
OldVisibility returns the old "visibility" field's value of the Note entity. If the Note object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*NoteMutation) OwnerCleared ¶
func (m *NoteMutation) OwnerCleared() bool
OwnerCleared reports if the "owner" edge to the User entity was cleared.
func (*NoteMutation) OwnerID ¶
func (m *NoteMutation) OwnerID() (id int, exists bool)
OwnerID returns the "owner" edge ID in the mutation.
func (*NoteMutation) OwnerIDs ¶
func (m *NoteMutation) OwnerIDs() (ids []int)
OwnerIDs returns the "owner" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OwnerID instead. It exists only for internal usage by the builders.
func (*NoteMutation) PermissionLevel ¶
func (m *NoteMutation) PermissionLevel() (r note.PermissionLevel, exists bool)
PermissionLevel returns the value of the "permission_level" field in the mutation.
func (*NoteMutation) RemoveLikeIDs ¶
func (m *NoteMutation) RemoveLikeIDs(ids ...int)
RemoveLikeIDs removes the "likes" edge to the NoteLike entity by IDs.
func (*NoteMutation) RemoveRepostIDs ¶
func (m *NoteMutation) RemoveRepostIDs(ids ...int)
RemoveRepostIDs removes the "reposts" edge to the NoteRepost entity by IDs.
func (*NoteMutation) RemovedEdges ¶
func (m *NoteMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*NoteMutation) RemovedIDs ¶
func (m *NoteMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*NoteMutation) RemovedLikesIDs ¶
func (m *NoteMutation) RemovedLikesIDs() (ids []int)
RemovedLikes returns the removed IDs of the "likes" edge to the NoteLike entity.
func (*NoteMutation) RemovedRepostsIDs ¶
func (m *NoteMutation) RemovedRepostsIDs() (ids []int)
RemovedReposts returns the removed IDs of the "reposts" edge to the NoteRepost entity.
func (*NoteMutation) RepostsCleared ¶
func (m *NoteMutation) RepostsCleared() bool
RepostsCleared reports if the "reposts" edge to the NoteRepost entity was cleared.
func (*NoteMutation) RepostsIDs ¶
func (m *NoteMutation) RepostsIDs() (ids []int)
RepostsIDs returns the "reposts" edge IDs in the mutation.
func (*NoteMutation) ResetAiCurriculum ¶
func (m *NoteMutation) ResetAiCurriculum()
ResetAiCurriculum resets all changes to the "ai_curriculum" field.
func (*NoteMutation) ResetAiProcessing ¶
func (m *NoteMutation) ResetAiProcessing()
ResetAiProcessing resets all changes to the "ai_processing" field.
func (*NoteMutation) ResetContent ¶
func (m *NoteMutation) ResetContent()
ResetContent resets all changes to the "content" field.
func (*NoteMutation) ResetCreatedAt ¶
func (m *NoteMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*NoteMutation) ResetDescription ¶
func (m *NoteMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*NoteMutation) ResetEdge ¶
func (m *NoteMutation) ResetEdge(name string) error
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 (*NoteMutation) ResetField ¶
func (m *NoteMutation) ResetField(name string) error
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 (*NoteMutation) ResetLikes ¶
func (m *NoteMutation) ResetLikes()
ResetLikes resets all changes to the "likes" edge.
func (*NoteMutation) ResetOwner ¶
func (m *NoteMutation) ResetOwner()
ResetOwner resets all changes to the "owner" edge.
func (*NoteMutation) ResetPermissionLevel ¶
func (m *NoteMutation) ResetPermissionLevel()
ResetPermissionLevel resets all changes to the "permission_level" field.
func (*NoteMutation) ResetReposts ¶
func (m *NoteMutation) ResetReposts()
ResetReposts resets all changes to the "reposts" edge.
func (*NoteMutation) ResetResources ¶
func (m *NoteMutation) ResetResources()
ResetResources resets all changes to the "resources" field.
func (*NoteMutation) ResetShareToken ¶
func (m *NoteMutation) ResetShareToken()
ResetShareToken resets all changes to the "share_token" field.
func (*NoteMutation) ResetTitle ¶
func (m *NoteMutation) ResetTitle()
ResetTitle resets all changes to the "title" field.
func (*NoteMutation) ResetUpdatedAt ¶
func (m *NoteMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*NoteMutation) ResetVisibility ¶
func (m *NoteMutation) ResetVisibility()
ResetVisibility resets all changes to the "visibility" field.
func (*NoteMutation) Resources ¶
func (m *NoteMutation) Resources() (r []types.Resource, exists bool)
Resources returns the value of the "resources" field in the mutation.
func (*NoteMutation) ResourcesCleared ¶
func (m *NoteMutation) ResourcesCleared() bool
ResourcesCleared returns if the "resources" field was cleared in this mutation.
func (*NoteMutation) SetAiCurriculum ¶
func (m *NoteMutation) SetAiCurriculum(s string)
SetAiCurriculum sets the "ai_curriculum" field.
func (*NoteMutation) SetAiProcessing ¶
func (m *NoteMutation) SetAiProcessing(b bool)
SetAiProcessing sets the "ai_processing" field.
func (*NoteMutation) SetContent ¶
func (m *NoteMutation) SetContent(s string)
SetContent sets the "content" field.
func (*NoteMutation) SetCreatedAt ¶
func (m *NoteMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*NoteMutation) SetDescription ¶
func (m *NoteMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*NoteMutation) SetField ¶
func (m *NoteMutation) SetField(name string, value ent.Value) error
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 (*NoteMutation) SetOp ¶
func (m *NoteMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*NoteMutation) SetOwnerID ¶
func (m *NoteMutation) SetOwnerID(id int)
SetOwnerID sets the "owner" edge to the User entity by id.
func (*NoteMutation) SetPermissionLevel ¶
func (m *NoteMutation) SetPermissionLevel(nl note.PermissionLevel)
SetPermissionLevel sets the "permission_level" field.
func (*NoteMutation) SetResources ¶
func (m *NoteMutation) SetResources(t []types.Resource)
SetResources sets the "resources" field.
func (*NoteMutation) SetShareToken ¶
func (m *NoteMutation) SetShareToken(s string)
SetShareToken sets the "share_token" field.
func (*NoteMutation) SetTitle ¶
func (m *NoteMutation) SetTitle(s string)
SetTitle sets the "title" field.
func (*NoteMutation) SetUpdatedAt ¶
func (m *NoteMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*NoteMutation) SetVisibility ¶
func (m *NoteMutation) SetVisibility(n note.Visibility)
SetVisibility sets the "visibility" field.
func (*NoteMutation) ShareToken ¶
func (m *NoteMutation) ShareToken() (r string, exists bool)
ShareToken returns the value of the "share_token" field in the mutation.
func (*NoteMutation) ShareTokenCleared ¶
func (m *NoteMutation) ShareTokenCleared() bool
ShareTokenCleared returns if the "share_token" field was cleared in this mutation.
func (*NoteMutation) Title ¶
func (m *NoteMutation) Title() (r string, exists bool)
Title returns the value of the "title" field in the mutation.
func (NoteMutation) Tx ¶
func (m NoteMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*NoteMutation) Type ¶
func (m *NoteMutation) Type() string
Type returns the node type of this mutation (Note).
func (*NoteMutation) UpdatedAt ¶
func (m *NoteMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*NoteMutation) Visibility ¶
func (m *NoteMutation) Visibility() (r note.Visibility, exists bool)
Visibility returns the value of the "visibility" field in the mutation.
func (*NoteMutation) Where ¶
func (m *NoteMutation) Where(ps ...predicate.Note)
Where appends a list predicates to the NoteMutation builder.
func (*NoteMutation) WhereP ¶
func (m *NoteMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the NoteMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type NoteQuery ¶
type NoteQuery struct {
// contains filtered or unexported fields
}
NoteQuery is the builder for querying Note entities.
func (*NoteQuery) Aggregate ¶
func (nq *NoteQuery) Aggregate(fns ...AggregateFunc) *NoteSelect
Aggregate returns a NoteSelect configured with the given aggregations.
func (*NoteQuery) Clone ¶
Clone returns a duplicate of the NoteQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*NoteQuery) First ¶
First returns the first Note entity from the query. Returns a *NotFoundError when no Note was found.
func (*NoteQuery) FirstID ¶
FirstID returns the first Note ID from the query. Returns a *NotFoundError when no Note ID was found.
func (*NoteQuery) GroupBy ¶
func (nq *NoteQuery) GroupBy(field string, fields ...string) *NoteGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct {
Title string `json:"title,omitempty"`
Count int `json:"count,omitempty"`
}
client.Note.Query().
GroupBy(note.FieldTitle).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*NoteQuery) Only ¶
Only returns a single Note entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Note entity is found. Returns a *NotFoundError when no Note entities are found.
func (*NoteQuery) OnlyID ¶
OnlyID is like Only, but returns the only Note ID in the query. Returns a *NotSingularError when more than one Note ID is found. Returns a *NotFoundError when no entities are found.
func (*NoteQuery) Order ¶
func (nq *NoteQuery) Order(o ...note.OrderOption) *NoteQuery
Order specifies how the records should be ordered.
func (*NoteQuery) QueryLikes ¶
func (nq *NoteQuery) QueryLikes() *NoteLikeQuery
QueryLikes chains the current query on the "likes" edge.
func (*NoteQuery) QueryOwner ¶
QueryOwner chains the current query on the "owner" edge.
func (*NoteQuery) QueryReposts ¶
func (nq *NoteQuery) QueryReposts() *NoteRepostQuery
QueryReposts chains the current query on the "reposts" edge.
func (*NoteQuery) Select ¶
func (nq *NoteQuery) Select(fields ...string) *NoteSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct {
Title string `json:"title,omitempty"`
}
client.Note.Query().
Select(note.FieldTitle).
Scan(ctx, &v)
func (*NoteQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*NoteQuery) WithLikes ¶
func (nq *NoteQuery) WithLikes(opts ...func(*NoteLikeQuery)) *NoteQuery
WithLikes tells the query-builder to eager-load the nodes that are connected to the "likes" edge. The optional arguments are used to configure the query builder of the edge.
func (*NoteQuery) WithOwner ¶
WithOwner tells the query-builder to eager-load the nodes that are connected to the "owner" edge. The optional arguments are used to configure the query builder of the edge.
func (*NoteQuery) WithReposts ¶
func (nq *NoteQuery) WithReposts(opts ...func(*NoteRepostQuery)) *NoteQuery
WithReposts tells the query-builder to eager-load the nodes that are connected to the "reposts" edge. The optional arguments are used to configure the query builder of the edge.
type NoteRepost ¶
type NoteRepost struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// Optional comment when reposting
Comment string `json:"comment,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the NoteRepostQuery when eager-loading is set.
Edges NoteRepostEdges `json:"edges"`
// contains filtered or unexported fields
}
NoteRepost is the model entity for the NoteRepost schema.
func (*NoteRepost) QueryNote ¶
func (nr *NoteRepost) QueryNote() *NoteQuery
QueryNote queries the "note" edge of the NoteRepost entity.
func (*NoteRepost) QueryUser ¶
func (nr *NoteRepost) QueryUser() *UserQuery
QueryUser queries the "user" edge of the NoteRepost entity.
func (*NoteRepost) String ¶
func (nr *NoteRepost) String() string
String implements the fmt.Stringer.
func (*NoteRepost) Unwrap ¶
func (nr *NoteRepost) Unwrap() *NoteRepost
Unwrap unwraps the NoteRepost entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*NoteRepost) Update ¶
func (nr *NoteRepost) Update() *NoteRepostUpdateOne
Update returns a builder for updating this NoteRepost. Note that you need to call NoteRepost.Unwrap() before calling this method if this NoteRepost was returned from a transaction, and the transaction was committed or rolled back.
type NoteRepostClient ¶
type NoteRepostClient struct {
// contains filtered or unexported fields
}
NoteRepostClient is a client for the NoteRepost schema.
func NewNoteRepostClient ¶
func NewNoteRepostClient(c config) *NoteRepostClient
NewNoteRepostClient returns a client for the NoteRepost from the given config.
func (*NoteRepostClient) Create ¶
func (c *NoteRepostClient) Create() *NoteRepostCreate
Create returns a builder for creating a NoteRepost entity.
func (*NoteRepostClient) CreateBulk ¶
func (c *NoteRepostClient) CreateBulk(builders ...*NoteRepostCreate) *NoteRepostCreateBulk
CreateBulk returns a builder for creating a bulk of NoteRepost entities.
func (*NoteRepostClient) Delete ¶
func (c *NoteRepostClient) Delete() *NoteRepostDelete
Delete returns a delete builder for NoteRepost.
func (*NoteRepostClient) DeleteOne ¶
func (c *NoteRepostClient) DeleteOne(nr *NoteRepost) *NoteRepostDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*NoteRepostClient) DeleteOneID ¶
func (c *NoteRepostClient) DeleteOneID(id int) *NoteRepostDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*NoteRepostClient) Get ¶
func (c *NoteRepostClient) Get(ctx context.Context, id int) (*NoteRepost, error)
Get returns a NoteRepost entity by its id.
func (*NoteRepostClient) GetX ¶
func (c *NoteRepostClient) GetX(ctx context.Context, id int) *NoteRepost
GetX is like Get, but panics if an error occurs.
func (*NoteRepostClient) Hooks ¶
func (c *NoteRepostClient) Hooks() []Hook
Hooks returns the client hooks.
func (*NoteRepostClient) Intercept ¶
func (c *NoteRepostClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `noterepost.Intercept(f(g(h())))`.
func (*NoteRepostClient) Interceptors ¶
func (c *NoteRepostClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*NoteRepostClient) MapCreateBulk ¶
func (c *NoteRepostClient) MapCreateBulk(slice any, setFunc func(*NoteRepostCreate, int)) *NoteRepostCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*NoteRepostClient) Query ¶
func (c *NoteRepostClient) Query() *NoteRepostQuery
Query returns a query builder for NoteRepost.
func (*NoteRepostClient) QueryNote ¶
func (c *NoteRepostClient) QueryNote(nr *NoteRepost) *NoteQuery
QueryNote queries the note edge of a NoteRepost.
func (*NoteRepostClient) QueryUser ¶
func (c *NoteRepostClient) QueryUser(nr *NoteRepost) *UserQuery
QueryUser queries the user edge of a NoteRepost.
func (*NoteRepostClient) Update ¶
func (c *NoteRepostClient) Update() *NoteRepostUpdate
Update returns an update builder for NoteRepost.
func (*NoteRepostClient) UpdateOne ¶
func (c *NoteRepostClient) UpdateOne(nr *NoteRepost) *NoteRepostUpdateOne
UpdateOne returns an update builder for the given entity.
func (*NoteRepostClient) UpdateOneID ¶
func (c *NoteRepostClient) UpdateOneID(id int) *NoteRepostUpdateOne
UpdateOneID returns an update builder for the given id.
func (*NoteRepostClient) Use ¶
func (c *NoteRepostClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `noterepost.Hooks(f(g(h())))`.
type NoteRepostCreate ¶
type NoteRepostCreate struct {
// contains filtered or unexported fields
}
NoteRepostCreate is the builder for creating a NoteRepost entity.
func (*NoteRepostCreate) Exec ¶
func (nrc *NoteRepostCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*NoteRepostCreate) ExecX ¶
func (nrc *NoteRepostCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NoteRepostCreate) Mutation ¶
func (nrc *NoteRepostCreate) Mutation() *NoteRepostMutation
Mutation returns the NoteRepostMutation object of the builder.
func (*NoteRepostCreate) Save ¶
func (nrc *NoteRepostCreate) Save(ctx context.Context) (*NoteRepost, error)
Save creates the NoteRepost in the database.
func (*NoteRepostCreate) SaveX ¶
func (nrc *NoteRepostCreate) SaveX(ctx context.Context) *NoteRepost
SaveX calls Save and panics if Save returns an error.
func (*NoteRepostCreate) SetComment ¶
func (nrc *NoteRepostCreate) SetComment(s string) *NoteRepostCreate
SetComment sets the "comment" field.
func (*NoteRepostCreate) SetCreatedAt ¶
func (nrc *NoteRepostCreate) SetCreatedAt(t time.Time) *NoteRepostCreate
SetCreatedAt sets the "created_at" field.
func (*NoteRepostCreate) SetNillableComment ¶
func (nrc *NoteRepostCreate) SetNillableComment(s *string) *NoteRepostCreate
SetNillableComment sets the "comment" field if the given value is not nil.
func (*NoteRepostCreate) SetNillableCreatedAt ¶
func (nrc *NoteRepostCreate) SetNillableCreatedAt(t *time.Time) *NoteRepostCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*NoteRepostCreate) SetNote ¶
func (nrc *NoteRepostCreate) SetNote(n *Note) *NoteRepostCreate
SetNote sets the "note" edge to the Note entity.
func (*NoteRepostCreate) SetNoteID ¶
func (nrc *NoteRepostCreate) SetNoteID(id int) *NoteRepostCreate
SetNoteID sets the "note" edge to the Note entity by ID.
func (*NoteRepostCreate) SetUser ¶
func (nrc *NoteRepostCreate) SetUser(u *User) *NoteRepostCreate
SetUser sets the "user" edge to the User entity.
func (*NoteRepostCreate) SetUserID ¶
func (nrc *NoteRepostCreate) SetUserID(id int) *NoteRepostCreate
SetUserID sets the "user" edge to the User entity by ID.
type NoteRepostCreateBulk ¶
type NoteRepostCreateBulk struct {
// contains filtered or unexported fields
}
NoteRepostCreateBulk is the builder for creating many NoteRepost entities in bulk.
func (*NoteRepostCreateBulk) Exec ¶
func (nrcb *NoteRepostCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*NoteRepostCreateBulk) ExecX ¶
func (nrcb *NoteRepostCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NoteRepostCreateBulk) Save ¶
func (nrcb *NoteRepostCreateBulk) Save(ctx context.Context) ([]*NoteRepost, error)
Save creates the NoteRepost entities in the database.
func (*NoteRepostCreateBulk) SaveX ¶
func (nrcb *NoteRepostCreateBulk) SaveX(ctx context.Context) []*NoteRepost
SaveX is like Save, but panics if an error occurs.
type NoteRepostDelete ¶
type NoteRepostDelete struct {
// contains filtered or unexported fields
}
NoteRepostDelete is the builder for deleting a NoteRepost entity.
func (*NoteRepostDelete) Exec ¶
func (nrd *NoteRepostDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*NoteRepostDelete) ExecX ¶
func (nrd *NoteRepostDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*NoteRepostDelete) Where ¶
func (nrd *NoteRepostDelete) Where(ps ...predicate.NoteRepost) *NoteRepostDelete
Where appends a list predicates to the NoteRepostDelete builder.
type NoteRepostDeleteOne ¶
type NoteRepostDeleteOne struct {
// contains filtered or unexported fields
}
NoteRepostDeleteOne is the builder for deleting a single NoteRepost entity.
func (*NoteRepostDeleteOne) Exec ¶
func (nrdo *NoteRepostDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*NoteRepostDeleteOne) ExecX ¶
func (nrdo *NoteRepostDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NoteRepostDeleteOne) Where ¶
func (nrdo *NoteRepostDeleteOne) Where(ps ...predicate.NoteRepost) *NoteRepostDeleteOne
Where appends a list predicates to the NoteRepostDelete builder.
type NoteRepostEdges ¶
type NoteRepostEdges struct {
// User holds the value of the user edge.
User *User `json:"user,omitempty"`
// Note holds the value of the note edge.
Note *Note `json:"note,omitempty"`
// contains filtered or unexported fields
}
NoteRepostEdges holds the relations/edges for other nodes in the graph.
func (NoteRepostEdges) NoteOrErr ¶
func (e NoteRepostEdges) NoteOrErr() (*Note, error)
NoteOrErr returns the Note value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (NoteRepostEdges) UserOrErr ¶
func (e NoteRepostEdges) UserOrErr() (*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type NoteRepostGroupBy ¶
type NoteRepostGroupBy struct {
// contains filtered or unexported fields
}
NoteRepostGroupBy is the group-by builder for NoteRepost entities.
func (*NoteRepostGroupBy) Aggregate ¶
func (nrgb *NoteRepostGroupBy) Aggregate(fns ...AggregateFunc) *NoteRepostGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*NoteRepostGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*NoteRepostGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*NoteRepostGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*NoteRepostGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*NoteRepostGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*NoteRepostGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*NoteRepostGroupBy) Scan ¶
func (nrgb *NoteRepostGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*NoteRepostGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type NoteRepostMutation ¶
type NoteRepostMutation struct {
// contains filtered or unexported fields
}
NoteRepostMutation represents an operation that mutates the NoteRepost nodes in the graph.
func (*NoteRepostMutation) AddField ¶
func (m *NoteRepostMutation) AddField(name string, value ent.Value) error
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 (*NoteRepostMutation) AddedEdges ¶
func (m *NoteRepostMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*NoteRepostMutation) AddedField ¶
func (m *NoteRepostMutation) AddedField(name string) (ent.Value, bool)
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 (*NoteRepostMutation) AddedFields ¶
func (m *NoteRepostMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*NoteRepostMutation) AddedIDs ¶
func (m *NoteRepostMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*NoteRepostMutation) ClearComment ¶
func (m *NoteRepostMutation) ClearComment()
ClearComment clears the value of the "comment" field.
func (*NoteRepostMutation) ClearEdge ¶
func (m *NoteRepostMutation) ClearEdge(name string) error
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 (*NoteRepostMutation) ClearField ¶
func (m *NoteRepostMutation) ClearField(name string) error
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 (*NoteRepostMutation) ClearNote ¶
func (m *NoteRepostMutation) ClearNote()
ClearNote clears the "note" edge to the Note entity.
func (*NoteRepostMutation) ClearUser ¶
func (m *NoteRepostMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*NoteRepostMutation) ClearedEdges ¶
func (m *NoteRepostMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*NoteRepostMutation) ClearedFields ¶
func (m *NoteRepostMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (NoteRepostMutation) Client ¶
func (m NoteRepostMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*NoteRepostMutation) Comment ¶
func (m *NoteRepostMutation) Comment() (r string, exists bool)
Comment returns the value of the "comment" field in the mutation.
func (*NoteRepostMutation) CommentCleared ¶
func (m *NoteRepostMutation) CommentCleared() bool
CommentCleared returns if the "comment" field was cleared in this mutation.
func (*NoteRepostMutation) CreatedAt ¶
func (m *NoteRepostMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*NoteRepostMutation) EdgeCleared ¶
func (m *NoteRepostMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*NoteRepostMutation) Field ¶
func (m *NoteRepostMutation) Field(name string) (ent.Value, bool)
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 (*NoteRepostMutation) FieldCleared ¶
func (m *NoteRepostMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*NoteRepostMutation) Fields ¶
func (m *NoteRepostMutation) Fields() []string
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 (*NoteRepostMutation) ID ¶
func (m *NoteRepostMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*NoteRepostMutation) IDs ¶
func (m *NoteRepostMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*NoteRepostMutation) NoteCleared ¶
func (m *NoteRepostMutation) NoteCleared() bool
NoteCleared reports if the "note" edge to the Note entity was cleared.
func (*NoteRepostMutation) NoteID ¶
func (m *NoteRepostMutation) NoteID() (id int, exists bool)
NoteID returns the "note" edge ID in the mutation.
func (*NoteRepostMutation) NoteIDs ¶
func (m *NoteRepostMutation) NoteIDs() (ids []int)
NoteIDs returns the "note" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use NoteID instead. It exists only for internal usage by the builders.
func (*NoteRepostMutation) OldComment ¶
func (m *NoteRepostMutation) OldComment(ctx context.Context) (v string, err error)
OldComment returns the old "comment" field's value of the NoteRepost entity. If the NoteRepost object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*NoteRepostMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the NoteRepost entity. If the NoteRepost object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*NoteRepostMutation) OldField ¶
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 (*NoteRepostMutation) RemovedEdges ¶
func (m *NoteRepostMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*NoteRepostMutation) RemovedIDs ¶
func (m *NoteRepostMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*NoteRepostMutation) ResetComment ¶
func (m *NoteRepostMutation) ResetComment()
ResetComment resets all changes to the "comment" field.
func (*NoteRepostMutation) ResetCreatedAt ¶
func (m *NoteRepostMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*NoteRepostMutation) ResetEdge ¶
func (m *NoteRepostMutation) ResetEdge(name string) error
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 (*NoteRepostMutation) ResetField ¶
func (m *NoteRepostMutation) ResetField(name string) error
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 (*NoteRepostMutation) ResetNote ¶
func (m *NoteRepostMutation) ResetNote()
ResetNote resets all changes to the "note" edge.
func (*NoteRepostMutation) ResetUser ¶
func (m *NoteRepostMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*NoteRepostMutation) SetComment ¶
func (m *NoteRepostMutation) SetComment(s string)
SetComment sets the "comment" field.
func (*NoteRepostMutation) SetCreatedAt ¶
func (m *NoteRepostMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*NoteRepostMutation) SetField ¶
func (m *NoteRepostMutation) SetField(name string, value ent.Value) error
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 (*NoteRepostMutation) SetNoteID ¶
func (m *NoteRepostMutation) SetNoteID(id int)
SetNoteID sets the "note" edge to the Note entity by id.
func (*NoteRepostMutation) SetOp ¶
func (m *NoteRepostMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*NoteRepostMutation) SetUserID ¶
func (m *NoteRepostMutation) SetUserID(id int)
SetUserID sets the "user" edge to the User entity by id.
func (NoteRepostMutation) Tx ¶
func (m NoteRepostMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*NoteRepostMutation) Type ¶
func (m *NoteRepostMutation) Type() string
Type returns the node type of this mutation (NoteRepost).
func (*NoteRepostMutation) UserCleared ¶
func (m *NoteRepostMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*NoteRepostMutation) UserID ¶
func (m *NoteRepostMutation) UserID() (id int, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*NoteRepostMutation) UserIDs ¶
func (m *NoteRepostMutation) UserIDs() (ids []int)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*NoteRepostMutation) Where ¶
func (m *NoteRepostMutation) Where(ps ...predicate.NoteRepost)
Where appends a list predicates to the NoteRepostMutation builder.
func (*NoteRepostMutation) WhereP ¶
func (m *NoteRepostMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the NoteRepostMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type NoteRepostQuery ¶
type NoteRepostQuery struct {
// contains filtered or unexported fields
}
NoteRepostQuery is the builder for querying NoteRepost entities.
func (*NoteRepostQuery) Aggregate ¶
func (nrq *NoteRepostQuery) Aggregate(fns ...AggregateFunc) *NoteRepostSelect
Aggregate returns a NoteRepostSelect configured with the given aggregations.
func (*NoteRepostQuery) All ¶
func (nrq *NoteRepostQuery) All(ctx context.Context) ([]*NoteRepost, error)
All executes the query and returns a list of NoteReposts.
func (*NoteRepostQuery) AllX ¶
func (nrq *NoteRepostQuery) AllX(ctx context.Context) []*NoteRepost
AllX is like All, but panics if an error occurs.
func (*NoteRepostQuery) Clone ¶
func (nrq *NoteRepostQuery) Clone() *NoteRepostQuery
Clone returns a duplicate of the NoteRepostQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*NoteRepostQuery) Count ¶
func (nrq *NoteRepostQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*NoteRepostQuery) CountX ¶
func (nrq *NoteRepostQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*NoteRepostQuery) Exist ¶
func (nrq *NoteRepostQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*NoteRepostQuery) ExistX ¶
func (nrq *NoteRepostQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*NoteRepostQuery) First ¶
func (nrq *NoteRepostQuery) First(ctx context.Context) (*NoteRepost, error)
First returns the first NoteRepost entity from the query. Returns a *NotFoundError when no NoteRepost was found.
func (*NoteRepostQuery) FirstID ¶
func (nrq *NoteRepostQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first NoteRepost ID from the query. Returns a *NotFoundError when no NoteRepost ID was found.
func (*NoteRepostQuery) FirstIDX ¶
func (nrq *NoteRepostQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*NoteRepostQuery) FirstX ¶
func (nrq *NoteRepostQuery) FirstX(ctx context.Context) *NoteRepost
FirstX is like First, but panics if an error occurs.
func (*NoteRepostQuery) GroupBy ¶
func (nrq *NoteRepostQuery) GroupBy(field string, fields ...string) *NoteRepostGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct {
Comment string `json:"comment,omitempty"`
Count int `json:"count,omitempty"`
}
client.NoteRepost.Query().
GroupBy(noterepost.FieldComment).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*NoteRepostQuery) IDs ¶
func (nrq *NoteRepostQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of NoteRepost IDs.
func (*NoteRepostQuery) IDsX ¶
func (nrq *NoteRepostQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*NoteRepostQuery) Limit ¶
func (nrq *NoteRepostQuery) Limit(limit int) *NoteRepostQuery
Limit the number of records to be returned by this query.
func (*NoteRepostQuery) Offset ¶
func (nrq *NoteRepostQuery) Offset(offset int) *NoteRepostQuery
Offset to start from.
func (*NoteRepostQuery) Only ¶
func (nrq *NoteRepostQuery) Only(ctx context.Context) (*NoteRepost, error)
Only returns a single NoteRepost entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one NoteRepost entity is found. Returns a *NotFoundError when no NoteRepost entities are found.
func (*NoteRepostQuery) OnlyID ¶
func (nrq *NoteRepostQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only NoteRepost ID in the query. Returns a *NotSingularError when more than one NoteRepost ID is found. Returns a *NotFoundError when no entities are found.
func (*NoteRepostQuery) OnlyIDX ¶
func (nrq *NoteRepostQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*NoteRepostQuery) OnlyX ¶
func (nrq *NoteRepostQuery) OnlyX(ctx context.Context) *NoteRepost
OnlyX is like Only, but panics if an error occurs.
func (*NoteRepostQuery) Order ¶
func (nrq *NoteRepostQuery) Order(o ...noterepost.OrderOption) *NoteRepostQuery
Order specifies how the records should be ordered.
func (*NoteRepostQuery) QueryNote ¶
func (nrq *NoteRepostQuery) QueryNote() *NoteQuery
QueryNote chains the current query on the "note" edge.
func (*NoteRepostQuery) QueryUser ¶
func (nrq *NoteRepostQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*NoteRepostQuery) Select ¶
func (nrq *NoteRepostQuery) Select(fields ...string) *NoteRepostSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct {
Comment string `json:"comment,omitempty"`
}
client.NoteRepost.Query().
Select(noterepost.FieldComment).
Scan(ctx, &v)
func (*NoteRepostQuery) Unique ¶
func (nrq *NoteRepostQuery) Unique(unique bool) *NoteRepostQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*NoteRepostQuery) Where ¶
func (nrq *NoteRepostQuery) Where(ps ...predicate.NoteRepost) *NoteRepostQuery
Where adds a new predicate for the NoteRepostQuery builder.
func (*NoteRepostQuery) WithNote ¶
func (nrq *NoteRepostQuery) WithNote(opts ...func(*NoteQuery)) *NoteRepostQuery
WithNote tells the query-builder to eager-load the nodes that are connected to the "note" edge. The optional arguments are used to configure the query builder of the edge.
func (*NoteRepostQuery) WithUser ¶
func (nrq *NoteRepostQuery) WithUser(opts ...func(*UserQuery)) *NoteRepostQuery
WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.
type NoteRepostSelect ¶
type NoteRepostSelect struct {
*NoteRepostQuery
// contains filtered or unexported fields
}
NoteRepostSelect is the builder for selecting fields of NoteRepost entities.
func (*NoteRepostSelect) Aggregate ¶
func (nrs *NoteRepostSelect) Aggregate(fns ...AggregateFunc) *NoteRepostSelect
Aggregate adds the given aggregation functions to the selector query.
func (*NoteRepostSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*NoteRepostSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*NoteRepostSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*NoteRepostSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*NoteRepostSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*NoteRepostSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*NoteRepostSelect) Scan ¶
func (nrs *NoteRepostSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*NoteRepostSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type NoteRepostUpdate ¶
type NoteRepostUpdate struct {
// contains filtered or unexported fields
}
NoteRepostUpdate is the builder for updating NoteRepost entities.
func (*NoteRepostUpdate) ClearComment ¶
func (nru *NoteRepostUpdate) ClearComment() *NoteRepostUpdate
ClearComment clears the value of the "comment" field.
func (*NoteRepostUpdate) ClearNote ¶
func (nru *NoteRepostUpdate) ClearNote() *NoteRepostUpdate
ClearNote clears the "note" edge to the Note entity.
func (*NoteRepostUpdate) ClearUser ¶
func (nru *NoteRepostUpdate) ClearUser() *NoteRepostUpdate
ClearUser clears the "user" edge to the User entity.
func (*NoteRepostUpdate) Exec ¶
func (nru *NoteRepostUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*NoteRepostUpdate) ExecX ¶
func (nru *NoteRepostUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NoteRepostUpdate) Mutation ¶
func (nru *NoteRepostUpdate) Mutation() *NoteRepostMutation
Mutation returns the NoteRepostMutation object of the builder.
func (*NoteRepostUpdate) Save ¶
func (nru *NoteRepostUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*NoteRepostUpdate) SaveX ¶
func (nru *NoteRepostUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*NoteRepostUpdate) SetComment ¶
func (nru *NoteRepostUpdate) SetComment(s string) *NoteRepostUpdate
SetComment sets the "comment" field.
func (*NoteRepostUpdate) SetNillableComment ¶
func (nru *NoteRepostUpdate) SetNillableComment(s *string) *NoteRepostUpdate
SetNillableComment sets the "comment" field if the given value is not nil.
func (*NoteRepostUpdate) SetNote ¶
func (nru *NoteRepostUpdate) SetNote(n *Note) *NoteRepostUpdate
SetNote sets the "note" edge to the Note entity.
func (*NoteRepostUpdate) SetNoteID ¶
func (nru *NoteRepostUpdate) SetNoteID(id int) *NoteRepostUpdate
SetNoteID sets the "note" edge to the Note entity by ID.
func (*NoteRepostUpdate) SetUser ¶
func (nru *NoteRepostUpdate) SetUser(u *User) *NoteRepostUpdate
SetUser sets the "user" edge to the User entity.
func (*NoteRepostUpdate) SetUserID ¶
func (nru *NoteRepostUpdate) SetUserID(id int) *NoteRepostUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*NoteRepostUpdate) Where ¶
func (nru *NoteRepostUpdate) Where(ps ...predicate.NoteRepost) *NoteRepostUpdate
Where appends a list predicates to the NoteRepostUpdate builder.
type NoteRepostUpdateOne ¶
type NoteRepostUpdateOne struct {
// contains filtered or unexported fields
}
NoteRepostUpdateOne is the builder for updating a single NoteRepost entity.
func (*NoteRepostUpdateOne) ClearComment ¶
func (nruo *NoteRepostUpdateOne) ClearComment() *NoteRepostUpdateOne
ClearComment clears the value of the "comment" field.
func (*NoteRepostUpdateOne) ClearNote ¶
func (nruo *NoteRepostUpdateOne) ClearNote() *NoteRepostUpdateOne
ClearNote clears the "note" edge to the Note entity.
func (*NoteRepostUpdateOne) ClearUser ¶
func (nruo *NoteRepostUpdateOne) ClearUser() *NoteRepostUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*NoteRepostUpdateOne) Exec ¶
func (nruo *NoteRepostUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*NoteRepostUpdateOne) ExecX ¶
func (nruo *NoteRepostUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NoteRepostUpdateOne) Mutation ¶
func (nruo *NoteRepostUpdateOne) Mutation() *NoteRepostMutation
Mutation returns the NoteRepostMutation object of the builder.
func (*NoteRepostUpdateOne) Save ¶
func (nruo *NoteRepostUpdateOne) Save(ctx context.Context) (*NoteRepost, error)
Save executes the query and returns the updated NoteRepost entity.
func (*NoteRepostUpdateOne) SaveX ¶
func (nruo *NoteRepostUpdateOne) SaveX(ctx context.Context) *NoteRepost
SaveX is like Save, but panics if an error occurs.
func (*NoteRepostUpdateOne) Select ¶
func (nruo *NoteRepostUpdateOne) Select(field string, fields ...string) *NoteRepostUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*NoteRepostUpdateOne) SetComment ¶
func (nruo *NoteRepostUpdateOne) SetComment(s string) *NoteRepostUpdateOne
SetComment sets the "comment" field.
func (*NoteRepostUpdateOne) SetNillableComment ¶
func (nruo *NoteRepostUpdateOne) SetNillableComment(s *string) *NoteRepostUpdateOne
SetNillableComment sets the "comment" field if the given value is not nil.
func (*NoteRepostUpdateOne) SetNote ¶
func (nruo *NoteRepostUpdateOne) SetNote(n *Note) *NoteRepostUpdateOne
SetNote sets the "note" edge to the Note entity.
func (*NoteRepostUpdateOne) SetNoteID ¶
func (nruo *NoteRepostUpdateOne) SetNoteID(id int) *NoteRepostUpdateOne
SetNoteID sets the "note" edge to the Note entity by ID.
func (*NoteRepostUpdateOne) SetUser ¶
func (nruo *NoteRepostUpdateOne) SetUser(u *User) *NoteRepostUpdateOne
SetUser sets the "user" edge to the User entity.
func (*NoteRepostUpdateOne) SetUserID ¶
func (nruo *NoteRepostUpdateOne) SetUserID(id int) *NoteRepostUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*NoteRepostUpdateOne) Where ¶
func (nruo *NoteRepostUpdateOne) Where(ps ...predicate.NoteRepost) *NoteRepostUpdateOne
Where appends a list predicates to the NoteRepostUpdate builder.
type NoteSelect ¶
type NoteSelect struct {
*NoteQuery
// contains filtered or unexported fields
}
NoteSelect is the builder for selecting fields of Note entities.
func (*NoteSelect) Aggregate ¶
func (ns *NoteSelect) Aggregate(fns ...AggregateFunc) *NoteSelect
Aggregate adds the given aggregation functions to the selector query.
func (*NoteSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*NoteSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*NoteSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*NoteSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*NoteSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*NoteSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*NoteSelect) Scan ¶
func (ns *NoteSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*NoteSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type NoteUpdate ¶
type NoteUpdate struct {
// contains filtered or unexported fields
}
NoteUpdate is the builder for updating Note entities.
func (*NoteUpdate) AddLikeIDs ¶
func (nu *NoteUpdate) AddLikeIDs(ids ...int) *NoteUpdate
AddLikeIDs adds the "likes" edge to the NoteLike entity by IDs.
func (*NoteUpdate) AddLikes ¶
func (nu *NoteUpdate) AddLikes(n ...*NoteLike) *NoteUpdate
AddLikes adds the "likes" edges to the NoteLike entity.
func (*NoteUpdate) AddRepostIDs ¶
func (nu *NoteUpdate) AddRepostIDs(ids ...int) *NoteUpdate
AddRepostIDs adds the "reposts" edge to the NoteRepost entity by IDs.
func (*NoteUpdate) AddReposts ¶
func (nu *NoteUpdate) AddReposts(n ...*NoteRepost) *NoteUpdate
AddReposts adds the "reposts" edges to the NoteRepost entity.
func (*NoteUpdate) AppendResources ¶
func (nu *NoteUpdate) AppendResources(t []types.Resource) *NoteUpdate
AppendResources appends t to the "resources" field.
func (*NoteUpdate) ClearAiCurriculum ¶
func (nu *NoteUpdate) ClearAiCurriculum() *NoteUpdate
ClearAiCurriculum clears the value of the "ai_curriculum" field.
func (*NoteUpdate) ClearContent ¶
func (nu *NoteUpdate) ClearContent() *NoteUpdate
ClearContent clears the value of the "content" field.
func (*NoteUpdate) ClearDescription ¶
func (nu *NoteUpdate) ClearDescription() *NoteUpdate
ClearDescription clears the value of the "description" field.
func (*NoteUpdate) ClearLikes ¶
func (nu *NoteUpdate) ClearLikes() *NoteUpdate
ClearLikes clears all "likes" edges to the NoteLike entity.
func (*NoteUpdate) ClearOwner ¶
func (nu *NoteUpdate) ClearOwner() *NoteUpdate
ClearOwner clears the "owner" edge to the User entity.
func (*NoteUpdate) ClearReposts ¶
func (nu *NoteUpdate) ClearReposts() *NoteUpdate
ClearReposts clears all "reposts" edges to the NoteRepost entity.
func (*NoteUpdate) ClearResources ¶
func (nu *NoteUpdate) ClearResources() *NoteUpdate
ClearResources clears the value of the "resources" field.
func (*NoteUpdate) ClearShareToken ¶
func (nu *NoteUpdate) ClearShareToken() *NoteUpdate
ClearShareToken clears the value of the "share_token" field.
func (*NoteUpdate) Exec ¶
func (nu *NoteUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*NoteUpdate) ExecX ¶
func (nu *NoteUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NoteUpdate) Mutation ¶
func (nu *NoteUpdate) Mutation() *NoteMutation
Mutation returns the NoteMutation object of the builder.
func (*NoteUpdate) RemoveLikeIDs ¶
func (nu *NoteUpdate) RemoveLikeIDs(ids ...int) *NoteUpdate
RemoveLikeIDs removes the "likes" edge to NoteLike entities by IDs.
func (*NoteUpdate) RemoveLikes ¶
func (nu *NoteUpdate) RemoveLikes(n ...*NoteLike) *NoteUpdate
RemoveLikes removes "likes" edges to NoteLike entities.
func (*NoteUpdate) RemoveRepostIDs ¶
func (nu *NoteUpdate) RemoveRepostIDs(ids ...int) *NoteUpdate
RemoveRepostIDs removes the "reposts" edge to NoteRepost entities by IDs.
func (*NoteUpdate) RemoveReposts ¶
func (nu *NoteUpdate) RemoveReposts(n ...*NoteRepost) *NoteUpdate
RemoveReposts removes "reposts" edges to NoteRepost entities.
func (*NoteUpdate) Save ¶
func (nu *NoteUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*NoteUpdate) SaveX ¶
func (nu *NoteUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*NoteUpdate) SetAiCurriculum ¶
func (nu *NoteUpdate) SetAiCurriculum(s string) *NoteUpdate
SetAiCurriculum sets the "ai_curriculum" field.
func (*NoteUpdate) SetAiProcessing ¶
func (nu *NoteUpdate) SetAiProcessing(b bool) *NoteUpdate
SetAiProcessing sets the "ai_processing" field.
func (*NoteUpdate) SetContent ¶
func (nu *NoteUpdate) SetContent(s string) *NoteUpdate
SetContent sets the "content" field.
func (*NoteUpdate) SetDescription ¶
func (nu *NoteUpdate) SetDescription(s string) *NoteUpdate
SetDescription sets the "description" field.
func (*NoteUpdate) SetNillableAiCurriculum ¶
func (nu *NoteUpdate) SetNillableAiCurriculum(s *string) *NoteUpdate
SetNillableAiCurriculum sets the "ai_curriculum" field if the given value is not nil.
func (*NoteUpdate) SetNillableAiProcessing ¶
func (nu *NoteUpdate) SetNillableAiProcessing(b *bool) *NoteUpdate
SetNillableAiProcessing sets the "ai_processing" field if the given value is not nil.
func (*NoteUpdate) SetNillableContent ¶
func (nu *NoteUpdate) SetNillableContent(s *string) *NoteUpdate
SetNillableContent sets the "content" field if the given value is not nil.
func (*NoteUpdate) SetNillableDescription ¶
func (nu *NoteUpdate) SetNillableDescription(s *string) *NoteUpdate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*NoteUpdate) SetNillablePermissionLevel ¶
func (nu *NoteUpdate) SetNillablePermissionLevel(nl *note.PermissionLevel) *NoteUpdate
SetNillablePermissionLevel sets the "permission_level" field if the given value is not nil.
func (*NoteUpdate) SetNillableShareToken ¶
func (nu *NoteUpdate) SetNillableShareToken(s *string) *NoteUpdate
SetNillableShareToken sets the "share_token" field if the given value is not nil.
func (*NoteUpdate) SetNillableTitle ¶
func (nu *NoteUpdate) SetNillableTitle(s *string) *NoteUpdate
SetNillableTitle sets the "title" field if the given value is not nil.
func (*NoteUpdate) SetNillableVisibility ¶
func (nu *NoteUpdate) SetNillableVisibility(n *note.Visibility) *NoteUpdate
SetNillableVisibility sets the "visibility" field if the given value is not nil.
func (*NoteUpdate) SetOwner ¶
func (nu *NoteUpdate) SetOwner(u *User) *NoteUpdate
SetOwner sets the "owner" edge to the User entity.
func (*NoteUpdate) SetOwnerID ¶
func (nu *NoteUpdate) SetOwnerID(id int) *NoteUpdate
SetOwnerID sets the "owner" edge to the User entity by ID.
func (*NoteUpdate) SetPermissionLevel ¶
func (nu *NoteUpdate) SetPermissionLevel(nl note.PermissionLevel) *NoteUpdate
SetPermissionLevel sets the "permission_level" field.
func (*NoteUpdate) SetResources ¶
func (nu *NoteUpdate) SetResources(t []types.Resource) *NoteUpdate
SetResources sets the "resources" field.
func (*NoteUpdate) SetShareToken ¶
func (nu *NoteUpdate) SetShareToken(s string) *NoteUpdate
SetShareToken sets the "share_token" field.
func (*NoteUpdate) SetTitle ¶
func (nu *NoteUpdate) SetTitle(s string) *NoteUpdate
SetTitle sets the "title" field.
func (*NoteUpdate) SetUpdatedAt ¶
func (nu *NoteUpdate) SetUpdatedAt(t time.Time) *NoteUpdate
SetUpdatedAt sets the "updated_at" field.
func (*NoteUpdate) SetVisibility ¶
func (nu *NoteUpdate) SetVisibility(n note.Visibility) *NoteUpdate
SetVisibility sets the "visibility" field.
func (*NoteUpdate) Where ¶
func (nu *NoteUpdate) Where(ps ...predicate.Note) *NoteUpdate
Where appends a list predicates to the NoteUpdate builder.
type NoteUpdateOne ¶
type NoteUpdateOne struct {
// contains filtered or unexported fields
}
NoteUpdateOne is the builder for updating a single Note entity.
func (*NoteUpdateOne) AddLikeIDs ¶
func (nuo *NoteUpdateOne) AddLikeIDs(ids ...int) *NoteUpdateOne
AddLikeIDs adds the "likes" edge to the NoteLike entity by IDs.
func (*NoteUpdateOne) AddLikes ¶
func (nuo *NoteUpdateOne) AddLikes(n ...*NoteLike) *NoteUpdateOne
AddLikes adds the "likes" edges to the NoteLike entity.
func (*NoteUpdateOne) AddRepostIDs ¶
func (nuo *NoteUpdateOne) AddRepostIDs(ids ...int) *NoteUpdateOne
AddRepostIDs adds the "reposts" edge to the NoteRepost entity by IDs.
func (*NoteUpdateOne) AddReposts ¶
func (nuo *NoteUpdateOne) AddReposts(n ...*NoteRepost) *NoteUpdateOne
AddReposts adds the "reposts" edges to the NoteRepost entity.
func (*NoteUpdateOne) AppendResources ¶
func (nuo *NoteUpdateOne) AppendResources(t []types.Resource) *NoteUpdateOne
AppendResources appends t to the "resources" field.
func (*NoteUpdateOne) ClearAiCurriculum ¶
func (nuo *NoteUpdateOne) ClearAiCurriculum() *NoteUpdateOne
ClearAiCurriculum clears the value of the "ai_curriculum" field.
func (*NoteUpdateOne) ClearContent ¶
func (nuo *NoteUpdateOne) ClearContent() *NoteUpdateOne
ClearContent clears the value of the "content" field.
func (*NoteUpdateOne) ClearDescription ¶
func (nuo *NoteUpdateOne) ClearDescription() *NoteUpdateOne
ClearDescription clears the value of the "description" field.
func (*NoteUpdateOne) ClearLikes ¶
func (nuo *NoteUpdateOne) ClearLikes() *NoteUpdateOne
ClearLikes clears all "likes" edges to the NoteLike entity.
func (*NoteUpdateOne) ClearOwner ¶
func (nuo *NoteUpdateOne) ClearOwner() *NoteUpdateOne
ClearOwner clears the "owner" edge to the User entity.
func (*NoteUpdateOne) ClearReposts ¶
func (nuo *NoteUpdateOne) ClearReposts() *NoteUpdateOne
ClearReposts clears all "reposts" edges to the NoteRepost entity.
func (*NoteUpdateOne) ClearResources ¶
func (nuo *NoteUpdateOne) ClearResources() *NoteUpdateOne
ClearResources clears the value of the "resources" field.
func (*NoteUpdateOne) ClearShareToken ¶
func (nuo *NoteUpdateOne) ClearShareToken() *NoteUpdateOne
ClearShareToken clears the value of the "share_token" field.
func (*NoteUpdateOne) Exec ¶
func (nuo *NoteUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*NoteUpdateOne) ExecX ¶
func (nuo *NoteUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NoteUpdateOne) Mutation ¶
func (nuo *NoteUpdateOne) Mutation() *NoteMutation
Mutation returns the NoteMutation object of the builder.
func (*NoteUpdateOne) RemoveLikeIDs ¶
func (nuo *NoteUpdateOne) RemoveLikeIDs(ids ...int) *NoteUpdateOne
RemoveLikeIDs removes the "likes" edge to NoteLike entities by IDs.
func (*NoteUpdateOne) RemoveLikes ¶
func (nuo *NoteUpdateOne) RemoveLikes(n ...*NoteLike) *NoteUpdateOne
RemoveLikes removes "likes" edges to NoteLike entities.
func (*NoteUpdateOne) RemoveRepostIDs ¶
func (nuo *NoteUpdateOne) RemoveRepostIDs(ids ...int) *NoteUpdateOne
RemoveRepostIDs removes the "reposts" edge to NoteRepost entities by IDs.
func (*NoteUpdateOne) RemoveReposts ¶
func (nuo *NoteUpdateOne) RemoveReposts(n ...*NoteRepost) *NoteUpdateOne
RemoveReposts removes "reposts" edges to NoteRepost entities.
func (*NoteUpdateOne) Save ¶
func (nuo *NoteUpdateOne) Save(ctx context.Context) (*Note, error)
Save executes the query and returns the updated Note entity.
func (*NoteUpdateOne) SaveX ¶
func (nuo *NoteUpdateOne) SaveX(ctx context.Context) *Note
SaveX is like Save, but panics if an error occurs.
func (*NoteUpdateOne) Select ¶
func (nuo *NoteUpdateOne) Select(field string, fields ...string) *NoteUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*NoteUpdateOne) SetAiCurriculum ¶
func (nuo *NoteUpdateOne) SetAiCurriculum(s string) *NoteUpdateOne
SetAiCurriculum sets the "ai_curriculum" field.
func (*NoteUpdateOne) SetAiProcessing ¶
func (nuo *NoteUpdateOne) SetAiProcessing(b bool) *NoteUpdateOne
SetAiProcessing sets the "ai_processing" field.
func (*NoteUpdateOne) SetContent ¶
func (nuo *NoteUpdateOne) SetContent(s string) *NoteUpdateOne
SetContent sets the "content" field.
func (*NoteUpdateOne) SetDescription ¶
func (nuo *NoteUpdateOne) SetDescription(s string) *NoteUpdateOne
SetDescription sets the "description" field.
func (*NoteUpdateOne) SetNillableAiCurriculum ¶
func (nuo *NoteUpdateOne) SetNillableAiCurriculum(s *string) *NoteUpdateOne
SetNillableAiCurriculum sets the "ai_curriculum" field if the given value is not nil.
func (*NoteUpdateOne) SetNillableAiProcessing ¶
func (nuo *NoteUpdateOne) SetNillableAiProcessing(b *bool) *NoteUpdateOne
SetNillableAiProcessing sets the "ai_processing" field if the given value is not nil.
func (*NoteUpdateOne) SetNillableContent ¶
func (nuo *NoteUpdateOne) SetNillableContent(s *string) *NoteUpdateOne
SetNillableContent sets the "content" field if the given value is not nil.
func (*NoteUpdateOne) SetNillableDescription ¶
func (nuo *NoteUpdateOne) SetNillableDescription(s *string) *NoteUpdateOne
SetNillableDescription sets the "description" field if the given value is not nil.
func (*NoteUpdateOne) SetNillablePermissionLevel ¶
func (nuo *NoteUpdateOne) SetNillablePermissionLevel(nl *note.PermissionLevel) *NoteUpdateOne
SetNillablePermissionLevel sets the "permission_level" field if the given value is not nil.
func (*NoteUpdateOne) SetNillableShareToken ¶
func (nuo *NoteUpdateOne) SetNillableShareToken(s *string) *NoteUpdateOne
SetNillableShareToken sets the "share_token" field if the given value is not nil.
func (*NoteUpdateOne) SetNillableTitle ¶
func (nuo *NoteUpdateOne) SetNillableTitle(s *string) *NoteUpdateOne
SetNillableTitle sets the "title" field if the given value is not nil.
func (*NoteUpdateOne) SetNillableVisibility ¶
func (nuo *NoteUpdateOne) SetNillableVisibility(n *note.Visibility) *NoteUpdateOne
SetNillableVisibility sets the "visibility" field if the given value is not nil.
func (*NoteUpdateOne) SetOwner ¶
func (nuo *NoteUpdateOne) SetOwner(u *User) *NoteUpdateOne
SetOwner sets the "owner" edge to the User entity.
func (*NoteUpdateOne) SetOwnerID ¶
func (nuo *NoteUpdateOne) SetOwnerID(id int) *NoteUpdateOne
SetOwnerID sets the "owner" edge to the User entity by ID.
func (*NoteUpdateOne) SetPermissionLevel ¶
func (nuo *NoteUpdateOne) SetPermissionLevel(nl note.PermissionLevel) *NoteUpdateOne
SetPermissionLevel sets the "permission_level" field.
func (*NoteUpdateOne) SetResources ¶
func (nuo *NoteUpdateOne) SetResources(t []types.Resource) *NoteUpdateOne
SetResources sets the "resources" field.
func (*NoteUpdateOne) SetShareToken ¶
func (nuo *NoteUpdateOne) SetShareToken(s string) *NoteUpdateOne
SetShareToken sets the "share_token" field.
func (*NoteUpdateOne) SetTitle ¶
func (nuo *NoteUpdateOne) SetTitle(s string) *NoteUpdateOne
SetTitle sets the "title" field.
func (*NoteUpdateOne) SetUpdatedAt ¶
func (nuo *NoteUpdateOne) SetUpdatedAt(t time.Time) *NoteUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*NoteUpdateOne) SetVisibility ¶
func (nuo *NoteUpdateOne) SetVisibility(n note.Visibility) *NoteUpdateOne
SetVisibility sets the "visibility" field.
func (*NoteUpdateOne) Where ¶
func (nuo *NoteUpdateOne) Where(ps ...predicate.Note) *NoteUpdateOne
Where appends a list predicates to the NoteUpdate builder.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type PasswordToken ¶
type PasswordToken struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// Token holds the value of the "token" field.
Token string `json:"-"`
// UserID holds the value of the "user_id" field.
UserID int `json:"user_id,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the PasswordTokenQuery when eager-loading is set.
Edges PasswordTokenEdges `json:"edges"`
// contains filtered or unexported fields
}
PasswordToken is the model entity for the PasswordToken schema.
func (*PasswordToken) QueryUser ¶
func (pt *PasswordToken) QueryUser() *UserQuery
QueryUser queries the "user" edge of the PasswordToken entity.
func (*PasswordToken) String ¶
func (pt *PasswordToken) String() string
String implements the fmt.Stringer.
func (*PasswordToken) Unwrap ¶
func (pt *PasswordToken) Unwrap() *PasswordToken
Unwrap unwraps the PasswordToken entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*PasswordToken) Update ¶
func (pt *PasswordToken) Update() *PasswordTokenUpdateOne
Update returns a builder for updating this PasswordToken. Note that you need to call PasswordToken.Unwrap() before calling this method if this PasswordToken was returned from a transaction, and the transaction was committed or rolled back.
type PasswordTokenClient ¶
type PasswordTokenClient struct {
// contains filtered or unexported fields
}
PasswordTokenClient is a client for the PasswordToken schema.
func NewPasswordTokenClient ¶
func NewPasswordTokenClient(c config) *PasswordTokenClient
NewPasswordTokenClient returns a client for the PasswordToken from the given config.
func (*PasswordTokenClient) Create ¶
func (c *PasswordTokenClient) Create() *PasswordTokenCreate
Create returns a builder for creating a PasswordToken entity.
func (*PasswordTokenClient) CreateBulk ¶
func (c *PasswordTokenClient) CreateBulk(builders ...*PasswordTokenCreate) *PasswordTokenCreateBulk
CreateBulk returns a builder for creating a bulk of PasswordToken entities.
func (*PasswordTokenClient) Delete ¶
func (c *PasswordTokenClient) Delete() *PasswordTokenDelete
Delete returns a delete builder for PasswordToken.
func (*PasswordTokenClient) DeleteOne ¶
func (c *PasswordTokenClient) DeleteOne(pt *PasswordToken) *PasswordTokenDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*PasswordTokenClient) DeleteOneID ¶
func (c *PasswordTokenClient) DeleteOneID(id int) *PasswordTokenDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*PasswordTokenClient) Get ¶
func (c *PasswordTokenClient) Get(ctx context.Context, id int) (*PasswordToken, error)
Get returns a PasswordToken entity by its id.
func (*PasswordTokenClient) GetX ¶
func (c *PasswordTokenClient) GetX(ctx context.Context, id int) *PasswordToken
GetX is like Get, but panics if an error occurs.
func (*PasswordTokenClient) Hooks ¶
func (c *PasswordTokenClient) Hooks() []Hook
Hooks returns the client hooks.
func (*PasswordTokenClient) Intercept ¶
func (c *PasswordTokenClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `passwordtoken.Intercept(f(g(h())))`.
func (*PasswordTokenClient) Interceptors ¶
func (c *PasswordTokenClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*PasswordTokenClient) MapCreateBulk ¶
func (c *PasswordTokenClient) MapCreateBulk(slice any, setFunc func(*PasswordTokenCreate, int)) *PasswordTokenCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*PasswordTokenClient) Query ¶
func (c *PasswordTokenClient) Query() *PasswordTokenQuery
Query returns a query builder for PasswordToken.
func (*PasswordTokenClient) QueryUser ¶
func (c *PasswordTokenClient) QueryUser(pt *PasswordToken) *UserQuery
QueryUser queries the user edge of a PasswordToken.
func (*PasswordTokenClient) Update ¶
func (c *PasswordTokenClient) Update() *PasswordTokenUpdate
Update returns an update builder for PasswordToken.
func (*PasswordTokenClient) UpdateOne ¶
func (c *PasswordTokenClient) UpdateOne(pt *PasswordToken) *PasswordTokenUpdateOne
UpdateOne returns an update builder for the given entity.
func (*PasswordTokenClient) UpdateOneID ¶
func (c *PasswordTokenClient) UpdateOneID(id int) *PasswordTokenUpdateOne
UpdateOneID returns an update builder for the given id.
func (*PasswordTokenClient) Use ¶
func (c *PasswordTokenClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `passwordtoken.Hooks(f(g(h())))`.
type PasswordTokenCreate ¶
type PasswordTokenCreate struct {
// contains filtered or unexported fields
}
PasswordTokenCreate is the builder for creating a PasswordToken entity.
func (*PasswordTokenCreate) Exec ¶
func (ptc *PasswordTokenCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*PasswordTokenCreate) ExecX ¶
func (ptc *PasswordTokenCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PasswordTokenCreate) Mutation ¶
func (ptc *PasswordTokenCreate) Mutation() *PasswordTokenMutation
Mutation returns the PasswordTokenMutation object of the builder.
func (*PasswordTokenCreate) Save ¶
func (ptc *PasswordTokenCreate) Save(ctx context.Context) (*PasswordToken, error)
Save creates the PasswordToken in the database.
func (*PasswordTokenCreate) SaveX ¶
func (ptc *PasswordTokenCreate) SaveX(ctx context.Context) *PasswordToken
SaveX calls Save and panics if Save returns an error.
func (*PasswordTokenCreate) SetCreatedAt ¶
func (ptc *PasswordTokenCreate) SetCreatedAt(t time.Time) *PasswordTokenCreate
SetCreatedAt sets the "created_at" field.
func (*PasswordTokenCreate) SetNillableCreatedAt ¶
func (ptc *PasswordTokenCreate) SetNillableCreatedAt(t *time.Time) *PasswordTokenCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*PasswordTokenCreate) SetToken ¶
func (ptc *PasswordTokenCreate) SetToken(s string) *PasswordTokenCreate
SetToken sets the "token" field.
func (*PasswordTokenCreate) SetUser ¶
func (ptc *PasswordTokenCreate) SetUser(u *User) *PasswordTokenCreate
SetUser sets the "user" edge to the User entity.
func (*PasswordTokenCreate) SetUserID ¶
func (ptc *PasswordTokenCreate) SetUserID(i int) *PasswordTokenCreate
SetUserID sets the "user_id" field.
type PasswordTokenCreateBulk ¶
type PasswordTokenCreateBulk struct {
// contains filtered or unexported fields
}
PasswordTokenCreateBulk is the builder for creating many PasswordToken entities in bulk.
func (*PasswordTokenCreateBulk) Exec ¶
func (ptcb *PasswordTokenCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*PasswordTokenCreateBulk) ExecX ¶
func (ptcb *PasswordTokenCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PasswordTokenCreateBulk) Save ¶
func (ptcb *PasswordTokenCreateBulk) Save(ctx context.Context) ([]*PasswordToken, error)
Save creates the PasswordToken entities in the database.
func (*PasswordTokenCreateBulk) SaveX ¶
func (ptcb *PasswordTokenCreateBulk) SaveX(ctx context.Context) []*PasswordToken
SaveX is like Save, but panics if an error occurs.
type PasswordTokenDelete ¶
type PasswordTokenDelete struct {
// contains filtered or unexported fields
}
PasswordTokenDelete is the builder for deleting a PasswordToken entity.
func (*PasswordTokenDelete) Exec ¶
func (ptd *PasswordTokenDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*PasswordTokenDelete) ExecX ¶
func (ptd *PasswordTokenDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*PasswordTokenDelete) Where ¶
func (ptd *PasswordTokenDelete) Where(ps ...predicate.PasswordToken) *PasswordTokenDelete
Where appends a list predicates to the PasswordTokenDelete builder.
type PasswordTokenDeleteOne ¶
type PasswordTokenDeleteOne struct {
// contains filtered or unexported fields
}
PasswordTokenDeleteOne is the builder for deleting a single PasswordToken entity.
func (*PasswordTokenDeleteOne) Exec ¶
func (ptdo *PasswordTokenDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*PasswordTokenDeleteOne) ExecX ¶
func (ptdo *PasswordTokenDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PasswordTokenDeleteOne) Where ¶
func (ptdo *PasswordTokenDeleteOne) Where(ps ...predicate.PasswordToken) *PasswordTokenDeleteOne
Where appends a list predicates to the PasswordTokenDelete builder.
type PasswordTokenEdges ¶
type PasswordTokenEdges struct {
// User holds the value of the user edge.
User *User `json:"user,omitempty"`
// contains filtered or unexported fields
}
PasswordTokenEdges holds the relations/edges for other nodes in the graph.
func (PasswordTokenEdges) UserOrErr ¶
func (e PasswordTokenEdges) UserOrErr() (*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type PasswordTokenGroupBy ¶
type PasswordTokenGroupBy struct {
// contains filtered or unexported fields
}
PasswordTokenGroupBy is the group-by builder for PasswordToken entities.
func (*PasswordTokenGroupBy) Aggregate ¶
func (ptgb *PasswordTokenGroupBy) Aggregate(fns ...AggregateFunc) *PasswordTokenGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*PasswordTokenGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PasswordTokenGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PasswordTokenGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PasswordTokenGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PasswordTokenGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PasswordTokenGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PasswordTokenGroupBy) Scan ¶
func (ptgb *PasswordTokenGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PasswordTokenGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PasswordTokenMutation ¶
type PasswordTokenMutation struct {
// contains filtered or unexported fields
}
PasswordTokenMutation represents an operation that mutates the PasswordToken nodes in the graph.
func (*PasswordTokenMutation) AddField ¶
func (m *PasswordTokenMutation) AddField(name string, value ent.Value) error
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 (*PasswordTokenMutation) AddedEdges ¶
func (m *PasswordTokenMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*PasswordTokenMutation) AddedField ¶
func (m *PasswordTokenMutation) AddedField(name string) (ent.Value, bool)
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 (*PasswordTokenMutation) AddedFields ¶
func (m *PasswordTokenMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*PasswordTokenMutation) AddedIDs ¶
func (m *PasswordTokenMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*PasswordTokenMutation) ClearEdge ¶
func (m *PasswordTokenMutation) ClearEdge(name string) error
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 (*PasswordTokenMutation) ClearField ¶
func (m *PasswordTokenMutation) ClearField(name string) error
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 (*PasswordTokenMutation) ClearUser ¶
func (m *PasswordTokenMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*PasswordTokenMutation) ClearedEdges ¶
func (m *PasswordTokenMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*PasswordTokenMutation) ClearedFields ¶
func (m *PasswordTokenMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (PasswordTokenMutation) Client ¶
func (m PasswordTokenMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*PasswordTokenMutation) CreatedAt ¶
func (m *PasswordTokenMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*PasswordTokenMutation) EdgeCleared ¶
func (m *PasswordTokenMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*PasswordTokenMutation) Field ¶
func (m *PasswordTokenMutation) Field(name string) (ent.Value, bool)
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 (*PasswordTokenMutation) FieldCleared ¶
func (m *PasswordTokenMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*PasswordTokenMutation) Fields ¶
func (m *PasswordTokenMutation) Fields() []string
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 (*PasswordTokenMutation) ID ¶
func (m *PasswordTokenMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*PasswordTokenMutation) IDs ¶
func (m *PasswordTokenMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*PasswordTokenMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the PasswordToken entity. If the PasswordToken object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*PasswordTokenMutation) OldField ¶
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 (*PasswordTokenMutation) OldToken ¶
func (m *PasswordTokenMutation) OldToken(ctx context.Context) (v string, err error)
OldToken returns the old "token" field's value of the PasswordToken entity. If the PasswordToken object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*PasswordTokenMutation) OldUserID ¶
func (m *PasswordTokenMutation) OldUserID(ctx context.Context) (v int, err error)
OldUserID returns the old "user_id" field's value of the PasswordToken entity. If the PasswordToken object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*PasswordTokenMutation) Op ¶
func (m *PasswordTokenMutation) Op() Op
Op returns the operation name.
func (*PasswordTokenMutation) RemovedEdges ¶
func (m *PasswordTokenMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*PasswordTokenMutation) RemovedIDs ¶
func (m *PasswordTokenMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*PasswordTokenMutation) ResetCreatedAt ¶
func (m *PasswordTokenMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*PasswordTokenMutation) ResetEdge ¶
func (m *PasswordTokenMutation) ResetEdge(name string) error
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 (*PasswordTokenMutation) ResetField ¶
func (m *PasswordTokenMutation) ResetField(name string) error
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 (*PasswordTokenMutation) ResetToken ¶
func (m *PasswordTokenMutation) ResetToken()
ResetToken resets all changes to the "token" field.
func (*PasswordTokenMutation) ResetUser ¶
func (m *PasswordTokenMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*PasswordTokenMutation) ResetUserID ¶
func (m *PasswordTokenMutation) ResetUserID()
ResetUserID resets all changes to the "user_id" field.
func (*PasswordTokenMutation) SetCreatedAt ¶
func (m *PasswordTokenMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*PasswordTokenMutation) SetField ¶
func (m *PasswordTokenMutation) SetField(name string, value ent.Value) error
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 (*PasswordTokenMutation) SetOp ¶
func (m *PasswordTokenMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*PasswordTokenMutation) SetToken ¶
func (m *PasswordTokenMutation) SetToken(s string)
SetToken sets the "token" field.
func (*PasswordTokenMutation) SetUserID ¶
func (m *PasswordTokenMutation) SetUserID(i int)
SetUserID sets the "user_id" field.
func (*PasswordTokenMutation) Token ¶
func (m *PasswordTokenMutation) Token() (r string, exists bool)
Token returns the value of the "token" field in the mutation.
func (PasswordTokenMutation) Tx ¶
func (m PasswordTokenMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*PasswordTokenMutation) Type ¶
func (m *PasswordTokenMutation) Type() string
Type returns the node type of this mutation (PasswordToken).
func (*PasswordTokenMutation) UserCleared ¶
func (m *PasswordTokenMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*PasswordTokenMutation) UserID ¶
func (m *PasswordTokenMutation) UserID() (r int, exists bool)
UserID returns the value of the "user_id" field in the mutation.
func (*PasswordTokenMutation) UserIDs ¶
func (m *PasswordTokenMutation) UserIDs() (ids []int)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*PasswordTokenMutation) Where ¶
func (m *PasswordTokenMutation) Where(ps ...predicate.PasswordToken)
Where appends a list predicates to the PasswordTokenMutation builder.
func (*PasswordTokenMutation) WhereP ¶
func (m *PasswordTokenMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the PasswordTokenMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type PasswordTokenQuery ¶
type PasswordTokenQuery struct {
// contains filtered or unexported fields
}
PasswordTokenQuery is the builder for querying PasswordToken entities.
func (*PasswordTokenQuery) Aggregate ¶
func (ptq *PasswordTokenQuery) Aggregate(fns ...AggregateFunc) *PasswordTokenSelect
Aggregate returns a PasswordTokenSelect configured with the given aggregations.
func (*PasswordTokenQuery) All ¶
func (ptq *PasswordTokenQuery) All(ctx context.Context) ([]*PasswordToken, error)
All executes the query and returns a list of PasswordTokens.
func (*PasswordTokenQuery) AllX ¶
func (ptq *PasswordTokenQuery) AllX(ctx context.Context) []*PasswordToken
AllX is like All, but panics if an error occurs.
func (*PasswordTokenQuery) Clone ¶
func (ptq *PasswordTokenQuery) Clone() *PasswordTokenQuery
Clone returns a duplicate of the PasswordTokenQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*PasswordTokenQuery) Count ¶
func (ptq *PasswordTokenQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*PasswordTokenQuery) CountX ¶
func (ptq *PasswordTokenQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*PasswordTokenQuery) Exist ¶
func (ptq *PasswordTokenQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*PasswordTokenQuery) ExistX ¶
func (ptq *PasswordTokenQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*PasswordTokenQuery) First ¶
func (ptq *PasswordTokenQuery) First(ctx context.Context) (*PasswordToken, error)
First returns the first PasswordToken entity from the query. Returns a *NotFoundError when no PasswordToken was found.
func (*PasswordTokenQuery) FirstID ¶
func (ptq *PasswordTokenQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first PasswordToken ID from the query. Returns a *NotFoundError when no PasswordToken ID was found.
func (*PasswordTokenQuery) FirstIDX ¶
func (ptq *PasswordTokenQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*PasswordTokenQuery) FirstX ¶
func (ptq *PasswordTokenQuery) FirstX(ctx context.Context) *PasswordToken
FirstX is like First, but panics if an error occurs.
func (*PasswordTokenQuery) GroupBy ¶
func (ptq *PasswordTokenQuery) GroupBy(field string, fields ...string) *PasswordTokenGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct {
Token string `json:"token,omitempty"`
Count int `json:"count,omitempty"`
}
client.PasswordToken.Query().
GroupBy(passwordtoken.FieldToken).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*PasswordTokenQuery) IDs ¶
func (ptq *PasswordTokenQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of PasswordToken IDs.
func (*PasswordTokenQuery) IDsX ¶
func (ptq *PasswordTokenQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*PasswordTokenQuery) Limit ¶
func (ptq *PasswordTokenQuery) Limit(limit int) *PasswordTokenQuery
Limit the number of records to be returned by this query.
func (*PasswordTokenQuery) Offset ¶
func (ptq *PasswordTokenQuery) Offset(offset int) *PasswordTokenQuery
Offset to start from.
func (*PasswordTokenQuery) Only ¶
func (ptq *PasswordTokenQuery) Only(ctx context.Context) (*PasswordToken, error)
Only returns a single PasswordToken entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one PasswordToken entity is found. Returns a *NotFoundError when no PasswordToken entities are found.
func (*PasswordTokenQuery) OnlyID ¶
func (ptq *PasswordTokenQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only PasswordToken ID in the query. Returns a *NotSingularError when more than one PasswordToken ID is found. Returns a *NotFoundError when no entities are found.
func (*PasswordTokenQuery) OnlyIDX ¶
func (ptq *PasswordTokenQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*PasswordTokenQuery) OnlyX ¶
func (ptq *PasswordTokenQuery) OnlyX(ctx context.Context) *PasswordToken
OnlyX is like Only, but panics if an error occurs.
func (*PasswordTokenQuery) Order ¶
func (ptq *PasswordTokenQuery) Order(o ...passwordtoken.OrderOption) *PasswordTokenQuery
Order specifies how the records should be ordered.
func (*PasswordTokenQuery) QueryUser ¶
func (ptq *PasswordTokenQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*PasswordTokenQuery) Select ¶
func (ptq *PasswordTokenQuery) Select(fields ...string) *PasswordTokenSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct {
Token string `json:"token,omitempty"`
}
client.PasswordToken.Query().
Select(passwordtoken.FieldToken).
Scan(ctx, &v)
func (*PasswordTokenQuery) Unique ¶
func (ptq *PasswordTokenQuery) Unique(unique bool) *PasswordTokenQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*PasswordTokenQuery) Where ¶
func (ptq *PasswordTokenQuery) Where(ps ...predicate.PasswordToken) *PasswordTokenQuery
Where adds a new predicate for the PasswordTokenQuery builder.
func (*PasswordTokenQuery) WithUser ¶
func (ptq *PasswordTokenQuery) WithUser(opts ...func(*UserQuery)) *PasswordTokenQuery
WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.
type PasswordTokenSelect ¶
type PasswordTokenSelect struct {
*PasswordTokenQuery
// contains filtered or unexported fields
}
PasswordTokenSelect is the builder for selecting fields of PasswordToken entities.
func (*PasswordTokenSelect) Aggregate ¶
func (pts *PasswordTokenSelect) Aggregate(fns ...AggregateFunc) *PasswordTokenSelect
Aggregate adds the given aggregation functions to the selector query.
func (*PasswordTokenSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PasswordTokenSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PasswordTokenSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PasswordTokenSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PasswordTokenSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PasswordTokenSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PasswordTokenSelect) Scan ¶
func (pts *PasswordTokenSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PasswordTokenSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PasswordTokenUpdate ¶
type PasswordTokenUpdate struct {
// contains filtered or unexported fields
}
PasswordTokenUpdate is the builder for updating PasswordToken entities.
func (*PasswordTokenUpdate) ClearUser ¶
func (ptu *PasswordTokenUpdate) ClearUser() *PasswordTokenUpdate
ClearUser clears the "user" edge to the User entity.
func (*PasswordTokenUpdate) Exec ¶
func (ptu *PasswordTokenUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*PasswordTokenUpdate) ExecX ¶
func (ptu *PasswordTokenUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PasswordTokenUpdate) Mutation ¶
func (ptu *PasswordTokenUpdate) Mutation() *PasswordTokenMutation
Mutation returns the PasswordTokenMutation object of the builder.
func (*PasswordTokenUpdate) Save ¶
func (ptu *PasswordTokenUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*PasswordTokenUpdate) SaveX ¶
func (ptu *PasswordTokenUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*PasswordTokenUpdate) SetCreatedAt ¶
func (ptu *PasswordTokenUpdate) SetCreatedAt(t time.Time) *PasswordTokenUpdate
SetCreatedAt sets the "created_at" field.
func (*PasswordTokenUpdate) SetNillableCreatedAt ¶
func (ptu *PasswordTokenUpdate) SetNillableCreatedAt(t *time.Time) *PasswordTokenUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*PasswordTokenUpdate) SetNillableToken ¶
func (ptu *PasswordTokenUpdate) SetNillableToken(s *string) *PasswordTokenUpdate
SetNillableToken sets the "token" field if the given value is not nil.
func (*PasswordTokenUpdate) SetNillableUserID ¶
func (ptu *PasswordTokenUpdate) SetNillableUserID(i *int) *PasswordTokenUpdate
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*PasswordTokenUpdate) SetToken ¶
func (ptu *PasswordTokenUpdate) SetToken(s string) *PasswordTokenUpdate
SetToken sets the "token" field.
func (*PasswordTokenUpdate) SetUser ¶
func (ptu *PasswordTokenUpdate) SetUser(u *User) *PasswordTokenUpdate
SetUser sets the "user" edge to the User entity.
func (*PasswordTokenUpdate) SetUserID ¶
func (ptu *PasswordTokenUpdate) SetUserID(i int) *PasswordTokenUpdate
SetUserID sets the "user_id" field.
func (*PasswordTokenUpdate) Where ¶
func (ptu *PasswordTokenUpdate) Where(ps ...predicate.PasswordToken) *PasswordTokenUpdate
Where appends a list predicates to the PasswordTokenUpdate builder.
type PasswordTokenUpdateOne ¶
type PasswordTokenUpdateOne struct {
// contains filtered or unexported fields
}
PasswordTokenUpdateOne is the builder for updating a single PasswordToken entity.
func (*PasswordTokenUpdateOne) ClearUser ¶
func (ptuo *PasswordTokenUpdateOne) ClearUser() *PasswordTokenUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*PasswordTokenUpdateOne) Exec ¶
func (ptuo *PasswordTokenUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*PasswordTokenUpdateOne) ExecX ¶
func (ptuo *PasswordTokenUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PasswordTokenUpdateOne) Mutation ¶
func (ptuo *PasswordTokenUpdateOne) Mutation() *PasswordTokenMutation
Mutation returns the PasswordTokenMutation object of the builder.
func (*PasswordTokenUpdateOne) Save ¶
func (ptuo *PasswordTokenUpdateOne) Save(ctx context.Context) (*PasswordToken, error)
Save executes the query and returns the updated PasswordToken entity.
func (*PasswordTokenUpdateOne) SaveX ¶
func (ptuo *PasswordTokenUpdateOne) SaveX(ctx context.Context) *PasswordToken
SaveX is like Save, but panics if an error occurs.
func (*PasswordTokenUpdateOne) Select ¶
func (ptuo *PasswordTokenUpdateOne) Select(field string, fields ...string) *PasswordTokenUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*PasswordTokenUpdateOne) SetCreatedAt ¶
func (ptuo *PasswordTokenUpdateOne) SetCreatedAt(t time.Time) *PasswordTokenUpdateOne
SetCreatedAt sets the "created_at" field.
func (*PasswordTokenUpdateOne) SetNillableCreatedAt ¶
func (ptuo *PasswordTokenUpdateOne) SetNillableCreatedAt(t *time.Time) *PasswordTokenUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*PasswordTokenUpdateOne) SetNillableToken ¶
func (ptuo *PasswordTokenUpdateOne) SetNillableToken(s *string) *PasswordTokenUpdateOne
SetNillableToken sets the "token" field if the given value is not nil.
func (*PasswordTokenUpdateOne) SetNillableUserID ¶
func (ptuo *PasswordTokenUpdateOne) SetNillableUserID(i *int) *PasswordTokenUpdateOne
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*PasswordTokenUpdateOne) SetToken ¶
func (ptuo *PasswordTokenUpdateOne) SetToken(s string) *PasswordTokenUpdateOne
SetToken sets the "token" field.
func (*PasswordTokenUpdateOne) SetUser ¶
func (ptuo *PasswordTokenUpdateOne) SetUser(u *User) *PasswordTokenUpdateOne
SetUser sets the "user" edge to the User entity.
func (*PasswordTokenUpdateOne) SetUserID ¶
func (ptuo *PasswordTokenUpdateOne) SetUserID(i int) *PasswordTokenUpdateOne
SetUserID sets the "user_id" field.
func (*PasswordTokenUpdateOne) Where ¶
func (ptuo *PasswordTokenUpdateOne) Where(ps ...predicate.PasswordToken) *PasswordTokenUpdateOne
Where appends a list predicates to the PasswordTokenUpdate builder.
type PasswordTokens ¶
type PasswordTokens []*PasswordToken
PasswordTokens is a parsable slice of PasswordToken.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker {
return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
// Do some stuff before.
if err := next.Rollback(ctx, tx); err != nil {
return err
}
// Do some stuff after.
return nil
})
}
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct {
// Note is the client for interacting with the Note builders.
Note *NoteClient
// NoteLike is the client for interacting with the NoteLike builders.
NoteLike *NoteLikeClient
// NoteRepost is the client for interacting with the NoteRepost builders.
NoteRepost *NoteRepostClient
// PasswordToken is the client for interacting with the PasswordToken builders.
PasswordToken *PasswordTokenClient
// User is the client for interacting with the User builders.
User *UserClient
// contains filtered or unexported fields
}
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type User ¶
type User struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// Name holds the value of the "name" field.
Name string `json:"name,omitempty"`
// PhoneNumber holds the value of the "phone_number" field.
PhoneNumber string `json:"phone_number,omitempty"`
// Email holds the value of the "email" field.
Email *string `json:"email,omitempty"`
// Password holds the value of the "password" field.
Password string `json:"-"`
// Verified holds the value of the "verified" field.
Verified bool `json:"verified,omitempty"`
// 2-digit verification code shown on web for WhatsApp verification
VerificationCode *string `json:"verification_code,omitempty"`
// Admin holds the value of the "admin" field.
Admin bool `json:"admin,omitempty"`
// RegistrationMethod holds the value of the "registration_method" field.
RegistrationMethod user.RegistrationMethod `json:"registration_method,omitempty"`
// Path to profile picture file
ProfilePicture *string `json:"profile_picture,omitempty"`
// User's preferred theme
DarkMode bool `json:"dark_mode,omitempty"`
// User biography/description
Bio *string `json:"bio,omitempty"`
// Whether user wants to receive email notifications
EmailNotifications bool `json:"email_notifications,omitempty"`
// Whether user wants to receive SMS notifications
SmsNotifications bool `json:"sms_notifications,omitempty"`
// Whether the account is active or deactivated
IsActive bool `json:"is_active,omitempty"`
// Last login timestamp
LastLogin *time.Time `json:"last_login,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// UpdatedAt holds the value of the "updated_at" field.
UpdatedAt *time.Time `json:"updated_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the UserQuery when eager-loading is set.
Edges UserEdges `json:"edges"`
// contains filtered or unexported fields
}
User is the model entity for the User schema.
func (*User) QueryNoteLikes ¶
func (u *User) QueryNoteLikes() *NoteLikeQuery
QueryNoteLikes queries the "note_likes" edge of the User entity.
func (*User) QueryNoteReposts ¶
func (u *User) QueryNoteReposts() *NoteRepostQuery
QueryNoteReposts queries the "note_reposts" edge of the User entity.
func (*User) QueryNotes ¶
QueryNotes queries the "notes" edge of the User entity.
func (*User) QueryOwner ¶
func (u *User) QueryOwner() *PasswordTokenQuery
QueryOwner queries the "owner" edge of the User entity.
func (*User) Unwrap ¶
Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*User) Update ¶
func (u *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is a client for the User schema.
func NewUserClient ¶
func NewUserClient(c config) *UserClient
NewUserClient returns a client for the User from the given config.
func (*UserClient) Create ¶
func (c *UserClient) Create() *UserCreate
Create returns a builder for creating a User entity.
func (*UserClient) CreateBulk ¶
func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
CreateBulk returns a builder for creating a bulk of User entities.
func (*UserClient) Delete ¶
func (c *UserClient) Delete() *UserDelete
Delete returns a delete builder for User.
func (*UserClient) DeleteOne ¶
func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserClient) GetX ¶
func (c *UserClient) GetX(ctx context.Context, id int) *User
GetX is like Get, but panics if an error occurs.
func (*UserClient) Intercept ¶
func (c *UserClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.
func (*UserClient) Interceptors ¶
func (c *UserClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*UserClient) MapCreateBulk ¶
func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*UserClient) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) QueryNoteLikes ¶
func (c *UserClient) QueryNoteLikes(u *User) *NoteLikeQuery
QueryNoteLikes queries the note_likes edge of a User.
func (*UserClient) QueryNoteReposts ¶
func (c *UserClient) QueryNoteReposts(u *User) *NoteRepostQuery
QueryNoteReposts queries the note_reposts edge of a User.
func (*UserClient) QueryNotes ¶
func (c *UserClient) QueryNotes(u *User) *NoteQuery
QueryNotes queries the notes edge of a User.
func (*UserClient) QueryOwner ¶
func (c *UserClient) QueryOwner(u *User) *PasswordTokenQuery
QueryOwner queries the owner edge of a User.
func (*UserClient) Update ¶
func (c *UserClient) Update() *UserUpdate
Update returns an update builder for User.
func (*UserClient) UpdateOne ¶
func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserClient) UpdateOneID ¶
func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserClient) Use ¶
func (c *UserClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.
type UserCreate ¶
type UserCreate struct {
// contains filtered or unexported fields
}
UserCreate is the builder for creating a User entity.
func (*UserCreate) AddNoteIDs ¶
func (uc *UserCreate) AddNoteIDs(ids ...int) *UserCreate
AddNoteIDs adds the "notes" edge to the Note entity by IDs.
func (*UserCreate) AddNoteLikeIDs ¶
func (uc *UserCreate) AddNoteLikeIDs(ids ...int) *UserCreate
AddNoteLikeIDs adds the "note_likes" edge to the NoteLike entity by IDs.
func (*UserCreate) AddNoteLikes ¶
func (uc *UserCreate) AddNoteLikes(n ...*NoteLike) *UserCreate
AddNoteLikes adds the "note_likes" edges to the NoteLike entity.
func (*UserCreate) AddNoteRepostIDs ¶
func (uc *UserCreate) AddNoteRepostIDs(ids ...int) *UserCreate
AddNoteRepostIDs adds the "note_reposts" edge to the NoteRepost entity by IDs.
func (*UserCreate) AddNoteReposts ¶
func (uc *UserCreate) AddNoteReposts(n ...*NoteRepost) *UserCreate
AddNoteReposts adds the "note_reposts" edges to the NoteRepost entity.
func (*UserCreate) AddNotes ¶
func (uc *UserCreate) AddNotes(n ...*Note) *UserCreate
AddNotes adds the "notes" edges to the Note entity.
func (*UserCreate) AddOwner ¶
func (uc *UserCreate) AddOwner(p ...*PasswordToken) *UserCreate
AddOwner adds the "owner" edges to the PasswordToken entity.
func (*UserCreate) AddOwnerIDs ¶
func (uc *UserCreate) AddOwnerIDs(ids ...int) *UserCreate
AddOwnerIDs adds the "owner" edge to the PasswordToken entity by IDs.
func (*UserCreate) Exec ¶
func (uc *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecX ¶
func (uc *UserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreate) Mutation ¶
func (uc *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) Save ¶
func (uc *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶
func (uc *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetAdmin ¶
func (uc *UserCreate) SetAdmin(b bool) *UserCreate
SetAdmin sets the "admin" field.
func (*UserCreate) SetBio ¶
func (uc *UserCreate) SetBio(s string) *UserCreate
SetBio sets the "bio" field.
func (*UserCreate) SetCreatedAt ¶
func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate
SetCreatedAt sets the "created_at" field.
func (*UserCreate) SetDarkMode ¶
func (uc *UserCreate) SetDarkMode(b bool) *UserCreate
SetDarkMode sets the "dark_mode" field.
func (*UserCreate) SetEmail ¶
func (uc *UserCreate) SetEmail(s string) *UserCreate
SetEmail sets the "email" field.
func (*UserCreate) SetEmailNotifications ¶
func (uc *UserCreate) SetEmailNotifications(b bool) *UserCreate
SetEmailNotifications sets the "email_notifications" field.
func (*UserCreate) SetIsActive ¶
func (uc *UserCreate) SetIsActive(b bool) *UserCreate
SetIsActive sets the "is_active" field.
func (*UserCreate) SetLastLogin ¶
func (uc *UserCreate) SetLastLogin(t time.Time) *UserCreate
SetLastLogin sets the "last_login" field.
func (*UserCreate) SetName ¶
func (uc *UserCreate) SetName(s string) *UserCreate
SetName sets the "name" field.
func (*UserCreate) SetNillableAdmin ¶
func (uc *UserCreate) SetNillableAdmin(b *bool) *UserCreate
SetNillableAdmin sets the "admin" field if the given value is not nil.
func (*UserCreate) SetNillableBio ¶
func (uc *UserCreate) SetNillableBio(s *string) *UserCreate
SetNillableBio sets the "bio" field if the given value is not nil.
func (*UserCreate) SetNillableCreatedAt ¶
func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*UserCreate) SetNillableDarkMode ¶
func (uc *UserCreate) SetNillableDarkMode(b *bool) *UserCreate
SetNillableDarkMode sets the "dark_mode" field if the given value is not nil.
func (*UserCreate) SetNillableEmail ¶
func (uc *UserCreate) SetNillableEmail(s *string) *UserCreate
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserCreate) SetNillableEmailNotifications ¶
func (uc *UserCreate) SetNillableEmailNotifications(b *bool) *UserCreate
SetNillableEmailNotifications sets the "email_notifications" field if the given value is not nil.
func (*UserCreate) SetNillableIsActive ¶
func (uc *UserCreate) SetNillableIsActive(b *bool) *UserCreate
SetNillableIsActive sets the "is_active" field if the given value is not nil.
func (*UserCreate) SetNillableLastLogin ¶
func (uc *UserCreate) SetNillableLastLogin(t *time.Time) *UserCreate
SetNillableLastLogin sets the "last_login" field if the given value is not nil.
func (*UserCreate) SetNillablePassword ¶
func (uc *UserCreate) SetNillablePassword(s *string) *UserCreate
SetNillablePassword sets the "password" field if the given value is not nil.
func (*UserCreate) SetNillableProfilePicture ¶
func (uc *UserCreate) SetNillableProfilePicture(s *string) *UserCreate
SetNillableProfilePicture sets the "profile_picture" field if the given value is not nil.
func (*UserCreate) SetNillableRegistrationMethod ¶
func (uc *UserCreate) SetNillableRegistrationMethod(um *user.RegistrationMethod) *UserCreate
SetNillableRegistrationMethod sets the "registration_method" field if the given value is not nil.
func (*UserCreate) SetNillableSmsNotifications ¶
func (uc *UserCreate) SetNillableSmsNotifications(b *bool) *UserCreate
SetNillableSmsNotifications sets the "sms_notifications" field if the given value is not nil.
func (*UserCreate) SetNillableUpdatedAt ¶
func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*UserCreate) SetNillableVerificationCode ¶
func (uc *UserCreate) SetNillableVerificationCode(s *string) *UserCreate
SetNillableVerificationCode sets the "verification_code" field if the given value is not nil.
func (*UserCreate) SetNillableVerified ¶
func (uc *UserCreate) SetNillableVerified(b *bool) *UserCreate
SetNillableVerified sets the "verified" field if the given value is not nil.
func (*UserCreate) SetPassword ¶
func (uc *UserCreate) SetPassword(s string) *UserCreate
SetPassword sets the "password" field.
func (*UserCreate) SetPhoneNumber ¶
func (uc *UserCreate) SetPhoneNumber(s string) *UserCreate
SetPhoneNumber sets the "phone_number" field.
func (*UserCreate) SetProfilePicture ¶
func (uc *UserCreate) SetProfilePicture(s string) *UserCreate
SetProfilePicture sets the "profile_picture" field.
func (*UserCreate) SetRegistrationMethod ¶
func (uc *UserCreate) SetRegistrationMethod(um user.RegistrationMethod) *UserCreate
SetRegistrationMethod sets the "registration_method" field.
func (*UserCreate) SetSmsNotifications ¶
func (uc *UserCreate) SetSmsNotifications(b bool) *UserCreate
SetSmsNotifications sets the "sms_notifications" field.
func (*UserCreate) SetUpdatedAt ¶
func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate
SetUpdatedAt sets the "updated_at" field.
func (*UserCreate) SetVerificationCode ¶
func (uc *UserCreate) SetVerificationCode(s string) *UserCreate
SetVerificationCode sets the "verification_code" field.
func (*UserCreate) SetVerified ¶
func (uc *UserCreate) SetVerified(b bool) *UserCreate
SetVerified sets the "verified" field.
type UserCreateBulk ¶
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating many User entities in bulk.
func (*UserCreateBulk) Exec ¶
func (ucb *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (ucb *UserCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserDelete ¶
type UserDelete struct {
// contains filtered or unexported fields
}
UserDelete is the builder for deleting a User entity.
func (*UserDelete) Exec ¶
func (ud *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶
func (ud *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶
func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete
Where appends a list predicates to the UserDelete builder.
type UserDeleteOne ¶
type UserDeleteOne struct {
// contains filtered or unexported fields
}
UserDeleteOne is the builder for deleting a single User entity.
func (*UserDeleteOne) Exec ¶
func (udo *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (udo *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserDeleteOne) Where ¶
func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne
Where appends a list predicates to the UserDelete builder.
type UserEdges ¶
type UserEdges struct {
// Owner holds the value of the owner edge.
Owner []*PasswordToken `json:"owner,omitempty"`
// Notes holds the value of the notes edge.
Notes []*Note `json:"notes,omitempty"`
// NoteLikes holds the value of the note_likes edge.
NoteLikes []*NoteLike `json:"note_likes,omitempty"`
// NoteReposts holds the value of the note_reposts edge.
NoteReposts []*NoteRepost `json:"note_reposts,omitempty"`
// contains filtered or unexported fields
}
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) NoteLikesOrErr ¶
NoteLikesOrErr returns the NoteLikes value or an error if the edge was not loaded in eager-loading.
func (UserEdges) NoteRepostsOrErr ¶
func (e UserEdges) NoteRepostsOrErr() ([]*NoteRepost, error)
NoteRepostsOrErr returns the NoteReposts value or an error if the edge was not loaded in eager-loading.
func (UserEdges) NotesOrErr ¶
NotesOrErr returns the Notes value or an error if the edge was not loaded in eager-loading.
func (UserEdges) OwnerOrErr ¶
func (e UserEdges) OwnerOrErr() ([]*PasswordToken, error)
OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading.
type UserGroupBy ¶
type UserGroupBy struct {
// contains filtered or unexported fields
}
UserGroupBy is the group-by builder for User entities.
func (*UserGroupBy) Aggregate ¶
func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Scan ¶
func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserMutation ¶
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutates the User nodes in the graph.
func (*UserMutation) AddField ¶
func (m *UserMutation) AddField(name string, value ent.Value) error
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 (*UserMutation) AddNoteIDs ¶
func (m *UserMutation) AddNoteIDs(ids ...int)
AddNoteIDs adds the "notes" edge to the Note entity by ids.
func (*UserMutation) AddNoteLikeIDs ¶
func (m *UserMutation) AddNoteLikeIDs(ids ...int)
AddNoteLikeIDs adds the "note_likes" edge to the NoteLike entity by ids.
func (*UserMutation) AddNoteRepostIDs ¶
func (m *UserMutation) AddNoteRepostIDs(ids ...int)
AddNoteRepostIDs adds the "note_reposts" edge to the NoteRepost entity by ids.
func (*UserMutation) AddOwnerIDs ¶
func (m *UserMutation) AddOwnerIDs(ids ...int)
AddOwnerIDs adds the "owner" edge to the PasswordToken entity by ids.
func (*UserMutation) AddedEdges ¶
func (m *UserMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserMutation) AddedField ¶
func (m *UserMutation) AddedField(name string) (ent.Value, bool)
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 (*UserMutation) AddedFields ¶
func (m *UserMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserMutation) AddedIDs ¶
func (m *UserMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserMutation) Admin ¶
func (m *UserMutation) Admin() (r bool, exists bool)
Admin returns the value of the "admin" field in the mutation.
func (*UserMutation) Bio ¶
func (m *UserMutation) Bio() (r string, exists bool)
Bio returns the value of the "bio" field in the mutation.
func (*UserMutation) BioCleared ¶
func (m *UserMutation) BioCleared() bool
BioCleared returns if the "bio" field was cleared in this mutation.
func (*UserMutation) ClearBio ¶
func (m *UserMutation) ClearBio()
ClearBio clears the value of the "bio" field.
func (*UserMutation) ClearEdge ¶
func (m *UserMutation) ClearEdge(name string) error
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 (*UserMutation) ClearEmail ¶
func (m *UserMutation) ClearEmail()
ClearEmail clears the value of the "email" field.
func (*UserMutation) ClearField ¶
func (m *UserMutation) ClearField(name string) error
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 (*UserMutation) ClearLastLogin ¶
func (m *UserMutation) ClearLastLogin()
ClearLastLogin clears the value of the "last_login" field.
func (*UserMutation) ClearNoteLikes ¶
func (m *UserMutation) ClearNoteLikes()
ClearNoteLikes clears the "note_likes" edge to the NoteLike entity.
func (*UserMutation) ClearNoteReposts ¶
func (m *UserMutation) ClearNoteReposts()
ClearNoteReposts clears the "note_reposts" edge to the NoteRepost entity.
func (*UserMutation) ClearNotes ¶
func (m *UserMutation) ClearNotes()
ClearNotes clears the "notes" edge to the Note entity.
func (*UserMutation) ClearOwner ¶
func (m *UserMutation) ClearOwner()
ClearOwner clears the "owner" edge to the PasswordToken entity.
func (*UserMutation) ClearPassword ¶
func (m *UserMutation) ClearPassword()
ClearPassword clears the value of the "password" field.
func (*UserMutation) ClearProfilePicture ¶
func (m *UserMutation) ClearProfilePicture()
ClearProfilePicture clears the value of the "profile_picture" field.
func (*UserMutation) ClearUpdatedAt ¶
func (m *UserMutation) ClearUpdatedAt()
ClearUpdatedAt clears the value of the "updated_at" field.
func (*UserMutation) ClearVerificationCode ¶
func (m *UserMutation) ClearVerificationCode()
ClearVerificationCode clears the value of the "verification_code" field.
func (*UserMutation) ClearedEdges ¶
func (m *UserMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserMutation) ClearedFields ¶
func (m *UserMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserMutation) Client ¶
func (m UserMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*UserMutation) CreatedAt ¶
func (m *UserMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*UserMutation) DarkMode ¶
func (m *UserMutation) DarkMode() (r bool, exists bool)
DarkMode returns the value of the "dark_mode" field in the mutation.
func (*UserMutation) EdgeCleared ¶
func (m *UserMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserMutation) Email ¶
func (m *UserMutation) Email() (r string, exists bool)
Email returns the value of the "email" field in the mutation.
func (*UserMutation) EmailCleared ¶
func (m *UserMutation) EmailCleared() bool
EmailCleared returns if the "email" field was cleared in this mutation.
func (*UserMutation) EmailNotifications ¶
func (m *UserMutation) EmailNotifications() (r bool, exists bool)
EmailNotifications returns the value of the "email_notifications" field in the mutation.
func (*UserMutation) Field ¶
func (m *UserMutation) Field(name string) (ent.Value, bool)
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 (*UserMutation) FieldCleared ¶
func (m *UserMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserMutation) Fields ¶
func (m *UserMutation) Fields() []string
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 (*UserMutation) ID ¶
func (m *UserMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*UserMutation) IDs ¶
func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*UserMutation) IsActive ¶
func (m *UserMutation) IsActive() (r bool, exists bool)
IsActive returns the value of the "is_active" field in the mutation.
func (*UserMutation) LastLogin ¶
func (m *UserMutation) LastLogin() (r time.Time, exists bool)
LastLogin returns the value of the "last_login" field in the mutation.
func (*UserMutation) LastLoginCleared ¶
func (m *UserMutation) LastLoginCleared() bool
LastLoginCleared returns if the "last_login" field was cleared in this mutation.
func (*UserMutation) Name ¶
func (m *UserMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*UserMutation) NoteLikesCleared ¶
func (m *UserMutation) NoteLikesCleared() bool
NoteLikesCleared reports if the "note_likes" edge to the NoteLike entity was cleared.
func (*UserMutation) NoteLikesIDs ¶
func (m *UserMutation) NoteLikesIDs() (ids []int)
NoteLikesIDs returns the "note_likes" edge IDs in the mutation.
func (*UserMutation) NoteRepostsCleared ¶
func (m *UserMutation) NoteRepostsCleared() bool
NoteRepostsCleared reports if the "note_reposts" edge to the NoteRepost entity was cleared.
func (*UserMutation) NoteRepostsIDs ¶
func (m *UserMutation) NoteRepostsIDs() (ids []int)
NoteRepostsIDs returns the "note_reposts" edge IDs in the mutation.
func (*UserMutation) NotesCleared ¶
func (m *UserMutation) NotesCleared() bool
NotesCleared reports if the "notes" edge to the Note entity was cleared.
func (*UserMutation) NotesIDs ¶
func (m *UserMutation) NotesIDs() (ids []int)
NotesIDs returns the "notes" edge IDs in the mutation.
func (*UserMutation) OldAdmin ¶
func (m *UserMutation) OldAdmin(ctx context.Context) (v bool, err error)
OldAdmin returns the old "admin" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldBio ¶
func (m *UserMutation) OldBio(ctx context.Context) (v *string, err error)
OldBio returns the old "bio" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldDarkMode ¶
func (m *UserMutation) OldDarkMode(ctx context.Context) (v bool, err error)
OldDarkMode returns the old "dark_mode" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldEmail ¶
func (m *UserMutation) OldEmail(ctx context.Context) (v *string, err error)
OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldEmailNotifications ¶
func (m *UserMutation) OldEmailNotifications(ctx context.Context) (v bool, err error)
OldEmailNotifications returns the old "email_notifications" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldField ¶
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 (*UserMutation) OldIsActive ¶
func (m *UserMutation) OldIsActive(ctx context.Context) (v bool, err error)
OldIsActive returns the old "is_active" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldLastLogin ¶
OldLastLogin returns the old "last_login" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldName ¶
func (m *UserMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldPassword ¶
func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)
OldPassword returns the old "password" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldPhoneNumber ¶
func (m *UserMutation) OldPhoneNumber(ctx context.Context) (v string, err error)
OldPhoneNumber returns the old "phone_number" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldProfilePicture ¶
func (m *UserMutation) OldProfilePicture(ctx context.Context) (v *string, err error)
OldProfilePicture returns the old "profile_picture" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldRegistrationMethod ¶
func (m *UserMutation) OldRegistrationMethod(ctx context.Context) (v user.RegistrationMethod, err error)
OldRegistrationMethod returns the old "registration_method" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldSmsNotifications ¶
func (m *UserMutation) OldSmsNotifications(ctx context.Context) (v bool, err error)
OldSmsNotifications returns the old "sms_notifications" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldVerificationCode ¶
func (m *UserMutation) OldVerificationCode(ctx context.Context) (v *string, err error)
OldVerificationCode returns the old "verification_code" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldVerified ¶
func (m *UserMutation) OldVerified(ctx context.Context) (v bool, err error)
OldVerified returns the old "verified" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OwnerCleared ¶
func (m *UserMutation) OwnerCleared() bool
OwnerCleared reports if the "owner" edge to the PasswordToken entity was cleared.
func (*UserMutation) OwnerIDs ¶
func (m *UserMutation) OwnerIDs() (ids []int)
OwnerIDs returns the "owner" edge IDs in the mutation.
func (*UserMutation) Password ¶
func (m *UserMutation) Password() (r string, exists bool)
Password returns the value of the "password" field in the mutation.
func (*UserMutation) PasswordCleared ¶
func (m *UserMutation) PasswordCleared() bool
PasswordCleared returns if the "password" field was cleared in this mutation.
func (*UserMutation) PhoneNumber ¶
func (m *UserMutation) PhoneNumber() (r string, exists bool)
PhoneNumber returns the value of the "phone_number" field in the mutation.
func (*UserMutation) ProfilePicture ¶
func (m *UserMutation) ProfilePicture() (r string, exists bool)
ProfilePicture returns the value of the "profile_picture" field in the mutation.
func (*UserMutation) ProfilePictureCleared ¶
func (m *UserMutation) ProfilePictureCleared() bool
ProfilePictureCleared returns if the "profile_picture" field was cleared in this mutation.
func (*UserMutation) RegistrationMethod ¶
func (m *UserMutation) RegistrationMethod() (r user.RegistrationMethod, exists bool)
RegistrationMethod returns the value of the "registration_method" field in the mutation.
func (*UserMutation) RemoveNoteIDs ¶
func (m *UserMutation) RemoveNoteIDs(ids ...int)
RemoveNoteIDs removes the "notes" edge to the Note entity by IDs.
func (*UserMutation) RemoveNoteLikeIDs ¶
func (m *UserMutation) RemoveNoteLikeIDs(ids ...int)
RemoveNoteLikeIDs removes the "note_likes" edge to the NoteLike entity by IDs.
func (*UserMutation) RemoveNoteRepostIDs ¶
func (m *UserMutation) RemoveNoteRepostIDs(ids ...int)
RemoveNoteRepostIDs removes the "note_reposts" edge to the NoteRepost entity by IDs.
func (*UserMutation) RemoveOwnerIDs ¶
func (m *UserMutation) RemoveOwnerIDs(ids ...int)
RemoveOwnerIDs removes the "owner" edge to the PasswordToken entity by IDs.
func (*UserMutation) RemovedEdges ¶
func (m *UserMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserMutation) RemovedIDs ¶
func (m *UserMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*UserMutation) RemovedNoteLikesIDs ¶
func (m *UserMutation) RemovedNoteLikesIDs() (ids []int)
RemovedNoteLikes returns the removed IDs of the "note_likes" edge to the NoteLike entity.
func (*UserMutation) RemovedNoteRepostsIDs ¶
func (m *UserMutation) RemovedNoteRepostsIDs() (ids []int)
RemovedNoteReposts returns the removed IDs of the "note_reposts" edge to the NoteRepost entity.
func (*UserMutation) RemovedNotesIDs ¶
func (m *UserMutation) RemovedNotesIDs() (ids []int)
RemovedNotes returns the removed IDs of the "notes" edge to the Note entity.
func (*UserMutation) RemovedOwnerIDs ¶
func (m *UserMutation) RemovedOwnerIDs() (ids []int)
RemovedOwner returns the removed IDs of the "owner" edge to the PasswordToken entity.
func (*UserMutation) ResetAdmin ¶
func (m *UserMutation) ResetAdmin()
ResetAdmin resets all changes to the "admin" field.
func (*UserMutation) ResetBio ¶
func (m *UserMutation) ResetBio()
ResetBio resets all changes to the "bio" field.
func (*UserMutation) ResetCreatedAt ¶
func (m *UserMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*UserMutation) ResetDarkMode ¶
func (m *UserMutation) ResetDarkMode()
ResetDarkMode resets all changes to the "dark_mode" field.
func (*UserMutation) ResetEdge ¶
func (m *UserMutation) ResetEdge(name string) error
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 (*UserMutation) ResetEmail ¶
func (m *UserMutation) ResetEmail()
ResetEmail resets all changes to the "email" field.
func (*UserMutation) ResetEmailNotifications ¶
func (m *UserMutation) ResetEmailNotifications()
ResetEmailNotifications resets all changes to the "email_notifications" field.
func (*UserMutation) ResetField ¶
func (m *UserMutation) ResetField(name string) error
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 (*UserMutation) ResetIsActive ¶
func (m *UserMutation) ResetIsActive()
ResetIsActive resets all changes to the "is_active" field.
func (*UserMutation) ResetLastLogin ¶
func (m *UserMutation) ResetLastLogin()
ResetLastLogin resets all changes to the "last_login" field.
func (*UserMutation) ResetName ¶
func (m *UserMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*UserMutation) ResetNoteLikes ¶
func (m *UserMutation) ResetNoteLikes()
ResetNoteLikes resets all changes to the "note_likes" edge.
func (*UserMutation) ResetNoteReposts ¶
func (m *UserMutation) ResetNoteReposts()
ResetNoteReposts resets all changes to the "note_reposts" edge.
func (*UserMutation) ResetNotes ¶
func (m *UserMutation) ResetNotes()
ResetNotes resets all changes to the "notes" edge.
func (*UserMutation) ResetOwner ¶
func (m *UserMutation) ResetOwner()
ResetOwner resets all changes to the "owner" edge.
func (*UserMutation) ResetPassword ¶
func (m *UserMutation) ResetPassword()
ResetPassword resets all changes to the "password" field.
func (*UserMutation) ResetPhoneNumber ¶
func (m *UserMutation) ResetPhoneNumber()
ResetPhoneNumber resets all changes to the "phone_number" field.
func (*UserMutation) ResetProfilePicture ¶
func (m *UserMutation) ResetProfilePicture()
ResetProfilePicture resets all changes to the "profile_picture" field.
func (*UserMutation) ResetRegistrationMethod ¶
func (m *UserMutation) ResetRegistrationMethod()
ResetRegistrationMethod resets all changes to the "registration_method" field.
func (*UserMutation) ResetSmsNotifications ¶
func (m *UserMutation) ResetSmsNotifications()
ResetSmsNotifications resets all changes to the "sms_notifications" field.
func (*UserMutation) ResetUpdatedAt ¶
func (m *UserMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*UserMutation) ResetVerificationCode ¶
func (m *UserMutation) ResetVerificationCode()
ResetVerificationCode resets all changes to the "verification_code" field.
func (*UserMutation) ResetVerified ¶
func (m *UserMutation) ResetVerified()
ResetVerified resets all changes to the "verified" field.
func (*UserMutation) SetAdmin ¶
func (m *UserMutation) SetAdmin(b bool)
SetAdmin sets the "admin" field.
func (*UserMutation) SetCreatedAt ¶
func (m *UserMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*UserMutation) SetDarkMode ¶
func (m *UserMutation) SetDarkMode(b bool)
SetDarkMode sets the "dark_mode" field.
func (*UserMutation) SetEmail ¶
func (m *UserMutation) SetEmail(s string)
SetEmail sets the "email" field.
func (*UserMutation) SetEmailNotifications ¶
func (m *UserMutation) SetEmailNotifications(b bool)
SetEmailNotifications sets the "email_notifications" field.
func (*UserMutation) SetField ¶
func (m *UserMutation) SetField(name string, value ent.Value) error
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 (*UserMutation) SetIsActive ¶
func (m *UserMutation) SetIsActive(b bool)
SetIsActive sets the "is_active" field.
func (*UserMutation) SetLastLogin ¶
func (m *UserMutation) SetLastLogin(t time.Time)
SetLastLogin sets the "last_login" field.
func (*UserMutation) SetName ¶
func (m *UserMutation) SetName(s string)
SetName sets the "name" field.
func (*UserMutation) SetOp ¶
func (m *UserMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UserMutation) SetPassword ¶
func (m *UserMutation) SetPassword(s string)
SetPassword sets the "password" field.
func (*UserMutation) SetPhoneNumber ¶
func (m *UserMutation) SetPhoneNumber(s string)
SetPhoneNumber sets the "phone_number" field.
func (*UserMutation) SetProfilePicture ¶
func (m *UserMutation) SetProfilePicture(s string)
SetProfilePicture sets the "profile_picture" field.
func (*UserMutation) SetRegistrationMethod ¶
func (m *UserMutation) SetRegistrationMethod(um user.RegistrationMethod)
SetRegistrationMethod sets the "registration_method" field.
func (*UserMutation) SetSmsNotifications ¶
func (m *UserMutation) SetSmsNotifications(b bool)
SetSmsNotifications sets the "sms_notifications" field.
func (*UserMutation) SetUpdatedAt ¶
func (m *UserMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*UserMutation) SetVerificationCode ¶
func (m *UserMutation) SetVerificationCode(s string)
SetVerificationCode sets the "verification_code" field.
func (*UserMutation) SetVerified ¶
func (m *UserMutation) SetVerified(b bool)
SetVerified sets the "verified" field.
func (*UserMutation) SmsNotifications ¶
func (m *UserMutation) SmsNotifications() (r bool, exists bool)
SmsNotifications returns the value of the "sms_notifications" field in the mutation.
func (UserMutation) Tx ¶
func (m UserMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserMutation) Type ¶
func (m *UserMutation) Type() string
Type returns the node type of this mutation (User).
func (*UserMutation) UpdatedAt ¶
func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*UserMutation) UpdatedAtCleared ¶
func (m *UserMutation) UpdatedAtCleared() bool
UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.
func (*UserMutation) VerificationCode ¶
func (m *UserMutation) VerificationCode() (r string, exists bool)
VerificationCode returns the value of the "verification_code" field in the mutation.
func (*UserMutation) VerificationCodeCleared ¶
func (m *UserMutation) VerificationCodeCleared() bool
VerificationCodeCleared returns if the "verification_code" field was cleared in this mutation.
func (*UserMutation) Verified ¶
func (m *UserMutation) Verified() (r bool, exists bool)
Verified returns the value of the "verified" field in the mutation.
func (*UserMutation) Where ¶
func (m *UserMutation) Where(ps ...predicate.User)
Where appends a list predicates to the UserMutation builder.
func (*UserMutation) WhereP ¶
func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Aggregate ¶
func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate returns a UserSelect configured with the given aggregations.
func (*UserQuery) Clone ¶
Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserQuery) First ¶
First returns the first User entity from the query. Returns a *NotFoundError when no User was found.
func (*UserQuery) FirstID ¶
FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.
func (*UserQuery) GroupBy ¶
func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct {
Name string `json:"name,omitempty"`
Count int `json:"count,omitempty"`
}
client.User.Query().
GroupBy(user.FieldName).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*UserQuery) Only ¶
Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.
func (*UserQuery) OnlyID ¶
OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.
func (*UserQuery) Order ¶
func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
Order specifies how the records should be ordered.
func (*UserQuery) QueryNoteLikes ¶
func (uq *UserQuery) QueryNoteLikes() *NoteLikeQuery
QueryNoteLikes chains the current query on the "note_likes" edge.
func (*UserQuery) QueryNoteReposts ¶
func (uq *UserQuery) QueryNoteReposts() *NoteRepostQuery
QueryNoteReposts chains the current query on the "note_reposts" edge.
func (*UserQuery) QueryNotes ¶
QueryNotes chains the current query on the "notes" edge.
func (*UserQuery) QueryOwner ¶
func (uq *UserQuery) QueryOwner() *PasswordTokenQuery
QueryOwner chains the current query on the "owner" edge.
func (*UserQuery) Select ¶
func (uq *UserQuery) Select(fields ...string) *UserSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct {
Name string `json:"name,omitempty"`
}
client.User.Query().
Select(user.FieldName).
Scan(ctx, &v)
func (*UserQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*UserQuery) WithNoteLikes ¶
func (uq *UserQuery) WithNoteLikes(opts ...func(*NoteLikeQuery)) *UserQuery
WithNoteLikes tells the query-builder to eager-load the nodes that are connected to the "note_likes" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithNoteReposts ¶
func (uq *UserQuery) WithNoteReposts(opts ...func(*NoteRepostQuery)) *UserQuery
WithNoteReposts tells the query-builder to eager-load the nodes that are connected to the "note_reposts" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithNotes ¶
WithNotes tells the query-builder to eager-load the nodes that are connected to the "notes" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithOwner ¶
func (uq *UserQuery) WithOwner(opts ...func(*PasswordTokenQuery)) *UserQuery
WithOwner tells the query-builder to eager-load the nodes that are connected to the "owner" edge. The optional arguments are used to configure the query builder of the edge.
type UserSelect ¶
type UserSelect struct {
*UserQuery
// contains filtered or unexported fields
}
UserSelect is the builder for selecting fields of User entities.
func (*UserSelect) Aggregate ¶
func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UserSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSelect) Scan ¶
func (us *UserSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) AddNoteIDs ¶
func (uu *UserUpdate) AddNoteIDs(ids ...int) *UserUpdate
AddNoteIDs adds the "notes" edge to the Note entity by IDs.
func (*UserUpdate) AddNoteLikeIDs ¶
func (uu *UserUpdate) AddNoteLikeIDs(ids ...int) *UserUpdate
AddNoteLikeIDs adds the "note_likes" edge to the NoteLike entity by IDs.
func (*UserUpdate) AddNoteLikes ¶
func (uu *UserUpdate) AddNoteLikes(n ...*NoteLike) *UserUpdate
AddNoteLikes adds the "note_likes" edges to the NoteLike entity.
func (*UserUpdate) AddNoteRepostIDs ¶
func (uu *UserUpdate) AddNoteRepostIDs(ids ...int) *UserUpdate
AddNoteRepostIDs adds the "note_reposts" edge to the NoteRepost entity by IDs.
func (*UserUpdate) AddNoteReposts ¶
func (uu *UserUpdate) AddNoteReposts(n ...*NoteRepost) *UserUpdate
AddNoteReposts adds the "note_reposts" edges to the NoteRepost entity.
func (*UserUpdate) AddNotes ¶
func (uu *UserUpdate) AddNotes(n ...*Note) *UserUpdate
AddNotes adds the "notes" edges to the Note entity.
func (*UserUpdate) AddOwner ¶
func (uu *UserUpdate) AddOwner(p ...*PasswordToken) *UserUpdate
AddOwner adds the "owner" edges to the PasswordToken entity.
func (*UserUpdate) AddOwnerIDs ¶
func (uu *UserUpdate) AddOwnerIDs(ids ...int) *UserUpdate
AddOwnerIDs adds the "owner" edge to the PasswordToken entity by IDs.
func (*UserUpdate) ClearBio ¶
func (uu *UserUpdate) ClearBio() *UserUpdate
ClearBio clears the value of the "bio" field.
func (*UserUpdate) ClearEmail ¶
func (uu *UserUpdate) ClearEmail() *UserUpdate
ClearEmail clears the value of the "email" field.
func (*UserUpdate) ClearLastLogin ¶
func (uu *UserUpdate) ClearLastLogin() *UserUpdate
ClearLastLogin clears the value of the "last_login" field.
func (*UserUpdate) ClearNoteLikes ¶
func (uu *UserUpdate) ClearNoteLikes() *UserUpdate
ClearNoteLikes clears all "note_likes" edges to the NoteLike entity.
func (*UserUpdate) ClearNoteReposts ¶
func (uu *UserUpdate) ClearNoteReposts() *UserUpdate
ClearNoteReposts clears all "note_reposts" edges to the NoteRepost entity.
func (*UserUpdate) ClearNotes ¶
func (uu *UserUpdate) ClearNotes() *UserUpdate
ClearNotes clears all "notes" edges to the Note entity.
func (*UserUpdate) ClearOwner ¶
func (uu *UserUpdate) ClearOwner() *UserUpdate
ClearOwner clears all "owner" edges to the PasswordToken entity.
func (*UserUpdate) ClearPassword ¶
func (uu *UserUpdate) ClearPassword() *UserUpdate
ClearPassword clears the value of the "password" field.
func (*UserUpdate) ClearProfilePicture ¶
func (uu *UserUpdate) ClearProfilePicture() *UserUpdate
ClearProfilePicture clears the value of the "profile_picture" field.
func (*UserUpdate) ClearUpdatedAt ¶
func (uu *UserUpdate) ClearUpdatedAt() *UserUpdate
ClearUpdatedAt clears the value of the "updated_at" field.
func (*UserUpdate) ClearVerificationCode ¶
func (uu *UserUpdate) ClearVerificationCode() *UserUpdate
ClearVerificationCode clears the value of the "verification_code" field.
func (*UserUpdate) Exec ¶
func (uu *UserUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpdate) ExecX ¶
func (uu *UserUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdate) Mutation ¶
func (uu *UserUpdate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdate) RemoveNoteIDs ¶
func (uu *UserUpdate) RemoveNoteIDs(ids ...int) *UserUpdate
RemoveNoteIDs removes the "notes" edge to Note entities by IDs.
func (*UserUpdate) RemoveNoteLikeIDs ¶
func (uu *UserUpdate) RemoveNoteLikeIDs(ids ...int) *UserUpdate
RemoveNoteLikeIDs removes the "note_likes" edge to NoteLike entities by IDs.
func (*UserUpdate) RemoveNoteLikes ¶
func (uu *UserUpdate) RemoveNoteLikes(n ...*NoteLike) *UserUpdate
RemoveNoteLikes removes "note_likes" edges to NoteLike entities.
func (*UserUpdate) RemoveNoteRepostIDs ¶
func (uu *UserUpdate) RemoveNoteRepostIDs(ids ...int) *UserUpdate
RemoveNoteRepostIDs removes the "note_reposts" edge to NoteRepost entities by IDs.
func (*UserUpdate) RemoveNoteReposts ¶
func (uu *UserUpdate) RemoveNoteReposts(n ...*NoteRepost) *UserUpdate
RemoveNoteReposts removes "note_reposts" edges to NoteRepost entities.
func (*UserUpdate) RemoveNotes ¶
func (uu *UserUpdate) RemoveNotes(n ...*Note) *UserUpdate
RemoveNotes removes "notes" edges to Note entities.
func (*UserUpdate) RemoveOwner ¶
func (uu *UserUpdate) RemoveOwner(p ...*PasswordToken) *UserUpdate
RemoveOwner removes "owner" edges to PasswordToken entities.
func (*UserUpdate) RemoveOwnerIDs ¶
func (uu *UserUpdate) RemoveOwnerIDs(ids ...int) *UserUpdate
RemoveOwnerIDs removes the "owner" edge to PasswordToken entities by IDs.
func (*UserUpdate) Save ¶
func (uu *UserUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserUpdate) SaveX ¶
func (uu *UserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserUpdate) SetAdmin ¶
func (uu *UserUpdate) SetAdmin(b bool) *UserUpdate
SetAdmin sets the "admin" field.
func (*UserUpdate) SetBio ¶
func (uu *UserUpdate) SetBio(s string) *UserUpdate
SetBio sets the "bio" field.
func (*UserUpdate) SetDarkMode ¶
func (uu *UserUpdate) SetDarkMode(b bool) *UserUpdate
SetDarkMode sets the "dark_mode" field.
func (*UserUpdate) SetEmail ¶
func (uu *UserUpdate) SetEmail(s string) *UserUpdate
SetEmail sets the "email" field.
func (*UserUpdate) SetEmailNotifications ¶
func (uu *UserUpdate) SetEmailNotifications(b bool) *UserUpdate
SetEmailNotifications sets the "email_notifications" field.
func (*UserUpdate) SetIsActive ¶
func (uu *UserUpdate) SetIsActive(b bool) *UserUpdate
SetIsActive sets the "is_active" field.
func (*UserUpdate) SetLastLogin ¶
func (uu *UserUpdate) SetLastLogin(t time.Time) *UserUpdate
SetLastLogin sets the "last_login" field.
func (*UserUpdate) SetName ¶
func (uu *UserUpdate) SetName(s string) *UserUpdate
SetName sets the "name" field.
func (*UserUpdate) SetNillableAdmin ¶
func (uu *UserUpdate) SetNillableAdmin(b *bool) *UserUpdate
SetNillableAdmin sets the "admin" field if the given value is not nil.
func (*UserUpdate) SetNillableBio ¶
func (uu *UserUpdate) SetNillableBio(s *string) *UserUpdate
SetNillableBio sets the "bio" field if the given value is not nil.
func (*UserUpdate) SetNillableDarkMode ¶
func (uu *UserUpdate) SetNillableDarkMode(b *bool) *UserUpdate
SetNillableDarkMode sets the "dark_mode" field if the given value is not nil.
func (*UserUpdate) SetNillableEmail ¶
func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdate) SetNillableEmailNotifications ¶
func (uu *UserUpdate) SetNillableEmailNotifications(b *bool) *UserUpdate
SetNillableEmailNotifications sets the "email_notifications" field if the given value is not nil.
func (*UserUpdate) SetNillableIsActive ¶
func (uu *UserUpdate) SetNillableIsActive(b *bool) *UserUpdate
SetNillableIsActive sets the "is_active" field if the given value is not nil.
func (*UserUpdate) SetNillableLastLogin ¶
func (uu *UserUpdate) SetNillableLastLogin(t *time.Time) *UserUpdate
SetNillableLastLogin sets the "last_login" field if the given value is not nil.
func (*UserUpdate) SetNillableName ¶
func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*UserUpdate) SetNillablePassword ¶
func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate
SetNillablePassword sets the "password" field if the given value is not nil.
func (*UserUpdate) SetNillablePhoneNumber ¶
func (uu *UserUpdate) SetNillablePhoneNumber(s *string) *UserUpdate
SetNillablePhoneNumber sets the "phone_number" field if the given value is not nil.
func (*UserUpdate) SetNillableProfilePicture ¶
func (uu *UserUpdate) SetNillableProfilePicture(s *string) *UserUpdate
SetNillableProfilePicture sets the "profile_picture" field if the given value is not nil.
func (*UserUpdate) SetNillableRegistrationMethod ¶
func (uu *UserUpdate) SetNillableRegistrationMethod(um *user.RegistrationMethod) *UserUpdate
SetNillableRegistrationMethod sets the "registration_method" field if the given value is not nil.
func (*UserUpdate) SetNillableSmsNotifications ¶
func (uu *UserUpdate) SetNillableSmsNotifications(b *bool) *UserUpdate
SetNillableSmsNotifications sets the "sms_notifications" field if the given value is not nil.
func (*UserUpdate) SetNillableVerificationCode ¶
func (uu *UserUpdate) SetNillableVerificationCode(s *string) *UserUpdate
SetNillableVerificationCode sets the "verification_code" field if the given value is not nil.
func (*UserUpdate) SetNillableVerified ¶
func (uu *UserUpdate) SetNillableVerified(b *bool) *UserUpdate
SetNillableVerified sets the "verified" field if the given value is not nil.
func (*UserUpdate) SetPassword ¶
func (uu *UserUpdate) SetPassword(s string) *UserUpdate
SetPassword sets the "password" field.
func (*UserUpdate) SetPhoneNumber ¶
func (uu *UserUpdate) SetPhoneNumber(s string) *UserUpdate
SetPhoneNumber sets the "phone_number" field.
func (*UserUpdate) SetProfilePicture ¶
func (uu *UserUpdate) SetProfilePicture(s string) *UserUpdate
SetProfilePicture sets the "profile_picture" field.
func (*UserUpdate) SetRegistrationMethod ¶
func (uu *UserUpdate) SetRegistrationMethod(um user.RegistrationMethod) *UserUpdate
SetRegistrationMethod sets the "registration_method" field.
func (*UserUpdate) SetSmsNotifications ¶
func (uu *UserUpdate) SetSmsNotifications(b bool) *UserUpdate
SetSmsNotifications sets the "sms_notifications" field.
func (*UserUpdate) SetUpdatedAt ¶
func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate
SetUpdatedAt sets the "updated_at" field.
func (*UserUpdate) SetVerificationCode ¶
func (uu *UserUpdate) SetVerificationCode(s string) *UserUpdate
SetVerificationCode sets the "verification_code" field.
func (*UserUpdate) SetVerified ¶
func (uu *UserUpdate) SetVerified(b bool) *UserUpdate
SetVerified sets the "verified" field.
func (*UserUpdate) Where ¶
func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
Where appends a list predicates to the UserUpdate builder.
type UserUpdateOne ¶
type UserUpdateOne struct {
// contains filtered or unexported fields
}
UserUpdateOne is the builder for updating a single User entity.
func (*UserUpdateOne) AddNoteIDs ¶
func (uuo *UserUpdateOne) AddNoteIDs(ids ...int) *UserUpdateOne
AddNoteIDs adds the "notes" edge to the Note entity by IDs.
func (*UserUpdateOne) AddNoteLikeIDs ¶
func (uuo *UserUpdateOne) AddNoteLikeIDs(ids ...int) *UserUpdateOne
AddNoteLikeIDs adds the "note_likes" edge to the NoteLike entity by IDs.
func (*UserUpdateOne) AddNoteLikes ¶
func (uuo *UserUpdateOne) AddNoteLikes(n ...*NoteLike) *UserUpdateOne
AddNoteLikes adds the "note_likes" edges to the NoteLike entity.
func (*UserUpdateOne) AddNoteRepostIDs ¶
func (uuo *UserUpdateOne) AddNoteRepostIDs(ids ...int) *UserUpdateOne
AddNoteRepostIDs adds the "note_reposts" edge to the NoteRepost entity by IDs.
func (*UserUpdateOne) AddNoteReposts ¶
func (uuo *UserUpdateOne) AddNoteReposts(n ...*NoteRepost) *UserUpdateOne
AddNoteReposts adds the "note_reposts" edges to the NoteRepost entity.
func (*UserUpdateOne) AddNotes ¶
func (uuo *UserUpdateOne) AddNotes(n ...*Note) *UserUpdateOne
AddNotes adds the "notes" edges to the Note entity.
func (*UserUpdateOne) AddOwner ¶
func (uuo *UserUpdateOne) AddOwner(p ...*PasswordToken) *UserUpdateOne
AddOwner adds the "owner" edges to the PasswordToken entity.
func (*UserUpdateOne) AddOwnerIDs ¶
func (uuo *UserUpdateOne) AddOwnerIDs(ids ...int) *UserUpdateOne
AddOwnerIDs adds the "owner" edge to the PasswordToken entity by IDs.
func (*UserUpdateOne) ClearBio ¶
func (uuo *UserUpdateOne) ClearBio() *UserUpdateOne
ClearBio clears the value of the "bio" field.
func (*UserUpdateOne) ClearEmail ¶
func (uuo *UserUpdateOne) ClearEmail() *UserUpdateOne
ClearEmail clears the value of the "email" field.
func (*UserUpdateOne) ClearLastLogin ¶
func (uuo *UserUpdateOne) ClearLastLogin() *UserUpdateOne
ClearLastLogin clears the value of the "last_login" field.
func (*UserUpdateOne) ClearNoteLikes ¶
func (uuo *UserUpdateOne) ClearNoteLikes() *UserUpdateOne
ClearNoteLikes clears all "note_likes" edges to the NoteLike entity.
func (*UserUpdateOne) ClearNoteReposts ¶
func (uuo *UserUpdateOne) ClearNoteReposts() *UserUpdateOne
ClearNoteReposts clears all "note_reposts" edges to the NoteRepost entity.
func (*UserUpdateOne) ClearNotes ¶
func (uuo *UserUpdateOne) ClearNotes() *UserUpdateOne
ClearNotes clears all "notes" edges to the Note entity.
func (*UserUpdateOne) ClearOwner ¶
func (uuo *UserUpdateOne) ClearOwner() *UserUpdateOne
ClearOwner clears all "owner" edges to the PasswordToken entity.
func (*UserUpdateOne) ClearPassword ¶
func (uuo *UserUpdateOne) ClearPassword() *UserUpdateOne
ClearPassword clears the value of the "password" field.
func (*UserUpdateOne) ClearProfilePicture ¶
func (uuo *UserUpdateOne) ClearProfilePicture() *UserUpdateOne
ClearProfilePicture clears the value of the "profile_picture" field.
func (*UserUpdateOne) ClearUpdatedAt ¶
func (uuo *UserUpdateOne) ClearUpdatedAt() *UserUpdateOne
ClearUpdatedAt clears the value of the "updated_at" field.
func (*UserUpdateOne) ClearVerificationCode ¶
func (uuo *UserUpdateOne) ClearVerificationCode() *UserUpdateOne
ClearVerificationCode clears the value of the "verification_code" field.
func (*UserUpdateOne) Exec ¶
func (uuo *UserUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserUpdateOne) ExecX ¶
func (uuo *UserUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdateOne) Mutation ¶
func (uuo *UserUpdateOne) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdateOne) RemoveNoteIDs ¶
func (uuo *UserUpdateOne) RemoveNoteIDs(ids ...int) *UserUpdateOne
RemoveNoteIDs removes the "notes" edge to Note entities by IDs.
func (*UserUpdateOne) RemoveNoteLikeIDs ¶
func (uuo *UserUpdateOne) RemoveNoteLikeIDs(ids ...int) *UserUpdateOne
RemoveNoteLikeIDs removes the "note_likes" edge to NoteLike entities by IDs.
func (*UserUpdateOne) RemoveNoteLikes ¶
func (uuo *UserUpdateOne) RemoveNoteLikes(n ...*NoteLike) *UserUpdateOne
RemoveNoteLikes removes "note_likes" edges to NoteLike entities.
func (*UserUpdateOne) RemoveNoteRepostIDs ¶
func (uuo *UserUpdateOne) RemoveNoteRepostIDs(ids ...int) *UserUpdateOne
RemoveNoteRepostIDs removes the "note_reposts" edge to NoteRepost entities by IDs.
func (*UserUpdateOne) RemoveNoteReposts ¶
func (uuo *UserUpdateOne) RemoveNoteReposts(n ...*NoteRepost) *UserUpdateOne
RemoveNoteReposts removes "note_reposts" edges to NoteRepost entities.
func (*UserUpdateOne) RemoveNotes ¶
func (uuo *UserUpdateOne) RemoveNotes(n ...*Note) *UserUpdateOne
RemoveNotes removes "notes" edges to Note entities.
func (*UserUpdateOne) RemoveOwner ¶
func (uuo *UserUpdateOne) RemoveOwner(p ...*PasswordToken) *UserUpdateOne
RemoveOwner removes "owner" edges to PasswordToken entities.
func (*UserUpdateOne) RemoveOwnerIDs ¶
func (uuo *UserUpdateOne) RemoveOwnerIDs(ids ...int) *UserUpdateOne
RemoveOwnerIDs removes the "owner" edge to PasswordToken entities by IDs.
func (*UserUpdateOne) Save ¶
func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
Save executes the query and returns the updated User entity.
func (*UserUpdateOne) SaveX ¶
func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
SaveX is like Save, but panics if an error occurs.
func (*UserUpdateOne) Select ¶
func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserUpdateOne) SetAdmin ¶
func (uuo *UserUpdateOne) SetAdmin(b bool) *UserUpdateOne
SetAdmin sets the "admin" field.
func (*UserUpdateOne) SetBio ¶
func (uuo *UserUpdateOne) SetBio(s string) *UserUpdateOne
SetBio sets the "bio" field.
func (*UserUpdateOne) SetDarkMode ¶
func (uuo *UserUpdateOne) SetDarkMode(b bool) *UserUpdateOne
SetDarkMode sets the "dark_mode" field.
func (*UserUpdateOne) SetEmail ¶
func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
SetEmail sets the "email" field.
func (*UserUpdateOne) SetEmailNotifications ¶
func (uuo *UserUpdateOne) SetEmailNotifications(b bool) *UserUpdateOne
SetEmailNotifications sets the "email_notifications" field.
func (*UserUpdateOne) SetIsActive ¶
func (uuo *UserUpdateOne) SetIsActive(b bool) *UserUpdateOne
SetIsActive sets the "is_active" field.
func (*UserUpdateOne) SetLastLogin ¶
func (uuo *UserUpdateOne) SetLastLogin(t time.Time) *UserUpdateOne
SetLastLogin sets the "last_login" field.
func (*UserUpdateOne) SetName ¶
func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne
SetName sets the "name" field.
func (*UserUpdateOne) SetNillableAdmin ¶
func (uuo *UserUpdateOne) SetNillableAdmin(b *bool) *UserUpdateOne
SetNillableAdmin sets the "admin" field if the given value is not nil.
func (*UserUpdateOne) SetNillableBio ¶
func (uuo *UserUpdateOne) SetNillableBio(s *string) *UserUpdateOne
SetNillableBio sets the "bio" field if the given value is not nil.
func (*UserUpdateOne) SetNillableDarkMode ¶
func (uuo *UserUpdateOne) SetNillableDarkMode(b *bool) *UserUpdateOne
SetNillableDarkMode sets the "dark_mode" field if the given value is not nil.
func (*UserUpdateOne) SetNillableEmail ¶
func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdateOne) SetNillableEmailNotifications ¶
func (uuo *UserUpdateOne) SetNillableEmailNotifications(b *bool) *UserUpdateOne
SetNillableEmailNotifications sets the "email_notifications" field if the given value is not nil.
func (*UserUpdateOne) SetNillableIsActive ¶
func (uuo *UserUpdateOne) SetNillableIsActive(b *bool) *UserUpdateOne
SetNillableIsActive sets the "is_active" field if the given value is not nil.
func (*UserUpdateOne) SetNillableLastLogin ¶
func (uuo *UserUpdateOne) SetNillableLastLogin(t *time.Time) *UserUpdateOne
SetNillableLastLogin sets the "last_login" field if the given value is not nil.
func (*UserUpdateOne) SetNillableName ¶
func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*UserUpdateOne) SetNillablePassword ¶
func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne
SetNillablePassword sets the "password" field if the given value is not nil.
func (*UserUpdateOne) SetNillablePhoneNumber ¶
func (uuo *UserUpdateOne) SetNillablePhoneNumber(s *string) *UserUpdateOne
SetNillablePhoneNumber sets the "phone_number" field if the given value is not nil.
func (*UserUpdateOne) SetNillableProfilePicture ¶
func (uuo *UserUpdateOne) SetNillableProfilePicture(s *string) *UserUpdateOne
SetNillableProfilePicture sets the "profile_picture" field if the given value is not nil.
func (*UserUpdateOne) SetNillableRegistrationMethod ¶
func (uuo *UserUpdateOne) SetNillableRegistrationMethod(um *user.RegistrationMethod) *UserUpdateOne
SetNillableRegistrationMethod sets the "registration_method" field if the given value is not nil.
func (*UserUpdateOne) SetNillableSmsNotifications ¶
func (uuo *UserUpdateOne) SetNillableSmsNotifications(b *bool) *UserUpdateOne
SetNillableSmsNotifications sets the "sms_notifications" field if the given value is not nil.
func (*UserUpdateOne) SetNillableVerificationCode ¶
func (uuo *UserUpdateOne) SetNillableVerificationCode(s *string) *UserUpdateOne
SetNillableVerificationCode sets the "verification_code" field if the given value is not nil.
func (*UserUpdateOne) SetNillableVerified ¶
func (uuo *UserUpdateOne) SetNillableVerified(b *bool) *UserUpdateOne
SetNillableVerified sets the "verified" field if the given value is not nil.
func (*UserUpdateOne) SetPassword ¶
func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne
SetPassword sets the "password" field.
func (*UserUpdateOne) SetPhoneNumber ¶
func (uuo *UserUpdateOne) SetPhoneNumber(s string) *UserUpdateOne
SetPhoneNumber sets the "phone_number" field.
func (*UserUpdateOne) SetProfilePicture ¶
func (uuo *UserUpdateOne) SetProfilePicture(s string) *UserUpdateOne
SetProfilePicture sets the "profile_picture" field.
func (*UserUpdateOne) SetRegistrationMethod ¶
func (uuo *UserUpdateOne) SetRegistrationMethod(um user.RegistrationMethod) *UserUpdateOne
SetRegistrationMethod sets the "registration_method" field.
func (*UserUpdateOne) SetSmsNotifications ¶
func (uuo *UserUpdateOne) SetSmsNotifications(b bool) *UserUpdateOne
SetSmsNotifications sets the "sms_notifications" field.
func (*UserUpdateOne) SetUpdatedAt ¶
func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*UserUpdateOne) SetVerificationCode ¶
func (uuo *UserUpdateOne) SetVerificationCode(s string) *UserUpdateOne
SetVerificationCode sets the "verification_code" field.
func (*UserUpdateOne) SetVerified ¶
func (uuo *UserUpdateOne) SetVerified(b bool) *UserUpdateOne
SetVerified sets the "verified" field.
func (*UserUpdateOne) Where ¶
func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
Where appends a list predicates to the UserUpdate builder.
type ValidationError ¶
type ValidationError struct {
Name string // Field or edge name.
// contains filtered or unexported fields
}
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
Source Files
¶
- client.go
- ent.go
- generate.go
- mutation.go
- note.go
- note_create.go
- note_delete.go
- note_query.go
- note_update.go
- notelike.go
- notelike_create.go
- notelike_delete.go
- notelike_query.go
- notelike_update.go
- noterepost.go
- noterepost_create.go
- noterepost_delete.go
- noterepost_query.go
- noterepost_update.go
- passwordtoken.go
- passwordtoken_create.go
- passwordtoken_delete.go
- passwordtoken_query.go
- passwordtoken_update.go
- runtime.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go