Documentation
¶
Overview ¶
Package ent wraps generated and non-generated ent-related code.
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type TelegramChannel
- type TelegramChannelClient
- func (c *TelegramChannelClient) Create() *TelegramChannelCreate
- func (c *TelegramChannelClient) CreateBulk(builders ...*TelegramChannelCreate) *TelegramChannelCreateBulk
- func (c *TelegramChannelClient) Delete() *TelegramChannelDelete
- func (c *TelegramChannelClient) DeleteOne(_m *TelegramChannel) *TelegramChannelDeleteOne
- func (c *TelegramChannelClient) DeleteOneID(id int64) *TelegramChannelDeleteOne
- func (c *TelegramChannelClient) Get(ctx context.Context, id int64) (*TelegramChannel, error)
- func (c *TelegramChannelClient) GetX(ctx context.Context, id int64) *TelegramChannel
- func (c *TelegramChannelClient) Hooks() []Hook
- func (c *TelegramChannelClient) Intercept(interceptors ...Interceptor)
- func (c *TelegramChannelClient) Interceptors() []Interceptor
- func (c *TelegramChannelClient) MapCreateBulk(slice any, setFunc func(*TelegramChannelCreate, int)) *TelegramChannelCreateBulk
- func (c *TelegramChannelClient) Query() *TelegramChannelQuery
- func (c *TelegramChannelClient) Update() *TelegramChannelUpdate
- func (c *TelegramChannelClient) UpdateOne(_m *TelegramChannel) *TelegramChannelUpdateOne
- func (c *TelegramChannelClient) UpdateOneID(id int64) *TelegramChannelUpdateOne
- func (c *TelegramChannelClient) Use(hooks ...Hook)
- type TelegramChannelCreate
- func (_c *TelegramChannelCreate) Exec(ctx context.Context) error
- func (_c *TelegramChannelCreate) ExecX(ctx context.Context)
- func (_c *TelegramChannelCreate) Mutation() *TelegramChannelMutation
- func (_c *TelegramChannelCreate) OnConflict(opts ...sql.ConflictOption) *TelegramChannelUpsertOne
- func (_c *TelegramChannelCreate) OnConflictColumns(columns ...string) *TelegramChannelUpsertOne
- func (_c *TelegramChannelCreate) Save(ctx context.Context) (*TelegramChannel, error)
- func (_c *TelegramChannelCreate) SaveX(ctx context.Context) *TelegramChannel
- func (_c *TelegramChannelCreate) SetAccessHash(v int64) *TelegramChannelCreate
- func (_c *TelegramChannelCreate) SetActive(v bool) *TelegramChannelCreate
- func (_c *TelegramChannelCreate) SetID(v int64) *TelegramChannelCreate
- func (_c *TelegramChannelCreate) SetTitle(v string) *TelegramChannelCreate
- type TelegramChannelCreateBulk
- func (_c *TelegramChannelCreateBulk) Exec(ctx context.Context) error
- func (_c *TelegramChannelCreateBulk) ExecX(ctx context.Context)
- func (_c *TelegramChannelCreateBulk) OnConflict(opts ...sql.ConflictOption) *TelegramChannelUpsertBulk
- func (_c *TelegramChannelCreateBulk) OnConflictColumns(columns ...string) *TelegramChannelUpsertBulk
- func (_c *TelegramChannelCreateBulk) Save(ctx context.Context) ([]*TelegramChannel, error)
- func (_c *TelegramChannelCreateBulk) SaveX(ctx context.Context) []*TelegramChannel
- type TelegramChannelDelete
- type TelegramChannelDeleteOne
- type TelegramChannelGroupBy
- func (_g *TelegramChannelGroupBy) Aggregate(fns ...AggregateFunc) *TelegramChannelGroupBy
- func (s *TelegramChannelGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *TelegramChannelGroupBy) BoolX(ctx context.Context) bool
- func (s *TelegramChannelGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *TelegramChannelGroupBy) BoolsX(ctx context.Context) []bool
- func (s *TelegramChannelGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *TelegramChannelGroupBy) Float64X(ctx context.Context) float64
- func (s *TelegramChannelGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *TelegramChannelGroupBy) Float64sX(ctx context.Context) []float64
- func (s *TelegramChannelGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *TelegramChannelGroupBy) IntX(ctx context.Context) int
- func (s *TelegramChannelGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *TelegramChannelGroupBy) IntsX(ctx context.Context) []int
- func (_g *TelegramChannelGroupBy) Scan(ctx context.Context, v any) error
- func (s *TelegramChannelGroupBy) ScanX(ctx context.Context, v any)
- func (s *TelegramChannelGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *TelegramChannelGroupBy) StringX(ctx context.Context) string
- func (s *TelegramChannelGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *TelegramChannelGroupBy) StringsX(ctx context.Context) []string
- type TelegramChannelMutation
- func (m *TelegramChannelMutation) AccessHash() (r int64, exists bool)
- func (m *TelegramChannelMutation) Active() (r bool, exists bool)
- func (m *TelegramChannelMutation) AddAccessHash(i int64)
- func (m *TelegramChannelMutation) AddField(name string, value ent.Value) error
- func (m *TelegramChannelMutation) AddedAccessHash() (r int64, exists bool)
- func (m *TelegramChannelMutation) AddedEdges() []string
- func (m *TelegramChannelMutation) AddedField(name string) (ent.Value, bool)
- func (m *TelegramChannelMutation) AddedFields() []string
- func (m *TelegramChannelMutation) AddedIDs(name string) []ent.Value
- func (m *TelegramChannelMutation) ClearEdge(name string) error
- func (m *TelegramChannelMutation) ClearField(name string) error
- func (m *TelegramChannelMutation) ClearedEdges() []string
- func (m *TelegramChannelMutation) ClearedFields() []string
- func (m TelegramChannelMutation) Client() *Client
- func (m *TelegramChannelMutation) EdgeCleared(name string) bool
- func (m *TelegramChannelMutation) Field(name string) (ent.Value, bool)
- func (m *TelegramChannelMutation) FieldCleared(name string) bool
- func (m *TelegramChannelMutation) Fields() []string
- func (m *TelegramChannelMutation) ID() (id int64, exists bool)
- func (m *TelegramChannelMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *TelegramChannelMutation) OldAccessHash(ctx context.Context) (v int64, err error)
- func (m *TelegramChannelMutation) OldActive(ctx context.Context) (v bool, err error)
- func (m *TelegramChannelMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TelegramChannelMutation) OldTitle(ctx context.Context) (v string, err error)
- func (m *TelegramChannelMutation) Op() Op
- func (m *TelegramChannelMutation) RemovedEdges() []string
- func (m *TelegramChannelMutation) RemovedIDs(name string) []ent.Value
- func (m *TelegramChannelMutation) ResetAccessHash()
- func (m *TelegramChannelMutation) ResetActive()
- func (m *TelegramChannelMutation) ResetEdge(name string) error
- func (m *TelegramChannelMutation) ResetField(name string) error
- func (m *TelegramChannelMutation) ResetTitle()
- func (m *TelegramChannelMutation) SetAccessHash(i int64)
- func (m *TelegramChannelMutation) SetActive(b bool)
- func (m *TelegramChannelMutation) SetField(name string, value ent.Value) error
- func (m *TelegramChannelMutation) SetID(id int64)
- func (m *TelegramChannelMutation) SetOp(op Op)
- func (m *TelegramChannelMutation) SetTitle(s string)
- func (m *TelegramChannelMutation) Title() (r string, exists bool)
- func (m TelegramChannelMutation) Tx() (*Tx, error)
- func (m *TelegramChannelMutation) Type() string
- func (m *TelegramChannelMutation) Where(ps ...predicate.TelegramChannel)
- func (m *TelegramChannelMutation) WhereP(ps ...func(*sql.Selector))
- type TelegramChannelQuery
- func (_q *TelegramChannelQuery) Aggregate(fns ...AggregateFunc) *TelegramChannelSelect
- func (_q *TelegramChannelQuery) All(ctx context.Context) ([]*TelegramChannel, error)
- func (_q *TelegramChannelQuery) AllX(ctx context.Context) []*TelegramChannel
- func (_q *TelegramChannelQuery) Clone() *TelegramChannelQuery
- func (_q *TelegramChannelQuery) Count(ctx context.Context) (int, error)
- func (_q *TelegramChannelQuery) CountX(ctx context.Context) int
- func (_q *TelegramChannelQuery) Exist(ctx context.Context) (bool, error)
- func (_q *TelegramChannelQuery) ExistX(ctx context.Context) bool
- func (_q *TelegramChannelQuery) First(ctx context.Context) (*TelegramChannel, error)
- func (_q *TelegramChannelQuery) FirstID(ctx context.Context) (id int64, err error)
- func (_q *TelegramChannelQuery) FirstIDX(ctx context.Context) int64
- func (_q *TelegramChannelQuery) FirstX(ctx context.Context) *TelegramChannel
- func (_q *TelegramChannelQuery) GroupBy(field string, fields ...string) *TelegramChannelGroupBy
- func (_q *TelegramChannelQuery) IDs(ctx context.Context) (ids []int64, err error)
- func (_q *TelegramChannelQuery) IDsX(ctx context.Context) []int64
- func (_q *TelegramChannelQuery) Limit(limit int) *TelegramChannelQuery
- func (_q *TelegramChannelQuery) Offset(offset int) *TelegramChannelQuery
- func (_q *TelegramChannelQuery) Only(ctx context.Context) (*TelegramChannel, error)
- func (_q *TelegramChannelQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (_q *TelegramChannelQuery) OnlyIDX(ctx context.Context) int64
- func (_q *TelegramChannelQuery) OnlyX(ctx context.Context) *TelegramChannel
- func (_q *TelegramChannelQuery) Order(o ...telegramchannel.OrderOption) *TelegramChannelQuery
- func (_q *TelegramChannelQuery) Select(fields ...string) *TelegramChannelSelect
- func (_q *TelegramChannelQuery) Unique(unique bool) *TelegramChannelQuery
- func (_q *TelegramChannelQuery) Where(ps ...predicate.TelegramChannel) *TelegramChannelQuery
- type TelegramChannelSelect
- func (_s *TelegramChannelSelect) Aggregate(fns ...AggregateFunc) *TelegramChannelSelect
- func (s *TelegramChannelSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *TelegramChannelSelect) BoolX(ctx context.Context) bool
- func (s *TelegramChannelSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *TelegramChannelSelect) BoolsX(ctx context.Context) []bool
- func (s *TelegramChannelSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *TelegramChannelSelect) Float64X(ctx context.Context) float64
- func (s *TelegramChannelSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *TelegramChannelSelect) Float64sX(ctx context.Context) []float64
- func (s *TelegramChannelSelect) Int(ctx context.Context) (_ int, err error)
- func (s *TelegramChannelSelect) IntX(ctx context.Context) int
- func (s *TelegramChannelSelect) Ints(ctx context.Context) ([]int, error)
- func (s *TelegramChannelSelect) IntsX(ctx context.Context) []int
- func (_s *TelegramChannelSelect) Scan(ctx context.Context, v any) error
- func (s *TelegramChannelSelect) ScanX(ctx context.Context, v any)
- func (s *TelegramChannelSelect) String(ctx context.Context) (_ string, err error)
- func (s *TelegramChannelSelect) StringX(ctx context.Context) string
- func (s *TelegramChannelSelect) Strings(ctx context.Context) ([]string, error)
- func (s *TelegramChannelSelect) StringsX(ctx context.Context) []string
- type TelegramChannelUpdate
- func (_u *TelegramChannelUpdate) AddAccessHash(v int64) *TelegramChannelUpdate
- func (_u *TelegramChannelUpdate) Exec(ctx context.Context) error
- func (_u *TelegramChannelUpdate) ExecX(ctx context.Context)
- func (_u *TelegramChannelUpdate) Mutation() *TelegramChannelMutation
- func (_u *TelegramChannelUpdate) Save(ctx context.Context) (int, error)
- func (_u *TelegramChannelUpdate) SaveX(ctx context.Context) int
- func (_u *TelegramChannelUpdate) SetAccessHash(v int64) *TelegramChannelUpdate
- func (_u *TelegramChannelUpdate) SetActive(v bool) *TelegramChannelUpdate
- func (_u *TelegramChannelUpdate) SetNillableAccessHash(v *int64) *TelegramChannelUpdate
- func (_u *TelegramChannelUpdate) SetNillableActive(v *bool) *TelegramChannelUpdate
- func (_u *TelegramChannelUpdate) SetNillableTitle(v *string) *TelegramChannelUpdate
- func (_u *TelegramChannelUpdate) SetTitle(v string) *TelegramChannelUpdate
- func (_u *TelegramChannelUpdate) Where(ps ...predicate.TelegramChannel) *TelegramChannelUpdate
- type TelegramChannelUpdateOne
- func (_u *TelegramChannelUpdateOne) AddAccessHash(v int64) *TelegramChannelUpdateOne
- func (_u *TelegramChannelUpdateOne) Exec(ctx context.Context) error
- func (_u *TelegramChannelUpdateOne) ExecX(ctx context.Context)
- func (_u *TelegramChannelUpdateOne) Mutation() *TelegramChannelMutation
- func (_u *TelegramChannelUpdateOne) Save(ctx context.Context) (*TelegramChannel, error)
- func (_u *TelegramChannelUpdateOne) SaveX(ctx context.Context) *TelegramChannel
- func (_u *TelegramChannelUpdateOne) Select(field string, fields ...string) *TelegramChannelUpdateOne
- func (_u *TelegramChannelUpdateOne) SetAccessHash(v int64) *TelegramChannelUpdateOne
- func (_u *TelegramChannelUpdateOne) SetActive(v bool) *TelegramChannelUpdateOne
- func (_u *TelegramChannelUpdateOne) SetNillableAccessHash(v *int64) *TelegramChannelUpdateOne
- func (_u *TelegramChannelUpdateOne) SetNillableActive(v *bool) *TelegramChannelUpdateOne
- func (_u *TelegramChannelUpdateOne) SetNillableTitle(v *string) *TelegramChannelUpdateOne
- func (_u *TelegramChannelUpdateOne) SetTitle(v string) *TelegramChannelUpdateOne
- func (_u *TelegramChannelUpdateOne) Where(ps ...predicate.TelegramChannel) *TelegramChannelUpdateOne
- type TelegramChannelUpsert
- func (u *TelegramChannelUpsert) AddAccessHash(v int64) *TelegramChannelUpsert
- func (u *TelegramChannelUpsert) SetAccessHash(v int64) *TelegramChannelUpsert
- func (u *TelegramChannelUpsert) SetActive(v bool) *TelegramChannelUpsert
- func (u *TelegramChannelUpsert) SetTitle(v string) *TelegramChannelUpsert
- func (u *TelegramChannelUpsert) UpdateAccessHash() *TelegramChannelUpsert
- func (u *TelegramChannelUpsert) UpdateActive() *TelegramChannelUpsert
- func (u *TelegramChannelUpsert) UpdateTitle() *TelegramChannelUpsert
- type TelegramChannelUpsertBulk
- func (u *TelegramChannelUpsertBulk) AddAccessHash(v int64) *TelegramChannelUpsertBulk
- func (u *TelegramChannelUpsertBulk) DoNothing() *TelegramChannelUpsertBulk
- func (u *TelegramChannelUpsertBulk) Exec(ctx context.Context) error
- func (u *TelegramChannelUpsertBulk) ExecX(ctx context.Context)
- func (u *TelegramChannelUpsertBulk) Ignore() *TelegramChannelUpsertBulk
- func (u *TelegramChannelUpsertBulk) SetAccessHash(v int64) *TelegramChannelUpsertBulk
- func (u *TelegramChannelUpsertBulk) SetActive(v bool) *TelegramChannelUpsertBulk
- func (u *TelegramChannelUpsertBulk) SetTitle(v string) *TelegramChannelUpsertBulk
- func (u *TelegramChannelUpsertBulk) Update(set func(*TelegramChannelUpsert)) *TelegramChannelUpsertBulk
- func (u *TelegramChannelUpsertBulk) UpdateAccessHash() *TelegramChannelUpsertBulk
- func (u *TelegramChannelUpsertBulk) UpdateActive() *TelegramChannelUpsertBulk
- func (u *TelegramChannelUpsertBulk) UpdateNewValues() *TelegramChannelUpsertBulk
- func (u *TelegramChannelUpsertBulk) UpdateTitle() *TelegramChannelUpsertBulk
- type TelegramChannelUpsertOne
- func (u *TelegramChannelUpsertOne) AddAccessHash(v int64) *TelegramChannelUpsertOne
- func (u *TelegramChannelUpsertOne) DoNothing() *TelegramChannelUpsertOne
- func (u *TelegramChannelUpsertOne) Exec(ctx context.Context) error
- func (u *TelegramChannelUpsertOne) ExecX(ctx context.Context)
- func (u *TelegramChannelUpsertOne) ID(ctx context.Context) (id int64, err error)
- func (u *TelegramChannelUpsertOne) IDX(ctx context.Context) int64
- func (u *TelegramChannelUpsertOne) Ignore() *TelegramChannelUpsertOne
- func (u *TelegramChannelUpsertOne) SetAccessHash(v int64) *TelegramChannelUpsertOne
- func (u *TelegramChannelUpsertOne) SetActive(v bool) *TelegramChannelUpsertOne
- func (u *TelegramChannelUpsertOne) SetTitle(v string) *TelegramChannelUpsertOne
- func (u *TelegramChannelUpsertOne) Update(set func(*TelegramChannelUpsert)) *TelegramChannelUpsertOne
- func (u *TelegramChannelUpsertOne) UpdateAccessHash() *TelegramChannelUpsertOne
- func (u *TelegramChannelUpsertOne) UpdateActive() *TelegramChannelUpsertOne
- func (u *TelegramChannelUpsertOne) UpdateNewValues() *TelegramChannelUpsertOne
- func (u *TelegramChannelUpsertOne) UpdateTitle() *TelegramChannelUpsertOne
- type TelegramChannels
- type TelegramSession
- type TelegramSessionClient
- func (c *TelegramSessionClient) Create() *TelegramSessionCreate
- func (c *TelegramSessionClient) CreateBulk(builders ...*TelegramSessionCreate) *TelegramSessionCreateBulk
- func (c *TelegramSessionClient) Delete() *TelegramSessionDelete
- func (c *TelegramSessionClient) DeleteOne(_m *TelegramSession) *TelegramSessionDeleteOne
- func (c *TelegramSessionClient) DeleteOneID(id int) *TelegramSessionDeleteOne
- func (c *TelegramSessionClient) Get(ctx context.Context, id int) (*TelegramSession, error)
- func (c *TelegramSessionClient) GetX(ctx context.Context, id int) *TelegramSession
- func (c *TelegramSessionClient) Hooks() []Hook
- func (c *TelegramSessionClient) Intercept(interceptors ...Interceptor)
- func (c *TelegramSessionClient) Interceptors() []Interceptor
- func (c *TelegramSessionClient) MapCreateBulk(slice any, setFunc func(*TelegramSessionCreate, int)) *TelegramSessionCreateBulk
- func (c *TelegramSessionClient) Query() *TelegramSessionQuery
- func (c *TelegramSessionClient) Update() *TelegramSessionUpdate
- func (c *TelegramSessionClient) UpdateOne(_m *TelegramSession) *TelegramSessionUpdateOne
- func (c *TelegramSessionClient) UpdateOneID(id int) *TelegramSessionUpdateOne
- func (c *TelegramSessionClient) Use(hooks ...Hook)
- type TelegramSessionCreate
- func (_c *TelegramSessionCreate) Exec(ctx context.Context) error
- func (_c *TelegramSessionCreate) ExecX(ctx context.Context)
- func (_c *TelegramSessionCreate) Mutation() *TelegramSessionMutation
- func (_c *TelegramSessionCreate) OnConflict(opts ...sql.ConflictOption) *TelegramSessionUpsertOne
- func (_c *TelegramSessionCreate) OnConflictColumns(columns ...string) *TelegramSessionUpsertOne
- func (_c *TelegramSessionCreate) Save(ctx context.Context) (*TelegramSession, error)
- func (_c *TelegramSessionCreate) SaveX(ctx context.Context) *TelegramSession
- func (_c *TelegramSessionCreate) SetData(v []byte) *TelegramSessionCreate
- func (_c *TelegramSessionCreate) SetID(v int) *TelegramSessionCreate
- type TelegramSessionCreateBulk
- func (_c *TelegramSessionCreateBulk) Exec(ctx context.Context) error
- func (_c *TelegramSessionCreateBulk) ExecX(ctx context.Context)
- func (_c *TelegramSessionCreateBulk) OnConflict(opts ...sql.ConflictOption) *TelegramSessionUpsertBulk
- func (_c *TelegramSessionCreateBulk) OnConflictColumns(columns ...string) *TelegramSessionUpsertBulk
- func (_c *TelegramSessionCreateBulk) Save(ctx context.Context) ([]*TelegramSession, error)
- func (_c *TelegramSessionCreateBulk) SaveX(ctx context.Context) []*TelegramSession
- type TelegramSessionDelete
- type TelegramSessionDeleteOne
- type TelegramSessionGroupBy
- func (_g *TelegramSessionGroupBy) Aggregate(fns ...AggregateFunc) *TelegramSessionGroupBy
- func (s *TelegramSessionGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *TelegramSessionGroupBy) BoolX(ctx context.Context) bool
- func (s *TelegramSessionGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *TelegramSessionGroupBy) BoolsX(ctx context.Context) []bool
- func (s *TelegramSessionGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *TelegramSessionGroupBy) Float64X(ctx context.Context) float64
- func (s *TelegramSessionGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *TelegramSessionGroupBy) Float64sX(ctx context.Context) []float64
- func (s *TelegramSessionGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *TelegramSessionGroupBy) IntX(ctx context.Context) int
- func (s *TelegramSessionGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *TelegramSessionGroupBy) IntsX(ctx context.Context) []int
- func (_g *TelegramSessionGroupBy) Scan(ctx context.Context, v any) error
- func (s *TelegramSessionGroupBy) ScanX(ctx context.Context, v any)
- func (s *TelegramSessionGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *TelegramSessionGroupBy) StringX(ctx context.Context) string
- func (s *TelegramSessionGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *TelegramSessionGroupBy) StringsX(ctx context.Context) []string
- type TelegramSessionMutation
- func (m *TelegramSessionMutation) AddField(name string, value ent.Value) error
- func (m *TelegramSessionMutation) AddedEdges() []string
- func (m *TelegramSessionMutation) AddedField(name string) (ent.Value, bool)
- func (m *TelegramSessionMutation) AddedFields() []string
- func (m *TelegramSessionMutation) AddedIDs(name string) []ent.Value
- func (m *TelegramSessionMutation) ClearEdge(name string) error
- func (m *TelegramSessionMutation) ClearField(name string) error
- func (m *TelegramSessionMutation) ClearedEdges() []string
- func (m *TelegramSessionMutation) ClearedFields() []string
- func (m TelegramSessionMutation) Client() *Client
- func (m *TelegramSessionMutation) Data() (r []byte, exists bool)
- func (m *TelegramSessionMutation) EdgeCleared(name string) bool
- func (m *TelegramSessionMutation) Field(name string) (ent.Value, bool)
- func (m *TelegramSessionMutation) FieldCleared(name string) bool
- func (m *TelegramSessionMutation) Fields() []string
- func (m *TelegramSessionMutation) ID() (id int, exists bool)
- func (m *TelegramSessionMutation) IDs(ctx context.Context) ([]int, error)
- func (m *TelegramSessionMutation) OldData(ctx context.Context) (v []byte, err error)
- func (m *TelegramSessionMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TelegramSessionMutation) Op() Op
- func (m *TelegramSessionMutation) RemovedEdges() []string
- func (m *TelegramSessionMutation) RemovedIDs(name string) []ent.Value
- func (m *TelegramSessionMutation) ResetData()
- func (m *TelegramSessionMutation) ResetEdge(name string) error
- func (m *TelegramSessionMutation) ResetField(name string) error
- func (m *TelegramSessionMutation) SetData(b []byte)
- func (m *TelegramSessionMutation) SetField(name string, value ent.Value) error
- func (m *TelegramSessionMutation) SetID(id int)
- func (m *TelegramSessionMutation) SetOp(op Op)
- func (m TelegramSessionMutation) Tx() (*Tx, error)
- func (m *TelegramSessionMutation) Type() string
- func (m *TelegramSessionMutation) Where(ps ...predicate.TelegramSession)
- func (m *TelegramSessionMutation) WhereP(ps ...func(*sql.Selector))
- type TelegramSessionQuery
- func (_q *TelegramSessionQuery) Aggregate(fns ...AggregateFunc) *TelegramSessionSelect
- func (_q *TelegramSessionQuery) All(ctx context.Context) ([]*TelegramSession, error)
- func (_q *TelegramSessionQuery) AllX(ctx context.Context) []*TelegramSession
- func (_q *TelegramSessionQuery) Clone() *TelegramSessionQuery
- func (_q *TelegramSessionQuery) Count(ctx context.Context) (int, error)
- func (_q *TelegramSessionQuery) CountX(ctx context.Context) int
- func (_q *TelegramSessionQuery) Exist(ctx context.Context) (bool, error)
- func (_q *TelegramSessionQuery) ExistX(ctx context.Context) bool
- func (_q *TelegramSessionQuery) First(ctx context.Context) (*TelegramSession, error)
- func (_q *TelegramSessionQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *TelegramSessionQuery) FirstIDX(ctx context.Context) int
- func (_q *TelegramSessionQuery) FirstX(ctx context.Context) *TelegramSession
- func (_q *TelegramSessionQuery) GroupBy(field string, fields ...string) *TelegramSessionGroupBy
- func (_q *TelegramSessionQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *TelegramSessionQuery) IDsX(ctx context.Context) []int
- func (_q *TelegramSessionQuery) Limit(limit int) *TelegramSessionQuery
- func (_q *TelegramSessionQuery) Offset(offset int) *TelegramSessionQuery
- func (_q *TelegramSessionQuery) Only(ctx context.Context) (*TelegramSession, error)
- func (_q *TelegramSessionQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *TelegramSessionQuery) OnlyIDX(ctx context.Context) int
- func (_q *TelegramSessionQuery) OnlyX(ctx context.Context) *TelegramSession
- func (_q *TelegramSessionQuery) Order(o ...telegramsession.OrderOption) *TelegramSessionQuery
- func (_q *TelegramSessionQuery) Select(fields ...string) *TelegramSessionSelect
- func (_q *TelegramSessionQuery) Unique(unique bool) *TelegramSessionQuery
- func (_q *TelegramSessionQuery) Where(ps ...predicate.TelegramSession) *TelegramSessionQuery
- type TelegramSessionSelect
- func (_s *TelegramSessionSelect) Aggregate(fns ...AggregateFunc) *TelegramSessionSelect
- func (s *TelegramSessionSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *TelegramSessionSelect) BoolX(ctx context.Context) bool
- func (s *TelegramSessionSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *TelegramSessionSelect) BoolsX(ctx context.Context) []bool
- func (s *TelegramSessionSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *TelegramSessionSelect) Float64X(ctx context.Context) float64
- func (s *TelegramSessionSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *TelegramSessionSelect) Float64sX(ctx context.Context) []float64
- func (s *TelegramSessionSelect) Int(ctx context.Context) (_ int, err error)
- func (s *TelegramSessionSelect) IntX(ctx context.Context) int
- func (s *TelegramSessionSelect) Ints(ctx context.Context) ([]int, error)
- func (s *TelegramSessionSelect) IntsX(ctx context.Context) []int
- func (_s *TelegramSessionSelect) Scan(ctx context.Context, v any) error
- func (s *TelegramSessionSelect) ScanX(ctx context.Context, v any)
- func (s *TelegramSessionSelect) String(ctx context.Context) (_ string, err error)
- func (s *TelegramSessionSelect) StringX(ctx context.Context) string
- func (s *TelegramSessionSelect) Strings(ctx context.Context) ([]string, error)
- func (s *TelegramSessionSelect) StringsX(ctx context.Context) []string
- type TelegramSessionUpdate
- func (_u *TelegramSessionUpdate) Exec(ctx context.Context) error
- func (_u *TelegramSessionUpdate) ExecX(ctx context.Context)
- func (_u *TelegramSessionUpdate) Mutation() *TelegramSessionMutation
- func (_u *TelegramSessionUpdate) Save(ctx context.Context) (int, error)
- func (_u *TelegramSessionUpdate) SaveX(ctx context.Context) int
- func (_u *TelegramSessionUpdate) SetData(v []byte) *TelegramSessionUpdate
- func (_u *TelegramSessionUpdate) Where(ps ...predicate.TelegramSession) *TelegramSessionUpdate
- type TelegramSessionUpdateOne
- func (_u *TelegramSessionUpdateOne) Exec(ctx context.Context) error
- func (_u *TelegramSessionUpdateOne) ExecX(ctx context.Context)
- func (_u *TelegramSessionUpdateOne) Mutation() *TelegramSessionMutation
- func (_u *TelegramSessionUpdateOne) Save(ctx context.Context) (*TelegramSession, error)
- func (_u *TelegramSessionUpdateOne) SaveX(ctx context.Context) *TelegramSession
- func (_u *TelegramSessionUpdateOne) Select(field string, fields ...string) *TelegramSessionUpdateOne
- func (_u *TelegramSessionUpdateOne) SetData(v []byte) *TelegramSessionUpdateOne
- func (_u *TelegramSessionUpdateOne) Where(ps ...predicate.TelegramSession) *TelegramSessionUpdateOne
- type TelegramSessionUpsert
- type TelegramSessionUpsertBulk
- func (u *TelegramSessionUpsertBulk) DoNothing() *TelegramSessionUpsertBulk
- func (u *TelegramSessionUpsertBulk) Exec(ctx context.Context) error
- func (u *TelegramSessionUpsertBulk) ExecX(ctx context.Context)
- func (u *TelegramSessionUpsertBulk) Ignore() *TelegramSessionUpsertBulk
- func (u *TelegramSessionUpsertBulk) SetData(v []byte) *TelegramSessionUpsertBulk
- func (u *TelegramSessionUpsertBulk) Update(set func(*TelegramSessionUpsert)) *TelegramSessionUpsertBulk
- func (u *TelegramSessionUpsertBulk) UpdateData() *TelegramSessionUpsertBulk
- func (u *TelegramSessionUpsertBulk) UpdateNewValues() *TelegramSessionUpsertBulk
- type TelegramSessionUpsertOne
- func (u *TelegramSessionUpsertOne) DoNothing() *TelegramSessionUpsertOne
- func (u *TelegramSessionUpsertOne) Exec(ctx context.Context) error
- func (u *TelegramSessionUpsertOne) ExecX(ctx context.Context)
- func (u *TelegramSessionUpsertOne) ID(ctx context.Context) (id int, err error)
- func (u *TelegramSessionUpsertOne) IDX(ctx context.Context) int
- func (u *TelegramSessionUpsertOne) Ignore() *TelegramSessionUpsertOne
- func (u *TelegramSessionUpsertOne) SetData(v []byte) *TelegramSessionUpsertOne
- func (u *TelegramSessionUpsertOne) Update(set func(*TelegramSessionUpsert)) *TelegramSessionUpsertOne
- func (u *TelegramSessionUpsertOne) UpdateData() *TelegramSessionUpsertOne
- func (u *TelegramSessionUpsertOne) UpdateNewValues() *TelegramSessionUpsertOne
- type TelegramSessions
- type TraverseFunc
- type Traverser
- type Tx
- 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. TypeTelegramChannel = "TelegramChannel" TypeTelegramSession = "TelegramSession" )
Variables ¶
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Client ¶
type Client struct {
// Schema is the client for creating, migrating and dropping schema.
Schema *migrate.Schema
// TelegramChannel is the client for interacting with the TelegramChannel builders.
TelegramChannel *TelegramChannelClient
// TelegramSession is the client for interacting with the TelegramSession builders.
TelegramSession *TelegramSessionClient
// 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(). TelegramChannel. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer {
return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
// Do some stuff before.
if err := next.Commit(ctx, tx); err != nil {
return err
}
// Do some stuff after.
return nil
})
}
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker {
return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
// Do some stuff before.
if err := next.Rollback(ctx, tx); err != nil {
return err
}
// Do some stuff after.
return nil
})
}
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type TelegramChannel ¶
type TelegramChannel struct {
// ID of the ent.
ID int64 `json:"id,omitempty"`
// AccessHash holds the value of the "access_hash" field.
AccessHash int64 `json:"access_hash,omitempty"`
// Title holds the value of the "title" field.
Title string `json:"title,omitempty"`
// Active holds the value of the "active" field.
Active bool `json:"active,omitempty"`
// contains filtered or unexported fields
}
TelegramChannel is the model entity for the TelegramChannel schema.
func (*TelegramChannel) String ¶
func (_m *TelegramChannel) String() string
String implements the fmt.Stringer.
func (*TelegramChannel) Unwrap ¶
func (_m *TelegramChannel) Unwrap() *TelegramChannel
Unwrap unwraps the TelegramChannel 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 (*TelegramChannel) Update ¶
func (_m *TelegramChannel) Update() *TelegramChannelUpdateOne
Update returns a builder for updating this TelegramChannel. Note that you need to call TelegramChannel.Unwrap() before calling this method if this TelegramChannel was returned from a transaction, and the transaction was committed or rolled back.
type TelegramChannelClient ¶
type TelegramChannelClient struct {
// contains filtered or unexported fields
}
TelegramChannelClient is a client for the TelegramChannel schema.
func NewTelegramChannelClient ¶
func NewTelegramChannelClient(c config) *TelegramChannelClient
NewTelegramChannelClient returns a client for the TelegramChannel from the given config.
func (*TelegramChannelClient) Create ¶
func (c *TelegramChannelClient) Create() *TelegramChannelCreate
Create returns a builder for creating a TelegramChannel entity.
func (*TelegramChannelClient) CreateBulk ¶
func (c *TelegramChannelClient) CreateBulk(builders ...*TelegramChannelCreate) *TelegramChannelCreateBulk
CreateBulk returns a builder for creating a bulk of TelegramChannel entities.
func (*TelegramChannelClient) Delete ¶
func (c *TelegramChannelClient) Delete() *TelegramChannelDelete
Delete returns a delete builder for TelegramChannel.
func (*TelegramChannelClient) DeleteOne ¶
func (c *TelegramChannelClient) DeleteOne(_m *TelegramChannel) *TelegramChannelDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*TelegramChannelClient) DeleteOneID ¶
func (c *TelegramChannelClient) DeleteOneID(id int64) *TelegramChannelDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*TelegramChannelClient) Get ¶
func (c *TelegramChannelClient) Get(ctx context.Context, id int64) (*TelegramChannel, error)
Get returns a TelegramChannel entity by its id.
func (*TelegramChannelClient) GetX ¶
func (c *TelegramChannelClient) GetX(ctx context.Context, id int64) *TelegramChannel
GetX is like Get, but panics if an error occurs.
func (*TelegramChannelClient) Hooks ¶
func (c *TelegramChannelClient) Hooks() []Hook
Hooks returns the client hooks.
func (*TelegramChannelClient) Intercept ¶
func (c *TelegramChannelClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `telegramchannel.Intercept(f(g(h())))`.
func (*TelegramChannelClient) Interceptors ¶
func (c *TelegramChannelClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*TelegramChannelClient) MapCreateBulk ¶
func (c *TelegramChannelClient) MapCreateBulk(slice any, setFunc func(*TelegramChannelCreate, int)) *TelegramChannelCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*TelegramChannelClient) Query ¶
func (c *TelegramChannelClient) Query() *TelegramChannelQuery
Query returns a query builder for TelegramChannel.
func (*TelegramChannelClient) Update ¶
func (c *TelegramChannelClient) Update() *TelegramChannelUpdate
Update returns an update builder for TelegramChannel.
func (*TelegramChannelClient) UpdateOne ¶
func (c *TelegramChannelClient) UpdateOne(_m *TelegramChannel) *TelegramChannelUpdateOne
UpdateOne returns an update builder for the given entity.
func (*TelegramChannelClient) UpdateOneID ¶
func (c *TelegramChannelClient) UpdateOneID(id int64) *TelegramChannelUpdateOne
UpdateOneID returns an update builder for the given id.
func (*TelegramChannelClient) Use ¶
func (c *TelegramChannelClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `telegramchannel.Hooks(f(g(h())))`.
type TelegramChannelCreate ¶
type TelegramChannelCreate struct {
// contains filtered or unexported fields
}
TelegramChannelCreate is the builder for creating a TelegramChannel entity.
func (*TelegramChannelCreate) Exec ¶
func (_c *TelegramChannelCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*TelegramChannelCreate) ExecX ¶
func (_c *TelegramChannelCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TelegramChannelCreate) Mutation ¶
func (_c *TelegramChannelCreate) Mutation() *TelegramChannelMutation
Mutation returns the TelegramChannelMutation object of the builder.
func (*TelegramChannelCreate) OnConflict ¶
func (_c *TelegramChannelCreate) OnConflict(opts ...sql.ConflictOption) *TelegramChannelUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.TelegramChannel.Create().
SetAccessHash(v).
OnConflict(
// Update the row with the new values
// the was proposed for insertion.
sql.ResolveWithNewValues(),
).
// Override some of the fields with custom
// update values.
Update(func(u *ent.TelegramChannelUpsert) {
SetAccessHash(v+v).
}).
Exec(ctx)
func (*TelegramChannelCreate) OnConflictColumns ¶
func (_c *TelegramChannelCreate) OnConflictColumns(columns ...string) *TelegramChannelUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.TelegramChannel.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*TelegramChannelCreate) Save ¶
func (_c *TelegramChannelCreate) Save(ctx context.Context) (*TelegramChannel, error)
Save creates the TelegramChannel in the database.
func (*TelegramChannelCreate) SaveX ¶
func (_c *TelegramChannelCreate) SaveX(ctx context.Context) *TelegramChannel
SaveX calls Save and panics if Save returns an error.
func (*TelegramChannelCreate) SetAccessHash ¶
func (_c *TelegramChannelCreate) SetAccessHash(v int64) *TelegramChannelCreate
SetAccessHash sets the "access_hash" field.
func (*TelegramChannelCreate) SetActive ¶
func (_c *TelegramChannelCreate) SetActive(v bool) *TelegramChannelCreate
SetActive sets the "active" field.
func (*TelegramChannelCreate) SetID ¶
func (_c *TelegramChannelCreate) SetID(v int64) *TelegramChannelCreate
SetID sets the "id" field.
func (*TelegramChannelCreate) SetTitle ¶
func (_c *TelegramChannelCreate) SetTitle(v string) *TelegramChannelCreate
SetTitle sets the "title" field.
type TelegramChannelCreateBulk ¶
type TelegramChannelCreateBulk struct {
// contains filtered or unexported fields
}
TelegramChannelCreateBulk is the builder for creating many TelegramChannel entities in bulk.
func (*TelegramChannelCreateBulk) Exec ¶
func (_c *TelegramChannelCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TelegramChannelCreateBulk) ExecX ¶
func (_c *TelegramChannelCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TelegramChannelCreateBulk) OnConflict ¶
func (_c *TelegramChannelCreateBulk) OnConflict(opts ...sql.ConflictOption) *TelegramChannelUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.TelegramChannel.CreateBulk(builders...).
OnConflict(
// Update the row with the new values
// the was proposed for insertion.
sql.ResolveWithNewValues(),
).
// Override some of the fields with custom
// update values.
Update(func(u *ent.TelegramChannelUpsert) {
SetAccessHash(v+v).
}).
Exec(ctx)
func (*TelegramChannelCreateBulk) OnConflictColumns ¶
func (_c *TelegramChannelCreateBulk) OnConflictColumns(columns ...string) *TelegramChannelUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.TelegramChannel.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*TelegramChannelCreateBulk) Save ¶
func (_c *TelegramChannelCreateBulk) Save(ctx context.Context) ([]*TelegramChannel, error)
Save creates the TelegramChannel entities in the database.
func (*TelegramChannelCreateBulk) SaveX ¶
func (_c *TelegramChannelCreateBulk) SaveX(ctx context.Context) []*TelegramChannel
SaveX is like Save, but panics if an error occurs.
type TelegramChannelDelete ¶
type TelegramChannelDelete struct {
// contains filtered or unexported fields
}
TelegramChannelDelete is the builder for deleting a TelegramChannel entity.
func (*TelegramChannelDelete) Exec ¶
func (_d *TelegramChannelDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*TelegramChannelDelete) ExecX ¶
func (_d *TelegramChannelDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*TelegramChannelDelete) Where ¶
func (_d *TelegramChannelDelete) Where(ps ...predicate.TelegramChannel) *TelegramChannelDelete
Where appends a list predicates to the TelegramChannelDelete builder.
type TelegramChannelDeleteOne ¶
type TelegramChannelDeleteOne struct {
// contains filtered or unexported fields
}
TelegramChannelDeleteOne is the builder for deleting a single TelegramChannel entity.
func (*TelegramChannelDeleteOne) Exec ¶
func (_d *TelegramChannelDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*TelegramChannelDeleteOne) ExecX ¶
func (_d *TelegramChannelDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TelegramChannelDeleteOne) Where ¶
func (_d *TelegramChannelDeleteOne) Where(ps ...predicate.TelegramChannel) *TelegramChannelDeleteOne
Where appends a list predicates to the TelegramChannelDelete builder.
type TelegramChannelGroupBy ¶
type TelegramChannelGroupBy struct {
// contains filtered or unexported fields
}
TelegramChannelGroupBy is the group-by builder for TelegramChannel entities.
func (*TelegramChannelGroupBy) Aggregate ¶
func (_g *TelegramChannelGroupBy) Aggregate(fns ...AggregateFunc) *TelegramChannelGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*TelegramChannelGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TelegramChannelGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TelegramChannelGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TelegramChannelGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TelegramChannelGroupBy) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*TelegramChannelGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TelegramChannelGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TelegramChannelGroupBy) Scan ¶
func (_g *TelegramChannelGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TelegramChannelGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TelegramChannelMutation ¶
type TelegramChannelMutation struct {
// contains filtered or unexported fields
}
TelegramChannelMutation represents an operation that mutates the TelegramChannel nodes in the graph.
func (*TelegramChannelMutation) AccessHash ¶
func (m *TelegramChannelMutation) AccessHash() (r int64, exists bool)
AccessHash returns the value of the "access_hash" field in the mutation.
func (*TelegramChannelMutation) Active ¶
func (m *TelegramChannelMutation) Active() (r bool, exists bool)
Active returns the value of the "active" field in the mutation.
func (*TelegramChannelMutation) AddAccessHash ¶
func (m *TelegramChannelMutation) AddAccessHash(i int64)
AddAccessHash adds i to the "access_hash" field.
func (*TelegramChannelMutation) AddField ¶
func (m *TelegramChannelMutation) 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 (*TelegramChannelMutation) AddedAccessHash ¶
func (m *TelegramChannelMutation) AddedAccessHash() (r int64, exists bool)
AddedAccessHash returns the value that was added to the "access_hash" field in this mutation.
func (*TelegramChannelMutation) AddedEdges ¶
func (m *TelegramChannelMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*TelegramChannelMutation) AddedField ¶
func (m *TelegramChannelMutation) 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 (*TelegramChannelMutation) AddedFields ¶
func (m *TelegramChannelMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*TelegramChannelMutation) AddedIDs ¶
func (m *TelegramChannelMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*TelegramChannelMutation) ClearEdge ¶
func (m *TelegramChannelMutation) 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 (*TelegramChannelMutation) ClearField ¶
func (m *TelegramChannelMutation) 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 (*TelegramChannelMutation) ClearedEdges ¶
func (m *TelegramChannelMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*TelegramChannelMutation) ClearedFields ¶
func (m *TelegramChannelMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (TelegramChannelMutation) Client ¶
func (m TelegramChannelMutation) 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 (*TelegramChannelMutation) EdgeCleared ¶
func (m *TelegramChannelMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*TelegramChannelMutation) Field ¶
func (m *TelegramChannelMutation) 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 (*TelegramChannelMutation) FieldCleared ¶
func (m *TelegramChannelMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*TelegramChannelMutation) Fields ¶
func (m *TelegramChannelMutation) 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 (*TelegramChannelMutation) ID ¶
func (m *TelegramChannelMutation) ID() (id int64, 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 (*TelegramChannelMutation) IDs ¶
func (m *TelegramChannelMutation) IDs(ctx context.Context) ([]int64, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*TelegramChannelMutation) OldAccessHash ¶
func (m *TelegramChannelMutation) OldAccessHash(ctx context.Context) (v int64, err error)
OldAccessHash returns the old "access_hash" field's value of the TelegramChannel entity. If the TelegramChannel 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 (*TelegramChannelMutation) OldActive ¶
func (m *TelegramChannelMutation) OldActive(ctx context.Context) (v bool, err error)
OldActive returns the old "active" field's value of the TelegramChannel entity. If the TelegramChannel 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 (*TelegramChannelMutation) 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 (*TelegramChannelMutation) OldTitle ¶
func (m *TelegramChannelMutation) OldTitle(ctx context.Context) (v string, err error)
OldTitle returns the old "title" field's value of the TelegramChannel entity. If the TelegramChannel 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 (*TelegramChannelMutation) Op ¶
func (m *TelegramChannelMutation) Op() Op
Op returns the operation name.
func (*TelegramChannelMutation) RemovedEdges ¶
func (m *TelegramChannelMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*TelegramChannelMutation) RemovedIDs ¶
func (m *TelegramChannelMutation) 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 (*TelegramChannelMutation) ResetAccessHash ¶
func (m *TelegramChannelMutation) ResetAccessHash()
ResetAccessHash resets all changes to the "access_hash" field.
func (*TelegramChannelMutation) ResetActive ¶
func (m *TelegramChannelMutation) ResetActive()
ResetActive resets all changes to the "active" field.
func (*TelegramChannelMutation) ResetEdge ¶
func (m *TelegramChannelMutation) 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 (*TelegramChannelMutation) ResetField ¶
func (m *TelegramChannelMutation) 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 (*TelegramChannelMutation) ResetTitle ¶
func (m *TelegramChannelMutation) ResetTitle()
ResetTitle resets all changes to the "title" field.
func (*TelegramChannelMutation) SetAccessHash ¶
func (m *TelegramChannelMutation) SetAccessHash(i int64)
SetAccessHash sets the "access_hash" field.
func (*TelegramChannelMutation) SetActive ¶
func (m *TelegramChannelMutation) SetActive(b bool)
SetActive sets the "active" field.
func (*TelegramChannelMutation) SetField ¶
func (m *TelegramChannelMutation) 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 (*TelegramChannelMutation) SetID ¶
func (m *TelegramChannelMutation) SetID(id int64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of TelegramChannel entities.
func (*TelegramChannelMutation) SetOp ¶
func (m *TelegramChannelMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*TelegramChannelMutation) SetTitle ¶
func (m *TelegramChannelMutation) SetTitle(s string)
SetTitle sets the "title" field.
func (*TelegramChannelMutation) Title ¶
func (m *TelegramChannelMutation) Title() (r string, exists bool)
Title returns the value of the "title" field in the mutation.
func (TelegramChannelMutation) Tx ¶
func (m TelegramChannelMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*TelegramChannelMutation) Type ¶
func (m *TelegramChannelMutation) Type() string
Type returns the node type of this mutation (TelegramChannel).
func (*TelegramChannelMutation) Where ¶
func (m *TelegramChannelMutation) Where(ps ...predicate.TelegramChannel)
Where appends a list predicates to the TelegramChannelMutation builder.
func (*TelegramChannelMutation) WhereP ¶
func (m *TelegramChannelMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the TelegramChannelMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type TelegramChannelQuery ¶
type TelegramChannelQuery struct {
// contains filtered or unexported fields
}
TelegramChannelQuery is the builder for querying TelegramChannel entities.
func (*TelegramChannelQuery) Aggregate ¶
func (_q *TelegramChannelQuery) Aggregate(fns ...AggregateFunc) *TelegramChannelSelect
Aggregate returns a TelegramChannelSelect configured with the given aggregations.
func (*TelegramChannelQuery) All ¶
func (_q *TelegramChannelQuery) All(ctx context.Context) ([]*TelegramChannel, error)
All executes the query and returns a list of TelegramChannels.
func (*TelegramChannelQuery) AllX ¶
func (_q *TelegramChannelQuery) AllX(ctx context.Context) []*TelegramChannel
AllX is like All, but panics if an error occurs.
func (*TelegramChannelQuery) Clone ¶
func (_q *TelegramChannelQuery) Clone() *TelegramChannelQuery
Clone returns a duplicate of the TelegramChannelQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*TelegramChannelQuery) Count ¶
func (_q *TelegramChannelQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*TelegramChannelQuery) CountX ¶
func (_q *TelegramChannelQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*TelegramChannelQuery) Exist ¶
func (_q *TelegramChannelQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*TelegramChannelQuery) ExistX ¶
func (_q *TelegramChannelQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*TelegramChannelQuery) First ¶
func (_q *TelegramChannelQuery) First(ctx context.Context) (*TelegramChannel, error)
First returns the first TelegramChannel entity from the query. Returns a *NotFoundError when no TelegramChannel was found.
func (*TelegramChannelQuery) FirstID ¶
func (_q *TelegramChannelQuery) FirstID(ctx context.Context) (id int64, err error)
FirstID returns the first TelegramChannel ID from the query. Returns a *NotFoundError when no TelegramChannel ID was found.
func (*TelegramChannelQuery) FirstIDX ¶
func (_q *TelegramChannelQuery) FirstIDX(ctx context.Context) int64
FirstIDX is like FirstID, but panics if an error occurs.
func (*TelegramChannelQuery) FirstX ¶
func (_q *TelegramChannelQuery) FirstX(ctx context.Context) *TelegramChannel
FirstX is like First, but panics if an error occurs.
func (*TelegramChannelQuery) GroupBy ¶
func (_q *TelegramChannelQuery) GroupBy(field string, fields ...string) *TelegramChannelGroupBy
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 {
AccessHash int64 `json:"access_hash,omitempty"`
Count int `json:"count,omitempty"`
}
client.TelegramChannel.Query().
GroupBy(telegramchannel.FieldAccessHash).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*TelegramChannelQuery) IDs ¶
func (_q *TelegramChannelQuery) IDs(ctx context.Context) (ids []int64, err error)
IDs executes the query and returns a list of TelegramChannel IDs.
func (*TelegramChannelQuery) IDsX ¶
func (_q *TelegramChannelQuery) IDsX(ctx context.Context) []int64
IDsX is like IDs, but panics if an error occurs.
func (*TelegramChannelQuery) Limit ¶
func (_q *TelegramChannelQuery) Limit(limit int) *TelegramChannelQuery
Limit the number of records to be returned by this query.
func (*TelegramChannelQuery) Offset ¶
func (_q *TelegramChannelQuery) Offset(offset int) *TelegramChannelQuery
Offset to start from.
func (*TelegramChannelQuery) Only ¶
func (_q *TelegramChannelQuery) Only(ctx context.Context) (*TelegramChannel, error)
Only returns a single TelegramChannel entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one TelegramChannel entity is found. Returns a *NotFoundError when no TelegramChannel entities are found.
func (*TelegramChannelQuery) OnlyID ¶
func (_q *TelegramChannelQuery) OnlyID(ctx context.Context) (id int64, err error)
OnlyID is like Only, but returns the only TelegramChannel ID in the query. Returns a *NotSingularError when more than one TelegramChannel ID is found. Returns a *NotFoundError when no entities are found.
func (*TelegramChannelQuery) OnlyIDX ¶
func (_q *TelegramChannelQuery) OnlyIDX(ctx context.Context) int64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*TelegramChannelQuery) OnlyX ¶
func (_q *TelegramChannelQuery) OnlyX(ctx context.Context) *TelegramChannel
OnlyX is like Only, but panics if an error occurs.
func (*TelegramChannelQuery) Order ¶
func (_q *TelegramChannelQuery) Order(o ...telegramchannel.OrderOption) *TelegramChannelQuery
Order specifies how the records should be ordered.
func (*TelegramChannelQuery) Select ¶
func (_q *TelegramChannelQuery) Select(fields ...string) *TelegramChannelSelect
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 {
AccessHash int64 `json:"access_hash,omitempty"`
}
client.TelegramChannel.Query().
Select(telegramchannel.FieldAccessHash).
Scan(ctx, &v)
func (*TelegramChannelQuery) Unique ¶
func (_q *TelegramChannelQuery) Unique(unique bool) *TelegramChannelQuery
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 (*TelegramChannelQuery) Where ¶
func (_q *TelegramChannelQuery) Where(ps ...predicate.TelegramChannel) *TelegramChannelQuery
Where adds a new predicate for the TelegramChannelQuery builder.
type TelegramChannelSelect ¶
type TelegramChannelSelect struct {
*TelegramChannelQuery
// contains filtered or unexported fields
}
TelegramChannelSelect is the builder for selecting fields of TelegramChannel entities.
func (*TelegramChannelSelect) Aggregate ¶
func (_s *TelegramChannelSelect) Aggregate(fns ...AggregateFunc) *TelegramChannelSelect
Aggregate adds the given aggregation functions to the selector query.
func (*TelegramChannelSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TelegramChannelSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TelegramChannelSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TelegramChannelSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TelegramChannelSelect) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*TelegramChannelSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TelegramChannelSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TelegramChannelSelect) Scan ¶
func (_s *TelegramChannelSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TelegramChannelSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TelegramChannelUpdate ¶
type TelegramChannelUpdate struct {
// contains filtered or unexported fields
}
TelegramChannelUpdate is the builder for updating TelegramChannel entities.
func (*TelegramChannelUpdate) AddAccessHash ¶
func (_u *TelegramChannelUpdate) AddAccessHash(v int64) *TelegramChannelUpdate
AddAccessHash adds value to the "access_hash" field.
func (*TelegramChannelUpdate) Exec ¶
func (_u *TelegramChannelUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*TelegramChannelUpdate) ExecX ¶
func (_u *TelegramChannelUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TelegramChannelUpdate) Mutation ¶
func (_u *TelegramChannelUpdate) Mutation() *TelegramChannelMutation
Mutation returns the TelegramChannelMutation object of the builder.
func (*TelegramChannelUpdate) Save ¶
func (_u *TelegramChannelUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*TelegramChannelUpdate) SaveX ¶
func (_u *TelegramChannelUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*TelegramChannelUpdate) SetAccessHash ¶
func (_u *TelegramChannelUpdate) SetAccessHash(v int64) *TelegramChannelUpdate
SetAccessHash sets the "access_hash" field.
func (*TelegramChannelUpdate) SetActive ¶
func (_u *TelegramChannelUpdate) SetActive(v bool) *TelegramChannelUpdate
SetActive sets the "active" field.
func (*TelegramChannelUpdate) SetNillableAccessHash ¶
func (_u *TelegramChannelUpdate) SetNillableAccessHash(v *int64) *TelegramChannelUpdate
SetNillableAccessHash sets the "access_hash" field if the given value is not nil.
func (*TelegramChannelUpdate) SetNillableActive ¶
func (_u *TelegramChannelUpdate) SetNillableActive(v *bool) *TelegramChannelUpdate
SetNillableActive sets the "active" field if the given value is not nil.
func (*TelegramChannelUpdate) SetNillableTitle ¶
func (_u *TelegramChannelUpdate) SetNillableTitle(v *string) *TelegramChannelUpdate
SetNillableTitle sets the "title" field if the given value is not nil.
func (*TelegramChannelUpdate) SetTitle ¶
func (_u *TelegramChannelUpdate) SetTitle(v string) *TelegramChannelUpdate
SetTitle sets the "title" field.
func (*TelegramChannelUpdate) Where ¶
func (_u *TelegramChannelUpdate) Where(ps ...predicate.TelegramChannel) *TelegramChannelUpdate
Where appends a list predicates to the TelegramChannelUpdate builder.
type TelegramChannelUpdateOne ¶
type TelegramChannelUpdateOne struct {
// contains filtered or unexported fields
}
TelegramChannelUpdateOne is the builder for updating a single TelegramChannel entity.
func (*TelegramChannelUpdateOne) AddAccessHash ¶
func (_u *TelegramChannelUpdateOne) AddAccessHash(v int64) *TelegramChannelUpdateOne
AddAccessHash adds value to the "access_hash" field.
func (*TelegramChannelUpdateOne) Exec ¶
func (_u *TelegramChannelUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*TelegramChannelUpdateOne) ExecX ¶
func (_u *TelegramChannelUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TelegramChannelUpdateOne) Mutation ¶
func (_u *TelegramChannelUpdateOne) Mutation() *TelegramChannelMutation
Mutation returns the TelegramChannelMutation object of the builder.
func (*TelegramChannelUpdateOne) Save ¶
func (_u *TelegramChannelUpdateOne) Save(ctx context.Context) (*TelegramChannel, error)
Save executes the query and returns the updated TelegramChannel entity.
func (*TelegramChannelUpdateOne) SaveX ¶
func (_u *TelegramChannelUpdateOne) SaveX(ctx context.Context) *TelegramChannel
SaveX is like Save, but panics if an error occurs.
func (*TelegramChannelUpdateOne) Select ¶
func (_u *TelegramChannelUpdateOne) Select(field string, fields ...string) *TelegramChannelUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*TelegramChannelUpdateOne) SetAccessHash ¶
func (_u *TelegramChannelUpdateOne) SetAccessHash(v int64) *TelegramChannelUpdateOne
SetAccessHash sets the "access_hash" field.
func (*TelegramChannelUpdateOne) SetActive ¶
func (_u *TelegramChannelUpdateOne) SetActive(v bool) *TelegramChannelUpdateOne
SetActive sets the "active" field.
func (*TelegramChannelUpdateOne) SetNillableAccessHash ¶
func (_u *TelegramChannelUpdateOne) SetNillableAccessHash(v *int64) *TelegramChannelUpdateOne
SetNillableAccessHash sets the "access_hash" field if the given value is not nil.
func (*TelegramChannelUpdateOne) SetNillableActive ¶
func (_u *TelegramChannelUpdateOne) SetNillableActive(v *bool) *TelegramChannelUpdateOne
SetNillableActive sets the "active" field if the given value is not nil.
func (*TelegramChannelUpdateOne) SetNillableTitle ¶
func (_u *TelegramChannelUpdateOne) SetNillableTitle(v *string) *TelegramChannelUpdateOne
SetNillableTitle sets the "title" field if the given value is not nil.
func (*TelegramChannelUpdateOne) SetTitle ¶
func (_u *TelegramChannelUpdateOne) SetTitle(v string) *TelegramChannelUpdateOne
SetTitle sets the "title" field.
func (*TelegramChannelUpdateOne) Where ¶
func (_u *TelegramChannelUpdateOne) Where(ps ...predicate.TelegramChannel) *TelegramChannelUpdateOne
Where appends a list predicates to the TelegramChannelUpdate builder.
type TelegramChannelUpsert ¶
TelegramChannelUpsert is the "OnConflict" setter.
func (*TelegramChannelUpsert) AddAccessHash ¶
func (u *TelegramChannelUpsert) AddAccessHash(v int64) *TelegramChannelUpsert
AddAccessHash adds v to the "access_hash" field.
func (*TelegramChannelUpsert) SetAccessHash ¶
func (u *TelegramChannelUpsert) SetAccessHash(v int64) *TelegramChannelUpsert
SetAccessHash sets the "access_hash" field.
func (*TelegramChannelUpsert) SetActive ¶
func (u *TelegramChannelUpsert) SetActive(v bool) *TelegramChannelUpsert
SetActive sets the "active" field.
func (*TelegramChannelUpsert) SetTitle ¶
func (u *TelegramChannelUpsert) SetTitle(v string) *TelegramChannelUpsert
SetTitle sets the "title" field.
func (*TelegramChannelUpsert) UpdateAccessHash ¶
func (u *TelegramChannelUpsert) UpdateAccessHash() *TelegramChannelUpsert
UpdateAccessHash sets the "access_hash" field to the value that was provided on create.
func (*TelegramChannelUpsert) UpdateActive ¶
func (u *TelegramChannelUpsert) UpdateActive() *TelegramChannelUpsert
UpdateActive sets the "active" field to the value that was provided on create.
func (*TelegramChannelUpsert) UpdateTitle ¶
func (u *TelegramChannelUpsert) UpdateTitle() *TelegramChannelUpsert
UpdateTitle sets the "title" field to the value that was provided on create.
type TelegramChannelUpsertBulk ¶
type TelegramChannelUpsertBulk struct {
// contains filtered or unexported fields
}
TelegramChannelUpsertBulk is the builder for "upsert"-ing a bulk of TelegramChannel nodes.
func (*TelegramChannelUpsertBulk) AddAccessHash ¶
func (u *TelegramChannelUpsertBulk) AddAccessHash(v int64) *TelegramChannelUpsertBulk
AddAccessHash adds v to the "access_hash" field.
func (*TelegramChannelUpsertBulk) DoNothing ¶
func (u *TelegramChannelUpsertBulk) DoNothing() *TelegramChannelUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*TelegramChannelUpsertBulk) Exec ¶
func (u *TelegramChannelUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TelegramChannelUpsertBulk) ExecX ¶
func (u *TelegramChannelUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TelegramChannelUpsertBulk) Ignore ¶
func (u *TelegramChannelUpsertBulk) Ignore() *TelegramChannelUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.TelegramChannel.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*TelegramChannelUpsertBulk) SetAccessHash ¶
func (u *TelegramChannelUpsertBulk) SetAccessHash(v int64) *TelegramChannelUpsertBulk
SetAccessHash sets the "access_hash" field.
func (*TelegramChannelUpsertBulk) SetActive ¶
func (u *TelegramChannelUpsertBulk) SetActive(v bool) *TelegramChannelUpsertBulk
SetActive sets the "active" field.
func (*TelegramChannelUpsertBulk) SetTitle ¶
func (u *TelegramChannelUpsertBulk) SetTitle(v string) *TelegramChannelUpsertBulk
SetTitle sets the "title" field.
func (*TelegramChannelUpsertBulk) Update ¶
func (u *TelegramChannelUpsertBulk) Update(set func(*TelegramChannelUpsert)) *TelegramChannelUpsertBulk
Update allows overriding fields `UPDATE` values. See the TelegramChannelCreateBulk.OnConflict documentation for more info.
func (*TelegramChannelUpsertBulk) UpdateAccessHash ¶
func (u *TelegramChannelUpsertBulk) UpdateAccessHash() *TelegramChannelUpsertBulk
UpdateAccessHash sets the "access_hash" field to the value that was provided on create.
func (*TelegramChannelUpsertBulk) UpdateActive ¶
func (u *TelegramChannelUpsertBulk) UpdateActive() *TelegramChannelUpsertBulk
UpdateActive sets the "active" field to the value that was provided on create.
func (*TelegramChannelUpsertBulk) UpdateNewValues ¶
func (u *TelegramChannelUpsertBulk) UpdateNewValues() *TelegramChannelUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.TelegramChannel.Create().
OnConflict(
sql.ResolveWithNewValues(),
sql.ResolveWith(func(u *sql.UpdateSet) {
u.SetIgnore(telegramchannel.FieldID)
}),
).
Exec(ctx)
func (*TelegramChannelUpsertBulk) UpdateTitle ¶
func (u *TelegramChannelUpsertBulk) UpdateTitle() *TelegramChannelUpsertBulk
UpdateTitle sets the "title" field to the value that was provided on create.
type TelegramChannelUpsertOne ¶
type TelegramChannelUpsertOne struct {
// contains filtered or unexported fields
}
TelegramChannelUpsertOne is the builder for "upsert"-ing
one TelegramChannel node.
func (*TelegramChannelUpsertOne) AddAccessHash ¶
func (u *TelegramChannelUpsertOne) AddAccessHash(v int64) *TelegramChannelUpsertOne
AddAccessHash adds v to the "access_hash" field.
func (*TelegramChannelUpsertOne) DoNothing ¶
func (u *TelegramChannelUpsertOne) DoNothing() *TelegramChannelUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*TelegramChannelUpsertOne) Exec ¶
func (u *TelegramChannelUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*TelegramChannelUpsertOne) ExecX ¶
func (u *TelegramChannelUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TelegramChannelUpsertOne) ID ¶
func (u *TelegramChannelUpsertOne) ID(ctx context.Context) (id int64, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*TelegramChannelUpsertOne) IDX ¶
func (u *TelegramChannelUpsertOne) IDX(ctx context.Context) int64
IDX is like ID, but panics if an error occurs.
func (*TelegramChannelUpsertOne) Ignore ¶
func (u *TelegramChannelUpsertOne) Ignore() *TelegramChannelUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.TelegramChannel.Create().
OnConflict(sql.ResolveWithIgnore()).
Exec(ctx)
func (*TelegramChannelUpsertOne) SetAccessHash ¶
func (u *TelegramChannelUpsertOne) SetAccessHash(v int64) *TelegramChannelUpsertOne
SetAccessHash sets the "access_hash" field.
func (*TelegramChannelUpsertOne) SetActive ¶
func (u *TelegramChannelUpsertOne) SetActive(v bool) *TelegramChannelUpsertOne
SetActive sets the "active" field.
func (*TelegramChannelUpsertOne) SetTitle ¶
func (u *TelegramChannelUpsertOne) SetTitle(v string) *TelegramChannelUpsertOne
SetTitle sets the "title" field.
func (*TelegramChannelUpsertOne) Update ¶
func (u *TelegramChannelUpsertOne) Update(set func(*TelegramChannelUpsert)) *TelegramChannelUpsertOne
Update allows overriding fields `UPDATE` values. See the TelegramChannelCreate.OnConflict documentation for more info.
func (*TelegramChannelUpsertOne) UpdateAccessHash ¶
func (u *TelegramChannelUpsertOne) UpdateAccessHash() *TelegramChannelUpsertOne
UpdateAccessHash sets the "access_hash" field to the value that was provided on create.
func (*TelegramChannelUpsertOne) UpdateActive ¶
func (u *TelegramChannelUpsertOne) UpdateActive() *TelegramChannelUpsertOne
UpdateActive sets the "active" field to the value that was provided on create.
func (*TelegramChannelUpsertOne) UpdateNewValues ¶
func (u *TelegramChannelUpsertOne) UpdateNewValues() *TelegramChannelUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:
client.TelegramChannel.Create().
OnConflict(
sql.ResolveWithNewValues(),
sql.ResolveWith(func(u *sql.UpdateSet) {
u.SetIgnore(telegramchannel.FieldID)
}),
).
Exec(ctx)
func (*TelegramChannelUpsertOne) UpdateTitle ¶
func (u *TelegramChannelUpsertOne) UpdateTitle() *TelegramChannelUpsertOne
UpdateTitle sets the "title" field to the value that was provided on create.
type TelegramChannels ¶
type TelegramChannels []*TelegramChannel
TelegramChannels is a parsable slice of TelegramChannel.
type TelegramSession ¶
type TelegramSession struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// Data holds the value of the "data" field.
Data []byte `json:"data,omitempty"`
// contains filtered or unexported fields
}
TelegramSession is the model entity for the TelegramSession schema.
func (*TelegramSession) String ¶
func (_m *TelegramSession) String() string
String implements the fmt.Stringer.
func (*TelegramSession) Unwrap ¶
func (_m *TelegramSession) Unwrap() *TelegramSession
Unwrap unwraps the TelegramSession 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 (*TelegramSession) Update ¶
func (_m *TelegramSession) Update() *TelegramSessionUpdateOne
Update returns a builder for updating this TelegramSession. Note that you need to call TelegramSession.Unwrap() before calling this method if this TelegramSession was returned from a transaction, and the transaction was committed or rolled back.
type TelegramSessionClient ¶
type TelegramSessionClient struct {
// contains filtered or unexported fields
}
TelegramSessionClient is a client for the TelegramSession schema.
func NewTelegramSessionClient ¶
func NewTelegramSessionClient(c config) *TelegramSessionClient
NewTelegramSessionClient returns a client for the TelegramSession from the given config.
func (*TelegramSessionClient) Create ¶
func (c *TelegramSessionClient) Create() *TelegramSessionCreate
Create returns a builder for creating a TelegramSession entity.
func (*TelegramSessionClient) CreateBulk ¶
func (c *TelegramSessionClient) CreateBulk(builders ...*TelegramSessionCreate) *TelegramSessionCreateBulk
CreateBulk returns a builder for creating a bulk of TelegramSession entities.
func (*TelegramSessionClient) Delete ¶
func (c *TelegramSessionClient) Delete() *TelegramSessionDelete
Delete returns a delete builder for TelegramSession.
func (*TelegramSessionClient) DeleteOne ¶
func (c *TelegramSessionClient) DeleteOne(_m *TelegramSession) *TelegramSessionDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*TelegramSessionClient) DeleteOneID ¶
func (c *TelegramSessionClient) DeleteOneID(id int) *TelegramSessionDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*TelegramSessionClient) Get ¶
func (c *TelegramSessionClient) Get(ctx context.Context, id int) (*TelegramSession, error)
Get returns a TelegramSession entity by its id.
func (*TelegramSessionClient) GetX ¶
func (c *TelegramSessionClient) GetX(ctx context.Context, id int) *TelegramSession
GetX is like Get, but panics if an error occurs.
func (*TelegramSessionClient) Hooks ¶
func (c *TelegramSessionClient) Hooks() []Hook
Hooks returns the client hooks.
func (*TelegramSessionClient) Intercept ¶
func (c *TelegramSessionClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `telegramsession.Intercept(f(g(h())))`.
func (*TelegramSessionClient) Interceptors ¶
func (c *TelegramSessionClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*TelegramSessionClient) MapCreateBulk ¶
func (c *TelegramSessionClient) MapCreateBulk(slice any, setFunc func(*TelegramSessionCreate, int)) *TelegramSessionCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*TelegramSessionClient) Query ¶
func (c *TelegramSessionClient) Query() *TelegramSessionQuery
Query returns a query builder for TelegramSession.
func (*TelegramSessionClient) Update ¶
func (c *TelegramSessionClient) Update() *TelegramSessionUpdate
Update returns an update builder for TelegramSession.
func (*TelegramSessionClient) UpdateOne ¶
func (c *TelegramSessionClient) UpdateOne(_m *TelegramSession) *TelegramSessionUpdateOne
UpdateOne returns an update builder for the given entity.
func (*TelegramSessionClient) UpdateOneID ¶
func (c *TelegramSessionClient) UpdateOneID(id int) *TelegramSessionUpdateOne
UpdateOneID returns an update builder for the given id.
func (*TelegramSessionClient) Use ¶
func (c *TelegramSessionClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `telegramsession.Hooks(f(g(h())))`.
type TelegramSessionCreate ¶
type TelegramSessionCreate struct {
// contains filtered or unexported fields
}
TelegramSessionCreate is the builder for creating a TelegramSession entity.
func (*TelegramSessionCreate) Exec ¶
func (_c *TelegramSessionCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*TelegramSessionCreate) ExecX ¶
func (_c *TelegramSessionCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TelegramSessionCreate) Mutation ¶
func (_c *TelegramSessionCreate) Mutation() *TelegramSessionMutation
Mutation returns the TelegramSessionMutation object of the builder.
func (*TelegramSessionCreate) OnConflict ¶
func (_c *TelegramSessionCreate) OnConflict(opts ...sql.ConflictOption) *TelegramSessionUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.TelegramSession.Create().
SetData(v).
OnConflict(
// Update the row with the new values
// the was proposed for insertion.
sql.ResolveWithNewValues(),
).
// Override some of the fields with custom
// update values.
Update(func(u *ent.TelegramSessionUpsert) {
SetData(v+v).
}).
Exec(ctx)
func (*TelegramSessionCreate) OnConflictColumns ¶
func (_c *TelegramSessionCreate) OnConflictColumns(columns ...string) *TelegramSessionUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.TelegramSession.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*TelegramSessionCreate) Save ¶
func (_c *TelegramSessionCreate) Save(ctx context.Context) (*TelegramSession, error)
Save creates the TelegramSession in the database.
func (*TelegramSessionCreate) SaveX ¶
func (_c *TelegramSessionCreate) SaveX(ctx context.Context) *TelegramSession
SaveX calls Save and panics if Save returns an error.
func (*TelegramSessionCreate) SetData ¶
func (_c *TelegramSessionCreate) SetData(v []byte) *TelegramSessionCreate
SetData sets the "data" field.
func (*TelegramSessionCreate) SetID ¶
func (_c *TelegramSessionCreate) SetID(v int) *TelegramSessionCreate
SetID sets the "id" field.
type TelegramSessionCreateBulk ¶
type TelegramSessionCreateBulk struct {
// contains filtered or unexported fields
}
TelegramSessionCreateBulk is the builder for creating many TelegramSession entities in bulk.
func (*TelegramSessionCreateBulk) Exec ¶
func (_c *TelegramSessionCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TelegramSessionCreateBulk) ExecX ¶
func (_c *TelegramSessionCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TelegramSessionCreateBulk) OnConflict ¶
func (_c *TelegramSessionCreateBulk) OnConflict(opts ...sql.ConflictOption) *TelegramSessionUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.TelegramSession.CreateBulk(builders...).
OnConflict(
// Update the row with the new values
// the was proposed for insertion.
sql.ResolveWithNewValues(),
).
// Override some of the fields with custom
// update values.
Update(func(u *ent.TelegramSessionUpsert) {
SetData(v+v).
}).
Exec(ctx)
func (*TelegramSessionCreateBulk) OnConflictColumns ¶
func (_c *TelegramSessionCreateBulk) OnConflictColumns(columns ...string) *TelegramSessionUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.TelegramSession.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*TelegramSessionCreateBulk) Save ¶
func (_c *TelegramSessionCreateBulk) Save(ctx context.Context) ([]*TelegramSession, error)
Save creates the TelegramSession entities in the database.
func (*TelegramSessionCreateBulk) SaveX ¶
func (_c *TelegramSessionCreateBulk) SaveX(ctx context.Context) []*TelegramSession
SaveX is like Save, but panics if an error occurs.
type TelegramSessionDelete ¶
type TelegramSessionDelete struct {
// contains filtered or unexported fields
}
TelegramSessionDelete is the builder for deleting a TelegramSession entity.
func (*TelegramSessionDelete) Exec ¶
func (_d *TelegramSessionDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*TelegramSessionDelete) ExecX ¶
func (_d *TelegramSessionDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*TelegramSessionDelete) Where ¶
func (_d *TelegramSessionDelete) Where(ps ...predicate.TelegramSession) *TelegramSessionDelete
Where appends a list predicates to the TelegramSessionDelete builder.
type TelegramSessionDeleteOne ¶
type TelegramSessionDeleteOne struct {
// contains filtered or unexported fields
}
TelegramSessionDeleteOne is the builder for deleting a single TelegramSession entity.
func (*TelegramSessionDeleteOne) Exec ¶
func (_d *TelegramSessionDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*TelegramSessionDeleteOne) ExecX ¶
func (_d *TelegramSessionDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TelegramSessionDeleteOne) Where ¶
func (_d *TelegramSessionDeleteOne) Where(ps ...predicate.TelegramSession) *TelegramSessionDeleteOne
Where appends a list predicates to the TelegramSessionDelete builder.
type TelegramSessionGroupBy ¶
type TelegramSessionGroupBy struct {
// contains filtered or unexported fields
}
TelegramSessionGroupBy is the group-by builder for TelegramSession entities.
func (*TelegramSessionGroupBy) Aggregate ¶
func (_g *TelegramSessionGroupBy) Aggregate(fns ...AggregateFunc) *TelegramSessionGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*TelegramSessionGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TelegramSessionGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TelegramSessionGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TelegramSessionGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TelegramSessionGroupBy) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*TelegramSessionGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TelegramSessionGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TelegramSessionGroupBy) Scan ¶
func (_g *TelegramSessionGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TelegramSessionGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TelegramSessionMutation ¶
type TelegramSessionMutation struct {
// contains filtered or unexported fields
}
TelegramSessionMutation represents an operation that mutates the TelegramSession nodes in the graph.
func (*TelegramSessionMutation) AddField ¶
func (m *TelegramSessionMutation) 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 (*TelegramSessionMutation) AddedEdges ¶
func (m *TelegramSessionMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*TelegramSessionMutation) AddedField ¶
func (m *TelegramSessionMutation) 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 (*TelegramSessionMutation) AddedFields ¶
func (m *TelegramSessionMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*TelegramSessionMutation) AddedIDs ¶
func (m *TelegramSessionMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*TelegramSessionMutation) ClearEdge ¶
func (m *TelegramSessionMutation) 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 (*TelegramSessionMutation) ClearField ¶
func (m *TelegramSessionMutation) 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 (*TelegramSessionMutation) ClearedEdges ¶
func (m *TelegramSessionMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*TelegramSessionMutation) ClearedFields ¶
func (m *TelegramSessionMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (TelegramSessionMutation) Client ¶
func (m TelegramSessionMutation) 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 (*TelegramSessionMutation) Data ¶
func (m *TelegramSessionMutation) Data() (r []byte, exists bool)
Data returns the value of the "data" field in the mutation.
func (*TelegramSessionMutation) EdgeCleared ¶
func (m *TelegramSessionMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*TelegramSessionMutation) Field ¶
func (m *TelegramSessionMutation) 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 (*TelegramSessionMutation) FieldCleared ¶
func (m *TelegramSessionMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*TelegramSessionMutation) Fields ¶
func (m *TelegramSessionMutation) 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 (*TelegramSessionMutation) ID ¶
func (m *TelegramSessionMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*TelegramSessionMutation) IDs ¶
func (m *TelegramSessionMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*TelegramSessionMutation) OldData ¶
func (m *TelegramSessionMutation) OldData(ctx context.Context) (v []byte, err error)
OldData returns the old "data" field's value of the TelegramSession entity. If the TelegramSession 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 (*TelegramSessionMutation) 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 (*TelegramSessionMutation) Op ¶
func (m *TelegramSessionMutation) Op() Op
Op returns the operation name.
func (*TelegramSessionMutation) RemovedEdges ¶
func (m *TelegramSessionMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*TelegramSessionMutation) RemovedIDs ¶
func (m *TelegramSessionMutation) 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 (*TelegramSessionMutation) ResetData ¶
func (m *TelegramSessionMutation) ResetData()
ResetData resets all changes to the "data" field.
func (*TelegramSessionMutation) ResetEdge ¶
func (m *TelegramSessionMutation) 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 (*TelegramSessionMutation) ResetField ¶
func (m *TelegramSessionMutation) 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 (*TelegramSessionMutation) SetData ¶
func (m *TelegramSessionMutation) SetData(b []byte)
SetData sets the "data" field.
func (*TelegramSessionMutation) SetField ¶
func (m *TelegramSessionMutation) 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 (*TelegramSessionMutation) SetID ¶
func (m *TelegramSessionMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of TelegramSession entities.
func (*TelegramSessionMutation) SetOp ¶
func (m *TelegramSessionMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (TelegramSessionMutation) Tx ¶
func (m TelegramSessionMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*TelegramSessionMutation) Type ¶
func (m *TelegramSessionMutation) Type() string
Type returns the node type of this mutation (TelegramSession).
func (*TelegramSessionMutation) Where ¶
func (m *TelegramSessionMutation) Where(ps ...predicate.TelegramSession)
Where appends a list predicates to the TelegramSessionMutation builder.
func (*TelegramSessionMutation) WhereP ¶
func (m *TelegramSessionMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the TelegramSessionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type TelegramSessionQuery ¶
type TelegramSessionQuery struct {
// contains filtered or unexported fields
}
TelegramSessionQuery is the builder for querying TelegramSession entities.
func (*TelegramSessionQuery) Aggregate ¶
func (_q *TelegramSessionQuery) Aggregate(fns ...AggregateFunc) *TelegramSessionSelect
Aggregate returns a TelegramSessionSelect configured with the given aggregations.
func (*TelegramSessionQuery) All ¶
func (_q *TelegramSessionQuery) All(ctx context.Context) ([]*TelegramSession, error)
All executes the query and returns a list of TelegramSessions.
func (*TelegramSessionQuery) AllX ¶
func (_q *TelegramSessionQuery) AllX(ctx context.Context) []*TelegramSession
AllX is like All, but panics if an error occurs.
func (*TelegramSessionQuery) Clone ¶
func (_q *TelegramSessionQuery) Clone() *TelegramSessionQuery
Clone returns a duplicate of the TelegramSessionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*TelegramSessionQuery) Count ¶
func (_q *TelegramSessionQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*TelegramSessionQuery) CountX ¶
func (_q *TelegramSessionQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*TelegramSessionQuery) Exist ¶
func (_q *TelegramSessionQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*TelegramSessionQuery) ExistX ¶
func (_q *TelegramSessionQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*TelegramSessionQuery) First ¶
func (_q *TelegramSessionQuery) First(ctx context.Context) (*TelegramSession, error)
First returns the first TelegramSession entity from the query. Returns a *NotFoundError when no TelegramSession was found.
func (*TelegramSessionQuery) FirstID ¶
func (_q *TelegramSessionQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first TelegramSession ID from the query. Returns a *NotFoundError when no TelegramSession ID was found.
func (*TelegramSessionQuery) FirstIDX ¶
func (_q *TelegramSessionQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*TelegramSessionQuery) FirstX ¶
func (_q *TelegramSessionQuery) FirstX(ctx context.Context) *TelegramSession
FirstX is like First, but panics if an error occurs.
func (*TelegramSessionQuery) GroupBy ¶
func (_q *TelegramSessionQuery) GroupBy(field string, fields ...string) *TelegramSessionGroupBy
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 {
Data []byte `json:"data,omitempty"`
Count int `json:"count,omitempty"`
}
client.TelegramSession.Query().
GroupBy(telegramsession.FieldData).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*TelegramSessionQuery) IDs ¶
func (_q *TelegramSessionQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of TelegramSession IDs.
func (*TelegramSessionQuery) IDsX ¶
func (_q *TelegramSessionQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*TelegramSessionQuery) Limit ¶
func (_q *TelegramSessionQuery) Limit(limit int) *TelegramSessionQuery
Limit the number of records to be returned by this query.
func (*TelegramSessionQuery) Offset ¶
func (_q *TelegramSessionQuery) Offset(offset int) *TelegramSessionQuery
Offset to start from.
func (*TelegramSessionQuery) Only ¶
func (_q *TelegramSessionQuery) Only(ctx context.Context) (*TelegramSession, error)
Only returns a single TelegramSession entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one TelegramSession entity is found. Returns a *NotFoundError when no TelegramSession entities are found.
func (*TelegramSessionQuery) OnlyID ¶
func (_q *TelegramSessionQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only TelegramSession ID in the query. Returns a *NotSingularError when more than one TelegramSession ID is found. Returns a *NotFoundError when no entities are found.
func (*TelegramSessionQuery) OnlyIDX ¶
func (_q *TelegramSessionQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*TelegramSessionQuery) OnlyX ¶
func (_q *TelegramSessionQuery) OnlyX(ctx context.Context) *TelegramSession
OnlyX is like Only, but panics if an error occurs.
func (*TelegramSessionQuery) Order ¶
func (_q *TelegramSessionQuery) Order(o ...telegramsession.OrderOption) *TelegramSessionQuery
Order specifies how the records should be ordered.
func (*TelegramSessionQuery) Select ¶
func (_q *TelegramSessionQuery) Select(fields ...string) *TelegramSessionSelect
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 {
Data []byte `json:"data,omitempty"`
}
client.TelegramSession.Query().
Select(telegramsession.FieldData).
Scan(ctx, &v)
func (*TelegramSessionQuery) Unique ¶
func (_q *TelegramSessionQuery) Unique(unique bool) *TelegramSessionQuery
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 (*TelegramSessionQuery) Where ¶
func (_q *TelegramSessionQuery) Where(ps ...predicate.TelegramSession) *TelegramSessionQuery
Where adds a new predicate for the TelegramSessionQuery builder.
type TelegramSessionSelect ¶
type TelegramSessionSelect struct {
*TelegramSessionQuery
// contains filtered or unexported fields
}
TelegramSessionSelect is the builder for selecting fields of TelegramSession entities.
func (*TelegramSessionSelect) Aggregate ¶
func (_s *TelegramSessionSelect) Aggregate(fns ...AggregateFunc) *TelegramSessionSelect
Aggregate adds the given aggregation functions to the selector query.
func (*TelegramSessionSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TelegramSessionSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TelegramSessionSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TelegramSessionSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TelegramSessionSelect) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*TelegramSessionSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TelegramSessionSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TelegramSessionSelect) Scan ¶
func (_s *TelegramSessionSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TelegramSessionSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TelegramSessionUpdate ¶
type TelegramSessionUpdate struct {
// contains filtered or unexported fields
}
TelegramSessionUpdate is the builder for updating TelegramSession entities.
func (*TelegramSessionUpdate) Exec ¶
func (_u *TelegramSessionUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*TelegramSessionUpdate) ExecX ¶
func (_u *TelegramSessionUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TelegramSessionUpdate) Mutation ¶
func (_u *TelegramSessionUpdate) Mutation() *TelegramSessionMutation
Mutation returns the TelegramSessionMutation object of the builder.
func (*TelegramSessionUpdate) Save ¶
func (_u *TelegramSessionUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*TelegramSessionUpdate) SaveX ¶
func (_u *TelegramSessionUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*TelegramSessionUpdate) SetData ¶
func (_u *TelegramSessionUpdate) SetData(v []byte) *TelegramSessionUpdate
SetData sets the "data" field.
func (*TelegramSessionUpdate) Where ¶
func (_u *TelegramSessionUpdate) Where(ps ...predicate.TelegramSession) *TelegramSessionUpdate
Where appends a list predicates to the TelegramSessionUpdate builder.
type TelegramSessionUpdateOne ¶
type TelegramSessionUpdateOne struct {
// contains filtered or unexported fields
}
TelegramSessionUpdateOne is the builder for updating a single TelegramSession entity.
func (*TelegramSessionUpdateOne) Exec ¶
func (_u *TelegramSessionUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*TelegramSessionUpdateOne) ExecX ¶
func (_u *TelegramSessionUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TelegramSessionUpdateOne) Mutation ¶
func (_u *TelegramSessionUpdateOne) Mutation() *TelegramSessionMutation
Mutation returns the TelegramSessionMutation object of the builder.
func (*TelegramSessionUpdateOne) Save ¶
func (_u *TelegramSessionUpdateOne) Save(ctx context.Context) (*TelegramSession, error)
Save executes the query and returns the updated TelegramSession entity.
func (*TelegramSessionUpdateOne) SaveX ¶
func (_u *TelegramSessionUpdateOne) SaveX(ctx context.Context) *TelegramSession
SaveX is like Save, but panics if an error occurs.
func (*TelegramSessionUpdateOne) Select ¶
func (_u *TelegramSessionUpdateOne) Select(field string, fields ...string) *TelegramSessionUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*TelegramSessionUpdateOne) SetData ¶
func (_u *TelegramSessionUpdateOne) SetData(v []byte) *TelegramSessionUpdateOne
SetData sets the "data" field.
func (*TelegramSessionUpdateOne) Where ¶
func (_u *TelegramSessionUpdateOne) Where(ps ...predicate.TelegramSession) *TelegramSessionUpdateOne
Where appends a list predicates to the TelegramSessionUpdate builder.
type TelegramSessionUpsert ¶
TelegramSessionUpsert is the "OnConflict" setter.
func (*TelegramSessionUpsert) SetData ¶
func (u *TelegramSessionUpsert) SetData(v []byte) *TelegramSessionUpsert
SetData sets the "data" field.
func (*TelegramSessionUpsert) UpdateData ¶
func (u *TelegramSessionUpsert) UpdateData() *TelegramSessionUpsert
UpdateData sets the "data" field to the value that was provided on create.
type TelegramSessionUpsertBulk ¶
type TelegramSessionUpsertBulk struct {
// contains filtered or unexported fields
}
TelegramSessionUpsertBulk is the builder for "upsert"-ing a bulk of TelegramSession nodes.
func (*TelegramSessionUpsertBulk) DoNothing ¶
func (u *TelegramSessionUpsertBulk) DoNothing() *TelegramSessionUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*TelegramSessionUpsertBulk) Exec ¶
func (u *TelegramSessionUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TelegramSessionUpsertBulk) ExecX ¶
func (u *TelegramSessionUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TelegramSessionUpsertBulk) Ignore ¶
func (u *TelegramSessionUpsertBulk) Ignore() *TelegramSessionUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.TelegramSession.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*TelegramSessionUpsertBulk) SetData ¶
func (u *TelegramSessionUpsertBulk) SetData(v []byte) *TelegramSessionUpsertBulk
SetData sets the "data" field.
func (*TelegramSessionUpsertBulk) Update ¶
func (u *TelegramSessionUpsertBulk) Update(set func(*TelegramSessionUpsert)) *TelegramSessionUpsertBulk
Update allows overriding fields `UPDATE` values. See the TelegramSessionCreateBulk.OnConflict documentation for more info.
func (*TelegramSessionUpsertBulk) UpdateData ¶
func (u *TelegramSessionUpsertBulk) UpdateData() *TelegramSessionUpsertBulk
UpdateData sets the "data" field to the value that was provided on create.
func (*TelegramSessionUpsertBulk) UpdateNewValues ¶
func (u *TelegramSessionUpsertBulk) UpdateNewValues() *TelegramSessionUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.TelegramSession.Create().
OnConflict(
sql.ResolveWithNewValues(),
sql.ResolveWith(func(u *sql.UpdateSet) {
u.SetIgnore(telegramsession.FieldID)
}),
).
Exec(ctx)
type TelegramSessionUpsertOne ¶
type TelegramSessionUpsertOne struct {
// contains filtered or unexported fields
}
TelegramSessionUpsertOne is the builder for "upsert"-ing
one TelegramSession node.
func (*TelegramSessionUpsertOne) DoNothing ¶
func (u *TelegramSessionUpsertOne) DoNothing() *TelegramSessionUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*TelegramSessionUpsertOne) Exec ¶
func (u *TelegramSessionUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*TelegramSessionUpsertOne) ExecX ¶
func (u *TelegramSessionUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TelegramSessionUpsertOne) ID ¶
func (u *TelegramSessionUpsertOne) ID(ctx context.Context) (id int, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*TelegramSessionUpsertOne) IDX ¶
func (u *TelegramSessionUpsertOne) IDX(ctx context.Context) int
IDX is like ID, but panics if an error occurs.
func (*TelegramSessionUpsertOne) Ignore ¶
func (u *TelegramSessionUpsertOne) Ignore() *TelegramSessionUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.TelegramSession.Create().
OnConflict(sql.ResolveWithIgnore()).
Exec(ctx)
func (*TelegramSessionUpsertOne) SetData ¶
func (u *TelegramSessionUpsertOne) SetData(v []byte) *TelegramSessionUpsertOne
SetData sets the "data" field.
func (*TelegramSessionUpsertOne) Update ¶
func (u *TelegramSessionUpsertOne) Update(set func(*TelegramSessionUpsert)) *TelegramSessionUpsertOne
Update allows overriding fields `UPDATE` values. See the TelegramSessionCreate.OnConflict documentation for more info.
func (*TelegramSessionUpsertOne) UpdateData ¶
func (u *TelegramSessionUpsertOne) UpdateData() *TelegramSessionUpsertOne
UpdateData sets the "data" field to the value that was provided on create.
func (*TelegramSessionUpsertOne) UpdateNewValues ¶
func (u *TelegramSessionUpsertOne) UpdateNewValues() *TelegramSessionUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:
client.TelegramSession.Create().
OnConflict(
sql.ResolveWithNewValues(),
sql.ResolveWith(func(u *sql.UpdateSet) {
u.SetIgnore(telegramsession.FieldID)
}),
).
Exec(ctx)
type TelegramSessions ¶
type TelegramSessions []*TelegramSession
TelegramSessions is a parsable slice of TelegramSession.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct {
// TelegramChannel is the client for interacting with the TelegramChannel builders.
TelegramChannel *TelegramChannelClient
// TelegramSession is the client for interacting with the TelegramSession builders.
TelegramSession *TelegramSessionClient
// 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 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.