Documentation
¶
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AccessToken
- type AccessTokenClient
- func (c *AccessTokenClient) Create() *AccessTokenCreate
- func (c *AccessTokenClient) CreateBulk(builders ...*AccessTokenCreate) *AccessTokenCreateBulk
- func (c *AccessTokenClient) Delete() *AccessTokenDelete
- func (c *AccessTokenClient) DeleteOne(at *AccessToken) *AccessTokenDeleteOne
- func (c *AccessTokenClient) DeleteOneID(id uuid.UUID) *AccessTokenDeleteOne
- func (c *AccessTokenClient) Get(ctx context.Context, id uuid.UUID) (*AccessToken, error)
- func (c *AccessTokenClient) GetX(ctx context.Context, id uuid.UUID) *AccessToken
- func (c *AccessTokenClient) Hooks() []Hook
- func (c *AccessTokenClient) Intercept(interceptors ...Interceptor)
- func (c *AccessTokenClient) Interceptors() []Interceptor
- func (c *AccessTokenClient) MapCreateBulk(slice any, setFunc func(*AccessTokenCreate, int)) *AccessTokenCreateBulk
- func (c *AccessTokenClient) Query() *AccessTokenQuery
- func (c *AccessTokenClient) QueryGroups(at *AccessToken) *GroupQuery
- func (c *AccessTokenClient) QueryUser(at *AccessToken) *UserQuery
- func (c *AccessTokenClient) Update() *AccessTokenUpdate
- func (c *AccessTokenClient) UpdateOne(at *AccessToken) *AccessTokenUpdateOne
- func (c *AccessTokenClient) UpdateOneID(id uuid.UUID) *AccessTokenUpdateOne
- func (c *AccessTokenClient) Use(hooks ...Hook)
- type AccessTokenCreate
- func (atc *AccessTokenCreate) AddGroupIDs(ids ...uuid.UUID) *AccessTokenCreate
- func (atc *AccessTokenCreate) AddGroups(g ...*Group) *AccessTokenCreate
- func (atc *AccessTokenCreate) Exec(ctx context.Context) error
- func (atc *AccessTokenCreate) ExecX(ctx context.Context)
- func (atc *AccessTokenCreate) Mutation() *AccessTokenMutation
- func (atc *AccessTokenCreate) OnConflict(opts ...sql.ConflictOption) *AccessTokenUpsertOne
- func (atc *AccessTokenCreate) OnConflictColumns(columns ...string) *AccessTokenUpsertOne
- func (atc *AccessTokenCreate) Save(ctx context.Context) (*AccessToken, error)
- func (atc *AccessTokenCreate) SaveX(ctx context.Context) *AccessToken
- func (atc *AccessTokenCreate) SetExpiresAt(t time.Time) *AccessTokenCreate
- func (atc *AccessTokenCreate) SetID(u uuid.UUID) *AccessTokenCreate
- func (atc *AccessTokenCreate) SetNillableID(u *uuid.UUID) *AccessTokenCreate
- func (atc *AccessTokenCreate) SetNillableUserID(id *uuid.UUID) *AccessTokenCreate
- func (atc *AccessTokenCreate) SetToken(s string) *AccessTokenCreate
- func (atc *AccessTokenCreate) SetUser(u *User) *AccessTokenCreate
- func (atc *AccessTokenCreate) SetUserID(id uuid.UUID) *AccessTokenCreate
- type AccessTokenCreateBulk
- func (atcb *AccessTokenCreateBulk) Exec(ctx context.Context) error
- func (atcb *AccessTokenCreateBulk) ExecX(ctx context.Context)
- func (atcb *AccessTokenCreateBulk) OnConflict(opts ...sql.ConflictOption) *AccessTokenUpsertBulk
- func (atcb *AccessTokenCreateBulk) OnConflictColumns(columns ...string) *AccessTokenUpsertBulk
- func (atcb *AccessTokenCreateBulk) Save(ctx context.Context) ([]*AccessToken, error)
- func (atcb *AccessTokenCreateBulk) SaveX(ctx context.Context) []*AccessToken
- type AccessTokenDelete
- type AccessTokenDeleteOne
- type AccessTokenEdges
- type AccessTokenGroupBy
- func (atgb *AccessTokenGroupBy) Aggregate(fns ...AggregateFunc) *AccessTokenGroupBy
- func (s *AccessTokenGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *AccessTokenGroupBy) BoolX(ctx context.Context) bool
- func (s *AccessTokenGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *AccessTokenGroupBy) BoolsX(ctx context.Context) []bool
- func (s *AccessTokenGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *AccessTokenGroupBy) Float64X(ctx context.Context) float64
- func (s *AccessTokenGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *AccessTokenGroupBy) Float64sX(ctx context.Context) []float64
- func (s *AccessTokenGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *AccessTokenGroupBy) IntX(ctx context.Context) int
- func (s *AccessTokenGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *AccessTokenGroupBy) IntsX(ctx context.Context) []int
- func (atgb *AccessTokenGroupBy) Scan(ctx context.Context, v any) error
- func (s *AccessTokenGroupBy) ScanX(ctx context.Context, v any)
- func (s *AccessTokenGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *AccessTokenGroupBy) StringX(ctx context.Context) string
- func (s *AccessTokenGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *AccessTokenGroupBy) StringsX(ctx context.Context) []string
- type AccessTokenMutation
- func (m *AccessTokenMutation) AddField(name string, value ent.Value) error
- func (m *AccessTokenMutation) AddGroupIDs(ids ...uuid.UUID)
- func (m *AccessTokenMutation) AddedEdges() []string
- func (m *AccessTokenMutation) AddedField(name string) (ent.Value, bool)
- func (m *AccessTokenMutation) AddedFields() []string
- func (m *AccessTokenMutation) AddedIDs(name string) []ent.Value
- func (m *AccessTokenMutation) ClearEdge(name string) error
- func (m *AccessTokenMutation) ClearField(name string) error
- func (m *AccessTokenMutation) ClearGroups()
- func (m *AccessTokenMutation) ClearUser()
- func (m *AccessTokenMutation) ClearedEdges() []string
- func (m *AccessTokenMutation) ClearedFields() []string
- func (m AccessTokenMutation) Client() *Client
- func (m *AccessTokenMutation) EdgeCleared(name string) bool
- func (m *AccessTokenMutation) ExpiresAt() (r time.Time, exists bool)
- func (m *AccessTokenMutation) Field(name string) (ent.Value, bool)
- func (m *AccessTokenMutation) FieldCleared(name string) bool
- func (m *AccessTokenMutation) Fields() []string
- func (m *AccessTokenMutation) GroupsCleared() bool
- func (m *AccessTokenMutation) GroupsIDs() (ids []uuid.UUID)
- func (m *AccessTokenMutation) ID() (id uuid.UUID, exists bool)
- func (m *AccessTokenMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *AccessTokenMutation) OldExpiresAt(ctx context.Context) (v time.Time, err error)
- func (m *AccessTokenMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *AccessTokenMutation) OldToken(ctx context.Context) (v string, err error)
- func (m *AccessTokenMutation) Op() Op
- func (m *AccessTokenMutation) RemoveGroupIDs(ids ...uuid.UUID)
- func (m *AccessTokenMutation) RemovedEdges() []string
- func (m *AccessTokenMutation) RemovedGroupsIDs() (ids []uuid.UUID)
- func (m *AccessTokenMutation) RemovedIDs(name string) []ent.Value
- func (m *AccessTokenMutation) ResetEdge(name string) error
- func (m *AccessTokenMutation) ResetExpiresAt()
- func (m *AccessTokenMutation) ResetField(name string) error
- func (m *AccessTokenMutation) ResetGroups()
- func (m *AccessTokenMutation) ResetToken()
- func (m *AccessTokenMutation) ResetUser()
- func (m *AccessTokenMutation) SetExpiresAt(t time.Time)
- func (m *AccessTokenMutation) SetField(name string, value ent.Value) error
- func (m *AccessTokenMutation) SetID(id uuid.UUID)
- func (m *AccessTokenMutation) SetOp(op Op)
- func (m *AccessTokenMutation) SetToken(s string)
- func (m *AccessTokenMutation) SetUserID(id uuid.UUID)
- func (m *AccessTokenMutation) Token() (r string, exists bool)
- func (m AccessTokenMutation) Tx() (*Tx, error)
- func (m *AccessTokenMutation) Type() string
- func (m *AccessTokenMutation) UserCleared() bool
- func (m *AccessTokenMutation) UserID() (id uuid.UUID, exists bool)
- func (m *AccessTokenMutation) UserIDs() (ids []uuid.UUID)
- func (m *AccessTokenMutation) Where(ps ...predicate.AccessToken)
- func (m *AccessTokenMutation) WhereP(ps ...func(*sql.Selector))
- type AccessTokenQuery
- func (atq *AccessTokenQuery) Aggregate(fns ...AggregateFunc) *AccessTokenSelect
- func (atq *AccessTokenQuery) All(ctx context.Context) ([]*AccessToken, error)
- func (atq *AccessTokenQuery) AllX(ctx context.Context) []*AccessToken
- func (atq *AccessTokenQuery) Clone() *AccessTokenQuery
- func (atq *AccessTokenQuery) Count(ctx context.Context) (int, error)
- func (atq *AccessTokenQuery) CountX(ctx context.Context) int
- func (atq *AccessTokenQuery) Exist(ctx context.Context) (bool, error)
- func (atq *AccessTokenQuery) ExistX(ctx context.Context) bool
- func (atq *AccessTokenQuery) First(ctx context.Context) (*AccessToken, error)
- func (atq *AccessTokenQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (atq *AccessTokenQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (atq *AccessTokenQuery) FirstX(ctx context.Context) *AccessToken
- func (atq *AccessTokenQuery) GroupBy(field string, fields ...string) *AccessTokenGroupBy
- func (atq *AccessTokenQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (atq *AccessTokenQuery) IDsX(ctx context.Context) []uuid.UUID
- func (atq *AccessTokenQuery) Limit(limit int) *AccessTokenQuery
- func (atq *AccessTokenQuery) Offset(offset int) *AccessTokenQuery
- func (atq *AccessTokenQuery) Only(ctx context.Context) (*AccessToken, error)
- func (atq *AccessTokenQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (atq *AccessTokenQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (atq *AccessTokenQuery) OnlyX(ctx context.Context) *AccessToken
- func (atq *AccessTokenQuery) Order(o ...accesstoken.OrderOption) *AccessTokenQuery
- func (atq *AccessTokenQuery) QueryGroups() *GroupQuery
- func (atq *AccessTokenQuery) QueryUser() *UserQuery
- func (atq *AccessTokenQuery) Select(fields ...string) *AccessTokenSelect
- func (atq *AccessTokenQuery) Unique(unique bool) *AccessTokenQuery
- func (atq *AccessTokenQuery) Where(ps ...predicate.AccessToken) *AccessTokenQuery
- func (atq *AccessTokenQuery) WithGroups(opts ...func(*GroupQuery)) *AccessTokenQuery
- func (atq *AccessTokenQuery) WithUser(opts ...func(*UserQuery)) *AccessTokenQuery
- type AccessTokenSelect
- func (ats *AccessTokenSelect) Aggregate(fns ...AggregateFunc) *AccessTokenSelect
- func (s *AccessTokenSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *AccessTokenSelect) BoolX(ctx context.Context) bool
- func (s *AccessTokenSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *AccessTokenSelect) BoolsX(ctx context.Context) []bool
- func (s *AccessTokenSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *AccessTokenSelect) Float64X(ctx context.Context) float64
- func (s *AccessTokenSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *AccessTokenSelect) Float64sX(ctx context.Context) []float64
- func (s *AccessTokenSelect) Int(ctx context.Context) (_ int, err error)
- func (s *AccessTokenSelect) IntX(ctx context.Context) int
- func (s *AccessTokenSelect) Ints(ctx context.Context) ([]int, error)
- func (s *AccessTokenSelect) IntsX(ctx context.Context) []int
- func (ats *AccessTokenSelect) Scan(ctx context.Context, v any) error
- func (s *AccessTokenSelect) ScanX(ctx context.Context, v any)
- func (s *AccessTokenSelect) String(ctx context.Context) (_ string, err error)
- func (s *AccessTokenSelect) StringX(ctx context.Context) string
- func (s *AccessTokenSelect) Strings(ctx context.Context) ([]string, error)
- func (s *AccessTokenSelect) StringsX(ctx context.Context) []string
- type AccessTokenUpdate
- func (atu *AccessTokenUpdate) AddGroupIDs(ids ...uuid.UUID) *AccessTokenUpdate
- func (atu *AccessTokenUpdate) AddGroups(g ...*Group) *AccessTokenUpdate
- func (atu *AccessTokenUpdate) ClearGroups() *AccessTokenUpdate
- func (atu *AccessTokenUpdate) ClearUser() *AccessTokenUpdate
- func (atu *AccessTokenUpdate) Exec(ctx context.Context) error
- func (atu *AccessTokenUpdate) ExecX(ctx context.Context)
- func (atu *AccessTokenUpdate) Mutation() *AccessTokenMutation
- func (atu *AccessTokenUpdate) RemoveGroupIDs(ids ...uuid.UUID) *AccessTokenUpdate
- func (atu *AccessTokenUpdate) RemoveGroups(g ...*Group) *AccessTokenUpdate
- func (atu *AccessTokenUpdate) Save(ctx context.Context) (int, error)
- func (atu *AccessTokenUpdate) SaveX(ctx context.Context) int
- func (atu *AccessTokenUpdate) SetExpiresAt(t time.Time) *AccessTokenUpdate
- func (atu *AccessTokenUpdate) SetNillableExpiresAt(t *time.Time) *AccessTokenUpdate
- func (atu *AccessTokenUpdate) SetNillableToken(s *string) *AccessTokenUpdate
- func (atu *AccessTokenUpdate) SetNillableUserID(id *uuid.UUID) *AccessTokenUpdate
- func (atu *AccessTokenUpdate) SetToken(s string) *AccessTokenUpdate
- func (atu *AccessTokenUpdate) SetUser(u *User) *AccessTokenUpdate
- func (atu *AccessTokenUpdate) SetUserID(id uuid.UUID) *AccessTokenUpdate
- func (atu *AccessTokenUpdate) Where(ps ...predicate.AccessToken) *AccessTokenUpdate
- type AccessTokenUpdateOne
- func (atuo *AccessTokenUpdateOne) AddGroupIDs(ids ...uuid.UUID) *AccessTokenUpdateOne
- func (atuo *AccessTokenUpdateOne) AddGroups(g ...*Group) *AccessTokenUpdateOne
- func (atuo *AccessTokenUpdateOne) ClearGroups() *AccessTokenUpdateOne
- func (atuo *AccessTokenUpdateOne) ClearUser() *AccessTokenUpdateOne
- func (atuo *AccessTokenUpdateOne) Exec(ctx context.Context) error
- func (atuo *AccessTokenUpdateOne) ExecX(ctx context.Context)
- func (atuo *AccessTokenUpdateOne) Mutation() *AccessTokenMutation
- func (atuo *AccessTokenUpdateOne) RemoveGroupIDs(ids ...uuid.UUID) *AccessTokenUpdateOne
- func (atuo *AccessTokenUpdateOne) RemoveGroups(g ...*Group) *AccessTokenUpdateOne
- func (atuo *AccessTokenUpdateOne) Save(ctx context.Context) (*AccessToken, error)
- func (atuo *AccessTokenUpdateOne) SaveX(ctx context.Context) *AccessToken
- func (atuo *AccessTokenUpdateOne) Select(field string, fields ...string) *AccessTokenUpdateOne
- func (atuo *AccessTokenUpdateOne) SetExpiresAt(t time.Time) *AccessTokenUpdateOne
- func (atuo *AccessTokenUpdateOne) SetNillableExpiresAt(t *time.Time) *AccessTokenUpdateOne
- func (atuo *AccessTokenUpdateOne) SetNillableToken(s *string) *AccessTokenUpdateOne
- func (atuo *AccessTokenUpdateOne) SetNillableUserID(id *uuid.UUID) *AccessTokenUpdateOne
- func (atuo *AccessTokenUpdateOne) SetToken(s string) *AccessTokenUpdateOne
- func (atuo *AccessTokenUpdateOne) SetUser(u *User) *AccessTokenUpdateOne
- func (atuo *AccessTokenUpdateOne) SetUserID(id uuid.UUID) *AccessTokenUpdateOne
- func (atuo *AccessTokenUpdateOne) Where(ps ...predicate.AccessToken) *AccessTokenUpdateOne
- type AccessTokenUpsert
- type AccessTokenUpsertBulk
- func (u *AccessTokenUpsertBulk) DoNothing() *AccessTokenUpsertBulk
- func (u *AccessTokenUpsertBulk) Exec(ctx context.Context) error
- func (u *AccessTokenUpsertBulk) ExecX(ctx context.Context)
- func (u *AccessTokenUpsertBulk) Ignore() *AccessTokenUpsertBulk
- func (u *AccessTokenUpsertBulk) SetExpiresAt(v time.Time) *AccessTokenUpsertBulk
- func (u *AccessTokenUpsertBulk) SetToken(v string) *AccessTokenUpsertBulk
- func (u *AccessTokenUpsertBulk) Update(set func(*AccessTokenUpsert)) *AccessTokenUpsertBulk
- func (u *AccessTokenUpsertBulk) UpdateExpiresAt() *AccessTokenUpsertBulk
- func (u *AccessTokenUpsertBulk) UpdateNewValues() *AccessTokenUpsertBulk
- func (u *AccessTokenUpsertBulk) UpdateToken() *AccessTokenUpsertBulk
- type AccessTokenUpsertOne
- func (u *AccessTokenUpsertOne) DoNothing() *AccessTokenUpsertOne
- func (u *AccessTokenUpsertOne) Exec(ctx context.Context) error
- func (u *AccessTokenUpsertOne) ExecX(ctx context.Context)
- func (u *AccessTokenUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)
- func (u *AccessTokenUpsertOne) IDX(ctx context.Context) uuid.UUID
- func (u *AccessTokenUpsertOne) Ignore() *AccessTokenUpsertOne
- func (u *AccessTokenUpsertOne) SetExpiresAt(v time.Time) *AccessTokenUpsertOne
- func (u *AccessTokenUpsertOne) SetToken(v string) *AccessTokenUpsertOne
- func (u *AccessTokenUpsertOne) Update(set func(*AccessTokenUpsert)) *AccessTokenUpsertOne
- func (u *AccessTokenUpsertOne) UpdateExpiresAt() *AccessTokenUpsertOne
- func (u *AccessTokenUpsertOne) UpdateNewValues() *AccessTokenUpsertOne
- func (u *AccessTokenUpsertOne) UpdateToken() *AccessTokenUpsertOne
- type AccessTokens
- 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 Code
- type CodeClient
- func (c *CodeClient) Create() *CodeCreate
- func (c *CodeClient) CreateBulk(builders ...*CodeCreate) *CodeCreateBulk
- func (c *CodeClient) Delete() *CodeDelete
- func (c *CodeClient) DeleteOne(co *Code) *CodeDeleteOne
- func (c *CodeClient) DeleteOneID(id uuid.UUID) *CodeDeleteOne
- func (c *CodeClient) Get(ctx context.Context, id uuid.UUID) (*Code, error)
- func (c *CodeClient) GetX(ctx context.Context, id uuid.UUID) *Code
- func (c *CodeClient) Hooks() []Hook
- func (c *CodeClient) Intercept(interceptors ...Interceptor)
- func (c *CodeClient) Interceptors() []Interceptor
- func (c *CodeClient) MapCreateBulk(slice any, setFunc func(*CodeCreate, int)) *CodeCreateBulk
- func (c *CodeClient) Query() *CodeQuery
- func (c *CodeClient) QueryGroups(co *Code) *GroupQuery
- func (c *CodeClient) QueryUser(co *Code) *UserQuery
- func (c *CodeClient) Update() *CodeUpdate
- func (c *CodeClient) UpdateOne(co *Code) *CodeUpdateOne
- func (c *CodeClient) UpdateOneID(id uuid.UUID) *CodeUpdateOne
- func (c *CodeClient) Use(hooks ...Hook)
- type CodeCreate
- func (cc *CodeCreate) AddGroupIDs(ids ...uuid.UUID) *CodeCreate
- func (cc *CodeCreate) AddGroups(g ...*Group) *CodeCreate
- func (cc *CodeCreate) Exec(ctx context.Context) error
- func (cc *CodeCreate) ExecX(ctx context.Context)
- func (cc *CodeCreate) Mutation() *CodeMutation
- func (cc *CodeCreate) OnConflict(opts ...sql.ConflictOption) *CodeUpsertOne
- func (cc *CodeCreate) OnConflictColumns(columns ...string) *CodeUpsertOne
- func (cc *CodeCreate) Save(ctx context.Context) (*Code, error)
- func (cc *CodeCreate) SaveX(ctx context.Context) *Code
- func (cc *CodeCreate) SetClientID(s string) *CodeCreate
- func (cc *CodeCreate) SetCode(s string) *CodeCreate
- func (cc *CodeCreate) SetCodeChallenge(s string) *CodeCreate
- func (cc *CodeCreate) SetExpiresAt(t time.Time) *CodeCreate
- func (cc *CodeCreate) SetID(u uuid.UUID) *CodeCreate
- func (cc *CodeCreate) SetNillableClientID(s *string) *CodeCreate
- func (cc *CodeCreate) SetNillableCodeChallenge(s *string) *CodeCreate
- func (cc *CodeCreate) SetNillableID(u *uuid.UUID) *CodeCreate
- func (cc *CodeCreate) SetNillableRedirectURI(s *string) *CodeCreate
- func (cc *CodeCreate) SetNillableScope(s *string) *CodeCreate
- func (cc *CodeCreate) SetNillableUserID(id *uuid.UUID) *CodeCreate
- func (cc *CodeCreate) SetRedirectURI(s string) *CodeCreate
- func (cc *CodeCreate) SetScope(s string) *CodeCreate
- func (cc *CodeCreate) SetUser(u *User) *CodeCreate
- func (cc *CodeCreate) SetUserID(id uuid.UUID) *CodeCreate
- type CodeCreateBulk
- func (ccb *CodeCreateBulk) Exec(ctx context.Context) error
- func (ccb *CodeCreateBulk) ExecX(ctx context.Context)
- func (ccb *CodeCreateBulk) OnConflict(opts ...sql.ConflictOption) *CodeUpsertBulk
- func (ccb *CodeCreateBulk) OnConflictColumns(columns ...string) *CodeUpsertBulk
- func (ccb *CodeCreateBulk) Save(ctx context.Context) ([]*Code, error)
- func (ccb *CodeCreateBulk) SaveX(ctx context.Context) []*Code
- type CodeDelete
- type CodeDeleteOne
- type CodeEdges
- type CodeGroupBy
- func (cgb *CodeGroupBy) Aggregate(fns ...AggregateFunc) *CodeGroupBy
- func (s *CodeGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *CodeGroupBy) BoolX(ctx context.Context) bool
- func (s *CodeGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *CodeGroupBy) BoolsX(ctx context.Context) []bool
- func (s *CodeGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *CodeGroupBy) Float64X(ctx context.Context) float64
- func (s *CodeGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *CodeGroupBy) Float64sX(ctx context.Context) []float64
- func (s *CodeGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *CodeGroupBy) IntX(ctx context.Context) int
- func (s *CodeGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *CodeGroupBy) IntsX(ctx context.Context) []int
- func (cgb *CodeGroupBy) Scan(ctx context.Context, v any) error
- func (s *CodeGroupBy) ScanX(ctx context.Context, v any)
- func (s *CodeGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *CodeGroupBy) StringX(ctx context.Context) string
- func (s *CodeGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *CodeGroupBy) StringsX(ctx context.Context) []string
- type CodeMutation
- func (m *CodeMutation) AddField(name string, value ent.Value) error
- func (m *CodeMutation) AddGroupIDs(ids ...uuid.UUID)
- func (m *CodeMutation) AddedEdges() []string
- func (m *CodeMutation) AddedField(name string) (ent.Value, bool)
- func (m *CodeMutation) AddedFields() []string
- func (m *CodeMutation) AddedIDs(name string) []ent.Value
- func (m *CodeMutation) ClearEdge(name string) error
- func (m *CodeMutation) ClearField(name string) error
- func (m *CodeMutation) ClearGroups()
- func (m *CodeMutation) ClearUser()
- func (m *CodeMutation) ClearedEdges() []string
- func (m *CodeMutation) ClearedFields() []string
- func (m CodeMutation) Client() *Client
- func (m *CodeMutation) ClientID() (r string, exists bool)
- func (m *CodeMutation) Code() (r string, exists bool)
- func (m *CodeMutation) CodeChallenge() (r string, exists bool)
- func (m *CodeMutation) EdgeCleared(name string) bool
- func (m *CodeMutation) ExpiresAt() (r time.Time, exists bool)
- func (m *CodeMutation) Field(name string) (ent.Value, bool)
- func (m *CodeMutation) FieldCleared(name string) bool
- func (m *CodeMutation) Fields() []string
- func (m *CodeMutation) GroupsCleared() bool
- func (m *CodeMutation) GroupsIDs() (ids []uuid.UUID)
- func (m *CodeMutation) ID() (id uuid.UUID, exists bool)
- func (m *CodeMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *CodeMutation) OldClientID(ctx context.Context) (v string, err error)
- func (m *CodeMutation) OldCode(ctx context.Context) (v string, err error)
- func (m *CodeMutation) OldCodeChallenge(ctx context.Context) (v string, err error)
- func (m *CodeMutation) OldExpiresAt(ctx context.Context) (v time.Time, err error)
- func (m *CodeMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CodeMutation) OldRedirectURI(ctx context.Context) (v string, err error)
- func (m *CodeMutation) OldScope(ctx context.Context) (v string, err error)
- func (m *CodeMutation) Op() Op
- func (m *CodeMutation) RedirectURI() (r string, exists bool)
- func (m *CodeMutation) RemoveGroupIDs(ids ...uuid.UUID)
- func (m *CodeMutation) RemovedEdges() []string
- func (m *CodeMutation) RemovedGroupsIDs() (ids []uuid.UUID)
- func (m *CodeMutation) RemovedIDs(name string) []ent.Value
- func (m *CodeMutation) ResetClientID()
- func (m *CodeMutation) ResetCode()
- func (m *CodeMutation) ResetCodeChallenge()
- func (m *CodeMutation) ResetEdge(name string) error
- func (m *CodeMutation) ResetExpiresAt()
- func (m *CodeMutation) ResetField(name string) error
- func (m *CodeMutation) ResetGroups()
- func (m *CodeMutation) ResetRedirectURI()
- func (m *CodeMutation) ResetScope()
- func (m *CodeMutation) ResetUser()
- func (m *CodeMutation) Scope() (r string, exists bool)
- func (m *CodeMutation) SetClientID(s string)
- func (m *CodeMutation) SetCode(s string)
- func (m *CodeMutation) SetCodeChallenge(s string)
- func (m *CodeMutation) SetExpiresAt(t time.Time)
- func (m *CodeMutation) SetField(name string, value ent.Value) error
- func (m *CodeMutation) SetID(id uuid.UUID)
- func (m *CodeMutation) SetOp(op Op)
- func (m *CodeMutation) SetRedirectURI(s string)
- func (m *CodeMutation) SetScope(s string)
- func (m *CodeMutation) SetUserID(id uuid.UUID)
- func (m CodeMutation) Tx() (*Tx, error)
- func (m *CodeMutation) Type() string
- func (m *CodeMutation) UserCleared() bool
- func (m *CodeMutation) UserID() (id uuid.UUID, exists bool)
- func (m *CodeMutation) UserIDs() (ids []uuid.UUID)
- func (m *CodeMutation) Where(ps ...predicate.Code)
- func (m *CodeMutation) WhereP(ps ...func(*sql.Selector))
- type CodeQuery
- func (cq *CodeQuery) Aggregate(fns ...AggregateFunc) *CodeSelect
- func (cq *CodeQuery) All(ctx context.Context) ([]*Code, error)
- func (cq *CodeQuery) AllX(ctx context.Context) []*Code
- func (cq *CodeQuery) Clone() *CodeQuery
- func (cq *CodeQuery) Count(ctx context.Context) (int, error)
- func (cq *CodeQuery) CountX(ctx context.Context) int
- func (cq *CodeQuery) Exist(ctx context.Context) (bool, error)
- func (cq *CodeQuery) ExistX(ctx context.Context) bool
- func (cq *CodeQuery) First(ctx context.Context) (*Code, error)
- func (cq *CodeQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (cq *CodeQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (cq *CodeQuery) FirstX(ctx context.Context) *Code
- func (cq *CodeQuery) GroupBy(field string, fields ...string) *CodeGroupBy
- func (cq *CodeQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (cq *CodeQuery) IDsX(ctx context.Context) []uuid.UUID
- func (cq *CodeQuery) Limit(limit int) *CodeQuery
- func (cq *CodeQuery) Offset(offset int) *CodeQuery
- func (cq *CodeQuery) Only(ctx context.Context) (*Code, error)
- func (cq *CodeQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (cq *CodeQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (cq *CodeQuery) OnlyX(ctx context.Context) *Code
- func (cq *CodeQuery) Order(o ...code.OrderOption) *CodeQuery
- func (cq *CodeQuery) QueryGroups() *GroupQuery
- func (cq *CodeQuery) QueryUser() *UserQuery
- func (cq *CodeQuery) Select(fields ...string) *CodeSelect
- func (cq *CodeQuery) Unique(unique bool) *CodeQuery
- func (cq *CodeQuery) Where(ps ...predicate.Code) *CodeQuery
- func (cq *CodeQuery) WithGroups(opts ...func(*GroupQuery)) *CodeQuery
- func (cq *CodeQuery) WithUser(opts ...func(*UserQuery)) *CodeQuery
- type CodeSelect
- func (cs *CodeSelect) Aggregate(fns ...AggregateFunc) *CodeSelect
- func (s *CodeSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *CodeSelect) BoolX(ctx context.Context) bool
- func (s *CodeSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *CodeSelect) BoolsX(ctx context.Context) []bool
- func (s *CodeSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *CodeSelect) Float64X(ctx context.Context) float64
- func (s *CodeSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *CodeSelect) Float64sX(ctx context.Context) []float64
- func (s *CodeSelect) Int(ctx context.Context) (_ int, err error)
- func (s *CodeSelect) IntX(ctx context.Context) int
- func (s *CodeSelect) Ints(ctx context.Context) ([]int, error)
- func (s *CodeSelect) IntsX(ctx context.Context) []int
- func (cs *CodeSelect) Scan(ctx context.Context, v any) error
- func (s *CodeSelect) ScanX(ctx context.Context, v any)
- func (s *CodeSelect) String(ctx context.Context) (_ string, err error)
- func (s *CodeSelect) StringX(ctx context.Context) string
- func (s *CodeSelect) Strings(ctx context.Context) ([]string, error)
- func (s *CodeSelect) StringsX(ctx context.Context) []string
- type CodeUpdate
- func (cu *CodeUpdate) AddGroupIDs(ids ...uuid.UUID) *CodeUpdate
- func (cu *CodeUpdate) AddGroups(g ...*Group) *CodeUpdate
- func (cu *CodeUpdate) ClearGroups() *CodeUpdate
- func (cu *CodeUpdate) ClearUser() *CodeUpdate
- func (cu *CodeUpdate) Exec(ctx context.Context) error
- func (cu *CodeUpdate) ExecX(ctx context.Context)
- func (cu *CodeUpdate) Mutation() *CodeMutation
- func (cu *CodeUpdate) RemoveGroupIDs(ids ...uuid.UUID) *CodeUpdate
- func (cu *CodeUpdate) RemoveGroups(g ...*Group) *CodeUpdate
- func (cu *CodeUpdate) Save(ctx context.Context) (int, error)
- func (cu *CodeUpdate) SaveX(ctx context.Context) int
- func (cu *CodeUpdate) SetClientID(s string) *CodeUpdate
- func (cu *CodeUpdate) SetCode(s string) *CodeUpdate
- func (cu *CodeUpdate) SetCodeChallenge(s string) *CodeUpdate
- func (cu *CodeUpdate) SetExpiresAt(t time.Time) *CodeUpdate
- func (cu *CodeUpdate) SetNillableClientID(s *string) *CodeUpdate
- func (cu *CodeUpdate) SetNillableCode(s *string) *CodeUpdate
- func (cu *CodeUpdate) SetNillableCodeChallenge(s *string) *CodeUpdate
- func (cu *CodeUpdate) SetNillableExpiresAt(t *time.Time) *CodeUpdate
- func (cu *CodeUpdate) SetNillableRedirectURI(s *string) *CodeUpdate
- func (cu *CodeUpdate) SetNillableScope(s *string) *CodeUpdate
- func (cu *CodeUpdate) SetNillableUserID(id *uuid.UUID) *CodeUpdate
- func (cu *CodeUpdate) SetRedirectURI(s string) *CodeUpdate
- func (cu *CodeUpdate) SetScope(s string) *CodeUpdate
- func (cu *CodeUpdate) SetUser(u *User) *CodeUpdate
- func (cu *CodeUpdate) SetUserID(id uuid.UUID) *CodeUpdate
- func (cu *CodeUpdate) Where(ps ...predicate.Code) *CodeUpdate
- type CodeUpdateOne
- func (cuo *CodeUpdateOne) AddGroupIDs(ids ...uuid.UUID) *CodeUpdateOne
- func (cuo *CodeUpdateOne) AddGroups(g ...*Group) *CodeUpdateOne
- func (cuo *CodeUpdateOne) ClearGroups() *CodeUpdateOne
- func (cuo *CodeUpdateOne) ClearUser() *CodeUpdateOne
- func (cuo *CodeUpdateOne) Exec(ctx context.Context) error
- func (cuo *CodeUpdateOne) ExecX(ctx context.Context)
- func (cuo *CodeUpdateOne) Mutation() *CodeMutation
- func (cuo *CodeUpdateOne) RemoveGroupIDs(ids ...uuid.UUID) *CodeUpdateOne
- func (cuo *CodeUpdateOne) RemoveGroups(g ...*Group) *CodeUpdateOne
- func (cuo *CodeUpdateOne) Save(ctx context.Context) (*Code, error)
- func (cuo *CodeUpdateOne) SaveX(ctx context.Context) *Code
- func (cuo *CodeUpdateOne) Select(field string, fields ...string) *CodeUpdateOne
- func (cuo *CodeUpdateOne) SetClientID(s string) *CodeUpdateOne
- func (cuo *CodeUpdateOne) SetCode(s string) *CodeUpdateOne
- func (cuo *CodeUpdateOne) SetCodeChallenge(s string) *CodeUpdateOne
- func (cuo *CodeUpdateOne) SetExpiresAt(t time.Time) *CodeUpdateOne
- func (cuo *CodeUpdateOne) SetNillableClientID(s *string) *CodeUpdateOne
- func (cuo *CodeUpdateOne) SetNillableCode(s *string) *CodeUpdateOne
- func (cuo *CodeUpdateOne) SetNillableCodeChallenge(s *string) *CodeUpdateOne
- func (cuo *CodeUpdateOne) SetNillableExpiresAt(t *time.Time) *CodeUpdateOne
- func (cuo *CodeUpdateOne) SetNillableRedirectURI(s *string) *CodeUpdateOne
- func (cuo *CodeUpdateOne) SetNillableScope(s *string) *CodeUpdateOne
- func (cuo *CodeUpdateOne) SetNillableUserID(id *uuid.UUID) *CodeUpdateOne
- func (cuo *CodeUpdateOne) SetRedirectURI(s string) *CodeUpdateOne
- func (cuo *CodeUpdateOne) SetScope(s string) *CodeUpdateOne
- func (cuo *CodeUpdateOne) SetUser(u *User) *CodeUpdateOne
- func (cuo *CodeUpdateOne) SetUserID(id uuid.UUID) *CodeUpdateOne
- func (cuo *CodeUpdateOne) Where(ps ...predicate.Code) *CodeUpdateOne
- type CodeUpsert
- func (u *CodeUpsert) SetClientID(v string) *CodeUpsert
- func (u *CodeUpsert) SetCode(v string) *CodeUpsert
- func (u *CodeUpsert) SetCodeChallenge(v string) *CodeUpsert
- func (u *CodeUpsert) SetExpiresAt(v time.Time) *CodeUpsert
- func (u *CodeUpsert) SetRedirectURI(v string) *CodeUpsert
- func (u *CodeUpsert) SetScope(v string) *CodeUpsert
- func (u *CodeUpsert) UpdateClientID() *CodeUpsert
- func (u *CodeUpsert) UpdateCode() *CodeUpsert
- func (u *CodeUpsert) UpdateCodeChallenge() *CodeUpsert
- func (u *CodeUpsert) UpdateExpiresAt() *CodeUpsert
- func (u *CodeUpsert) UpdateRedirectURI() *CodeUpsert
- func (u *CodeUpsert) UpdateScope() *CodeUpsert
- type CodeUpsertBulk
- func (u *CodeUpsertBulk) DoNothing() *CodeUpsertBulk
- func (u *CodeUpsertBulk) Exec(ctx context.Context) error
- func (u *CodeUpsertBulk) ExecX(ctx context.Context)
- func (u *CodeUpsertBulk) Ignore() *CodeUpsertBulk
- func (u *CodeUpsertBulk) SetClientID(v string) *CodeUpsertBulk
- func (u *CodeUpsertBulk) SetCode(v string) *CodeUpsertBulk
- func (u *CodeUpsertBulk) SetCodeChallenge(v string) *CodeUpsertBulk
- func (u *CodeUpsertBulk) SetExpiresAt(v time.Time) *CodeUpsertBulk
- func (u *CodeUpsertBulk) SetRedirectURI(v string) *CodeUpsertBulk
- func (u *CodeUpsertBulk) SetScope(v string) *CodeUpsertBulk
- func (u *CodeUpsertBulk) Update(set func(*CodeUpsert)) *CodeUpsertBulk
- func (u *CodeUpsertBulk) UpdateClientID() *CodeUpsertBulk
- func (u *CodeUpsertBulk) UpdateCode() *CodeUpsertBulk
- func (u *CodeUpsertBulk) UpdateCodeChallenge() *CodeUpsertBulk
- func (u *CodeUpsertBulk) UpdateExpiresAt() *CodeUpsertBulk
- func (u *CodeUpsertBulk) UpdateNewValues() *CodeUpsertBulk
- func (u *CodeUpsertBulk) UpdateRedirectURI() *CodeUpsertBulk
- func (u *CodeUpsertBulk) UpdateScope() *CodeUpsertBulk
- type CodeUpsertOne
- func (u *CodeUpsertOne) DoNothing() *CodeUpsertOne
- func (u *CodeUpsertOne) Exec(ctx context.Context) error
- func (u *CodeUpsertOne) ExecX(ctx context.Context)
- func (u *CodeUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)
- func (u *CodeUpsertOne) IDX(ctx context.Context) uuid.UUID
- func (u *CodeUpsertOne) Ignore() *CodeUpsertOne
- func (u *CodeUpsertOne) SetClientID(v string) *CodeUpsertOne
- func (u *CodeUpsertOne) SetCode(v string) *CodeUpsertOne
- func (u *CodeUpsertOne) SetCodeChallenge(v string) *CodeUpsertOne
- func (u *CodeUpsertOne) SetExpiresAt(v time.Time) *CodeUpsertOne
- func (u *CodeUpsertOne) SetRedirectURI(v string) *CodeUpsertOne
- func (u *CodeUpsertOne) SetScope(v string) *CodeUpsertOne
- func (u *CodeUpsertOne) Update(set func(*CodeUpsert)) *CodeUpsertOne
- func (u *CodeUpsertOne) UpdateClientID() *CodeUpsertOne
- func (u *CodeUpsertOne) UpdateCode() *CodeUpsertOne
- func (u *CodeUpsertOne) UpdateCodeChallenge() *CodeUpsertOne
- func (u *CodeUpsertOne) UpdateExpiresAt() *CodeUpsertOne
- func (u *CodeUpsertOne) UpdateNewValues() *CodeUpsertOne
- func (u *CodeUpsertOne) UpdateRedirectURI() *CodeUpsertOne
- func (u *CodeUpsertOne) UpdateScope() *CodeUpsertOne
- type Codes
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Group
- type GroupClient
- func (c *GroupClient) Create() *GroupCreate
- func (c *GroupClient) CreateBulk(builders ...*GroupCreate) *GroupCreateBulk
- func (c *GroupClient) Delete() *GroupDelete
- func (c *GroupClient) DeleteOne(gr *Group) *GroupDeleteOne
- func (c *GroupClient) DeleteOneID(id uuid.UUID) *GroupDeleteOne
- func (c *GroupClient) Get(ctx context.Context, id uuid.UUID) (*Group, error)
- func (c *GroupClient) GetX(ctx context.Context, id uuid.UUID) *Group
- func (c *GroupClient) Hooks() []Hook
- func (c *GroupClient) Intercept(interceptors ...Interceptor)
- func (c *GroupClient) Interceptors() []Interceptor
- func (c *GroupClient) MapCreateBulk(slice any, setFunc func(*GroupCreate, int)) *GroupCreateBulk
- func (c *GroupClient) Query() *GroupQuery
- func (c *GroupClient) QueryAccessTokens(gr *Group) *AccessTokenQuery
- func (c *GroupClient) QueryCodes(gr *Group) *CodeQuery
- func (c *GroupClient) QueryUsers(gr *Group) *UserQuery
- func (c *GroupClient) Update() *GroupUpdate
- func (c *GroupClient) UpdateOne(gr *Group) *GroupUpdateOne
- func (c *GroupClient) UpdateOneID(id uuid.UUID) *GroupUpdateOne
- func (c *GroupClient) Use(hooks ...Hook)
- type GroupCreate
- func (gc *GroupCreate) AddAccessTokenIDs(ids ...uuid.UUID) *GroupCreate
- func (gc *GroupCreate) AddAccessTokens(a ...*AccessToken) *GroupCreate
- func (gc *GroupCreate) AddCodeIDs(ids ...uuid.UUID) *GroupCreate
- func (gc *GroupCreate) AddCodes(c ...*Code) *GroupCreate
- func (gc *GroupCreate) AddUserIDs(ids ...uuid.UUID) *GroupCreate
- func (gc *GroupCreate) AddUsers(u ...*User) *GroupCreate
- func (gc *GroupCreate) Exec(ctx context.Context) error
- func (gc *GroupCreate) ExecX(ctx context.Context)
- func (gc *GroupCreate) Mutation() *GroupMutation
- func (gc *GroupCreate) OnConflict(opts ...sql.ConflictOption) *GroupUpsertOne
- func (gc *GroupCreate) OnConflictColumns(columns ...string) *GroupUpsertOne
- func (gc *GroupCreate) Save(ctx context.Context) (*Group, error)
- func (gc *GroupCreate) SaveX(ctx context.Context) *Group
- func (gc *GroupCreate) SetID(u uuid.UUID) *GroupCreate
- func (gc *GroupCreate) SetName(s string) *GroupCreate
- func (gc *GroupCreate) SetNillableID(u *uuid.UUID) *GroupCreate
- type GroupCreateBulk
- func (gcb *GroupCreateBulk) Exec(ctx context.Context) error
- func (gcb *GroupCreateBulk) ExecX(ctx context.Context)
- func (gcb *GroupCreateBulk) OnConflict(opts ...sql.ConflictOption) *GroupUpsertBulk
- func (gcb *GroupCreateBulk) OnConflictColumns(columns ...string) *GroupUpsertBulk
- func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error)
- func (gcb *GroupCreateBulk) SaveX(ctx context.Context) []*Group
- type GroupDelete
- type GroupDeleteOne
- type GroupEdges
- type GroupGroupBy
- func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy
- func (s *GroupGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *GroupGroupBy) BoolX(ctx context.Context) bool
- func (s *GroupGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *GroupGroupBy) BoolsX(ctx context.Context) []bool
- func (s *GroupGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *GroupGroupBy) Float64X(ctx context.Context) float64
- func (s *GroupGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *GroupGroupBy) Float64sX(ctx context.Context) []float64
- func (s *GroupGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *GroupGroupBy) IntX(ctx context.Context) int
- func (s *GroupGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *GroupGroupBy) IntsX(ctx context.Context) []int
- func (ggb *GroupGroupBy) Scan(ctx context.Context, v any) error
- func (s *GroupGroupBy) ScanX(ctx context.Context, v any)
- func (s *GroupGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *GroupGroupBy) StringX(ctx context.Context) string
- func (s *GroupGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *GroupGroupBy) StringsX(ctx context.Context) []string
- type GroupMutation
- func (m *GroupMutation) AccessTokensCleared() bool
- func (m *GroupMutation) AccessTokensIDs() (ids []uuid.UUID)
- func (m *GroupMutation) AddAccessTokenIDs(ids ...uuid.UUID)
- func (m *GroupMutation) AddCodeIDs(ids ...uuid.UUID)
- func (m *GroupMutation) AddField(name string, value ent.Value) error
- func (m *GroupMutation) AddUserIDs(ids ...uuid.UUID)
- func (m *GroupMutation) AddedEdges() []string
- func (m *GroupMutation) AddedField(name string) (ent.Value, bool)
- func (m *GroupMutation) AddedFields() []string
- func (m *GroupMutation) AddedIDs(name string) []ent.Value
- func (m *GroupMutation) ClearAccessTokens()
- func (m *GroupMutation) ClearCodes()
- func (m *GroupMutation) ClearEdge(name string) error
- func (m *GroupMutation) ClearField(name string) error
- func (m *GroupMutation) ClearUsers()
- func (m *GroupMutation) ClearedEdges() []string
- func (m *GroupMutation) ClearedFields() []string
- func (m GroupMutation) Client() *Client
- func (m *GroupMutation) CodesCleared() bool
- func (m *GroupMutation) CodesIDs() (ids []uuid.UUID)
- func (m *GroupMutation) EdgeCleared(name string) bool
- func (m *GroupMutation) Field(name string) (ent.Value, bool)
- func (m *GroupMutation) FieldCleared(name string) bool
- func (m *GroupMutation) Fields() []string
- func (m *GroupMutation) ID() (id uuid.UUID, exists bool)
- func (m *GroupMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *GroupMutation) Name() (r string, exists bool)
- func (m *GroupMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *GroupMutation) OldName(ctx context.Context) (v string, err error)
- func (m *GroupMutation) Op() Op
- func (m *GroupMutation) RemoveAccessTokenIDs(ids ...uuid.UUID)
- func (m *GroupMutation) RemoveCodeIDs(ids ...uuid.UUID)
- func (m *GroupMutation) RemoveUserIDs(ids ...uuid.UUID)
- func (m *GroupMutation) RemovedAccessTokensIDs() (ids []uuid.UUID)
- func (m *GroupMutation) RemovedCodesIDs() (ids []uuid.UUID)
- func (m *GroupMutation) RemovedEdges() []string
- func (m *GroupMutation) RemovedIDs(name string) []ent.Value
- func (m *GroupMutation) RemovedUsersIDs() (ids []uuid.UUID)
- func (m *GroupMutation) ResetAccessTokens()
- func (m *GroupMutation) ResetCodes()
- func (m *GroupMutation) ResetEdge(name string) error
- func (m *GroupMutation) ResetField(name string) error
- func (m *GroupMutation) ResetName()
- func (m *GroupMutation) ResetUsers()
- func (m *GroupMutation) SetField(name string, value ent.Value) error
- func (m *GroupMutation) SetID(id uuid.UUID)
- func (m *GroupMutation) SetName(s string)
- func (m *GroupMutation) SetOp(op Op)
- func (m GroupMutation) Tx() (*Tx, error)
- func (m *GroupMutation) Type() string
- func (m *GroupMutation) UsersCleared() bool
- func (m *GroupMutation) UsersIDs() (ids []uuid.UUID)
- func (m *GroupMutation) Where(ps ...predicate.Group)
- func (m *GroupMutation) WhereP(ps ...func(*sql.Selector))
- type GroupQuery
- func (gq *GroupQuery) Aggregate(fns ...AggregateFunc) *GroupSelect
- func (gq *GroupQuery) All(ctx context.Context) ([]*Group, error)
- func (gq *GroupQuery) AllX(ctx context.Context) []*Group
- func (gq *GroupQuery) Clone() *GroupQuery
- func (gq *GroupQuery) Count(ctx context.Context) (int, error)
- func (gq *GroupQuery) CountX(ctx context.Context) int
- func (gq *GroupQuery) Exist(ctx context.Context) (bool, error)
- func (gq *GroupQuery) ExistX(ctx context.Context) bool
- func (gq *GroupQuery) First(ctx context.Context) (*Group, error)
- func (gq *GroupQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (gq *GroupQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (gq *GroupQuery) FirstX(ctx context.Context) *Group
- func (gq *GroupQuery) GroupBy(field string, fields ...string) *GroupGroupBy
- func (gq *GroupQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (gq *GroupQuery) IDsX(ctx context.Context) []uuid.UUID
- func (gq *GroupQuery) Limit(limit int) *GroupQuery
- func (gq *GroupQuery) Offset(offset int) *GroupQuery
- func (gq *GroupQuery) Only(ctx context.Context) (*Group, error)
- func (gq *GroupQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (gq *GroupQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (gq *GroupQuery) OnlyX(ctx context.Context) *Group
- func (gq *GroupQuery) Order(o ...group.OrderOption) *GroupQuery
- func (gq *GroupQuery) QueryAccessTokens() *AccessTokenQuery
- func (gq *GroupQuery) QueryCodes() *CodeQuery
- func (gq *GroupQuery) QueryUsers() *UserQuery
- func (gq *GroupQuery) Select(fields ...string) *GroupSelect
- func (gq *GroupQuery) Unique(unique bool) *GroupQuery
- func (gq *GroupQuery) Where(ps ...predicate.Group) *GroupQuery
- func (gq *GroupQuery) WithAccessTokens(opts ...func(*AccessTokenQuery)) *GroupQuery
- func (gq *GroupQuery) WithCodes(opts ...func(*CodeQuery)) *GroupQuery
- func (gq *GroupQuery) WithUsers(opts ...func(*UserQuery)) *GroupQuery
- type GroupSelect
- func (gs *GroupSelect) Aggregate(fns ...AggregateFunc) *GroupSelect
- func (s *GroupSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *GroupSelect) BoolX(ctx context.Context) bool
- func (s *GroupSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *GroupSelect) BoolsX(ctx context.Context) []bool
- func (s *GroupSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *GroupSelect) Float64X(ctx context.Context) float64
- func (s *GroupSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *GroupSelect) Float64sX(ctx context.Context) []float64
- func (s *GroupSelect) Int(ctx context.Context) (_ int, err error)
- func (s *GroupSelect) IntX(ctx context.Context) int
- func (s *GroupSelect) Ints(ctx context.Context) ([]int, error)
- func (s *GroupSelect) IntsX(ctx context.Context) []int
- func (gs *GroupSelect) Scan(ctx context.Context, v any) error
- func (s *GroupSelect) ScanX(ctx context.Context, v any)
- func (s *GroupSelect) String(ctx context.Context) (_ string, err error)
- func (s *GroupSelect) StringX(ctx context.Context) string
- func (s *GroupSelect) Strings(ctx context.Context) ([]string, error)
- func (s *GroupSelect) StringsX(ctx context.Context) []string
- type GroupUpdate
- func (gu *GroupUpdate) AddAccessTokenIDs(ids ...uuid.UUID) *GroupUpdate
- func (gu *GroupUpdate) AddAccessTokens(a ...*AccessToken) *GroupUpdate
- func (gu *GroupUpdate) AddCodeIDs(ids ...uuid.UUID) *GroupUpdate
- func (gu *GroupUpdate) AddCodes(c ...*Code) *GroupUpdate
- func (gu *GroupUpdate) AddUserIDs(ids ...uuid.UUID) *GroupUpdate
- func (gu *GroupUpdate) AddUsers(u ...*User) *GroupUpdate
- func (gu *GroupUpdate) ClearAccessTokens() *GroupUpdate
- func (gu *GroupUpdate) ClearCodes() *GroupUpdate
- func (gu *GroupUpdate) ClearUsers() *GroupUpdate
- func (gu *GroupUpdate) Exec(ctx context.Context) error
- func (gu *GroupUpdate) ExecX(ctx context.Context)
- func (gu *GroupUpdate) Mutation() *GroupMutation
- func (gu *GroupUpdate) RemoveAccessTokenIDs(ids ...uuid.UUID) *GroupUpdate
- func (gu *GroupUpdate) RemoveAccessTokens(a ...*AccessToken) *GroupUpdate
- func (gu *GroupUpdate) RemoveCodeIDs(ids ...uuid.UUID) *GroupUpdate
- func (gu *GroupUpdate) RemoveCodes(c ...*Code) *GroupUpdate
- func (gu *GroupUpdate) RemoveUserIDs(ids ...uuid.UUID) *GroupUpdate
- func (gu *GroupUpdate) RemoveUsers(u ...*User) *GroupUpdate
- func (gu *GroupUpdate) Save(ctx context.Context) (int, error)
- func (gu *GroupUpdate) SaveX(ctx context.Context) int
- func (gu *GroupUpdate) SetName(s string) *GroupUpdate
- func (gu *GroupUpdate) SetNillableName(s *string) *GroupUpdate
- func (gu *GroupUpdate) Where(ps ...predicate.Group) *GroupUpdate
- type GroupUpdateOne
- func (guo *GroupUpdateOne) AddAccessTokenIDs(ids ...uuid.UUID) *GroupUpdateOne
- func (guo *GroupUpdateOne) AddAccessTokens(a ...*AccessToken) *GroupUpdateOne
- func (guo *GroupUpdateOne) AddCodeIDs(ids ...uuid.UUID) *GroupUpdateOne
- func (guo *GroupUpdateOne) AddCodes(c ...*Code) *GroupUpdateOne
- func (guo *GroupUpdateOne) AddUserIDs(ids ...uuid.UUID) *GroupUpdateOne
- func (guo *GroupUpdateOne) AddUsers(u ...*User) *GroupUpdateOne
- func (guo *GroupUpdateOne) ClearAccessTokens() *GroupUpdateOne
- func (guo *GroupUpdateOne) ClearCodes() *GroupUpdateOne
- func (guo *GroupUpdateOne) ClearUsers() *GroupUpdateOne
- func (guo *GroupUpdateOne) Exec(ctx context.Context) error
- func (guo *GroupUpdateOne) ExecX(ctx context.Context)
- func (guo *GroupUpdateOne) Mutation() *GroupMutation
- func (guo *GroupUpdateOne) RemoveAccessTokenIDs(ids ...uuid.UUID) *GroupUpdateOne
- func (guo *GroupUpdateOne) RemoveAccessTokens(a ...*AccessToken) *GroupUpdateOne
- func (guo *GroupUpdateOne) RemoveCodeIDs(ids ...uuid.UUID) *GroupUpdateOne
- func (guo *GroupUpdateOne) RemoveCodes(c ...*Code) *GroupUpdateOne
- func (guo *GroupUpdateOne) RemoveUserIDs(ids ...uuid.UUID) *GroupUpdateOne
- func (guo *GroupUpdateOne) RemoveUsers(u ...*User) *GroupUpdateOne
- func (guo *GroupUpdateOne) Save(ctx context.Context) (*Group, error)
- func (guo *GroupUpdateOne) SaveX(ctx context.Context) *Group
- func (guo *GroupUpdateOne) Select(field string, fields ...string) *GroupUpdateOne
- func (guo *GroupUpdateOne) SetName(s string) *GroupUpdateOne
- func (guo *GroupUpdateOne) SetNillableName(s *string) *GroupUpdateOne
- func (guo *GroupUpdateOne) Where(ps ...predicate.Group) *GroupUpdateOne
- type GroupUpsert
- type GroupUpsertBulk
- func (u *GroupUpsertBulk) DoNothing() *GroupUpsertBulk
- func (u *GroupUpsertBulk) Exec(ctx context.Context) error
- func (u *GroupUpsertBulk) ExecX(ctx context.Context)
- func (u *GroupUpsertBulk) Ignore() *GroupUpsertBulk
- func (u *GroupUpsertBulk) SetName(v string) *GroupUpsertBulk
- func (u *GroupUpsertBulk) Update(set func(*GroupUpsert)) *GroupUpsertBulk
- func (u *GroupUpsertBulk) UpdateName() *GroupUpsertBulk
- func (u *GroupUpsertBulk) UpdateNewValues() *GroupUpsertBulk
- type GroupUpsertOne
- func (u *GroupUpsertOne) DoNothing() *GroupUpsertOne
- func (u *GroupUpsertOne) Exec(ctx context.Context) error
- func (u *GroupUpsertOne) ExecX(ctx context.Context)
- func (u *GroupUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)
- func (u *GroupUpsertOne) IDX(ctx context.Context) uuid.UUID
- func (u *GroupUpsertOne) Ignore() *GroupUpsertOne
- func (u *GroupUpsertOne) SetName(v string) *GroupUpsertOne
- func (u *GroupUpsertOne) Update(set func(*GroupUpsert)) *GroupUpsertOne
- func (u *GroupUpsertOne) UpdateName() *GroupUpsertOne
- func (u *GroupUpsertOne) UpdateNewValues() *GroupUpsertOne
- type Groups
- 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 TraverseFunc
- type Traverser
- type Tx
- type User
- type UserClient
- func (c *UserClient) Create() *UserCreate
- func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
- func (c *UserClient) Delete() *UserDelete
- func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
- func (c *UserClient) DeleteOneID(id uuid.UUID) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Intercept(interceptors ...Interceptor)
- func (c *UserClient) Interceptors() []Interceptor
- func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) QueryAccessTokens(u *User) *AccessTokenQuery
- func (c *UserClient) QueryCodes(u *User) *CodeQuery
- func (c *UserClient) QueryGroups(u *User) *GroupQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id uuid.UUID) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- func (uc *UserCreate) AddAccessTokenIDs(ids ...uuid.UUID) *UserCreate
- func (uc *UserCreate) AddAccessTokens(a ...*AccessToken) *UserCreate
- func (uc *UserCreate) AddCodeIDs(ids ...uuid.UUID) *UserCreate
- func (uc *UserCreate) AddCodes(c ...*Code) *UserCreate
- func (uc *UserCreate) AddGroupIDs(ids ...uuid.UUID) *UserCreate
- func (uc *UserCreate) AddGroups(g ...*Group) *UserCreate
- func (uc *UserCreate) Exec(ctx context.Context) error
- func (uc *UserCreate) ExecX(ctx context.Context)
- func (uc *UserCreate) Mutation() *UserMutation
- func (uc *UserCreate) OnConflict(opts ...sql.ConflictOption) *UserUpsertOne
- func (uc *UserCreate) OnConflictColumns(columns ...string) *UserUpsertOne
- func (uc *UserCreate) Save(ctx context.Context) (*User, error)
- func (uc *UserCreate) SaveX(ctx context.Context) *User
- func (uc *UserCreate) SetEmail(s string) *UserCreate
- func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate
- func (uc *UserCreate) SetName(s string) *UserCreate
- func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate
- type UserCreateBulk
- func (ucb *UserCreateBulk) Exec(ctx context.Context) error
- func (ucb *UserCreateBulk) ExecX(ctx context.Context)
- func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk
- func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk
- func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)
- func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User
- type UserDelete
- type UserDeleteOne
- type UserEdges
- type UserGroupBy
- func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserGroupBy) BoolX(ctx context.Context) bool
- func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserGroupBy) Float64X(ctx context.Context) float64
- func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserGroupBy) IntX(ctx context.Context) int
- func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
- func (s *UserGroupBy) ScanX(ctx context.Context, v any)
- func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserGroupBy) StringX(ctx context.Context) string
- func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) AccessTokensCleared() bool
- func (m *UserMutation) AccessTokensIDs() (ids []uuid.UUID)
- func (m *UserMutation) AddAccessTokenIDs(ids ...uuid.UUID)
- func (m *UserMutation) AddCodeIDs(ids ...uuid.UUID)
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddGroupIDs(ids ...uuid.UUID)
- func (m *UserMutation) AddedEdges() []string
- func (m *UserMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserMutation) AddedFields() []string
- func (m *UserMutation) AddedIDs(name string) []ent.Value
- func (m *UserMutation) ClearAccessTokens()
- func (m *UserMutation) ClearCodes()
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearGroups()
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) CodesCleared() bool
- func (m *UserMutation) CodesIDs() (ids []uuid.UUID)
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) Email() (r string, exists bool)
- func (m *UserMutation) Field(name string) (ent.Value, bool)
- func (m *UserMutation) FieldCleared(name string) bool
- func (m *UserMutation) Fields() []string
- func (m *UserMutation) GroupsCleared() bool
- func (m *UserMutation) GroupsIDs() (ids []uuid.UUID)
- func (m *UserMutation) ID() (id uuid.UUID, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *UserMutation) Name() (r string, exists bool)
- func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldName(ctx context.Context) (v string, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) RemoveAccessTokenIDs(ids ...uuid.UUID)
- func (m *UserMutation) RemoveCodeIDs(ids ...uuid.UUID)
- func (m *UserMutation) RemoveGroupIDs(ids ...uuid.UUID)
- func (m *UserMutation) RemovedAccessTokensIDs() (ids []uuid.UUID)
- func (m *UserMutation) RemovedCodesIDs() (ids []uuid.UUID)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedGroupsIDs() (ids []uuid.UUID)
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) ResetAccessTokens()
- func (m *UserMutation) ResetCodes()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetEmail()
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetGroups()
- func (m *UserMutation) ResetName()
- func (m *UserMutation) SetEmail(s string)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetID(id uuid.UUID)
- func (m *UserMutation) SetName(s string)
- func (m *UserMutation) SetOp(op Op)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) Where(ps ...predicate.User)
- func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
- type UserQuery
- func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
- func (uq *UserQuery) All(ctx context.Context) ([]*User, error)
- func (uq *UserQuery) AllX(ctx context.Context) []*User
- func (uq *UserQuery) Clone() *UserQuery
- func (uq *UserQuery) Count(ctx context.Context) (int, error)
- func (uq *UserQuery) CountX(ctx context.Context) int
- func (uq *UserQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UserQuery) ExistX(ctx context.Context) bool
- func (uq *UserQuery) First(ctx context.Context) (*User, error)
- func (uq *UserQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (uq *UserQuery) FirstX(ctx context.Context) *User
- func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (uq *UserQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)
- func (uq *UserQuery) IDsX(ctx context.Context) []uuid.UUID
- func (uq *UserQuery) Limit(limit int) *UserQuery
- func (uq *UserQuery) Offset(offset int) *UserQuery
- func (uq *UserQuery) Only(ctx context.Context) (*User, error)
- func (uq *UserQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
- func (uq *UserQuery) QueryAccessTokens() *AccessTokenQuery
- func (uq *UserQuery) QueryCodes() *CodeQuery
- func (uq *UserQuery) QueryGroups() *GroupQuery
- func (uq *UserQuery) Select(fields ...string) *UserSelect
- func (uq *UserQuery) Unique(unique bool) *UserQuery
- func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery
- func (uq *UserQuery) WithAccessTokens(opts ...func(*AccessTokenQuery)) *UserQuery
- func (uq *UserQuery) WithCodes(opts ...func(*CodeQuery)) *UserQuery
- func (uq *UserQuery) WithGroups(opts ...func(*GroupQuery)) *UserQuery
- type UserSelect
- func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
- func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserSelect) BoolX(ctx context.Context) bool
- func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserSelect) BoolsX(ctx context.Context) []bool
- func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserSelect) Float64X(ctx context.Context) float64
- func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserSelect) Float64sX(ctx context.Context) []float64
- func (s *UserSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserSelect) IntX(ctx context.Context) int
- func (s *UserSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserSelect) IntsX(ctx context.Context) []int
- func (us *UserSelect) Scan(ctx context.Context, v any) error
- func (s *UserSelect) ScanX(ctx context.Context, v any)
- func (s *UserSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserSelect) StringX(ctx context.Context) string
- func (s *UserSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserSelect) StringsX(ctx context.Context) []string
- type UserUpdate
- func (uu *UserUpdate) AddAccessTokenIDs(ids ...uuid.UUID) *UserUpdate
- func (uu *UserUpdate) AddAccessTokens(a ...*AccessToken) *UserUpdate
- func (uu *UserUpdate) AddCodeIDs(ids ...uuid.UUID) *UserUpdate
- func (uu *UserUpdate) AddCodes(c ...*Code) *UserUpdate
- func (uu *UserUpdate) AddGroupIDs(ids ...uuid.UUID) *UserUpdate
- func (uu *UserUpdate) AddGroups(g ...*Group) *UserUpdate
- func (uu *UserUpdate) ClearAccessTokens() *UserUpdate
- func (uu *UserUpdate) ClearCodes() *UserUpdate
- func (uu *UserUpdate) ClearGroups() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) RemoveAccessTokenIDs(ids ...uuid.UUID) *UserUpdate
- func (uu *UserUpdate) RemoveAccessTokens(a ...*AccessToken) *UserUpdate
- func (uu *UserUpdate) RemoveCodeIDs(ids ...uuid.UUID) *UserUpdate
- func (uu *UserUpdate) RemoveCodes(c ...*Code) *UserUpdate
- func (uu *UserUpdate) RemoveGroupIDs(ids ...uuid.UUID) *UserUpdate
- func (uu *UserUpdate) RemoveGroups(g ...*Group) *UserUpdate
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetEmail(s string) *UserUpdate
- func (uu *UserUpdate) SetName(s string) *UserUpdate
- func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddAccessTokenIDs(ids ...uuid.UUID) *UserUpdateOne
- func (uuo *UserUpdateOne) AddAccessTokens(a ...*AccessToken) *UserUpdateOne
- func (uuo *UserUpdateOne) AddCodeIDs(ids ...uuid.UUID) *UserUpdateOne
- func (uuo *UserUpdateOne) AddCodes(c ...*Code) *UserUpdateOne
- func (uuo *UserUpdateOne) AddGroupIDs(ids ...uuid.UUID) *UserUpdateOne
- func (uuo *UserUpdateOne) AddGroups(g ...*Group) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearAccessTokens() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearCodes() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearGroups() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) RemoveAccessTokenIDs(ids ...uuid.UUID) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveAccessTokens(a ...*AccessToken) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveCodeIDs(ids ...uuid.UUID) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveCodes(c ...*Code) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveGroupIDs(ids ...uuid.UUID) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveGroups(g ...*Group) *UserUpdateOne
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
- type UserUpsert
- type UserUpsertBulk
- func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk
- func (u *UserUpsertBulk) Exec(ctx context.Context) error
- func (u *UserUpsertBulk) ExecX(ctx context.Context)
- func (u *UserUpsertBulk) Ignore() *UserUpsertBulk
- func (u *UserUpsertBulk) SetEmail(v string) *UserUpsertBulk
- func (u *UserUpsertBulk) SetName(v string) *UserUpsertBulk
- func (u *UserUpsertBulk) Update(set func(*UserUpsert)) *UserUpsertBulk
- func (u *UserUpsertBulk) UpdateEmail() *UserUpsertBulk
- func (u *UserUpsertBulk) UpdateName() *UserUpsertBulk
- func (u *UserUpsertBulk) UpdateNewValues() *UserUpsertBulk
- type UserUpsertOne
- func (u *UserUpsertOne) DoNothing() *UserUpsertOne
- func (u *UserUpsertOne) Exec(ctx context.Context) error
- func (u *UserUpsertOne) ExecX(ctx context.Context)
- func (u *UserUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)
- func (u *UserUpsertOne) IDX(ctx context.Context) uuid.UUID
- func (u *UserUpsertOne) Ignore() *UserUpsertOne
- func (u *UserUpsertOne) SetEmail(v string) *UserUpsertOne
- func (u *UserUpsertOne) SetName(v string) *UserUpsertOne
- func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne
- func (u *UserUpsertOne) UpdateEmail() *UserUpsertOne
- func (u *UserUpsertOne) UpdateName() *UserUpsertOne
- func (u *UserUpsertOne) UpdateNewValues() *UserUpsertOne
- type Users
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeAccessToken = "AccessToken" TypeCode = "Code" TypeGroup = "Group" TypeUser = "User" )
Variables ¶
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AccessToken ¶
type AccessToken struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // Token holds the value of the "token" field. Token string `json:"token,omitempty"` // ExpiresAt holds the value of the "expires_at" field. ExpiresAt time.Time `json:"expires_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the AccessTokenQuery when eager-loading is set. Edges AccessTokenEdges `json:"edges"` // contains filtered or unexported fields }
AccessToken is the model entity for the AccessToken schema.
func (*AccessToken) QueryGroups ¶
func (at *AccessToken) QueryGroups() *GroupQuery
QueryGroups queries the "groups" edge of the AccessToken entity.
func (*AccessToken) QueryUser ¶
func (at *AccessToken) QueryUser() *UserQuery
QueryUser queries the "user" edge of the AccessToken entity.
func (*AccessToken) String ¶
func (at *AccessToken) String() string
String implements the fmt.Stringer.
func (*AccessToken) Unwrap ¶
func (at *AccessToken) Unwrap() *AccessToken
Unwrap unwraps the AccessToken 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 (*AccessToken) Update ¶
func (at *AccessToken) Update() *AccessTokenUpdateOne
Update returns a builder for updating this AccessToken. Note that you need to call AccessToken.Unwrap() before calling this method if this AccessToken was returned from a transaction, and the transaction was committed or rolled back.
type AccessTokenClient ¶
type AccessTokenClient struct {
// contains filtered or unexported fields
}
AccessTokenClient is a client for the AccessToken schema.
func NewAccessTokenClient ¶
func NewAccessTokenClient(c config) *AccessTokenClient
NewAccessTokenClient returns a client for the AccessToken from the given config.
func (*AccessTokenClient) Create ¶
func (c *AccessTokenClient) Create() *AccessTokenCreate
Create returns a builder for creating a AccessToken entity.
func (*AccessTokenClient) CreateBulk ¶
func (c *AccessTokenClient) CreateBulk(builders ...*AccessTokenCreate) *AccessTokenCreateBulk
CreateBulk returns a builder for creating a bulk of AccessToken entities.
func (*AccessTokenClient) Delete ¶
func (c *AccessTokenClient) Delete() *AccessTokenDelete
Delete returns a delete builder for AccessToken.
func (*AccessTokenClient) DeleteOne ¶
func (c *AccessTokenClient) DeleteOne(at *AccessToken) *AccessTokenDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*AccessTokenClient) DeleteOneID ¶
func (c *AccessTokenClient) DeleteOneID(id uuid.UUID) *AccessTokenDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*AccessTokenClient) Get ¶
func (c *AccessTokenClient) Get(ctx context.Context, id uuid.UUID) (*AccessToken, error)
Get returns a AccessToken entity by its id.
func (*AccessTokenClient) GetX ¶
func (c *AccessTokenClient) GetX(ctx context.Context, id uuid.UUID) *AccessToken
GetX is like Get, but panics if an error occurs.
func (*AccessTokenClient) Hooks ¶
func (c *AccessTokenClient) Hooks() []Hook
Hooks returns the client hooks.
func (*AccessTokenClient) Intercept ¶
func (c *AccessTokenClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `accesstoken.Intercept(f(g(h())))`.
func (*AccessTokenClient) Interceptors ¶
func (c *AccessTokenClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*AccessTokenClient) MapCreateBulk ¶
func (c *AccessTokenClient) MapCreateBulk(slice any, setFunc func(*AccessTokenCreate, int)) *AccessTokenCreateBulk
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 (*AccessTokenClient) Query ¶
func (c *AccessTokenClient) Query() *AccessTokenQuery
Query returns a query builder for AccessToken.
func (*AccessTokenClient) QueryGroups ¶
func (c *AccessTokenClient) QueryGroups(at *AccessToken) *GroupQuery
QueryGroups queries the groups edge of a AccessToken.
func (*AccessTokenClient) QueryUser ¶
func (c *AccessTokenClient) QueryUser(at *AccessToken) *UserQuery
QueryUser queries the user edge of a AccessToken.
func (*AccessTokenClient) Update ¶
func (c *AccessTokenClient) Update() *AccessTokenUpdate
Update returns an update builder for AccessToken.
func (*AccessTokenClient) UpdateOne ¶
func (c *AccessTokenClient) UpdateOne(at *AccessToken) *AccessTokenUpdateOne
UpdateOne returns an update builder for the given entity.
func (*AccessTokenClient) UpdateOneID ¶
func (c *AccessTokenClient) UpdateOneID(id uuid.UUID) *AccessTokenUpdateOne
UpdateOneID returns an update builder for the given id.
func (*AccessTokenClient) Use ¶
func (c *AccessTokenClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `accesstoken.Hooks(f(g(h())))`.
type AccessTokenCreate ¶
type AccessTokenCreate struct {
// contains filtered or unexported fields
}
AccessTokenCreate is the builder for creating a AccessToken entity.
func (*AccessTokenCreate) AddGroupIDs ¶
func (atc *AccessTokenCreate) AddGroupIDs(ids ...uuid.UUID) *AccessTokenCreate
AddGroupIDs adds the "groups" edge to the Group entity by IDs.
func (*AccessTokenCreate) AddGroups ¶
func (atc *AccessTokenCreate) AddGroups(g ...*Group) *AccessTokenCreate
AddGroups adds the "groups" edges to the Group entity.
func (*AccessTokenCreate) Exec ¶
func (atc *AccessTokenCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*AccessTokenCreate) ExecX ¶
func (atc *AccessTokenCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AccessTokenCreate) Mutation ¶
func (atc *AccessTokenCreate) Mutation() *AccessTokenMutation
Mutation returns the AccessTokenMutation object of the builder.
func (*AccessTokenCreate) OnConflict ¶
func (atc *AccessTokenCreate) OnConflict(opts ...sql.ConflictOption) *AccessTokenUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.AccessToken.Create(). SetToken(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.AccessTokenUpsert) { SetToken(v+v). }). Exec(ctx)
func (*AccessTokenCreate) OnConflictColumns ¶
func (atc *AccessTokenCreate) OnConflictColumns(columns ...string) *AccessTokenUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.AccessToken.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*AccessTokenCreate) Save ¶
func (atc *AccessTokenCreate) Save(ctx context.Context) (*AccessToken, error)
Save creates the AccessToken in the database.
func (*AccessTokenCreate) SaveX ¶
func (atc *AccessTokenCreate) SaveX(ctx context.Context) *AccessToken
SaveX calls Save and panics if Save returns an error.
func (*AccessTokenCreate) SetExpiresAt ¶
func (atc *AccessTokenCreate) SetExpiresAt(t time.Time) *AccessTokenCreate
SetExpiresAt sets the "expires_at" field.
func (*AccessTokenCreate) SetID ¶
func (atc *AccessTokenCreate) SetID(u uuid.UUID) *AccessTokenCreate
SetID sets the "id" field.
func (*AccessTokenCreate) SetNillableID ¶
func (atc *AccessTokenCreate) SetNillableID(u *uuid.UUID) *AccessTokenCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*AccessTokenCreate) SetNillableUserID ¶
func (atc *AccessTokenCreate) SetNillableUserID(id *uuid.UUID) *AccessTokenCreate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*AccessTokenCreate) SetToken ¶
func (atc *AccessTokenCreate) SetToken(s string) *AccessTokenCreate
SetToken sets the "token" field.
func (*AccessTokenCreate) SetUser ¶
func (atc *AccessTokenCreate) SetUser(u *User) *AccessTokenCreate
SetUser sets the "user" edge to the User entity.
func (*AccessTokenCreate) SetUserID ¶
func (atc *AccessTokenCreate) SetUserID(id uuid.UUID) *AccessTokenCreate
SetUserID sets the "user" edge to the User entity by ID.
type AccessTokenCreateBulk ¶
type AccessTokenCreateBulk struct {
// contains filtered or unexported fields
}
AccessTokenCreateBulk is the builder for creating many AccessToken entities in bulk.
func (*AccessTokenCreateBulk) Exec ¶
func (atcb *AccessTokenCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*AccessTokenCreateBulk) ExecX ¶
func (atcb *AccessTokenCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AccessTokenCreateBulk) OnConflict ¶
func (atcb *AccessTokenCreateBulk) OnConflict(opts ...sql.ConflictOption) *AccessTokenUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.AccessToken.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.AccessTokenUpsert) { SetToken(v+v). }). Exec(ctx)
func (*AccessTokenCreateBulk) OnConflictColumns ¶
func (atcb *AccessTokenCreateBulk) OnConflictColumns(columns ...string) *AccessTokenUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.AccessToken.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*AccessTokenCreateBulk) Save ¶
func (atcb *AccessTokenCreateBulk) Save(ctx context.Context) ([]*AccessToken, error)
Save creates the AccessToken entities in the database.
func (*AccessTokenCreateBulk) SaveX ¶
func (atcb *AccessTokenCreateBulk) SaveX(ctx context.Context) []*AccessToken
SaveX is like Save, but panics if an error occurs.
type AccessTokenDelete ¶
type AccessTokenDelete struct {
// contains filtered or unexported fields
}
AccessTokenDelete is the builder for deleting a AccessToken entity.
func (*AccessTokenDelete) Exec ¶
func (atd *AccessTokenDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*AccessTokenDelete) ExecX ¶
func (atd *AccessTokenDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*AccessTokenDelete) Where ¶
func (atd *AccessTokenDelete) Where(ps ...predicate.AccessToken) *AccessTokenDelete
Where appends a list predicates to the AccessTokenDelete builder.
type AccessTokenDeleteOne ¶
type AccessTokenDeleteOne struct {
// contains filtered or unexported fields
}
AccessTokenDeleteOne is the builder for deleting a single AccessToken entity.
func (*AccessTokenDeleteOne) Exec ¶
func (atdo *AccessTokenDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*AccessTokenDeleteOne) ExecX ¶
func (atdo *AccessTokenDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AccessTokenDeleteOne) Where ¶
func (atdo *AccessTokenDeleteOne) Where(ps ...predicate.AccessToken) *AccessTokenDeleteOne
Where appends a list predicates to the AccessTokenDelete builder.
type AccessTokenEdges ¶
type AccessTokenEdges struct { // User holds the value of the user edge. User *User `json:"user,omitempty"` // Groups holds the value of the groups edge. Groups []*Group `json:"groups,omitempty"` // contains filtered or unexported fields }
AccessTokenEdges holds the relations/edges for other nodes in the graph.
func (AccessTokenEdges) GroupsOrErr ¶
func (e AccessTokenEdges) GroupsOrErr() ([]*Group, error)
GroupsOrErr returns the Groups value or an error if the edge was not loaded in eager-loading.
func (AccessTokenEdges) UserOrErr ¶
func (e AccessTokenEdges) UserOrErr() (*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type AccessTokenGroupBy ¶
type AccessTokenGroupBy struct {
// contains filtered or unexported fields
}
AccessTokenGroupBy is the group-by builder for AccessToken entities.
func (*AccessTokenGroupBy) Aggregate ¶
func (atgb *AccessTokenGroupBy) Aggregate(fns ...AggregateFunc) *AccessTokenGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*AccessTokenGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AccessTokenGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AccessTokenGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AccessTokenGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AccessTokenGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AccessTokenGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AccessTokenGroupBy) Scan ¶
func (atgb *AccessTokenGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*AccessTokenGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AccessTokenMutation ¶
type AccessTokenMutation struct {
// contains filtered or unexported fields
}
AccessTokenMutation represents an operation that mutates the AccessToken nodes in the graph.
func (*AccessTokenMutation) AddField ¶
func (m *AccessTokenMutation) 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 (*AccessTokenMutation) AddGroupIDs ¶
func (m *AccessTokenMutation) AddGroupIDs(ids ...uuid.UUID)
AddGroupIDs adds the "groups" edge to the Group entity by ids.
func (*AccessTokenMutation) AddedEdges ¶
func (m *AccessTokenMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*AccessTokenMutation) AddedField ¶
func (m *AccessTokenMutation) 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 (*AccessTokenMutation) AddedFields ¶
func (m *AccessTokenMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*AccessTokenMutation) AddedIDs ¶
func (m *AccessTokenMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*AccessTokenMutation) ClearEdge ¶
func (m *AccessTokenMutation) 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 (*AccessTokenMutation) ClearField ¶
func (m *AccessTokenMutation) 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 (*AccessTokenMutation) ClearGroups ¶
func (m *AccessTokenMutation) ClearGroups()
ClearGroups clears the "groups" edge to the Group entity.
func (*AccessTokenMutation) ClearUser ¶
func (m *AccessTokenMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*AccessTokenMutation) ClearedEdges ¶
func (m *AccessTokenMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*AccessTokenMutation) ClearedFields ¶
func (m *AccessTokenMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (AccessTokenMutation) Client ¶
func (m AccessTokenMutation) 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 (*AccessTokenMutation) EdgeCleared ¶
func (m *AccessTokenMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*AccessTokenMutation) ExpiresAt ¶
func (m *AccessTokenMutation) ExpiresAt() (r time.Time, exists bool)
ExpiresAt returns the value of the "expires_at" field in the mutation.
func (*AccessTokenMutation) Field ¶
func (m *AccessTokenMutation) 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 (*AccessTokenMutation) FieldCleared ¶
func (m *AccessTokenMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*AccessTokenMutation) Fields ¶
func (m *AccessTokenMutation) 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 (*AccessTokenMutation) GroupsCleared ¶
func (m *AccessTokenMutation) GroupsCleared() bool
GroupsCleared reports if the "groups" edge to the Group entity was cleared.
func (*AccessTokenMutation) GroupsIDs ¶
func (m *AccessTokenMutation) GroupsIDs() (ids []uuid.UUID)
GroupsIDs returns the "groups" edge IDs in the mutation.
func (*AccessTokenMutation) ID ¶
func (m *AccessTokenMutation) ID() (id uuid.UUID, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*AccessTokenMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*AccessTokenMutation) OldExpiresAt ¶
OldExpiresAt returns the old "expires_at" field's value of the AccessToken entity. If the AccessToken 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 (*AccessTokenMutation) 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 (*AccessTokenMutation) OldToken ¶
func (m *AccessTokenMutation) OldToken(ctx context.Context) (v string, err error)
OldToken returns the old "token" field's value of the AccessToken entity. If the AccessToken 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 (*AccessTokenMutation) Op ¶
func (m *AccessTokenMutation) Op() Op
Op returns the operation name.
func (*AccessTokenMutation) RemoveGroupIDs ¶
func (m *AccessTokenMutation) RemoveGroupIDs(ids ...uuid.UUID)
RemoveGroupIDs removes the "groups" edge to the Group entity by IDs.
func (*AccessTokenMutation) RemovedEdges ¶
func (m *AccessTokenMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*AccessTokenMutation) RemovedGroupsIDs ¶
func (m *AccessTokenMutation) RemovedGroupsIDs() (ids []uuid.UUID)
RemovedGroups returns the removed IDs of the "groups" edge to the Group entity.
func (*AccessTokenMutation) RemovedIDs ¶
func (m *AccessTokenMutation) 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 (*AccessTokenMutation) ResetEdge ¶
func (m *AccessTokenMutation) 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 (*AccessTokenMutation) ResetExpiresAt ¶
func (m *AccessTokenMutation) ResetExpiresAt()
ResetExpiresAt resets all changes to the "expires_at" field.
func (*AccessTokenMutation) ResetField ¶
func (m *AccessTokenMutation) 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 (*AccessTokenMutation) ResetGroups ¶
func (m *AccessTokenMutation) ResetGroups()
ResetGroups resets all changes to the "groups" edge.
func (*AccessTokenMutation) ResetToken ¶
func (m *AccessTokenMutation) ResetToken()
ResetToken resets all changes to the "token" field.
func (*AccessTokenMutation) ResetUser ¶
func (m *AccessTokenMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*AccessTokenMutation) SetExpiresAt ¶
func (m *AccessTokenMutation) SetExpiresAt(t time.Time)
SetExpiresAt sets the "expires_at" field.
func (*AccessTokenMutation) SetField ¶
func (m *AccessTokenMutation) 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 (*AccessTokenMutation) SetID ¶
func (m *AccessTokenMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of AccessToken entities.
func (*AccessTokenMutation) SetOp ¶
func (m *AccessTokenMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*AccessTokenMutation) SetToken ¶
func (m *AccessTokenMutation) SetToken(s string)
SetToken sets the "token" field.
func (*AccessTokenMutation) SetUserID ¶
func (m *AccessTokenMutation) SetUserID(id uuid.UUID)
SetUserID sets the "user" edge to the User entity by id.
func (*AccessTokenMutation) Token ¶
func (m *AccessTokenMutation) Token() (r string, exists bool)
Token returns the value of the "token" field in the mutation.
func (AccessTokenMutation) Tx ¶
func (m AccessTokenMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*AccessTokenMutation) Type ¶
func (m *AccessTokenMutation) Type() string
Type returns the node type of this mutation (AccessToken).
func (*AccessTokenMutation) UserCleared ¶
func (m *AccessTokenMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*AccessTokenMutation) UserID ¶
func (m *AccessTokenMutation) UserID() (id uuid.UUID, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*AccessTokenMutation) UserIDs ¶
func (m *AccessTokenMutation) UserIDs() (ids []uuid.UUID)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*AccessTokenMutation) Where ¶
func (m *AccessTokenMutation) Where(ps ...predicate.AccessToken)
Where appends a list predicates to the AccessTokenMutation builder.
func (*AccessTokenMutation) WhereP ¶
func (m *AccessTokenMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the AccessTokenMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type AccessTokenQuery ¶
type AccessTokenQuery struct {
// contains filtered or unexported fields
}
AccessTokenQuery is the builder for querying AccessToken entities.
func (*AccessTokenQuery) Aggregate ¶
func (atq *AccessTokenQuery) Aggregate(fns ...AggregateFunc) *AccessTokenSelect
Aggregate returns a AccessTokenSelect configured with the given aggregations.
func (*AccessTokenQuery) All ¶
func (atq *AccessTokenQuery) All(ctx context.Context) ([]*AccessToken, error)
All executes the query and returns a list of AccessTokens.
func (*AccessTokenQuery) AllX ¶
func (atq *AccessTokenQuery) AllX(ctx context.Context) []*AccessToken
AllX is like All, but panics if an error occurs.
func (*AccessTokenQuery) Clone ¶
func (atq *AccessTokenQuery) Clone() *AccessTokenQuery
Clone returns a duplicate of the AccessTokenQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*AccessTokenQuery) Count ¶
func (atq *AccessTokenQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*AccessTokenQuery) CountX ¶
func (atq *AccessTokenQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*AccessTokenQuery) Exist ¶
func (atq *AccessTokenQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*AccessTokenQuery) ExistX ¶
func (atq *AccessTokenQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*AccessTokenQuery) First ¶
func (atq *AccessTokenQuery) First(ctx context.Context) (*AccessToken, error)
First returns the first AccessToken entity from the query. Returns a *NotFoundError when no AccessToken was found.
func (*AccessTokenQuery) FirstID ¶
FirstID returns the first AccessToken ID from the query. Returns a *NotFoundError when no AccessToken ID was found.
func (*AccessTokenQuery) FirstIDX ¶
func (atq *AccessTokenQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*AccessTokenQuery) FirstX ¶
func (atq *AccessTokenQuery) FirstX(ctx context.Context) *AccessToken
FirstX is like First, but panics if an error occurs.
func (*AccessTokenQuery) GroupBy ¶
func (atq *AccessTokenQuery) GroupBy(field string, fields ...string) *AccessTokenGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Token string `json:"token,omitempty"` Count int `json:"count,omitempty"` } client.AccessToken.Query(). GroupBy(accesstoken.FieldToken). Aggregate(ent.Count()). Scan(ctx, &v)
func (*AccessTokenQuery) IDsX ¶
func (atq *AccessTokenQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*AccessTokenQuery) Limit ¶
func (atq *AccessTokenQuery) Limit(limit int) *AccessTokenQuery
Limit the number of records to be returned by this query.
func (*AccessTokenQuery) Offset ¶
func (atq *AccessTokenQuery) Offset(offset int) *AccessTokenQuery
Offset to start from.
func (*AccessTokenQuery) Only ¶
func (atq *AccessTokenQuery) Only(ctx context.Context) (*AccessToken, error)
Only returns a single AccessToken entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one AccessToken entity is found. Returns a *NotFoundError when no AccessToken entities are found.
func (*AccessTokenQuery) OnlyID ¶
OnlyID is like Only, but returns the only AccessToken ID in the query. Returns a *NotSingularError when more than one AccessToken ID is found. Returns a *NotFoundError when no entities are found.
func (*AccessTokenQuery) OnlyIDX ¶
func (atq *AccessTokenQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*AccessTokenQuery) OnlyX ¶
func (atq *AccessTokenQuery) OnlyX(ctx context.Context) *AccessToken
OnlyX is like Only, but panics if an error occurs.
func (*AccessTokenQuery) Order ¶
func (atq *AccessTokenQuery) Order(o ...accesstoken.OrderOption) *AccessTokenQuery
Order specifies how the records should be ordered.
func (*AccessTokenQuery) QueryGroups ¶
func (atq *AccessTokenQuery) QueryGroups() *GroupQuery
QueryGroups chains the current query on the "groups" edge.
func (*AccessTokenQuery) QueryUser ¶
func (atq *AccessTokenQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*AccessTokenQuery) Select ¶
func (atq *AccessTokenQuery) Select(fields ...string) *AccessTokenSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Token string `json:"token,omitempty"` } client.AccessToken.Query(). Select(accesstoken.FieldToken). Scan(ctx, &v)
func (*AccessTokenQuery) Unique ¶
func (atq *AccessTokenQuery) Unique(unique bool) *AccessTokenQuery
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 (*AccessTokenQuery) Where ¶
func (atq *AccessTokenQuery) Where(ps ...predicate.AccessToken) *AccessTokenQuery
Where adds a new predicate for the AccessTokenQuery builder.
func (*AccessTokenQuery) WithGroups ¶
func (atq *AccessTokenQuery) WithGroups(opts ...func(*GroupQuery)) *AccessTokenQuery
WithGroups tells the query-builder to eager-load the nodes that are connected to the "groups" edge. The optional arguments are used to configure the query builder of the edge.
func (*AccessTokenQuery) WithUser ¶
func (atq *AccessTokenQuery) WithUser(opts ...func(*UserQuery)) *AccessTokenQuery
WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.
type AccessTokenSelect ¶
type AccessTokenSelect struct { *AccessTokenQuery // contains filtered or unexported fields }
AccessTokenSelect is the builder for selecting fields of AccessToken entities.
func (*AccessTokenSelect) Aggregate ¶
func (ats *AccessTokenSelect) Aggregate(fns ...AggregateFunc) *AccessTokenSelect
Aggregate adds the given aggregation functions to the selector query.
func (*AccessTokenSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AccessTokenSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AccessTokenSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AccessTokenSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AccessTokenSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AccessTokenSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AccessTokenSelect) Scan ¶
func (ats *AccessTokenSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*AccessTokenSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AccessTokenUpdate ¶
type AccessTokenUpdate struct {
// contains filtered or unexported fields
}
AccessTokenUpdate is the builder for updating AccessToken entities.
func (*AccessTokenUpdate) AddGroupIDs ¶
func (atu *AccessTokenUpdate) AddGroupIDs(ids ...uuid.UUID) *AccessTokenUpdate
AddGroupIDs adds the "groups" edge to the Group entity by IDs.
func (*AccessTokenUpdate) AddGroups ¶
func (atu *AccessTokenUpdate) AddGroups(g ...*Group) *AccessTokenUpdate
AddGroups adds the "groups" edges to the Group entity.
func (*AccessTokenUpdate) ClearGroups ¶
func (atu *AccessTokenUpdate) ClearGroups() *AccessTokenUpdate
ClearGroups clears all "groups" edges to the Group entity.
func (*AccessTokenUpdate) ClearUser ¶
func (atu *AccessTokenUpdate) ClearUser() *AccessTokenUpdate
ClearUser clears the "user" edge to the User entity.
func (*AccessTokenUpdate) Exec ¶
func (atu *AccessTokenUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*AccessTokenUpdate) ExecX ¶
func (atu *AccessTokenUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AccessTokenUpdate) Mutation ¶
func (atu *AccessTokenUpdate) Mutation() *AccessTokenMutation
Mutation returns the AccessTokenMutation object of the builder.
func (*AccessTokenUpdate) RemoveGroupIDs ¶
func (atu *AccessTokenUpdate) RemoveGroupIDs(ids ...uuid.UUID) *AccessTokenUpdate
RemoveGroupIDs removes the "groups" edge to Group entities by IDs.
func (*AccessTokenUpdate) RemoveGroups ¶
func (atu *AccessTokenUpdate) RemoveGroups(g ...*Group) *AccessTokenUpdate
RemoveGroups removes "groups" edges to Group entities.
func (*AccessTokenUpdate) Save ¶
func (atu *AccessTokenUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*AccessTokenUpdate) SaveX ¶
func (atu *AccessTokenUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*AccessTokenUpdate) SetExpiresAt ¶
func (atu *AccessTokenUpdate) SetExpiresAt(t time.Time) *AccessTokenUpdate
SetExpiresAt sets the "expires_at" field.
func (*AccessTokenUpdate) SetNillableExpiresAt ¶
func (atu *AccessTokenUpdate) SetNillableExpiresAt(t *time.Time) *AccessTokenUpdate
SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.
func (*AccessTokenUpdate) SetNillableToken ¶
func (atu *AccessTokenUpdate) SetNillableToken(s *string) *AccessTokenUpdate
SetNillableToken sets the "token" field if the given value is not nil.
func (*AccessTokenUpdate) SetNillableUserID ¶
func (atu *AccessTokenUpdate) SetNillableUserID(id *uuid.UUID) *AccessTokenUpdate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*AccessTokenUpdate) SetToken ¶
func (atu *AccessTokenUpdate) SetToken(s string) *AccessTokenUpdate
SetToken sets the "token" field.
func (*AccessTokenUpdate) SetUser ¶
func (atu *AccessTokenUpdate) SetUser(u *User) *AccessTokenUpdate
SetUser sets the "user" edge to the User entity.
func (*AccessTokenUpdate) SetUserID ¶
func (atu *AccessTokenUpdate) SetUserID(id uuid.UUID) *AccessTokenUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*AccessTokenUpdate) Where ¶
func (atu *AccessTokenUpdate) Where(ps ...predicate.AccessToken) *AccessTokenUpdate
Where appends a list predicates to the AccessTokenUpdate builder.
type AccessTokenUpdateOne ¶
type AccessTokenUpdateOne struct {
// contains filtered or unexported fields
}
AccessTokenUpdateOne is the builder for updating a single AccessToken entity.
func (*AccessTokenUpdateOne) AddGroupIDs ¶
func (atuo *AccessTokenUpdateOne) AddGroupIDs(ids ...uuid.UUID) *AccessTokenUpdateOne
AddGroupIDs adds the "groups" edge to the Group entity by IDs.
func (*AccessTokenUpdateOne) AddGroups ¶
func (atuo *AccessTokenUpdateOne) AddGroups(g ...*Group) *AccessTokenUpdateOne
AddGroups adds the "groups" edges to the Group entity.
func (*AccessTokenUpdateOne) ClearGroups ¶
func (atuo *AccessTokenUpdateOne) ClearGroups() *AccessTokenUpdateOne
ClearGroups clears all "groups" edges to the Group entity.
func (*AccessTokenUpdateOne) ClearUser ¶
func (atuo *AccessTokenUpdateOne) ClearUser() *AccessTokenUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*AccessTokenUpdateOne) Exec ¶
func (atuo *AccessTokenUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*AccessTokenUpdateOne) ExecX ¶
func (atuo *AccessTokenUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AccessTokenUpdateOne) Mutation ¶
func (atuo *AccessTokenUpdateOne) Mutation() *AccessTokenMutation
Mutation returns the AccessTokenMutation object of the builder.
func (*AccessTokenUpdateOne) RemoveGroupIDs ¶
func (atuo *AccessTokenUpdateOne) RemoveGroupIDs(ids ...uuid.UUID) *AccessTokenUpdateOne
RemoveGroupIDs removes the "groups" edge to Group entities by IDs.
func (*AccessTokenUpdateOne) RemoveGroups ¶
func (atuo *AccessTokenUpdateOne) RemoveGroups(g ...*Group) *AccessTokenUpdateOne
RemoveGroups removes "groups" edges to Group entities.
func (*AccessTokenUpdateOne) Save ¶
func (atuo *AccessTokenUpdateOne) Save(ctx context.Context) (*AccessToken, error)
Save executes the query and returns the updated AccessToken entity.
func (*AccessTokenUpdateOne) SaveX ¶
func (atuo *AccessTokenUpdateOne) SaveX(ctx context.Context) *AccessToken
SaveX is like Save, but panics if an error occurs.
func (*AccessTokenUpdateOne) Select ¶
func (atuo *AccessTokenUpdateOne) Select(field string, fields ...string) *AccessTokenUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*AccessTokenUpdateOne) SetExpiresAt ¶
func (atuo *AccessTokenUpdateOne) SetExpiresAt(t time.Time) *AccessTokenUpdateOne
SetExpiresAt sets the "expires_at" field.
func (*AccessTokenUpdateOne) SetNillableExpiresAt ¶
func (atuo *AccessTokenUpdateOne) SetNillableExpiresAt(t *time.Time) *AccessTokenUpdateOne
SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.
func (*AccessTokenUpdateOne) SetNillableToken ¶
func (atuo *AccessTokenUpdateOne) SetNillableToken(s *string) *AccessTokenUpdateOne
SetNillableToken sets the "token" field if the given value is not nil.
func (*AccessTokenUpdateOne) SetNillableUserID ¶
func (atuo *AccessTokenUpdateOne) SetNillableUserID(id *uuid.UUID) *AccessTokenUpdateOne
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*AccessTokenUpdateOne) SetToken ¶
func (atuo *AccessTokenUpdateOne) SetToken(s string) *AccessTokenUpdateOne
SetToken sets the "token" field.
func (*AccessTokenUpdateOne) SetUser ¶
func (atuo *AccessTokenUpdateOne) SetUser(u *User) *AccessTokenUpdateOne
SetUser sets the "user" edge to the User entity.
func (*AccessTokenUpdateOne) SetUserID ¶
func (atuo *AccessTokenUpdateOne) SetUserID(id uuid.UUID) *AccessTokenUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*AccessTokenUpdateOne) Where ¶
func (atuo *AccessTokenUpdateOne) Where(ps ...predicate.AccessToken) *AccessTokenUpdateOne
Where appends a list predicates to the AccessTokenUpdate builder.
type AccessTokenUpsert ¶
AccessTokenUpsert is the "OnConflict" setter.
func (*AccessTokenUpsert) SetExpiresAt ¶
func (u *AccessTokenUpsert) SetExpiresAt(v time.Time) *AccessTokenUpsert
SetExpiresAt sets the "expires_at" field.
func (*AccessTokenUpsert) SetToken ¶
func (u *AccessTokenUpsert) SetToken(v string) *AccessTokenUpsert
SetToken sets the "token" field.
func (*AccessTokenUpsert) UpdateExpiresAt ¶
func (u *AccessTokenUpsert) UpdateExpiresAt() *AccessTokenUpsert
UpdateExpiresAt sets the "expires_at" field to the value that was provided on create.
func (*AccessTokenUpsert) UpdateToken ¶
func (u *AccessTokenUpsert) UpdateToken() *AccessTokenUpsert
UpdateToken sets the "token" field to the value that was provided on create.
type AccessTokenUpsertBulk ¶
type AccessTokenUpsertBulk struct {
// contains filtered or unexported fields
}
AccessTokenUpsertBulk is the builder for "upsert"-ing a bulk of AccessToken nodes.
func (*AccessTokenUpsertBulk) DoNothing ¶
func (u *AccessTokenUpsertBulk) DoNothing() *AccessTokenUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*AccessTokenUpsertBulk) Exec ¶
func (u *AccessTokenUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*AccessTokenUpsertBulk) ExecX ¶
func (u *AccessTokenUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AccessTokenUpsertBulk) Ignore ¶
func (u *AccessTokenUpsertBulk) Ignore() *AccessTokenUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.AccessToken.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*AccessTokenUpsertBulk) SetExpiresAt ¶
func (u *AccessTokenUpsertBulk) SetExpiresAt(v time.Time) *AccessTokenUpsertBulk
SetExpiresAt sets the "expires_at" field.
func (*AccessTokenUpsertBulk) SetToken ¶
func (u *AccessTokenUpsertBulk) SetToken(v string) *AccessTokenUpsertBulk
SetToken sets the "token" field.
func (*AccessTokenUpsertBulk) Update ¶
func (u *AccessTokenUpsertBulk) Update(set func(*AccessTokenUpsert)) *AccessTokenUpsertBulk
Update allows overriding fields `UPDATE` values. See the AccessTokenCreateBulk.OnConflict documentation for more info.
func (*AccessTokenUpsertBulk) UpdateExpiresAt ¶
func (u *AccessTokenUpsertBulk) UpdateExpiresAt() *AccessTokenUpsertBulk
UpdateExpiresAt sets the "expires_at" field to the value that was provided on create.
func (*AccessTokenUpsertBulk) UpdateNewValues ¶
func (u *AccessTokenUpsertBulk) UpdateNewValues() *AccessTokenUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.AccessToken.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(accesstoken.FieldID) }), ). Exec(ctx)
func (*AccessTokenUpsertBulk) UpdateToken ¶
func (u *AccessTokenUpsertBulk) UpdateToken() *AccessTokenUpsertBulk
UpdateToken sets the "token" field to the value that was provided on create.
type AccessTokenUpsertOne ¶
type AccessTokenUpsertOne struct {
// contains filtered or unexported fields
}
AccessTokenUpsertOne is the builder for "upsert"-ing
one AccessToken node.
func (*AccessTokenUpsertOne) DoNothing ¶
func (u *AccessTokenUpsertOne) DoNothing() *AccessTokenUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*AccessTokenUpsertOne) Exec ¶
func (u *AccessTokenUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*AccessTokenUpsertOne) ExecX ¶
func (u *AccessTokenUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AccessTokenUpsertOne) ID ¶
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*AccessTokenUpsertOne) IDX ¶
func (u *AccessTokenUpsertOne) IDX(ctx context.Context) uuid.UUID
IDX is like ID, but panics if an error occurs.
func (*AccessTokenUpsertOne) Ignore ¶
func (u *AccessTokenUpsertOne) Ignore() *AccessTokenUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.AccessToken.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*AccessTokenUpsertOne) SetExpiresAt ¶
func (u *AccessTokenUpsertOne) SetExpiresAt(v time.Time) *AccessTokenUpsertOne
SetExpiresAt sets the "expires_at" field.
func (*AccessTokenUpsertOne) SetToken ¶
func (u *AccessTokenUpsertOne) SetToken(v string) *AccessTokenUpsertOne
SetToken sets the "token" field.
func (*AccessTokenUpsertOne) Update ¶
func (u *AccessTokenUpsertOne) Update(set func(*AccessTokenUpsert)) *AccessTokenUpsertOne
Update allows overriding fields `UPDATE` values. See the AccessTokenCreate.OnConflict documentation for more info.
func (*AccessTokenUpsertOne) UpdateExpiresAt ¶
func (u *AccessTokenUpsertOne) UpdateExpiresAt() *AccessTokenUpsertOne
UpdateExpiresAt sets the "expires_at" field to the value that was provided on create.
func (*AccessTokenUpsertOne) UpdateNewValues ¶
func (u *AccessTokenUpsertOne) UpdateNewValues() *AccessTokenUpsertOne
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.AccessToken.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(accesstoken.FieldID) }), ). Exec(ctx)
func (*AccessTokenUpsertOne) UpdateToken ¶
func (u *AccessTokenUpsertOne) UpdateToken() *AccessTokenUpsertOne
UpdateToken sets the "token" field to the value that was provided on create.
type AccessTokens ¶
type AccessTokens []*AccessToken
AccessTokens is a parsable slice of AccessToken.
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 // AccessToken is the client for interacting with the AccessToken builders. AccessToken *AccessTokenClient // Code is the client for interacting with the Code builders. Code *CodeClient // Group is the client for interacting with the Group builders. Group *GroupClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.
func (*Client) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). AccessToken. 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 Code ¶
type Code struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // Code holds the value of the "code" field. Code string `json:"code,omitempty"` // ClientID holds the value of the "client_id" field. ClientID string `json:"client_id,omitempty"` // Scope holds the value of the "scope" field. Scope string `json:"scope,omitempty"` // RedirectURI holds the value of the "redirect_uri" field. RedirectURI string `json:"redirect_uri,omitempty"` // CodeChallenge holds the value of the "code_challenge" field. CodeChallenge string `json:"code_challenge,omitempty"` // ExpiresAt holds the value of the "expires_at" field. ExpiresAt time.Time `json:"expires_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the CodeQuery when eager-loading is set. Edges CodeEdges `json:"edges"` // contains filtered or unexported fields }
Code is the model entity for the Code schema.
func (*Code) QueryGroups ¶
func (c *Code) QueryGroups() *GroupQuery
QueryGroups queries the "groups" edge of the Code entity.
func (*Code) Unwrap ¶
Unwrap unwraps the Code 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 (*Code) Update ¶
func (c *Code) Update() *CodeUpdateOne
Update returns a builder for updating this Code. Note that you need to call Code.Unwrap() before calling this method if this Code was returned from a transaction, and the transaction was committed or rolled back.
type CodeClient ¶
type CodeClient struct {
// contains filtered or unexported fields
}
CodeClient is a client for the Code schema.
func NewCodeClient ¶
func NewCodeClient(c config) *CodeClient
NewCodeClient returns a client for the Code from the given config.
func (*CodeClient) Create ¶
func (c *CodeClient) Create() *CodeCreate
Create returns a builder for creating a Code entity.
func (*CodeClient) CreateBulk ¶
func (c *CodeClient) CreateBulk(builders ...*CodeCreate) *CodeCreateBulk
CreateBulk returns a builder for creating a bulk of Code entities.
func (*CodeClient) Delete ¶
func (c *CodeClient) Delete() *CodeDelete
Delete returns a delete builder for Code.
func (*CodeClient) DeleteOne ¶
func (c *CodeClient) DeleteOne(co *Code) *CodeDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*CodeClient) DeleteOneID ¶
func (c *CodeClient) DeleteOneID(id uuid.UUID) *CodeDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*CodeClient) Intercept ¶
func (c *CodeClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `code.Intercept(f(g(h())))`.
func (*CodeClient) Interceptors ¶
func (c *CodeClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*CodeClient) MapCreateBulk ¶
func (c *CodeClient) MapCreateBulk(slice any, setFunc func(*CodeCreate, int)) *CodeCreateBulk
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 (*CodeClient) Query ¶
func (c *CodeClient) Query() *CodeQuery
Query returns a query builder for Code.
func (*CodeClient) QueryGroups ¶
func (c *CodeClient) QueryGroups(co *Code) *GroupQuery
QueryGroups queries the groups edge of a Code.
func (*CodeClient) QueryUser ¶
func (c *CodeClient) QueryUser(co *Code) *UserQuery
QueryUser queries the user edge of a Code.
func (*CodeClient) Update ¶
func (c *CodeClient) Update() *CodeUpdate
Update returns an update builder for Code.
func (*CodeClient) UpdateOne ¶
func (c *CodeClient) UpdateOne(co *Code) *CodeUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CodeClient) UpdateOneID ¶
func (c *CodeClient) UpdateOneID(id uuid.UUID) *CodeUpdateOne
UpdateOneID returns an update builder for the given id.
func (*CodeClient) Use ¶
func (c *CodeClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `code.Hooks(f(g(h())))`.
type CodeCreate ¶
type CodeCreate struct {
// contains filtered or unexported fields
}
CodeCreate is the builder for creating a Code entity.
func (*CodeCreate) AddGroupIDs ¶
func (cc *CodeCreate) AddGroupIDs(ids ...uuid.UUID) *CodeCreate
AddGroupIDs adds the "groups" edge to the Group entity by IDs.
func (*CodeCreate) AddGroups ¶
func (cc *CodeCreate) AddGroups(g ...*Group) *CodeCreate
AddGroups adds the "groups" edges to the Group entity.
func (*CodeCreate) Exec ¶
func (cc *CodeCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*CodeCreate) ExecX ¶
func (cc *CodeCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CodeCreate) Mutation ¶
func (cc *CodeCreate) Mutation() *CodeMutation
Mutation returns the CodeMutation object of the builder.
func (*CodeCreate) OnConflict ¶
func (cc *CodeCreate) OnConflict(opts ...sql.ConflictOption) *CodeUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Code.Create(). SetCode(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.CodeUpsert) { SetCode(v+v). }). Exec(ctx)
func (*CodeCreate) OnConflictColumns ¶
func (cc *CodeCreate) OnConflictColumns(columns ...string) *CodeUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Code.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*CodeCreate) Save ¶
func (cc *CodeCreate) Save(ctx context.Context) (*Code, error)
Save creates the Code in the database.
func (*CodeCreate) SaveX ¶
func (cc *CodeCreate) SaveX(ctx context.Context) *Code
SaveX calls Save and panics if Save returns an error.
func (*CodeCreate) SetClientID ¶
func (cc *CodeCreate) SetClientID(s string) *CodeCreate
SetClientID sets the "client_id" field.
func (*CodeCreate) SetCode ¶
func (cc *CodeCreate) SetCode(s string) *CodeCreate
SetCode sets the "code" field.
func (*CodeCreate) SetCodeChallenge ¶
func (cc *CodeCreate) SetCodeChallenge(s string) *CodeCreate
SetCodeChallenge sets the "code_challenge" field.
func (*CodeCreate) SetExpiresAt ¶
func (cc *CodeCreate) SetExpiresAt(t time.Time) *CodeCreate
SetExpiresAt sets the "expires_at" field.
func (*CodeCreate) SetID ¶
func (cc *CodeCreate) SetID(u uuid.UUID) *CodeCreate
SetID sets the "id" field.
func (*CodeCreate) SetNillableClientID ¶
func (cc *CodeCreate) SetNillableClientID(s *string) *CodeCreate
SetNillableClientID sets the "client_id" field if the given value is not nil.
func (*CodeCreate) SetNillableCodeChallenge ¶
func (cc *CodeCreate) SetNillableCodeChallenge(s *string) *CodeCreate
SetNillableCodeChallenge sets the "code_challenge" field if the given value is not nil.
func (*CodeCreate) SetNillableID ¶
func (cc *CodeCreate) SetNillableID(u *uuid.UUID) *CodeCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*CodeCreate) SetNillableRedirectURI ¶
func (cc *CodeCreate) SetNillableRedirectURI(s *string) *CodeCreate
SetNillableRedirectURI sets the "redirect_uri" field if the given value is not nil.
func (*CodeCreate) SetNillableScope ¶
func (cc *CodeCreate) SetNillableScope(s *string) *CodeCreate
SetNillableScope sets the "scope" field if the given value is not nil.
func (*CodeCreate) SetNillableUserID ¶
func (cc *CodeCreate) SetNillableUserID(id *uuid.UUID) *CodeCreate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*CodeCreate) SetRedirectURI ¶
func (cc *CodeCreate) SetRedirectURI(s string) *CodeCreate
SetRedirectURI sets the "redirect_uri" field.
func (*CodeCreate) SetScope ¶
func (cc *CodeCreate) SetScope(s string) *CodeCreate
SetScope sets the "scope" field.
func (*CodeCreate) SetUser ¶
func (cc *CodeCreate) SetUser(u *User) *CodeCreate
SetUser sets the "user" edge to the User entity.
func (*CodeCreate) SetUserID ¶
func (cc *CodeCreate) SetUserID(id uuid.UUID) *CodeCreate
SetUserID sets the "user" edge to the User entity by ID.
type CodeCreateBulk ¶
type CodeCreateBulk struct {
// contains filtered or unexported fields
}
CodeCreateBulk is the builder for creating many Code entities in bulk.
func (*CodeCreateBulk) Exec ¶
func (ccb *CodeCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CodeCreateBulk) ExecX ¶
func (ccb *CodeCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CodeCreateBulk) OnConflict ¶
func (ccb *CodeCreateBulk) OnConflict(opts ...sql.ConflictOption) *CodeUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Code.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.CodeUpsert) { SetCode(v+v). }). Exec(ctx)
func (*CodeCreateBulk) OnConflictColumns ¶
func (ccb *CodeCreateBulk) OnConflictColumns(columns ...string) *CodeUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Code.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type CodeDelete ¶
type CodeDelete struct {
// contains filtered or unexported fields
}
CodeDelete is the builder for deleting a Code entity.
func (*CodeDelete) Exec ¶
func (cd *CodeDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*CodeDelete) ExecX ¶
func (cd *CodeDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*CodeDelete) Where ¶
func (cd *CodeDelete) Where(ps ...predicate.Code) *CodeDelete
Where appends a list predicates to the CodeDelete builder.
type CodeDeleteOne ¶
type CodeDeleteOne struct {
// contains filtered or unexported fields
}
CodeDeleteOne is the builder for deleting a single Code entity.
func (*CodeDeleteOne) Exec ¶
func (cdo *CodeDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CodeDeleteOne) ExecX ¶
func (cdo *CodeDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CodeDeleteOne) Where ¶
func (cdo *CodeDeleteOne) Where(ps ...predicate.Code) *CodeDeleteOne
Where appends a list predicates to the CodeDelete builder.
type CodeEdges ¶
type CodeEdges struct { // User holds the value of the user edge. User *User `json:"user,omitempty"` // Groups holds the value of the groups edge. Groups []*Group `json:"groups,omitempty"` // contains filtered or unexported fields }
CodeEdges holds the relations/edges for other nodes in the graph.
func (CodeEdges) GroupsOrErr ¶
GroupsOrErr returns the Groups value or an error if the edge was not loaded in eager-loading.
type CodeGroupBy ¶
type CodeGroupBy struct {
// contains filtered or unexported fields
}
CodeGroupBy is the group-by builder for Code entities.
func (*CodeGroupBy) Aggregate ¶
func (cgb *CodeGroupBy) Aggregate(fns ...AggregateFunc) *CodeGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CodeGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CodeGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CodeGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CodeGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CodeGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CodeGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CodeGroupBy) Scan ¶
func (cgb *CodeGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CodeGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CodeMutation ¶
type CodeMutation struct {
// contains filtered or unexported fields
}
CodeMutation represents an operation that mutates the Code nodes in the graph.
func (*CodeMutation) AddField ¶
func (m *CodeMutation) 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 (*CodeMutation) AddGroupIDs ¶
func (m *CodeMutation) AddGroupIDs(ids ...uuid.UUID)
AddGroupIDs adds the "groups" edge to the Group entity by ids.
func (*CodeMutation) AddedEdges ¶
func (m *CodeMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CodeMutation) AddedField ¶
func (m *CodeMutation) 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 (*CodeMutation) AddedFields ¶
func (m *CodeMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CodeMutation) AddedIDs ¶
func (m *CodeMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CodeMutation) ClearEdge ¶
func (m *CodeMutation) 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 (*CodeMutation) ClearField ¶
func (m *CodeMutation) 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 (*CodeMutation) ClearGroups ¶
func (m *CodeMutation) ClearGroups()
ClearGroups clears the "groups" edge to the Group entity.
func (*CodeMutation) ClearUser ¶
func (m *CodeMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*CodeMutation) ClearedEdges ¶
func (m *CodeMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CodeMutation) ClearedFields ¶
func (m *CodeMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CodeMutation) Client ¶
func (m CodeMutation) 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 (*CodeMutation) ClientID ¶
func (m *CodeMutation) ClientID() (r string, exists bool)
ClientID returns the value of the "client_id" field in the mutation.
func (*CodeMutation) Code ¶
func (m *CodeMutation) Code() (r string, exists bool)
Code returns the value of the "code" field in the mutation.
func (*CodeMutation) CodeChallenge ¶
func (m *CodeMutation) CodeChallenge() (r string, exists bool)
CodeChallenge returns the value of the "code_challenge" field in the mutation.
func (*CodeMutation) EdgeCleared ¶
func (m *CodeMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CodeMutation) ExpiresAt ¶
func (m *CodeMutation) ExpiresAt() (r time.Time, exists bool)
ExpiresAt returns the value of the "expires_at" field in the mutation.
func (*CodeMutation) Field ¶
func (m *CodeMutation) 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 (*CodeMutation) FieldCleared ¶
func (m *CodeMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CodeMutation) Fields ¶
func (m *CodeMutation) 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 (*CodeMutation) GroupsCleared ¶
func (m *CodeMutation) GroupsCleared() bool
GroupsCleared reports if the "groups" edge to the Group entity was cleared.
func (*CodeMutation) GroupsIDs ¶
func (m *CodeMutation) GroupsIDs() (ids []uuid.UUID)
GroupsIDs returns the "groups" edge IDs in the mutation.
func (*CodeMutation) ID ¶
func (m *CodeMutation) ID() (id uuid.UUID, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*CodeMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*CodeMutation) OldClientID ¶
func (m *CodeMutation) OldClientID(ctx context.Context) (v string, err error)
OldClientID returns the old "client_id" field's value of the Code entity. If the Code 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 (*CodeMutation) OldCode ¶
func (m *CodeMutation) OldCode(ctx context.Context) (v string, err error)
OldCode returns the old "code" field's value of the Code entity. If the Code 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 (*CodeMutation) OldCodeChallenge ¶
func (m *CodeMutation) OldCodeChallenge(ctx context.Context) (v string, err error)
OldCodeChallenge returns the old "code_challenge" field's value of the Code entity. If the Code 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 (*CodeMutation) OldExpiresAt ¶
OldExpiresAt returns the old "expires_at" field's value of the Code entity. If the Code 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 (*CodeMutation) 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 (*CodeMutation) OldRedirectURI ¶
func (m *CodeMutation) OldRedirectURI(ctx context.Context) (v string, err error)
OldRedirectURI returns the old "redirect_uri" field's value of the Code entity. If the Code 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 (*CodeMutation) OldScope ¶
func (m *CodeMutation) OldScope(ctx context.Context) (v string, err error)
OldScope returns the old "scope" field's value of the Code entity. If the Code 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 (*CodeMutation) RedirectURI ¶
func (m *CodeMutation) RedirectURI() (r string, exists bool)
RedirectURI returns the value of the "redirect_uri" field in the mutation.
func (*CodeMutation) RemoveGroupIDs ¶
func (m *CodeMutation) RemoveGroupIDs(ids ...uuid.UUID)
RemoveGroupIDs removes the "groups" edge to the Group entity by IDs.
func (*CodeMutation) RemovedEdges ¶
func (m *CodeMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CodeMutation) RemovedGroupsIDs ¶
func (m *CodeMutation) RemovedGroupsIDs() (ids []uuid.UUID)
RemovedGroups returns the removed IDs of the "groups" edge to the Group entity.
func (*CodeMutation) RemovedIDs ¶
func (m *CodeMutation) 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 (*CodeMutation) ResetClientID ¶
func (m *CodeMutation) ResetClientID()
ResetClientID resets all changes to the "client_id" field.
func (*CodeMutation) ResetCode ¶
func (m *CodeMutation) ResetCode()
ResetCode resets all changes to the "code" field.
func (*CodeMutation) ResetCodeChallenge ¶
func (m *CodeMutation) ResetCodeChallenge()
ResetCodeChallenge resets all changes to the "code_challenge" field.
func (*CodeMutation) ResetEdge ¶
func (m *CodeMutation) 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 (*CodeMutation) ResetExpiresAt ¶
func (m *CodeMutation) ResetExpiresAt()
ResetExpiresAt resets all changes to the "expires_at" field.
func (*CodeMutation) ResetField ¶
func (m *CodeMutation) 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 (*CodeMutation) ResetGroups ¶
func (m *CodeMutation) ResetGroups()
ResetGroups resets all changes to the "groups" edge.
func (*CodeMutation) ResetRedirectURI ¶
func (m *CodeMutation) ResetRedirectURI()
ResetRedirectURI resets all changes to the "redirect_uri" field.
func (*CodeMutation) ResetScope ¶
func (m *CodeMutation) ResetScope()
ResetScope resets all changes to the "scope" field.
func (*CodeMutation) ResetUser ¶
func (m *CodeMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*CodeMutation) Scope ¶
func (m *CodeMutation) Scope() (r string, exists bool)
Scope returns the value of the "scope" field in the mutation.
func (*CodeMutation) SetClientID ¶
func (m *CodeMutation) SetClientID(s string)
SetClientID sets the "client_id" field.
func (*CodeMutation) SetCode ¶
func (m *CodeMutation) SetCode(s string)
SetCode sets the "code" field.
func (*CodeMutation) SetCodeChallenge ¶
func (m *CodeMutation) SetCodeChallenge(s string)
SetCodeChallenge sets the "code_challenge" field.
func (*CodeMutation) SetExpiresAt ¶
func (m *CodeMutation) SetExpiresAt(t time.Time)
SetExpiresAt sets the "expires_at" field.
func (*CodeMutation) SetField ¶
func (m *CodeMutation) 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 (*CodeMutation) SetID ¶
func (m *CodeMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Code entities.
func (*CodeMutation) SetOp ¶
func (m *CodeMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*CodeMutation) SetRedirectURI ¶
func (m *CodeMutation) SetRedirectURI(s string)
SetRedirectURI sets the "redirect_uri" field.
func (*CodeMutation) SetScope ¶
func (m *CodeMutation) SetScope(s string)
SetScope sets the "scope" field.
func (*CodeMutation) SetUserID ¶
func (m *CodeMutation) SetUserID(id uuid.UUID)
SetUserID sets the "user" edge to the User entity by id.
func (CodeMutation) Tx ¶
func (m CodeMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CodeMutation) Type ¶
func (m *CodeMutation) Type() string
Type returns the node type of this mutation (Code).
func (*CodeMutation) UserCleared ¶
func (m *CodeMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*CodeMutation) UserID ¶
func (m *CodeMutation) UserID() (id uuid.UUID, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*CodeMutation) UserIDs ¶
func (m *CodeMutation) UserIDs() (ids []uuid.UUID)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*CodeMutation) Where ¶
func (m *CodeMutation) Where(ps ...predicate.Code)
Where appends a list predicates to the CodeMutation builder.
func (*CodeMutation) WhereP ¶
func (m *CodeMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the CodeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type CodeQuery ¶
type CodeQuery struct {
// contains filtered or unexported fields
}
CodeQuery is the builder for querying Code entities.
func (*CodeQuery) Aggregate ¶
func (cq *CodeQuery) Aggregate(fns ...AggregateFunc) *CodeSelect
Aggregate returns a CodeSelect configured with the given aggregations.
func (*CodeQuery) Clone ¶
Clone returns a duplicate of the CodeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CodeQuery) First ¶
First returns the first Code entity from the query. Returns a *NotFoundError when no Code was found.
func (*CodeQuery) FirstID ¶
FirstID returns the first Code ID from the query. Returns a *NotFoundError when no Code ID was found.
func (*CodeQuery) GroupBy ¶
func (cq *CodeQuery) GroupBy(field string, fields ...string) *CodeGroupBy
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 { Code string `json:"code,omitempty"` Count int `json:"count,omitempty"` } client.Code.Query(). GroupBy(code.FieldCode). Aggregate(ent.Count()). Scan(ctx, &v)
func (*CodeQuery) Only ¶
Only returns a single Code entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Code entity is found. Returns a *NotFoundError when no Code entities are found.
func (*CodeQuery) OnlyID ¶
OnlyID is like Only, but returns the only Code ID in the query. Returns a *NotSingularError when more than one Code ID is found. Returns a *NotFoundError when no entities are found.
func (*CodeQuery) Order ¶
func (cq *CodeQuery) Order(o ...code.OrderOption) *CodeQuery
Order specifies how the records should be ordered.
func (*CodeQuery) QueryGroups ¶
func (cq *CodeQuery) QueryGroups() *GroupQuery
QueryGroups chains the current query on the "groups" edge.
func (*CodeQuery) Select ¶
func (cq *CodeQuery) Select(fields ...string) *CodeSelect
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 { Code string `json:"code,omitempty"` } client.Code.Query(). Select(code.FieldCode). Scan(ctx, &v)
func (*CodeQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*CodeQuery) WithGroups ¶
func (cq *CodeQuery) WithGroups(opts ...func(*GroupQuery)) *CodeQuery
WithGroups tells the query-builder to eager-load the nodes that are connected to the "groups" edge. The optional arguments are used to configure the query builder of the edge.
type CodeSelect ¶
type CodeSelect struct { *CodeQuery // contains filtered or unexported fields }
CodeSelect is the builder for selecting fields of Code entities.
func (*CodeSelect) Aggregate ¶
func (cs *CodeSelect) Aggregate(fns ...AggregateFunc) *CodeSelect
Aggregate adds the given aggregation functions to the selector query.
func (*CodeSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CodeSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CodeSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CodeSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CodeSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CodeSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CodeSelect) Scan ¶
func (cs *CodeSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CodeSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CodeUpdate ¶
type CodeUpdate struct {
// contains filtered or unexported fields
}
CodeUpdate is the builder for updating Code entities.
func (*CodeUpdate) AddGroupIDs ¶
func (cu *CodeUpdate) AddGroupIDs(ids ...uuid.UUID) *CodeUpdate
AddGroupIDs adds the "groups" edge to the Group entity by IDs.
func (*CodeUpdate) AddGroups ¶
func (cu *CodeUpdate) AddGroups(g ...*Group) *CodeUpdate
AddGroups adds the "groups" edges to the Group entity.
func (*CodeUpdate) ClearGroups ¶
func (cu *CodeUpdate) ClearGroups() *CodeUpdate
ClearGroups clears all "groups" edges to the Group entity.
func (*CodeUpdate) ClearUser ¶
func (cu *CodeUpdate) ClearUser() *CodeUpdate
ClearUser clears the "user" edge to the User entity.
func (*CodeUpdate) Exec ¶
func (cu *CodeUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*CodeUpdate) ExecX ¶
func (cu *CodeUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CodeUpdate) Mutation ¶
func (cu *CodeUpdate) Mutation() *CodeMutation
Mutation returns the CodeMutation object of the builder.
func (*CodeUpdate) RemoveGroupIDs ¶
func (cu *CodeUpdate) RemoveGroupIDs(ids ...uuid.UUID) *CodeUpdate
RemoveGroupIDs removes the "groups" edge to Group entities by IDs.
func (*CodeUpdate) RemoveGroups ¶
func (cu *CodeUpdate) RemoveGroups(g ...*Group) *CodeUpdate
RemoveGroups removes "groups" edges to Group entities.
func (*CodeUpdate) Save ¶
func (cu *CodeUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*CodeUpdate) SaveX ¶
func (cu *CodeUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*CodeUpdate) SetClientID ¶
func (cu *CodeUpdate) SetClientID(s string) *CodeUpdate
SetClientID sets the "client_id" field.
func (*CodeUpdate) SetCode ¶
func (cu *CodeUpdate) SetCode(s string) *CodeUpdate
SetCode sets the "code" field.
func (*CodeUpdate) SetCodeChallenge ¶
func (cu *CodeUpdate) SetCodeChallenge(s string) *CodeUpdate
SetCodeChallenge sets the "code_challenge" field.
func (*CodeUpdate) SetExpiresAt ¶
func (cu *CodeUpdate) SetExpiresAt(t time.Time) *CodeUpdate
SetExpiresAt sets the "expires_at" field.
func (*CodeUpdate) SetNillableClientID ¶
func (cu *CodeUpdate) SetNillableClientID(s *string) *CodeUpdate
SetNillableClientID sets the "client_id" field if the given value is not nil.
func (*CodeUpdate) SetNillableCode ¶
func (cu *CodeUpdate) SetNillableCode(s *string) *CodeUpdate
SetNillableCode sets the "code" field if the given value is not nil.
func (*CodeUpdate) SetNillableCodeChallenge ¶
func (cu *CodeUpdate) SetNillableCodeChallenge(s *string) *CodeUpdate
SetNillableCodeChallenge sets the "code_challenge" field if the given value is not nil.
func (*CodeUpdate) SetNillableExpiresAt ¶
func (cu *CodeUpdate) SetNillableExpiresAt(t *time.Time) *CodeUpdate
SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.
func (*CodeUpdate) SetNillableRedirectURI ¶
func (cu *CodeUpdate) SetNillableRedirectURI(s *string) *CodeUpdate
SetNillableRedirectURI sets the "redirect_uri" field if the given value is not nil.
func (*CodeUpdate) SetNillableScope ¶
func (cu *CodeUpdate) SetNillableScope(s *string) *CodeUpdate
SetNillableScope sets the "scope" field if the given value is not nil.
func (*CodeUpdate) SetNillableUserID ¶
func (cu *CodeUpdate) SetNillableUserID(id *uuid.UUID) *CodeUpdate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*CodeUpdate) SetRedirectURI ¶
func (cu *CodeUpdate) SetRedirectURI(s string) *CodeUpdate
SetRedirectURI sets the "redirect_uri" field.
func (*CodeUpdate) SetScope ¶
func (cu *CodeUpdate) SetScope(s string) *CodeUpdate
SetScope sets the "scope" field.
func (*CodeUpdate) SetUser ¶
func (cu *CodeUpdate) SetUser(u *User) *CodeUpdate
SetUser sets the "user" edge to the User entity.
func (*CodeUpdate) SetUserID ¶
func (cu *CodeUpdate) SetUserID(id uuid.UUID) *CodeUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*CodeUpdate) Where ¶
func (cu *CodeUpdate) Where(ps ...predicate.Code) *CodeUpdate
Where appends a list predicates to the CodeUpdate builder.
type CodeUpdateOne ¶
type CodeUpdateOne struct {
// contains filtered or unexported fields
}
CodeUpdateOne is the builder for updating a single Code entity.
func (*CodeUpdateOne) AddGroupIDs ¶
func (cuo *CodeUpdateOne) AddGroupIDs(ids ...uuid.UUID) *CodeUpdateOne
AddGroupIDs adds the "groups" edge to the Group entity by IDs.
func (*CodeUpdateOne) AddGroups ¶
func (cuo *CodeUpdateOne) AddGroups(g ...*Group) *CodeUpdateOne
AddGroups adds the "groups" edges to the Group entity.
func (*CodeUpdateOne) ClearGroups ¶
func (cuo *CodeUpdateOne) ClearGroups() *CodeUpdateOne
ClearGroups clears all "groups" edges to the Group entity.
func (*CodeUpdateOne) ClearUser ¶
func (cuo *CodeUpdateOne) ClearUser() *CodeUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*CodeUpdateOne) Exec ¶
func (cuo *CodeUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CodeUpdateOne) ExecX ¶
func (cuo *CodeUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CodeUpdateOne) Mutation ¶
func (cuo *CodeUpdateOne) Mutation() *CodeMutation
Mutation returns the CodeMutation object of the builder.
func (*CodeUpdateOne) RemoveGroupIDs ¶
func (cuo *CodeUpdateOne) RemoveGroupIDs(ids ...uuid.UUID) *CodeUpdateOne
RemoveGroupIDs removes the "groups" edge to Group entities by IDs.
func (*CodeUpdateOne) RemoveGroups ¶
func (cuo *CodeUpdateOne) RemoveGroups(g ...*Group) *CodeUpdateOne
RemoveGroups removes "groups" edges to Group entities.
func (*CodeUpdateOne) Save ¶
func (cuo *CodeUpdateOne) Save(ctx context.Context) (*Code, error)
Save executes the query and returns the updated Code entity.
func (*CodeUpdateOne) SaveX ¶
func (cuo *CodeUpdateOne) SaveX(ctx context.Context) *Code
SaveX is like Save, but panics if an error occurs.
func (*CodeUpdateOne) Select ¶
func (cuo *CodeUpdateOne) Select(field string, fields ...string) *CodeUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CodeUpdateOne) SetClientID ¶
func (cuo *CodeUpdateOne) SetClientID(s string) *CodeUpdateOne
SetClientID sets the "client_id" field.
func (*CodeUpdateOne) SetCode ¶
func (cuo *CodeUpdateOne) SetCode(s string) *CodeUpdateOne
SetCode sets the "code" field.
func (*CodeUpdateOne) SetCodeChallenge ¶
func (cuo *CodeUpdateOne) SetCodeChallenge(s string) *CodeUpdateOne
SetCodeChallenge sets the "code_challenge" field.
func (*CodeUpdateOne) SetExpiresAt ¶
func (cuo *CodeUpdateOne) SetExpiresAt(t time.Time) *CodeUpdateOne
SetExpiresAt sets the "expires_at" field.
func (*CodeUpdateOne) SetNillableClientID ¶
func (cuo *CodeUpdateOne) SetNillableClientID(s *string) *CodeUpdateOne
SetNillableClientID sets the "client_id" field if the given value is not nil.
func (*CodeUpdateOne) SetNillableCode ¶
func (cuo *CodeUpdateOne) SetNillableCode(s *string) *CodeUpdateOne
SetNillableCode sets the "code" field if the given value is not nil.
func (*CodeUpdateOne) SetNillableCodeChallenge ¶
func (cuo *CodeUpdateOne) SetNillableCodeChallenge(s *string) *CodeUpdateOne
SetNillableCodeChallenge sets the "code_challenge" field if the given value is not nil.
func (*CodeUpdateOne) SetNillableExpiresAt ¶
func (cuo *CodeUpdateOne) SetNillableExpiresAt(t *time.Time) *CodeUpdateOne
SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.
func (*CodeUpdateOne) SetNillableRedirectURI ¶
func (cuo *CodeUpdateOne) SetNillableRedirectURI(s *string) *CodeUpdateOne
SetNillableRedirectURI sets the "redirect_uri" field if the given value is not nil.
func (*CodeUpdateOne) SetNillableScope ¶
func (cuo *CodeUpdateOne) SetNillableScope(s *string) *CodeUpdateOne
SetNillableScope sets the "scope" field if the given value is not nil.
func (*CodeUpdateOne) SetNillableUserID ¶
func (cuo *CodeUpdateOne) SetNillableUserID(id *uuid.UUID) *CodeUpdateOne
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*CodeUpdateOne) SetRedirectURI ¶
func (cuo *CodeUpdateOne) SetRedirectURI(s string) *CodeUpdateOne
SetRedirectURI sets the "redirect_uri" field.
func (*CodeUpdateOne) SetScope ¶
func (cuo *CodeUpdateOne) SetScope(s string) *CodeUpdateOne
SetScope sets the "scope" field.
func (*CodeUpdateOne) SetUser ¶
func (cuo *CodeUpdateOne) SetUser(u *User) *CodeUpdateOne
SetUser sets the "user" edge to the User entity.
func (*CodeUpdateOne) SetUserID ¶
func (cuo *CodeUpdateOne) SetUserID(id uuid.UUID) *CodeUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*CodeUpdateOne) Where ¶
func (cuo *CodeUpdateOne) Where(ps ...predicate.Code) *CodeUpdateOne
Where appends a list predicates to the CodeUpdate builder.
type CodeUpsert ¶
CodeUpsert is the "OnConflict" setter.
func (*CodeUpsert) SetClientID ¶
func (u *CodeUpsert) SetClientID(v string) *CodeUpsert
SetClientID sets the "client_id" field.
func (*CodeUpsert) SetCode ¶
func (u *CodeUpsert) SetCode(v string) *CodeUpsert
SetCode sets the "code" field.
func (*CodeUpsert) SetCodeChallenge ¶
func (u *CodeUpsert) SetCodeChallenge(v string) *CodeUpsert
SetCodeChallenge sets the "code_challenge" field.
func (*CodeUpsert) SetExpiresAt ¶
func (u *CodeUpsert) SetExpiresAt(v time.Time) *CodeUpsert
SetExpiresAt sets the "expires_at" field.
func (*CodeUpsert) SetRedirectURI ¶
func (u *CodeUpsert) SetRedirectURI(v string) *CodeUpsert
SetRedirectURI sets the "redirect_uri" field.
func (*CodeUpsert) SetScope ¶
func (u *CodeUpsert) SetScope(v string) *CodeUpsert
SetScope sets the "scope" field.
func (*CodeUpsert) UpdateClientID ¶
func (u *CodeUpsert) UpdateClientID() *CodeUpsert
UpdateClientID sets the "client_id" field to the value that was provided on create.
func (*CodeUpsert) UpdateCode ¶
func (u *CodeUpsert) UpdateCode() *CodeUpsert
UpdateCode sets the "code" field to the value that was provided on create.
func (*CodeUpsert) UpdateCodeChallenge ¶
func (u *CodeUpsert) UpdateCodeChallenge() *CodeUpsert
UpdateCodeChallenge sets the "code_challenge" field to the value that was provided on create.
func (*CodeUpsert) UpdateExpiresAt ¶
func (u *CodeUpsert) UpdateExpiresAt() *CodeUpsert
UpdateExpiresAt sets the "expires_at" field to the value that was provided on create.
func (*CodeUpsert) UpdateRedirectURI ¶
func (u *CodeUpsert) UpdateRedirectURI() *CodeUpsert
UpdateRedirectURI sets the "redirect_uri" field to the value that was provided on create.
func (*CodeUpsert) UpdateScope ¶
func (u *CodeUpsert) UpdateScope() *CodeUpsert
UpdateScope sets the "scope" field to the value that was provided on create.
type CodeUpsertBulk ¶
type CodeUpsertBulk struct {
// contains filtered or unexported fields
}
CodeUpsertBulk is the builder for "upsert"-ing a bulk of Code nodes.
func (*CodeUpsertBulk) DoNothing ¶
func (u *CodeUpsertBulk) DoNothing() *CodeUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*CodeUpsertBulk) Exec ¶
func (u *CodeUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CodeUpsertBulk) ExecX ¶
func (u *CodeUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CodeUpsertBulk) Ignore ¶
func (u *CodeUpsertBulk) Ignore() *CodeUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Code.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*CodeUpsertBulk) SetClientID ¶
func (u *CodeUpsertBulk) SetClientID(v string) *CodeUpsertBulk
SetClientID sets the "client_id" field.
func (*CodeUpsertBulk) SetCode ¶
func (u *CodeUpsertBulk) SetCode(v string) *CodeUpsertBulk
SetCode sets the "code" field.
func (*CodeUpsertBulk) SetCodeChallenge ¶
func (u *CodeUpsertBulk) SetCodeChallenge(v string) *CodeUpsertBulk
SetCodeChallenge sets the "code_challenge" field.
func (*CodeUpsertBulk) SetExpiresAt ¶
func (u *CodeUpsertBulk) SetExpiresAt(v time.Time) *CodeUpsertBulk
SetExpiresAt sets the "expires_at" field.
func (*CodeUpsertBulk) SetRedirectURI ¶
func (u *CodeUpsertBulk) SetRedirectURI(v string) *CodeUpsertBulk
SetRedirectURI sets the "redirect_uri" field.
func (*CodeUpsertBulk) SetScope ¶
func (u *CodeUpsertBulk) SetScope(v string) *CodeUpsertBulk
SetScope sets the "scope" field.
func (*CodeUpsertBulk) Update ¶
func (u *CodeUpsertBulk) Update(set func(*CodeUpsert)) *CodeUpsertBulk
Update allows overriding fields `UPDATE` values. See the CodeCreateBulk.OnConflict documentation for more info.
func (*CodeUpsertBulk) UpdateClientID ¶
func (u *CodeUpsertBulk) UpdateClientID() *CodeUpsertBulk
UpdateClientID sets the "client_id" field to the value that was provided on create.
func (*CodeUpsertBulk) UpdateCode ¶
func (u *CodeUpsertBulk) UpdateCode() *CodeUpsertBulk
UpdateCode sets the "code" field to the value that was provided on create.
func (*CodeUpsertBulk) UpdateCodeChallenge ¶
func (u *CodeUpsertBulk) UpdateCodeChallenge() *CodeUpsertBulk
UpdateCodeChallenge sets the "code_challenge" field to the value that was provided on create.
func (*CodeUpsertBulk) UpdateExpiresAt ¶
func (u *CodeUpsertBulk) UpdateExpiresAt() *CodeUpsertBulk
UpdateExpiresAt sets the "expires_at" field to the value that was provided on create.
func (*CodeUpsertBulk) UpdateNewValues ¶
func (u *CodeUpsertBulk) UpdateNewValues() *CodeUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Code.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(code.FieldID) }), ). Exec(ctx)
func (*CodeUpsertBulk) UpdateRedirectURI ¶
func (u *CodeUpsertBulk) UpdateRedirectURI() *CodeUpsertBulk
UpdateRedirectURI sets the "redirect_uri" field to the value that was provided on create.
func (*CodeUpsertBulk) UpdateScope ¶
func (u *CodeUpsertBulk) UpdateScope() *CodeUpsertBulk
UpdateScope sets the "scope" field to the value that was provided on create.
type CodeUpsertOne ¶
type CodeUpsertOne struct {
// contains filtered or unexported fields
}
CodeUpsertOne is the builder for "upsert"-ing
one Code node.
func (*CodeUpsertOne) DoNothing ¶
func (u *CodeUpsertOne) DoNothing() *CodeUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*CodeUpsertOne) Exec ¶
func (u *CodeUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*CodeUpsertOne) ExecX ¶
func (u *CodeUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CodeUpsertOne) IDX ¶
func (u *CodeUpsertOne) IDX(ctx context.Context) uuid.UUID
IDX is like ID, but panics if an error occurs.
func (*CodeUpsertOne) Ignore ¶
func (u *CodeUpsertOne) Ignore() *CodeUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Code.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*CodeUpsertOne) SetClientID ¶
func (u *CodeUpsertOne) SetClientID(v string) *CodeUpsertOne
SetClientID sets the "client_id" field.
func (*CodeUpsertOne) SetCode ¶
func (u *CodeUpsertOne) SetCode(v string) *CodeUpsertOne
SetCode sets the "code" field.
func (*CodeUpsertOne) SetCodeChallenge ¶
func (u *CodeUpsertOne) SetCodeChallenge(v string) *CodeUpsertOne
SetCodeChallenge sets the "code_challenge" field.
func (*CodeUpsertOne) SetExpiresAt ¶
func (u *CodeUpsertOne) SetExpiresAt(v time.Time) *CodeUpsertOne
SetExpiresAt sets the "expires_at" field.
func (*CodeUpsertOne) SetRedirectURI ¶
func (u *CodeUpsertOne) SetRedirectURI(v string) *CodeUpsertOne
SetRedirectURI sets the "redirect_uri" field.
func (*CodeUpsertOne) SetScope ¶
func (u *CodeUpsertOne) SetScope(v string) *CodeUpsertOne
SetScope sets the "scope" field.
func (*CodeUpsertOne) Update ¶
func (u *CodeUpsertOne) Update(set func(*CodeUpsert)) *CodeUpsertOne
Update allows overriding fields `UPDATE` values. See the CodeCreate.OnConflict documentation for more info.
func (*CodeUpsertOne) UpdateClientID ¶
func (u *CodeUpsertOne) UpdateClientID() *CodeUpsertOne
UpdateClientID sets the "client_id" field to the value that was provided on create.
func (*CodeUpsertOne) UpdateCode ¶
func (u *CodeUpsertOne) UpdateCode() *CodeUpsertOne
UpdateCode sets the "code" field to the value that was provided on create.
func (*CodeUpsertOne) UpdateCodeChallenge ¶
func (u *CodeUpsertOne) UpdateCodeChallenge() *CodeUpsertOne
UpdateCodeChallenge sets the "code_challenge" field to the value that was provided on create.
func (*CodeUpsertOne) UpdateExpiresAt ¶
func (u *CodeUpsertOne) UpdateExpiresAt() *CodeUpsertOne
UpdateExpiresAt sets the "expires_at" field to the value that was provided on create.
func (*CodeUpsertOne) UpdateNewValues ¶
func (u *CodeUpsertOne) UpdateNewValues() *CodeUpsertOne
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.Code.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(code.FieldID) }), ). Exec(ctx)
func (*CodeUpsertOne) UpdateRedirectURI ¶
func (u *CodeUpsertOne) UpdateRedirectURI() *CodeUpsertOne
UpdateRedirectURI sets the "redirect_uri" field to the value that was provided on create.
func (*CodeUpsertOne) UpdateScope ¶
func (u *CodeUpsertOne) UpdateScope() *CodeUpsertOne
UpdateScope sets the "scope" field to the value that was provided on create.
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 Group ¶
type Group struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the GroupQuery when eager-loading is set. Edges GroupEdges `json:"edges"` // contains filtered or unexported fields }
Group is the model entity for the Group schema.
func (*Group) QueryAccessTokens ¶
func (gr *Group) QueryAccessTokens() *AccessTokenQuery
QueryAccessTokens queries the "access_tokens" edge of the Group entity.
func (*Group) QueryCodes ¶
QueryCodes queries the "codes" edge of the Group entity.
func (*Group) QueryUsers ¶
QueryUsers queries the "users" edge of the Group entity.
func (*Group) Unwrap ¶
Unwrap unwraps the Group entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Group) Update ¶
func (gr *Group) Update() *GroupUpdateOne
Update returns a builder for updating this Group. Note that you need to call Group.Unwrap() before calling this method if this Group was returned from a transaction, and the transaction was committed or rolled back.
type GroupClient ¶
type GroupClient struct {
// contains filtered or unexported fields
}
GroupClient is a client for the Group schema.
func NewGroupClient ¶
func NewGroupClient(c config) *GroupClient
NewGroupClient returns a client for the Group from the given config.
func (*GroupClient) Create ¶
func (c *GroupClient) Create() *GroupCreate
Create returns a builder for creating a Group entity.
func (*GroupClient) CreateBulk ¶
func (c *GroupClient) CreateBulk(builders ...*GroupCreate) *GroupCreateBulk
CreateBulk returns a builder for creating a bulk of Group entities.
func (*GroupClient) Delete ¶
func (c *GroupClient) Delete() *GroupDelete
Delete returns a delete builder for Group.
func (*GroupClient) DeleteOne ¶
func (c *GroupClient) DeleteOne(gr *Group) *GroupDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*GroupClient) DeleteOneID ¶
func (c *GroupClient) DeleteOneID(id uuid.UUID) *GroupDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*GroupClient) Intercept ¶
func (c *GroupClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `group.Intercept(f(g(h())))`.
func (*GroupClient) Interceptors ¶
func (c *GroupClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*GroupClient) MapCreateBulk ¶
func (c *GroupClient) MapCreateBulk(slice any, setFunc func(*GroupCreate, int)) *GroupCreateBulk
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 (*GroupClient) Query ¶
func (c *GroupClient) Query() *GroupQuery
Query returns a query builder for Group.
func (*GroupClient) QueryAccessTokens ¶
func (c *GroupClient) QueryAccessTokens(gr *Group) *AccessTokenQuery
QueryAccessTokens queries the access_tokens edge of a Group.
func (*GroupClient) QueryCodes ¶
func (c *GroupClient) QueryCodes(gr *Group) *CodeQuery
QueryCodes queries the codes edge of a Group.
func (*GroupClient) QueryUsers ¶
func (c *GroupClient) QueryUsers(gr *Group) *UserQuery
QueryUsers queries the users edge of a Group.
func (*GroupClient) Update ¶
func (c *GroupClient) Update() *GroupUpdate
Update returns an update builder for Group.
func (*GroupClient) UpdateOne ¶
func (c *GroupClient) UpdateOne(gr *Group) *GroupUpdateOne
UpdateOne returns an update builder for the given entity.
func (*GroupClient) UpdateOneID ¶
func (c *GroupClient) UpdateOneID(id uuid.UUID) *GroupUpdateOne
UpdateOneID returns an update builder for the given id.
func (*GroupClient) Use ¶
func (c *GroupClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `group.Hooks(f(g(h())))`.
type GroupCreate ¶
type GroupCreate struct {
// contains filtered or unexported fields
}
GroupCreate is the builder for creating a Group entity.
func (*GroupCreate) AddAccessTokenIDs ¶
func (gc *GroupCreate) AddAccessTokenIDs(ids ...uuid.UUID) *GroupCreate
AddAccessTokenIDs adds the "access_tokens" edge to the AccessToken entity by IDs.
func (*GroupCreate) AddAccessTokens ¶
func (gc *GroupCreate) AddAccessTokens(a ...*AccessToken) *GroupCreate
AddAccessTokens adds the "access_tokens" edges to the AccessToken entity.
func (*GroupCreate) AddCodeIDs ¶
func (gc *GroupCreate) AddCodeIDs(ids ...uuid.UUID) *GroupCreate
AddCodeIDs adds the "codes" edge to the Code entity by IDs.
func (*GroupCreate) AddCodes ¶
func (gc *GroupCreate) AddCodes(c ...*Code) *GroupCreate
AddCodes adds the "codes" edges to the Code entity.
func (*GroupCreate) AddUserIDs ¶
func (gc *GroupCreate) AddUserIDs(ids ...uuid.UUID) *GroupCreate
AddUserIDs adds the "users" edge to the User entity by IDs.
func (*GroupCreate) AddUsers ¶
func (gc *GroupCreate) AddUsers(u ...*User) *GroupCreate
AddUsers adds the "users" edges to the User entity.
func (*GroupCreate) Exec ¶
func (gc *GroupCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*GroupCreate) ExecX ¶
func (gc *GroupCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GroupCreate) Mutation ¶
func (gc *GroupCreate) Mutation() *GroupMutation
Mutation returns the GroupMutation object of the builder.
func (*GroupCreate) OnConflict ¶
func (gc *GroupCreate) OnConflict(opts ...sql.ConflictOption) *GroupUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Group.Create(). SetName(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.GroupUpsert) { SetName(v+v). }). Exec(ctx)
func (*GroupCreate) OnConflictColumns ¶
func (gc *GroupCreate) OnConflictColumns(columns ...string) *GroupUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Group.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*GroupCreate) Save ¶
func (gc *GroupCreate) Save(ctx context.Context) (*Group, error)
Save creates the Group in the database.
func (*GroupCreate) SaveX ¶
func (gc *GroupCreate) SaveX(ctx context.Context) *Group
SaveX calls Save and panics if Save returns an error.
func (*GroupCreate) SetID ¶
func (gc *GroupCreate) SetID(u uuid.UUID) *GroupCreate
SetID sets the "id" field.
func (*GroupCreate) SetName ¶
func (gc *GroupCreate) SetName(s string) *GroupCreate
SetName sets the "name" field.
func (*GroupCreate) SetNillableID ¶
func (gc *GroupCreate) SetNillableID(u *uuid.UUID) *GroupCreate
SetNillableID sets the "id" field if the given value is not nil.
type GroupCreateBulk ¶
type GroupCreateBulk struct {
// contains filtered or unexported fields
}
GroupCreateBulk is the builder for creating many Group entities in bulk.
func (*GroupCreateBulk) Exec ¶
func (gcb *GroupCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*GroupCreateBulk) ExecX ¶
func (gcb *GroupCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GroupCreateBulk) OnConflict ¶
func (gcb *GroupCreateBulk) OnConflict(opts ...sql.ConflictOption) *GroupUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Group.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.GroupUpsert) { SetName(v+v). }). Exec(ctx)
func (*GroupCreateBulk) OnConflictColumns ¶
func (gcb *GroupCreateBulk) OnConflictColumns(columns ...string) *GroupUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Group.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type GroupDelete ¶
type GroupDelete struct {
// contains filtered or unexported fields
}
GroupDelete is the builder for deleting a Group entity.
func (*GroupDelete) Exec ¶
func (gd *GroupDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*GroupDelete) ExecX ¶
func (gd *GroupDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*GroupDelete) Where ¶
func (gd *GroupDelete) Where(ps ...predicate.Group) *GroupDelete
Where appends a list predicates to the GroupDelete builder.
type GroupDeleteOne ¶
type GroupDeleteOne struct {
// contains filtered or unexported fields
}
GroupDeleteOne is the builder for deleting a single Group entity.
func (*GroupDeleteOne) Exec ¶
func (gdo *GroupDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*GroupDeleteOne) ExecX ¶
func (gdo *GroupDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GroupDeleteOne) Where ¶
func (gdo *GroupDeleteOne) Where(ps ...predicate.Group) *GroupDeleteOne
Where appends a list predicates to the GroupDelete builder.
type GroupEdges ¶
type GroupEdges struct { // Users holds the value of the users edge. Users []*User `json:"users,omitempty"` // Codes holds the value of the codes edge. Codes []*Code `json:"codes,omitempty"` // AccessTokens holds the value of the access_tokens edge. AccessTokens []*AccessToken `json:"access_tokens,omitempty"` // contains filtered or unexported fields }
GroupEdges holds the relations/edges for other nodes in the graph.
func (GroupEdges) AccessTokensOrErr ¶
func (e GroupEdges) AccessTokensOrErr() ([]*AccessToken, error)
AccessTokensOrErr returns the AccessTokens value or an error if the edge was not loaded in eager-loading.
func (GroupEdges) CodesOrErr ¶
func (e GroupEdges) CodesOrErr() ([]*Code, error)
CodesOrErr returns the Codes value or an error if the edge was not loaded in eager-loading.
func (GroupEdges) UsersOrErr ¶
func (e GroupEdges) UsersOrErr() ([]*User, error)
UsersOrErr returns the Users value or an error if the edge was not loaded in eager-loading.
type GroupGroupBy ¶
type GroupGroupBy struct {
// contains filtered or unexported fields
}
GroupGroupBy is the group-by builder for Group entities.
func (*GroupGroupBy) Aggregate ¶
func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*GroupGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*GroupGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*GroupGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*GroupGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*GroupGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*GroupGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*GroupGroupBy) Scan ¶
func (ggb *GroupGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*GroupGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type GroupMutation ¶
type GroupMutation struct {
// contains filtered or unexported fields
}
GroupMutation represents an operation that mutates the Group nodes in the graph.
func (*GroupMutation) AccessTokensCleared ¶
func (m *GroupMutation) AccessTokensCleared() bool
AccessTokensCleared reports if the "access_tokens" edge to the AccessToken entity was cleared.
func (*GroupMutation) AccessTokensIDs ¶
func (m *GroupMutation) AccessTokensIDs() (ids []uuid.UUID)
AccessTokensIDs returns the "access_tokens" edge IDs in the mutation.
func (*GroupMutation) AddAccessTokenIDs ¶
func (m *GroupMutation) AddAccessTokenIDs(ids ...uuid.UUID)
AddAccessTokenIDs adds the "access_tokens" edge to the AccessToken entity by ids.
func (*GroupMutation) AddCodeIDs ¶
func (m *GroupMutation) AddCodeIDs(ids ...uuid.UUID)
AddCodeIDs adds the "codes" edge to the Code entity by ids.
func (*GroupMutation) AddField ¶
func (m *GroupMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*GroupMutation) AddUserIDs ¶
func (m *GroupMutation) AddUserIDs(ids ...uuid.UUID)
AddUserIDs adds the "users" edge to the User entity by ids.
func (*GroupMutation) AddedEdges ¶
func (m *GroupMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*GroupMutation) AddedField ¶
func (m *GroupMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*GroupMutation) AddedFields ¶
func (m *GroupMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*GroupMutation) AddedIDs ¶
func (m *GroupMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*GroupMutation) ClearAccessTokens ¶
func (m *GroupMutation) ClearAccessTokens()
ClearAccessTokens clears the "access_tokens" edge to the AccessToken entity.
func (*GroupMutation) ClearCodes ¶
func (m *GroupMutation) ClearCodes()
ClearCodes clears the "codes" edge to the Code entity.
func (*GroupMutation) ClearEdge ¶
func (m *GroupMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*GroupMutation) ClearField ¶
func (m *GroupMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*GroupMutation) ClearUsers ¶
func (m *GroupMutation) ClearUsers()
ClearUsers clears the "users" edge to the User entity.
func (*GroupMutation) ClearedEdges ¶
func (m *GroupMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*GroupMutation) ClearedFields ¶
func (m *GroupMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (GroupMutation) Client ¶
func (m GroupMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*GroupMutation) CodesCleared ¶
func (m *GroupMutation) CodesCleared() bool
CodesCleared reports if the "codes" edge to the Code entity was cleared.
func (*GroupMutation) CodesIDs ¶
func (m *GroupMutation) CodesIDs() (ids []uuid.UUID)
CodesIDs returns the "codes" edge IDs in the mutation.
func (*GroupMutation) EdgeCleared ¶
func (m *GroupMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*GroupMutation) Field ¶
func (m *GroupMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*GroupMutation) FieldCleared ¶
func (m *GroupMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*GroupMutation) Fields ¶
func (m *GroupMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*GroupMutation) ID ¶
func (m *GroupMutation) ID() (id uuid.UUID, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*GroupMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*GroupMutation) Name ¶
func (m *GroupMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*GroupMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*GroupMutation) OldName ¶
func (m *GroupMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Group entity. If the Group object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*GroupMutation) RemoveAccessTokenIDs ¶
func (m *GroupMutation) RemoveAccessTokenIDs(ids ...uuid.UUID)
RemoveAccessTokenIDs removes the "access_tokens" edge to the AccessToken entity by IDs.
func (*GroupMutation) RemoveCodeIDs ¶
func (m *GroupMutation) RemoveCodeIDs(ids ...uuid.UUID)
RemoveCodeIDs removes the "codes" edge to the Code entity by IDs.
func (*GroupMutation) RemoveUserIDs ¶
func (m *GroupMutation) RemoveUserIDs(ids ...uuid.UUID)
RemoveUserIDs removes the "users" edge to the User entity by IDs.
func (*GroupMutation) RemovedAccessTokensIDs ¶
func (m *GroupMutation) RemovedAccessTokensIDs() (ids []uuid.UUID)
RemovedAccessTokens returns the removed IDs of the "access_tokens" edge to the AccessToken entity.
func (*GroupMutation) RemovedCodesIDs ¶
func (m *GroupMutation) RemovedCodesIDs() (ids []uuid.UUID)
RemovedCodes returns the removed IDs of the "codes" edge to the Code entity.
func (*GroupMutation) RemovedEdges ¶
func (m *GroupMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*GroupMutation) RemovedIDs ¶
func (m *GroupMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*GroupMutation) RemovedUsersIDs ¶
func (m *GroupMutation) RemovedUsersIDs() (ids []uuid.UUID)
RemovedUsers returns the removed IDs of the "users" edge to the User entity.
func (*GroupMutation) ResetAccessTokens ¶
func (m *GroupMutation) ResetAccessTokens()
ResetAccessTokens resets all changes to the "access_tokens" edge.
func (*GroupMutation) ResetCodes ¶
func (m *GroupMutation) ResetCodes()
ResetCodes resets all changes to the "codes" edge.
func (*GroupMutation) ResetEdge ¶
func (m *GroupMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*GroupMutation) ResetField ¶
func (m *GroupMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*GroupMutation) ResetName ¶
func (m *GroupMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*GroupMutation) ResetUsers ¶
func (m *GroupMutation) ResetUsers()
ResetUsers resets all changes to the "users" edge.
func (*GroupMutation) SetField ¶
func (m *GroupMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*GroupMutation) SetID ¶
func (m *GroupMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Group entities.
func (*GroupMutation) SetName ¶
func (m *GroupMutation) SetName(s string)
SetName sets the "name" field.
func (*GroupMutation) SetOp ¶
func (m *GroupMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (GroupMutation) Tx ¶
func (m GroupMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*GroupMutation) Type ¶
func (m *GroupMutation) Type() string
Type returns the node type of this mutation (Group).
func (*GroupMutation) UsersCleared ¶
func (m *GroupMutation) UsersCleared() bool
UsersCleared reports if the "users" edge to the User entity was cleared.
func (*GroupMutation) UsersIDs ¶
func (m *GroupMutation) UsersIDs() (ids []uuid.UUID)
UsersIDs returns the "users" edge IDs in the mutation.
func (*GroupMutation) Where ¶
func (m *GroupMutation) Where(ps ...predicate.Group)
Where appends a list predicates to the GroupMutation builder.
func (*GroupMutation) WhereP ¶
func (m *GroupMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the GroupMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type GroupQuery ¶
type GroupQuery struct {
// contains filtered or unexported fields
}
GroupQuery is the builder for querying Group entities.
func (*GroupQuery) Aggregate ¶
func (gq *GroupQuery) Aggregate(fns ...AggregateFunc) *GroupSelect
Aggregate returns a GroupSelect configured with the given aggregations.
func (*GroupQuery) All ¶
func (gq *GroupQuery) All(ctx context.Context) ([]*Group, error)
All executes the query and returns a list of Groups.
func (*GroupQuery) AllX ¶
func (gq *GroupQuery) AllX(ctx context.Context) []*Group
AllX is like All, but panics if an error occurs.
func (*GroupQuery) Clone ¶
func (gq *GroupQuery) Clone() *GroupQuery
Clone returns a duplicate of the GroupQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*GroupQuery) Count ¶
func (gq *GroupQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*GroupQuery) CountX ¶
func (gq *GroupQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*GroupQuery) Exist ¶
func (gq *GroupQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*GroupQuery) ExistX ¶
func (gq *GroupQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*GroupQuery) First ¶
func (gq *GroupQuery) First(ctx context.Context) (*Group, error)
First returns the first Group entity from the query. Returns a *NotFoundError when no Group was found.
func (*GroupQuery) FirstID ¶
FirstID returns the first Group ID from the query. Returns a *NotFoundError when no Group ID was found.
func (*GroupQuery) FirstIDX ¶
func (gq *GroupQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*GroupQuery) FirstX ¶
func (gq *GroupQuery) FirstX(ctx context.Context) *Group
FirstX is like First, but panics if an error occurs.
func (*GroupQuery) GroupBy ¶
func (gq *GroupQuery) GroupBy(field string, fields ...string) *GroupGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Group.Query(). GroupBy(group.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*GroupQuery) IDsX ¶
func (gq *GroupQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*GroupQuery) Limit ¶
func (gq *GroupQuery) Limit(limit int) *GroupQuery
Limit the number of records to be returned by this query.
func (*GroupQuery) Offset ¶
func (gq *GroupQuery) Offset(offset int) *GroupQuery
Offset to start from.
func (*GroupQuery) Only ¶
func (gq *GroupQuery) Only(ctx context.Context) (*Group, error)
Only returns a single Group entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Group entity is found. Returns a *NotFoundError when no Group entities are found.
func (*GroupQuery) OnlyID ¶
OnlyID is like Only, but returns the only Group ID in the query. Returns a *NotSingularError when more than one Group ID is found. Returns a *NotFoundError when no entities are found.
func (*GroupQuery) OnlyIDX ¶
func (gq *GroupQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*GroupQuery) OnlyX ¶
func (gq *GroupQuery) OnlyX(ctx context.Context) *Group
OnlyX is like Only, but panics if an error occurs.
func (*GroupQuery) Order ¶
func (gq *GroupQuery) Order(o ...group.OrderOption) *GroupQuery
Order specifies how the records should be ordered.
func (*GroupQuery) QueryAccessTokens ¶
func (gq *GroupQuery) QueryAccessTokens() *AccessTokenQuery
QueryAccessTokens chains the current query on the "access_tokens" edge.
func (*GroupQuery) QueryCodes ¶
func (gq *GroupQuery) QueryCodes() *CodeQuery
QueryCodes chains the current query on the "codes" edge.
func (*GroupQuery) QueryUsers ¶
func (gq *GroupQuery) QueryUsers() *UserQuery
QueryUsers chains the current query on the "users" edge.
func (*GroupQuery) Select ¶
func (gq *GroupQuery) Select(fields ...string) *GroupSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.Group.Query(). Select(group.FieldName). Scan(ctx, &v)
func (*GroupQuery) Unique ¶
func (gq *GroupQuery) Unique(unique bool) *GroupQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*GroupQuery) Where ¶
func (gq *GroupQuery) Where(ps ...predicate.Group) *GroupQuery
Where adds a new predicate for the GroupQuery builder.
func (*GroupQuery) WithAccessTokens ¶
func (gq *GroupQuery) WithAccessTokens(opts ...func(*AccessTokenQuery)) *GroupQuery
WithAccessTokens tells the query-builder to eager-load the nodes that are connected to the "access_tokens" edge. The optional arguments are used to configure the query builder of the edge.
func (*GroupQuery) WithCodes ¶
func (gq *GroupQuery) WithCodes(opts ...func(*CodeQuery)) *GroupQuery
WithCodes tells the query-builder to eager-load the nodes that are connected to the "codes" edge. The optional arguments are used to configure the query builder of the edge.
func (*GroupQuery) WithUsers ¶
func (gq *GroupQuery) WithUsers(opts ...func(*UserQuery)) *GroupQuery
WithUsers tells the query-builder to eager-load the nodes that are connected to the "users" edge. The optional arguments are used to configure the query builder of the edge.
type GroupSelect ¶
type GroupSelect struct { *GroupQuery // contains filtered or unexported fields }
GroupSelect is the builder for selecting fields of Group entities.
func (*GroupSelect) Aggregate ¶
func (gs *GroupSelect) Aggregate(fns ...AggregateFunc) *GroupSelect
Aggregate adds the given aggregation functions to the selector query.
func (*GroupSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*GroupSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*GroupSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*GroupSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*GroupSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*GroupSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*GroupSelect) Scan ¶
func (gs *GroupSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*GroupSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type GroupUpdate ¶
type GroupUpdate struct {
// contains filtered or unexported fields
}
GroupUpdate is the builder for updating Group entities.
func (*GroupUpdate) AddAccessTokenIDs ¶
func (gu *GroupUpdate) AddAccessTokenIDs(ids ...uuid.UUID) *GroupUpdate
AddAccessTokenIDs adds the "access_tokens" edge to the AccessToken entity by IDs.
func (*GroupUpdate) AddAccessTokens ¶
func (gu *GroupUpdate) AddAccessTokens(a ...*AccessToken) *GroupUpdate
AddAccessTokens adds the "access_tokens" edges to the AccessToken entity.
func (*GroupUpdate) AddCodeIDs ¶
func (gu *GroupUpdate) AddCodeIDs(ids ...uuid.UUID) *GroupUpdate
AddCodeIDs adds the "codes" edge to the Code entity by IDs.
func (*GroupUpdate) AddCodes ¶
func (gu *GroupUpdate) AddCodes(c ...*Code) *GroupUpdate
AddCodes adds the "codes" edges to the Code entity.
func (*GroupUpdate) AddUserIDs ¶
func (gu *GroupUpdate) AddUserIDs(ids ...uuid.UUID) *GroupUpdate
AddUserIDs adds the "users" edge to the User entity by IDs.
func (*GroupUpdate) AddUsers ¶
func (gu *GroupUpdate) AddUsers(u ...*User) *GroupUpdate
AddUsers adds the "users" edges to the User entity.
func (*GroupUpdate) ClearAccessTokens ¶
func (gu *GroupUpdate) ClearAccessTokens() *GroupUpdate
ClearAccessTokens clears all "access_tokens" edges to the AccessToken entity.
func (*GroupUpdate) ClearCodes ¶
func (gu *GroupUpdate) ClearCodes() *GroupUpdate
ClearCodes clears all "codes" edges to the Code entity.
func (*GroupUpdate) ClearUsers ¶
func (gu *GroupUpdate) ClearUsers() *GroupUpdate
ClearUsers clears all "users" edges to the User entity.
func (*GroupUpdate) Exec ¶
func (gu *GroupUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*GroupUpdate) ExecX ¶
func (gu *GroupUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GroupUpdate) Mutation ¶
func (gu *GroupUpdate) Mutation() *GroupMutation
Mutation returns the GroupMutation object of the builder.
func (*GroupUpdate) RemoveAccessTokenIDs ¶
func (gu *GroupUpdate) RemoveAccessTokenIDs(ids ...uuid.UUID) *GroupUpdate
RemoveAccessTokenIDs removes the "access_tokens" edge to AccessToken entities by IDs.
func (*GroupUpdate) RemoveAccessTokens ¶
func (gu *GroupUpdate) RemoveAccessTokens(a ...*AccessToken) *GroupUpdate
RemoveAccessTokens removes "access_tokens" edges to AccessToken entities.
func (*GroupUpdate) RemoveCodeIDs ¶
func (gu *GroupUpdate) RemoveCodeIDs(ids ...uuid.UUID) *GroupUpdate
RemoveCodeIDs removes the "codes" edge to Code entities by IDs.
func (*GroupUpdate) RemoveCodes ¶
func (gu *GroupUpdate) RemoveCodes(c ...*Code) *GroupUpdate
RemoveCodes removes "codes" edges to Code entities.
func (*GroupUpdate) RemoveUserIDs ¶
func (gu *GroupUpdate) RemoveUserIDs(ids ...uuid.UUID) *GroupUpdate
RemoveUserIDs removes the "users" edge to User entities by IDs.
func (*GroupUpdate) RemoveUsers ¶
func (gu *GroupUpdate) RemoveUsers(u ...*User) *GroupUpdate
RemoveUsers removes "users" edges to User entities.
func (*GroupUpdate) Save ¶
func (gu *GroupUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*GroupUpdate) SaveX ¶
func (gu *GroupUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*GroupUpdate) SetName ¶
func (gu *GroupUpdate) SetName(s string) *GroupUpdate
SetName sets the "name" field.
func (*GroupUpdate) SetNillableName ¶
func (gu *GroupUpdate) SetNillableName(s *string) *GroupUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*GroupUpdate) Where ¶
func (gu *GroupUpdate) Where(ps ...predicate.Group) *GroupUpdate
Where appends a list predicates to the GroupUpdate builder.
type GroupUpdateOne ¶
type GroupUpdateOne struct {
// contains filtered or unexported fields
}
GroupUpdateOne is the builder for updating a single Group entity.
func (*GroupUpdateOne) AddAccessTokenIDs ¶
func (guo *GroupUpdateOne) AddAccessTokenIDs(ids ...uuid.UUID) *GroupUpdateOne
AddAccessTokenIDs adds the "access_tokens" edge to the AccessToken entity by IDs.
func (*GroupUpdateOne) AddAccessTokens ¶
func (guo *GroupUpdateOne) AddAccessTokens(a ...*AccessToken) *GroupUpdateOne
AddAccessTokens adds the "access_tokens" edges to the AccessToken entity.
func (*GroupUpdateOne) AddCodeIDs ¶
func (guo *GroupUpdateOne) AddCodeIDs(ids ...uuid.UUID) *GroupUpdateOne
AddCodeIDs adds the "codes" edge to the Code entity by IDs.
func (*GroupUpdateOne) AddCodes ¶
func (guo *GroupUpdateOne) AddCodes(c ...*Code) *GroupUpdateOne
AddCodes adds the "codes" edges to the Code entity.
func (*GroupUpdateOne) AddUserIDs ¶
func (guo *GroupUpdateOne) AddUserIDs(ids ...uuid.UUID) *GroupUpdateOne
AddUserIDs adds the "users" edge to the User entity by IDs.
func (*GroupUpdateOne) AddUsers ¶
func (guo *GroupUpdateOne) AddUsers(u ...*User) *GroupUpdateOne
AddUsers adds the "users" edges to the User entity.
func (*GroupUpdateOne) ClearAccessTokens ¶
func (guo *GroupUpdateOne) ClearAccessTokens() *GroupUpdateOne
ClearAccessTokens clears all "access_tokens" edges to the AccessToken entity.
func (*GroupUpdateOne) ClearCodes ¶
func (guo *GroupUpdateOne) ClearCodes() *GroupUpdateOne
ClearCodes clears all "codes" edges to the Code entity.
func (*GroupUpdateOne) ClearUsers ¶
func (guo *GroupUpdateOne) ClearUsers() *GroupUpdateOne
ClearUsers clears all "users" edges to the User entity.
func (*GroupUpdateOne) Exec ¶
func (guo *GroupUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*GroupUpdateOne) ExecX ¶
func (guo *GroupUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GroupUpdateOne) Mutation ¶
func (guo *GroupUpdateOne) Mutation() *GroupMutation
Mutation returns the GroupMutation object of the builder.
func (*GroupUpdateOne) RemoveAccessTokenIDs ¶
func (guo *GroupUpdateOne) RemoveAccessTokenIDs(ids ...uuid.UUID) *GroupUpdateOne
RemoveAccessTokenIDs removes the "access_tokens" edge to AccessToken entities by IDs.
func (*GroupUpdateOne) RemoveAccessTokens ¶
func (guo *GroupUpdateOne) RemoveAccessTokens(a ...*AccessToken) *GroupUpdateOne
RemoveAccessTokens removes "access_tokens" edges to AccessToken entities.
func (*GroupUpdateOne) RemoveCodeIDs ¶
func (guo *GroupUpdateOne) RemoveCodeIDs(ids ...uuid.UUID) *GroupUpdateOne
RemoveCodeIDs removes the "codes" edge to Code entities by IDs.
func (*GroupUpdateOne) RemoveCodes ¶
func (guo *GroupUpdateOne) RemoveCodes(c ...*Code) *GroupUpdateOne
RemoveCodes removes "codes" edges to Code entities.
func (*GroupUpdateOne) RemoveUserIDs ¶
func (guo *GroupUpdateOne) RemoveUserIDs(ids ...uuid.UUID) *GroupUpdateOne
RemoveUserIDs removes the "users" edge to User entities by IDs.
func (*GroupUpdateOne) RemoveUsers ¶
func (guo *GroupUpdateOne) RemoveUsers(u ...*User) *GroupUpdateOne
RemoveUsers removes "users" edges to User entities.
func (*GroupUpdateOne) Save ¶
func (guo *GroupUpdateOne) Save(ctx context.Context) (*Group, error)
Save executes the query and returns the updated Group entity.
func (*GroupUpdateOne) SaveX ¶
func (guo *GroupUpdateOne) SaveX(ctx context.Context) *Group
SaveX is like Save, but panics if an error occurs.
func (*GroupUpdateOne) Select ¶
func (guo *GroupUpdateOne) Select(field string, fields ...string) *GroupUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*GroupUpdateOne) SetName ¶
func (guo *GroupUpdateOne) SetName(s string) *GroupUpdateOne
SetName sets the "name" field.
func (*GroupUpdateOne) SetNillableName ¶
func (guo *GroupUpdateOne) SetNillableName(s *string) *GroupUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*GroupUpdateOne) Where ¶
func (guo *GroupUpdateOne) Where(ps ...predicate.Group) *GroupUpdateOne
Where appends a list predicates to the GroupUpdate builder.
type GroupUpsert ¶
GroupUpsert is the "OnConflict" setter.
func (*GroupUpsert) SetName ¶
func (u *GroupUpsert) SetName(v string) *GroupUpsert
SetName sets the "name" field.
func (*GroupUpsert) UpdateName ¶
func (u *GroupUpsert) UpdateName() *GroupUpsert
UpdateName sets the "name" field to the value that was provided on create.
type GroupUpsertBulk ¶
type GroupUpsertBulk struct {
// contains filtered or unexported fields
}
GroupUpsertBulk is the builder for "upsert"-ing a bulk of Group nodes.
func (*GroupUpsertBulk) DoNothing ¶
func (u *GroupUpsertBulk) DoNothing() *GroupUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*GroupUpsertBulk) Exec ¶
func (u *GroupUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*GroupUpsertBulk) ExecX ¶
func (u *GroupUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GroupUpsertBulk) Ignore ¶
func (u *GroupUpsertBulk) Ignore() *GroupUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Group.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*GroupUpsertBulk) SetName ¶
func (u *GroupUpsertBulk) SetName(v string) *GroupUpsertBulk
SetName sets the "name" field.
func (*GroupUpsertBulk) Update ¶
func (u *GroupUpsertBulk) Update(set func(*GroupUpsert)) *GroupUpsertBulk
Update allows overriding fields `UPDATE` values. See the GroupCreateBulk.OnConflict documentation for more info.
func (*GroupUpsertBulk) UpdateName ¶
func (u *GroupUpsertBulk) UpdateName() *GroupUpsertBulk
UpdateName sets the "name" field to the value that was provided on create.
func (*GroupUpsertBulk) UpdateNewValues ¶
func (u *GroupUpsertBulk) UpdateNewValues() *GroupUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Group.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(group.FieldID) }), ). Exec(ctx)
type GroupUpsertOne ¶
type GroupUpsertOne struct {
// contains filtered or unexported fields
}
GroupUpsertOne is the builder for "upsert"-ing
one Group node.
func (*GroupUpsertOne) DoNothing ¶
func (u *GroupUpsertOne) DoNothing() *GroupUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*GroupUpsertOne) Exec ¶
func (u *GroupUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*GroupUpsertOne) ExecX ¶
func (u *GroupUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GroupUpsertOne) IDX ¶
func (u *GroupUpsertOne) IDX(ctx context.Context) uuid.UUID
IDX is like ID, but panics if an error occurs.
func (*GroupUpsertOne) Ignore ¶
func (u *GroupUpsertOne) Ignore() *GroupUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Group.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*GroupUpsertOne) SetName ¶
func (u *GroupUpsertOne) SetName(v string) *GroupUpsertOne
SetName sets the "name" field.
func (*GroupUpsertOne) Update ¶
func (u *GroupUpsertOne) Update(set func(*GroupUpsert)) *GroupUpsertOne
Update allows overriding fields `UPDATE` values. See the GroupCreate.OnConflict documentation for more info.
func (*GroupUpsertOne) UpdateName ¶
func (u *GroupUpsertOne) UpdateName() *GroupUpsertOne
UpdateName sets the "name" field to the value that was provided on create.
func (*GroupUpsertOne) UpdateNewValues ¶
func (u *GroupUpsertOne) UpdateNewValues() *GroupUpsertOne
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.Group.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(group.FieldID) }), ). Exec(ctx)
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 TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // AccessToken is the client for interacting with the AccessToken builders. AccessToken *AccessTokenClient // Code is the client for interacting with the Code builders. Code *CodeClient // Group is the client for interacting with the Group builders. Group *GroupClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type User ¶
type User struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Email holds the value of the "email" field. Email string `json:"email,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the UserQuery when eager-loading is set. Edges UserEdges `json:"edges"` // contains filtered or unexported fields }
User is the model entity for the User schema.
func (*User) QueryAccessTokens ¶
func (u *User) QueryAccessTokens() *AccessTokenQuery
QueryAccessTokens queries the "access_tokens" edge of the User entity.
func (*User) QueryCodes ¶
QueryCodes queries the "codes" edge of the User entity.
func (*User) QueryGroups ¶
func (u *User) QueryGroups() *GroupQuery
QueryGroups queries the "groups" edge of the User entity.
func (*User) Unwrap ¶
Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*User) Update ¶
func (u *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is a client for the User schema.
func NewUserClient ¶
func NewUserClient(c config) *UserClient
NewUserClient returns a client for the User from the given config.
func (*UserClient) Create ¶
func (c *UserClient) Create() *UserCreate
Create returns a builder for creating a User entity.
func (*UserClient) CreateBulk ¶
func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
CreateBulk returns a builder for creating a bulk of User entities.
func (*UserClient) Delete ¶
func (c *UserClient) Delete() *UserDelete
Delete returns a delete builder for User.
func (*UserClient) DeleteOne ¶
func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id uuid.UUID) *UserDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserClient) Intercept ¶
func (c *UserClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.
func (*UserClient) Interceptors ¶
func (c *UserClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*UserClient) MapCreateBulk ¶
func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*UserClient) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) QueryAccessTokens ¶
func (c *UserClient) QueryAccessTokens(u *User) *AccessTokenQuery
QueryAccessTokens queries the access_tokens edge of a User.
func (*UserClient) QueryCodes ¶
func (c *UserClient) QueryCodes(u *User) *CodeQuery
QueryCodes queries the codes edge of a User.
func (*UserClient) QueryGroups ¶
func (c *UserClient) QueryGroups(u *User) *GroupQuery
QueryGroups queries the groups edge of a User.
func (*UserClient) Update ¶
func (c *UserClient) Update() *UserUpdate
Update returns an update builder for User.
func (*UserClient) UpdateOne ¶
func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserClient) UpdateOneID ¶
func (c *UserClient) UpdateOneID(id uuid.UUID) *UserUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserClient) Use ¶
func (c *UserClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.
type UserCreate ¶
type UserCreate struct {
// contains filtered or unexported fields
}
UserCreate is the builder for creating a User entity.
func (*UserCreate) AddAccessTokenIDs ¶
func (uc *UserCreate) AddAccessTokenIDs(ids ...uuid.UUID) *UserCreate
AddAccessTokenIDs adds the "access_tokens" edge to the AccessToken entity by IDs.
func (*UserCreate) AddAccessTokens ¶
func (uc *UserCreate) AddAccessTokens(a ...*AccessToken) *UserCreate
AddAccessTokens adds the "access_tokens" edges to the AccessToken entity.
func (*UserCreate) AddCodeIDs ¶
func (uc *UserCreate) AddCodeIDs(ids ...uuid.UUID) *UserCreate
AddCodeIDs adds the "codes" edge to the Code entity by IDs.
func (*UserCreate) AddCodes ¶
func (uc *UserCreate) AddCodes(c ...*Code) *UserCreate
AddCodes adds the "codes" edges to the Code entity.
func (*UserCreate) AddGroupIDs ¶
func (uc *UserCreate) AddGroupIDs(ids ...uuid.UUID) *UserCreate
AddGroupIDs adds the "groups" edge to the Group entity by IDs.
func (*UserCreate) AddGroups ¶
func (uc *UserCreate) AddGroups(g ...*Group) *UserCreate
AddGroups adds the "groups" edges to the Group entity.
func (*UserCreate) Exec ¶
func (uc *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecX ¶
func (uc *UserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreate) Mutation ¶
func (uc *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) OnConflict ¶
func (uc *UserCreate) OnConflict(opts ...sql.ConflictOption) *UserUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.User.Create(). SetName(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.UserUpsert) { SetName(v+v). }). Exec(ctx)
func (*UserCreate) OnConflictColumns ¶
func (uc *UserCreate) OnConflictColumns(columns ...string) *UserUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.User.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*UserCreate) Save ¶
func (uc *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶
func (uc *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetEmail ¶
func (uc *UserCreate) SetEmail(s string) *UserCreate
SetEmail sets the "email" field.
func (*UserCreate) SetID ¶
func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate
SetID sets the "id" field.
func (*UserCreate) SetName ¶
func (uc *UserCreate) SetName(s string) *UserCreate
SetName sets the "name" field.
func (*UserCreate) SetNillableID ¶
func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate
SetNillableID sets the "id" field if the given value is not nil.
type UserCreateBulk ¶
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating many User entities in bulk.
func (*UserCreateBulk) Exec ¶
func (ucb *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (ucb *UserCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreateBulk) OnConflict ¶
func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.User.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.UserUpsert) { SetName(v+v). }). Exec(ctx)
func (*UserCreateBulk) OnConflictColumns ¶
func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.User.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type UserDelete ¶
type UserDelete struct {
// contains filtered or unexported fields
}
UserDelete is the builder for deleting a User entity.
func (*UserDelete) Exec ¶
func (ud *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶
func (ud *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶
func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete
Where appends a list predicates to the UserDelete builder.
type UserDeleteOne ¶
type UserDeleteOne struct {
// contains filtered or unexported fields
}
UserDeleteOne is the builder for deleting a single User entity.
func (*UserDeleteOne) Exec ¶
func (udo *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (udo *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserDeleteOne) Where ¶
func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne
Where appends a list predicates to the UserDelete builder.
type UserEdges ¶
type UserEdges struct { // Groups holds the value of the groups edge. Groups []*Group `json:"groups,omitempty"` // Codes holds the value of the codes edge. Codes []*Code `json:"codes,omitempty"` // AccessTokens holds the value of the access_tokens edge. AccessTokens []*AccessToken `json:"access_tokens,omitempty"` // contains filtered or unexported fields }
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) AccessTokensOrErr ¶
func (e UserEdges) AccessTokensOrErr() ([]*AccessToken, error)
AccessTokensOrErr returns the AccessTokens value or an error if the edge was not loaded in eager-loading.
func (UserEdges) CodesOrErr ¶
CodesOrErr returns the Codes value or an error if the edge was not loaded in eager-loading.
func (UserEdges) GroupsOrErr ¶
GroupsOrErr returns the Groups value or an error if the edge was not loaded in eager-loading.
type UserGroupBy ¶
type UserGroupBy struct {
// contains filtered or unexported fields
}
UserGroupBy is the group-by builder for User entities.
func (*UserGroupBy) Aggregate ¶
func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Scan ¶
func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserMutation ¶
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutates the User nodes in the graph.
func (*UserMutation) AccessTokensCleared ¶
func (m *UserMutation) AccessTokensCleared() bool
AccessTokensCleared reports if the "access_tokens" edge to the AccessToken entity was cleared.
func (*UserMutation) AccessTokensIDs ¶
func (m *UserMutation) AccessTokensIDs() (ids []uuid.UUID)
AccessTokensIDs returns the "access_tokens" edge IDs in the mutation.
func (*UserMutation) AddAccessTokenIDs ¶
func (m *UserMutation) AddAccessTokenIDs(ids ...uuid.UUID)
AddAccessTokenIDs adds the "access_tokens" edge to the AccessToken entity by ids.
func (*UserMutation) AddCodeIDs ¶
func (m *UserMutation) AddCodeIDs(ids ...uuid.UUID)
AddCodeIDs adds the "codes" edge to the Code entity by ids.
func (*UserMutation) AddField ¶
func (m *UserMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) AddGroupIDs ¶
func (m *UserMutation) AddGroupIDs(ids ...uuid.UUID)
AddGroupIDs adds the "groups" edge to the Group entity by ids.
func (*UserMutation) AddedEdges ¶
func (m *UserMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserMutation) AddedField ¶
func (m *UserMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) AddedFields ¶
func (m *UserMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserMutation) AddedIDs ¶
func (m *UserMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserMutation) ClearAccessTokens ¶
func (m *UserMutation) ClearAccessTokens()
ClearAccessTokens clears the "access_tokens" edge to the AccessToken entity.
func (*UserMutation) ClearCodes ¶
func (m *UserMutation) ClearCodes()
ClearCodes clears the "codes" edge to the Code entity.
func (*UserMutation) ClearEdge ¶
func (m *UserMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*UserMutation) ClearField ¶
func (m *UserMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ClearGroups ¶
func (m *UserMutation) ClearGroups()
ClearGroups clears the "groups" edge to the Group entity.
func (*UserMutation) ClearedEdges ¶
func (m *UserMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserMutation) ClearedFields ¶
func (m *UserMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserMutation) Client ¶
func (m UserMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*UserMutation) CodesCleared ¶
func (m *UserMutation) CodesCleared() bool
CodesCleared reports if the "codes" edge to the Code entity was cleared.
func (*UserMutation) CodesIDs ¶
func (m *UserMutation) CodesIDs() (ids []uuid.UUID)
CodesIDs returns the "codes" edge IDs in the mutation.
func (*UserMutation) EdgeCleared ¶
func (m *UserMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserMutation) Email ¶
func (m *UserMutation) Email() (r string, exists bool)
Email returns the value of the "email" field in the mutation.
func (*UserMutation) Field ¶
func (m *UserMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) FieldCleared ¶
func (m *UserMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserMutation) Fields ¶
func (m *UserMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*UserMutation) GroupsCleared ¶
func (m *UserMutation) GroupsCleared() bool
GroupsCleared reports if the "groups" edge to the Group entity was cleared.
func (*UserMutation) GroupsIDs ¶
func (m *UserMutation) GroupsIDs() (ids []uuid.UUID)
GroupsIDs returns the "groups" edge IDs in the mutation.
func (*UserMutation) ID ¶
func (m *UserMutation) ID() (id uuid.UUID, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*UserMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*UserMutation) Name ¶
func (m *UserMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*UserMutation) OldEmail ¶
func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)
OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*UserMutation) OldName ¶
func (m *UserMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) RemoveAccessTokenIDs ¶
func (m *UserMutation) RemoveAccessTokenIDs(ids ...uuid.UUID)
RemoveAccessTokenIDs removes the "access_tokens" edge to the AccessToken entity by IDs.
func (*UserMutation) RemoveCodeIDs ¶
func (m *UserMutation) RemoveCodeIDs(ids ...uuid.UUID)
RemoveCodeIDs removes the "codes" edge to the Code entity by IDs.
func (*UserMutation) RemoveGroupIDs ¶
func (m *UserMutation) RemoveGroupIDs(ids ...uuid.UUID)
RemoveGroupIDs removes the "groups" edge to the Group entity by IDs.
func (*UserMutation) RemovedAccessTokensIDs ¶
func (m *UserMutation) RemovedAccessTokensIDs() (ids []uuid.UUID)
RemovedAccessTokens returns the removed IDs of the "access_tokens" edge to the AccessToken entity.
func (*UserMutation) RemovedCodesIDs ¶
func (m *UserMutation) RemovedCodesIDs() (ids []uuid.UUID)
RemovedCodes returns the removed IDs of the "codes" edge to the Code entity.
func (*UserMutation) RemovedEdges ¶
func (m *UserMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserMutation) RemovedGroupsIDs ¶
func (m *UserMutation) RemovedGroupsIDs() (ids []uuid.UUID)
RemovedGroups returns the removed IDs of the "groups" edge to the Group entity.
func (*UserMutation) RemovedIDs ¶
func (m *UserMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*UserMutation) ResetAccessTokens ¶
func (m *UserMutation) ResetAccessTokens()
ResetAccessTokens resets all changes to the "access_tokens" edge.
func (*UserMutation) ResetCodes ¶
func (m *UserMutation) ResetCodes()
ResetCodes resets all changes to the "codes" edge.
func (*UserMutation) ResetEdge ¶
func (m *UserMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*UserMutation) ResetEmail ¶
func (m *UserMutation) ResetEmail()
ResetEmail resets all changes to the "email" field.
func (*UserMutation) ResetField ¶
func (m *UserMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ResetGroups ¶
func (m *UserMutation) ResetGroups()
ResetGroups resets all changes to the "groups" edge.
func (*UserMutation) ResetName ¶
func (m *UserMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*UserMutation) SetEmail ¶
func (m *UserMutation) SetEmail(s string)
SetEmail sets the "email" field.
func (*UserMutation) SetField ¶
func (m *UserMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) SetID ¶
func (m *UserMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.
func (*UserMutation) SetName ¶
func (m *UserMutation) SetName(s string)
SetName sets the "name" field.
func (*UserMutation) SetOp ¶
func (m *UserMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (UserMutation) Tx ¶
func (m UserMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserMutation) Type ¶
func (m *UserMutation) Type() string
Type returns the node type of this mutation (User).
func (*UserMutation) Where ¶
func (m *UserMutation) Where(ps ...predicate.User)
Where appends a list predicates to the UserMutation builder.
func (*UserMutation) WhereP ¶
func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Aggregate ¶
func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate returns a UserSelect configured with the given aggregations.
func (*UserQuery) Clone ¶
Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserQuery) First ¶
First returns the first User entity from the query. Returns a *NotFoundError when no User was found.
func (*UserQuery) FirstID ¶
FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.
func (*UserQuery) GroupBy ¶
func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserQuery) Only ¶
Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.
func (*UserQuery) OnlyID ¶
OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.
func (*UserQuery) Order ¶
func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
Order specifies how the records should be ordered.
func (*UserQuery) QueryAccessTokens ¶
func (uq *UserQuery) QueryAccessTokens() *AccessTokenQuery
QueryAccessTokens chains the current query on the "access_tokens" edge.
func (*UserQuery) QueryCodes ¶
QueryCodes chains the current query on the "codes" edge.
func (*UserQuery) QueryGroups ¶
func (uq *UserQuery) QueryGroups() *GroupQuery
QueryGroups chains the current query on the "groups" edge.
func (*UserQuery) Select ¶
func (uq *UserQuery) Select(fields ...string) *UserSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.User.Query(). Select(user.FieldName). Scan(ctx, &v)
func (*UserQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*UserQuery) WithAccessTokens ¶
func (uq *UserQuery) WithAccessTokens(opts ...func(*AccessTokenQuery)) *UserQuery
WithAccessTokens tells the query-builder to eager-load the nodes that are connected to the "access_tokens" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithCodes ¶
WithCodes tells the query-builder to eager-load the nodes that are connected to the "codes" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithGroups ¶
func (uq *UserQuery) WithGroups(opts ...func(*GroupQuery)) *UserQuery
WithGroups tells the query-builder to eager-load the nodes that are connected to the "groups" edge. The optional arguments are used to configure the query builder of the edge.
type UserSelect ¶
type UserSelect struct { *UserQuery // contains filtered or unexported fields }
UserSelect is the builder for selecting fields of User entities.
func (*UserSelect) Aggregate ¶
func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UserSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSelect) Scan ¶
func (us *UserSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) AddAccessTokenIDs ¶
func (uu *UserUpdate) AddAccessTokenIDs(ids ...uuid.UUID) *UserUpdate
AddAccessTokenIDs adds the "access_tokens" edge to the AccessToken entity by IDs.
func (*UserUpdate) AddAccessTokens ¶
func (uu *UserUpdate) AddAccessTokens(a ...*AccessToken) *UserUpdate
AddAccessTokens adds the "access_tokens" edges to the AccessToken entity.
func (*UserUpdate) AddCodeIDs ¶
func (uu *UserUpdate) AddCodeIDs(ids ...uuid.UUID) *UserUpdate
AddCodeIDs adds the "codes" edge to the Code entity by IDs.
func (*UserUpdate) AddCodes ¶
func (uu *UserUpdate) AddCodes(c ...*Code) *UserUpdate
AddCodes adds the "codes" edges to the Code entity.
func (*UserUpdate) AddGroupIDs ¶
func (uu *UserUpdate) AddGroupIDs(ids ...uuid.UUID) *UserUpdate
AddGroupIDs adds the "groups" edge to the Group entity by IDs.
func (*UserUpdate) AddGroups ¶
func (uu *UserUpdate) AddGroups(g ...*Group) *UserUpdate
AddGroups adds the "groups" edges to the Group entity.
func (*UserUpdate) ClearAccessTokens ¶
func (uu *UserUpdate) ClearAccessTokens() *UserUpdate
ClearAccessTokens clears all "access_tokens" edges to the AccessToken entity.
func (*UserUpdate) ClearCodes ¶
func (uu *UserUpdate) ClearCodes() *UserUpdate
ClearCodes clears all "codes" edges to the Code entity.
func (*UserUpdate) ClearGroups ¶
func (uu *UserUpdate) ClearGroups() *UserUpdate
ClearGroups clears all "groups" edges to the Group entity.
func (*UserUpdate) Exec ¶
func (uu *UserUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpdate) ExecX ¶
func (uu *UserUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdate) Mutation ¶
func (uu *UserUpdate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdate) RemoveAccessTokenIDs ¶
func (uu *UserUpdate) RemoveAccessTokenIDs(ids ...uuid.UUID) *UserUpdate
RemoveAccessTokenIDs removes the "access_tokens" edge to AccessToken entities by IDs.
func (*UserUpdate) RemoveAccessTokens ¶
func (uu *UserUpdate) RemoveAccessTokens(a ...*AccessToken) *UserUpdate
RemoveAccessTokens removes "access_tokens" edges to AccessToken entities.
func (*UserUpdate) RemoveCodeIDs ¶
func (uu *UserUpdate) RemoveCodeIDs(ids ...uuid.UUID) *UserUpdate
RemoveCodeIDs removes the "codes" edge to Code entities by IDs.
func (*UserUpdate) RemoveCodes ¶
func (uu *UserUpdate) RemoveCodes(c ...*Code) *UserUpdate
RemoveCodes removes "codes" edges to Code entities.
func (*UserUpdate) RemoveGroupIDs ¶
func (uu *UserUpdate) RemoveGroupIDs(ids ...uuid.UUID) *UserUpdate
RemoveGroupIDs removes the "groups" edge to Group entities by IDs.
func (*UserUpdate) RemoveGroups ¶
func (uu *UserUpdate) RemoveGroups(g ...*Group) *UserUpdate
RemoveGroups removes "groups" edges to Group entities.
func (*UserUpdate) Save ¶
func (uu *UserUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserUpdate) SaveX ¶
func (uu *UserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserUpdate) SetEmail ¶
func (uu *UserUpdate) SetEmail(s string) *UserUpdate
SetEmail sets the "email" field.
func (*UserUpdate) SetName ¶
func (uu *UserUpdate) SetName(s string) *UserUpdate
SetName sets the "name" field.
func (*UserUpdate) SetNillableEmail ¶
func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdate) SetNillableName ¶
func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*UserUpdate) Where ¶
func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
Where appends a list predicates to the UserUpdate builder.
type UserUpdateOne ¶
type UserUpdateOne struct {
// contains filtered or unexported fields
}
UserUpdateOne is the builder for updating a single User entity.
func (*UserUpdateOne) AddAccessTokenIDs ¶
func (uuo *UserUpdateOne) AddAccessTokenIDs(ids ...uuid.UUID) *UserUpdateOne
AddAccessTokenIDs adds the "access_tokens" edge to the AccessToken entity by IDs.
func (*UserUpdateOne) AddAccessTokens ¶
func (uuo *UserUpdateOne) AddAccessTokens(a ...*AccessToken) *UserUpdateOne
AddAccessTokens adds the "access_tokens" edges to the AccessToken entity.
func (*UserUpdateOne) AddCodeIDs ¶
func (uuo *UserUpdateOne) AddCodeIDs(ids ...uuid.UUID) *UserUpdateOne
AddCodeIDs adds the "codes" edge to the Code entity by IDs.
func (*UserUpdateOne) AddCodes ¶
func (uuo *UserUpdateOne) AddCodes(c ...*Code) *UserUpdateOne
AddCodes adds the "codes" edges to the Code entity.
func (*UserUpdateOne) AddGroupIDs ¶
func (uuo *UserUpdateOne) AddGroupIDs(ids ...uuid.UUID) *UserUpdateOne
AddGroupIDs adds the "groups" edge to the Group entity by IDs.
func (*UserUpdateOne) AddGroups ¶
func (uuo *UserUpdateOne) AddGroups(g ...*Group) *UserUpdateOne
AddGroups adds the "groups" edges to the Group entity.
func (*UserUpdateOne) ClearAccessTokens ¶
func (uuo *UserUpdateOne) ClearAccessTokens() *UserUpdateOne
ClearAccessTokens clears all "access_tokens" edges to the AccessToken entity.
func (*UserUpdateOne) ClearCodes ¶
func (uuo *UserUpdateOne) ClearCodes() *UserUpdateOne
ClearCodes clears all "codes" edges to the Code entity.
func (*UserUpdateOne) ClearGroups ¶
func (uuo *UserUpdateOne) ClearGroups() *UserUpdateOne
ClearGroups clears all "groups" edges to the Group entity.
func (*UserUpdateOne) Exec ¶
func (uuo *UserUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserUpdateOne) ExecX ¶
func (uuo *UserUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdateOne) Mutation ¶
func (uuo *UserUpdateOne) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdateOne) RemoveAccessTokenIDs ¶
func (uuo *UserUpdateOne) RemoveAccessTokenIDs(ids ...uuid.UUID) *UserUpdateOne
RemoveAccessTokenIDs removes the "access_tokens" edge to AccessToken entities by IDs.
func (*UserUpdateOne) RemoveAccessTokens ¶
func (uuo *UserUpdateOne) RemoveAccessTokens(a ...*AccessToken) *UserUpdateOne
RemoveAccessTokens removes "access_tokens" edges to AccessToken entities.
func (*UserUpdateOne) RemoveCodeIDs ¶
func (uuo *UserUpdateOne) RemoveCodeIDs(ids ...uuid.UUID) *UserUpdateOne
RemoveCodeIDs removes the "codes" edge to Code entities by IDs.
func (*UserUpdateOne) RemoveCodes ¶
func (uuo *UserUpdateOne) RemoveCodes(c ...*Code) *UserUpdateOne
RemoveCodes removes "codes" edges to Code entities.
func (*UserUpdateOne) RemoveGroupIDs ¶
func (uuo *UserUpdateOne) RemoveGroupIDs(ids ...uuid.UUID) *UserUpdateOne
RemoveGroupIDs removes the "groups" edge to Group entities by IDs.
func (*UserUpdateOne) RemoveGroups ¶
func (uuo *UserUpdateOne) RemoveGroups(g ...*Group) *UserUpdateOne
RemoveGroups removes "groups" edges to Group entities.
func (*UserUpdateOne) Save ¶
func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
Save executes the query and returns the updated User entity.
func (*UserUpdateOne) SaveX ¶
func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
SaveX is like Save, but panics if an error occurs.
func (*UserUpdateOne) Select ¶
func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserUpdateOne) SetEmail ¶
func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
SetEmail sets the "email" field.
func (*UserUpdateOne) SetName ¶
func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne
SetName sets the "name" field.
func (*UserUpdateOne) SetNillableEmail ¶
func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdateOne) SetNillableName ¶
func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*UserUpdateOne) Where ¶
func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
Where appends a list predicates to the UserUpdate builder.
type UserUpsert ¶
UserUpsert is the "OnConflict" setter.
func (*UserUpsert) SetEmail ¶
func (u *UserUpsert) SetEmail(v string) *UserUpsert
SetEmail sets the "email" field.
func (*UserUpsert) SetName ¶
func (u *UserUpsert) SetName(v string) *UserUpsert
SetName sets the "name" field.
func (*UserUpsert) UpdateEmail ¶
func (u *UserUpsert) UpdateEmail() *UserUpsert
UpdateEmail sets the "email" field to the value that was provided on create.
func (*UserUpsert) UpdateName ¶
func (u *UserUpsert) UpdateName() *UserUpsert
UpdateName sets the "name" field to the value that was provided on create.
type UserUpsertBulk ¶
type UserUpsertBulk struct {
// contains filtered or unexported fields
}
UserUpsertBulk is the builder for "upsert"-ing a bulk of User nodes.
func (*UserUpsertBulk) DoNothing ¶
func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*UserUpsertBulk) Exec ¶
func (u *UserUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpsertBulk) ExecX ¶
func (u *UserUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpsertBulk) Ignore ¶
func (u *UserUpsertBulk) Ignore() *UserUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.User.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*UserUpsertBulk) SetEmail ¶
func (u *UserUpsertBulk) SetEmail(v string) *UserUpsertBulk
SetEmail sets the "email" field.
func (*UserUpsertBulk) SetName ¶
func (u *UserUpsertBulk) SetName(v string) *UserUpsertBulk
SetName sets the "name" field.
func (*UserUpsertBulk) Update ¶
func (u *UserUpsertBulk) Update(set func(*UserUpsert)) *UserUpsertBulk
Update allows overriding fields `UPDATE` values. See the UserCreateBulk.OnConflict documentation for more info.
func (*UserUpsertBulk) UpdateEmail ¶
func (u *UserUpsertBulk) UpdateEmail() *UserUpsertBulk
UpdateEmail sets the "email" field to the value that was provided on create.
func (*UserUpsertBulk) UpdateName ¶
func (u *UserUpsertBulk) UpdateName() *UserUpsertBulk
UpdateName sets the "name" field to the value that was provided on create.
func (*UserUpsertBulk) UpdateNewValues ¶
func (u *UserUpsertBulk) UpdateNewValues() *UserUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.User.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(user.FieldID) }), ). Exec(ctx)
type UserUpsertOne ¶
type UserUpsertOne struct {
// contains filtered or unexported fields
}
UserUpsertOne is the builder for "upsert"-ing
one User node.
func (*UserUpsertOne) DoNothing ¶
func (u *UserUpsertOne) DoNothing() *UserUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*UserUpsertOne) Exec ¶
func (u *UserUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpsertOne) ExecX ¶
func (u *UserUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpsertOne) IDX ¶
func (u *UserUpsertOne) IDX(ctx context.Context) uuid.UUID
IDX is like ID, but panics if an error occurs.
func (*UserUpsertOne) Ignore ¶
func (u *UserUpsertOne) Ignore() *UserUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.User.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*UserUpsertOne) SetEmail ¶
func (u *UserUpsertOne) SetEmail(v string) *UserUpsertOne
SetEmail sets the "email" field.
func (*UserUpsertOne) SetName ¶
func (u *UserUpsertOne) SetName(v string) *UserUpsertOne
SetName sets the "name" field.
func (*UserUpsertOne) Update ¶
func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne
Update allows overriding fields `UPDATE` values. See the UserCreate.OnConflict documentation for more info.
func (*UserUpsertOne) UpdateEmail ¶
func (u *UserUpsertOne) UpdateEmail() *UserUpsertOne
UpdateEmail sets the "email" field to the value that was provided on create.
func (*UserUpsertOne) UpdateName ¶
func (u *UserUpsertOne) UpdateName() *UserUpsertOne
UpdateName sets the "name" field to the value that was provided on create.
func (*UserUpsertOne) UpdateNewValues ¶
func (u *UserUpsertOne) UpdateNewValues() *UserUpsertOne
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.User.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(user.FieldID) }), ). Exec(ctx)
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
Source Files
¶
- accesstoken.go
- accesstoken_create.go
- accesstoken_delete.go
- accesstoken_query.go
- accesstoken_update.go
- client.go
- code.go
- code_create.go
- code_delete.go
- code_query.go
- code_update.go
- ent.go
- generate.go
- group.go
- group_create.go
- group_delete.go
- group_query.go
- group_update.go
- mutation.go
- runtime.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go