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 NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- func OpenTxFromContext(ctx context.Context) (context.Context, driver.Tx, error)
- 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) Node(ctx context.Context, id uuid.UUID) (*Node, error)
- func (c *Client) Noder(ctx context.Context, id uuid.UUID, opts ...NodeOption) (_ Noder, err error)
- func (c *Client) Noders(ctx context.Context, ids []uuid.UUID, opts ...NodeOption) ([]Noder, error)
- func (c *Client) OpenTx(ctx context.Context) (context.Context, driver.Tx, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ComplexityRoot
- type Config
- type ConstraintError
- type Cursor
- type DirectiveRoot
- type Edge
- type Field
- type Group
- func (n *Group) IsNode()
- func (gr *Group) NamedUsers(name string) ([]*User, error)
- func (gr *Group) Node(ctx context.Context) (node *Node, err error)
- func (gr *Group) QueryUsers() *UserQuery
- func (gr *Group) String() string
- func (gr *Group) ToEdge(order *GroupOrder) *GroupEdge
- func (gr *Group) Unwrap() *Group
- func (gr *Group) Update() *GroupUpdateOne
- func (gr *Group) Users(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*UserConnection, error)
- func (gr *Group) Value(name string) (ent.Value, error)
- type GroupClient
- func (c *GroupClient) Create() *GroupCreate
- func (c *GroupClient) CreateBulk(builders ...*GroupCreate) *GroupCreateBulk
- func (c *GroupClient) Delete() *GroupDelete
- func (c *GroupClient) DeleteOne(gr *Group) *GroupDeleteOne
- func (c *GroupClient) DeleteOneID(id uuid.UUID) *GroupDeleteOne
- func (c *GroupClient) Get(ctx context.Context, id uuid.UUID) (*Group, error)
- func (c *GroupClient) GetX(ctx context.Context, id uuid.UUID) *Group
- func (c *GroupClient) Hooks() []Hook
- func (c *GroupClient) Intercept(interceptors ...Interceptor)
- func (c *GroupClient) Interceptors() []Interceptor
- func (c *GroupClient) Query() *GroupQuery
- func (c *GroupClient) QueryUsers(gr *Group) *UserQuery
- func (c *GroupClient) Update() *GroupUpdate
- func (c *GroupClient) UpdateOne(gr *Group) *GroupUpdateOne
- func (c *GroupClient) UpdateOneID(id uuid.UUID) *GroupUpdateOne
- func (c *GroupClient) Use(hooks ...Hook)
- type GroupConnection
- type GroupCreate
- func (gc *GroupCreate) AddUserIDs(ids ...uuid.UUID) *GroupCreate
- func (gc *GroupCreate) AddUsers(u ...*User) *GroupCreate
- func (gc *GroupCreate) Exec(ctx context.Context) error
- func (gc *GroupCreate) ExecX(ctx context.Context)
- func (gc *GroupCreate) Mutation() *GroupMutation
- func (gc *GroupCreate) Save(ctx context.Context) (*Group, error)
- func (gc *GroupCreate) SaveX(ctx context.Context) *Group
- func (gc *GroupCreate) SetCreatedAt(t time.Time) *GroupCreate
- func (gc *GroupCreate) SetID(u uuid.UUID) *GroupCreate
- func (gc *GroupCreate) SetNillableCreatedAt(t *time.Time) *GroupCreate
- func (gc *GroupCreate) SetNillableID(u *uuid.UUID) *GroupCreate
- func (gc *GroupCreate) SetNillableUpdatedAt(t *time.Time) *GroupCreate
- func (gc *GroupCreate) SetUpdatedAt(t time.Time) *GroupCreate
- type GroupCreateBulk
- type GroupDelete
- type GroupDeleteOne
- type GroupEdge
- type GroupEdges
- type GroupGroupBy
- func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy
- func (s *GroupGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *GroupGroupBy) BoolX(ctx context.Context) bool
- func (s *GroupGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *GroupGroupBy) BoolsX(ctx context.Context) []bool
- func (s *GroupGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *GroupGroupBy) Float64X(ctx context.Context) float64
- func (s *GroupGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *GroupGroupBy) Float64sX(ctx context.Context) []float64
- func (s *GroupGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *GroupGroupBy) IntX(ctx context.Context) int
- func (s *GroupGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *GroupGroupBy) IntsX(ctx context.Context) []int
- func (ggb *GroupGroupBy) Scan(ctx context.Context, v any) error
- func (s *GroupGroupBy) ScanX(ctx context.Context, v any)
- func (s *GroupGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *GroupGroupBy) StringX(ctx context.Context) string
- func (s *GroupGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *GroupGroupBy) StringsX(ctx context.Context) []string
- type GroupMutation
- func (m *GroupMutation) AddField(name string, value ent.Value) error
- func (m *GroupMutation) AddUserIDs(ids ...uuid.UUID)
- func (m *GroupMutation) AddedEdges() []string
- func (m *GroupMutation) AddedField(name string) (ent.Value, bool)
- func (m *GroupMutation) AddedFields() []string
- func (m *GroupMutation) AddedIDs(name string) []ent.Value
- func (m *GroupMutation) ClearEdge(name string) error
- func (m *GroupMutation) ClearField(name string) error
- func (m *GroupMutation) ClearUsers()
- func (m *GroupMutation) ClearedEdges() []string
- func (m *GroupMutation) ClearedFields() []string
- func (m GroupMutation) Client() *Client
- func (m *GroupMutation) CreatedAt() (r time.Time, exists bool)
- func (m *GroupMutation) EdgeCleared(name string) bool
- func (m *GroupMutation) Field(name string) (ent.Value, bool)
- func (m *GroupMutation) FieldCleared(name string) bool
- func (m *GroupMutation) Fields() []string
- func (m *GroupMutation) ID() (id uuid.UUID, exists bool)
- func (m *GroupMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *GroupMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *GroupMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *GroupMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *GroupMutation) Op() Op
- func (m *GroupMutation) RemoveUserIDs(ids ...uuid.UUID)
- func (m *GroupMutation) RemovedEdges() []string
- func (m *GroupMutation) RemovedIDs(name string) []ent.Value
- func (m *GroupMutation) RemovedUsersIDs() (ids []uuid.UUID)
- func (m *GroupMutation) ResetCreatedAt()
- func (m *GroupMutation) ResetEdge(name string) error
- func (m *GroupMutation) ResetField(name string) error
- func (m *GroupMutation) ResetUpdatedAt()
- func (m *GroupMutation) ResetUsers()
- func (m *GroupMutation) SetCreatedAt(t time.Time)
- func (m *GroupMutation) SetField(name string, value ent.Value) error
- func (m *GroupMutation) SetID(id uuid.UUID)
- func (m *GroupMutation) SetOp(op Op)
- func (m *GroupMutation) SetUpdatedAt(t time.Time)
- func (m GroupMutation) Tx() (*Tx, error)
- func (m *GroupMutation) Type() string
- func (m *GroupMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *GroupMutation) UsersCleared() bool
- func (m *GroupMutation) UsersIDs() (ids []uuid.UUID)
- func (m *GroupMutation) Where(ps ...predicate.Group)
- func (m *GroupMutation) WhereP(ps ...func(*sql.Selector))
- type GroupOrder
- type GroupOrderField
- type GroupPaginateOption
- type GroupQuery
- func (gq *GroupQuery) Aggregate(fns ...AggregateFunc) *GroupSelect
- func (gq *GroupQuery) All(ctx context.Context) ([]*Group, error)
- func (gq *GroupQuery) AllX(ctx context.Context) []*Group
- func (gq *GroupQuery) Clone() *GroupQuery
- func (gr *GroupQuery) CollectFields(ctx context.Context, satisfies ...string) (*GroupQuery, error)
- func (gq *GroupQuery) Count(ctx context.Context) (int, error)
- func (gq *GroupQuery) CountX(ctx context.Context) int
- func (gq *GroupQuery) Exist(ctx context.Context) (bool, error)
- func (gq *GroupQuery) ExistX(ctx context.Context) bool
- func (gq *GroupQuery) First(ctx context.Context) (*Group, error)
- func (gq *GroupQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (gq *GroupQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (gq *GroupQuery) FirstX(ctx context.Context) *Group
- func (gq *GroupQuery) GroupBy(field string, fields ...string) *GroupGroupBy
- func (gq *GroupQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (gq *GroupQuery) IDsX(ctx context.Context) []uuid.UUID
- func (gq *GroupQuery) Limit(limit int) *GroupQuery
- func (gq *GroupQuery) Offset(offset int) *GroupQuery
- func (gq *GroupQuery) Only(ctx context.Context) (*Group, error)
- func (gq *GroupQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (gq *GroupQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (gq *GroupQuery) OnlyX(ctx context.Context) *Group
- func (gq *GroupQuery) Order(o ...group.OrderOption) *GroupQuery
- func (gr *GroupQuery) Paginate(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*GroupConnection, error)
- func (gq *GroupQuery) QueryUsers() *UserQuery
- func (gq *GroupQuery) Select(fields ...string) *GroupSelect
- func (gq *GroupQuery) Unique(unique bool) *GroupQuery
- func (gq *GroupQuery) Where(ps ...predicate.Group) *GroupQuery
- func (gq *GroupQuery) WithNamedUsers(name string, opts ...func(*UserQuery)) *GroupQuery
- func (gq *GroupQuery) WithUsers(opts ...func(*UserQuery)) *GroupQuery
- type GroupSelect
- func (gs *GroupSelect) Aggregate(fns ...AggregateFunc) *GroupSelect
- func (s *GroupSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *GroupSelect) BoolX(ctx context.Context) bool
- func (s *GroupSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *GroupSelect) BoolsX(ctx context.Context) []bool
- func (s *GroupSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *GroupSelect) Float64X(ctx context.Context) float64
- func (s *GroupSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *GroupSelect) Float64sX(ctx context.Context) []float64
- func (s *GroupSelect) Int(ctx context.Context) (_ int, err error)
- func (s *GroupSelect) IntX(ctx context.Context) int
- func (s *GroupSelect) Ints(ctx context.Context) ([]int, error)
- func (s *GroupSelect) IntsX(ctx context.Context) []int
- func (gs *GroupSelect) Scan(ctx context.Context, v any) error
- func (s *GroupSelect) ScanX(ctx context.Context, v any)
- func (s *GroupSelect) String(ctx context.Context) (_ string, err error)
- func (s *GroupSelect) StringX(ctx context.Context) string
- func (s *GroupSelect) Strings(ctx context.Context) ([]string, error)
- func (s *GroupSelect) StringsX(ctx context.Context) []string
- type GroupUpdate
- func (gu *GroupUpdate) AddUserIDs(ids ...uuid.UUID) *GroupUpdate
- func (gu *GroupUpdate) AddUsers(u ...*User) *GroupUpdate
- func (gu *GroupUpdate) ClearUsers() *GroupUpdate
- func (gu *GroupUpdate) Exec(ctx context.Context) error
- func (gu *GroupUpdate) ExecX(ctx context.Context)
- func (gu *GroupUpdate) Mutation() *GroupMutation
- func (gu *GroupUpdate) RemoveUserIDs(ids ...uuid.UUID) *GroupUpdate
- func (gu *GroupUpdate) RemoveUsers(u ...*User) *GroupUpdate
- func (gu *GroupUpdate) Save(ctx context.Context) (int, error)
- func (gu *GroupUpdate) SaveX(ctx context.Context) int
- func (gu *GroupUpdate) SetUpdatedAt(t time.Time) *GroupUpdate
- func (gu *GroupUpdate) Where(ps ...predicate.Group) *GroupUpdate
- type GroupUpdateOne
- func (guo *GroupUpdateOne) AddUserIDs(ids ...uuid.UUID) *GroupUpdateOne
- func (guo *GroupUpdateOne) AddUsers(u ...*User) *GroupUpdateOne
- func (guo *GroupUpdateOne) ClearUsers() *GroupUpdateOne
- func (guo *GroupUpdateOne) Exec(ctx context.Context) error
- func (guo *GroupUpdateOne) ExecX(ctx context.Context)
- func (guo *GroupUpdateOne) Mutation() *GroupMutation
- func (guo *GroupUpdateOne) RemoveUserIDs(ids ...uuid.UUID) *GroupUpdateOne
- func (guo *GroupUpdateOne) RemoveUsers(u ...*User) *GroupUpdateOne
- func (guo *GroupUpdateOne) Save(ctx context.Context) (*Group, error)
- func (guo *GroupUpdateOne) SaveX(ctx context.Context) *Group
- func (guo *GroupUpdateOne) Select(field string, fields ...string) *GroupUpdateOne
- func (guo *GroupUpdateOne) SetUpdatedAt(t time.Time) *GroupUpdateOne
- func (guo *GroupUpdateOne) Where(ps ...predicate.Group) *GroupUpdateOne
- type GroupWhereInput
- type Groups
- type Hook
- type InterceptFunc
- type Interceptor
- type Message
- func (m *Message) From(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*MessageConnection, error)
- func (n *Message) IsNode()
- func (m *Message) NamedFrom(name string) ([]*Message, error)
- func (m *Message) NamedTo(name string) ([]*Message, error)
- func (m *Message) Node(ctx context.Context) (node *Node, err error)
- func (m *Message) QueryFrom() *MessageQuery
- func (m *Message) QueryTo() *MessageQuery
- func (m *Message) String() string
- func (m *Message) To(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*MessageConnection, error)
- func (m *Message) ToEdge(order *MessageOrder) *MessageEdge
- func (m *Message) Unwrap() *Message
- func (m *Message) Update() *MessageUpdateOne
- func (m *Message) Value(name string) (ent.Value, error)
- type MessageClient
- func (c *MessageClient) Create() *MessageCreate
- func (c *MessageClient) CreateBulk(builders ...*MessageCreate) *MessageCreateBulk
- func (c *MessageClient) Delete() *MessageDelete
- func (c *MessageClient) DeleteOne(m *Message) *MessageDeleteOne
- func (c *MessageClient) DeleteOneID(id uuid.UUID) *MessageDeleteOne
- func (c *MessageClient) Get(ctx context.Context, id uuid.UUID) (*Message, error)
- func (c *MessageClient) GetX(ctx context.Context, id uuid.UUID) *Message
- func (c *MessageClient) Hooks() []Hook
- func (c *MessageClient) Intercept(interceptors ...Interceptor)
- func (c *MessageClient) Interceptors() []Interceptor
- func (c *MessageClient) Query() *MessageQuery
- func (c *MessageClient) QueryFrom(m *Message) *MessageQuery
- func (c *MessageClient) QueryTo(m *Message) *MessageQuery
- func (c *MessageClient) Update() *MessageUpdate
- func (c *MessageClient) UpdateOne(m *Message) *MessageUpdateOne
- func (c *MessageClient) UpdateOneID(id uuid.UUID) *MessageUpdateOne
- func (c *MessageClient) Use(hooks ...Hook)
- type MessageConnection
- type MessageCreate
- func (mc *MessageCreate) AddFrom(m ...*Message) *MessageCreate
- func (mc *MessageCreate) AddFromIDs(ids ...uuid.UUID) *MessageCreate
- func (mc *MessageCreate) AddTo(m ...*Message) *MessageCreate
- func (mc *MessageCreate) AddToIDs(ids ...uuid.UUID) *MessageCreate
- func (mc *MessageCreate) Exec(ctx context.Context) error
- func (mc *MessageCreate) ExecX(ctx context.Context)
- func (mc *MessageCreate) Mutation() *MessageMutation
- func (mc *MessageCreate) Save(ctx context.Context) (*Message, error)
- func (mc *MessageCreate) SaveX(ctx context.Context) *Message
- func (mc *MessageCreate) SetBody(s string) *MessageCreate
- func (mc *MessageCreate) SetCreatedAt(t time.Time) *MessageCreate
- func (mc *MessageCreate) SetID(u uuid.UUID) *MessageCreate
- func (mc *MessageCreate) SetNillableCreatedAt(t *time.Time) *MessageCreate
- func (mc *MessageCreate) SetNillableID(u *uuid.UUID) *MessageCreate
- func (mc *MessageCreate) SetNillableUpdatedAt(t *time.Time) *MessageCreate
- func (mc *MessageCreate) SetUpdatedAt(t time.Time) *MessageCreate
- type MessageCreateBulk
- type MessageDelete
- type MessageDeleteOne
- type MessageEdge
- type MessageEdges
- type MessageGroupBy
- func (mgb *MessageGroupBy) Aggregate(fns ...AggregateFunc) *MessageGroupBy
- func (s *MessageGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *MessageGroupBy) BoolX(ctx context.Context) bool
- func (s *MessageGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *MessageGroupBy) BoolsX(ctx context.Context) []bool
- func (s *MessageGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *MessageGroupBy) Float64X(ctx context.Context) float64
- func (s *MessageGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *MessageGroupBy) Float64sX(ctx context.Context) []float64
- func (s *MessageGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *MessageGroupBy) IntX(ctx context.Context) int
- func (s *MessageGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *MessageGroupBy) IntsX(ctx context.Context) []int
- func (mgb *MessageGroupBy) Scan(ctx context.Context, v any) error
- func (s *MessageGroupBy) ScanX(ctx context.Context, v any)
- func (s *MessageGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *MessageGroupBy) StringX(ctx context.Context) string
- func (s *MessageGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *MessageGroupBy) StringsX(ctx context.Context) []string
- type MessageMutation
- func (m *MessageMutation) AddField(name string, value ent.Value) error
- func (m *MessageMutation) AddFromIDs(ids ...uuid.UUID)
- func (m *MessageMutation) AddToIDs(ids ...uuid.UUID)
- func (m *MessageMutation) AddedEdges() []string
- func (m *MessageMutation) AddedField(name string) (ent.Value, bool)
- func (m *MessageMutation) AddedFields() []string
- func (m *MessageMutation) AddedIDs(name string) []ent.Value
- func (m *MessageMutation) Body() (r string, exists bool)
- func (m *MessageMutation) ClearEdge(name string) error
- func (m *MessageMutation) ClearField(name string) error
- func (m *MessageMutation) ClearFrom()
- func (m *MessageMutation) ClearTo()
- func (m *MessageMutation) ClearedEdges() []string
- func (m *MessageMutation) ClearedFields() []string
- func (m MessageMutation) Client() *Client
- func (m *MessageMutation) CreatedAt() (r time.Time, exists bool)
- func (m *MessageMutation) EdgeCleared(name string) bool
- func (m *MessageMutation) Field(name string) (ent.Value, bool)
- func (m *MessageMutation) FieldCleared(name string) bool
- func (m *MessageMutation) Fields() []string
- func (m *MessageMutation) FromCleared() bool
- func (m *MessageMutation) FromIDs() (ids []uuid.UUID)
- func (m *MessageMutation) ID() (id uuid.UUID, exists bool)
- func (m *MessageMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *MessageMutation) OldBody(ctx context.Context) (v string, err error)
- func (m *MessageMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *MessageMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *MessageMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *MessageMutation) Op() Op
- func (m *MessageMutation) RemoveFromIDs(ids ...uuid.UUID)
- func (m *MessageMutation) RemoveToIDs(ids ...uuid.UUID)
- func (m *MessageMutation) RemovedEdges() []string
- func (m *MessageMutation) RemovedFromIDs() (ids []uuid.UUID)
- func (m *MessageMutation) RemovedIDs(name string) []ent.Value
- func (m *MessageMutation) RemovedToIDs() (ids []uuid.UUID)
- func (m *MessageMutation) ResetBody()
- func (m *MessageMutation) ResetCreatedAt()
- func (m *MessageMutation) ResetEdge(name string) error
- func (m *MessageMutation) ResetField(name string) error
- func (m *MessageMutation) ResetFrom()
- func (m *MessageMutation) ResetTo()
- func (m *MessageMutation) ResetUpdatedAt()
- func (m *MessageMutation) SetBody(s string)
- func (m *MessageMutation) SetCreatedAt(t time.Time)
- func (m *MessageMutation) SetField(name string, value ent.Value) error
- func (m *MessageMutation) SetID(id uuid.UUID)
- func (m *MessageMutation) SetOp(op Op)
- func (m *MessageMutation) SetUpdatedAt(t time.Time)
- func (m *MessageMutation) ToCleared() bool
- func (m *MessageMutation) ToIDs() (ids []uuid.UUID)
- func (m MessageMutation) Tx() (*Tx, error)
- func (m *MessageMutation) Type() string
- func (m *MessageMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *MessageMutation) Where(ps ...predicate.Message)
- func (m *MessageMutation) WhereP(ps ...func(*sql.Selector))
- type MessageOrder
- type MessageOrderField
- type MessagePaginateOption
- type MessageQuery
- func (mq *MessageQuery) Aggregate(fns ...AggregateFunc) *MessageSelect
- func (mq *MessageQuery) All(ctx context.Context) ([]*Message, error)
- func (mq *MessageQuery) AllX(ctx context.Context) []*Message
- func (mq *MessageQuery) Clone() *MessageQuery
- func (m *MessageQuery) CollectFields(ctx context.Context, satisfies ...string) (*MessageQuery, error)
- func (mq *MessageQuery) Count(ctx context.Context) (int, error)
- func (mq *MessageQuery) CountX(ctx context.Context) int
- func (mq *MessageQuery) Exist(ctx context.Context) (bool, error)
- func (mq *MessageQuery) ExistX(ctx context.Context) bool
- func (mq *MessageQuery) First(ctx context.Context) (*Message, error)
- func (mq *MessageQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (mq *MessageQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (mq *MessageQuery) FirstX(ctx context.Context) *Message
- func (mq *MessageQuery) GroupBy(field string, fields ...string) *MessageGroupBy
- func (mq *MessageQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (mq *MessageQuery) IDsX(ctx context.Context) []uuid.UUID
- func (mq *MessageQuery) Limit(limit int) *MessageQuery
- func (mq *MessageQuery) Offset(offset int) *MessageQuery
- func (mq *MessageQuery) Only(ctx context.Context) (*Message, error)
- func (mq *MessageQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (mq *MessageQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (mq *MessageQuery) OnlyX(ctx context.Context) *Message
- func (mq *MessageQuery) Order(o ...message.OrderOption) *MessageQuery
- func (m *MessageQuery) Paginate(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*MessageConnection, error)
- func (mq *MessageQuery) QueryFrom() *MessageQuery
- func (mq *MessageQuery) QueryTo() *MessageQuery
- func (mq *MessageQuery) Select(fields ...string) *MessageSelect
- func (mq *MessageQuery) Unique(unique bool) *MessageQuery
- func (mq *MessageQuery) Where(ps ...predicate.Message) *MessageQuery
- func (mq *MessageQuery) WithFrom(opts ...func(*MessageQuery)) *MessageQuery
- func (mq *MessageQuery) WithNamedFrom(name string, opts ...func(*MessageQuery)) *MessageQuery
- func (mq *MessageQuery) WithNamedTo(name string, opts ...func(*MessageQuery)) *MessageQuery
- func (mq *MessageQuery) WithTo(opts ...func(*MessageQuery)) *MessageQuery
- type MessageSelect
- func (ms *MessageSelect) Aggregate(fns ...AggregateFunc) *MessageSelect
- func (s *MessageSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *MessageSelect) BoolX(ctx context.Context) bool
- func (s *MessageSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *MessageSelect) BoolsX(ctx context.Context) []bool
- func (s *MessageSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *MessageSelect) Float64X(ctx context.Context) float64
- func (s *MessageSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *MessageSelect) Float64sX(ctx context.Context) []float64
- func (s *MessageSelect) Int(ctx context.Context) (_ int, err error)
- func (s *MessageSelect) IntX(ctx context.Context) int
- func (s *MessageSelect) Ints(ctx context.Context) ([]int, error)
- func (s *MessageSelect) IntsX(ctx context.Context) []int
- func (ms *MessageSelect) Scan(ctx context.Context, v any) error
- func (s *MessageSelect) ScanX(ctx context.Context, v any)
- func (s *MessageSelect) String(ctx context.Context) (_ string, err error)
- func (s *MessageSelect) StringX(ctx context.Context) string
- func (s *MessageSelect) Strings(ctx context.Context) ([]string, error)
- func (s *MessageSelect) StringsX(ctx context.Context) []string
- type MessageUpdate
- func (mu *MessageUpdate) AddFrom(m ...*Message) *MessageUpdate
- func (mu *MessageUpdate) AddFromIDs(ids ...uuid.UUID) *MessageUpdate
- func (mu *MessageUpdate) AddTo(m ...*Message) *MessageUpdate
- func (mu *MessageUpdate) AddToIDs(ids ...uuid.UUID) *MessageUpdate
- func (mu *MessageUpdate) ClearFrom() *MessageUpdate
- func (mu *MessageUpdate) ClearTo() *MessageUpdate
- func (mu *MessageUpdate) Exec(ctx context.Context) error
- func (mu *MessageUpdate) ExecX(ctx context.Context)
- func (mu *MessageUpdate) Mutation() *MessageMutation
- func (mu *MessageUpdate) RemoveFrom(m ...*Message) *MessageUpdate
- func (mu *MessageUpdate) RemoveFromIDs(ids ...uuid.UUID) *MessageUpdate
- func (mu *MessageUpdate) RemoveTo(m ...*Message) *MessageUpdate
- func (mu *MessageUpdate) RemoveToIDs(ids ...uuid.UUID) *MessageUpdate
- func (mu *MessageUpdate) Save(ctx context.Context) (int, error)
- func (mu *MessageUpdate) SaveX(ctx context.Context) int
- func (mu *MessageUpdate) SetBody(s string) *MessageUpdate
- func (mu *MessageUpdate) SetUpdatedAt(t time.Time) *MessageUpdate
- func (mu *MessageUpdate) Where(ps ...predicate.Message) *MessageUpdate
- type MessageUpdateOne
- func (muo *MessageUpdateOne) AddFrom(m ...*Message) *MessageUpdateOne
- func (muo *MessageUpdateOne) AddFromIDs(ids ...uuid.UUID) *MessageUpdateOne
- func (muo *MessageUpdateOne) AddTo(m ...*Message) *MessageUpdateOne
- func (muo *MessageUpdateOne) AddToIDs(ids ...uuid.UUID) *MessageUpdateOne
- func (muo *MessageUpdateOne) ClearFrom() *MessageUpdateOne
- func (muo *MessageUpdateOne) ClearTo() *MessageUpdateOne
- func (muo *MessageUpdateOne) Exec(ctx context.Context) error
- func (muo *MessageUpdateOne) ExecX(ctx context.Context)
- func (muo *MessageUpdateOne) Mutation() *MessageMutation
- func (muo *MessageUpdateOne) RemoveFrom(m ...*Message) *MessageUpdateOne
- func (muo *MessageUpdateOne) RemoveFromIDs(ids ...uuid.UUID) *MessageUpdateOne
- func (muo *MessageUpdateOne) RemoveTo(m ...*Message) *MessageUpdateOne
- func (muo *MessageUpdateOne) RemoveToIDs(ids ...uuid.UUID) *MessageUpdateOne
- func (muo *MessageUpdateOne) Save(ctx context.Context) (*Message, error)
- func (muo *MessageUpdateOne) SaveX(ctx context.Context) *Message
- func (muo *MessageUpdateOne) Select(field string, fields ...string) *MessageUpdateOne
- func (muo *MessageUpdateOne) SetBody(s string) *MessageUpdateOne
- func (muo *MessageUpdateOne) SetUpdatedAt(t time.Time) *MessageUpdateOne
- func (muo *MessageUpdateOne) Where(ps ...predicate.Message) *MessageUpdateOne
- type MessageWhereInput
- type Messages
- type MutateFunc
- type Mutation
- type Mutator
- type Node
- type NodeOption
- type Noder
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Notification
- func (n *Notification) IsNode()
- func (n *Notification) Node(ctx context.Context) (node *Node, err error)
- func (n *Notification) String() string
- func (n *Notification) ToEdge(order *NotificationOrder) *NotificationEdge
- func (n *Notification) Unwrap() *Notification
- func (n *Notification) Update() *NotificationUpdateOne
- func (n *Notification) Value(name string) (ent.Value, error)
- type NotificationClient
- func (c *NotificationClient) Create() *NotificationCreate
- func (c *NotificationClient) CreateBulk(builders ...*NotificationCreate) *NotificationCreateBulk
- func (c *NotificationClient) Delete() *NotificationDelete
- func (c *NotificationClient) DeleteOne(n *Notification) *NotificationDeleteOne
- func (c *NotificationClient) DeleteOneID(id uuid.UUID) *NotificationDeleteOne
- func (c *NotificationClient) Get(ctx context.Context, id uuid.UUID) (*Notification, error)
- func (c *NotificationClient) GetX(ctx context.Context, id uuid.UUID) *Notification
- func (c *NotificationClient) Hooks() []Hook
- func (c *NotificationClient) Intercept(interceptors ...Interceptor)
- func (c *NotificationClient) Interceptors() []Interceptor
- func (c *NotificationClient) Query() *NotificationQuery
- func (c *NotificationClient) Update() *NotificationUpdate
- func (c *NotificationClient) UpdateOne(n *Notification) *NotificationUpdateOne
- func (c *NotificationClient) UpdateOneID(id uuid.UUID) *NotificationUpdateOne
- func (c *NotificationClient) Use(hooks ...Hook)
- type NotificationConnection
- type NotificationCreate
- func (nc *NotificationCreate) Exec(ctx context.Context) error
- func (nc *NotificationCreate) ExecX(ctx context.Context)
- func (nc *NotificationCreate) Mutation() *NotificationMutation
- func (nc *NotificationCreate) Save(ctx context.Context) (*Notification, error)
- func (nc *NotificationCreate) SaveX(ctx context.Context) *Notification
- func (nc *NotificationCreate) SetCreatedAt(t time.Time) *NotificationCreate
- func (nc *NotificationCreate) SetID(u uuid.UUID) *NotificationCreate
- func (nc *NotificationCreate) SetNillableCreatedAt(t *time.Time) *NotificationCreate
- func (nc *NotificationCreate) SetNillableID(u *uuid.UUID) *NotificationCreate
- func (nc *NotificationCreate) SetNillableUpdatedAt(t *time.Time) *NotificationCreate
- func (nc *NotificationCreate) SetUpdatedAt(t time.Time) *NotificationCreate
- type NotificationCreateBulk
- type NotificationDelete
- type NotificationDeleteOne
- type NotificationEdge
- type NotificationGroupBy
- func (ngb *NotificationGroupBy) Aggregate(fns ...AggregateFunc) *NotificationGroupBy
- func (s *NotificationGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *NotificationGroupBy) BoolX(ctx context.Context) bool
- func (s *NotificationGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *NotificationGroupBy) BoolsX(ctx context.Context) []bool
- func (s *NotificationGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *NotificationGroupBy) Float64X(ctx context.Context) float64
- func (s *NotificationGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *NotificationGroupBy) Float64sX(ctx context.Context) []float64
- func (s *NotificationGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *NotificationGroupBy) IntX(ctx context.Context) int
- func (s *NotificationGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *NotificationGroupBy) IntsX(ctx context.Context) []int
- func (ngb *NotificationGroupBy) Scan(ctx context.Context, v any) error
- func (s *NotificationGroupBy) ScanX(ctx context.Context, v any)
- func (s *NotificationGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *NotificationGroupBy) StringX(ctx context.Context) string
- func (s *NotificationGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *NotificationGroupBy) StringsX(ctx context.Context) []string
- type NotificationMutation
- func (m *NotificationMutation) AddField(name string, value ent.Value) error
- func (m *NotificationMutation) AddedEdges() []string
- func (m *NotificationMutation) AddedField(name string) (ent.Value, bool)
- func (m *NotificationMutation) AddedFields() []string
- func (m *NotificationMutation) AddedIDs(name string) []ent.Value
- func (m *NotificationMutation) ClearEdge(name string) error
- func (m *NotificationMutation) ClearField(name string) error
- func (m *NotificationMutation) ClearedEdges() []string
- func (m *NotificationMutation) ClearedFields() []string
- func (m NotificationMutation) Client() *Client
- func (m *NotificationMutation) CreatedAt() (r time.Time, exists bool)
- func (m *NotificationMutation) EdgeCleared(name string) bool
- func (m *NotificationMutation) Field(name string) (ent.Value, bool)
- func (m *NotificationMutation) FieldCleared(name string) bool
- func (m *NotificationMutation) Fields() []string
- func (m *NotificationMutation) ID() (id uuid.UUID, exists bool)
- func (m *NotificationMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *NotificationMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *NotificationMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *NotificationMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *NotificationMutation) Op() Op
- func (m *NotificationMutation) RemovedEdges() []string
- func (m *NotificationMutation) RemovedIDs(name string) []ent.Value
- func (m *NotificationMutation) ResetCreatedAt()
- func (m *NotificationMutation) ResetEdge(name string) error
- func (m *NotificationMutation) ResetField(name string) error
- func (m *NotificationMutation) ResetUpdatedAt()
- func (m *NotificationMutation) SetCreatedAt(t time.Time)
- func (m *NotificationMutation) SetField(name string, value ent.Value) error
- func (m *NotificationMutation) SetID(id uuid.UUID)
- func (m *NotificationMutation) SetOp(op Op)
- func (m *NotificationMutation) SetUpdatedAt(t time.Time)
- func (m NotificationMutation) Tx() (*Tx, error)
- func (m *NotificationMutation) Type() string
- func (m *NotificationMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *NotificationMutation) Where(ps ...predicate.Notification)
- func (m *NotificationMutation) WhereP(ps ...func(*sql.Selector))
- type NotificationOrder
- type NotificationOrderField
- type NotificationPaginateOption
- type NotificationQuery
- func (nq *NotificationQuery) Aggregate(fns ...AggregateFunc) *NotificationSelect
- func (nq *NotificationQuery) All(ctx context.Context) ([]*Notification, error)
- func (nq *NotificationQuery) AllX(ctx context.Context) []*Notification
- func (nq *NotificationQuery) Clone() *NotificationQuery
- func (n *NotificationQuery) CollectFields(ctx context.Context, satisfies ...string) (*NotificationQuery, error)
- func (nq *NotificationQuery) Count(ctx context.Context) (int, error)
- func (nq *NotificationQuery) CountX(ctx context.Context) int
- func (nq *NotificationQuery) Exist(ctx context.Context) (bool, error)
- func (nq *NotificationQuery) ExistX(ctx context.Context) bool
- func (nq *NotificationQuery) First(ctx context.Context) (*Notification, error)
- func (nq *NotificationQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (nq *NotificationQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (nq *NotificationQuery) FirstX(ctx context.Context) *Notification
- func (nq *NotificationQuery) GroupBy(field string, fields ...string) *NotificationGroupBy
- func (nq *NotificationQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (nq *NotificationQuery) IDsX(ctx context.Context) []uuid.UUID
- func (nq *NotificationQuery) Limit(limit int) *NotificationQuery
- func (nq *NotificationQuery) Offset(offset int) *NotificationQuery
- func (nq *NotificationQuery) Only(ctx context.Context) (*Notification, error)
- func (nq *NotificationQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (nq *NotificationQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (nq *NotificationQuery) OnlyX(ctx context.Context) *Notification
- func (nq *NotificationQuery) Order(o ...notification.OrderOption) *NotificationQuery
- func (n *NotificationQuery) Paginate(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*NotificationConnection, error)
- func (nq *NotificationQuery) Select(fields ...string) *NotificationSelect
- func (nq *NotificationQuery) Unique(unique bool) *NotificationQuery
- func (nq *NotificationQuery) Where(ps ...predicate.Notification) *NotificationQuery
- type NotificationSelect
- func (ns *NotificationSelect) Aggregate(fns ...AggregateFunc) *NotificationSelect
- func (s *NotificationSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *NotificationSelect) BoolX(ctx context.Context) bool
- func (s *NotificationSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *NotificationSelect) BoolsX(ctx context.Context) []bool
- func (s *NotificationSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *NotificationSelect) Float64X(ctx context.Context) float64
- func (s *NotificationSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *NotificationSelect) Float64sX(ctx context.Context) []float64
- func (s *NotificationSelect) Int(ctx context.Context) (_ int, err error)
- func (s *NotificationSelect) IntX(ctx context.Context) int
- func (s *NotificationSelect) Ints(ctx context.Context) ([]int, error)
- func (s *NotificationSelect) IntsX(ctx context.Context) []int
- func (ns *NotificationSelect) Scan(ctx context.Context, v any) error
- func (s *NotificationSelect) ScanX(ctx context.Context, v any)
- func (s *NotificationSelect) String(ctx context.Context) (_ string, err error)
- func (s *NotificationSelect) StringX(ctx context.Context) string
- func (s *NotificationSelect) Strings(ctx context.Context) ([]string, error)
- func (s *NotificationSelect) StringsX(ctx context.Context) []string
- type NotificationUpdate
- func (nu *NotificationUpdate) Exec(ctx context.Context) error
- func (nu *NotificationUpdate) ExecX(ctx context.Context)
- func (nu *NotificationUpdate) Mutation() *NotificationMutation
- func (nu *NotificationUpdate) Save(ctx context.Context) (int, error)
- func (nu *NotificationUpdate) SaveX(ctx context.Context) int
- func (nu *NotificationUpdate) SetUpdatedAt(t time.Time) *NotificationUpdate
- func (nu *NotificationUpdate) Where(ps ...predicate.Notification) *NotificationUpdate
- type NotificationUpdateOne
- func (nuo *NotificationUpdateOne) Exec(ctx context.Context) error
- func (nuo *NotificationUpdateOne) ExecX(ctx context.Context)
- func (nuo *NotificationUpdateOne) Mutation() *NotificationMutation
- func (nuo *NotificationUpdateOne) Save(ctx context.Context) (*Notification, error)
- func (nuo *NotificationUpdateOne) SaveX(ctx context.Context) *Notification
- func (nuo *NotificationUpdateOne) Select(field string, fields ...string) *NotificationUpdateOne
- func (nuo *NotificationUpdateOne) SetUpdatedAt(t time.Time) *NotificationUpdateOne
- func (nuo *NotificationUpdateOne) Where(ps ...predicate.Notification) *NotificationUpdateOne
- type NotificationWhereInput
- type Notifications
- type Op
- type Option
- type OrderDirection
- type OrderFunc
- type PageInfo
- type Policy
- type Post
- func (n *Post) IsNode()
- func (po *Post) Node(ctx context.Context) (node *Node, err error)
- func (po *Post) QueryUser() *UserQuery
- func (po *Post) String() string
- func (po *Post) ToEdge(order *PostOrder) *PostEdge
- func (po *Post) Unwrap() *Post
- func (po *Post) Update() *PostUpdateOne
- func (po *Post) User(ctx context.Context) (*User, error)
- func (po *Post) Value(name string) (ent.Value, error)
- type PostClient
- func (c *PostClient) Create() *PostCreate
- func (c *PostClient) CreateBulk(builders ...*PostCreate) *PostCreateBulk
- func (c *PostClient) Delete() *PostDelete
- func (c *PostClient) DeleteOne(po *Post) *PostDeleteOne
- func (c *PostClient) DeleteOneID(id uuid.UUID) *PostDeleteOne
- func (c *PostClient) Get(ctx context.Context, id uuid.UUID) (*Post, error)
- func (c *PostClient) GetX(ctx context.Context, id uuid.UUID) *Post
- func (c *PostClient) Hooks() []Hook
- func (c *PostClient) Intercept(interceptors ...Interceptor)
- func (c *PostClient) Interceptors() []Interceptor
- func (c *PostClient) Query() *PostQuery
- func (c *PostClient) QueryUser(po *Post) *UserQuery
- func (c *PostClient) Update() *PostUpdate
- func (c *PostClient) UpdateOne(po *Post) *PostUpdateOne
- func (c *PostClient) UpdateOneID(id uuid.UUID) *PostUpdateOne
- func (c *PostClient) Use(hooks ...Hook)
- type PostConnection
- type PostCreate
- func (pc *PostCreate) Exec(ctx context.Context) error
- func (pc *PostCreate) ExecX(ctx context.Context)
- func (pc *PostCreate) Mutation() *PostMutation
- func (pc *PostCreate) Save(ctx context.Context) (*Post, error)
- func (pc *PostCreate) SaveX(ctx context.Context) *Post
- func (pc *PostCreate) SetCreatedAt(t time.Time) *PostCreate
- func (pc *PostCreate) SetID(u uuid.UUID) *PostCreate
- func (pc *PostCreate) SetNillableCreatedAt(t *time.Time) *PostCreate
- func (pc *PostCreate) SetNillableID(u *uuid.UUID) *PostCreate
- func (pc *PostCreate) SetNillableUpdatedAt(t *time.Time) *PostCreate
- func (pc *PostCreate) SetNillableUserID(id *uuid.UUID) *PostCreate
- func (pc *PostCreate) SetUpdatedAt(t time.Time) *PostCreate
- func (pc *PostCreate) SetUser(u *User) *PostCreate
- func (pc *PostCreate) SetUserID(id uuid.UUID) *PostCreate
- type PostCreateBulk
- type PostDelete
- type PostDeleteOne
- type PostEdge
- type PostEdges
- type PostGroupBy
- func (pgb *PostGroupBy) Aggregate(fns ...AggregateFunc) *PostGroupBy
- func (s *PostGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *PostGroupBy) BoolX(ctx context.Context) bool
- func (s *PostGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *PostGroupBy) BoolsX(ctx context.Context) []bool
- func (s *PostGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *PostGroupBy) Float64X(ctx context.Context) float64
- func (s *PostGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *PostGroupBy) Float64sX(ctx context.Context) []float64
- func (s *PostGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *PostGroupBy) IntX(ctx context.Context) int
- func (s *PostGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *PostGroupBy) IntsX(ctx context.Context) []int
- func (pgb *PostGroupBy) Scan(ctx context.Context, v any) error
- func (s *PostGroupBy) ScanX(ctx context.Context, v any)
- func (s *PostGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *PostGroupBy) StringX(ctx context.Context) string
- func (s *PostGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *PostGroupBy) StringsX(ctx context.Context) []string
- type PostMutation
- func (m *PostMutation) AddField(name string, value ent.Value) error
- func (m *PostMutation) AddedEdges() []string
- func (m *PostMutation) AddedField(name string) (ent.Value, bool)
- func (m *PostMutation) AddedFields() []string
- func (m *PostMutation) AddedIDs(name string) []ent.Value
- func (m *PostMutation) ClearEdge(name string) error
- func (m *PostMutation) ClearField(name string) error
- func (m *PostMutation) ClearUser()
- func (m *PostMutation) ClearedEdges() []string
- func (m *PostMutation) ClearedFields() []string
- func (m PostMutation) Client() *Client
- func (m *PostMutation) CreatedAt() (r time.Time, exists bool)
- func (m *PostMutation) EdgeCleared(name string) bool
- func (m *PostMutation) Field(name string) (ent.Value, bool)
- func (m *PostMutation) FieldCleared(name string) bool
- func (m *PostMutation) Fields() []string
- func (m *PostMutation) ID() (id uuid.UUID, exists bool)
- func (m *PostMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *PostMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *PostMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *PostMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *PostMutation) Op() Op
- func (m *PostMutation) RemovedEdges() []string
- func (m *PostMutation) RemovedIDs(name string) []ent.Value
- func (m *PostMutation) ResetCreatedAt()
- func (m *PostMutation) ResetEdge(name string) error
- func (m *PostMutation) ResetField(name string) error
- func (m *PostMutation) ResetUpdatedAt()
- func (m *PostMutation) ResetUser()
- func (m *PostMutation) SetCreatedAt(t time.Time)
- func (m *PostMutation) SetField(name string, value ent.Value) error
- func (m *PostMutation) SetID(id uuid.UUID)
- func (m *PostMutation) SetOp(op Op)
- func (m *PostMutation) SetUpdatedAt(t time.Time)
- func (m *PostMutation) SetUserID(id uuid.UUID)
- func (m PostMutation) Tx() (*Tx, error)
- func (m *PostMutation) Type() string
- func (m *PostMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *PostMutation) UserCleared() bool
- func (m *PostMutation) UserID() (id uuid.UUID, exists bool)
- func (m *PostMutation) UserIDs() (ids []uuid.UUID)
- func (m *PostMutation) Where(ps ...predicate.Post)
- func (m *PostMutation) WhereP(ps ...func(*sql.Selector))
- type PostOrder
- type PostOrderField
- type PostPaginateOption
- type PostQuery
- func (pq *PostQuery) Aggregate(fns ...AggregateFunc) *PostSelect
- func (pq *PostQuery) All(ctx context.Context) ([]*Post, error)
- func (pq *PostQuery) AllX(ctx context.Context) []*Post
- func (pq *PostQuery) Clone() *PostQuery
- func (po *PostQuery) CollectFields(ctx context.Context, satisfies ...string) (*PostQuery, error)
- func (pq *PostQuery) Count(ctx context.Context) (int, error)
- func (pq *PostQuery) CountX(ctx context.Context) int
- func (pq *PostQuery) Exist(ctx context.Context) (bool, error)
- func (pq *PostQuery) ExistX(ctx context.Context) bool
- func (pq *PostQuery) First(ctx context.Context) (*Post, error)
- func (pq *PostQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (pq *PostQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (pq *PostQuery) FirstX(ctx context.Context) *Post
- func (pq *PostQuery) GroupBy(field string, fields ...string) *PostGroupBy
- func (pq *PostQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (pq *PostQuery) IDsX(ctx context.Context) []uuid.UUID
- func (pq *PostQuery) Limit(limit int) *PostQuery
- func (pq *PostQuery) Offset(offset int) *PostQuery
- func (pq *PostQuery) Only(ctx context.Context) (*Post, error)
- func (pq *PostQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (pq *PostQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (pq *PostQuery) OnlyX(ctx context.Context) *Post
- func (pq *PostQuery) Order(o ...post.OrderOption) *PostQuery
- func (po *PostQuery) Paginate(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*PostConnection, error)
- func (pq *PostQuery) QueryUser() *UserQuery
- func (pq *PostQuery) Select(fields ...string) *PostSelect
- func (pq *PostQuery) Unique(unique bool) *PostQuery
- func (pq *PostQuery) Where(ps ...predicate.Post) *PostQuery
- func (pq *PostQuery) WithUser(opts ...func(*UserQuery)) *PostQuery
- type PostSelect
- func (ps *PostSelect) Aggregate(fns ...AggregateFunc) *PostSelect
- func (s *PostSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *PostSelect) BoolX(ctx context.Context) bool
- func (s *PostSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *PostSelect) BoolsX(ctx context.Context) []bool
- func (s *PostSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *PostSelect) Float64X(ctx context.Context) float64
- func (s *PostSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *PostSelect) Float64sX(ctx context.Context) []float64
- func (s *PostSelect) Int(ctx context.Context) (_ int, err error)
- func (s *PostSelect) IntX(ctx context.Context) int
- func (s *PostSelect) Ints(ctx context.Context) ([]int, error)
- func (s *PostSelect) IntsX(ctx context.Context) []int
- func (ps *PostSelect) Scan(ctx context.Context, v any) error
- func (s *PostSelect) ScanX(ctx context.Context, v any)
- func (s *PostSelect) String(ctx context.Context) (_ string, err error)
- func (s *PostSelect) StringX(ctx context.Context) string
- func (s *PostSelect) Strings(ctx context.Context) ([]string, error)
- func (s *PostSelect) StringsX(ctx context.Context) []string
- type PostUpdate
- func (pu *PostUpdate) ClearUser() *PostUpdate
- func (pu *PostUpdate) Exec(ctx context.Context) error
- func (pu *PostUpdate) ExecX(ctx context.Context)
- func (pu *PostUpdate) Mutation() *PostMutation
- func (pu *PostUpdate) Save(ctx context.Context) (int, error)
- func (pu *PostUpdate) SaveX(ctx context.Context) int
- func (pu *PostUpdate) SetNillableUserID(id *uuid.UUID) *PostUpdate
- func (pu *PostUpdate) SetUpdatedAt(t time.Time) *PostUpdate
- func (pu *PostUpdate) SetUser(u *User) *PostUpdate
- func (pu *PostUpdate) SetUserID(id uuid.UUID) *PostUpdate
- func (pu *PostUpdate) Where(ps ...predicate.Post) *PostUpdate
- type PostUpdateOne
- func (puo *PostUpdateOne) ClearUser() *PostUpdateOne
- func (puo *PostUpdateOne) Exec(ctx context.Context) error
- func (puo *PostUpdateOne) ExecX(ctx context.Context)
- func (puo *PostUpdateOne) Mutation() *PostMutation
- func (puo *PostUpdateOne) Save(ctx context.Context) (*Post, error)
- func (puo *PostUpdateOne) SaveX(ctx context.Context) *Post
- func (puo *PostUpdateOne) Select(field string, fields ...string) *PostUpdateOne
- func (puo *PostUpdateOne) SetNillableUserID(id *uuid.UUID) *PostUpdateOne
- func (puo *PostUpdateOne) SetUpdatedAt(t time.Time) *PostUpdateOne
- func (puo *PostUpdateOne) SetUser(u *User) *PostUpdateOne
- func (puo *PostUpdateOne) SetUserID(id uuid.UUID) *PostUpdateOne
- func (puo *PostUpdateOne) Where(ps ...predicate.Post) *PostUpdateOne
- type PostWhereInput
- type Posts
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type QueryResolver
- type ResolverRoot
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Setting
- func (n *Setting) IsNode()
- func (s *Setting) Node(ctx context.Context) (node *Node, err error)
- func (s *Setting) String() string
- func (s *Setting) ToEdge(order *SettingOrder) *SettingEdge
- func (s *Setting) Unwrap() *Setting
- func (s *Setting) Update() *SettingUpdateOne
- func (s *Setting) Value(name string) (ent.Value, error)
- type SettingClient
- func (c *SettingClient) Create() *SettingCreate
- func (c *SettingClient) CreateBulk(builders ...*SettingCreate) *SettingCreateBulk
- func (c *SettingClient) Delete() *SettingDelete
- func (c *SettingClient) DeleteOne(s *Setting) *SettingDeleteOne
- func (c *SettingClient) DeleteOneID(id uuid.UUID) *SettingDeleteOne
- func (c *SettingClient) Get(ctx context.Context, id uuid.UUID) (*Setting, error)
- func (c *SettingClient) GetX(ctx context.Context, id uuid.UUID) *Setting
- func (c *SettingClient) Hooks() []Hook
- func (c *SettingClient) Intercept(interceptors ...Interceptor)
- func (c *SettingClient) Interceptors() []Interceptor
- func (c *SettingClient) Query() *SettingQuery
- func (c *SettingClient) Update() *SettingUpdate
- func (c *SettingClient) UpdateOne(s *Setting) *SettingUpdateOne
- func (c *SettingClient) UpdateOneID(id uuid.UUID) *SettingUpdateOne
- func (c *SettingClient) Use(hooks ...Hook)
- type SettingConnection
- type SettingCreate
- func (sc *SettingCreate) Exec(ctx context.Context) error
- func (sc *SettingCreate) ExecX(ctx context.Context)
- func (sc *SettingCreate) Mutation() *SettingMutation
- func (sc *SettingCreate) Save(ctx context.Context) (*Setting, error)
- func (sc *SettingCreate) SaveX(ctx context.Context) *Setting
- func (sc *SettingCreate) SetCreatedAt(t time.Time) *SettingCreate
- func (sc *SettingCreate) SetID(u uuid.UUID) *SettingCreate
- func (sc *SettingCreate) SetNillableCreatedAt(t *time.Time) *SettingCreate
- func (sc *SettingCreate) SetNillableID(u *uuid.UUID) *SettingCreate
- func (sc *SettingCreate) SetNillableUpdatedAt(t *time.Time) *SettingCreate
- func (sc *SettingCreate) SetUpdatedAt(t time.Time) *SettingCreate
- type SettingCreateBulk
- type SettingDelete
- type SettingDeleteOne
- type SettingEdge
- type SettingGroupBy
- func (sgb *SettingGroupBy) Aggregate(fns ...AggregateFunc) *SettingGroupBy
- func (s *SettingGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *SettingGroupBy) BoolX(ctx context.Context) bool
- func (s *SettingGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *SettingGroupBy) BoolsX(ctx context.Context) []bool
- func (s *SettingGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *SettingGroupBy) Float64X(ctx context.Context) float64
- func (s *SettingGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *SettingGroupBy) Float64sX(ctx context.Context) []float64
- func (s *SettingGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *SettingGroupBy) IntX(ctx context.Context) int
- func (s *SettingGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *SettingGroupBy) IntsX(ctx context.Context) []int
- func (sgb *SettingGroupBy) Scan(ctx context.Context, v any) error
- func (s *SettingGroupBy) ScanX(ctx context.Context, v any)
- func (s *SettingGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *SettingGroupBy) StringX(ctx context.Context) string
- func (s *SettingGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *SettingGroupBy) StringsX(ctx context.Context) []string
- type SettingMutation
- func (m *SettingMutation) AddField(name string, value ent.Value) error
- func (m *SettingMutation) AddedEdges() []string
- func (m *SettingMutation) AddedField(name string) (ent.Value, bool)
- func (m *SettingMutation) AddedFields() []string
- func (m *SettingMutation) AddedIDs(name string) []ent.Value
- func (m *SettingMutation) ClearEdge(name string) error
- func (m *SettingMutation) ClearField(name string) error
- func (m *SettingMutation) ClearedEdges() []string
- func (m *SettingMutation) ClearedFields() []string
- func (m SettingMutation) Client() *Client
- func (m *SettingMutation) CreatedAt() (r time.Time, exists bool)
- func (m *SettingMutation) EdgeCleared(name string) bool
- func (m *SettingMutation) Field(name string) (ent.Value, bool)
- func (m *SettingMutation) FieldCleared(name string) bool
- func (m *SettingMutation) Fields() []string
- func (m *SettingMutation) ID() (id uuid.UUID, exists bool)
- func (m *SettingMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *SettingMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *SettingMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *SettingMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *SettingMutation) Op() Op
- func (m *SettingMutation) RemovedEdges() []string
- func (m *SettingMutation) RemovedIDs(name string) []ent.Value
- func (m *SettingMutation) ResetCreatedAt()
- func (m *SettingMutation) ResetEdge(name string) error
- func (m *SettingMutation) ResetField(name string) error
- func (m *SettingMutation) ResetUpdatedAt()
- func (m *SettingMutation) SetCreatedAt(t time.Time)
- func (m *SettingMutation) SetField(name string, value ent.Value) error
- func (m *SettingMutation) SetID(id uuid.UUID)
- func (m *SettingMutation) SetOp(op Op)
- func (m *SettingMutation) SetUpdatedAt(t time.Time)
- func (m SettingMutation) Tx() (*Tx, error)
- func (m *SettingMutation) Type() string
- func (m *SettingMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *SettingMutation) Where(ps ...predicate.Setting)
- func (m *SettingMutation) WhereP(ps ...func(*sql.Selector))
- type SettingOrder
- type SettingOrderField
- type SettingPaginateOption
- type SettingQuery
- func (sq *SettingQuery) Aggregate(fns ...AggregateFunc) *SettingSelect
- func (sq *SettingQuery) All(ctx context.Context) ([]*Setting, error)
- func (sq *SettingQuery) AllX(ctx context.Context) []*Setting
- func (sq *SettingQuery) Clone() *SettingQuery
- func (s *SettingQuery) CollectFields(ctx context.Context, satisfies ...string) (*SettingQuery, error)
- func (sq *SettingQuery) Count(ctx context.Context) (int, error)
- func (sq *SettingQuery) CountX(ctx context.Context) int
- func (sq *SettingQuery) Exist(ctx context.Context) (bool, error)
- func (sq *SettingQuery) ExistX(ctx context.Context) bool
- func (sq *SettingQuery) First(ctx context.Context) (*Setting, error)
- func (sq *SettingQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (sq *SettingQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (sq *SettingQuery) FirstX(ctx context.Context) *Setting
- func (sq *SettingQuery) GroupBy(field string, fields ...string) *SettingGroupBy
- func (sq *SettingQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (sq *SettingQuery) IDsX(ctx context.Context) []uuid.UUID
- func (sq *SettingQuery) Limit(limit int) *SettingQuery
- func (sq *SettingQuery) Offset(offset int) *SettingQuery
- func (sq *SettingQuery) Only(ctx context.Context) (*Setting, error)
- func (sq *SettingQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (sq *SettingQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (sq *SettingQuery) OnlyX(ctx context.Context) *Setting
- func (sq *SettingQuery) Order(o ...setting.OrderOption) *SettingQuery
- func (s *SettingQuery) Paginate(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*SettingConnection, error)
- func (sq *SettingQuery) Select(fields ...string) *SettingSelect
- func (sq *SettingQuery) Unique(unique bool) *SettingQuery
- func (sq *SettingQuery) Where(ps ...predicate.Setting) *SettingQuery
- type SettingSelect
- func (ss *SettingSelect) Aggregate(fns ...AggregateFunc) *SettingSelect
- func (s *SettingSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *SettingSelect) BoolX(ctx context.Context) bool
- func (s *SettingSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *SettingSelect) BoolsX(ctx context.Context) []bool
- func (s *SettingSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *SettingSelect) Float64X(ctx context.Context) float64
- func (s *SettingSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *SettingSelect) Float64sX(ctx context.Context) []float64
- func (s *SettingSelect) Int(ctx context.Context) (_ int, err error)
- func (s *SettingSelect) IntX(ctx context.Context) int
- func (s *SettingSelect) Ints(ctx context.Context) ([]int, error)
- func (s *SettingSelect) IntsX(ctx context.Context) []int
- func (ss *SettingSelect) Scan(ctx context.Context, v any) error
- func (s *SettingSelect) ScanX(ctx context.Context, v any)
- func (s *SettingSelect) String(ctx context.Context) (_ string, err error)
- func (s *SettingSelect) StringX(ctx context.Context) string
- func (s *SettingSelect) Strings(ctx context.Context) ([]string, error)
- func (s *SettingSelect) StringsX(ctx context.Context) []string
- type SettingUpdate
- func (su *SettingUpdate) Exec(ctx context.Context) error
- func (su *SettingUpdate) ExecX(ctx context.Context)
- func (su *SettingUpdate) Mutation() *SettingMutation
- func (su *SettingUpdate) Save(ctx context.Context) (int, error)
- func (su *SettingUpdate) SaveX(ctx context.Context) int
- func (su *SettingUpdate) SetUpdatedAt(t time.Time) *SettingUpdate
- func (su *SettingUpdate) Where(ps ...predicate.Setting) *SettingUpdate
- type SettingUpdateOne
- func (suo *SettingUpdateOne) Exec(ctx context.Context) error
- func (suo *SettingUpdateOne) ExecX(ctx context.Context)
- func (suo *SettingUpdateOne) Mutation() *SettingMutation
- func (suo *SettingUpdateOne) Save(ctx context.Context) (*Setting, error)
- func (suo *SettingUpdateOne) SaveX(ctx context.Context) *Setting
- func (suo *SettingUpdateOne) Select(field string, fields ...string) *SettingUpdateOne
- func (suo *SettingUpdateOne) SetUpdatedAt(t time.Time) *SettingUpdateOne
- func (suo *SettingUpdateOne) Where(ps ...predicate.Setting) *SettingUpdateOne
- type SettingWhereInput
- type Settings
- type TraverseFunc
- type Traverser
- type Tx
- type User
- func (u *User) Followers(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*UserConnection, error)
- func (u *User) Following(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*UserConnection, error)
- func (u *User) Groups(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*GroupConnection, error)
- func (n *User) IsNode()
- func (u *User) NamedFollowers(name string) ([]*User, error)
- func (u *User) NamedFollowing(name string) ([]*User, error)
- func (u *User) NamedGroups(name string) ([]*Group, error)
- func (u *User) NamedPosts(name string) ([]*Post, error)
- func (u *User) Node(ctx context.Context) (node *Node, err error)
- func (u *User) Posts(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*PostConnection, error)
- func (u *User) QueryFollowers() *UserQuery
- func (u *User) QueryFollowing() *UserQuery
- func (u *User) QueryGroups() *GroupQuery
- func (u *User) QueryPosts() *PostQuery
- func (u *User) String() string
- func (u *User) ToEdge(order *UserOrder) *UserEdge
- 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 uuid.UUID) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Intercept(interceptors ...Interceptor)
- func (c *UserClient) Interceptors() []Interceptor
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) QueryFollowers(u *User) *UserQuery
- func (c *UserClient) QueryFollowing(u *User) *UserQuery
- func (c *UserClient) QueryGroups(u *User) *GroupQuery
- func (c *UserClient) QueryPosts(u *User) *PostQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id uuid.UUID) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserConnection
- type UserCreate
- func (uc *UserCreate) AddFollowerIDs(ids ...uuid.UUID) *UserCreate
- func (uc *UserCreate) AddFollowers(u ...*User) *UserCreate
- func (uc *UserCreate) AddFollowing(u ...*User) *UserCreate
- func (uc *UserCreate) AddFollowingIDs(ids ...uuid.UUID) *UserCreate
- func (uc *UserCreate) AddGroupIDs(ids ...uuid.UUID) *UserCreate
- func (uc *UserCreate) AddGroups(g ...*Group) *UserCreate
- func (uc *UserCreate) AddPostIDs(ids ...uuid.UUID) *UserCreate
- func (uc *UserCreate) AddPosts(p ...*Post) *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) SetAccountAddress(s string) *UserCreate
- func (uc *UserCreate) SetAlias(s string) *UserCreate
- func (uc *UserCreate) SetBio(s string) *UserCreate
- func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate
- func (uc *UserCreate) SetEmailAddress(s string) *UserCreate
- func (uc *UserCreate) SetFirstName(s string) *UserCreate
- func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate
- func (uc *UserCreate) SetLastName(s string) *UserCreate
- func (uc *UserCreate) SetNillableBio(s *string) *UserCreate
- func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate
- func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserEdge
- 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) AccountAddress() (r string, exists bool)
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddFollowerIDs(ids ...uuid.UUID)
- func (m *UserMutation) AddFollowingIDs(ids ...uuid.UUID)
- func (m *UserMutation) AddGroupIDs(ids ...uuid.UUID)
- func (m *UserMutation) AddPostIDs(ids ...uuid.UUID)
- 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) Alias() (r string, 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) ClearField(name string) error
- func (m *UserMutation) ClearFollowers()
- func (m *UserMutation) ClearFollowing()
- func (m *UserMutation) ClearGroups()
- func (m *UserMutation) ClearPosts()
- 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) EdgeCleared(name string) bool
- func (m *UserMutation) EmailAddress() (r string, 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) FirstName() (r string, exists bool)
- func (m *UserMutation) FollowersCleared() bool
- func (m *UserMutation) FollowersIDs() (ids []uuid.UUID)
- func (m *UserMutation) FollowingCleared() bool
- func (m *UserMutation) FollowingIDs() (ids []uuid.UUID)
- func (m *UserMutation) GroupsCleared() bool
- func (m *UserMutation) GroupsIDs() (ids []uuid.UUID)
- func (m *UserMutation) ID() (id uuid.UUID, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *UserMutation) LastName() (r string, exists bool)
- func (m *UserMutation) OldAccountAddress(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldAlias(ctx context.Context) (v string, 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) OldEmailAddress(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldFirstName(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldLastName(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) PostsCleared() bool
- func (m *UserMutation) PostsIDs() (ids []uuid.UUID)
- func (m *UserMutation) RemoveFollowerIDs(ids ...uuid.UUID)
- func (m *UserMutation) RemoveFollowingIDs(ids ...uuid.UUID)
- func (m *UserMutation) RemoveGroupIDs(ids ...uuid.UUID)
- func (m *UserMutation) RemovePostIDs(ids ...uuid.UUID)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedFollowersIDs() (ids []uuid.UUID)
- func (m *UserMutation) RemovedFollowingIDs() (ids []uuid.UUID)
- func (m *UserMutation) RemovedGroupsIDs() (ids []uuid.UUID)
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedPostsIDs() (ids []uuid.UUID)
- func (m *UserMutation) ResetAccountAddress()
- func (m *UserMutation) ResetAlias()
- func (m *UserMutation) ResetBio()
- func (m *UserMutation) ResetCreatedAt()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetEmailAddress()
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetFirstName()
- func (m *UserMutation) ResetFollowers()
- func (m *UserMutation) ResetFollowing()
- func (m *UserMutation) ResetGroups()
- func (m *UserMutation) ResetLastName()
- func (m *UserMutation) ResetPosts()
- func (m *UserMutation) ResetUpdatedAt()
- func (m *UserMutation) SetAccountAddress(s string)
- func (m *UserMutation) SetAlias(s string)
- func (m *UserMutation) SetBio(s string)
- func (m *UserMutation) SetCreatedAt(t time.Time)
- func (m *UserMutation) SetEmailAddress(s string)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetFirstName(s string)
- func (m *UserMutation) SetID(id uuid.UUID)
- func (m *UserMutation) SetLastName(s string)
- func (m *UserMutation) SetOp(op Op)
- func (m *UserMutation) SetUpdatedAt(t time.Time)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *UserMutation) Where(ps ...predicate.User)
- func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
- type UserOrder
- type UserOrderField
- type UserPaginateOption
- 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 (u *UserQuery) CollectFields(ctx context.Context, satisfies ...string) (*UserQuery, error)
- 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 uuid.UUID, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) uuid.UUID
- 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 []uuid.UUID, err error)
- func (uq *UserQuery) IDsX(ctx context.Context) []uuid.UUID
- 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 uuid.UUID, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
- func (u *UserQuery) Paginate(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*UserConnection, error)
- func (uq *UserQuery) QueryFollowers() *UserQuery
- func (uq *UserQuery) QueryFollowing() *UserQuery
- func (uq *UserQuery) QueryGroups() *GroupQuery
- func (uq *UserQuery) QueryPosts() *PostQuery
- 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) WithFollowers(opts ...func(*UserQuery)) *UserQuery
- func (uq *UserQuery) WithFollowing(opts ...func(*UserQuery)) *UserQuery
- func (uq *UserQuery) WithGroups(opts ...func(*GroupQuery)) *UserQuery
- func (uq *UserQuery) WithNamedFollowers(name string, opts ...func(*UserQuery)) *UserQuery
- func (uq *UserQuery) WithNamedFollowing(name string, opts ...func(*UserQuery)) *UserQuery
- func (uq *UserQuery) WithNamedGroups(name string, opts ...func(*GroupQuery)) *UserQuery
- func (uq *UserQuery) WithNamedPosts(name string, opts ...func(*PostQuery)) *UserQuery
- func (uq *UserQuery) WithPosts(opts ...func(*PostQuery)) *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) AddFollowerIDs(ids ...uuid.UUID) *UserUpdate
- func (uu *UserUpdate) AddFollowers(u ...*User) *UserUpdate
- func (uu *UserUpdate) AddFollowing(u ...*User) *UserUpdate
- func (uu *UserUpdate) AddFollowingIDs(ids ...uuid.UUID) *UserUpdate
- func (uu *UserUpdate) AddGroupIDs(ids ...uuid.UUID) *UserUpdate
- func (uu *UserUpdate) AddGroups(g ...*Group) *UserUpdate
- func (uu *UserUpdate) AddPostIDs(ids ...uuid.UUID) *UserUpdate
- func (uu *UserUpdate) AddPosts(p ...*Post) *UserUpdate
- func (uu *UserUpdate) ClearBio() *UserUpdate
- func (uu *UserUpdate) ClearFollowers() *UserUpdate
- func (uu *UserUpdate) ClearFollowing() *UserUpdate
- func (uu *UserUpdate) ClearGroups() *UserUpdate
- func (uu *UserUpdate) ClearPosts() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) RemoveFollowerIDs(ids ...uuid.UUID) *UserUpdate
- func (uu *UserUpdate) RemoveFollowers(u ...*User) *UserUpdate
- func (uu *UserUpdate) RemoveFollowing(u ...*User) *UserUpdate
- func (uu *UserUpdate) RemoveFollowingIDs(ids ...uuid.UUID) *UserUpdate
- func (uu *UserUpdate) RemoveGroupIDs(ids ...uuid.UUID) *UserUpdate
- func (uu *UserUpdate) RemoveGroups(g ...*Group) *UserUpdate
- func (uu *UserUpdate) RemovePostIDs(ids ...uuid.UUID) *UserUpdate
- func (uu *UserUpdate) RemovePosts(p ...*Post) *UserUpdate
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetAccountAddress(s string) *UserUpdate
- func (uu *UserUpdate) SetAlias(s string) *UserUpdate
- func (uu *UserUpdate) SetBio(s string) *UserUpdate
- func (uu *UserUpdate) SetEmailAddress(s string) *UserUpdate
- func (uu *UserUpdate) SetFirstName(s string) *UserUpdate
- func (uu *UserUpdate) SetLastName(s string) *UserUpdate
- func (uu *UserUpdate) SetNillableBio(s *string) *UserUpdate
- func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddFollowerIDs(ids ...uuid.UUID) *UserUpdateOne
- func (uuo *UserUpdateOne) AddFollowers(u ...*User) *UserUpdateOne
- func (uuo *UserUpdateOne) AddFollowing(u ...*User) *UserUpdateOne
- func (uuo *UserUpdateOne) AddFollowingIDs(ids ...uuid.UUID) *UserUpdateOne
- func (uuo *UserUpdateOne) AddGroupIDs(ids ...uuid.UUID) *UserUpdateOne
- func (uuo *UserUpdateOne) AddGroups(g ...*Group) *UserUpdateOne
- func (uuo *UserUpdateOne) AddPostIDs(ids ...uuid.UUID) *UserUpdateOne
- func (uuo *UserUpdateOne) AddPosts(p ...*Post) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearBio() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearFollowers() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearFollowing() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearGroups() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearPosts() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) RemoveFollowerIDs(ids ...uuid.UUID) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveFollowers(u ...*User) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveFollowing(u ...*User) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveFollowingIDs(ids ...uuid.UUID) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveGroupIDs(ids ...uuid.UUID) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveGroups(g ...*Group) *UserUpdateOne
- func (uuo *UserUpdateOne) RemovePostIDs(ids ...uuid.UUID) *UserUpdateOne
- func (uuo *UserUpdateOne) RemovePosts(p ...*Post) *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) SetAccountAddress(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetAlias(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetBio(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetEmailAddress(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetFirstName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetLastName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableBio(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
- type UserWhereInput
- 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. TypeGroup = "Group" TypeMessage = "Message" TypeNotification = "Notification" TypePost = "Post" TypeSetting = "Setting" TypeUser = "User" )
Variables ¶
var DefaultGroupOrder = &GroupOrder{ Direction: entgql.OrderDirectionAsc, Field: &GroupOrderField{ Value: func(gr *Group) (ent.Value, error) { return gr.ID, nil }, column: group.FieldID, toTerm: group.ByID, toCursor: func(gr *Group) Cursor { return Cursor{ID: gr.ID} }, }, }
DefaultGroupOrder is the default ordering of Group.
var DefaultMessageOrder = &MessageOrder{ Direction: entgql.OrderDirectionAsc, Field: &MessageOrderField{ Value: func(m *Message) (ent.Value, error) { return m.ID, nil }, column: message.FieldID, toTerm: message.ByID, toCursor: func(m *Message) Cursor { return Cursor{ID: m.ID} }, }, }
DefaultMessageOrder is the default ordering of Message.
var DefaultNotificationOrder = &NotificationOrder{ Direction: entgql.OrderDirectionAsc, Field: &NotificationOrderField{ Value: func(n *Notification) (ent.Value, error) { return n.ID, nil }, column: notification.FieldID, toTerm: notification.ByID, toCursor: func(n *Notification) Cursor { return Cursor{ID: n.ID} }, }, }
DefaultNotificationOrder is the default ordering of Notification.
var DefaultPostOrder = &PostOrder{ Direction: entgql.OrderDirectionAsc, Field: &PostOrderField{ Value: func(po *Post) (ent.Value, error) { return po.ID, nil }, column: post.FieldID, toTerm: post.ByID, toCursor: func(po *Post) Cursor { return Cursor{ID: po.ID} }, }, }
DefaultPostOrder is the default ordering of Post.
var DefaultSettingOrder = &SettingOrder{ Direction: entgql.OrderDirectionAsc, Field: &SettingOrderField{ Value: func(s *Setting) (ent.Value, error) { return s.ID, nil }, column: setting.FieldID, toTerm: setting.ByID, toCursor: func(s *Setting) Cursor { return Cursor{ID: s.ID} }, }, }
DefaultSettingOrder is the default ordering of Setting.
var DefaultUserOrder = &UserOrder{ Direction: entgql.OrderDirectionAsc, Field: &UserOrderField{ Value: func(u *User) (ent.Value, error) { return u.ID, nil }, column: user.FieldID, toTerm: user.ByID, toCursor: func(u *User) Cursor { return Cursor{ID: u.ID} }, }, }
DefaultUserOrder is the default ordering of User.
var ErrEmptyGroupWhereInput = errors.New("internal: empty predicate GroupWhereInput")
ErrEmptyGroupWhereInput is returned in case the GroupWhereInput is empty.
var ErrEmptyMessageWhereInput = errors.New("internal: empty predicate MessageWhereInput")
ErrEmptyMessageWhereInput is returned in case the MessageWhereInput is empty.
var ErrEmptyNotificationWhereInput = errors.New("internal: empty predicate NotificationWhereInput")
ErrEmptyNotificationWhereInput is returned in case the NotificationWhereInput is empty.
var ErrEmptyPostWhereInput = errors.New("internal: empty predicate PostWhereInput")
ErrEmptyPostWhereInput is returned in case the PostWhereInput is empty.
var ErrEmptySettingWhereInput = errors.New("internal: empty predicate SettingWhereInput")
ErrEmptySettingWhereInput is returned in case the SettingWhereInput is empty.
var ErrEmptyUserWhereInput = errors.New("internal: empty predicate UserWhereInput")
ErrEmptyUserWhereInput is returned in case the UserWhereInput is empty.
var Module = fx.Module("internal", fx.Provide( NewGraph, NewExecutableSchema, ), )
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.
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
func NewTxContext ¶
NewTxContext returns a new context with the given Tx 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(internal.As(internal.Sum(field1), "sum_field1"), (internal.As(internal.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 // Group is the client for interacting with the Group builders. Group *GroupClient // Message is the client for interacting with the Message builders. Message *MessageClient // Notification is the client for interacting with the Notification builders. Notification *NotificationClient // Post is the client for interacting with the Post builders. Post *PostClient // Setting is the client for interacting with the Setting builders. Setting *SettingClient // 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(). Group. 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(...)`.
func (*Client) Node ¶
Node returns the node with given global ID.
This API helpful in case you want to build an administrator tool to browser all types in system.
func (*Client) Noder ¶
Noder returns a Node by its id. If the NodeType was not provided, it will be derived from the id value according to the universal-id configuration.
c.Noder(ctx, id) c.Noder(ctx, id, ent.WithNodeType(typeResolver))
func (*Client) OpenTx ¶
OpenTx opens a transaction and returns a transactional context along with the created transaction.
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 ComplexityRoot ¶
type ComplexityRoot struct { Group struct { CreatedAt func(childComplexity int) int ID func(childComplexity int) int UpdatedAt func(childComplexity int) int Users func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, where *UserWhereInput) int } GroupConnection struct { Edges func(childComplexity int) int PageInfo func(childComplexity int) int TotalCount func(childComplexity int) int } GroupEdge struct { Cursor func(childComplexity int) int Node func(childComplexity int) int } Message struct { Body func(childComplexity int) int CreatedAt func(childComplexity int) int From func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, where *MessageWhereInput) int ID func(childComplexity int) int To func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, where *MessageWhereInput) int UpdatedAt func(childComplexity int) int } MessageConnection struct { Edges func(childComplexity int) int PageInfo func(childComplexity int) int TotalCount func(childComplexity int) int } MessageEdge struct { Cursor func(childComplexity int) int Node func(childComplexity int) int } Notification struct { CreatedAt func(childComplexity int) int ID func(childComplexity int) int UpdatedAt func(childComplexity int) int } NotificationConnection struct { Edges func(childComplexity int) int PageInfo func(childComplexity int) int TotalCount func(childComplexity int) int } NotificationEdge struct { Cursor func(childComplexity int) int Node func(childComplexity int) int } PageInfo struct { EndCursor func(childComplexity int) int HasNextPage func(childComplexity int) int HasPreviousPage func(childComplexity int) int StartCursor func(childComplexity int) int } Post struct { CreatedAt func(childComplexity int) int ID func(childComplexity int) int UpdatedAt func(childComplexity int) int User func(childComplexity int) int } PostConnection struct { Edges func(childComplexity int) int PageInfo func(childComplexity int) int TotalCount func(childComplexity int) int } PostEdge struct { Cursor func(childComplexity int) int Node func(childComplexity int) int } Query struct { Node func(childComplexity int, id uuid.UUID) int Nodes func(childComplexity int, ids []uuid.UUID) int } Setting struct { CreatedAt func(childComplexity int) int ID func(childComplexity int) int UpdatedAt func(childComplexity int) int } SettingConnection struct { Edges func(childComplexity int) int PageInfo func(childComplexity int) int TotalCount func(childComplexity int) int } SettingEdge struct { Cursor func(childComplexity int) int Node func(childComplexity int) int } User struct { AccountAddress func(childComplexity int) int Alias func(childComplexity int) int Bio func(childComplexity int) int CreatedAt func(childComplexity int) int EmailAddress func(childComplexity int) int FirstName func(childComplexity int) int Followers func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, where *UserWhereInput) int Following func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, where *UserWhereInput) int Groups func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, where *GroupWhereInput) int ID func(childComplexity int) int LastName func(childComplexity int) int Posts func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, where *PostWhereInput) int UpdatedAt func(childComplexity int) int } UserConnection struct { Edges func(childComplexity int) int PageInfo func(childComplexity int) int TotalCount func(childComplexity int) int } UserEdge struct { Cursor func(childComplexity int) int Node func(childComplexity int) int } }
type Config ¶
type Config struct { Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
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 DirectiveRoot ¶
type DirectiveRoot struct { }
type Edge ¶
type Edge struct { Type string `json:"type,omitempty"` // edge type. Name string `json:"name,omitempty"` // edge name. IDs []uuid.UUID `json:"ids,omitempty"` // node ids (where this edge point to). }
Edges between two nodes.
type Field ¶
type Field struct { Type string `json:"type,omitempty"` // field type. Name string `json:"name,omitempty"` // field name (as in struct). Value string `json:"value,omitempty"` // stringified value. }
Field of a node.
type Group ¶
type Group struct { // ID of the ent. ID uuid.UUID `json:"id,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 GroupQuery when eager-loading is set. Edges GroupEdges `json:"edges"` // contains filtered or unexported fields }
Group is the model entity for the Group schema.
func (*Group) IsNode ¶
func (n *Group) IsNode()
IsNode implements the Node interface check for GQLGen.
func (*Group) NamedUsers ¶
NamedUsers returns the Users named value or an error if the edge was not loaded in eager-loading with this name.
func (*Group) QueryUsers ¶
QueryUsers queries the "users" edge of the Group entity.
func (*Group) ToEdge ¶
func (gr *Group) ToEdge(order *GroupOrder) *GroupEdge
ToEdge converts Group into GroupEdge.
func (*Group) Unwrap ¶
Unwrap unwraps the Group 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 (*Group) Update ¶
func (gr *Group) Update() *GroupUpdateOne
Update returns a builder for updating this Group. Note that you need to call Group.Unwrap() before calling this method if this Group was returned from a transaction, and the transaction was committed or rolled back.
type GroupClient ¶
type GroupClient struct {
// contains filtered or unexported fields
}
GroupClient is a client for the Group schema.
func NewGroupClient ¶
func NewGroupClient(c config) *GroupClient
NewGroupClient returns a client for the Group from the given config.
func (*GroupClient) Create ¶
func (c *GroupClient) Create() *GroupCreate
Create returns a builder for creating a Group entity.
func (*GroupClient) CreateBulk ¶
func (c *GroupClient) CreateBulk(builders ...*GroupCreate) *GroupCreateBulk
CreateBulk returns a builder for creating a bulk of Group entities.
func (*GroupClient) Delete ¶
func (c *GroupClient) Delete() *GroupDelete
Delete returns a delete builder for Group.
func (*GroupClient) DeleteOne ¶
func (c *GroupClient) DeleteOne(gr *Group) *GroupDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*GroupClient) DeleteOneID ¶
func (c *GroupClient) DeleteOneID(id uuid.UUID) *GroupDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*GroupClient) Intercept ¶
func (c *GroupClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `group.Intercept(f(g(h())))`.
func (*GroupClient) Interceptors ¶
func (c *GroupClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*GroupClient) Query ¶
func (c *GroupClient) Query() *GroupQuery
Query returns a query builder for Group.
func (*GroupClient) QueryUsers ¶
func (c *GroupClient) QueryUsers(gr *Group) *UserQuery
QueryUsers queries the users edge of a Group.
func (*GroupClient) Update ¶
func (c *GroupClient) Update() *GroupUpdate
Update returns an update builder for Group.
func (*GroupClient) UpdateOne ¶
func (c *GroupClient) UpdateOne(gr *Group) *GroupUpdateOne
UpdateOne returns an update builder for the given entity.
func (*GroupClient) UpdateOneID ¶
func (c *GroupClient) UpdateOneID(id uuid.UUID) *GroupUpdateOne
UpdateOneID returns an update builder for the given id.
func (*GroupClient) Use ¶
func (c *GroupClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `group.Hooks(f(g(h())))`.
type GroupConnection ¶
type GroupConnection struct { Edges []*GroupEdge `json:"edges"` PageInfo PageInfo `json:"pageInfo"` TotalCount int `json:"totalCount"` }
GroupConnection is the connection containing edges to Group.
type GroupCreate ¶
type GroupCreate struct {
// contains filtered or unexported fields
}
GroupCreate is the builder for creating a Group entity.
func (*GroupCreate) AddUserIDs ¶
func (gc *GroupCreate) AddUserIDs(ids ...uuid.UUID) *GroupCreate
AddUserIDs adds the "users" edge to the User entity by IDs.
func (*GroupCreate) AddUsers ¶
func (gc *GroupCreate) AddUsers(u ...*User) *GroupCreate
AddUsers adds the "users" edges to the User entity.
func (*GroupCreate) Exec ¶
func (gc *GroupCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*GroupCreate) ExecX ¶
func (gc *GroupCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GroupCreate) Mutation ¶
func (gc *GroupCreate) Mutation() *GroupMutation
Mutation returns the GroupMutation object of the builder.
func (*GroupCreate) Save ¶
func (gc *GroupCreate) Save(ctx context.Context) (*Group, error)
Save creates the Group in the database.
func (*GroupCreate) SaveX ¶
func (gc *GroupCreate) SaveX(ctx context.Context) *Group
SaveX calls Save and panics if Save returns an error.
func (*GroupCreate) SetCreatedAt ¶
func (gc *GroupCreate) SetCreatedAt(t time.Time) *GroupCreate
SetCreatedAt sets the "created_at" field.
func (*GroupCreate) SetID ¶
func (gc *GroupCreate) SetID(u uuid.UUID) *GroupCreate
SetID sets the "id" field.
func (*GroupCreate) SetNillableCreatedAt ¶
func (gc *GroupCreate) SetNillableCreatedAt(t *time.Time) *GroupCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*GroupCreate) SetNillableID ¶
func (gc *GroupCreate) SetNillableID(u *uuid.UUID) *GroupCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*GroupCreate) SetNillableUpdatedAt ¶
func (gc *GroupCreate) SetNillableUpdatedAt(t *time.Time) *GroupCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*GroupCreate) SetUpdatedAt ¶
func (gc *GroupCreate) SetUpdatedAt(t time.Time) *GroupCreate
SetUpdatedAt sets the "updated_at" field.
type GroupCreateBulk ¶
type GroupCreateBulk struct {
// contains filtered or unexported fields
}
GroupCreateBulk is the builder for creating many Group entities in bulk.
func (*GroupCreateBulk) Exec ¶
func (gcb *GroupCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*GroupCreateBulk) ExecX ¶
func (gcb *GroupCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type GroupDelete ¶
type GroupDelete struct {
// contains filtered or unexported fields
}
GroupDelete is the builder for deleting a Group entity.
func (*GroupDelete) Exec ¶
func (gd *GroupDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*GroupDelete) ExecX ¶
func (gd *GroupDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*GroupDelete) Where ¶
func (gd *GroupDelete) Where(ps ...predicate.Group) *GroupDelete
Where appends a list predicates to the GroupDelete builder.
type GroupDeleteOne ¶
type GroupDeleteOne struct {
// contains filtered or unexported fields
}
GroupDeleteOne is the builder for deleting a single Group entity.
func (*GroupDeleteOne) Exec ¶
func (gdo *GroupDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*GroupDeleteOne) ExecX ¶
func (gdo *GroupDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GroupDeleteOne) Where ¶
func (gdo *GroupDeleteOne) Where(ps ...predicate.Group) *GroupDeleteOne
Where appends a list predicates to the GroupDelete builder.
type GroupEdges ¶
type GroupEdges struct { // Users holds the value of the users edge. Users []*User `json:"users,omitempty"` // contains filtered or unexported fields }
GroupEdges holds the relations/edges for other nodes in the graph.
func (GroupEdges) UsersOrErr ¶
func (e GroupEdges) UsersOrErr() ([]*User, error)
UsersOrErr returns the Users value or an error if the edge was not loaded in eager-loading.
type GroupGroupBy ¶
type GroupGroupBy struct {
// contains filtered or unexported fields
}
GroupGroupBy is the group-by builder for Group entities.
func (*GroupGroupBy) Aggregate ¶
func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*GroupGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*GroupGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*GroupGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*GroupGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*GroupGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*GroupGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*GroupGroupBy) Scan ¶
func (ggb *GroupGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*GroupGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type GroupMutation ¶
type GroupMutation struct {
// contains filtered or unexported fields
}
GroupMutation represents an operation that mutates the Group nodes in the graph.
func (*GroupMutation) AddField ¶
func (m *GroupMutation) 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 (*GroupMutation) AddUserIDs ¶
func (m *GroupMutation) AddUserIDs(ids ...uuid.UUID)
AddUserIDs adds the "users" edge to the User entity by ids.
func (*GroupMutation) AddedEdges ¶
func (m *GroupMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*GroupMutation) AddedField ¶
func (m *GroupMutation) 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 (*GroupMutation) AddedFields ¶
func (m *GroupMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*GroupMutation) AddedIDs ¶
func (m *GroupMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*GroupMutation) ClearEdge ¶
func (m *GroupMutation) 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 (*GroupMutation) ClearField ¶
func (m *GroupMutation) 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 (*GroupMutation) ClearUsers ¶
func (m *GroupMutation) ClearUsers()
ClearUsers clears the "users" edge to the User entity.
func (*GroupMutation) ClearedEdges ¶
func (m *GroupMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*GroupMutation) ClearedFields ¶
func (m *GroupMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (GroupMutation) Client ¶
func (m GroupMutation) 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 (*GroupMutation) CreatedAt ¶
func (m *GroupMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*GroupMutation) EdgeCleared ¶
func (m *GroupMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*GroupMutation) Field ¶
func (m *GroupMutation) 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 (*GroupMutation) FieldCleared ¶
func (m *GroupMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*GroupMutation) Fields ¶
func (m *GroupMutation) 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 (*GroupMutation) ID ¶
func (m *GroupMutation) ID() (id uuid.UUID, 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 (*GroupMutation) IDs ¶
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 (*GroupMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Group entity. If the Group 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 (*GroupMutation) 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 (*GroupMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Group entity. If the Group 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 (*GroupMutation) RemoveUserIDs ¶
func (m *GroupMutation) RemoveUserIDs(ids ...uuid.UUID)
RemoveUserIDs removes the "users" edge to the User entity by IDs.
func (*GroupMutation) RemovedEdges ¶
func (m *GroupMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*GroupMutation) RemovedIDs ¶
func (m *GroupMutation) 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 (*GroupMutation) RemovedUsersIDs ¶
func (m *GroupMutation) RemovedUsersIDs() (ids []uuid.UUID)
RemovedUsers returns the removed IDs of the "users" edge to the User entity.
func (*GroupMutation) ResetCreatedAt ¶
func (m *GroupMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*GroupMutation) ResetEdge ¶
func (m *GroupMutation) 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 (*GroupMutation) ResetField ¶
func (m *GroupMutation) 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 (*GroupMutation) ResetUpdatedAt ¶
func (m *GroupMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*GroupMutation) ResetUsers ¶
func (m *GroupMutation) ResetUsers()
ResetUsers resets all changes to the "users" edge.
func (*GroupMutation) SetCreatedAt ¶
func (m *GroupMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*GroupMutation) SetField ¶
func (m *GroupMutation) 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 (*GroupMutation) SetID ¶
func (m *GroupMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Group entities.
func (*GroupMutation) SetOp ¶
func (m *GroupMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*GroupMutation) SetUpdatedAt ¶
func (m *GroupMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (GroupMutation) Tx ¶
func (m GroupMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*GroupMutation) Type ¶
func (m *GroupMutation) Type() string
Type returns the node type of this mutation (Group).
func (*GroupMutation) UpdatedAt ¶
func (m *GroupMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*GroupMutation) UsersCleared ¶
func (m *GroupMutation) UsersCleared() bool
UsersCleared reports if the "users" edge to the User entity was cleared.
func (*GroupMutation) UsersIDs ¶
func (m *GroupMutation) UsersIDs() (ids []uuid.UUID)
UsersIDs returns the "users" edge IDs in the mutation.
func (*GroupMutation) Where ¶
func (m *GroupMutation) Where(ps ...predicate.Group)
Where appends a list predicates to the GroupMutation builder.
func (*GroupMutation) WhereP ¶
func (m *GroupMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the GroupMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type GroupOrder ¶
type GroupOrder struct { Direction OrderDirection `json:"direction"` Field *GroupOrderField `json:"field"` }
GroupOrder defines the ordering of Group.
type GroupOrderField ¶
type GroupOrderField struct { // Value extracts the ordering value from the given Group. Value func(*Group) (ent.Value, error) // contains filtered or unexported fields }
GroupOrderField defines the ordering field of Group.
type GroupPaginateOption ¶
type GroupPaginateOption func(*groupPager) error
GroupPaginateOption enables pagination customization.
func WithGroupFilter ¶
func WithGroupFilter(filter func(*GroupQuery) (*GroupQuery, error)) GroupPaginateOption
WithGroupFilter configures pagination filter.
func WithGroupOrder ¶
func WithGroupOrder(order *GroupOrder) GroupPaginateOption
WithGroupOrder configures pagination ordering.
type GroupQuery ¶
type GroupQuery struct {
// contains filtered or unexported fields
}
GroupQuery is the builder for querying Group entities.
func (*GroupQuery) Aggregate ¶
func (gq *GroupQuery) Aggregate(fns ...AggregateFunc) *GroupSelect
Aggregate returns a GroupSelect configured with the given aggregations.
func (*GroupQuery) All ¶
func (gq *GroupQuery) All(ctx context.Context) ([]*Group, error)
All executes the query and returns a list of Groups.
func (*GroupQuery) AllX ¶
func (gq *GroupQuery) AllX(ctx context.Context) []*Group
AllX is like All, but panics if an error occurs.
func (*GroupQuery) Clone ¶
func (gq *GroupQuery) Clone() *GroupQuery
Clone returns a duplicate of the GroupQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*GroupQuery) CollectFields ¶
func (gr *GroupQuery) CollectFields(ctx context.Context, satisfies ...string) (*GroupQuery, error)
CollectFields tells the query-builder to eagerly load connected nodes by resolver context.
func (*GroupQuery) Count ¶
func (gq *GroupQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*GroupQuery) CountX ¶
func (gq *GroupQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*GroupQuery) Exist ¶
func (gq *GroupQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*GroupQuery) ExistX ¶
func (gq *GroupQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*GroupQuery) First ¶
func (gq *GroupQuery) First(ctx context.Context) (*Group, error)
First returns the first Group entity from the query. Returns a *NotFoundError when no Group was found.
func (*GroupQuery) FirstID ¶
FirstID returns the first Group ID from the query. Returns a *NotFoundError when no Group ID was found.
func (*GroupQuery) FirstIDX ¶
func (gq *GroupQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*GroupQuery) FirstX ¶
func (gq *GroupQuery) FirstX(ctx context.Context) *Group
FirstX is like First, but panics if an error occurs.
func (*GroupQuery) GroupBy ¶
func (gq *GroupQuery) GroupBy(field string, fields ...string) *GroupGroupBy
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.Group.Query(). GroupBy(group.FieldCreatedAt). Aggregate(internal.Count()). Scan(ctx, &v)
func (*GroupQuery) IDsX ¶
func (gq *GroupQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*GroupQuery) Limit ¶
func (gq *GroupQuery) Limit(limit int) *GroupQuery
Limit the number of records to be returned by this query.
func (*GroupQuery) Offset ¶
func (gq *GroupQuery) Offset(offset int) *GroupQuery
Offset to start from.
func (*GroupQuery) Only ¶
func (gq *GroupQuery) Only(ctx context.Context) (*Group, error)
Only returns a single Group entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Group entity is found. Returns a *NotFoundError when no Group entities are found.
func (*GroupQuery) OnlyID ¶
OnlyID is like Only, but returns the only Group ID in the query. Returns a *NotSingularError when more than one Group ID is found. Returns a *NotFoundError when no entities are found.
func (*GroupQuery) OnlyIDX ¶
func (gq *GroupQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*GroupQuery) OnlyX ¶
func (gq *GroupQuery) OnlyX(ctx context.Context) *Group
OnlyX is like Only, but panics if an error occurs.
func (*GroupQuery) Order ¶
func (gq *GroupQuery) Order(o ...group.OrderOption) *GroupQuery
Order specifies how the records should be ordered.
func (*GroupQuery) Paginate ¶
func (gr *GroupQuery) Paginate( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, opts ...GroupPaginateOption, ) (*GroupConnection, error)
Paginate executes the query and returns a relay based cursor connection to Group.
func (*GroupQuery) QueryUsers ¶
func (gq *GroupQuery) QueryUsers() *UserQuery
QueryUsers chains the current query on the "users" edge.
func (*GroupQuery) Select ¶
func (gq *GroupQuery) Select(fields ...string) *GroupSelect
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.Group.Query(). Select(group.FieldCreatedAt). Scan(ctx, &v)
func (*GroupQuery) Unique ¶
func (gq *GroupQuery) Unique(unique bool) *GroupQuery
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 (*GroupQuery) Where ¶
func (gq *GroupQuery) Where(ps ...predicate.Group) *GroupQuery
Where adds a new predicate for the GroupQuery builder.
func (*GroupQuery) WithNamedUsers ¶
func (gq *GroupQuery) WithNamedUsers(name string, opts ...func(*UserQuery)) *GroupQuery
WithNamedUsers tells the query-builder to eager-load the nodes that are connected to the "users" edge with the given name. The optional arguments are used to configure the query builder of the edge.
func (*GroupQuery) WithUsers ¶
func (gq *GroupQuery) WithUsers(opts ...func(*UserQuery)) *GroupQuery
WithUsers tells the query-builder to eager-load the nodes that are connected to the "users" edge. The optional arguments are used to configure the query builder of the edge.
type GroupSelect ¶
type GroupSelect struct { *GroupQuery // contains filtered or unexported fields }
GroupSelect is the builder for selecting fields of Group entities.
func (*GroupSelect) Aggregate ¶
func (gs *GroupSelect) Aggregate(fns ...AggregateFunc) *GroupSelect
Aggregate adds the given aggregation functions to the selector query.
func (*GroupSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*GroupSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*GroupSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*GroupSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*GroupSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*GroupSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*GroupSelect) Scan ¶
func (gs *GroupSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*GroupSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type GroupUpdate ¶
type GroupUpdate struct {
// contains filtered or unexported fields
}
GroupUpdate is the builder for updating Group entities.
func (*GroupUpdate) AddUserIDs ¶
func (gu *GroupUpdate) AddUserIDs(ids ...uuid.UUID) *GroupUpdate
AddUserIDs adds the "users" edge to the User entity by IDs.
func (*GroupUpdate) AddUsers ¶
func (gu *GroupUpdate) AddUsers(u ...*User) *GroupUpdate
AddUsers adds the "users" edges to the User entity.
func (*GroupUpdate) ClearUsers ¶
func (gu *GroupUpdate) ClearUsers() *GroupUpdate
ClearUsers clears all "users" edges to the User entity.
func (*GroupUpdate) Exec ¶
func (gu *GroupUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*GroupUpdate) ExecX ¶
func (gu *GroupUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GroupUpdate) Mutation ¶
func (gu *GroupUpdate) Mutation() *GroupMutation
Mutation returns the GroupMutation object of the builder.
func (*GroupUpdate) RemoveUserIDs ¶
func (gu *GroupUpdate) RemoveUserIDs(ids ...uuid.UUID) *GroupUpdate
RemoveUserIDs removes the "users" edge to User entities by IDs.
func (*GroupUpdate) RemoveUsers ¶
func (gu *GroupUpdate) RemoveUsers(u ...*User) *GroupUpdate
RemoveUsers removes "users" edges to User entities.
func (*GroupUpdate) Save ¶
func (gu *GroupUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*GroupUpdate) SaveX ¶
func (gu *GroupUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*GroupUpdate) SetUpdatedAt ¶
func (gu *GroupUpdate) SetUpdatedAt(t time.Time) *GroupUpdate
SetUpdatedAt sets the "updated_at" field.
func (*GroupUpdate) Where ¶
func (gu *GroupUpdate) Where(ps ...predicate.Group) *GroupUpdate
Where appends a list predicates to the GroupUpdate builder.
type GroupUpdateOne ¶
type GroupUpdateOne struct {
// contains filtered or unexported fields
}
GroupUpdateOne is the builder for updating a single Group entity.
func (*GroupUpdateOne) AddUserIDs ¶
func (guo *GroupUpdateOne) AddUserIDs(ids ...uuid.UUID) *GroupUpdateOne
AddUserIDs adds the "users" edge to the User entity by IDs.
func (*GroupUpdateOne) AddUsers ¶
func (guo *GroupUpdateOne) AddUsers(u ...*User) *GroupUpdateOne
AddUsers adds the "users" edges to the User entity.
func (*GroupUpdateOne) ClearUsers ¶
func (guo *GroupUpdateOne) ClearUsers() *GroupUpdateOne
ClearUsers clears all "users" edges to the User entity.
func (*GroupUpdateOne) Exec ¶
func (guo *GroupUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*GroupUpdateOne) ExecX ¶
func (guo *GroupUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GroupUpdateOne) Mutation ¶
func (guo *GroupUpdateOne) Mutation() *GroupMutation
Mutation returns the GroupMutation object of the builder.
func (*GroupUpdateOne) RemoveUserIDs ¶
func (guo *GroupUpdateOne) RemoveUserIDs(ids ...uuid.UUID) *GroupUpdateOne
RemoveUserIDs removes the "users" edge to User entities by IDs.
func (*GroupUpdateOne) RemoveUsers ¶
func (guo *GroupUpdateOne) RemoveUsers(u ...*User) *GroupUpdateOne
RemoveUsers removes "users" edges to User entities.
func (*GroupUpdateOne) Save ¶
func (guo *GroupUpdateOne) Save(ctx context.Context) (*Group, error)
Save executes the query and returns the updated Group entity.
func (*GroupUpdateOne) SaveX ¶
func (guo *GroupUpdateOne) SaveX(ctx context.Context) *Group
SaveX is like Save, but panics if an error occurs.
func (*GroupUpdateOne) Select ¶
func (guo *GroupUpdateOne) Select(field string, fields ...string) *GroupUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*GroupUpdateOne) SetUpdatedAt ¶
func (guo *GroupUpdateOne) SetUpdatedAt(t time.Time) *GroupUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*GroupUpdateOne) Where ¶
func (guo *GroupUpdateOne) Where(ps ...predicate.Group) *GroupUpdateOne
Where appends a list predicates to the GroupUpdate builder.
type GroupWhereInput ¶
type GroupWhereInput struct { Predicates []predicate.Group `json:"-"` Not *GroupWhereInput `json:"not,omitempty"` Or []*GroupWhereInput `json:"or,omitempty"` And []*GroupWhereInput `json:"and,omitempty"` // "id" field predicates. ID *uuid.UUID `json:"id,omitempty"` IDNEQ *uuid.UUID `json:"idNEQ,omitempty"` IDIn []uuid.UUID `json:"idIn,omitempty"` IDNotIn []uuid.UUID `json:"idNotIn,omitempty"` IDGT *uuid.UUID `json:"idGT,omitempty"` IDGTE *uuid.UUID `json:"idGTE,omitempty"` IDLT *uuid.UUID `json:"idLT,omitempty"` IDLTE *uuid.UUID `json:"idLTE,omitempty"` // "created_at" field predicates. CreatedAt *time.Time `json:"createdAt,omitempty"` CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` // "updated_at" field predicates. UpdatedAt *time.Time `json:"updatedAt,omitempty"` UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` // "users" edge predicates. HasUsers *bool `json:"hasUsers,omitempty"` HasUsersWith []*UserWhereInput `json:"hasUsersWith,omitempty"` }
GroupWhereInput represents a where input for filtering Group queries.
func (*GroupWhereInput) AddPredicates ¶
func (i *GroupWhereInput) AddPredicates(predicates ...predicate.Group)
AddPredicates adds custom predicates to the where input to be used during the filtering phase.
func (*GroupWhereInput) Filter ¶
func (i *GroupWhereInput) Filter(q *GroupQuery) (*GroupQuery, error)
Filter applies the GroupWhereInput filter on the GroupQuery builder.
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 Message ¶
type Message struct { // ID of the ent. ID uuid.UUID `json:"id,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"` // Body holds the value of the "body" field. Body string `json:"body,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the MessageQuery when eager-loading is set. Edges MessageEdges `json:"edges"` // contains filtered or unexported fields }
Message is the model entity for the Message schema.
func (*Message) From ¶
func (m *Message) From( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, where *MessageWhereInput, ) (*MessageConnection, error)
func (*Message) IsNode ¶
func (n *Message) IsNode()
IsNode implements the Node interface check for GQLGen.
func (*Message) NamedFrom ¶
NamedFrom returns the From named value or an error if the edge was not loaded in eager-loading with this name.
func (*Message) NamedTo ¶
NamedTo returns the To named value or an error if the edge was not loaded in eager-loading with this name.
func (*Message) QueryFrom ¶
func (m *Message) QueryFrom() *MessageQuery
QueryFrom queries the "from" edge of the Message entity.
func (*Message) QueryTo ¶
func (m *Message) QueryTo() *MessageQuery
QueryTo queries the "to" edge of the Message entity.
func (*Message) To ¶
func (m *Message) To( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, where *MessageWhereInput, ) (*MessageConnection, error)
func (*Message) ToEdge ¶
func (m *Message) ToEdge(order *MessageOrder) *MessageEdge
ToEdge converts Message into MessageEdge.
func (*Message) Unwrap ¶
Unwrap unwraps the Message 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 (*Message) Update ¶
func (m *Message) Update() *MessageUpdateOne
Update returns a builder for updating this Message. Note that you need to call Message.Unwrap() before calling this method if this Message was returned from a transaction, and the transaction was committed or rolled back.
type MessageClient ¶
type MessageClient struct {
// contains filtered or unexported fields
}
MessageClient is a client for the Message schema.
func NewMessageClient ¶
func NewMessageClient(c config) *MessageClient
NewMessageClient returns a client for the Message from the given config.
func (*MessageClient) Create ¶
func (c *MessageClient) Create() *MessageCreate
Create returns a builder for creating a Message entity.
func (*MessageClient) CreateBulk ¶
func (c *MessageClient) CreateBulk(builders ...*MessageCreate) *MessageCreateBulk
CreateBulk returns a builder for creating a bulk of Message entities.
func (*MessageClient) Delete ¶
func (c *MessageClient) Delete() *MessageDelete
Delete returns a delete builder for Message.
func (*MessageClient) DeleteOne ¶
func (c *MessageClient) DeleteOne(m *Message) *MessageDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*MessageClient) DeleteOneID ¶
func (c *MessageClient) DeleteOneID(id uuid.UUID) *MessageDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*MessageClient) Hooks ¶
func (c *MessageClient) Hooks() []Hook
Hooks returns the client hooks.
func (*MessageClient) Intercept ¶
func (c *MessageClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `message.Intercept(f(g(h())))`.
func (*MessageClient) Interceptors ¶
func (c *MessageClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*MessageClient) Query ¶
func (c *MessageClient) Query() *MessageQuery
Query returns a query builder for Message.
func (*MessageClient) QueryFrom ¶
func (c *MessageClient) QueryFrom(m *Message) *MessageQuery
QueryFrom queries the from edge of a Message.
func (*MessageClient) QueryTo ¶
func (c *MessageClient) QueryTo(m *Message) *MessageQuery
QueryTo queries the to edge of a Message.
func (*MessageClient) Update ¶
func (c *MessageClient) Update() *MessageUpdate
Update returns an update builder for Message.
func (*MessageClient) UpdateOne ¶
func (c *MessageClient) UpdateOne(m *Message) *MessageUpdateOne
UpdateOne returns an update builder for the given entity.
func (*MessageClient) UpdateOneID ¶
func (c *MessageClient) UpdateOneID(id uuid.UUID) *MessageUpdateOne
UpdateOneID returns an update builder for the given id.
func (*MessageClient) Use ¶
func (c *MessageClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `message.Hooks(f(g(h())))`.
type MessageConnection ¶
type MessageConnection struct { Edges []*MessageEdge `json:"edges"` PageInfo PageInfo `json:"pageInfo"` TotalCount int `json:"totalCount"` }
MessageConnection is the connection containing edges to Message.
type MessageCreate ¶
type MessageCreate struct {
// contains filtered or unexported fields
}
MessageCreate is the builder for creating a Message entity.
func (*MessageCreate) AddFrom ¶
func (mc *MessageCreate) AddFrom(m ...*Message) *MessageCreate
AddFrom adds the "from" edges to the Message entity.
func (*MessageCreate) AddFromIDs ¶
func (mc *MessageCreate) AddFromIDs(ids ...uuid.UUID) *MessageCreate
AddFromIDs adds the "from" edge to the Message entity by IDs.
func (*MessageCreate) AddTo ¶
func (mc *MessageCreate) AddTo(m ...*Message) *MessageCreate
AddTo adds the "to" edges to the Message entity.
func (*MessageCreate) AddToIDs ¶
func (mc *MessageCreate) AddToIDs(ids ...uuid.UUID) *MessageCreate
AddToIDs adds the "to" edge to the Message entity by IDs.
func (*MessageCreate) Exec ¶
func (mc *MessageCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*MessageCreate) ExecX ¶
func (mc *MessageCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MessageCreate) Mutation ¶
func (mc *MessageCreate) Mutation() *MessageMutation
Mutation returns the MessageMutation object of the builder.
func (*MessageCreate) Save ¶
func (mc *MessageCreate) Save(ctx context.Context) (*Message, error)
Save creates the Message in the database.
func (*MessageCreate) SaveX ¶
func (mc *MessageCreate) SaveX(ctx context.Context) *Message
SaveX calls Save and panics if Save returns an error.
func (*MessageCreate) SetBody ¶
func (mc *MessageCreate) SetBody(s string) *MessageCreate
SetBody sets the "body" field.
func (*MessageCreate) SetCreatedAt ¶
func (mc *MessageCreate) SetCreatedAt(t time.Time) *MessageCreate
SetCreatedAt sets the "created_at" field.
func (*MessageCreate) SetID ¶
func (mc *MessageCreate) SetID(u uuid.UUID) *MessageCreate
SetID sets the "id" field.
func (*MessageCreate) SetNillableCreatedAt ¶
func (mc *MessageCreate) SetNillableCreatedAt(t *time.Time) *MessageCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*MessageCreate) SetNillableID ¶
func (mc *MessageCreate) SetNillableID(u *uuid.UUID) *MessageCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*MessageCreate) SetNillableUpdatedAt ¶
func (mc *MessageCreate) SetNillableUpdatedAt(t *time.Time) *MessageCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*MessageCreate) SetUpdatedAt ¶
func (mc *MessageCreate) SetUpdatedAt(t time.Time) *MessageCreate
SetUpdatedAt sets the "updated_at" field.
type MessageCreateBulk ¶
type MessageCreateBulk struct {
// contains filtered or unexported fields
}
MessageCreateBulk is the builder for creating many Message entities in bulk.
func (*MessageCreateBulk) Exec ¶
func (mcb *MessageCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*MessageCreateBulk) ExecX ¶
func (mcb *MessageCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type MessageDelete ¶
type MessageDelete struct {
// contains filtered or unexported fields
}
MessageDelete is the builder for deleting a Message entity.
func (*MessageDelete) Exec ¶
func (md *MessageDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*MessageDelete) ExecX ¶
func (md *MessageDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*MessageDelete) Where ¶
func (md *MessageDelete) Where(ps ...predicate.Message) *MessageDelete
Where appends a list predicates to the MessageDelete builder.
type MessageDeleteOne ¶
type MessageDeleteOne struct {
// contains filtered or unexported fields
}
MessageDeleteOne is the builder for deleting a single Message entity.
func (*MessageDeleteOne) Exec ¶
func (mdo *MessageDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*MessageDeleteOne) ExecX ¶
func (mdo *MessageDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MessageDeleteOne) Where ¶
func (mdo *MessageDeleteOne) Where(ps ...predicate.Message) *MessageDeleteOne
Where appends a list predicates to the MessageDelete builder.
type MessageEdge ¶
MessageEdge is the edge representation of Message.
type MessageEdges ¶
type MessageEdges struct { // From holds the value of the from edge. From []*Message `json:"from,omitempty"` // To holds the value of the to edge. To []*Message `json:"to,omitempty"` // contains filtered or unexported fields }
MessageEdges holds the relations/edges for other nodes in the graph.
func (MessageEdges) FromOrErr ¶
func (e MessageEdges) FromOrErr() ([]*Message, error)
FromOrErr returns the From value or an error if the edge was not loaded in eager-loading.
func (MessageEdges) ToOrErr ¶
func (e MessageEdges) ToOrErr() ([]*Message, error)
ToOrErr returns the To value or an error if the edge was not loaded in eager-loading.
type MessageGroupBy ¶
type MessageGroupBy struct {
// contains filtered or unexported fields
}
MessageGroupBy is the group-by builder for Message entities.
func (*MessageGroupBy) Aggregate ¶
func (mgb *MessageGroupBy) Aggregate(fns ...AggregateFunc) *MessageGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*MessageGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*MessageGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*MessageGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*MessageGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*MessageGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*MessageGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*MessageGroupBy) Scan ¶
func (mgb *MessageGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*MessageGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type MessageMutation ¶
type MessageMutation struct {
// contains filtered or unexported fields
}
MessageMutation represents an operation that mutates the Message nodes in the graph.
func (*MessageMutation) AddField ¶
func (m *MessageMutation) 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 (*MessageMutation) AddFromIDs ¶
func (m *MessageMutation) AddFromIDs(ids ...uuid.UUID)
AddFromIDs adds the "from" edge to the Message entity by ids.
func (*MessageMutation) AddToIDs ¶
func (m *MessageMutation) AddToIDs(ids ...uuid.UUID)
AddToIDs adds the "to" edge to the Message entity by ids.
func (*MessageMutation) AddedEdges ¶
func (m *MessageMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*MessageMutation) AddedField ¶
func (m *MessageMutation) 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 (*MessageMutation) AddedFields ¶
func (m *MessageMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*MessageMutation) AddedIDs ¶
func (m *MessageMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*MessageMutation) Body ¶
func (m *MessageMutation) Body() (r string, exists bool)
Body returns the value of the "body" field in the mutation.
func (*MessageMutation) ClearEdge ¶
func (m *MessageMutation) 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 (*MessageMutation) ClearField ¶
func (m *MessageMutation) 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 (*MessageMutation) ClearFrom ¶
func (m *MessageMutation) ClearFrom()
ClearFrom clears the "from" edge to the Message entity.
func (*MessageMutation) ClearTo ¶
func (m *MessageMutation) ClearTo()
ClearTo clears the "to" edge to the Message entity.
func (*MessageMutation) ClearedEdges ¶
func (m *MessageMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*MessageMutation) ClearedFields ¶
func (m *MessageMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (MessageMutation) Client ¶
func (m MessageMutation) 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 (*MessageMutation) CreatedAt ¶
func (m *MessageMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*MessageMutation) EdgeCleared ¶
func (m *MessageMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*MessageMutation) Field ¶
func (m *MessageMutation) 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 (*MessageMutation) FieldCleared ¶
func (m *MessageMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*MessageMutation) Fields ¶
func (m *MessageMutation) 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 (*MessageMutation) FromCleared ¶
func (m *MessageMutation) FromCleared() bool
FromCleared reports if the "from" edge to the Message entity was cleared.
func (*MessageMutation) FromIDs ¶
func (m *MessageMutation) FromIDs() (ids []uuid.UUID)
FromIDs returns the "from" edge IDs in the mutation.
func (*MessageMutation) ID ¶
func (m *MessageMutation) ID() (id uuid.UUID, 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 (*MessageMutation) IDs ¶
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 (*MessageMutation) OldBody ¶
func (m *MessageMutation) OldBody(ctx context.Context) (v string, err error)
OldBody returns the old "body" field's value of the Message entity. If the Message 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 (*MessageMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Message entity. If the Message 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 (*MessageMutation) 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 (*MessageMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Message entity. If the Message 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 (*MessageMutation) RemoveFromIDs ¶
func (m *MessageMutation) RemoveFromIDs(ids ...uuid.UUID)
RemoveFromIDs removes the "from" edge to the Message entity by IDs.
func (*MessageMutation) RemoveToIDs ¶
func (m *MessageMutation) RemoveToIDs(ids ...uuid.UUID)
RemoveToIDs removes the "to" edge to the Message entity by IDs.
func (*MessageMutation) RemovedEdges ¶
func (m *MessageMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*MessageMutation) RemovedFromIDs ¶
func (m *MessageMutation) RemovedFromIDs() (ids []uuid.UUID)
RemovedFrom returns the removed IDs of the "from" edge to the Message entity.
func (*MessageMutation) RemovedIDs ¶
func (m *MessageMutation) 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 (*MessageMutation) RemovedToIDs ¶
func (m *MessageMutation) RemovedToIDs() (ids []uuid.UUID)
RemovedTo returns the removed IDs of the "to" edge to the Message entity.
func (*MessageMutation) ResetBody ¶
func (m *MessageMutation) ResetBody()
ResetBody resets all changes to the "body" field.
func (*MessageMutation) ResetCreatedAt ¶
func (m *MessageMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*MessageMutation) ResetEdge ¶
func (m *MessageMutation) 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 (*MessageMutation) ResetField ¶
func (m *MessageMutation) 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 (*MessageMutation) ResetFrom ¶
func (m *MessageMutation) ResetFrom()
ResetFrom resets all changes to the "from" edge.
func (*MessageMutation) ResetTo ¶
func (m *MessageMutation) ResetTo()
ResetTo resets all changes to the "to" edge.
func (*MessageMutation) ResetUpdatedAt ¶
func (m *MessageMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*MessageMutation) SetBody ¶
func (m *MessageMutation) SetBody(s string)
SetBody sets the "body" field.
func (*MessageMutation) SetCreatedAt ¶
func (m *MessageMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*MessageMutation) SetField ¶
func (m *MessageMutation) 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 (*MessageMutation) SetID ¶
func (m *MessageMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Message entities.
func (*MessageMutation) SetOp ¶
func (m *MessageMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*MessageMutation) SetUpdatedAt ¶
func (m *MessageMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*MessageMutation) ToCleared ¶
func (m *MessageMutation) ToCleared() bool
ToCleared reports if the "to" edge to the Message entity was cleared.
func (*MessageMutation) ToIDs ¶
func (m *MessageMutation) ToIDs() (ids []uuid.UUID)
ToIDs returns the "to" edge IDs in the mutation.
func (MessageMutation) Tx ¶
func (m MessageMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*MessageMutation) Type ¶
func (m *MessageMutation) Type() string
Type returns the node type of this mutation (Message).
func (*MessageMutation) UpdatedAt ¶
func (m *MessageMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*MessageMutation) Where ¶
func (m *MessageMutation) Where(ps ...predicate.Message)
Where appends a list predicates to the MessageMutation builder.
func (*MessageMutation) WhereP ¶
func (m *MessageMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the MessageMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type MessageOrder ¶
type MessageOrder struct { Direction OrderDirection `json:"direction"` Field *MessageOrderField `json:"field"` }
MessageOrder defines the ordering of Message.
type MessageOrderField ¶
type MessageOrderField struct { // Value extracts the ordering value from the given Message. Value func(*Message) (ent.Value, error) // contains filtered or unexported fields }
MessageOrderField defines the ordering field of Message.
type MessagePaginateOption ¶
type MessagePaginateOption func(*messagePager) error
MessagePaginateOption enables pagination customization.
func WithMessageFilter ¶
func WithMessageFilter(filter func(*MessageQuery) (*MessageQuery, error)) MessagePaginateOption
WithMessageFilter configures pagination filter.
func WithMessageOrder ¶
func WithMessageOrder(order *MessageOrder) MessagePaginateOption
WithMessageOrder configures pagination ordering.
type MessageQuery ¶
type MessageQuery struct {
// contains filtered or unexported fields
}
MessageQuery is the builder for querying Message entities.
func (*MessageQuery) Aggregate ¶
func (mq *MessageQuery) Aggregate(fns ...AggregateFunc) *MessageSelect
Aggregate returns a MessageSelect configured with the given aggregations.
func (*MessageQuery) All ¶
func (mq *MessageQuery) All(ctx context.Context) ([]*Message, error)
All executes the query and returns a list of Messages.
func (*MessageQuery) AllX ¶
func (mq *MessageQuery) AllX(ctx context.Context) []*Message
AllX is like All, but panics if an error occurs.
func (*MessageQuery) Clone ¶
func (mq *MessageQuery) Clone() *MessageQuery
Clone returns a duplicate of the MessageQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*MessageQuery) CollectFields ¶
func (m *MessageQuery) CollectFields(ctx context.Context, satisfies ...string) (*MessageQuery, error)
CollectFields tells the query-builder to eagerly load connected nodes by resolver context.
func (*MessageQuery) Count ¶
func (mq *MessageQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*MessageQuery) CountX ¶
func (mq *MessageQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*MessageQuery) Exist ¶
func (mq *MessageQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*MessageQuery) ExistX ¶
func (mq *MessageQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*MessageQuery) First ¶
func (mq *MessageQuery) First(ctx context.Context) (*Message, error)
First returns the first Message entity from the query. Returns a *NotFoundError when no Message was found.
func (*MessageQuery) FirstID ¶
FirstID returns the first Message ID from the query. Returns a *NotFoundError when no Message ID was found.
func (*MessageQuery) FirstIDX ¶
func (mq *MessageQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*MessageQuery) FirstX ¶
func (mq *MessageQuery) FirstX(ctx context.Context) *Message
FirstX is like First, but panics if an error occurs.
func (*MessageQuery) GroupBy ¶
func (mq *MessageQuery) GroupBy(field string, fields ...string) *MessageGroupBy
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.Message.Query(). GroupBy(message.FieldCreatedAt). Aggregate(internal.Count()). Scan(ctx, &v)
func (*MessageQuery) IDsX ¶
func (mq *MessageQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*MessageQuery) Limit ¶
func (mq *MessageQuery) Limit(limit int) *MessageQuery
Limit the number of records to be returned by this query.
func (*MessageQuery) Offset ¶
func (mq *MessageQuery) Offset(offset int) *MessageQuery
Offset to start from.
func (*MessageQuery) Only ¶
func (mq *MessageQuery) Only(ctx context.Context) (*Message, error)
Only returns a single Message entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Message entity is found. Returns a *NotFoundError when no Message entities are found.
func (*MessageQuery) OnlyID ¶
OnlyID is like Only, but returns the only Message ID in the query. Returns a *NotSingularError when more than one Message ID is found. Returns a *NotFoundError when no entities are found.
func (*MessageQuery) OnlyIDX ¶
func (mq *MessageQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*MessageQuery) OnlyX ¶
func (mq *MessageQuery) OnlyX(ctx context.Context) *Message
OnlyX is like Only, but panics if an error occurs.
func (*MessageQuery) Order ¶
func (mq *MessageQuery) Order(o ...message.OrderOption) *MessageQuery
Order specifies how the records should be ordered.
func (*MessageQuery) Paginate ¶
func (m *MessageQuery) Paginate( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, opts ...MessagePaginateOption, ) (*MessageConnection, error)
Paginate executes the query and returns a relay based cursor connection to Message.
func (*MessageQuery) QueryFrom ¶
func (mq *MessageQuery) QueryFrom() *MessageQuery
QueryFrom chains the current query on the "from" edge.
func (*MessageQuery) QueryTo ¶
func (mq *MessageQuery) QueryTo() *MessageQuery
QueryTo chains the current query on the "to" edge.
func (*MessageQuery) Select ¶
func (mq *MessageQuery) Select(fields ...string) *MessageSelect
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.Message.Query(). Select(message.FieldCreatedAt). Scan(ctx, &v)
func (*MessageQuery) Unique ¶
func (mq *MessageQuery) Unique(unique bool) *MessageQuery
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 (*MessageQuery) Where ¶
func (mq *MessageQuery) Where(ps ...predicate.Message) *MessageQuery
Where adds a new predicate for the MessageQuery builder.
func (*MessageQuery) WithFrom ¶
func (mq *MessageQuery) WithFrom(opts ...func(*MessageQuery)) *MessageQuery
WithFrom tells the query-builder to eager-load the nodes that are connected to the "from" edge. The optional arguments are used to configure the query builder of the edge.
func (*MessageQuery) WithNamedFrom ¶
func (mq *MessageQuery) WithNamedFrom(name string, opts ...func(*MessageQuery)) *MessageQuery
WithNamedFrom tells the query-builder to eager-load the nodes that are connected to the "from" edge with the given name. The optional arguments are used to configure the query builder of the edge.
func (*MessageQuery) WithNamedTo ¶
func (mq *MessageQuery) WithNamedTo(name string, opts ...func(*MessageQuery)) *MessageQuery
WithNamedTo tells the query-builder to eager-load the nodes that are connected to the "to" edge with the given name. The optional arguments are used to configure the query builder of the edge.
func (*MessageQuery) WithTo ¶
func (mq *MessageQuery) WithTo(opts ...func(*MessageQuery)) *MessageQuery
WithTo tells the query-builder to eager-load the nodes that are connected to the "to" edge. The optional arguments are used to configure the query builder of the edge.
type MessageSelect ¶
type MessageSelect struct { *MessageQuery // contains filtered or unexported fields }
MessageSelect is the builder for selecting fields of Message entities.
func (*MessageSelect) Aggregate ¶
func (ms *MessageSelect) Aggregate(fns ...AggregateFunc) *MessageSelect
Aggregate adds the given aggregation functions to the selector query.
func (*MessageSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*MessageSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*MessageSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*MessageSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*MessageSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*MessageSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*MessageSelect) Scan ¶
func (ms *MessageSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*MessageSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type MessageUpdate ¶
type MessageUpdate struct {
// contains filtered or unexported fields
}
MessageUpdate is the builder for updating Message entities.
func (*MessageUpdate) AddFrom ¶
func (mu *MessageUpdate) AddFrom(m ...*Message) *MessageUpdate
AddFrom adds the "from" edges to the Message entity.
func (*MessageUpdate) AddFromIDs ¶
func (mu *MessageUpdate) AddFromIDs(ids ...uuid.UUID) *MessageUpdate
AddFromIDs adds the "from" edge to the Message entity by IDs.
func (*MessageUpdate) AddTo ¶
func (mu *MessageUpdate) AddTo(m ...*Message) *MessageUpdate
AddTo adds the "to" edges to the Message entity.
func (*MessageUpdate) AddToIDs ¶
func (mu *MessageUpdate) AddToIDs(ids ...uuid.UUID) *MessageUpdate
AddToIDs adds the "to" edge to the Message entity by IDs.
func (*MessageUpdate) ClearFrom ¶
func (mu *MessageUpdate) ClearFrom() *MessageUpdate
ClearFrom clears all "from" edges to the Message entity.
func (*MessageUpdate) ClearTo ¶
func (mu *MessageUpdate) ClearTo() *MessageUpdate
ClearTo clears all "to" edges to the Message entity.
func (*MessageUpdate) Exec ¶
func (mu *MessageUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*MessageUpdate) ExecX ¶
func (mu *MessageUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MessageUpdate) Mutation ¶
func (mu *MessageUpdate) Mutation() *MessageMutation
Mutation returns the MessageMutation object of the builder.
func (*MessageUpdate) RemoveFrom ¶
func (mu *MessageUpdate) RemoveFrom(m ...*Message) *MessageUpdate
RemoveFrom removes "from" edges to Message entities.
func (*MessageUpdate) RemoveFromIDs ¶
func (mu *MessageUpdate) RemoveFromIDs(ids ...uuid.UUID) *MessageUpdate
RemoveFromIDs removes the "from" edge to Message entities by IDs.
func (*MessageUpdate) RemoveTo ¶
func (mu *MessageUpdate) RemoveTo(m ...*Message) *MessageUpdate
RemoveTo removes "to" edges to Message entities.
func (*MessageUpdate) RemoveToIDs ¶
func (mu *MessageUpdate) RemoveToIDs(ids ...uuid.UUID) *MessageUpdate
RemoveToIDs removes the "to" edge to Message entities by IDs.
func (*MessageUpdate) Save ¶
func (mu *MessageUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*MessageUpdate) SaveX ¶
func (mu *MessageUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*MessageUpdate) SetBody ¶
func (mu *MessageUpdate) SetBody(s string) *MessageUpdate
SetBody sets the "body" field.
func (*MessageUpdate) SetUpdatedAt ¶
func (mu *MessageUpdate) SetUpdatedAt(t time.Time) *MessageUpdate
SetUpdatedAt sets the "updated_at" field.
func (*MessageUpdate) Where ¶
func (mu *MessageUpdate) Where(ps ...predicate.Message) *MessageUpdate
Where appends a list predicates to the MessageUpdate builder.
type MessageUpdateOne ¶
type MessageUpdateOne struct {
// contains filtered or unexported fields
}
MessageUpdateOne is the builder for updating a single Message entity.
func (*MessageUpdateOne) AddFrom ¶
func (muo *MessageUpdateOne) AddFrom(m ...*Message) *MessageUpdateOne
AddFrom adds the "from" edges to the Message entity.
func (*MessageUpdateOne) AddFromIDs ¶
func (muo *MessageUpdateOne) AddFromIDs(ids ...uuid.UUID) *MessageUpdateOne
AddFromIDs adds the "from" edge to the Message entity by IDs.
func (*MessageUpdateOne) AddTo ¶
func (muo *MessageUpdateOne) AddTo(m ...*Message) *MessageUpdateOne
AddTo adds the "to" edges to the Message entity.
func (*MessageUpdateOne) AddToIDs ¶
func (muo *MessageUpdateOne) AddToIDs(ids ...uuid.UUID) *MessageUpdateOne
AddToIDs adds the "to" edge to the Message entity by IDs.
func (*MessageUpdateOne) ClearFrom ¶
func (muo *MessageUpdateOne) ClearFrom() *MessageUpdateOne
ClearFrom clears all "from" edges to the Message entity.
func (*MessageUpdateOne) ClearTo ¶
func (muo *MessageUpdateOne) ClearTo() *MessageUpdateOne
ClearTo clears all "to" edges to the Message entity.
func (*MessageUpdateOne) Exec ¶
func (muo *MessageUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*MessageUpdateOne) ExecX ¶
func (muo *MessageUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MessageUpdateOne) Mutation ¶
func (muo *MessageUpdateOne) Mutation() *MessageMutation
Mutation returns the MessageMutation object of the builder.
func (*MessageUpdateOne) RemoveFrom ¶
func (muo *MessageUpdateOne) RemoveFrom(m ...*Message) *MessageUpdateOne
RemoveFrom removes "from" edges to Message entities.
func (*MessageUpdateOne) RemoveFromIDs ¶
func (muo *MessageUpdateOne) RemoveFromIDs(ids ...uuid.UUID) *MessageUpdateOne
RemoveFromIDs removes the "from" edge to Message entities by IDs.
func (*MessageUpdateOne) RemoveTo ¶
func (muo *MessageUpdateOne) RemoveTo(m ...*Message) *MessageUpdateOne
RemoveTo removes "to" edges to Message entities.
func (*MessageUpdateOne) RemoveToIDs ¶
func (muo *MessageUpdateOne) RemoveToIDs(ids ...uuid.UUID) *MessageUpdateOne
RemoveToIDs removes the "to" edge to Message entities by IDs.
func (*MessageUpdateOne) Save ¶
func (muo *MessageUpdateOne) Save(ctx context.Context) (*Message, error)
Save executes the query and returns the updated Message entity.
func (*MessageUpdateOne) SaveX ¶
func (muo *MessageUpdateOne) SaveX(ctx context.Context) *Message
SaveX is like Save, but panics if an error occurs.
func (*MessageUpdateOne) Select ¶
func (muo *MessageUpdateOne) Select(field string, fields ...string) *MessageUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*MessageUpdateOne) SetBody ¶
func (muo *MessageUpdateOne) SetBody(s string) *MessageUpdateOne
SetBody sets the "body" field.
func (*MessageUpdateOne) SetUpdatedAt ¶
func (muo *MessageUpdateOne) SetUpdatedAt(t time.Time) *MessageUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*MessageUpdateOne) Where ¶
func (muo *MessageUpdateOne) Where(ps ...predicate.Message) *MessageUpdateOne
Where appends a list predicates to the MessageUpdate builder.
type MessageWhereInput ¶
type MessageWhereInput struct { Predicates []predicate.Message `json:"-"` Not *MessageWhereInput `json:"not,omitempty"` Or []*MessageWhereInput `json:"or,omitempty"` And []*MessageWhereInput `json:"and,omitempty"` // "id" field predicates. ID *uuid.UUID `json:"id,omitempty"` IDNEQ *uuid.UUID `json:"idNEQ,omitempty"` IDIn []uuid.UUID `json:"idIn,omitempty"` IDNotIn []uuid.UUID `json:"idNotIn,omitempty"` IDGT *uuid.UUID `json:"idGT,omitempty"` IDGTE *uuid.UUID `json:"idGTE,omitempty"` IDLT *uuid.UUID `json:"idLT,omitempty"` IDLTE *uuid.UUID `json:"idLTE,omitempty"` // "created_at" field predicates. CreatedAt *time.Time `json:"createdAt,omitempty"` CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` // "updated_at" field predicates. UpdatedAt *time.Time `json:"updatedAt,omitempty"` UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` // "body" field predicates. Body *string `json:"body,omitempty"` BodyNEQ *string `json:"bodyNEQ,omitempty"` BodyIn []string `json:"bodyIn,omitempty"` BodyNotIn []string `json:"bodyNotIn,omitempty"` BodyGT *string `json:"bodyGT,omitempty"` BodyGTE *string `json:"bodyGTE,omitempty"` BodyLT *string `json:"bodyLT,omitempty"` BodyLTE *string `json:"bodyLTE,omitempty"` BodyContains *string `json:"bodyContains,omitempty"` BodyHasPrefix *string `json:"bodyHasPrefix,omitempty"` BodyHasSuffix *string `json:"bodyHasSuffix,omitempty"` BodyEqualFold *string `json:"bodyEqualFold,omitempty"` BodyContainsFold *string `json:"bodyContainsFold,omitempty"` // "from" edge predicates. HasFrom *bool `json:"hasFrom,omitempty"` HasFromWith []*MessageWhereInput `json:"hasFromWith,omitempty"` // "to" edge predicates. HasTo *bool `json:"hasTo,omitempty"` HasToWith []*MessageWhereInput `json:"hasToWith,omitempty"` }
MessageWhereInput represents a where input for filtering Message queries.
func (*MessageWhereInput) AddPredicates ¶
func (i *MessageWhereInput) AddPredicates(predicates ...predicate.Message)
AddPredicates adds custom predicates to the where input to be used during the filtering phase.
func (*MessageWhereInput) Filter ¶
func (i *MessageWhereInput) Filter(q *MessageQuery) (*MessageQuery, error)
Filter applies the MessageWhereInput filter on the MessageQuery builder.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type Node ¶
type Node struct { ID uuid.UUID `json:"id,omitempty"` // node id. Type string `json:"type,omitempty"` // node type. Fields []*Field `json:"fields,omitempty"` // node fields. Edges []*Edge `json:"edges,omitempty"` // node edges. }
Node in the graph.
type NodeOption ¶
type NodeOption func(*nodeOptions)
NodeOption allows configuring the Noder execution using functional options.
func WithFixedNodeType ¶
func WithFixedNodeType(t string) NodeOption
WithFixedNodeType sets the Type of the node to a fixed value.
func WithNodeType ¶
WithNodeType sets the node Type resolver function (i.e. the table to query). If was not provided, the table will be derived from the universal-id configuration as described in: https://entgo.io/docs/migrate/#universal-ids.
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 Notification ¶
type Notification struct { // ID of the ent. ID uuid.UUID `json:"id,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"` // contains filtered or unexported fields }
Notification is the model entity for the Notification schema.
func (*Notification) IsNode ¶
func (n *Notification) IsNode()
IsNode implements the Node interface check for GQLGen.
func (*Notification) Node ¶
func (n *Notification) Node(ctx context.Context) (node *Node, err error)
Node implements Noder interface
func (*Notification) String ¶
func (n *Notification) String() string
String implements the fmt.Stringer.
func (*Notification) ToEdge ¶
func (n *Notification) ToEdge(order *NotificationOrder) *NotificationEdge
ToEdge converts Notification into NotificationEdge.
func (*Notification) Unwrap ¶
func (n *Notification) Unwrap() *Notification
Unwrap unwraps the Notification 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 (*Notification) Update ¶
func (n *Notification) Update() *NotificationUpdateOne
Update returns a builder for updating this Notification. Note that you need to call Notification.Unwrap() before calling this method if this Notification was returned from a transaction, and the transaction was committed or rolled back.
type NotificationClient ¶
type NotificationClient struct {
// contains filtered or unexported fields
}
NotificationClient is a client for the Notification schema.
func NewNotificationClient ¶
func NewNotificationClient(c config) *NotificationClient
NewNotificationClient returns a client for the Notification from the given config.
func (*NotificationClient) Create ¶
func (c *NotificationClient) Create() *NotificationCreate
Create returns a builder for creating a Notification entity.
func (*NotificationClient) CreateBulk ¶
func (c *NotificationClient) CreateBulk(builders ...*NotificationCreate) *NotificationCreateBulk
CreateBulk returns a builder for creating a bulk of Notification entities.
func (*NotificationClient) Delete ¶
func (c *NotificationClient) Delete() *NotificationDelete
Delete returns a delete builder for Notification.
func (*NotificationClient) DeleteOne ¶
func (c *NotificationClient) DeleteOne(n *Notification) *NotificationDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*NotificationClient) DeleteOneID ¶
func (c *NotificationClient) DeleteOneID(id uuid.UUID) *NotificationDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*NotificationClient) Get ¶
func (c *NotificationClient) Get(ctx context.Context, id uuid.UUID) (*Notification, error)
Get returns a Notification entity by its id.
func (*NotificationClient) GetX ¶
func (c *NotificationClient) GetX(ctx context.Context, id uuid.UUID) *Notification
GetX is like Get, but panics if an error occurs.
func (*NotificationClient) Hooks ¶
func (c *NotificationClient) Hooks() []Hook
Hooks returns the client hooks.
func (*NotificationClient) Intercept ¶
func (c *NotificationClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `notification.Intercept(f(g(h())))`.
func (*NotificationClient) Interceptors ¶
func (c *NotificationClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*NotificationClient) Query ¶
func (c *NotificationClient) Query() *NotificationQuery
Query returns a query builder for Notification.
func (*NotificationClient) Update ¶
func (c *NotificationClient) Update() *NotificationUpdate
Update returns an update builder for Notification.
func (*NotificationClient) UpdateOne ¶
func (c *NotificationClient) UpdateOne(n *Notification) *NotificationUpdateOne
UpdateOne returns an update builder for the given entity.
func (*NotificationClient) UpdateOneID ¶
func (c *NotificationClient) UpdateOneID(id uuid.UUID) *NotificationUpdateOne
UpdateOneID returns an update builder for the given id.
func (*NotificationClient) Use ¶
func (c *NotificationClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `notification.Hooks(f(g(h())))`.
type NotificationConnection ¶
type NotificationConnection struct { Edges []*NotificationEdge `json:"edges"` PageInfo PageInfo `json:"pageInfo"` TotalCount int `json:"totalCount"` }
NotificationConnection is the connection containing edges to Notification.
type NotificationCreate ¶
type NotificationCreate struct {
// contains filtered or unexported fields
}
NotificationCreate is the builder for creating a Notification entity.
func (*NotificationCreate) Exec ¶
func (nc *NotificationCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*NotificationCreate) ExecX ¶
func (nc *NotificationCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NotificationCreate) Mutation ¶
func (nc *NotificationCreate) Mutation() *NotificationMutation
Mutation returns the NotificationMutation object of the builder.
func (*NotificationCreate) Save ¶
func (nc *NotificationCreate) Save(ctx context.Context) (*Notification, error)
Save creates the Notification in the database.
func (*NotificationCreate) SaveX ¶
func (nc *NotificationCreate) SaveX(ctx context.Context) *Notification
SaveX calls Save and panics if Save returns an error.
func (*NotificationCreate) SetCreatedAt ¶
func (nc *NotificationCreate) SetCreatedAt(t time.Time) *NotificationCreate
SetCreatedAt sets the "created_at" field.
func (*NotificationCreate) SetID ¶
func (nc *NotificationCreate) SetID(u uuid.UUID) *NotificationCreate
SetID sets the "id" field.
func (*NotificationCreate) SetNillableCreatedAt ¶
func (nc *NotificationCreate) SetNillableCreatedAt(t *time.Time) *NotificationCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*NotificationCreate) SetNillableID ¶
func (nc *NotificationCreate) SetNillableID(u *uuid.UUID) *NotificationCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*NotificationCreate) SetNillableUpdatedAt ¶
func (nc *NotificationCreate) SetNillableUpdatedAt(t *time.Time) *NotificationCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*NotificationCreate) SetUpdatedAt ¶
func (nc *NotificationCreate) SetUpdatedAt(t time.Time) *NotificationCreate
SetUpdatedAt sets the "updated_at" field.
type NotificationCreateBulk ¶
type NotificationCreateBulk struct {
// contains filtered or unexported fields
}
NotificationCreateBulk is the builder for creating many Notification entities in bulk.
func (*NotificationCreateBulk) Exec ¶
func (ncb *NotificationCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*NotificationCreateBulk) ExecX ¶
func (ncb *NotificationCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NotificationCreateBulk) Save ¶
func (ncb *NotificationCreateBulk) Save(ctx context.Context) ([]*Notification, error)
Save creates the Notification entities in the database.
func (*NotificationCreateBulk) SaveX ¶
func (ncb *NotificationCreateBulk) SaveX(ctx context.Context) []*Notification
SaveX is like Save, but panics if an error occurs.
type NotificationDelete ¶
type NotificationDelete struct {
// contains filtered or unexported fields
}
NotificationDelete is the builder for deleting a Notification entity.
func (*NotificationDelete) Exec ¶
func (nd *NotificationDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*NotificationDelete) ExecX ¶
func (nd *NotificationDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*NotificationDelete) Where ¶
func (nd *NotificationDelete) Where(ps ...predicate.Notification) *NotificationDelete
Where appends a list predicates to the NotificationDelete builder.
type NotificationDeleteOne ¶
type NotificationDeleteOne struct {
// contains filtered or unexported fields
}
NotificationDeleteOne is the builder for deleting a single Notification entity.
func (*NotificationDeleteOne) Exec ¶
func (ndo *NotificationDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*NotificationDeleteOne) ExecX ¶
func (ndo *NotificationDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NotificationDeleteOne) Where ¶
func (ndo *NotificationDeleteOne) Where(ps ...predicate.Notification) *NotificationDeleteOne
Where appends a list predicates to the NotificationDelete builder.
type NotificationEdge ¶
type NotificationEdge struct { Node *Notification `json:"node"` Cursor Cursor `json:"cursor"` }
NotificationEdge is the edge representation of Notification.
type NotificationGroupBy ¶
type NotificationGroupBy struct {
// contains filtered or unexported fields
}
NotificationGroupBy is the group-by builder for Notification entities.
func (*NotificationGroupBy) Aggregate ¶
func (ngb *NotificationGroupBy) Aggregate(fns ...AggregateFunc) *NotificationGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*NotificationGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*NotificationGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*NotificationGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*NotificationGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*NotificationGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*NotificationGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*NotificationGroupBy) Scan ¶
func (ngb *NotificationGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*NotificationGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type NotificationMutation ¶
type NotificationMutation struct {
// contains filtered or unexported fields
}
NotificationMutation represents an operation that mutates the Notification nodes in the graph.
func (*NotificationMutation) AddField ¶
func (m *NotificationMutation) 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 (*NotificationMutation) AddedEdges ¶
func (m *NotificationMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*NotificationMutation) AddedField ¶
func (m *NotificationMutation) 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 (*NotificationMutation) AddedFields ¶
func (m *NotificationMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*NotificationMutation) AddedIDs ¶
func (m *NotificationMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*NotificationMutation) ClearEdge ¶
func (m *NotificationMutation) 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 (*NotificationMutation) ClearField ¶
func (m *NotificationMutation) 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 (*NotificationMutation) ClearedEdges ¶
func (m *NotificationMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*NotificationMutation) ClearedFields ¶
func (m *NotificationMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (NotificationMutation) Client ¶
func (m NotificationMutation) 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 (*NotificationMutation) CreatedAt ¶
func (m *NotificationMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*NotificationMutation) EdgeCleared ¶
func (m *NotificationMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*NotificationMutation) Field ¶
func (m *NotificationMutation) 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 (*NotificationMutation) FieldCleared ¶
func (m *NotificationMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*NotificationMutation) Fields ¶
func (m *NotificationMutation) 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 (*NotificationMutation) ID ¶
func (m *NotificationMutation) ID() (id uuid.UUID, 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 (*NotificationMutation) IDs ¶
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 (*NotificationMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Notification entity. If the Notification 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 (*NotificationMutation) 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 (*NotificationMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Notification entity. If the Notification 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 (*NotificationMutation) Op ¶
func (m *NotificationMutation) Op() Op
Op returns the operation name.
func (*NotificationMutation) RemovedEdges ¶
func (m *NotificationMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*NotificationMutation) RemovedIDs ¶
func (m *NotificationMutation) 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 (*NotificationMutation) ResetCreatedAt ¶
func (m *NotificationMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*NotificationMutation) ResetEdge ¶
func (m *NotificationMutation) 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 (*NotificationMutation) ResetField ¶
func (m *NotificationMutation) 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 (*NotificationMutation) ResetUpdatedAt ¶
func (m *NotificationMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*NotificationMutation) SetCreatedAt ¶
func (m *NotificationMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*NotificationMutation) SetField ¶
func (m *NotificationMutation) 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 (*NotificationMutation) SetID ¶
func (m *NotificationMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Notification entities.
func (*NotificationMutation) SetOp ¶
func (m *NotificationMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*NotificationMutation) SetUpdatedAt ¶
func (m *NotificationMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (NotificationMutation) Tx ¶
func (m NotificationMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*NotificationMutation) Type ¶
func (m *NotificationMutation) Type() string
Type returns the node type of this mutation (Notification).
func (*NotificationMutation) UpdatedAt ¶
func (m *NotificationMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*NotificationMutation) Where ¶
func (m *NotificationMutation) Where(ps ...predicate.Notification)
Where appends a list predicates to the NotificationMutation builder.
func (*NotificationMutation) WhereP ¶
func (m *NotificationMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the NotificationMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type NotificationOrder ¶
type NotificationOrder struct { Direction OrderDirection `json:"direction"` Field *NotificationOrderField `json:"field"` }
NotificationOrder defines the ordering of Notification.
type NotificationOrderField ¶
type NotificationOrderField struct { // Value extracts the ordering value from the given Notification. Value func(*Notification) (ent.Value, error) // contains filtered or unexported fields }
NotificationOrderField defines the ordering field of Notification.
type NotificationPaginateOption ¶
type NotificationPaginateOption func(*notificationPager) error
NotificationPaginateOption enables pagination customization.
func WithNotificationFilter ¶
func WithNotificationFilter(filter func(*NotificationQuery) (*NotificationQuery, error)) NotificationPaginateOption
WithNotificationFilter configures pagination filter.
func WithNotificationOrder ¶
func WithNotificationOrder(order *NotificationOrder) NotificationPaginateOption
WithNotificationOrder configures pagination ordering.
type NotificationQuery ¶
type NotificationQuery struct {
// contains filtered or unexported fields
}
NotificationQuery is the builder for querying Notification entities.
func (*NotificationQuery) Aggregate ¶
func (nq *NotificationQuery) Aggregate(fns ...AggregateFunc) *NotificationSelect
Aggregate returns a NotificationSelect configured with the given aggregations.
func (*NotificationQuery) All ¶
func (nq *NotificationQuery) All(ctx context.Context) ([]*Notification, error)
All executes the query and returns a list of Notifications.
func (*NotificationQuery) AllX ¶
func (nq *NotificationQuery) AllX(ctx context.Context) []*Notification
AllX is like All, but panics if an error occurs.
func (*NotificationQuery) Clone ¶
func (nq *NotificationQuery) Clone() *NotificationQuery
Clone returns a duplicate of the NotificationQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*NotificationQuery) CollectFields ¶
func (n *NotificationQuery) CollectFields(ctx context.Context, satisfies ...string) (*NotificationQuery, error)
CollectFields tells the query-builder to eagerly load connected nodes by resolver context.
func (*NotificationQuery) Count ¶
func (nq *NotificationQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*NotificationQuery) CountX ¶
func (nq *NotificationQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*NotificationQuery) Exist ¶
func (nq *NotificationQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*NotificationQuery) ExistX ¶
func (nq *NotificationQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*NotificationQuery) First ¶
func (nq *NotificationQuery) First(ctx context.Context) (*Notification, error)
First returns the first Notification entity from the query. Returns a *NotFoundError when no Notification was found.
func (*NotificationQuery) FirstID ¶
FirstID returns the first Notification ID from the query. Returns a *NotFoundError when no Notification ID was found.
func (*NotificationQuery) FirstIDX ¶
func (nq *NotificationQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*NotificationQuery) FirstX ¶
func (nq *NotificationQuery) FirstX(ctx context.Context) *Notification
FirstX is like First, but panics if an error occurs.
func (*NotificationQuery) GroupBy ¶
func (nq *NotificationQuery) GroupBy(field string, fields ...string) *NotificationGroupBy
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.Notification.Query(). GroupBy(notification.FieldCreatedAt). Aggregate(internal.Count()). Scan(ctx, &v)
func (*NotificationQuery) IDsX ¶
func (nq *NotificationQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*NotificationQuery) Limit ¶
func (nq *NotificationQuery) Limit(limit int) *NotificationQuery
Limit the number of records to be returned by this query.
func (*NotificationQuery) Offset ¶
func (nq *NotificationQuery) Offset(offset int) *NotificationQuery
Offset to start from.
func (*NotificationQuery) Only ¶
func (nq *NotificationQuery) Only(ctx context.Context) (*Notification, error)
Only returns a single Notification entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Notification entity is found. Returns a *NotFoundError when no Notification entities are found.
func (*NotificationQuery) OnlyID ¶
OnlyID is like Only, but returns the only Notification ID in the query. Returns a *NotSingularError when more than one Notification ID is found. Returns a *NotFoundError when no entities are found.
func (*NotificationQuery) OnlyIDX ¶
func (nq *NotificationQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*NotificationQuery) OnlyX ¶
func (nq *NotificationQuery) OnlyX(ctx context.Context) *Notification
OnlyX is like Only, but panics if an error occurs.
func (*NotificationQuery) Order ¶
func (nq *NotificationQuery) Order(o ...notification.OrderOption) *NotificationQuery
Order specifies how the records should be ordered.
func (*NotificationQuery) Paginate ¶
func (n *NotificationQuery) Paginate( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, opts ...NotificationPaginateOption, ) (*NotificationConnection, error)
Paginate executes the query and returns a relay based cursor connection to Notification.
func (*NotificationQuery) Select ¶
func (nq *NotificationQuery) Select(fields ...string) *NotificationSelect
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.Notification.Query(). Select(notification.FieldCreatedAt). Scan(ctx, &v)
func (*NotificationQuery) Unique ¶
func (nq *NotificationQuery) Unique(unique bool) *NotificationQuery
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 (*NotificationQuery) Where ¶
func (nq *NotificationQuery) Where(ps ...predicate.Notification) *NotificationQuery
Where adds a new predicate for the NotificationQuery builder.
type NotificationSelect ¶
type NotificationSelect struct { *NotificationQuery // contains filtered or unexported fields }
NotificationSelect is the builder for selecting fields of Notification entities.
func (*NotificationSelect) Aggregate ¶
func (ns *NotificationSelect) Aggregate(fns ...AggregateFunc) *NotificationSelect
Aggregate adds the given aggregation functions to the selector query.
func (*NotificationSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*NotificationSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*NotificationSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*NotificationSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*NotificationSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*NotificationSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*NotificationSelect) Scan ¶
func (ns *NotificationSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*NotificationSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type NotificationUpdate ¶
type NotificationUpdate struct {
// contains filtered or unexported fields
}
NotificationUpdate is the builder for updating Notification entities.
func (*NotificationUpdate) Exec ¶
func (nu *NotificationUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*NotificationUpdate) ExecX ¶
func (nu *NotificationUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NotificationUpdate) Mutation ¶
func (nu *NotificationUpdate) Mutation() *NotificationMutation
Mutation returns the NotificationMutation object of the builder.
func (*NotificationUpdate) Save ¶
func (nu *NotificationUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*NotificationUpdate) SaveX ¶
func (nu *NotificationUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*NotificationUpdate) SetUpdatedAt ¶
func (nu *NotificationUpdate) SetUpdatedAt(t time.Time) *NotificationUpdate
SetUpdatedAt sets the "updated_at" field.
func (*NotificationUpdate) Where ¶
func (nu *NotificationUpdate) Where(ps ...predicate.Notification) *NotificationUpdate
Where appends a list predicates to the NotificationUpdate builder.
type NotificationUpdateOne ¶
type NotificationUpdateOne struct {
// contains filtered or unexported fields
}
NotificationUpdateOne is the builder for updating a single Notification entity.
func (*NotificationUpdateOne) Exec ¶
func (nuo *NotificationUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*NotificationUpdateOne) ExecX ¶
func (nuo *NotificationUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NotificationUpdateOne) Mutation ¶
func (nuo *NotificationUpdateOne) Mutation() *NotificationMutation
Mutation returns the NotificationMutation object of the builder.
func (*NotificationUpdateOne) Save ¶
func (nuo *NotificationUpdateOne) Save(ctx context.Context) (*Notification, error)
Save executes the query and returns the updated Notification entity.
func (*NotificationUpdateOne) SaveX ¶
func (nuo *NotificationUpdateOne) SaveX(ctx context.Context) *Notification
SaveX is like Save, but panics if an error occurs.
func (*NotificationUpdateOne) Select ¶
func (nuo *NotificationUpdateOne) Select(field string, fields ...string) *NotificationUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*NotificationUpdateOne) SetUpdatedAt ¶
func (nuo *NotificationUpdateOne) SetUpdatedAt(t time.Time) *NotificationUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*NotificationUpdateOne) Where ¶
func (nuo *NotificationUpdateOne) Where(ps ...predicate.Notification) *NotificationUpdateOne
Where appends a list predicates to the NotificationUpdate builder.
type NotificationWhereInput ¶
type NotificationWhereInput struct { Predicates []predicate.Notification `json:"-"` Not *NotificationWhereInput `json:"not,omitempty"` Or []*NotificationWhereInput `json:"or,omitempty"` And []*NotificationWhereInput `json:"and,omitempty"` // "id" field predicates. ID *uuid.UUID `json:"id,omitempty"` IDNEQ *uuid.UUID `json:"idNEQ,omitempty"` IDIn []uuid.UUID `json:"idIn,omitempty"` IDNotIn []uuid.UUID `json:"idNotIn,omitempty"` IDGT *uuid.UUID `json:"idGT,omitempty"` IDGTE *uuid.UUID `json:"idGTE,omitempty"` IDLT *uuid.UUID `json:"idLT,omitempty"` IDLTE *uuid.UUID `json:"idLTE,omitempty"` // "created_at" field predicates. CreatedAt *time.Time `json:"createdAt,omitempty"` CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` // "updated_at" field predicates. UpdatedAt *time.Time `json:"updatedAt,omitempty"` UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` }
NotificationWhereInput represents a where input for filtering Notification queries.
func (*NotificationWhereInput) AddPredicates ¶
func (i *NotificationWhereInput) AddPredicates(predicates ...predicate.Notification)
AddPredicates adds custom predicates to the where input to be used during the filtering phase.
func (*NotificationWhereInput) Filter ¶
func (i *NotificationWhereInput) Filter(q *NotificationQuery) (*NotificationQuery, error)
Filter applies the NotificationWhereInput filter on the NotificationQuery builder.
func (*NotificationWhereInput) P ¶
func (i *NotificationWhereInput) P() (predicate.Notification, error)
P returns a predicate for filtering notifications. An error is returned if the input is empty or invalid.
type Notifications ¶
type Notifications []*Notification
Notifications is a parsable slice of Notification.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type Post ¶
type Post struct { // ID of the ent. ID uuid.UUID `json:"id,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 PostQuery when eager-loading is set. Edges PostEdges `json:"edges"` // contains filtered or unexported fields }
Post is the model entity for the Post schema.
func (*Post) IsNode ¶
func (n *Post) IsNode()
IsNode implements the Node interface check for GQLGen.
func (*Post) Unwrap ¶
Unwrap unwraps the Post 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 (*Post) Update ¶
func (po *Post) Update() *PostUpdateOne
Update returns a builder for updating this Post. Note that you need to call Post.Unwrap() before calling this method if this Post was returned from a transaction, and the transaction was committed or rolled back.
type PostClient ¶
type PostClient struct {
// contains filtered or unexported fields
}
PostClient is a client for the Post schema.
func NewPostClient ¶
func NewPostClient(c config) *PostClient
NewPostClient returns a client for the Post from the given config.
func (*PostClient) Create ¶
func (c *PostClient) Create() *PostCreate
Create returns a builder for creating a Post entity.
func (*PostClient) CreateBulk ¶
func (c *PostClient) CreateBulk(builders ...*PostCreate) *PostCreateBulk
CreateBulk returns a builder for creating a bulk of Post entities.
func (*PostClient) Delete ¶
func (c *PostClient) Delete() *PostDelete
Delete returns a delete builder for Post.
func (*PostClient) DeleteOne ¶
func (c *PostClient) DeleteOne(po *Post) *PostDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*PostClient) DeleteOneID ¶
func (c *PostClient) DeleteOneID(id uuid.UUID) *PostDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*PostClient) Intercept ¶
func (c *PostClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `post.Intercept(f(g(h())))`.
func (*PostClient) Interceptors ¶
func (c *PostClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*PostClient) Query ¶
func (c *PostClient) Query() *PostQuery
Query returns a query builder for Post.
func (*PostClient) QueryUser ¶
func (c *PostClient) QueryUser(po *Post) *UserQuery
QueryUser queries the user edge of a Post.
func (*PostClient) Update ¶
func (c *PostClient) Update() *PostUpdate
Update returns an update builder for Post.
func (*PostClient) UpdateOne ¶
func (c *PostClient) UpdateOne(po *Post) *PostUpdateOne
UpdateOne returns an update builder for the given entity.
func (*PostClient) UpdateOneID ¶
func (c *PostClient) UpdateOneID(id uuid.UUID) *PostUpdateOne
UpdateOneID returns an update builder for the given id.
func (*PostClient) Use ¶
func (c *PostClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `post.Hooks(f(g(h())))`.
type PostConnection ¶
type PostConnection struct { Edges []*PostEdge `json:"edges"` PageInfo PageInfo `json:"pageInfo"` TotalCount int `json:"totalCount"` }
PostConnection is the connection containing edges to Post.
type PostCreate ¶
type PostCreate struct {
// contains filtered or unexported fields
}
PostCreate is the builder for creating a Post entity.
func (*PostCreate) Exec ¶
func (pc *PostCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*PostCreate) ExecX ¶
func (pc *PostCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PostCreate) Mutation ¶
func (pc *PostCreate) Mutation() *PostMutation
Mutation returns the PostMutation object of the builder.
func (*PostCreate) Save ¶
func (pc *PostCreate) Save(ctx context.Context) (*Post, error)
Save creates the Post in the database.
func (*PostCreate) SaveX ¶
func (pc *PostCreate) SaveX(ctx context.Context) *Post
SaveX calls Save and panics if Save returns an error.
func (*PostCreate) SetCreatedAt ¶
func (pc *PostCreate) SetCreatedAt(t time.Time) *PostCreate
SetCreatedAt sets the "created_at" field.
func (*PostCreate) SetID ¶
func (pc *PostCreate) SetID(u uuid.UUID) *PostCreate
SetID sets the "id" field.
func (*PostCreate) SetNillableCreatedAt ¶
func (pc *PostCreate) SetNillableCreatedAt(t *time.Time) *PostCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*PostCreate) SetNillableID ¶
func (pc *PostCreate) SetNillableID(u *uuid.UUID) *PostCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*PostCreate) SetNillableUpdatedAt ¶
func (pc *PostCreate) SetNillableUpdatedAt(t *time.Time) *PostCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*PostCreate) SetNillableUserID ¶
func (pc *PostCreate) SetNillableUserID(id *uuid.UUID) *PostCreate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*PostCreate) SetUpdatedAt ¶
func (pc *PostCreate) SetUpdatedAt(t time.Time) *PostCreate
SetUpdatedAt sets the "updated_at" field.
func (*PostCreate) SetUser ¶
func (pc *PostCreate) SetUser(u *User) *PostCreate
SetUser sets the "user" edge to the User entity.
func (*PostCreate) SetUserID ¶
func (pc *PostCreate) SetUserID(id uuid.UUID) *PostCreate
SetUserID sets the "user" edge to the User entity by ID.
type PostCreateBulk ¶
type PostCreateBulk struct {
// contains filtered or unexported fields
}
PostCreateBulk is the builder for creating many Post entities in bulk.
func (*PostCreateBulk) Exec ¶
func (pcb *PostCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*PostCreateBulk) ExecX ¶
func (pcb *PostCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type PostDelete ¶
type PostDelete struct {
// contains filtered or unexported fields
}
PostDelete is the builder for deleting a Post entity.
func (*PostDelete) Exec ¶
func (pd *PostDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*PostDelete) ExecX ¶
func (pd *PostDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*PostDelete) Where ¶
func (pd *PostDelete) Where(ps ...predicate.Post) *PostDelete
Where appends a list predicates to the PostDelete builder.
type PostDeleteOne ¶
type PostDeleteOne struct {
// contains filtered or unexported fields
}
PostDeleteOne is the builder for deleting a single Post entity.
func (*PostDeleteOne) Exec ¶
func (pdo *PostDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*PostDeleteOne) ExecX ¶
func (pdo *PostDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PostDeleteOne) Where ¶
func (pdo *PostDeleteOne) Where(ps ...predicate.Post) *PostDeleteOne
Where appends a list predicates to the PostDelete builder.
type PostEdges ¶
type PostEdges struct { // User holds the value of the user edge. User *User `json:"user,omitempty"` // contains filtered or unexported fields }
PostEdges holds the relations/edges for other nodes in the graph.
type PostGroupBy ¶
type PostGroupBy struct {
// contains filtered or unexported fields
}
PostGroupBy is the group-by builder for Post entities.
func (*PostGroupBy) Aggregate ¶
func (pgb *PostGroupBy) Aggregate(fns ...AggregateFunc) *PostGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*PostGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PostGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PostGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PostGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PostGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PostGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PostGroupBy) Scan ¶
func (pgb *PostGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PostGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PostMutation ¶
type PostMutation struct {
// contains filtered or unexported fields
}
PostMutation represents an operation that mutates the Post nodes in the graph.
func (*PostMutation) AddField ¶
func (m *PostMutation) 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 (*PostMutation) AddedEdges ¶
func (m *PostMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*PostMutation) AddedField ¶
func (m *PostMutation) 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 (*PostMutation) AddedFields ¶
func (m *PostMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*PostMutation) AddedIDs ¶
func (m *PostMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*PostMutation) ClearEdge ¶
func (m *PostMutation) 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 (*PostMutation) ClearField ¶
func (m *PostMutation) 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 (*PostMutation) ClearUser ¶
func (m *PostMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*PostMutation) ClearedEdges ¶
func (m *PostMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*PostMutation) ClearedFields ¶
func (m *PostMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (PostMutation) Client ¶
func (m PostMutation) 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 (*PostMutation) CreatedAt ¶
func (m *PostMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*PostMutation) EdgeCleared ¶
func (m *PostMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*PostMutation) Field ¶
func (m *PostMutation) 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 (*PostMutation) FieldCleared ¶
func (m *PostMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*PostMutation) Fields ¶
func (m *PostMutation) 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 (*PostMutation) ID ¶
func (m *PostMutation) ID() (id uuid.UUID, 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 (*PostMutation) IDs ¶
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 (*PostMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Post entity. If the Post 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 (*PostMutation) 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 (*PostMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Post entity. If the Post 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 (*PostMutation) RemovedEdges ¶
func (m *PostMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*PostMutation) RemovedIDs ¶
func (m *PostMutation) 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 (*PostMutation) ResetCreatedAt ¶
func (m *PostMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*PostMutation) ResetEdge ¶
func (m *PostMutation) 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 (*PostMutation) ResetField ¶
func (m *PostMutation) 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 (*PostMutation) ResetUpdatedAt ¶
func (m *PostMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*PostMutation) ResetUser ¶
func (m *PostMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*PostMutation) SetCreatedAt ¶
func (m *PostMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*PostMutation) SetField ¶
func (m *PostMutation) 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 (*PostMutation) SetID ¶
func (m *PostMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Post entities.
func (*PostMutation) SetOp ¶
func (m *PostMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*PostMutation) SetUpdatedAt ¶
func (m *PostMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*PostMutation) SetUserID ¶
func (m *PostMutation) SetUserID(id uuid.UUID)
SetUserID sets the "user" edge to the User entity by id.
func (PostMutation) Tx ¶
func (m PostMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*PostMutation) Type ¶
func (m *PostMutation) Type() string
Type returns the node type of this mutation (Post).
func (*PostMutation) UpdatedAt ¶
func (m *PostMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*PostMutation) UserCleared ¶
func (m *PostMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*PostMutation) UserID ¶
func (m *PostMutation) UserID() (id uuid.UUID, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*PostMutation) UserIDs ¶
func (m *PostMutation) UserIDs() (ids []uuid.UUID)
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 (*PostMutation) Where ¶
func (m *PostMutation) Where(ps ...predicate.Post)
Where appends a list predicates to the PostMutation builder.
func (*PostMutation) WhereP ¶
func (m *PostMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the PostMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type PostOrder ¶
type PostOrder struct { Direction OrderDirection `json:"direction"` Field *PostOrderField `json:"field"` }
PostOrder defines the ordering of Post.
type PostOrderField ¶
type PostOrderField struct { // Value extracts the ordering value from the given Post. Value func(*Post) (ent.Value, error) // contains filtered or unexported fields }
PostOrderField defines the ordering field of Post.
type PostPaginateOption ¶
type PostPaginateOption func(*postPager) error
PostPaginateOption enables pagination customization.
func WithPostFilter ¶
func WithPostFilter(filter func(*PostQuery) (*PostQuery, error)) PostPaginateOption
WithPostFilter configures pagination filter.
func WithPostOrder ¶
func WithPostOrder(order *PostOrder) PostPaginateOption
WithPostOrder configures pagination ordering.
type PostQuery ¶
type PostQuery struct {
// contains filtered or unexported fields
}
PostQuery is the builder for querying Post entities.
func (*PostQuery) Aggregate ¶
func (pq *PostQuery) Aggregate(fns ...AggregateFunc) *PostSelect
Aggregate returns a PostSelect configured with the given aggregations.
func (*PostQuery) Clone ¶
Clone returns a duplicate of the PostQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*PostQuery) CollectFields ¶
CollectFields tells the query-builder to eagerly load connected nodes by resolver context.
func (*PostQuery) First ¶
First returns the first Post entity from the query. Returns a *NotFoundError when no Post was found.
func (*PostQuery) FirstID ¶
FirstID returns the first Post ID from the query. Returns a *NotFoundError when no Post ID was found.
func (*PostQuery) GroupBy ¶
func (pq *PostQuery) GroupBy(field string, fields ...string) *PostGroupBy
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.Post.Query(). GroupBy(post.FieldCreatedAt). Aggregate(internal.Count()). Scan(ctx, &v)
func (*PostQuery) Only ¶
Only returns a single Post entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Post entity is found. Returns a *NotFoundError when no Post entities are found.
func (*PostQuery) OnlyID ¶
OnlyID is like Only, but returns the only Post ID in the query. Returns a *NotSingularError when more than one Post ID is found. Returns a *NotFoundError when no entities are found.
func (*PostQuery) Order ¶
func (pq *PostQuery) Order(o ...post.OrderOption) *PostQuery
Order specifies how the records should be ordered.
func (*PostQuery) Paginate ¶
func (po *PostQuery) Paginate( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, opts ...PostPaginateOption, ) (*PostConnection, error)
Paginate executes the query and returns a relay based cursor connection to Post.
func (*PostQuery) Select ¶
func (pq *PostQuery) Select(fields ...string) *PostSelect
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.Post.Query(). Select(post.FieldCreatedAt). Scan(ctx, &v)
func (*PostQuery) 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.
type PostSelect ¶
type PostSelect struct { *PostQuery // contains filtered or unexported fields }
PostSelect is the builder for selecting fields of Post entities.
func (*PostSelect) Aggregate ¶
func (ps *PostSelect) Aggregate(fns ...AggregateFunc) *PostSelect
Aggregate adds the given aggregation functions to the selector query.
func (*PostSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PostSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PostSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PostSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PostSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PostSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PostSelect) Scan ¶
func (ps *PostSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PostSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PostUpdate ¶
type PostUpdate struct {
// contains filtered or unexported fields
}
PostUpdate is the builder for updating Post entities.
func (*PostUpdate) ClearUser ¶
func (pu *PostUpdate) ClearUser() *PostUpdate
ClearUser clears the "user" edge to the User entity.
func (*PostUpdate) Exec ¶
func (pu *PostUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*PostUpdate) ExecX ¶
func (pu *PostUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PostUpdate) Mutation ¶
func (pu *PostUpdate) Mutation() *PostMutation
Mutation returns the PostMutation object of the builder.
func (*PostUpdate) Save ¶
func (pu *PostUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*PostUpdate) SaveX ¶
func (pu *PostUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*PostUpdate) SetNillableUserID ¶
func (pu *PostUpdate) SetNillableUserID(id *uuid.UUID) *PostUpdate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*PostUpdate) SetUpdatedAt ¶
func (pu *PostUpdate) SetUpdatedAt(t time.Time) *PostUpdate
SetUpdatedAt sets the "updated_at" field.
func (*PostUpdate) SetUser ¶
func (pu *PostUpdate) SetUser(u *User) *PostUpdate
SetUser sets the "user" edge to the User entity.
func (*PostUpdate) SetUserID ¶
func (pu *PostUpdate) SetUserID(id uuid.UUID) *PostUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*PostUpdate) Where ¶
func (pu *PostUpdate) Where(ps ...predicate.Post) *PostUpdate
Where appends a list predicates to the PostUpdate builder.
type PostUpdateOne ¶
type PostUpdateOne struct {
// contains filtered or unexported fields
}
PostUpdateOne is the builder for updating a single Post entity.
func (*PostUpdateOne) ClearUser ¶
func (puo *PostUpdateOne) ClearUser() *PostUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*PostUpdateOne) Exec ¶
func (puo *PostUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*PostUpdateOne) ExecX ¶
func (puo *PostUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PostUpdateOne) Mutation ¶
func (puo *PostUpdateOne) Mutation() *PostMutation
Mutation returns the PostMutation object of the builder.
func (*PostUpdateOne) Save ¶
func (puo *PostUpdateOne) Save(ctx context.Context) (*Post, error)
Save executes the query and returns the updated Post entity.
func (*PostUpdateOne) SaveX ¶
func (puo *PostUpdateOne) SaveX(ctx context.Context) *Post
SaveX is like Save, but panics if an error occurs.
func (*PostUpdateOne) Select ¶
func (puo *PostUpdateOne) Select(field string, fields ...string) *PostUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*PostUpdateOne) SetNillableUserID ¶
func (puo *PostUpdateOne) SetNillableUserID(id *uuid.UUID) *PostUpdateOne
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*PostUpdateOne) SetUpdatedAt ¶
func (puo *PostUpdateOne) SetUpdatedAt(t time.Time) *PostUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*PostUpdateOne) SetUser ¶
func (puo *PostUpdateOne) SetUser(u *User) *PostUpdateOne
SetUser sets the "user" edge to the User entity.
func (*PostUpdateOne) SetUserID ¶
func (puo *PostUpdateOne) SetUserID(id uuid.UUID) *PostUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*PostUpdateOne) Where ¶
func (puo *PostUpdateOne) Where(ps ...predicate.Post) *PostUpdateOne
Where appends a list predicates to the PostUpdate builder.
type PostWhereInput ¶
type PostWhereInput struct { Predicates []predicate.Post `json:"-"` Not *PostWhereInput `json:"not,omitempty"` Or []*PostWhereInput `json:"or,omitempty"` And []*PostWhereInput `json:"and,omitempty"` // "id" field predicates. ID *uuid.UUID `json:"id,omitempty"` IDNEQ *uuid.UUID `json:"idNEQ,omitempty"` IDIn []uuid.UUID `json:"idIn,omitempty"` IDNotIn []uuid.UUID `json:"idNotIn,omitempty"` IDGT *uuid.UUID `json:"idGT,omitempty"` IDGTE *uuid.UUID `json:"idGTE,omitempty"` IDLT *uuid.UUID `json:"idLT,omitempty"` IDLTE *uuid.UUID `json:"idLTE,omitempty"` // "created_at" field predicates. CreatedAt *time.Time `json:"createdAt,omitempty"` CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` // "updated_at" field predicates. UpdatedAt *time.Time `json:"updatedAt,omitempty"` UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` // "user" edge predicates. HasUser *bool `json:"hasUser,omitempty"` HasUserWith []*UserWhereInput `json:"hasUserWith,omitempty"` }
PostWhereInput represents a where input for filtering Post queries.
func (*PostWhereInput) AddPredicates ¶
func (i *PostWhereInput) AddPredicates(predicates ...predicate.Post)
AddPredicates adds custom predicates to the where input to be used during the filtering phase.
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 QueryResolver ¶
type ResolverRoot ¶
type ResolverRoot interface {
Query() QueryResolver
}
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 Setting ¶
type Setting struct { // ID of the ent. ID uuid.UUID `json:"id,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"` // contains filtered or unexported fields }
Setting is the model entity for the Setting schema.
func (*Setting) IsNode ¶
func (n *Setting) IsNode()
IsNode implements the Node interface check for GQLGen.
func (*Setting) ToEdge ¶
func (s *Setting) ToEdge(order *SettingOrder) *SettingEdge
ToEdge converts Setting into SettingEdge.
func (*Setting) Unwrap ¶
Unwrap unwraps the Setting 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 (*Setting) Update ¶
func (s *Setting) Update() *SettingUpdateOne
Update returns a builder for updating this Setting. Note that you need to call Setting.Unwrap() before calling this method if this Setting was returned from a transaction, and the transaction was committed or rolled back.
type SettingClient ¶
type SettingClient struct {
// contains filtered or unexported fields
}
SettingClient is a client for the Setting schema.
func NewSettingClient ¶
func NewSettingClient(c config) *SettingClient
NewSettingClient returns a client for the Setting from the given config.
func (*SettingClient) Create ¶
func (c *SettingClient) Create() *SettingCreate
Create returns a builder for creating a Setting entity.
func (*SettingClient) CreateBulk ¶
func (c *SettingClient) CreateBulk(builders ...*SettingCreate) *SettingCreateBulk
CreateBulk returns a builder for creating a bulk of Setting entities.
func (*SettingClient) Delete ¶
func (c *SettingClient) Delete() *SettingDelete
Delete returns a delete builder for Setting.
func (*SettingClient) DeleteOne ¶
func (c *SettingClient) DeleteOne(s *Setting) *SettingDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*SettingClient) DeleteOneID ¶
func (c *SettingClient) DeleteOneID(id uuid.UUID) *SettingDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*SettingClient) Hooks ¶
func (c *SettingClient) Hooks() []Hook
Hooks returns the client hooks.
func (*SettingClient) Intercept ¶
func (c *SettingClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `setting.Intercept(f(g(h())))`.
func (*SettingClient) Interceptors ¶
func (c *SettingClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*SettingClient) Query ¶
func (c *SettingClient) Query() *SettingQuery
Query returns a query builder for Setting.
func (*SettingClient) Update ¶
func (c *SettingClient) Update() *SettingUpdate
Update returns an update builder for Setting.
func (*SettingClient) UpdateOne ¶
func (c *SettingClient) UpdateOne(s *Setting) *SettingUpdateOne
UpdateOne returns an update builder for the given entity.
func (*SettingClient) UpdateOneID ¶
func (c *SettingClient) UpdateOneID(id uuid.UUID) *SettingUpdateOne
UpdateOneID returns an update builder for the given id.
func (*SettingClient) Use ¶
func (c *SettingClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `setting.Hooks(f(g(h())))`.
type SettingConnection ¶
type SettingConnection struct { Edges []*SettingEdge `json:"edges"` PageInfo PageInfo `json:"pageInfo"` TotalCount int `json:"totalCount"` }
SettingConnection is the connection containing edges to Setting.
type SettingCreate ¶
type SettingCreate struct {
// contains filtered or unexported fields
}
SettingCreate is the builder for creating a Setting entity.
func (*SettingCreate) Exec ¶
func (sc *SettingCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*SettingCreate) ExecX ¶
func (sc *SettingCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SettingCreate) Mutation ¶
func (sc *SettingCreate) Mutation() *SettingMutation
Mutation returns the SettingMutation object of the builder.
func (*SettingCreate) Save ¶
func (sc *SettingCreate) Save(ctx context.Context) (*Setting, error)
Save creates the Setting in the database.
func (*SettingCreate) SaveX ¶
func (sc *SettingCreate) SaveX(ctx context.Context) *Setting
SaveX calls Save and panics if Save returns an error.
func (*SettingCreate) SetCreatedAt ¶
func (sc *SettingCreate) SetCreatedAt(t time.Time) *SettingCreate
SetCreatedAt sets the "created_at" field.
func (*SettingCreate) SetID ¶
func (sc *SettingCreate) SetID(u uuid.UUID) *SettingCreate
SetID sets the "id" field.
func (*SettingCreate) SetNillableCreatedAt ¶
func (sc *SettingCreate) SetNillableCreatedAt(t *time.Time) *SettingCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*SettingCreate) SetNillableID ¶
func (sc *SettingCreate) SetNillableID(u *uuid.UUID) *SettingCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*SettingCreate) SetNillableUpdatedAt ¶
func (sc *SettingCreate) SetNillableUpdatedAt(t *time.Time) *SettingCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*SettingCreate) SetUpdatedAt ¶
func (sc *SettingCreate) SetUpdatedAt(t time.Time) *SettingCreate
SetUpdatedAt sets the "updated_at" field.
type SettingCreateBulk ¶
type SettingCreateBulk struct {
// contains filtered or unexported fields
}
SettingCreateBulk is the builder for creating many Setting entities in bulk.
func (*SettingCreateBulk) Exec ¶
func (scb *SettingCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*SettingCreateBulk) ExecX ¶
func (scb *SettingCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type SettingDelete ¶
type SettingDelete struct {
// contains filtered or unexported fields
}
SettingDelete is the builder for deleting a Setting entity.
func (*SettingDelete) Exec ¶
func (sd *SettingDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*SettingDelete) ExecX ¶
func (sd *SettingDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*SettingDelete) Where ¶
func (sd *SettingDelete) Where(ps ...predicate.Setting) *SettingDelete
Where appends a list predicates to the SettingDelete builder.
type SettingDeleteOne ¶
type SettingDeleteOne struct {
// contains filtered or unexported fields
}
SettingDeleteOne is the builder for deleting a single Setting entity.
func (*SettingDeleteOne) Exec ¶
func (sdo *SettingDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*SettingDeleteOne) ExecX ¶
func (sdo *SettingDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SettingDeleteOne) Where ¶
func (sdo *SettingDeleteOne) Where(ps ...predicate.Setting) *SettingDeleteOne
Where appends a list predicates to the SettingDelete builder.
type SettingEdge ¶
SettingEdge is the edge representation of Setting.
type SettingGroupBy ¶
type SettingGroupBy struct {
// contains filtered or unexported fields
}
SettingGroupBy is the group-by builder for Setting entities.
func (*SettingGroupBy) Aggregate ¶
func (sgb *SettingGroupBy) Aggregate(fns ...AggregateFunc) *SettingGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*SettingGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SettingGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SettingGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SettingGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SettingGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SettingGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SettingGroupBy) Scan ¶
func (sgb *SettingGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SettingGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SettingMutation ¶
type SettingMutation struct {
// contains filtered or unexported fields
}
SettingMutation represents an operation that mutates the Setting nodes in the graph.
func (*SettingMutation) AddField ¶
func (m *SettingMutation) 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 (*SettingMutation) AddedEdges ¶
func (m *SettingMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*SettingMutation) AddedField ¶
func (m *SettingMutation) 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 (*SettingMutation) AddedFields ¶
func (m *SettingMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*SettingMutation) AddedIDs ¶
func (m *SettingMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*SettingMutation) ClearEdge ¶
func (m *SettingMutation) 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 (*SettingMutation) ClearField ¶
func (m *SettingMutation) 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 (*SettingMutation) ClearedEdges ¶
func (m *SettingMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*SettingMutation) ClearedFields ¶
func (m *SettingMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (SettingMutation) Client ¶
func (m SettingMutation) 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 (*SettingMutation) CreatedAt ¶
func (m *SettingMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*SettingMutation) EdgeCleared ¶
func (m *SettingMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*SettingMutation) Field ¶
func (m *SettingMutation) 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 (*SettingMutation) FieldCleared ¶
func (m *SettingMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*SettingMutation) Fields ¶
func (m *SettingMutation) 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 (*SettingMutation) ID ¶
func (m *SettingMutation) ID() (id uuid.UUID, 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 (*SettingMutation) IDs ¶
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 (*SettingMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Setting entity. If the Setting 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 (*SettingMutation) 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 (*SettingMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Setting entity. If the Setting 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 (*SettingMutation) RemovedEdges ¶
func (m *SettingMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*SettingMutation) RemovedIDs ¶
func (m *SettingMutation) 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 (*SettingMutation) ResetCreatedAt ¶
func (m *SettingMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*SettingMutation) ResetEdge ¶
func (m *SettingMutation) 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 (*SettingMutation) ResetField ¶
func (m *SettingMutation) 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 (*SettingMutation) ResetUpdatedAt ¶
func (m *SettingMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*SettingMutation) SetCreatedAt ¶
func (m *SettingMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*SettingMutation) SetField ¶
func (m *SettingMutation) 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 (*SettingMutation) SetID ¶
func (m *SettingMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Setting entities.
func (*SettingMutation) SetOp ¶
func (m *SettingMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*SettingMutation) SetUpdatedAt ¶
func (m *SettingMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (SettingMutation) Tx ¶
func (m SettingMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*SettingMutation) Type ¶
func (m *SettingMutation) Type() string
Type returns the node type of this mutation (Setting).
func (*SettingMutation) UpdatedAt ¶
func (m *SettingMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*SettingMutation) Where ¶
func (m *SettingMutation) Where(ps ...predicate.Setting)
Where appends a list predicates to the SettingMutation builder.
func (*SettingMutation) WhereP ¶
func (m *SettingMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the SettingMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type SettingOrder ¶
type SettingOrder struct { Direction OrderDirection `json:"direction"` Field *SettingOrderField `json:"field"` }
SettingOrder defines the ordering of Setting.
type SettingOrderField ¶
type SettingOrderField struct { // Value extracts the ordering value from the given Setting. Value func(*Setting) (ent.Value, error) // contains filtered or unexported fields }
SettingOrderField defines the ordering field of Setting.
type SettingPaginateOption ¶
type SettingPaginateOption func(*settingPager) error
SettingPaginateOption enables pagination customization.
func WithSettingFilter ¶
func WithSettingFilter(filter func(*SettingQuery) (*SettingQuery, error)) SettingPaginateOption
WithSettingFilter configures pagination filter.
func WithSettingOrder ¶
func WithSettingOrder(order *SettingOrder) SettingPaginateOption
WithSettingOrder configures pagination ordering.
type SettingQuery ¶
type SettingQuery struct {
// contains filtered or unexported fields
}
SettingQuery is the builder for querying Setting entities.
func (*SettingQuery) Aggregate ¶
func (sq *SettingQuery) Aggregate(fns ...AggregateFunc) *SettingSelect
Aggregate returns a SettingSelect configured with the given aggregations.
func (*SettingQuery) All ¶
func (sq *SettingQuery) All(ctx context.Context) ([]*Setting, error)
All executes the query and returns a list of Settings.
func (*SettingQuery) AllX ¶
func (sq *SettingQuery) AllX(ctx context.Context) []*Setting
AllX is like All, but panics if an error occurs.
func (*SettingQuery) Clone ¶
func (sq *SettingQuery) Clone() *SettingQuery
Clone returns a duplicate of the SettingQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*SettingQuery) CollectFields ¶
func (s *SettingQuery) CollectFields(ctx context.Context, satisfies ...string) (*SettingQuery, error)
CollectFields tells the query-builder to eagerly load connected nodes by resolver context.
func (*SettingQuery) Count ¶
func (sq *SettingQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*SettingQuery) CountX ¶
func (sq *SettingQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*SettingQuery) Exist ¶
func (sq *SettingQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*SettingQuery) ExistX ¶
func (sq *SettingQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*SettingQuery) First ¶
func (sq *SettingQuery) First(ctx context.Context) (*Setting, error)
First returns the first Setting entity from the query. Returns a *NotFoundError when no Setting was found.
func (*SettingQuery) FirstID ¶
FirstID returns the first Setting ID from the query. Returns a *NotFoundError when no Setting ID was found.
func (*SettingQuery) FirstIDX ¶
func (sq *SettingQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*SettingQuery) FirstX ¶
func (sq *SettingQuery) FirstX(ctx context.Context) *Setting
FirstX is like First, but panics if an error occurs.
func (*SettingQuery) GroupBy ¶
func (sq *SettingQuery) GroupBy(field string, fields ...string) *SettingGroupBy
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.Setting.Query(). GroupBy(setting.FieldCreatedAt). Aggregate(internal.Count()). Scan(ctx, &v)
func (*SettingQuery) IDsX ¶
func (sq *SettingQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*SettingQuery) Limit ¶
func (sq *SettingQuery) Limit(limit int) *SettingQuery
Limit the number of records to be returned by this query.
func (*SettingQuery) Offset ¶
func (sq *SettingQuery) Offset(offset int) *SettingQuery
Offset to start from.
func (*SettingQuery) Only ¶
func (sq *SettingQuery) Only(ctx context.Context) (*Setting, error)
Only returns a single Setting entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Setting entity is found. Returns a *NotFoundError when no Setting entities are found.
func (*SettingQuery) OnlyID ¶
OnlyID is like Only, but returns the only Setting ID in the query. Returns a *NotSingularError when more than one Setting ID is found. Returns a *NotFoundError when no entities are found.
func (*SettingQuery) OnlyIDX ¶
func (sq *SettingQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*SettingQuery) OnlyX ¶
func (sq *SettingQuery) OnlyX(ctx context.Context) *Setting
OnlyX is like Only, but panics if an error occurs.
func (*SettingQuery) Order ¶
func (sq *SettingQuery) Order(o ...setting.OrderOption) *SettingQuery
Order specifies how the records should be ordered.
func (*SettingQuery) Paginate ¶
func (s *SettingQuery) Paginate( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, opts ...SettingPaginateOption, ) (*SettingConnection, error)
Paginate executes the query and returns a relay based cursor connection to Setting.
func (*SettingQuery) Select ¶
func (sq *SettingQuery) Select(fields ...string) *SettingSelect
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.Setting.Query(). Select(setting.FieldCreatedAt). Scan(ctx, &v)
func (*SettingQuery) Unique ¶
func (sq *SettingQuery) Unique(unique bool) *SettingQuery
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 (*SettingQuery) Where ¶
func (sq *SettingQuery) Where(ps ...predicate.Setting) *SettingQuery
Where adds a new predicate for the SettingQuery builder.
type SettingSelect ¶
type SettingSelect struct { *SettingQuery // contains filtered or unexported fields }
SettingSelect is the builder for selecting fields of Setting entities.
func (*SettingSelect) Aggregate ¶
func (ss *SettingSelect) Aggregate(fns ...AggregateFunc) *SettingSelect
Aggregate adds the given aggregation functions to the selector query.
func (*SettingSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SettingSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SettingSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SettingSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SettingSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SettingSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SettingSelect) Scan ¶
func (ss *SettingSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SettingSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SettingUpdate ¶
type SettingUpdate struct {
// contains filtered or unexported fields
}
SettingUpdate is the builder for updating Setting entities.
func (*SettingUpdate) Exec ¶
func (su *SettingUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*SettingUpdate) ExecX ¶
func (su *SettingUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SettingUpdate) Mutation ¶
func (su *SettingUpdate) Mutation() *SettingMutation
Mutation returns the SettingMutation object of the builder.
func (*SettingUpdate) Save ¶
func (su *SettingUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*SettingUpdate) SaveX ¶
func (su *SettingUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*SettingUpdate) SetUpdatedAt ¶
func (su *SettingUpdate) SetUpdatedAt(t time.Time) *SettingUpdate
SetUpdatedAt sets the "updated_at" field.
func (*SettingUpdate) Where ¶
func (su *SettingUpdate) Where(ps ...predicate.Setting) *SettingUpdate
Where appends a list predicates to the SettingUpdate builder.
type SettingUpdateOne ¶
type SettingUpdateOne struct {
// contains filtered or unexported fields
}
SettingUpdateOne is the builder for updating a single Setting entity.
func (*SettingUpdateOne) Exec ¶
func (suo *SettingUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*SettingUpdateOne) ExecX ¶
func (suo *SettingUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SettingUpdateOne) Mutation ¶
func (suo *SettingUpdateOne) Mutation() *SettingMutation
Mutation returns the SettingMutation object of the builder.
func (*SettingUpdateOne) Save ¶
func (suo *SettingUpdateOne) Save(ctx context.Context) (*Setting, error)
Save executes the query and returns the updated Setting entity.
func (*SettingUpdateOne) SaveX ¶
func (suo *SettingUpdateOne) SaveX(ctx context.Context) *Setting
SaveX is like Save, but panics if an error occurs.
func (*SettingUpdateOne) Select ¶
func (suo *SettingUpdateOne) Select(field string, fields ...string) *SettingUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*SettingUpdateOne) SetUpdatedAt ¶
func (suo *SettingUpdateOne) SetUpdatedAt(t time.Time) *SettingUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*SettingUpdateOne) Where ¶
func (suo *SettingUpdateOne) Where(ps ...predicate.Setting) *SettingUpdateOne
Where appends a list predicates to the SettingUpdate builder.
type SettingWhereInput ¶
type SettingWhereInput struct { Predicates []predicate.Setting `json:"-"` Not *SettingWhereInput `json:"not,omitempty"` Or []*SettingWhereInput `json:"or,omitempty"` And []*SettingWhereInput `json:"and,omitempty"` // "id" field predicates. ID *uuid.UUID `json:"id,omitempty"` IDNEQ *uuid.UUID `json:"idNEQ,omitempty"` IDIn []uuid.UUID `json:"idIn,omitempty"` IDNotIn []uuid.UUID `json:"idNotIn,omitempty"` IDGT *uuid.UUID `json:"idGT,omitempty"` IDGTE *uuid.UUID `json:"idGTE,omitempty"` IDLT *uuid.UUID `json:"idLT,omitempty"` IDLTE *uuid.UUID `json:"idLTE,omitempty"` // "created_at" field predicates. CreatedAt *time.Time `json:"createdAt,omitempty"` CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` // "updated_at" field predicates. UpdatedAt *time.Time `json:"updatedAt,omitempty"` UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` }
SettingWhereInput represents a where input for filtering Setting queries.
func (*SettingWhereInput) AddPredicates ¶
func (i *SettingWhereInput) AddPredicates(predicates ...predicate.Setting)
AddPredicates adds custom predicates to the where input to be used during the filtering phase.
func (*SettingWhereInput) Filter ¶
func (i *SettingWhereInput) Filter(q *SettingQuery) (*SettingQuery, error)
Filter applies the SettingWhereInput filter on the SettingQuery builder.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Group is the client for interacting with the Group builders. Group *GroupClient // Message is the client for interacting with the Message builders. Message *MessageClient // Notification is the client for interacting with the Notification builders. Notification *NotificationClient // Post is the client for interacting with the Post builders. Post *PostClient // Setting is the client for interacting with the Setting builders. Setting *SettingClient // 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 uuid.UUID `json:"id,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"` // FirstName holds the value of the "first_name" field. FirstName string `json:"first_name,omitempty"` // LastName holds the value of the "last_name" field. LastName string `json:"last_name,omitempty"` // EmailAddress holds the value of the "email_address" field. EmailAddress string `json:"email_address,omitempty"` // AccountAddress holds the value of the "account_address" field. AccountAddress string `json:"account_address,omitempty"` // Alias holds the value of the "alias" field. Alias string `json:"alias,omitempty"` // Bio holds the value of the "bio" field. Bio string `json:"bio,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) Followers ¶
func (u *User) Followers( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, where *UserWhereInput, ) (*UserConnection, error)
func (*User) Following ¶
func (u *User) Following( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, where *UserWhereInput, ) (*UserConnection, error)
func (*User) Groups ¶
func (u *User) Groups( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, where *GroupWhereInput, ) (*GroupConnection, error)
func (*User) IsNode ¶
func (n *User) IsNode()
IsNode implements the Node interface check for GQLGen.
func (*User) NamedFollowers ¶
NamedFollowers returns the Followers named value or an error if the edge was not loaded in eager-loading with this name.
func (*User) NamedFollowing ¶
NamedFollowing returns the Following named value or an error if the edge was not loaded in eager-loading with this name.
func (*User) NamedGroups ¶
NamedGroups returns the Groups named value or an error if the edge was not loaded in eager-loading with this name.
func (*User) NamedPosts ¶
NamedPosts returns the Posts named value or an error if the edge was not loaded in eager-loading with this name.
func (*User) Posts ¶
func (u *User) Posts( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, where *PostWhereInput, ) (*PostConnection, error)
func (*User) QueryFollowers ¶
QueryFollowers queries the "followers" edge of the User entity.
func (*User) QueryFollowing ¶
QueryFollowing queries the "following" edge of the User entity.
func (*User) QueryGroups ¶
func (u *User) QueryGroups() *GroupQuery
QueryGroups queries the "groups" edge of the User entity.
func (*User) QueryPosts ¶
QueryPosts queries the "posts" 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 uuid.UUID) *UserDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
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) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) QueryFollowers ¶
func (c *UserClient) QueryFollowers(u *User) *UserQuery
QueryFollowers queries the followers edge of a User.
func (*UserClient) QueryFollowing ¶
func (c *UserClient) QueryFollowing(u *User) *UserQuery
QueryFollowing queries the following edge of a User.
func (*UserClient) QueryGroups ¶
func (c *UserClient) QueryGroups(u *User) *GroupQuery
QueryGroups queries the groups edge of a User.
func (*UserClient) QueryPosts ¶
func (c *UserClient) QueryPosts(u *User) *PostQuery
QueryPosts queries the posts 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 uuid.UUID) *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 UserConnection ¶
type UserConnection struct { Edges []*UserEdge `json:"edges"` PageInfo PageInfo `json:"pageInfo"` TotalCount int `json:"totalCount"` }
UserConnection is the connection containing edges to User.
type UserCreate ¶
type UserCreate struct {
// contains filtered or unexported fields
}
UserCreate is the builder for creating a User entity.
func (*UserCreate) AddFollowerIDs ¶
func (uc *UserCreate) AddFollowerIDs(ids ...uuid.UUID) *UserCreate
AddFollowerIDs adds the "followers" edge to the User entity by IDs.
func (*UserCreate) AddFollowers ¶
func (uc *UserCreate) AddFollowers(u ...*User) *UserCreate
AddFollowers adds the "followers" edges to the User entity.
func (*UserCreate) AddFollowing ¶
func (uc *UserCreate) AddFollowing(u ...*User) *UserCreate
AddFollowing adds the "following" edges to the User entity.
func (*UserCreate) AddFollowingIDs ¶
func (uc *UserCreate) AddFollowingIDs(ids ...uuid.UUID) *UserCreate
AddFollowingIDs adds the "following" edge to the User entity by IDs.
func (*UserCreate) AddGroupIDs ¶
func (uc *UserCreate) AddGroupIDs(ids ...uuid.UUID) *UserCreate
AddGroupIDs adds the "groups" edge to the Group entity by IDs.
func (*UserCreate) AddGroups ¶
func (uc *UserCreate) AddGroups(g ...*Group) *UserCreate
AddGroups adds the "groups" edges to the Group entity.
func (*UserCreate) AddPostIDs ¶
func (uc *UserCreate) AddPostIDs(ids ...uuid.UUID) *UserCreate
AddPostIDs adds the "posts" edge to the Post entity by IDs.
func (*UserCreate) AddPosts ¶
func (uc *UserCreate) AddPosts(p ...*Post) *UserCreate
AddPosts adds the "posts" edges to the Post entity.
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) SetAccountAddress ¶
func (uc *UserCreate) SetAccountAddress(s string) *UserCreate
SetAccountAddress sets the "account_address" field.
func (*UserCreate) SetAlias ¶
func (uc *UserCreate) SetAlias(s string) *UserCreate
SetAlias sets the "alias" 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) SetEmailAddress ¶
func (uc *UserCreate) SetEmailAddress(s string) *UserCreate
SetEmailAddress sets the "email_address" field.
func (*UserCreate) SetFirstName ¶
func (uc *UserCreate) SetFirstName(s string) *UserCreate
SetFirstName sets the "first_name" field.
func (*UserCreate) SetID ¶
func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate
SetID sets the "id" field.
func (*UserCreate) SetLastName ¶
func (uc *UserCreate) SetLastName(s string) *UserCreate
SetLastName sets the "last_name" field.
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) SetNillableID ¶
func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate
SetNillableID sets the "id" 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) SetUpdatedAt ¶
func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate
SetUpdatedAt sets the "updated_at" 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 { // Followers holds the value of the followers edge. Followers []*User `json:"followers,omitempty"` // Following holds the value of the following edge. Following []*User `json:"following,omitempty"` // Posts holds the value of the posts edge. Posts []*Post `json:"posts,omitempty"` // Groups holds the value of the groups edge. Groups []*Group `json:"groups,omitempty"` // contains filtered or unexported fields }
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) FollowersOrErr ¶
FollowersOrErr returns the Followers value or an error if the edge was not loaded in eager-loading.
func (UserEdges) FollowingOrErr ¶
FollowingOrErr returns the Following value or an error if the edge was not loaded in eager-loading.
func (UserEdges) GroupsOrErr ¶
GroupsOrErr returns the Groups value or an error if the edge was not loaded in eager-loading.
func (UserEdges) PostsOrErr ¶
PostsOrErr returns the Posts 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) AccountAddress ¶
func (m *UserMutation) AccountAddress() (r string, exists bool)
AccountAddress returns the value of the "account_address" field in the mutation.
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) AddFollowerIDs ¶
func (m *UserMutation) AddFollowerIDs(ids ...uuid.UUID)
AddFollowerIDs adds the "followers" edge to the User entity by ids.
func (*UserMutation) AddFollowingIDs ¶
func (m *UserMutation) AddFollowingIDs(ids ...uuid.UUID)
AddFollowingIDs adds the "following" edge to the User entity by ids.
func (*UserMutation) AddGroupIDs ¶
func (m *UserMutation) AddGroupIDs(ids ...uuid.UUID)
AddGroupIDs adds the "groups" edge to the Group entity by ids.
func (*UserMutation) AddPostIDs ¶
func (m *UserMutation) AddPostIDs(ids ...uuid.UUID)
AddPostIDs adds the "posts" edge to the Post 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) Alias ¶
func (m *UserMutation) Alias() (r string, exists bool)
Alias returns the value of the "alias" 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) 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) ClearFollowers ¶
func (m *UserMutation) ClearFollowers()
ClearFollowers clears the "followers" edge to the User entity.
func (*UserMutation) ClearFollowing ¶
func (m *UserMutation) ClearFollowing()
ClearFollowing clears the "following" edge to the User entity.
func (*UserMutation) ClearGroups ¶
func (m *UserMutation) ClearGroups()
ClearGroups clears the "groups" edge to the Group entity.
func (*UserMutation) ClearPosts ¶
func (m *UserMutation) ClearPosts()
ClearPosts clears the "posts" edge to the Post entity.
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) 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) EmailAddress ¶
func (m *UserMutation) EmailAddress() (r string, exists bool)
EmailAddress returns the value of the "email_address" 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) FirstName ¶
func (m *UserMutation) FirstName() (r string, exists bool)
FirstName returns the value of the "first_name" field in the mutation.
func (*UserMutation) FollowersCleared ¶
func (m *UserMutation) FollowersCleared() bool
FollowersCleared reports if the "followers" edge to the User entity was cleared.
func (*UserMutation) FollowersIDs ¶
func (m *UserMutation) FollowersIDs() (ids []uuid.UUID)
FollowersIDs returns the "followers" edge IDs in the mutation.
func (*UserMutation) FollowingCleared ¶
func (m *UserMutation) FollowingCleared() bool
FollowingCleared reports if the "following" edge to the User entity was cleared.
func (*UserMutation) FollowingIDs ¶
func (m *UserMutation) FollowingIDs() (ids []uuid.UUID)
FollowingIDs returns the "following" edge IDs in the mutation.
func (*UserMutation) GroupsCleared ¶
func (m *UserMutation) GroupsCleared() bool
GroupsCleared reports if the "groups" edge to the Group entity was cleared.
func (*UserMutation) GroupsIDs ¶
func (m *UserMutation) GroupsIDs() (ids []uuid.UUID)
GroupsIDs returns the "groups" edge IDs in the mutation.
func (*UserMutation) ID ¶
func (m *UserMutation) ID() (id uuid.UUID, 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 ¶
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) LastName ¶
func (m *UserMutation) LastName() (r string, exists bool)
LastName returns the value of the "last_name" field in the mutation.
func (*UserMutation) OldAccountAddress ¶
func (m *UserMutation) OldAccountAddress(ctx context.Context) (v string, err error)
OldAccountAddress returns the old "account_address" 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) OldAlias ¶
func (m *UserMutation) OldAlias(ctx context.Context) (v string, err error)
OldAlias returns the old "alias" 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) OldEmailAddress ¶
func (m *UserMutation) OldEmailAddress(ctx context.Context) (v string, err error)
OldEmailAddress returns the old "email_address" 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) OldFirstName ¶
func (m *UserMutation) OldFirstName(ctx context.Context) (v string, err error)
OldFirstName returns the old "first_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) OldLastName ¶
func (m *UserMutation) OldLastName(ctx context.Context) (v string, err error)
OldLastName returns the old "last_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) 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) PostsCleared ¶
func (m *UserMutation) PostsCleared() bool
PostsCleared reports if the "posts" edge to the Post entity was cleared.
func (*UserMutation) PostsIDs ¶
func (m *UserMutation) PostsIDs() (ids []uuid.UUID)
PostsIDs returns the "posts" edge IDs in the mutation.
func (*UserMutation) RemoveFollowerIDs ¶
func (m *UserMutation) RemoveFollowerIDs(ids ...uuid.UUID)
RemoveFollowerIDs removes the "followers" edge to the User entity by IDs.
func (*UserMutation) RemoveFollowingIDs ¶
func (m *UserMutation) RemoveFollowingIDs(ids ...uuid.UUID)
RemoveFollowingIDs removes the "following" edge to the User entity by IDs.
func (*UserMutation) RemoveGroupIDs ¶
func (m *UserMutation) RemoveGroupIDs(ids ...uuid.UUID)
RemoveGroupIDs removes the "groups" edge to the Group entity by IDs.
func (*UserMutation) RemovePostIDs ¶
func (m *UserMutation) RemovePostIDs(ids ...uuid.UUID)
RemovePostIDs removes the "posts" edge to the Post entity by IDs.
func (*UserMutation) RemovedEdges ¶
func (m *UserMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserMutation) RemovedFollowersIDs ¶
func (m *UserMutation) RemovedFollowersIDs() (ids []uuid.UUID)
RemovedFollowers returns the removed IDs of the "followers" edge to the User entity.
func (*UserMutation) RemovedFollowingIDs ¶
func (m *UserMutation) RemovedFollowingIDs() (ids []uuid.UUID)
RemovedFollowing returns the removed IDs of the "following" edge to the User entity.
func (*UserMutation) RemovedGroupsIDs ¶
func (m *UserMutation) RemovedGroupsIDs() (ids []uuid.UUID)
RemovedGroups returns the removed IDs of the "groups" edge to the Group entity.
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) RemovedPostsIDs ¶
func (m *UserMutation) RemovedPostsIDs() (ids []uuid.UUID)
RemovedPosts returns the removed IDs of the "posts" edge to the Post entity.
func (*UserMutation) ResetAccountAddress ¶
func (m *UserMutation) ResetAccountAddress()
ResetAccountAddress resets all changes to the "account_address" field.
func (*UserMutation) ResetAlias ¶
func (m *UserMutation) ResetAlias()
ResetAlias resets all changes to the "alias" 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) 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) ResetEmailAddress ¶
func (m *UserMutation) ResetEmailAddress()
ResetEmailAddress resets all changes to the "email_address" 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) ResetFirstName ¶
func (m *UserMutation) ResetFirstName()
ResetFirstName resets all changes to the "first_name" field.
func (*UserMutation) ResetFollowers ¶
func (m *UserMutation) ResetFollowers()
ResetFollowers resets all changes to the "followers" edge.
func (*UserMutation) ResetFollowing ¶
func (m *UserMutation) ResetFollowing()
ResetFollowing resets all changes to the "following" edge.
func (*UserMutation) ResetGroups ¶
func (m *UserMutation) ResetGroups()
ResetGroups resets all changes to the "groups" edge.
func (*UserMutation) ResetLastName ¶
func (m *UserMutation) ResetLastName()
ResetLastName resets all changes to the "last_name" field.
func (*UserMutation) ResetPosts ¶
func (m *UserMutation) ResetPosts()
ResetPosts resets all changes to the "posts" edge.
func (*UserMutation) ResetUpdatedAt ¶
func (m *UserMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*UserMutation) SetAccountAddress ¶
func (m *UserMutation) SetAccountAddress(s string)
SetAccountAddress sets the "account_address" field.
func (*UserMutation) SetAlias ¶
func (m *UserMutation) SetAlias(s string)
SetAlias sets the "alias" field.
func (*UserMutation) SetCreatedAt ¶
func (m *UserMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*UserMutation) SetEmailAddress ¶
func (m *UserMutation) SetEmailAddress(s string)
SetEmailAddress sets the "email_address" 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) SetFirstName ¶
func (m *UserMutation) SetFirstName(s string)
SetFirstName sets the "first_name" field.
func (*UserMutation) SetID ¶
func (m *UserMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.
func (*UserMutation) SetLastName ¶
func (m *UserMutation) SetLastName(s string)
SetLastName sets the "last_name" field.
func (*UserMutation) SetOp ¶
func (m *UserMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UserMutation) SetUpdatedAt ¶
func (m *UserMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
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) 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 UserOrder ¶
type UserOrder struct { Direction OrderDirection `json:"direction"` Field *UserOrderField `json:"field"` }
UserOrder defines the ordering of User.
type UserOrderField ¶
type UserOrderField struct { // Value extracts the ordering value from the given User. Value func(*User) (ent.Value, error) // contains filtered or unexported fields }
UserOrderField defines the ordering field of User.
type UserPaginateOption ¶
type UserPaginateOption func(*userPager) error
UserPaginateOption enables pagination customization.
func WithUserFilter ¶
func WithUserFilter(filter func(*UserQuery) (*UserQuery, error)) UserPaginateOption
WithUserFilter configures pagination filter.
func WithUserOrder ¶
func WithUserOrder(order *UserOrder) UserPaginateOption
WithUserOrder configures pagination ordering.
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) CollectFields ¶
CollectFields tells the query-builder to eagerly load connected nodes by resolver context.
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 { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldCreatedAt). Aggregate(internal.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) Paginate ¶
func (u *UserQuery) Paginate( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, opts ...UserPaginateOption, ) (*UserConnection, error)
Paginate executes the query and returns a relay based cursor connection to User.
func (*UserQuery) QueryFollowers ¶
QueryFollowers chains the current query on the "followers" edge.
func (*UserQuery) QueryFollowing ¶
QueryFollowing chains the current query on the "following" edge.
func (*UserQuery) QueryGroups ¶
func (uq *UserQuery) QueryGroups() *GroupQuery
QueryGroups chains the current query on the "groups" edge.
func (*UserQuery) QueryPosts ¶
QueryPosts chains the current query on the "posts" 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 { CreatedAt time.Time `json:"created_at,omitempty"` } client.User.Query(). Select(user.FieldCreatedAt). 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) WithFollowers ¶
WithFollowers tells the query-builder to eager-load the nodes that are connected to the "followers" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithFollowing ¶
WithFollowing tells the query-builder to eager-load the nodes that are connected to the "following" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithGroups ¶
func (uq *UserQuery) WithGroups(opts ...func(*GroupQuery)) *UserQuery
WithGroups tells the query-builder to eager-load the nodes that are connected to the "groups" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithNamedFollowers ¶
WithNamedFollowers tells the query-builder to eager-load the nodes that are connected to the "followers" edge with the given name. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithNamedFollowing ¶
WithNamedFollowing tells the query-builder to eager-load the nodes that are connected to the "following" edge with the given name. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithNamedGroups ¶
func (uq *UserQuery) WithNamedGroups(name string, opts ...func(*GroupQuery)) *UserQuery
WithNamedGroups tells the query-builder to eager-load the nodes that are connected to the "groups" edge with the given name. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithNamedPosts ¶
WithNamedPosts tells the query-builder to eager-load the nodes that are connected to the "posts" edge with the given name. 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) AddFollowerIDs ¶
func (uu *UserUpdate) AddFollowerIDs(ids ...uuid.UUID) *UserUpdate
AddFollowerIDs adds the "followers" edge to the User entity by IDs.
func (*UserUpdate) AddFollowers ¶
func (uu *UserUpdate) AddFollowers(u ...*User) *UserUpdate
AddFollowers adds the "followers" edges to the User entity.
func (*UserUpdate) AddFollowing ¶
func (uu *UserUpdate) AddFollowing(u ...*User) *UserUpdate
AddFollowing adds the "following" edges to the User entity.
func (*UserUpdate) AddFollowingIDs ¶
func (uu *UserUpdate) AddFollowingIDs(ids ...uuid.UUID) *UserUpdate
AddFollowingIDs adds the "following" edge to the User entity by IDs.
func (*UserUpdate) AddGroupIDs ¶
func (uu *UserUpdate) AddGroupIDs(ids ...uuid.UUID) *UserUpdate
AddGroupIDs adds the "groups" edge to the Group entity by IDs.
func (*UserUpdate) AddGroups ¶
func (uu *UserUpdate) AddGroups(g ...*Group) *UserUpdate
AddGroups adds the "groups" edges to the Group entity.
func (*UserUpdate) AddPostIDs ¶
func (uu *UserUpdate) AddPostIDs(ids ...uuid.UUID) *UserUpdate
AddPostIDs adds the "posts" edge to the Post entity by IDs.
func (*UserUpdate) AddPosts ¶
func (uu *UserUpdate) AddPosts(p ...*Post) *UserUpdate
AddPosts adds the "posts" edges to the Post entity.
func (*UserUpdate) ClearBio ¶
func (uu *UserUpdate) ClearBio() *UserUpdate
ClearBio clears the value of the "bio" field.
func (*UserUpdate) ClearFollowers ¶
func (uu *UserUpdate) ClearFollowers() *UserUpdate
ClearFollowers clears all "followers" edges to the User entity.
func (*UserUpdate) ClearFollowing ¶
func (uu *UserUpdate) ClearFollowing() *UserUpdate
ClearFollowing clears all "following" edges to the User entity.
func (*UserUpdate) ClearGroups ¶
func (uu *UserUpdate) ClearGroups() *UserUpdate
ClearGroups clears all "groups" edges to the Group entity.
func (*UserUpdate) ClearPosts ¶
func (uu *UserUpdate) ClearPosts() *UserUpdate
ClearPosts clears all "posts" edges to the Post entity.
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) RemoveFollowerIDs ¶
func (uu *UserUpdate) RemoveFollowerIDs(ids ...uuid.UUID) *UserUpdate
RemoveFollowerIDs removes the "followers" edge to User entities by IDs.
func (*UserUpdate) RemoveFollowers ¶
func (uu *UserUpdate) RemoveFollowers(u ...*User) *UserUpdate
RemoveFollowers removes "followers" edges to User entities.
func (*UserUpdate) RemoveFollowing ¶
func (uu *UserUpdate) RemoveFollowing(u ...*User) *UserUpdate
RemoveFollowing removes "following" edges to User entities.
func (*UserUpdate) RemoveFollowingIDs ¶
func (uu *UserUpdate) RemoveFollowingIDs(ids ...uuid.UUID) *UserUpdate
RemoveFollowingIDs removes the "following" edge to User entities by IDs.
func (*UserUpdate) RemoveGroupIDs ¶
func (uu *UserUpdate) RemoveGroupIDs(ids ...uuid.UUID) *UserUpdate
RemoveGroupIDs removes the "groups" edge to Group entities by IDs.
func (*UserUpdate) RemoveGroups ¶
func (uu *UserUpdate) RemoveGroups(g ...*Group) *UserUpdate
RemoveGroups removes "groups" edges to Group entities.
func (*UserUpdate) RemovePostIDs ¶
func (uu *UserUpdate) RemovePostIDs(ids ...uuid.UUID) *UserUpdate
RemovePostIDs removes the "posts" edge to Post entities by IDs.
func (*UserUpdate) RemovePosts ¶
func (uu *UserUpdate) RemovePosts(p ...*Post) *UserUpdate
RemovePosts removes "posts" edges to Post entities.
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) SetAccountAddress ¶
func (uu *UserUpdate) SetAccountAddress(s string) *UserUpdate
SetAccountAddress sets the "account_address" field.
func (*UserUpdate) SetAlias ¶
func (uu *UserUpdate) SetAlias(s string) *UserUpdate
SetAlias sets the "alias" field.
func (*UserUpdate) SetBio ¶
func (uu *UserUpdate) SetBio(s string) *UserUpdate
SetBio sets the "bio" field.
func (*UserUpdate) SetEmailAddress ¶
func (uu *UserUpdate) SetEmailAddress(s string) *UserUpdate
SetEmailAddress sets the "email_address" field.
func (*UserUpdate) SetFirstName ¶
func (uu *UserUpdate) SetFirstName(s string) *UserUpdate
SetFirstName sets the "first_name" field.
func (*UserUpdate) SetLastName ¶
func (uu *UserUpdate) SetLastName(s string) *UserUpdate
SetLastName sets the "last_name" field.
func (*UserUpdate) SetNillableBio ¶
func (uu *UserUpdate) SetNillableBio(s *string) *UserUpdate
SetNillableBio sets the "bio" field if the given value is not nil.
func (*UserUpdate) SetUpdatedAt ¶
func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate
SetUpdatedAt sets the "updated_at" 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) AddFollowerIDs ¶
func (uuo *UserUpdateOne) AddFollowerIDs(ids ...uuid.UUID) *UserUpdateOne
AddFollowerIDs adds the "followers" edge to the User entity by IDs.
func (*UserUpdateOne) AddFollowers ¶
func (uuo *UserUpdateOne) AddFollowers(u ...*User) *UserUpdateOne
AddFollowers adds the "followers" edges to the User entity.
func (*UserUpdateOne) AddFollowing ¶
func (uuo *UserUpdateOne) AddFollowing(u ...*User) *UserUpdateOne
AddFollowing adds the "following" edges to the User entity.
func (*UserUpdateOne) AddFollowingIDs ¶
func (uuo *UserUpdateOne) AddFollowingIDs(ids ...uuid.UUID) *UserUpdateOne
AddFollowingIDs adds the "following" edge to the User entity by IDs.
func (*UserUpdateOne) AddGroupIDs ¶
func (uuo *UserUpdateOne) AddGroupIDs(ids ...uuid.UUID) *UserUpdateOne
AddGroupIDs adds the "groups" edge to the Group entity by IDs.
func (*UserUpdateOne) AddGroups ¶
func (uuo *UserUpdateOne) AddGroups(g ...*Group) *UserUpdateOne
AddGroups adds the "groups" edges to the Group entity.
func (*UserUpdateOne) AddPostIDs ¶
func (uuo *UserUpdateOne) AddPostIDs(ids ...uuid.UUID) *UserUpdateOne
AddPostIDs adds the "posts" edge to the Post entity by IDs.
func (*UserUpdateOne) AddPosts ¶
func (uuo *UserUpdateOne) AddPosts(p ...*Post) *UserUpdateOne
AddPosts adds the "posts" edges to the Post entity.
func (*UserUpdateOne) ClearBio ¶
func (uuo *UserUpdateOne) ClearBio() *UserUpdateOne
ClearBio clears the value of the "bio" field.
func (*UserUpdateOne) ClearFollowers ¶
func (uuo *UserUpdateOne) ClearFollowers() *UserUpdateOne
ClearFollowers clears all "followers" edges to the User entity.
func (*UserUpdateOne) ClearFollowing ¶
func (uuo *UserUpdateOne) ClearFollowing() *UserUpdateOne
ClearFollowing clears all "following" edges to the User entity.
func (*UserUpdateOne) ClearGroups ¶
func (uuo *UserUpdateOne) ClearGroups() *UserUpdateOne
ClearGroups clears all "groups" edges to the Group entity.
func (*UserUpdateOne) ClearPosts ¶
func (uuo *UserUpdateOne) ClearPosts() *UserUpdateOne
ClearPosts clears all "posts" edges to the Post entity.
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) RemoveFollowerIDs ¶
func (uuo *UserUpdateOne) RemoveFollowerIDs(ids ...uuid.UUID) *UserUpdateOne
RemoveFollowerIDs removes the "followers" edge to User entities by IDs.
func (*UserUpdateOne) RemoveFollowers ¶
func (uuo *UserUpdateOne) RemoveFollowers(u ...*User) *UserUpdateOne
RemoveFollowers removes "followers" edges to User entities.
func (*UserUpdateOne) RemoveFollowing ¶
func (uuo *UserUpdateOne) RemoveFollowing(u ...*User) *UserUpdateOne
RemoveFollowing removes "following" edges to User entities.
func (*UserUpdateOne) RemoveFollowingIDs ¶
func (uuo *UserUpdateOne) RemoveFollowingIDs(ids ...uuid.UUID) *UserUpdateOne
RemoveFollowingIDs removes the "following" edge to User entities by IDs.
func (*UserUpdateOne) RemoveGroupIDs ¶
func (uuo *UserUpdateOne) RemoveGroupIDs(ids ...uuid.UUID) *UserUpdateOne
RemoveGroupIDs removes the "groups" edge to Group entities by IDs.
func (*UserUpdateOne) RemoveGroups ¶
func (uuo *UserUpdateOne) RemoveGroups(g ...*Group) *UserUpdateOne
RemoveGroups removes "groups" edges to Group entities.
func (*UserUpdateOne) RemovePostIDs ¶
func (uuo *UserUpdateOne) RemovePostIDs(ids ...uuid.UUID) *UserUpdateOne
RemovePostIDs removes the "posts" edge to Post entities by IDs.
func (*UserUpdateOne) RemovePosts ¶
func (uuo *UserUpdateOne) RemovePosts(p ...*Post) *UserUpdateOne
RemovePosts removes "posts" edges to Post entities.
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) SetAccountAddress ¶
func (uuo *UserUpdateOne) SetAccountAddress(s string) *UserUpdateOne
SetAccountAddress sets the "account_address" field.
func (*UserUpdateOne) SetAlias ¶
func (uuo *UserUpdateOne) SetAlias(s string) *UserUpdateOne
SetAlias sets the "alias" field.
func (*UserUpdateOne) SetBio ¶
func (uuo *UserUpdateOne) SetBio(s string) *UserUpdateOne
SetBio sets the "bio" field.
func (*UserUpdateOne) SetEmailAddress ¶
func (uuo *UserUpdateOne) SetEmailAddress(s string) *UserUpdateOne
SetEmailAddress sets the "email_address" field.
func (*UserUpdateOne) SetFirstName ¶
func (uuo *UserUpdateOne) SetFirstName(s string) *UserUpdateOne
SetFirstName sets the "first_name" field.
func (*UserUpdateOne) SetLastName ¶
func (uuo *UserUpdateOne) SetLastName(s string) *UserUpdateOne
SetLastName sets the "last_name" field.
func (*UserUpdateOne) SetNillableBio ¶
func (uuo *UserUpdateOne) SetNillableBio(s *string) *UserUpdateOne
SetNillableBio sets the "bio" field if the given value is not nil.
func (*UserUpdateOne) SetUpdatedAt ¶
func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*UserUpdateOne) Where ¶
func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
Where appends a list predicates to the UserUpdate builder.
type UserWhereInput ¶
type UserWhereInput struct { Predicates []predicate.User `json:"-"` Not *UserWhereInput `json:"not,omitempty"` Or []*UserWhereInput `json:"or,omitempty"` And []*UserWhereInput `json:"and,omitempty"` // "id" field predicates. ID *uuid.UUID `json:"id,omitempty"` IDNEQ *uuid.UUID `json:"idNEQ,omitempty"` IDIn []uuid.UUID `json:"idIn,omitempty"` IDNotIn []uuid.UUID `json:"idNotIn,omitempty"` IDGT *uuid.UUID `json:"idGT,omitempty"` IDGTE *uuid.UUID `json:"idGTE,omitempty"` IDLT *uuid.UUID `json:"idLT,omitempty"` IDLTE *uuid.UUID `json:"idLTE,omitempty"` // "created_at" field predicates. CreatedAt *time.Time `json:"createdAt,omitempty"` CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` // "updated_at" field predicates. UpdatedAt *time.Time `json:"updatedAt,omitempty"` UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` // "first_name" field predicates. FirstName *string `json:"firstName,omitempty"` FirstNameNEQ *string `json:"firstNameNEQ,omitempty"` FirstNameIn []string `json:"firstNameIn,omitempty"` FirstNameNotIn []string `json:"firstNameNotIn,omitempty"` FirstNameGT *string `json:"firstNameGT,omitempty"` FirstNameGTE *string `json:"firstNameGTE,omitempty"` FirstNameLT *string `json:"firstNameLT,omitempty"` FirstNameLTE *string `json:"firstNameLTE,omitempty"` FirstNameContains *string `json:"firstNameContains,omitempty"` FirstNameHasPrefix *string `json:"firstNameHasPrefix,omitempty"` FirstNameHasSuffix *string `json:"firstNameHasSuffix,omitempty"` FirstNameEqualFold *string `json:"firstNameEqualFold,omitempty"` FirstNameContainsFold *string `json:"firstNameContainsFold,omitempty"` // "last_name" field predicates. LastName *string `json:"lastName,omitempty"` LastNameNEQ *string `json:"lastNameNEQ,omitempty"` LastNameIn []string `json:"lastNameIn,omitempty"` LastNameNotIn []string `json:"lastNameNotIn,omitempty"` LastNameGT *string `json:"lastNameGT,omitempty"` LastNameGTE *string `json:"lastNameGTE,omitempty"` LastNameLT *string `json:"lastNameLT,omitempty"` LastNameLTE *string `json:"lastNameLTE,omitempty"` LastNameContains *string `json:"lastNameContains,omitempty"` LastNameHasPrefix *string `json:"lastNameHasPrefix,omitempty"` LastNameHasSuffix *string `json:"lastNameHasSuffix,omitempty"` LastNameEqualFold *string `json:"lastNameEqualFold,omitempty"` LastNameContainsFold *string `json:"lastNameContainsFold,omitempty"` // "email_address" field predicates. EmailAddress *string `json:"emailAddress,omitempty"` EmailAddressNEQ *string `json:"emailAddressNEQ,omitempty"` EmailAddressIn []string `json:"emailAddressIn,omitempty"` EmailAddressNotIn []string `json:"emailAddressNotIn,omitempty"` EmailAddressGT *string `json:"emailAddressGT,omitempty"` EmailAddressGTE *string `json:"emailAddressGTE,omitempty"` EmailAddressLT *string `json:"emailAddressLT,omitempty"` EmailAddressLTE *string `json:"emailAddressLTE,omitempty"` EmailAddressContains *string `json:"emailAddressContains,omitempty"` EmailAddressHasPrefix *string `json:"emailAddressHasPrefix,omitempty"` EmailAddressHasSuffix *string `json:"emailAddressHasSuffix,omitempty"` EmailAddressEqualFold *string `json:"emailAddressEqualFold,omitempty"` EmailAddressContainsFold *string `json:"emailAddressContainsFold,omitempty"` // "account_address" field predicates. AccountAddress *string `json:"accountAddress,omitempty"` AccountAddressNEQ *string `json:"accountAddressNEQ,omitempty"` AccountAddressIn []string `json:"accountAddressIn,omitempty"` AccountAddressNotIn []string `json:"accountAddressNotIn,omitempty"` AccountAddressGT *string `json:"accountAddressGT,omitempty"` AccountAddressGTE *string `json:"accountAddressGTE,omitempty"` AccountAddressLT *string `json:"accountAddressLT,omitempty"` AccountAddressLTE *string `json:"accountAddressLTE,omitempty"` AccountAddressContains *string `json:"accountAddressContains,omitempty"` AccountAddressHasPrefix *string `json:"accountAddressHasPrefix,omitempty"` AccountAddressHasSuffix *string `json:"accountAddressHasSuffix,omitempty"` AccountAddressEqualFold *string `json:"accountAddressEqualFold,omitempty"` AccountAddressContainsFold *string `json:"accountAddressContainsFold,omitempty"` // "alias" field predicates. Alias *string `json:"alias,omitempty"` AliasNEQ *string `json:"aliasNEQ,omitempty"` AliasIn []string `json:"aliasIn,omitempty"` AliasNotIn []string `json:"aliasNotIn,omitempty"` AliasGT *string `json:"aliasGT,omitempty"` AliasGTE *string `json:"aliasGTE,omitempty"` AliasLT *string `json:"aliasLT,omitempty"` AliasLTE *string `json:"aliasLTE,omitempty"` AliasContains *string `json:"aliasContains,omitempty"` AliasHasPrefix *string `json:"aliasHasPrefix,omitempty"` AliasHasSuffix *string `json:"aliasHasSuffix,omitempty"` AliasEqualFold *string `json:"aliasEqualFold,omitempty"` AliasContainsFold *string `json:"aliasContainsFold,omitempty"` // "bio" field predicates. Bio *string `json:"bio,omitempty"` BioNEQ *string `json:"bioNEQ,omitempty"` BioIn []string `json:"bioIn,omitempty"` BioNotIn []string `json:"bioNotIn,omitempty"` BioGT *string `json:"bioGT,omitempty"` BioGTE *string `json:"bioGTE,omitempty"` BioLT *string `json:"bioLT,omitempty"` BioLTE *string `json:"bioLTE,omitempty"` BioContains *string `json:"bioContains,omitempty"` BioHasPrefix *string `json:"bioHasPrefix,omitempty"` BioHasSuffix *string `json:"bioHasSuffix,omitempty"` BioIsNil bool `json:"bioIsNil,omitempty"` BioNotNil bool `json:"bioNotNil,omitempty"` BioEqualFold *string `json:"bioEqualFold,omitempty"` BioContainsFold *string `json:"bioContainsFold,omitempty"` // "followers" edge predicates. HasFollowers *bool `json:"hasFollowers,omitempty"` HasFollowersWith []*UserWhereInput `json:"hasFollowersWith,omitempty"` // "following" edge predicates. HasFollowing *bool `json:"hasFollowing,omitempty"` HasFollowingWith []*UserWhereInput `json:"hasFollowingWith,omitempty"` // "posts" edge predicates. HasPosts *bool `json:"hasPosts,omitempty"` HasPostsWith []*PostWhereInput `json:"hasPostsWith,omitempty"` // "groups" edge predicates. HasGroups *bool `json:"hasGroups,omitempty"` HasGroupsWith []*GroupWhereInput `json:"hasGroupsWith,omitempty"` }
UserWhereInput represents a where input for filtering User queries.
func (*UserWhereInput) AddPredicates ¶
func (i *UserWhereInput) AddPredicates(predicates ...predicate.User)
AddPredicates adds custom predicates to the where input to be used during the filtering phase.
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
- gql_collection.go
- gql_edge.go
- gql_node.go
- gql_node_descriptor.go
- gql_pagination.go
- gql_schema.go
- gql_transaction.go
- gql_where_input.go
- graph.go
- group.go
- group_create.go
- group_delete.go
- group_query.go
- group_update.go
- message.go
- message_create.go
- message_delete.go
- message_query.go
- message_update.go
- module.go
- mutation.go
- notification.go
- notification_create.go
- notification_delete.go
- notification_query.go
- notification_update.go
- post.go
- post_create.go
- post_delete.go
- post_query.go
- post_update.go
- runtime.go
- setting.go
- setting_create.go
- setting_delete.go
- setting_query.go
- setting_update.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go