Documentation
¶
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Devices
- type DevicesClient
- func (c *DevicesClient) Create() *DevicesCreate
- func (c *DevicesClient) CreateBulk(builders ...*DevicesCreate) *DevicesCreateBulk
- func (c *DevicesClient) Delete() *DevicesDelete
- func (c *DevicesClient) DeleteOne(d *Devices) *DevicesDeleteOne
- func (c *DevicesClient) DeleteOneID(id uint64) *DevicesDeleteOne
- func (c *DevicesClient) Get(ctx context.Context, id uint64) (*Devices, error)
- func (c *DevicesClient) GetX(ctx context.Context, id uint64) *Devices
- func (c *DevicesClient) Hooks() []Hook
- func (c *DevicesClient) Intercept(interceptors ...Interceptor)
- func (c *DevicesClient) Interceptors() []Interceptor
- func (c *DevicesClient) MapCreateBulk(slice any, setFunc func(*DevicesCreate, int)) *DevicesCreateBulk
- func (c *DevicesClient) Query() *DevicesQuery
- func (c *DevicesClient) QueryUser(d *Devices) *UsersQuery
- func (c *DevicesClient) Update() *DevicesUpdate
- func (c *DevicesClient) UpdateOne(d *Devices) *DevicesUpdateOne
- func (c *DevicesClient) UpdateOneID(id uint64) *DevicesUpdateOne
- func (c *DevicesClient) Use(hooks ...Hook)
- type DevicesCreate
- func (dc *DevicesCreate) Exec(ctx context.Context) error
- func (dc *DevicesCreate) ExecX(ctx context.Context)
- func (dc *DevicesCreate) Mutation() *DevicesMutation
- func (dc *DevicesCreate) Save(ctx context.Context) (*Devices, error)
- func (dc *DevicesCreate) SaveX(ctx context.Context) *Devices
- func (dc *DevicesCreate) SetCreateTime(t time.Time) *DevicesCreate
- func (dc *DevicesCreate) SetDevice(s string) *DevicesCreate
- func (dc *DevicesCreate) SetID(u uint64) *DevicesCreate
- func (dc *DevicesCreate) SetIP(s string) *DevicesCreate
- func (dc *DevicesCreate) SetNillableCreateTime(t *time.Time) *DevicesCreate
- func (dc *DevicesCreate) SetNillableUpdateTime(t *time.Time) *DevicesCreate
- func (dc *DevicesCreate) SetNillableUserID(id *uint64) *DevicesCreate
- func (dc *DevicesCreate) SetUpdateTime(t time.Time) *DevicesCreate
- func (dc *DevicesCreate) SetUser(u *Users) *DevicesCreate
- func (dc *DevicesCreate) SetUserID(id uint64) *DevicesCreate
- type DevicesCreateBulk
- type DevicesDelete
- type DevicesDeleteOne
- type DevicesEdges
- type DevicesGroupBy
- func (dgb *DevicesGroupBy) Aggregate(fns ...AggregateFunc) *DevicesGroupBy
- func (s *DevicesGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *DevicesGroupBy) BoolX(ctx context.Context) bool
- func (s *DevicesGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *DevicesGroupBy) BoolsX(ctx context.Context) []bool
- func (s *DevicesGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *DevicesGroupBy) Float64X(ctx context.Context) float64
- func (s *DevicesGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *DevicesGroupBy) Float64sX(ctx context.Context) []float64
- func (s *DevicesGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *DevicesGroupBy) IntX(ctx context.Context) int
- func (s *DevicesGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *DevicesGroupBy) IntsX(ctx context.Context) []int
- func (dgb *DevicesGroupBy) Scan(ctx context.Context, v any) error
- func (s *DevicesGroupBy) ScanX(ctx context.Context, v any)
- func (s *DevicesGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *DevicesGroupBy) StringX(ctx context.Context) string
- func (s *DevicesGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *DevicesGroupBy) StringsX(ctx context.Context) []string
- type DevicesMutation
- func (m *DevicesMutation) AddField(name string, value ent.Value) error
- func (m *DevicesMutation) AddedEdges() []string
- func (m *DevicesMutation) AddedField(name string) (ent.Value, bool)
- func (m *DevicesMutation) AddedFields() []string
- func (m *DevicesMutation) AddedIDs(name string) []ent.Value
- func (m *DevicesMutation) ClearEdge(name string) error
- func (m *DevicesMutation) ClearField(name string) error
- func (m *DevicesMutation) ClearUser()
- func (m *DevicesMutation) ClearedEdges() []string
- func (m *DevicesMutation) ClearedFields() []string
- func (m DevicesMutation) Client() *Client
- func (m *DevicesMutation) CreateTime() (r time.Time, exists bool)
- func (m *DevicesMutation) Device() (r string, exists bool)
- func (m *DevicesMutation) EdgeCleared(name string) bool
- func (m *DevicesMutation) Field(name string) (ent.Value, bool)
- func (m *DevicesMutation) FieldCleared(name string) bool
- func (m *DevicesMutation) Fields() []string
- func (m *DevicesMutation) ID() (id uint64, exists bool)
- func (m *DevicesMutation) IDs(ctx context.Context) ([]uint64, error)
- func (m *DevicesMutation) IP() (r string, exists bool)
- func (m *DevicesMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *DevicesMutation) OldDevice(ctx context.Context) (v string, err error)
- func (m *DevicesMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *DevicesMutation) OldIP(ctx context.Context) (v string, err error)
- func (m *DevicesMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *DevicesMutation) Op() Op
- func (m *DevicesMutation) RemovedEdges() []string
- func (m *DevicesMutation) RemovedIDs(name string) []ent.Value
- func (m *DevicesMutation) ResetCreateTime()
- func (m *DevicesMutation) ResetDevice()
- func (m *DevicesMutation) ResetEdge(name string) error
- func (m *DevicesMutation) ResetField(name string) error
- func (m *DevicesMutation) ResetIP()
- func (m *DevicesMutation) ResetUpdateTime()
- func (m *DevicesMutation) ResetUser()
- func (m *DevicesMutation) SetCreateTime(t time.Time)
- func (m *DevicesMutation) SetDevice(s string)
- func (m *DevicesMutation) SetField(name string, value ent.Value) error
- func (m *DevicesMutation) SetID(id uint64)
- func (m *DevicesMutation) SetIP(s string)
- func (m *DevicesMutation) SetOp(op Op)
- func (m *DevicesMutation) SetUpdateTime(t time.Time)
- func (m *DevicesMutation) SetUserID(id uint64)
- func (m DevicesMutation) Tx() (*Tx, error)
- func (m *DevicesMutation) Type() string
- func (m *DevicesMutation) UpdateTime() (r time.Time, exists bool)
- func (m *DevicesMutation) UserCleared() bool
- func (m *DevicesMutation) UserID() (id uint64, exists bool)
- func (m *DevicesMutation) UserIDs() (ids []uint64)
- func (m *DevicesMutation) Where(ps ...predicate.Devices)
- func (m *DevicesMutation) WhereP(ps ...func(*sql.Selector))
- type DevicesQuery
- func (dq *DevicesQuery) Aggregate(fns ...AggregateFunc) *DevicesSelect
- func (dq *DevicesQuery) All(ctx context.Context) ([]*Devices, error)
- func (dq *DevicesQuery) AllX(ctx context.Context) []*Devices
- func (dq *DevicesQuery) Clone() *DevicesQuery
- func (dq *DevicesQuery) Count(ctx context.Context) (int, error)
- func (dq *DevicesQuery) CountX(ctx context.Context) int
- func (dq *DevicesQuery) Exist(ctx context.Context) (bool, error)
- func (dq *DevicesQuery) ExistX(ctx context.Context) bool
- func (dq *DevicesQuery) First(ctx context.Context) (*Devices, error)
- func (dq *DevicesQuery) FirstID(ctx context.Context) (id uint64, err error)
- func (dq *DevicesQuery) FirstIDX(ctx context.Context) uint64
- func (dq *DevicesQuery) FirstX(ctx context.Context) *Devices
- func (dq *DevicesQuery) GroupBy(field string, fields ...string) *DevicesGroupBy
- func (dq *DevicesQuery) IDs(ctx context.Context) (ids []uint64, err error)
- func (dq *DevicesQuery) IDsX(ctx context.Context) []uint64
- func (dq *DevicesQuery) Limit(limit int) *DevicesQuery
- func (dq *DevicesQuery) Offset(offset int) *DevicesQuery
- func (dq *DevicesQuery) Only(ctx context.Context) (*Devices, error)
- func (dq *DevicesQuery) OnlyID(ctx context.Context) (id uint64, err error)
- func (dq *DevicesQuery) OnlyIDX(ctx context.Context) uint64
- func (dq *DevicesQuery) OnlyX(ctx context.Context) *Devices
- func (dq *DevicesQuery) Order(o ...devices.OrderOption) *DevicesQuery
- func (dq *DevicesQuery) QueryUser() *UsersQuery
- func (dq *DevicesQuery) Select(fields ...string) *DevicesSelect
- func (dq *DevicesQuery) Unique(unique bool) *DevicesQuery
- func (dq *DevicesQuery) Where(ps ...predicate.Devices) *DevicesQuery
- func (dq *DevicesQuery) WithUser(opts ...func(*UsersQuery)) *DevicesQuery
- type DevicesSelect
- func (ds *DevicesSelect) Aggregate(fns ...AggregateFunc) *DevicesSelect
- func (s *DevicesSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *DevicesSelect) BoolX(ctx context.Context) bool
- func (s *DevicesSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *DevicesSelect) BoolsX(ctx context.Context) []bool
- func (s *DevicesSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *DevicesSelect) Float64X(ctx context.Context) float64
- func (s *DevicesSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *DevicesSelect) Float64sX(ctx context.Context) []float64
- func (s *DevicesSelect) Int(ctx context.Context) (_ int, err error)
- func (s *DevicesSelect) IntX(ctx context.Context) int
- func (s *DevicesSelect) Ints(ctx context.Context) ([]int, error)
- func (s *DevicesSelect) IntsX(ctx context.Context) []int
- func (ds *DevicesSelect) Scan(ctx context.Context, v any) error
- func (s *DevicesSelect) ScanX(ctx context.Context, v any)
- func (s *DevicesSelect) String(ctx context.Context) (_ string, err error)
- func (s *DevicesSelect) StringX(ctx context.Context) string
- func (s *DevicesSelect) Strings(ctx context.Context) ([]string, error)
- func (s *DevicesSelect) StringsX(ctx context.Context) []string
- type DevicesSlice
- type DevicesUpdate
- func (du *DevicesUpdate) ClearUser() *DevicesUpdate
- func (du *DevicesUpdate) Exec(ctx context.Context) error
- func (du *DevicesUpdate) ExecX(ctx context.Context)
- func (du *DevicesUpdate) Mutation() *DevicesMutation
- func (du *DevicesUpdate) Save(ctx context.Context) (int, error)
- func (du *DevicesUpdate) SaveX(ctx context.Context) int
- func (du *DevicesUpdate) SetDevice(s string) *DevicesUpdate
- func (du *DevicesUpdate) SetIP(s string) *DevicesUpdate
- func (du *DevicesUpdate) SetNillableDevice(s *string) *DevicesUpdate
- func (du *DevicesUpdate) SetNillableIP(s *string) *DevicesUpdate
- func (du *DevicesUpdate) SetNillableUserID(id *uint64) *DevicesUpdate
- func (du *DevicesUpdate) SetUpdateTime(t time.Time) *DevicesUpdate
- func (du *DevicesUpdate) SetUser(u *Users) *DevicesUpdate
- func (du *DevicesUpdate) SetUserID(id uint64) *DevicesUpdate
- func (du *DevicesUpdate) Where(ps ...predicate.Devices) *DevicesUpdate
- type DevicesUpdateOne
- func (duo *DevicesUpdateOne) ClearUser() *DevicesUpdateOne
- func (duo *DevicesUpdateOne) Exec(ctx context.Context) error
- func (duo *DevicesUpdateOne) ExecX(ctx context.Context)
- func (duo *DevicesUpdateOne) Mutation() *DevicesMutation
- func (duo *DevicesUpdateOne) Save(ctx context.Context) (*Devices, error)
- func (duo *DevicesUpdateOne) SaveX(ctx context.Context) *Devices
- func (duo *DevicesUpdateOne) Select(field string, fields ...string) *DevicesUpdateOne
- func (duo *DevicesUpdateOne) SetDevice(s string) *DevicesUpdateOne
- func (duo *DevicesUpdateOne) SetIP(s string) *DevicesUpdateOne
- func (duo *DevicesUpdateOne) SetNillableDevice(s *string) *DevicesUpdateOne
- func (duo *DevicesUpdateOne) SetNillableIP(s *string) *DevicesUpdateOne
- func (duo *DevicesUpdateOne) SetNillableUserID(id *uint64) *DevicesUpdateOne
- func (duo *DevicesUpdateOne) SetUpdateTime(t time.Time) *DevicesUpdateOne
- func (duo *DevicesUpdateOne) SetUser(u *Users) *DevicesUpdateOne
- func (duo *DevicesUpdateOne) SetUserID(id uint64) *DevicesUpdateOne
- func (duo *DevicesUpdateOne) Where(ps ...predicate.Devices) *DevicesUpdateOne
- type Dirs
- func (d *Dirs) QueryOwner() *UsersQuery
- func (d *Dirs) QueryPdir() *DirsQuery
- func (d *Dirs) QuerySaves() *SavesQuery
- func (d *Dirs) QuerySubdir() *DirsQuery
- func (d *Dirs) String() string
- func (d *Dirs) Unwrap() *Dirs
- func (d *Dirs) Update() *DirsUpdateOne
- func (d *Dirs) Value(name string) (ent.Value, error)
- type DirsClient
- func (c *DirsClient) Create() *DirsCreate
- func (c *DirsClient) CreateBulk(builders ...*DirsCreate) *DirsCreateBulk
- func (c *DirsClient) Delete() *DirsDelete
- func (c *DirsClient) DeleteOne(d *Dirs) *DirsDeleteOne
- func (c *DirsClient) DeleteOneID(id uint64) *DirsDeleteOne
- func (c *DirsClient) Get(ctx context.Context, id uint64) (*Dirs, error)
- func (c *DirsClient) GetX(ctx context.Context, id uint64) *Dirs
- func (c *DirsClient) Hooks() []Hook
- func (c *DirsClient) Intercept(interceptors ...Interceptor)
- func (c *DirsClient) Interceptors() []Interceptor
- func (c *DirsClient) MapCreateBulk(slice any, setFunc func(*DirsCreate, int)) *DirsCreateBulk
- func (c *DirsClient) Query() *DirsQuery
- func (c *DirsClient) QueryOwner(d *Dirs) *UsersQuery
- func (c *DirsClient) QueryPdir(d *Dirs) *DirsQuery
- func (c *DirsClient) QuerySaves(d *Dirs) *SavesQuery
- func (c *DirsClient) QuerySubdir(d *Dirs) *DirsQuery
- func (c *DirsClient) Update() *DirsUpdate
- func (c *DirsClient) UpdateOne(d *Dirs) *DirsUpdateOne
- func (c *DirsClient) UpdateOneID(id uint64) *DirsUpdateOne
- func (c *DirsClient) Use(hooks ...Hook)
- type DirsCreate
- func (dc *DirsCreate) AddPdir(d ...*Dirs) *DirsCreate
- func (dc *DirsCreate) AddPdirIDs(ids ...uint64) *DirsCreate
- func (dc *DirsCreate) AddSafeIDs(ids ...uint64) *DirsCreate
- func (dc *DirsCreate) AddSaves(s ...*Saves) *DirsCreate
- func (dc *DirsCreate) AddSubdir(d ...*Dirs) *DirsCreate
- func (dc *DirsCreate) AddSubdirIDs(ids ...uint64) *DirsCreate
- func (dc *DirsCreate) Exec(ctx context.Context) error
- func (dc *DirsCreate) ExecX(ctx context.Context)
- func (dc *DirsCreate) Mutation() *DirsMutation
- func (dc *DirsCreate) Save(ctx context.Context) (*Dirs, error)
- func (dc *DirsCreate) SaveX(ctx context.Context) *Dirs
- func (dc *DirsCreate) SetCreateTime(t time.Time) *DirsCreate
- func (dc *DirsCreate) SetID(u uint64) *DirsCreate
- func (dc *DirsCreate) SetName(s string) *DirsCreate
- func (dc *DirsCreate) SetNillableCreateTime(t *time.Time) *DirsCreate
- func (dc *DirsCreate) SetNillableOwnerID(id *uint64) *DirsCreate
- func (dc *DirsCreate) SetNillableUpdateTime(t *time.Time) *DirsCreate
- func (dc *DirsCreate) SetOwner(u *Users) *DirsCreate
- func (dc *DirsCreate) SetOwnerID(id uint64) *DirsCreate
- func (dc *DirsCreate) SetUpdateTime(t time.Time) *DirsCreate
- type DirsCreateBulk
- type DirsDelete
- type DirsDeleteOne
- type DirsEdges
- type DirsGroupBy
- func (dgb *DirsGroupBy) Aggregate(fns ...AggregateFunc) *DirsGroupBy
- func (s *DirsGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *DirsGroupBy) BoolX(ctx context.Context) bool
- func (s *DirsGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *DirsGroupBy) BoolsX(ctx context.Context) []bool
- func (s *DirsGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *DirsGroupBy) Float64X(ctx context.Context) float64
- func (s *DirsGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *DirsGroupBy) Float64sX(ctx context.Context) []float64
- func (s *DirsGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *DirsGroupBy) IntX(ctx context.Context) int
- func (s *DirsGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *DirsGroupBy) IntsX(ctx context.Context) []int
- func (dgb *DirsGroupBy) Scan(ctx context.Context, v any) error
- func (s *DirsGroupBy) ScanX(ctx context.Context, v any)
- func (s *DirsGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *DirsGroupBy) StringX(ctx context.Context) string
- func (s *DirsGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *DirsGroupBy) StringsX(ctx context.Context) []string
- type DirsMutation
- func (m *DirsMutation) AddField(name string, value ent.Value) error
- func (m *DirsMutation) AddPdirIDs(ids ...uint64)
- func (m *DirsMutation) AddSafeIDs(ids ...uint64)
- func (m *DirsMutation) AddSubdirIDs(ids ...uint64)
- func (m *DirsMutation) AddedEdges() []string
- func (m *DirsMutation) AddedField(name string) (ent.Value, bool)
- func (m *DirsMutation) AddedFields() []string
- func (m *DirsMutation) AddedIDs(name string) []ent.Value
- func (m *DirsMutation) ClearEdge(name string) error
- func (m *DirsMutation) ClearField(name string) error
- func (m *DirsMutation) ClearOwner()
- func (m *DirsMutation) ClearPdir()
- func (m *DirsMutation) ClearSaves()
- func (m *DirsMutation) ClearSubdir()
- func (m *DirsMutation) ClearedEdges() []string
- func (m *DirsMutation) ClearedFields() []string
- func (m DirsMutation) Client() *Client
- func (m *DirsMutation) CreateTime() (r time.Time, exists bool)
- func (m *DirsMutation) EdgeCleared(name string) bool
- func (m *DirsMutation) Field(name string) (ent.Value, bool)
- func (m *DirsMutation) FieldCleared(name string) bool
- func (m *DirsMutation) Fields() []string
- func (m *DirsMutation) ID() (id uint64, exists bool)
- func (m *DirsMutation) IDs(ctx context.Context) ([]uint64, error)
- func (m *DirsMutation) Name() (r string, exists bool)
- func (m *DirsMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *DirsMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *DirsMutation) OldName(ctx context.Context) (v string, err error)
- func (m *DirsMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *DirsMutation) Op() Op
- func (m *DirsMutation) OwnerCleared() bool
- func (m *DirsMutation) OwnerID() (id uint64, exists bool)
- func (m *DirsMutation) OwnerIDs() (ids []uint64)
- func (m *DirsMutation) PdirCleared() bool
- func (m *DirsMutation) PdirIDs() (ids []uint64)
- func (m *DirsMutation) RemovePdirIDs(ids ...uint64)
- func (m *DirsMutation) RemoveSafeIDs(ids ...uint64)
- func (m *DirsMutation) RemoveSubdirIDs(ids ...uint64)
- func (m *DirsMutation) RemovedEdges() []string
- func (m *DirsMutation) RemovedIDs(name string) []ent.Value
- func (m *DirsMutation) RemovedPdirIDs() (ids []uint64)
- func (m *DirsMutation) RemovedSavesIDs() (ids []uint64)
- func (m *DirsMutation) RemovedSubdirIDs() (ids []uint64)
- func (m *DirsMutation) ResetCreateTime()
- func (m *DirsMutation) ResetEdge(name string) error
- func (m *DirsMutation) ResetField(name string) error
- func (m *DirsMutation) ResetName()
- func (m *DirsMutation) ResetOwner()
- func (m *DirsMutation) ResetPdir()
- func (m *DirsMutation) ResetSaves()
- func (m *DirsMutation) ResetSubdir()
- func (m *DirsMutation) ResetUpdateTime()
- func (m *DirsMutation) SavesCleared() bool
- func (m *DirsMutation) SavesIDs() (ids []uint64)
- func (m *DirsMutation) SetCreateTime(t time.Time)
- func (m *DirsMutation) SetField(name string, value ent.Value) error
- func (m *DirsMutation) SetID(id uint64)
- func (m *DirsMutation) SetName(s string)
- func (m *DirsMutation) SetOp(op Op)
- func (m *DirsMutation) SetOwnerID(id uint64)
- func (m *DirsMutation) SetUpdateTime(t time.Time)
- func (m *DirsMutation) SubdirCleared() bool
- func (m *DirsMutation) SubdirIDs() (ids []uint64)
- func (m DirsMutation) Tx() (*Tx, error)
- func (m *DirsMutation) Type() string
- func (m *DirsMutation) UpdateTime() (r time.Time, exists bool)
- func (m *DirsMutation) Where(ps ...predicate.Dirs)
- func (m *DirsMutation) WhereP(ps ...func(*sql.Selector))
- type DirsQuery
- func (dq *DirsQuery) Aggregate(fns ...AggregateFunc) *DirsSelect
- func (dq *DirsQuery) All(ctx context.Context) ([]*Dirs, error)
- func (dq *DirsQuery) AllX(ctx context.Context) []*Dirs
- func (dq *DirsQuery) Clone() *DirsQuery
- func (dq *DirsQuery) Count(ctx context.Context) (int, error)
- func (dq *DirsQuery) CountX(ctx context.Context) int
- func (dq *DirsQuery) Exist(ctx context.Context) (bool, error)
- func (dq *DirsQuery) ExistX(ctx context.Context) bool
- func (dq *DirsQuery) First(ctx context.Context) (*Dirs, error)
- func (dq *DirsQuery) FirstID(ctx context.Context) (id uint64, err error)
- func (dq *DirsQuery) FirstIDX(ctx context.Context) uint64
- func (dq *DirsQuery) FirstX(ctx context.Context) *Dirs
- func (dq *DirsQuery) GroupBy(field string, fields ...string) *DirsGroupBy
- func (dq *DirsQuery) IDs(ctx context.Context) (ids []uint64, err error)
- func (dq *DirsQuery) IDsX(ctx context.Context) []uint64
- func (dq *DirsQuery) Limit(limit int) *DirsQuery
- func (dq *DirsQuery) Offset(offset int) *DirsQuery
- func (dq *DirsQuery) Only(ctx context.Context) (*Dirs, error)
- func (dq *DirsQuery) OnlyID(ctx context.Context) (id uint64, err error)
- func (dq *DirsQuery) OnlyIDX(ctx context.Context) uint64
- func (dq *DirsQuery) OnlyX(ctx context.Context) *Dirs
- func (dq *DirsQuery) Order(o ...dirs.OrderOption) *DirsQuery
- func (dq *DirsQuery) QueryOwner() *UsersQuery
- func (dq *DirsQuery) QueryPdir() *DirsQuery
- func (dq *DirsQuery) QuerySaves() *SavesQuery
- func (dq *DirsQuery) QuerySubdir() *DirsQuery
- func (dq *DirsQuery) Select(fields ...string) *DirsSelect
- func (dq *DirsQuery) Unique(unique bool) *DirsQuery
- func (dq *DirsQuery) Where(ps ...predicate.Dirs) *DirsQuery
- func (dq *DirsQuery) WithOwner(opts ...func(*UsersQuery)) *DirsQuery
- func (dq *DirsQuery) WithPdir(opts ...func(*DirsQuery)) *DirsQuery
- func (dq *DirsQuery) WithSaves(opts ...func(*SavesQuery)) *DirsQuery
- func (dq *DirsQuery) WithSubdir(opts ...func(*DirsQuery)) *DirsQuery
- type DirsSelect
- func (ds *DirsSelect) Aggregate(fns ...AggregateFunc) *DirsSelect
- func (s *DirsSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *DirsSelect) BoolX(ctx context.Context) bool
- func (s *DirsSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *DirsSelect) BoolsX(ctx context.Context) []bool
- func (s *DirsSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *DirsSelect) Float64X(ctx context.Context) float64
- func (s *DirsSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *DirsSelect) Float64sX(ctx context.Context) []float64
- func (s *DirsSelect) Int(ctx context.Context) (_ int, err error)
- func (s *DirsSelect) IntX(ctx context.Context) int
- func (s *DirsSelect) Ints(ctx context.Context) ([]int, error)
- func (s *DirsSelect) IntsX(ctx context.Context) []int
- func (ds *DirsSelect) Scan(ctx context.Context, v any) error
- func (s *DirsSelect) ScanX(ctx context.Context, v any)
- func (s *DirsSelect) String(ctx context.Context) (_ string, err error)
- func (s *DirsSelect) StringX(ctx context.Context) string
- func (s *DirsSelect) Strings(ctx context.Context) ([]string, error)
- func (s *DirsSelect) StringsX(ctx context.Context) []string
- type DirsSlice
- type DirsUpdate
- func (du *DirsUpdate) AddPdir(d ...*Dirs) *DirsUpdate
- func (du *DirsUpdate) AddPdirIDs(ids ...uint64) *DirsUpdate
- func (du *DirsUpdate) AddSafeIDs(ids ...uint64) *DirsUpdate
- func (du *DirsUpdate) AddSaves(s ...*Saves) *DirsUpdate
- func (du *DirsUpdate) AddSubdir(d ...*Dirs) *DirsUpdate
- func (du *DirsUpdate) AddSubdirIDs(ids ...uint64) *DirsUpdate
- func (du *DirsUpdate) ClearOwner() *DirsUpdate
- func (du *DirsUpdate) ClearPdir() *DirsUpdate
- func (du *DirsUpdate) ClearSaves() *DirsUpdate
- func (du *DirsUpdate) ClearSubdir() *DirsUpdate
- func (du *DirsUpdate) Exec(ctx context.Context) error
- func (du *DirsUpdate) ExecX(ctx context.Context)
- func (du *DirsUpdate) Mutation() *DirsMutation
- func (du *DirsUpdate) RemovePdir(d ...*Dirs) *DirsUpdate
- func (du *DirsUpdate) RemovePdirIDs(ids ...uint64) *DirsUpdate
- func (du *DirsUpdate) RemoveSafeIDs(ids ...uint64) *DirsUpdate
- func (du *DirsUpdate) RemoveSaves(s ...*Saves) *DirsUpdate
- func (du *DirsUpdate) RemoveSubdir(d ...*Dirs) *DirsUpdate
- func (du *DirsUpdate) RemoveSubdirIDs(ids ...uint64) *DirsUpdate
- func (du *DirsUpdate) Save(ctx context.Context) (int, error)
- func (du *DirsUpdate) SaveX(ctx context.Context) int
- func (du *DirsUpdate) SetName(s string) *DirsUpdate
- func (du *DirsUpdate) SetNillableName(s *string) *DirsUpdate
- func (du *DirsUpdate) SetNillableOwnerID(id *uint64) *DirsUpdate
- func (du *DirsUpdate) SetOwner(u *Users) *DirsUpdate
- func (du *DirsUpdate) SetOwnerID(id uint64) *DirsUpdate
- func (du *DirsUpdate) SetUpdateTime(t time.Time) *DirsUpdate
- func (du *DirsUpdate) Where(ps ...predicate.Dirs) *DirsUpdate
- type DirsUpdateOne
- func (duo *DirsUpdateOne) AddPdir(d ...*Dirs) *DirsUpdateOne
- func (duo *DirsUpdateOne) AddPdirIDs(ids ...uint64) *DirsUpdateOne
- func (duo *DirsUpdateOne) AddSafeIDs(ids ...uint64) *DirsUpdateOne
- func (duo *DirsUpdateOne) AddSaves(s ...*Saves) *DirsUpdateOne
- func (duo *DirsUpdateOne) AddSubdir(d ...*Dirs) *DirsUpdateOne
- func (duo *DirsUpdateOne) AddSubdirIDs(ids ...uint64) *DirsUpdateOne
- func (duo *DirsUpdateOne) ClearOwner() *DirsUpdateOne
- func (duo *DirsUpdateOne) ClearPdir() *DirsUpdateOne
- func (duo *DirsUpdateOne) ClearSaves() *DirsUpdateOne
- func (duo *DirsUpdateOne) ClearSubdir() *DirsUpdateOne
- func (duo *DirsUpdateOne) Exec(ctx context.Context) error
- func (duo *DirsUpdateOne) ExecX(ctx context.Context)
- func (duo *DirsUpdateOne) Mutation() *DirsMutation
- func (duo *DirsUpdateOne) RemovePdir(d ...*Dirs) *DirsUpdateOne
- func (duo *DirsUpdateOne) RemovePdirIDs(ids ...uint64) *DirsUpdateOne
- func (duo *DirsUpdateOne) RemoveSafeIDs(ids ...uint64) *DirsUpdateOne
- func (duo *DirsUpdateOne) RemoveSaves(s ...*Saves) *DirsUpdateOne
- func (duo *DirsUpdateOne) RemoveSubdir(d ...*Dirs) *DirsUpdateOne
- func (duo *DirsUpdateOne) RemoveSubdirIDs(ids ...uint64) *DirsUpdateOne
- func (duo *DirsUpdateOne) Save(ctx context.Context) (*Dirs, error)
- func (duo *DirsUpdateOne) SaveX(ctx context.Context) *Dirs
- func (duo *DirsUpdateOne) Select(field string, fields ...string) *DirsUpdateOne
- func (duo *DirsUpdateOne) SetName(s string) *DirsUpdateOne
- func (duo *DirsUpdateOne) SetNillableName(s *string) *DirsUpdateOne
- func (duo *DirsUpdateOne) SetNillableOwnerID(id *uint64) *DirsUpdateOne
- func (duo *DirsUpdateOne) SetOwner(u *Users) *DirsUpdateOne
- func (duo *DirsUpdateOne) SetOwnerID(id uint64) *DirsUpdateOne
- func (duo *DirsUpdateOne) SetUpdateTime(t time.Time) *DirsUpdateOne
- func (duo *DirsUpdateOne) Where(ps ...predicate.Dirs) *DirsUpdateOne
- type Files
- type FilesClient
- func (c *FilesClient) Create() *FilesCreate
- func (c *FilesClient) CreateBulk(builders ...*FilesCreate) *FilesCreateBulk
- func (c *FilesClient) Delete() *FilesDelete
- func (c *FilesClient) DeleteOne(f *Files) *FilesDeleteOne
- func (c *FilesClient) DeleteOneID(id uint64) *FilesDeleteOne
- func (c *FilesClient) Get(ctx context.Context, id uint64) (*Files, error)
- func (c *FilesClient) GetX(ctx context.Context, id uint64) *Files
- func (c *FilesClient) Hooks() []Hook
- func (c *FilesClient) Intercept(interceptors ...Interceptor)
- func (c *FilesClient) Interceptors() []Interceptor
- func (c *FilesClient) MapCreateBulk(slice any, setFunc func(*FilesCreate, int)) *FilesCreateBulk
- func (c *FilesClient) Query() *FilesQuery
- func (c *FilesClient) QuerySaves(f *Files) *SavesQuery
- func (c *FilesClient) Update() *FilesUpdate
- func (c *FilesClient) UpdateOne(f *Files) *FilesUpdateOne
- func (c *FilesClient) UpdateOneID(id uint64) *FilesUpdateOne
- func (c *FilesClient) Use(hooks ...Hook)
- type FilesCreate
- func (fc *FilesCreate) AddSafeIDs(ids ...uint64) *FilesCreate
- func (fc *FilesCreate) AddSaves(s ...*Saves) *FilesCreate
- func (fc *FilesCreate) Exec(ctx context.Context) error
- func (fc *FilesCreate) ExecX(ctx context.Context)
- func (fc *FilesCreate) Mutation() *FilesMutation
- func (fc *FilesCreate) Save(ctx context.Context) (*Files, error)
- func (fc *FilesCreate) SaveX(ctx context.Context) *Files
- func (fc *FilesCreate) SetHash(s string) *FilesCreate
- func (fc *FilesCreate) SetID(u uint64) *FilesCreate
- func (fc *FilesCreate) SetName(s string) *FilesCreate
- func (fc *FilesCreate) SetSize(u uint64) *FilesCreate
- type FilesCreateBulk
- type FilesDelete
- type FilesDeleteOne
- type FilesEdges
- type FilesGroupBy
- func (fgb *FilesGroupBy) Aggregate(fns ...AggregateFunc) *FilesGroupBy
- func (s *FilesGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *FilesGroupBy) BoolX(ctx context.Context) bool
- func (s *FilesGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *FilesGroupBy) BoolsX(ctx context.Context) []bool
- func (s *FilesGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *FilesGroupBy) Float64X(ctx context.Context) float64
- func (s *FilesGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *FilesGroupBy) Float64sX(ctx context.Context) []float64
- func (s *FilesGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *FilesGroupBy) IntX(ctx context.Context) int
- func (s *FilesGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *FilesGroupBy) IntsX(ctx context.Context) []int
- func (fgb *FilesGroupBy) Scan(ctx context.Context, v any) error
- func (s *FilesGroupBy) ScanX(ctx context.Context, v any)
- func (s *FilesGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *FilesGroupBy) StringX(ctx context.Context) string
- func (s *FilesGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *FilesGroupBy) StringsX(ctx context.Context) []string
- type FilesMutation
- func (m *FilesMutation) AddField(name string, value ent.Value) error
- func (m *FilesMutation) AddSafeIDs(ids ...uint64)
- func (m *FilesMutation) AddSize(u int64)
- func (m *FilesMutation) AddedEdges() []string
- func (m *FilesMutation) AddedField(name string) (ent.Value, bool)
- func (m *FilesMutation) AddedFields() []string
- func (m *FilesMutation) AddedIDs(name string) []ent.Value
- func (m *FilesMutation) AddedSize() (r int64, exists bool)
- func (m *FilesMutation) ClearEdge(name string) error
- func (m *FilesMutation) ClearField(name string) error
- func (m *FilesMutation) ClearSaves()
- func (m *FilesMutation) ClearedEdges() []string
- func (m *FilesMutation) ClearedFields() []string
- func (m FilesMutation) Client() *Client
- func (m *FilesMutation) EdgeCleared(name string) bool
- func (m *FilesMutation) Field(name string) (ent.Value, bool)
- func (m *FilesMutation) FieldCleared(name string) bool
- func (m *FilesMutation) Fields() []string
- func (m *FilesMutation) Hash() (r string, exists bool)
- func (m *FilesMutation) ID() (id uint64, exists bool)
- func (m *FilesMutation) IDs(ctx context.Context) ([]uint64, error)
- func (m *FilesMutation) Name() (r string, exists bool)
- func (m *FilesMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *FilesMutation) OldHash(ctx context.Context) (v string, err error)
- func (m *FilesMutation) OldName(ctx context.Context) (v string, err error)
- func (m *FilesMutation) OldSize(ctx context.Context) (v uint64, err error)
- func (m *FilesMutation) Op() Op
- func (m *FilesMutation) RemoveSafeIDs(ids ...uint64)
- func (m *FilesMutation) RemovedEdges() []string
- func (m *FilesMutation) RemovedIDs(name string) []ent.Value
- func (m *FilesMutation) RemovedSavesIDs() (ids []uint64)
- func (m *FilesMutation) ResetEdge(name string) error
- func (m *FilesMutation) ResetField(name string) error
- func (m *FilesMutation) ResetHash()
- func (m *FilesMutation) ResetName()
- func (m *FilesMutation) ResetSaves()
- func (m *FilesMutation) ResetSize()
- func (m *FilesMutation) SavesCleared() bool
- func (m *FilesMutation) SavesIDs() (ids []uint64)
- func (m *FilesMutation) SetField(name string, value ent.Value) error
- func (m *FilesMutation) SetHash(s string)
- func (m *FilesMutation) SetID(id uint64)
- func (m *FilesMutation) SetName(s string)
- func (m *FilesMutation) SetOp(op Op)
- func (m *FilesMutation) SetSize(u uint64)
- func (m *FilesMutation) Size() (r uint64, exists bool)
- func (m FilesMutation) Tx() (*Tx, error)
- func (m *FilesMutation) Type() string
- func (m *FilesMutation) Where(ps ...predicate.Files)
- func (m *FilesMutation) WhereP(ps ...func(*sql.Selector))
- type FilesQuery
- func (fq *FilesQuery) Aggregate(fns ...AggregateFunc) *FilesSelect
- func (fq *FilesQuery) All(ctx context.Context) ([]*Files, error)
- func (fq *FilesQuery) AllX(ctx context.Context) []*Files
- func (fq *FilesQuery) Clone() *FilesQuery
- func (fq *FilesQuery) Count(ctx context.Context) (int, error)
- func (fq *FilesQuery) CountX(ctx context.Context) int
- func (fq *FilesQuery) Exist(ctx context.Context) (bool, error)
- func (fq *FilesQuery) ExistX(ctx context.Context) bool
- func (fq *FilesQuery) First(ctx context.Context) (*Files, error)
- func (fq *FilesQuery) FirstID(ctx context.Context) (id uint64, err error)
- func (fq *FilesQuery) FirstIDX(ctx context.Context) uint64
- func (fq *FilesQuery) FirstX(ctx context.Context) *Files
- func (fq *FilesQuery) GroupBy(field string, fields ...string) *FilesGroupBy
- func (fq *FilesQuery) IDs(ctx context.Context) (ids []uint64, err error)
- func (fq *FilesQuery) IDsX(ctx context.Context) []uint64
- func (fq *FilesQuery) Limit(limit int) *FilesQuery
- func (fq *FilesQuery) Offset(offset int) *FilesQuery
- func (fq *FilesQuery) Only(ctx context.Context) (*Files, error)
- func (fq *FilesQuery) OnlyID(ctx context.Context) (id uint64, err error)
- func (fq *FilesQuery) OnlyIDX(ctx context.Context) uint64
- func (fq *FilesQuery) OnlyX(ctx context.Context) *Files
- func (fq *FilesQuery) Order(o ...files.OrderOption) *FilesQuery
- func (fq *FilesQuery) QuerySaves() *SavesQuery
- func (fq *FilesQuery) Select(fields ...string) *FilesSelect
- func (fq *FilesQuery) Unique(unique bool) *FilesQuery
- func (fq *FilesQuery) Where(ps ...predicate.Files) *FilesQuery
- func (fq *FilesQuery) WithSaves(opts ...func(*SavesQuery)) *FilesQuery
- type FilesSelect
- func (fs *FilesSelect) Aggregate(fns ...AggregateFunc) *FilesSelect
- func (s *FilesSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *FilesSelect) BoolX(ctx context.Context) bool
- func (s *FilesSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *FilesSelect) BoolsX(ctx context.Context) []bool
- func (s *FilesSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *FilesSelect) Float64X(ctx context.Context) float64
- func (s *FilesSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *FilesSelect) Float64sX(ctx context.Context) []float64
- func (s *FilesSelect) Int(ctx context.Context) (_ int, err error)
- func (s *FilesSelect) IntX(ctx context.Context) int
- func (s *FilesSelect) Ints(ctx context.Context) ([]int, error)
- func (s *FilesSelect) IntsX(ctx context.Context) []int
- func (fs *FilesSelect) Scan(ctx context.Context, v any) error
- func (s *FilesSelect) ScanX(ctx context.Context, v any)
- func (s *FilesSelect) String(ctx context.Context) (_ string, err error)
- func (s *FilesSelect) StringX(ctx context.Context) string
- func (s *FilesSelect) Strings(ctx context.Context) ([]string, error)
- func (s *FilesSelect) StringsX(ctx context.Context) []string
- type FilesSlice
- type FilesUpdate
- func (fu *FilesUpdate) AddSafeIDs(ids ...uint64) *FilesUpdate
- func (fu *FilesUpdate) AddSaves(s ...*Saves) *FilesUpdate
- func (fu *FilesUpdate) AddSize(u int64) *FilesUpdate
- func (fu *FilesUpdate) ClearSaves() *FilesUpdate
- func (fu *FilesUpdate) Exec(ctx context.Context) error
- func (fu *FilesUpdate) ExecX(ctx context.Context)
- func (fu *FilesUpdate) Mutation() *FilesMutation
- func (fu *FilesUpdate) RemoveSafeIDs(ids ...uint64) *FilesUpdate
- func (fu *FilesUpdate) RemoveSaves(s ...*Saves) *FilesUpdate
- func (fu *FilesUpdate) Save(ctx context.Context) (int, error)
- func (fu *FilesUpdate) SaveX(ctx context.Context) int
- func (fu *FilesUpdate) SetHash(s string) *FilesUpdate
- func (fu *FilesUpdate) SetName(s string) *FilesUpdate
- func (fu *FilesUpdate) SetNillableHash(s *string) *FilesUpdate
- func (fu *FilesUpdate) SetNillableName(s *string) *FilesUpdate
- func (fu *FilesUpdate) SetNillableSize(u *uint64) *FilesUpdate
- func (fu *FilesUpdate) SetSize(u uint64) *FilesUpdate
- func (fu *FilesUpdate) Where(ps ...predicate.Files) *FilesUpdate
- type FilesUpdateOne
- func (fuo *FilesUpdateOne) AddSafeIDs(ids ...uint64) *FilesUpdateOne
- func (fuo *FilesUpdateOne) AddSaves(s ...*Saves) *FilesUpdateOne
- func (fuo *FilesUpdateOne) AddSize(u int64) *FilesUpdateOne
- func (fuo *FilesUpdateOne) ClearSaves() *FilesUpdateOne
- func (fuo *FilesUpdateOne) Exec(ctx context.Context) error
- func (fuo *FilesUpdateOne) ExecX(ctx context.Context)
- func (fuo *FilesUpdateOne) Mutation() *FilesMutation
- func (fuo *FilesUpdateOne) RemoveSafeIDs(ids ...uint64) *FilesUpdateOne
- func (fuo *FilesUpdateOne) RemoveSaves(s ...*Saves) *FilesUpdateOne
- func (fuo *FilesUpdateOne) Save(ctx context.Context) (*Files, error)
- func (fuo *FilesUpdateOne) SaveX(ctx context.Context) *Files
- func (fuo *FilesUpdateOne) Select(field string, fields ...string) *FilesUpdateOne
- func (fuo *FilesUpdateOne) SetHash(s string) *FilesUpdateOne
- func (fuo *FilesUpdateOne) SetName(s string) *FilesUpdateOne
- func (fuo *FilesUpdateOne) SetNillableHash(s *string) *FilesUpdateOne
- func (fuo *FilesUpdateOne) SetNillableName(s *string) *FilesUpdateOne
- func (fuo *FilesUpdateOne) SetNillableSize(u *uint64) *FilesUpdateOne
- func (fuo *FilesUpdateOne) SetSize(u uint64) *FilesUpdateOne
- func (fuo *FilesUpdateOne) Where(ps ...predicate.Files) *FilesUpdateOne
- 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 Saves
- type SavesClient
- func (c *SavesClient) Create() *SavesCreate
- func (c *SavesClient) CreateBulk(builders ...*SavesCreate) *SavesCreateBulk
- func (c *SavesClient) Delete() *SavesDelete
- func (c *SavesClient) DeleteOne(s *Saves) *SavesDeleteOne
- func (c *SavesClient) DeleteOneID(id uint64) *SavesDeleteOne
- func (c *SavesClient) Get(ctx context.Context, id uint64) (*Saves, error)
- func (c *SavesClient) GetX(ctx context.Context, id uint64) *Saves
- func (c *SavesClient) Hooks() []Hook
- func (c *SavesClient) Intercept(interceptors ...Interceptor)
- func (c *SavesClient) Interceptors() []Interceptor
- func (c *SavesClient) MapCreateBulk(slice any, setFunc func(*SavesCreate, int)) *SavesCreateBulk
- func (c *SavesClient) Query() *SavesQuery
- func (c *SavesClient) QueryDir(s *Saves) *DirsQuery
- func (c *SavesClient) QueryFile(s *Saves) *FilesQuery
- func (c *SavesClient) QueryOwner(s *Saves) *UsersQuery
- func (c *SavesClient) Update() *SavesUpdate
- func (c *SavesClient) UpdateOne(s *Saves) *SavesUpdateOne
- func (c *SavesClient) UpdateOneID(id uint64) *SavesUpdateOne
- func (c *SavesClient) Use(hooks ...Hook)
- type SavesCreate
- func (sc *SavesCreate) AddDir(d ...*Dirs) *SavesCreate
- func (sc *SavesCreate) AddDirIDs(ids ...uint64) *SavesCreate
- func (sc *SavesCreate) Exec(ctx context.Context) error
- func (sc *SavesCreate) ExecX(ctx context.Context)
- func (sc *SavesCreate) Mutation() *SavesMutation
- func (sc *SavesCreate) Save(ctx context.Context) (*Saves, error)
- func (sc *SavesCreate) SaveX(ctx context.Context) *Saves
- func (sc *SavesCreate) SetCaption(s string) *SavesCreate
- func (sc *SavesCreate) SetCreateTime(t time.Time) *SavesCreate
- func (sc *SavesCreate) SetFile(f *Files) *SavesCreate
- func (sc *SavesCreate) SetFileID(id uint64) *SavesCreate
- func (sc *SavesCreate) SetID(u uint64) *SavesCreate
- func (sc *SavesCreate) SetName(s string) *SavesCreate
- func (sc *SavesCreate) SetNillableCaption(s *string) *SavesCreate
- func (sc *SavesCreate) SetNillableCreateTime(t *time.Time) *SavesCreate
- func (sc *SavesCreate) SetNillableFileID(id *uint64) *SavesCreate
- func (sc *SavesCreate) SetNillableOwnerID(id *uint64) *SavesCreate
- func (sc *SavesCreate) SetNillableUpdateTime(t *time.Time) *SavesCreate
- func (sc *SavesCreate) SetOwner(u *Users) *SavesCreate
- func (sc *SavesCreate) SetOwnerID(id uint64) *SavesCreate
- func (sc *SavesCreate) SetUpdateTime(t time.Time) *SavesCreate
- type SavesCreateBulk
- type SavesDelete
- type SavesDeleteOne
- type SavesEdges
- type SavesGroupBy
- func (sgb *SavesGroupBy) Aggregate(fns ...AggregateFunc) *SavesGroupBy
- func (s *SavesGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *SavesGroupBy) BoolX(ctx context.Context) bool
- func (s *SavesGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *SavesGroupBy) BoolsX(ctx context.Context) []bool
- func (s *SavesGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *SavesGroupBy) Float64X(ctx context.Context) float64
- func (s *SavesGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *SavesGroupBy) Float64sX(ctx context.Context) []float64
- func (s *SavesGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *SavesGroupBy) IntX(ctx context.Context) int
- func (s *SavesGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *SavesGroupBy) IntsX(ctx context.Context) []int
- func (sgb *SavesGroupBy) Scan(ctx context.Context, v any) error
- func (s *SavesGroupBy) ScanX(ctx context.Context, v any)
- func (s *SavesGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *SavesGroupBy) StringX(ctx context.Context) string
- func (s *SavesGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *SavesGroupBy) StringsX(ctx context.Context) []string
- type SavesMutation
- func (m *SavesMutation) AddDirIDs(ids ...uint64)
- func (m *SavesMutation) AddField(name string, value ent.Value) error
- func (m *SavesMutation) AddedEdges() []string
- func (m *SavesMutation) AddedField(name string) (ent.Value, bool)
- func (m *SavesMutation) AddedFields() []string
- func (m *SavesMutation) AddedIDs(name string) []ent.Value
- func (m *SavesMutation) Caption() (r string, exists bool)
- func (m *SavesMutation) CaptionCleared() bool
- func (m *SavesMutation) ClearCaption()
- func (m *SavesMutation) ClearDir()
- func (m *SavesMutation) ClearEdge(name string) error
- func (m *SavesMutation) ClearField(name string) error
- func (m *SavesMutation) ClearFile()
- func (m *SavesMutation) ClearOwner()
- func (m *SavesMutation) ClearedEdges() []string
- func (m *SavesMutation) ClearedFields() []string
- func (m SavesMutation) Client() *Client
- func (m *SavesMutation) CreateTime() (r time.Time, exists bool)
- func (m *SavesMutation) DirCleared() bool
- func (m *SavesMutation) DirIDs() (ids []uint64)
- func (m *SavesMutation) EdgeCleared(name string) bool
- func (m *SavesMutation) Field(name string) (ent.Value, bool)
- func (m *SavesMutation) FieldCleared(name string) bool
- func (m *SavesMutation) Fields() []string
- func (m *SavesMutation) FileCleared() bool
- func (m *SavesMutation) FileID() (id uint64, exists bool)
- func (m *SavesMutation) FileIDs() (ids []uint64)
- func (m *SavesMutation) ID() (id uint64, exists bool)
- func (m *SavesMutation) IDs(ctx context.Context) ([]uint64, error)
- func (m *SavesMutation) Name() (r string, exists bool)
- func (m *SavesMutation) OldCaption(ctx context.Context) (v string, err error)
- func (m *SavesMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *SavesMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *SavesMutation) OldName(ctx context.Context) (v string, err error)
- func (m *SavesMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *SavesMutation) Op() Op
- func (m *SavesMutation) OwnerCleared() bool
- func (m *SavesMutation) OwnerID() (id uint64, exists bool)
- func (m *SavesMutation) OwnerIDs() (ids []uint64)
- func (m *SavesMutation) RemoveDirIDs(ids ...uint64)
- func (m *SavesMutation) RemovedDirIDs() (ids []uint64)
- func (m *SavesMutation) RemovedEdges() []string
- func (m *SavesMutation) RemovedIDs(name string) []ent.Value
- func (m *SavesMutation) ResetCaption()
- func (m *SavesMutation) ResetCreateTime()
- func (m *SavesMutation) ResetDir()
- func (m *SavesMutation) ResetEdge(name string) error
- func (m *SavesMutation) ResetField(name string) error
- func (m *SavesMutation) ResetFile()
- func (m *SavesMutation) ResetName()
- func (m *SavesMutation) ResetOwner()
- func (m *SavesMutation) ResetUpdateTime()
- func (m *SavesMutation) SetCaption(s string)
- func (m *SavesMutation) SetCreateTime(t time.Time)
- func (m *SavesMutation) SetField(name string, value ent.Value) error
- func (m *SavesMutation) SetFileID(id uint64)
- func (m *SavesMutation) SetID(id uint64)
- func (m *SavesMutation) SetName(s string)
- func (m *SavesMutation) SetOp(op Op)
- func (m *SavesMutation) SetOwnerID(id uint64)
- func (m *SavesMutation) SetUpdateTime(t time.Time)
- func (m SavesMutation) Tx() (*Tx, error)
- func (m *SavesMutation) Type() string
- func (m *SavesMutation) UpdateTime() (r time.Time, exists bool)
- func (m *SavesMutation) Where(ps ...predicate.Saves)
- func (m *SavesMutation) WhereP(ps ...func(*sql.Selector))
- type SavesQuery
- func (sq *SavesQuery) Aggregate(fns ...AggregateFunc) *SavesSelect
- func (sq *SavesQuery) All(ctx context.Context) ([]*Saves, error)
- func (sq *SavesQuery) AllX(ctx context.Context) []*Saves
- func (sq *SavesQuery) Clone() *SavesQuery
- func (sq *SavesQuery) Count(ctx context.Context) (int, error)
- func (sq *SavesQuery) CountX(ctx context.Context) int
- func (sq *SavesQuery) Exist(ctx context.Context) (bool, error)
- func (sq *SavesQuery) ExistX(ctx context.Context) bool
- func (sq *SavesQuery) First(ctx context.Context) (*Saves, error)
- func (sq *SavesQuery) FirstID(ctx context.Context) (id uint64, err error)
- func (sq *SavesQuery) FirstIDX(ctx context.Context) uint64
- func (sq *SavesQuery) FirstX(ctx context.Context) *Saves
- func (sq *SavesQuery) GroupBy(field string, fields ...string) *SavesGroupBy
- func (sq *SavesQuery) IDs(ctx context.Context) (ids []uint64, err error)
- func (sq *SavesQuery) IDsX(ctx context.Context) []uint64
- func (sq *SavesQuery) Limit(limit int) *SavesQuery
- func (sq *SavesQuery) Offset(offset int) *SavesQuery
- func (sq *SavesQuery) Only(ctx context.Context) (*Saves, error)
- func (sq *SavesQuery) OnlyID(ctx context.Context) (id uint64, err error)
- func (sq *SavesQuery) OnlyIDX(ctx context.Context) uint64
- func (sq *SavesQuery) OnlyX(ctx context.Context) *Saves
- func (sq *SavesQuery) Order(o ...saves.OrderOption) *SavesQuery
- func (sq *SavesQuery) QueryDir() *DirsQuery
- func (sq *SavesQuery) QueryFile() *FilesQuery
- func (sq *SavesQuery) QueryOwner() *UsersQuery
- func (sq *SavesQuery) Select(fields ...string) *SavesSelect
- func (sq *SavesQuery) Unique(unique bool) *SavesQuery
- func (sq *SavesQuery) Where(ps ...predicate.Saves) *SavesQuery
- func (sq *SavesQuery) WithDir(opts ...func(*DirsQuery)) *SavesQuery
- func (sq *SavesQuery) WithFile(opts ...func(*FilesQuery)) *SavesQuery
- func (sq *SavesQuery) WithOwner(opts ...func(*UsersQuery)) *SavesQuery
- type SavesSelect
- func (ss *SavesSelect) Aggregate(fns ...AggregateFunc) *SavesSelect
- func (s *SavesSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *SavesSelect) BoolX(ctx context.Context) bool
- func (s *SavesSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *SavesSelect) BoolsX(ctx context.Context) []bool
- func (s *SavesSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *SavesSelect) Float64X(ctx context.Context) float64
- func (s *SavesSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *SavesSelect) Float64sX(ctx context.Context) []float64
- func (s *SavesSelect) Int(ctx context.Context) (_ int, err error)
- func (s *SavesSelect) IntX(ctx context.Context) int
- func (s *SavesSelect) Ints(ctx context.Context) ([]int, error)
- func (s *SavesSelect) IntsX(ctx context.Context) []int
- func (ss *SavesSelect) Scan(ctx context.Context, v any) error
- func (s *SavesSelect) ScanX(ctx context.Context, v any)
- func (s *SavesSelect) String(ctx context.Context) (_ string, err error)
- func (s *SavesSelect) StringX(ctx context.Context) string
- func (s *SavesSelect) Strings(ctx context.Context) ([]string, error)
- func (s *SavesSelect) StringsX(ctx context.Context) []string
- type SavesSlice
- type SavesUpdate
- func (su *SavesUpdate) AddDir(d ...*Dirs) *SavesUpdate
- func (su *SavesUpdate) AddDirIDs(ids ...uint64) *SavesUpdate
- func (su *SavesUpdate) ClearCaption() *SavesUpdate
- func (su *SavesUpdate) ClearDir() *SavesUpdate
- func (su *SavesUpdate) ClearFile() *SavesUpdate
- func (su *SavesUpdate) ClearOwner() *SavesUpdate
- func (su *SavesUpdate) Exec(ctx context.Context) error
- func (su *SavesUpdate) ExecX(ctx context.Context)
- func (su *SavesUpdate) Mutation() *SavesMutation
- func (su *SavesUpdate) RemoveDir(d ...*Dirs) *SavesUpdate
- func (su *SavesUpdate) RemoveDirIDs(ids ...uint64) *SavesUpdate
- func (su *SavesUpdate) Save(ctx context.Context) (int, error)
- func (su *SavesUpdate) SaveX(ctx context.Context) int
- func (su *SavesUpdate) SetCaption(s string) *SavesUpdate
- func (su *SavesUpdate) SetFile(f *Files) *SavesUpdate
- func (su *SavesUpdate) SetFileID(id uint64) *SavesUpdate
- func (su *SavesUpdate) SetName(s string) *SavesUpdate
- func (su *SavesUpdate) SetNillableCaption(s *string) *SavesUpdate
- func (su *SavesUpdate) SetNillableFileID(id *uint64) *SavesUpdate
- func (su *SavesUpdate) SetNillableName(s *string) *SavesUpdate
- func (su *SavesUpdate) SetNillableOwnerID(id *uint64) *SavesUpdate
- func (su *SavesUpdate) SetOwner(u *Users) *SavesUpdate
- func (su *SavesUpdate) SetOwnerID(id uint64) *SavesUpdate
- func (su *SavesUpdate) SetUpdateTime(t time.Time) *SavesUpdate
- func (su *SavesUpdate) Where(ps ...predicate.Saves) *SavesUpdate
- type SavesUpdateOne
- func (suo *SavesUpdateOne) AddDir(d ...*Dirs) *SavesUpdateOne
- func (suo *SavesUpdateOne) AddDirIDs(ids ...uint64) *SavesUpdateOne
- func (suo *SavesUpdateOne) ClearCaption() *SavesUpdateOne
- func (suo *SavesUpdateOne) ClearDir() *SavesUpdateOne
- func (suo *SavesUpdateOne) ClearFile() *SavesUpdateOne
- func (suo *SavesUpdateOne) ClearOwner() *SavesUpdateOne
- func (suo *SavesUpdateOne) Exec(ctx context.Context) error
- func (suo *SavesUpdateOne) ExecX(ctx context.Context)
- func (suo *SavesUpdateOne) Mutation() *SavesMutation
- func (suo *SavesUpdateOne) RemoveDir(d ...*Dirs) *SavesUpdateOne
- func (suo *SavesUpdateOne) RemoveDirIDs(ids ...uint64) *SavesUpdateOne
- func (suo *SavesUpdateOne) Save(ctx context.Context) (*Saves, error)
- func (suo *SavesUpdateOne) SaveX(ctx context.Context) *Saves
- func (suo *SavesUpdateOne) Select(field string, fields ...string) *SavesUpdateOne
- func (suo *SavesUpdateOne) SetCaption(s string) *SavesUpdateOne
- func (suo *SavesUpdateOne) SetFile(f *Files) *SavesUpdateOne
- func (suo *SavesUpdateOne) SetFileID(id uint64) *SavesUpdateOne
- func (suo *SavesUpdateOne) SetName(s string) *SavesUpdateOne
- func (suo *SavesUpdateOne) SetNillableCaption(s *string) *SavesUpdateOne
- func (suo *SavesUpdateOne) SetNillableFileID(id *uint64) *SavesUpdateOne
- func (suo *SavesUpdateOne) SetNillableName(s *string) *SavesUpdateOne
- func (suo *SavesUpdateOne) SetNillableOwnerID(id *uint64) *SavesUpdateOne
- func (suo *SavesUpdateOne) SetOwner(u *Users) *SavesUpdateOne
- func (suo *SavesUpdateOne) SetOwnerID(id uint64) *SavesUpdateOne
- func (suo *SavesUpdateOne) SetUpdateTime(t time.Time) *SavesUpdateOne
- func (suo *SavesUpdateOne) Where(ps ...predicate.Saves) *SavesUpdateOne
- type TraverseFunc
- type Traverser
- type Tx
- type Users
- type UsersClient
- func (c *UsersClient) Create() *UsersCreate
- func (c *UsersClient) CreateBulk(builders ...*UsersCreate) *UsersCreateBulk
- func (c *UsersClient) Delete() *UsersDelete
- func (c *UsersClient) DeleteOne(u *Users) *UsersDeleteOne
- func (c *UsersClient) DeleteOneID(id uint64) *UsersDeleteOne
- func (c *UsersClient) Get(ctx context.Context, id uint64) (*Users, error)
- func (c *UsersClient) GetX(ctx context.Context, id uint64) *Users
- func (c *UsersClient) Hooks() []Hook
- func (c *UsersClient) Intercept(interceptors ...Interceptor)
- func (c *UsersClient) Interceptors() []Interceptor
- func (c *UsersClient) MapCreateBulk(slice any, setFunc func(*UsersCreate, int)) *UsersCreateBulk
- func (c *UsersClient) Query() *UsersQuery
- func (c *UsersClient) QueryDevices(u *Users) *DevicesQuery
- func (c *UsersClient) QueryDirs(u *Users) *DirsQuery
- func (c *UsersClient) QuerySaves(u *Users) *SavesQuery
- func (c *UsersClient) Update() *UsersUpdate
- func (c *UsersClient) UpdateOne(u *Users) *UsersUpdateOne
- func (c *UsersClient) UpdateOneID(id uint64) *UsersUpdateOne
- func (c *UsersClient) Use(hooks ...Hook)
- type UsersCreate
- func (uc *UsersCreate) AddDeviceIDs(ids ...uint64) *UsersCreate
- func (uc *UsersCreate) AddDevices(d ...*Devices) *UsersCreate
- func (uc *UsersCreate) AddDirIDs(ids ...uint64) *UsersCreate
- func (uc *UsersCreate) AddDirs(d ...*Dirs) *UsersCreate
- func (uc *UsersCreate) AddSafeIDs(ids ...uint64) *UsersCreate
- func (uc *UsersCreate) AddSaves(s ...*Saves) *UsersCreate
- func (uc *UsersCreate) Exec(ctx context.Context) error
- func (uc *UsersCreate) ExecX(ctx context.Context)
- func (uc *UsersCreate) Mutation() *UsersMutation
- func (uc *UsersCreate) Save(ctx context.Context) (*Users, error)
- func (uc *UsersCreate) SaveX(ctx context.Context) *Users
- func (uc *UsersCreate) SetAvatar(s string) *UsersCreate
- func (uc *UsersCreate) SetBio(s string) *UsersCreate
- func (uc *UsersCreate) SetCreateTime(t time.Time) *UsersCreate
- func (uc *UsersCreate) SetEmail(s string) *UsersCreate
- func (uc *UsersCreate) SetID(u uint64) *UsersCreate
- func (uc *UsersCreate) SetName(s string) *UsersCreate
- func (uc *UsersCreate) SetNillableAvatar(s *string) *UsersCreate
- func (uc *UsersCreate) SetNillableBio(s *string) *UsersCreate
- func (uc *UsersCreate) SetNillableCreateTime(t *time.Time) *UsersCreate
- func (uc *UsersCreate) SetNillableEmail(s *string) *UsersCreate
- func (uc *UsersCreate) SetNillableName(s *string) *UsersCreate
- func (uc *UsersCreate) SetNillablePassword(s *string) *UsersCreate
- func (uc *UsersCreate) SetNillableUpdateTime(t *time.Time) *UsersCreate
- func (uc *UsersCreate) SetPassword(s string) *UsersCreate
- func (uc *UsersCreate) SetUpdateTime(t time.Time) *UsersCreate
- func (uc *UsersCreate) SetUsername(s string) *UsersCreate
- type UsersCreateBulk
- type UsersDelete
- type UsersDeleteOne
- type UsersEdges
- type UsersGroupBy
- func (ugb *UsersGroupBy) Aggregate(fns ...AggregateFunc) *UsersGroupBy
- func (s *UsersGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UsersGroupBy) BoolX(ctx context.Context) bool
- func (s *UsersGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UsersGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UsersGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UsersGroupBy) Float64X(ctx context.Context) float64
- func (s *UsersGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UsersGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UsersGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UsersGroupBy) IntX(ctx context.Context) int
- func (s *UsersGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UsersGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UsersGroupBy) Scan(ctx context.Context, v any) error
- func (s *UsersGroupBy) ScanX(ctx context.Context, v any)
- func (s *UsersGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UsersGroupBy) StringX(ctx context.Context) string
- func (s *UsersGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UsersGroupBy) StringsX(ctx context.Context) []string
- type UsersMutation
- func (m *UsersMutation) AddDeviceIDs(ids ...uint64)
- func (m *UsersMutation) AddDirIDs(ids ...uint64)
- func (m *UsersMutation) AddField(name string, value ent.Value) error
- func (m *UsersMutation) AddSafeIDs(ids ...uint64)
- func (m *UsersMutation) AddedEdges() []string
- func (m *UsersMutation) AddedField(name string) (ent.Value, bool)
- func (m *UsersMutation) AddedFields() []string
- func (m *UsersMutation) AddedIDs(name string) []ent.Value
- func (m *UsersMutation) Avatar() (r string, exists bool)
- func (m *UsersMutation) AvatarCleared() bool
- func (m *UsersMutation) Bio() (r string, exists bool)
- func (m *UsersMutation) BioCleared() bool
- func (m *UsersMutation) ClearAvatar()
- func (m *UsersMutation) ClearBio()
- func (m *UsersMutation) ClearDevices()
- func (m *UsersMutation) ClearDirs()
- func (m *UsersMutation) ClearEdge(name string) error
- func (m *UsersMutation) ClearEmail()
- func (m *UsersMutation) ClearField(name string) error
- func (m *UsersMutation) ClearName()
- func (m *UsersMutation) ClearPassword()
- func (m *UsersMutation) ClearSaves()
- func (m *UsersMutation) ClearedEdges() []string
- func (m *UsersMutation) ClearedFields() []string
- func (m UsersMutation) Client() *Client
- func (m *UsersMutation) CreateTime() (r time.Time, exists bool)
- func (m *UsersMutation) DevicesCleared() bool
- func (m *UsersMutation) DevicesIDs() (ids []uint64)
- func (m *UsersMutation) DirsCleared() bool
- func (m *UsersMutation) DirsIDs() (ids []uint64)
- func (m *UsersMutation) EdgeCleared(name string) bool
- func (m *UsersMutation) Email() (r string, exists bool)
- func (m *UsersMutation) EmailCleared() bool
- func (m *UsersMutation) Field(name string) (ent.Value, bool)
- func (m *UsersMutation) FieldCleared(name string) bool
- func (m *UsersMutation) Fields() []string
- func (m *UsersMutation) ID() (id uint64, exists bool)
- func (m *UsersMutation) IDs(ctx context.Context) ([]uint64, error)
- func (m *UsersMutation) Name() (r string, exists bool)
- func (m *UsersMutation) NameCleared() bool
- func (m *UsersMutation) OldAvatar(ctx context.Context) (v string, err error)
- func (m *UsersMutation) OldBio(ctx context.Context) (v string, err error)
- func (m *UsersMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *UsersMutation) OldEmail(ctx context.Context) (v string, err error)
- func (m *UsersMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UsersMutation) OldName(ctx context.Context) (v string, err error)
- func (m *UsersMutation) OldPassword(ctx context.Context) (v string, err error)
- func (m *UsersMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *UsersMutation) OldUsername(ctx context.Context) (v string, err error)
- func (m *UsersMutation) Op() Op
- func (m *UsersMutation) Password() (r string, exists bool)
- func (m *UsersMutation) PasswordCleared() bool
- func (m *UsersMutation) RemoveDeviceIDs(ids ...uint64)
- func (m *UsersMutation) RemoveDirIDs(ids ...uint64)
- func (m *UsersMutation) RemoveSafeIDs(ids ...uint64)
- func (m *UsersMutation) RemovedDevicesIDs() (ids []uint64)
- func (m *UsersMutation) RemovedDirsIDs() (ids []uint64)
- func (m *UsersMutation) RemovedEdges() []string
- func (m *UsersMutation) RemovedIDs(name string) []ent.Value
- func (m *UsersMutation) RemovedSavesIDs() (ids []uint64)
- func (m *UsersMutation) ResetAvatar()
- func (m *UsersMutation) ResetBio()
- func (m *UsersMutation) ResetCreateTime()
- func (m *UsersMutation) ResetDevices()
- func (m *UsersMutation) ResetDirs()
- func (m *UsersMutation) ResetEdge(name string) error
- func (m *UsersMutation) ResetEmail()
- func (m *UsersMutation) ResetField(name string) error
- func (m *UsersMutation) ResetName()
- func (m *UsersMutation) ResetPassword()
- func (m *UsersMutation) ResetSaves()
- func (m *UsersMutation) ResetUpdateTime()
- func (m *UsersMutation) ResetUsername()
- func (m *UsersMutation) SavesCleared() bool
- func (m *UsersMutation) SavesIDs() (ids []uint64)
- func (m *UsersMutation) SetAvatar(s string)
- func (m *UsersMutation) SetBio(s string)
- func (m *UsersMutation) SetCreateTime(t time.Time)
- func (m *UsersMutation) SetEmail(s string)
- func (m *UsersMutation) SetField(name string, value ent.Value) error
- func (m *UsersMutation) SetID(id uint64)
- func (m *UsersMutation) SetName(s string)
- func (m *UsersMutation) SetOp(op Op)
- func (m *UsersMutation) SetPassword(s string)
- func (m *UsersMutation) SetUpdateTime(t time.Time)
- func (m *UsersMutation) SetUsername(s string)
- func (m UsersMutation) Tx() (*Tx, error)
- func (m *UsersMutation) Type() string
- func (m *UsersMutation) UpdateTime() (r time.Time, exists bool)
- func (m *UsersMutation) Username() (r string, exists bool)
- func (m *UsersMutation) Where(ps ...predicate.Users)
- func (m *UsersMutation) WhereP(ps ...func(*sql.Selector))
- type UsersQuery
- func (uq *UsersQuery) Aggregate(fns ...AggregateFunc) *UsersSelect
- func (uq *UsersQuery) All(ctx context.Context) ([]*Users, error)
- func (uq *UsersQuery) AllX(ctx context.Context) []*Users
- func (uq *UsersQuery) Clone() *UsersQuery
- func (uq *UsersQuery) Count(ctx context.Context) (int, error)
- func (uq *UsersQuery) CountX(ctx context.Context) int
- func (uq *UsersQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UsersQuery) ExistX(ctx context.Context) bool
- func (uq *UsersQuery) First(ctx context.Context) (*Users, error)
- func (uq *UsersQuery) FirstID(ctx context.Context) (id uint64, err error)
- func (uq *UsersQuery) FirstIDX(ctx context.Context) uint64
- func (uq *UsersQuery) FirstX(ctx context.Context) *Users
- func (uq *UsersQuery) GroupBy(field string, fields ...string) *UsersGroupBy
- func (uq *UsersQuery) IDs(ctx context.Context) (ids []uint64, err error)
- func (uq *UsersQuery) IDsX(ctx context.Context) []uint64
- func (uq *UsersQuery) Limit(limit int) *UsersQuery
- func (uq *UsersQuery) Offset(offset int) *UsersQuery
- func (uq *UsersQuery) Only(ctx context.Context) (*Users, error)
- func (uq *UsersQuery) OnlyID(ctx context.Context) (id uint64, err error)
- func (uq *UsersQuery) OnlyIDX(ctx context.Context) uint64
- func (uq *UsersQuery) OnlyX(ctx context.Context) *Users
- func (uq *UsersQuery) Order(o ...users.OrderOption) *UsersQuery
- func (uq *UsersQuery) QueryDevices() *DevicesQuery
- func (uq *UsersQuery) QueryDirs() *DirsQuery
- func (uq *UsersQuery) QuerySaves() *SavesQuery
- func (uq *UsersQuery) Select(fields ...string) *UsersSelect
- func (uq *UsersQuery) Unique(unique bool) *UsersQuery
- func (uq *UsersQuery) Where(ps ...predicate.Users) *UsersQuery
- func (uq *UsersQuery) WithDevices(opts ...func(*DevicesQuery)) *UsersQuery
- func (uq *UsersQuery) WithDirs(opts ...func(*DirsQuery)) *UsersQuery
- func (uq *UsersQuery) WithSaves(opts ...func(*SavesQuery)) *UsersQuery
- type UsersSelect
- func (us *UsersSelect) Aggregate(fns ...AggregateFunc) *UsersSelect
- func (s *UsersSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UsersSelect) BoolX(ctx context.Context) bool
- func (s *UsersSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UsersSelect) BoolsX(ctx context.Context) []bool
- func (s *UsersSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UsersSelect) Float64X(ctx context.Context) float64
- func (s *UsersSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UsersSelect) Float64sX(ctx context.Context) []float64
- func (s *UsersSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UsersSelect) IntX(ctx context.Context) int
- func (s *UsersSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UsersSelect) IntsX(ctx context.Context) []int
- func (us *UsersSelect) Scan(ctx context.Context, v any) error
- func (s *UsersSelect) ScanX(ctx context.Context, v any)
- func (s *UsersSelect) String(ctx context.Context) (_ string, err error)
- func (s *UsersSelect) StringX(ctx context.Context) string
- func (s *UsersSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UsersSelect) StringsX(ctx context.Context) []string
- type UsersSlice
- type UsersUpdate
- func (uu *UsersUpdate) AddDeviceIDs(ids ...uint64) *UsersUpdate
- func (uu *UsersUpdate) AddDevices(d ...*Devices) *UsersUpdate
- func (uu *UsersUpdate) AddDirIDs(ids ...uint64) *UsersUpdate
- func (uu *UsersUpdate) AddDirs(d ...*Dirs) *UsersUpdate
- func (uu *UsersUpdate) AddSafeIDs(ids ...uint64) *UsersUpdate
- func (uu *UsersUpdate) AddSaves(s ...*Saves) *UsersUpdate
- func (uu *UsersUpdate) ClearAvatar() *UsersUpdate
- func (uu *UsersUpdate) ClearBio() *UsersUpdate
- func (uu *UsersUpdate) ClearDevices() *UsersUpdate
- func (uu *UsersUpdate) ClearDirs() *UsersUpdate
- func (uu *UsersUpdate) ClearEmail() *UsersUpdate
- func (uu *UsersUpdate) ClearName() *UsersUpdate
- func (uu *UsersUpdate) ClearPassword() *UsersUpdate
- func (uu *UsersUpdate) ClearSaves() *UsersUpdate
- func (uu *UsersUpdate) Exec(ctx context.Context) error
- func (uu *UsersUpdate) ExecX(ctx context.Context)
- func (uu *UsersUpdate) Mutation() *UsersMutation
- func (uu *UsersUpdate) RemoveDeviceIDs(ids ...uint64) *UsersUpdate
- func (uu *UsersUpdate) RemoveDevices(d ...*Devices) *UsersUpdate
- func (uu *UsersUpdate) RemoveDirIDs(ids ...uint64) *UsersUpdate
- func (uu *UsersUpdate) RemoveDirs(d ...*Dirs) *UsersUpdate
- func (uu *UsersUpdate) RemoveSafeIDs(ids ...uint64) *UsersUpdate
- func (uu *UsersUpdate) RemoveSaves(s ...*Saves) *UsersUpdate
- func (uu *UsersUpdate) Save(ctx context.Context) (int, error)
- func (uu *UsersUpdate) SaveX(ctx context.Context) int
- func (uu *UsersUpdate) SetAvatar(s string) *UsersUpdate
- func (uu *UsersUpdate) SetBio(s string) *UsersUpdate
- func (uu *UsersUpdate) SetEmail(s string) *UsersUpdate
- func (uu *UsersUpdate) SetName(s string) *UsersUpdate
- func (uu *UsersUpdate) SetNillableAvatar(s *string) *UsersUpdate
- func (uu *UsersUpdate) SetNillableBio(s *string) *UsersUpdate
- func (uu *UsersUpdate) SetNillableEmail(s *string) *UsersUpdate
- func (uu *UsersUpdate) SetNillableName(s *string) *UsersUpdate
- func (uu *UsersUpdate) SetNillablePassword(s *string) *UsersUpdate
- func (uu *UsersUpdate) SetNillableUsername(s *string) *UsersUpdate
- func (uu *UsersUpdate) SetPassword(s string) *UsersUpdate
- func (uu *UsersUpdate) SetUpdateTime(t time.Time) *UsersUpdate
- func (uu *UsersUpdate) SetUsername(s string) *UsersUpdate
- func (uu *UsersUpdate) Where(ps ...predicate.Users) *UsersUpdate
- type UsersUpdateOne
- func (uuo *UsersUpdateOne) AddDeviceIDs(ids ...uint64) *UsersUpdateOne
- func (uuo *UsersUpdateOne) AddDevices(d ...*Devices) *UsersUpdateOne
- func (uuo *UsersUpdateOne) AddDirIDs(ids ...uint64) *UsersUpdateOne
- func (uuo *UsersUpdateOne) AddDirs(d ...*Dirs) *UsersUpdateOne
- func (uuo *UsersUpdateOne) AddSafeIDs(ids ...uint64) *UsersUpdateOne
- func (uuo *UsersUpdateOne) AddSaves(s ...*Saves) *UsersUpdateOne
- func (uuo *UsersUpdateOne) ClearAvatar() *UsersUpdateOne
- func (uuo *UsersUpdateOne) ClearBio() *UsersUpdateOne
- func (uuo *UsersUpdateOne) ClearDevices() *UsersUpdateOne
- func (uuo *UsersUpdateOne) ClearDirs() *UsersUpdateOne
- func (uuo *UsersUpdateOne) ClearEmail() *UsersUpdateOne
- func (uuo *UsersUpdateOne) ClearName() *UsersUpdateOne
- func (uuo *UsersUpdateOne) ClearPassword() *UsersUpdateOne
- func (uuo *UsersUpdateOne) ClearSaves() *UsersUpdateOne
- func (uuo *UsersUpdateOne) Exec(ctx context.Context) error
- func (uuo *UsersUpdateOne) ExecX(ctx context.Context)
- func (uuo *UsersUpdateOne) Mutation() *UsersMutation
- func (uuo *UsersUpdateOne) RemoveDeviceIDs(ids ...uint64) *UsersUpdateOne
- func (uuo *UsersUpdateOne) RemoveDevices(d ...*Devices) *UsersUpdateOne
- func (uuo *UsersUpdateOne) RemoveDirIDs(ids ...uint64) *UsersUpdateOne
- func (uuo *UsersUpdateOne) RemoveDirs(d ...*Dirs) *UsersUpdateOne
- func (uuo *UsersUpdateOne) RemoveSafeIDs(ids ...uint64) *UsersUpdateOne
- func (uuo *UsersUpdateOne) RemoveSaves(s ...*Saves) *UsersUpdateOne
- func (uuo *UsersUpdateOne) Save(ctx context.Context) (*Users, error)
- func (uuo *UsersUpdateOne) SaveX(ctx context.Context) *Users
- func (uuo *UsersUpdateOne) Select(field string, fields ...string) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetAvatar(s string) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetBio(s string) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetEmail(s string) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetName(s string) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetNillableAvatar(s *string) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetNillableBio(s *string) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetNillableEmail(s *string) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetNillableName(s *string) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetNillablePassword(s *string) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetNillableUsername(s *string) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetPassword(s string) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetUpdateTime(t time.Time) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetUsername(s string) *UsersUpdateOne
- func (uuo *UsersUpdateOne) Where(ps ...predicate.Users) *UsersUpdateOne
- 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. TypeDevices = "Devices" TypeDirs = "Dirs" TypeFiles = "Files" TypeSaves = "Saves" TypeUsers = "Users" )
Variables ¶
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Devices is the client for interacting with the Devices builders. Devices *DevicesClient // Dirs is the client for interacting with the Dirs builders. Dirs *DirsClient // Files is the client for interacting with the Files builders. Files *FilesClient // Saves is the client for interacting with the Saves builders. Saves *SavesClient // Users is the client for interacting with the Users builders. Users *UsersClient // 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(). Devices. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer { return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Commit(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type Devices ¶
type Devices struct { // ID of the ent. ID uint64 `json:"id,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,omitempty"` // IP holds the value of the "ip" field. IP string `json:"ip,omitempty"` // Device holds the value of the "device" field. Device string `json:"device,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the DevicesQuery when eager-loading is set. Edges DevicesEdges `json:"edges"` // contains filtered or unexported fields }
Devices is the model entity for the Devices schema.
func (*Devices) QueryUser ¶
func (d *Devices) QueryUser() *UsersQuery
QueryUser queries the "user" edge of the Devices entity.
func (*Devices) Unwrap ¶
Unwrap unwraps the Devices 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 (*Devices) Update ¶
func (d *Devices) Update() *DevicesUpdateOne
Update returns a builder for updating this Devices. Note that you need to call Devices.Unwrap() before calling this method if this Devices was returned from a transaction, and the transaction was committed or rolled back.
type DevicesClient ¶
type DevicesClient struct {
// contains filtered or unexported fields
}
DevicesClient is a client for the Devices schema.
func NewDevicesClient ¶
func NewDevicesClient(c config) *DevicesClient
NewDevicesClient returns a client for the Devices from the given config.
func (*DevicesClient) Create ¶
func (c *DevicesClient) Create() *DevicesCreate
Create returns a builder for creating a Devices entity.
func (*DevicesClient) CreateBulk ¶
func (c *DevicesClient) CreateBulk(builders ...*DevicesCreate) *DevicesCreateBulk
CreateBulk returns a builder for creating a bulk of Devices entities.
func (*DevicesClient) Delete ¶
func (c *DevicesClient) Delete() *DevicesDelete
Delete returns a delete builder for Devices.
func (*DevicesClient) DeleteOne ¶
func (c *DevicesClient) DeleteOne(d *Devices) *DevicesDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*DevicesClient) DeleteOneID ¶
func (c *DevicesClient) DeleteOneID(id uint64) *DevicesDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*DevicesClient) GetX ¶
func (c *DevicesClient) GetX(ctx context.Context, id uint64) *Devices
GetX is like Get, but panics if an error occurs.
func (*DevicesClient) Hooks ¶
func (c *DevicesClient) Hooks() []Hook
Hooks returns the client hooks.
func (*DevicesClient) Intercept ¶
func (c *DevicesClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `devices.Intercept(f(g(h())))`.
func (*DevicesClient) Interceptors ¶
func (c *DevicesClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*DevicesClient) MapCreateBulk ¶
func (c *DevicesClient) MapCreateBulk(slice any, setFunc func(*DevicesCreate, int)) *DevicesCreateBulk
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 (*DevicesClient) Query ¶
func (c *DevicesClient) Query() *DevicesQuery
Query returns a query builder for Devices.
func (*DevicesClient) QueryUser ¶
func (c *DevicesClient) QueryUser(d *Devices) *UsersQuery
QueryUser queries the user edge of a Devices.
func (*DevicesClient) Update ¶
func (c *DevicesClient) Update() *DevicesUpdate
Update returns an update builder for Devices.
func (*DevicesClient) UpdateOne ¶
func (c *DevicesClient) UpdateOne(d *Devices) *DevicesUpdateOne
UpdateOne returns an update builder for the given entity.
func (*DevicesClient) UpdateOneID ¶
func (c *DevicesClient) UpdateOneID(id uint64) *DevicesUpdateOne
UpdateOneID returns an update builder for the given id.
func (*DevicesClient) Use ¶
func (c *DevicesClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `devices.Hooks(f(g(h())))`.
type DevicesCreate ¶
type DevicesCreate struct {
// contains filtered or unexported fields
}
DevicesCreate is the builder for creating a Devices entity.
func (*DevicesCreate) Exec ¶
func (dc *DevicesCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*DevicesCreate) ExecX ¶
func (dc *DevicesCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DevicesCreate) Mutation ¶
func (dc *DevicesCreate) Mutation() *DevicesMutation
Mutation returns the DevicesMutation object of the builder.
func (*DevicesCreate) Save ¶
func (dc *DevicesCreate) Save(ctx context.Context) (*Devices, error)
Save creates the Devices in the database.
func (*DevicesCreate) SaveX ¶
func (dc *DevicesCreate) SaveX(ctx context.Context) *Devices
SaveX calls Save and panics if Save returns an error.
func (*DevicesCreate) SetCreateTime ¶
func (dc *DevicesCreate) SetCreateTime(t time.Time) *DevicesCreate
SetCreateTime sets the "create_time" field.
func (*DevicesCreate) SetDevice ¶
func (dc *DevicesCreate) SetDevice(s string) *DevicesCreate
SetDevice sets the "device" field.
func (*DevicesCreate) SetID ¶
func (dc *DevicesCreate) SetID(u uint64) *DevicesCreate
SetID sets the "id" field.
func (*DevicesCreate) SetIP ¶
func (dc *DevicesCreate) SetIP(s string) *DevicesCreate
SetIP sets the "ip" field.
func (*DevicesCreate) SetNillableCreateTime ¶
func (dc *DevicesCreate) SetNillableCreateTime(t *time.Time) *DevicesCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*DevicesCreate) SetNillableUpdateTime ¶
func (dc *DevicesCreate) SetNillableUpdateTime(t *time.Time) *DevicesCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*DevicesCreate) SetNillableUserID ¶
func (dc *DevicesCreate) SetNillableUserID(id *uint64) *DevicesCreate
SetNillableUserID sets the "user" edge to the Users entity by ID if the given value is not nil.
func (*DevicesCreate) SetUpdateTime ¶
func (dc *DevicesCreate) SetUpdateTime(t time.Time) *DevicesCreate
SetUpdateTime sets the "update_time" field.
func (*DevicesCreate) SetUser ¶
func (dc *DevicesCreate) SetUser(u *Users) *DevicesCreate
SetUser sets the "user" edge to the Users entity.
func (*DevicesCreate) SetUserID ¶
func (dc *DevicesCreate) SetUserID(id uint64) *DevicesCreate
SetUserID sets the "user" edge to the Users entity by ID.
type DevicesCreateBulk ¶
type DevicesCreateBulk struct {
// contains filtered or unexported fields
}
DevicesCreateBulk is the builder for creating many Devices entities in bulk.
func (*DevicesCreateBulk) Exec ¶
func (dcb *DevicesCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*DevicesCreateBulk) ExecX ¶
func (dcb *DevicesCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type DevicesDelete ¶
type DevicesDelete struct {
// contains filtered or unexported fields
}
DevicesDelete is the builder for deleting a Devices entity.
func (*DevicesDelete) Exec ¶
func (dd *DevicesDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*DevicesDelete) ExecX ¶
func (dd *DevicesDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*DevicesDelete) Where ¶
func (dd *DevicesDelete) Where(ps ...predicate.Devices) *DevicesDelete
Where appends a list predicates to the DevicesDelete builder.
type DevicesDeleteOne ¶
type DevicesDeleteOne struct {
// contains filtered or unexported fields
}
DevicesDeleteOne is the builder for deleting a single Devices entity.
func (*DevicesDeleteOne) Exec ¶
func (ddo *DevicesDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*DevicesDeleteOne) ExecX ¶
func (ddo *DevicesDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DevicesDeleteOne) Where ¶
func (ddo *DevicesDeleteOne) Where(ps ...predicate.Devices) *DevicesDeleteOne
Where appends a list predicates to the DevicesDelete builder.
type DevicesEdges ¶
type DevicesEdges struct { // User holds the value of the user edge. User *Users `json:"user,omitempty"` // contains filtered or unexported fields }
DevicesEdges holds the relations/edges for other nodes in the graph.
func (DevicesEdges) UserOrErr ¶
func (e DevicesEdges) UserOrErr() (*Users, 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 DevicesGroupBy ¶
type DevicesGroupBy struct {
// contains filtered or unexported fields
}
DevicesGroupBy is the group-by builder for Devices entities.
func (*DevicesGroupBy) Aggregate ¶
func (dgb *DevicesGroupBy) Aggregate(fns ...AggregateFunc) *DevicesGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*DevicesGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*DevicesGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*DevicesGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*DevicesGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*DevicesGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*DevicesGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*DevicesGroupBy) Scan ¶
func (dgb *DevicesGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*DevicesGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type DevicesMutation ¶
type DevicesMutation struct {
// contains filtered or unexported fields
}
DevicesMutation represents an operation that mutates the Devices nodes in the graph.
func (*DevicesMutation) AddField ¶
func (m *DevicesMutation) 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 (*DevicesMutation) AddedEdges ¶
func (m *DevicesMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*DevicesMutation) AddedField ¶
func (m *DevicesMutation) 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 (*DevicesMutation) AddedFields ¶
func (m *DevicesMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*DevicesMutation) AddedIDs ¶
func (m *DevicesMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*DevicesMutation) ClearEdge ¶
func (m *DevicesMutation) 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 (*DevicesMutation) ClearField ¶
func (m *DevicesMutation) 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 (*DevicesMutation) ClearUser ¶
func (m *DevicesMutation) ClearUser()
ClearUser clears the "user" edge to the Users entity.
func (*DevicesMutation) ClearedEdges ¶
func (m *DevicesMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*DevicesMutation) ClearedFields ¶
func (m *DevicesMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (DevicesMutation) Client ¶
func (m DevicesMutation) 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 (*DevicesMutation) CreateTime ¶
func (m *DevicesMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*DevicesMutation) Device ¶
func (m *DevicesMutation) Device() (r string, exists bool)
Device returns the value of the "device" field in the mutation.
func (*DevicesMutation) EdgeCleared ¶
func (m *DevicesMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*DevicesMutation) Field ¶
func (m *DevicesMutation) 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 (*DevicesMutation) FieldCleared ¶
func (m *DevicesMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*DevicesMutation) Fields ¶
func (m *DevicesMutation) 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 (*DevicesMutation) ID ¶
func (m *DevicesMutation) ID() (id uint64, 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 (*DevicesMutation) IDs ¶
func (m *DevicesMutation) IDs(ctx context.Context) ([]uint64, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*DevicesMutation) IP ¶
func (m *DevicesMutation) IP() (r string, exists bool)
IP returns the value of the "ip" field in the mutation.
func (*DevicesMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the Devices entity. If the Devices 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 (*DevicesMutation) OldDevice ¶
func (m *DevicesMutation) OldDevice(ctx context.Context) (v string, err error)
OldDevice returns the old "device" field's value of the Devices entity. If the Devices 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 (*DevicesMutation) 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 (*DevicesMutation) OldIP ¶
func (m *DevicesMutation) OldIP(ctx context.Context) (v string, err error)
OldIP returns the old "ip" field's value of the Devices entity. If the Devices 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 (*DevicesMutation) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" field's value of the Devices entity. If the Devices 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 (*DevicesMutation) RemovedEdges ¶
func (m *DevicesMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*DevicesMutation) RemovedIDs ¶
func (m *DevicesMutation) 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 (*DevicesMutation) ResetCreateTime ¶
func (m *DevicesMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*DevicesMutation) ResetDevice ¶
func (m *DevicesMutation) ResetDevice()
ResetDevice resets all changes to the "device" field.
func (*DevicesMutation) ResetEdge ¶
func (m *DevicesMutation) 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 (*DevicesMutation) ResetField ¶
func (m *DevicesMutation) 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 (*DevicesMutation) ResetIP ¶
func (m *DevicesMutation) ResetIP()
ResetIP resets all changes to the "ip" field.
func (*DevicesMutation) ResetUpdateTime ¶
func (m *DevicesMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*DevicesMutation) ResetUser ¶
func (m *DevicesMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*DevicesMutation) SetCreateTime ¶
func (m *DevicesMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*DevicesMutation) SetDevice ¶
func (m *DevicesMutation) SetDevice(s string)
SetDevice sets the "device" field.
func (*DevicesMutation) SetField ¶
func (m *DevicesMutation) 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 (*DevicesMutation) SetID ¶
func (m *DevicesMutation) SetID(id uint64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Devices entities.
func (*DevicesMutation) SetIP ¶
func (m *DevicesMutation) SetIP(s string)
SetIP sets the "ip" field.
func (*DevicesMutation) SetOp ¶
func (m *DevicesMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*DevicesMutation) SetUpdateTime ¶
func (m *DevicesMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (*DevicesMutation) SetUserID ¶
func (m *DevicesMutation) SetUserID(id uint64)
SetUserID sets the "user" edge to the Users entity by id.
func (DevicesMutation) Tx ¶
func (m DevicesMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*DevicesMutation) Type ¶
func (m *DevicesMutation) Type() string
Type returns the node type of this mutation (Devices).
func (*DevicesMutation) UpdateTime ¶
func (m *DevicesMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*DevicesMutation) UserCleared ¶
func (m *DevicesMutation) UserCleared() bool
UserCleared reports if the "user" edge to the Users entity was cleared.
func (*DevicesMutation) UserID ¶
func (m *DevicesMutation) UserID() (id uint64, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*DevicesMutation) UserIDs ¶
func (m *DevicesMutation) UserIDs() (ids []uint64)
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 (*DevicesMutation) Where ¶
func (m *DevicesMutation) Where(ps ...predicate.Devices)
Where appends a list predicates to the DevicesMutation builder.
func (*DevicesMutation) WhereP ¶
func (m *DevicesMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the DevicesMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type DevicesQuery ¶
type DevicesQuery struct {
// contains filtered or unexported fields
}
DevicesQuery is the builder for querying Devices entities.
func (*DevicesQuery) Aggregate ¶
func (dq *DevicesQuery) Aggregate(fns ...AggregateFunc) *DevicesSelect
Aggregate returns a DevicesSelect configured with the given aggregations.
func (*DevicesQuery) All ¶
func (dq *DevicesQuery) All(ctx context.Context) ([]*Devices, error)
All executes the query and returns a list of DevicesSlice.
func (*DevicesQuery) AllX ¶
func (dq *DevicesQuery) AllX(ctx context.Context) []*Devices
AllX is like All, but panics if an error occurs.
func (*DevicesQuery) Clone ¶
func (dq *DevicesQuery) Clone() *DevicesQuery
Clone returns a duplicate of the DevicesQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*DevicesQuery) Count ¶
func (dq *DevicesQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*DevicesQuery) CountX ¶
func (dq *DevicesQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*DevicesQuery) Exist ¶
func (dq *DevicesQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*DevicesQuery) ExistX ¶
func (dq *DevicesQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*DevicesQuery) First ¶
func (dq *DevicesQuery) First(ctx context.Context) (*Devices, error)
First returns the first Devices entity from the query. Returns a *NotFoundError when no Devices was found.
func (*DevicesQuery) FirstID ¶
func (dq *DevicesQuery) FirstID(ctx context.Context) (id uint64, err error)
FirstID returns the first Devices ID from the query. Returns a *NotFoundError when no Devices ID was found.
func (*DevicesQuery) FirstIDX ¶
func (dq *DevicesQuery) FirstIDX(ctx context.Context) uint64
FirstIDX is like FirstID, but panics if an error occurs.
func (*DevicesQuery) FirstX ¶
func (dq *DevicesQuery) FirstX(ctx context.Context) *Devices
FirstX is like First, but panics if an error occurs.
func (*DevicesQuery) GroupBy ¶
func (dq *DevicesQuery) GroupBy(field string, fields ...string) *DevicesGroupBy
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 { CreateTime time.Time `json:"create_time,omitempty"` Count int `json:"count,omitempty"` } client.Devices.Query(). GroupBy(devices.FieldCreateTime). Aggregate(ent.Count()). Scan(ctx, &v)
func (*DevicesQuery) IDs ¶
func (dq *DevicesQuery) IDs(ctx context.Context) (ids []uint64, err error)
IDs executes the query and returns a list of Devices IDs.
func (*DevicesQuery) IDsX ¶
func (dq *DevicesQuery) IDsX(ctx context.Context) []uint64
IDsX is like IDs, but panics if an error occurs.
func (*DevicesQuery) Limit ¶
func (dq *DevicesQuery) Limit(limit int) *DevicesQuery
Limit the number of records to be returned by this query.
func (*DevicesQuery) Offset ¶
func (dq *DevicesQuery) Offset(offset int) *DevicesQuery
Offset to start from.
func (*DevicesQuery) Only ¶
func (dq *DevicesQuery) Only(ctx context.Context) (*Devices, error)
Only returns a single Devices entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Devices entity is found. Returns a *NotFoundError when no Devices entities are found.
func (*DevicesQuery) OnlyID ¶
func (dq *DevicesQuery) OnlyID(ctx context.Context) (id uint64, err error)
OnlyID is like Only, but returns the only Devices ID in the query. Returns a *NotSingularError when more than one Devices ID is found. Returns a *NotFoundError when no entities are found.
func (*DevicesQuery) OnlyIDX ¶
func (dq *DevicesQuery) OnlyIDX(ctx context.Context) uint64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*DevicesQuery) OnlyX ¶
func (dq *DevicesQuery) OnlyX(ctx context.Context) *Devices
OnlyX is like Only, but panics if an error occurs.
func (*DevicesQuery) Order ¶
func (dq *DevicesQuery) Order(o ...devices.OrderOption) *DevicesQuery
Order specifies how the records should be ordered.
func (*DevicesQuery) QueryUser ¶
func (dq *DevicesQuery) QueryUser() *UsersQuery
QueryUser chains the current query on the "user" edge.
func (*DevicesQuery) Select ¶
func (dq *DevicesQuery) Select(fields ...string) *DevicesSelect
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 { CreateTime time.Time `json:"create_time,omitempty"` } client.Devices.Query(). Select(devices.FieldCreateTime). Scan(ctx, &v)
func (*DevicesQuery) Unique ¶
func (dq *DevicesQuery) Unique(unique bool) *DevicesQuery
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 (*DevicesQuery) Where ¶
func (dq *DevicesQuery) Where(ps ...predicate.Devices) *DevicesQuery
Where adds a new predicate for the DevicesQuery builder.
func (*DevicesQuery) WithUser ¶
func (dq *DevicesQuery) WithUser(opts ...func(*UsersQuery)) *DevicesQuery
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 DevicesSelect ¶
type DevicesSelect struct { *DevicesQuery // contains filtered or unexported fields }
DevicesSelect is the builder for selecting fields of Devices entities.
func (*DevicesSelect) Aggregate ¶
func (ds *DevicesSelect) Aggregate(fns ...AggregateFunc) *DevicesSelect
Aggregate adds the given aggregation functions to the selector query.
func (*DevicesSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*DevicesSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*DevicesSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*DevicesSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*DevicesSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*DevicesSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*DevicesSelect) Scan ¶
func (ds *DevicesSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*DevicesSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type DevicesUpdate ¶
type DevicesUpdate struct {
// contains filtered or unexported fields
}
DevicesUpdate is the builder for updating Devices entities.
func (*DevicesUpdate) ClearUser ¶
func (du *DevicesUpdate) ClearUser() *DevicesUpdate
ClearUser clears the "user" edge to the Users entity.
func (*DevicesUpdate) Exec ¶
func (du *DevicesUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*DevicesUpdate) ExecX ¶
func (du *DevicesUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DevicesUpdate) Mutation ¶
func (du *DevicesUpdate) Mutation() *DevicesMutation
Mutation returns the DevicesMutation object of the builder.
func (*DevicesUpdate) Save ¶
func (du *DevicesUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*DevicesUpdate) SaveX ¶
func (du *DevicesUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*DevicesUpdate) SetDevice ¶
func (du *DevicesUpdate) SetDevice(s string) *DevicesUpdate
SetDevice sets the "device" field.
func (*DevicesUpdate) SetIP ¶
func (du *DevicesUpdate) SetIP(s string) *DevicesUpdate
SetIP sets the "ip" field.
func (*DevicesUpdate) SetNillableDevice ¶
func (du *DevicesUpdate) SetNillableDevice(s *string) *DevicesUpdate
SetNillableDevice sets the "device" field if the given value is not nil.
func (*DevicesUpdate) SetNillableIP ¶
func (du *DevicesUpdate) SetNillableIP(s *string) *DevicesUpdate
SetNillableIP sets the "ip" field if the given value is not nil.
func (*DevicesUpdate) SetNillableUserID ¶
func (du *DevicesUpdate) SetNillableUserID(id *uint64) *DevicesUpdate
SetNillableUserID sets the "user" edge to the Users entity by ID if the given value is not nil.
func (*DevicesUpdate) SetUpdateTime ¶
func (du *DevicesUpdate) SetUpdateTime(t time.Time) *DevicesUpdate
SetUpdateTime sets the "update_time" field.
func (*DevicesUpdate) SetUser ¶
func (du *DevicesUpdate) SetUser(u *Users) *DevicesUpdate
SetUser sets the "user" edge to the Users entity.
func (*DevicesUpdate) SetUserID ¶
func (du *DevicesUpdate) SetUserID(id uint64) *DevicesUpdate
SetUserID sets the "user" edge to the Users entity by ID.
func (*DevicesUpdate) Where ¶
func (du *DevicesUpdate) Where(ps ...predicate.Devices) *DevicesUpdate
Where appends a list predicates to the DevicesUpdate builder.
type DevicesUpdateOne ¶
type DevicesUpdateOne struct {
// contains filtered or unexported fields
}
DevicesUpdateOne is the builder for updating a single Devices entity.
func (*DevicesUpdateOne) ClearUser ¶
func (duo *DevicesUpdateOne) ClearUser() *DevicesUpdateOne
ClearUser clears the "user" edge to the Users entity.
func (*DevicesUpdateOne) Exec ¶
func (duo *DevicesUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*DevicesUpdateOne) ExecX ¶
func (duo *DevicesUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DevicesUpdateOne) Mutation ¶
func (duo *DevicesUpdateOne) Mutation() *DevicesMutation
Mutation returns the DevicesMutation object of the builder.
func (*DevicesUpdateOne) Save ¶
func (duo *DevicesUpdateOne) Save(ctx context.Context) (*Devices, error)
Save executes the query and returns the updated Devices entity.
func (*DevicesUpdateOne) SaveX ¶
func (duo *DevicesUpdateOne) SaveX(ctx context.Context) *Devices
SaveX is like Save, but panics if an error occurs.
func (*DevicesUpdateOne) Select ¶
func (duo *DevicesUpdateOne) Select(field string, fields ...string) *DevicesUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*DevicesUpdateOne) SetDevice ¶
func (duo *DevicesUpdateOne) SetDevice(s string) *DevicesUpdateOne
SetDevice sets the "device" field.
func (*DevicesUpdateOne) SetIP ¶
func (duo *DevicesUpdateOne) SetIP(s string) *DevicesUpdateOne
SetIP sets the "ip" field.
func (*DevicesUpdateOne) SetNillableDevice ¶
func (duo *DevicesUpdateOne) SetNillableDevice(s *string) *DevicesUpdateOne
SetNillableDevice sets the "device" field if the given value is not nil.
func (*DevicesUpdateOne) SetNillableIP ¶
func (duo *DevicesUpdateOne) SetNillableIP(s *string) *DevicesUpdateOne
SetNillableIP sets the "ip" field if the given value is not nil.
func (*DevicesUpdateOne) SetNillableUserID ¶
func (duo *DevicesUpdateOne) SetNillableUserID(id *uint64) *DevicesUpdateOne
SetNillableUserID sets the "user" edge to the Users entity by ID if the given value is not nil.
func (*DevicesUpdateOne) SetUpdateTime ¶
func (duo *DevicesUpdateOne) SetUpdateTime(t time.Time) *DevicesUpdateOne
SetUpdateTime sets the "update_time" field.
func (*DevicesUpdateOne) SetUser ¶
func (duo *DevicesUpdateOne) SetUser(u *Users) *DevicesUpdateOne
SetUser sets the "user" edge to the Users entity.
func (*DevicesUpdateOne) SetUserID ¶
func (duo *DevicesUpdateOne) SetUserID(id uint64) *DevicesUpdateOne
SetUserID sets the "user" edge to the Users entity by ID.
func (*DevicesUpdateOne) Where ¶
func (duo *DevicesUpdateOne) Where(ps ...predicate.Devices) *DevicesUpdateOne
Where appends a list predicates to the DevicesUpdate builder.
type Dirs ¶
type Dirs struct { // ID of the ent. ID uint64 `json:"id,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,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 DirsQuery when eager-loading is set. Edges DirsEdges `json:"edges"` // contains filtered or unexported fields }
Dirs is the model entity for the Dirs schema.
func (*Dirs) QueryOwner ¶
func (d *Dirs) QueryOwner() *UsersQuery
QueryOwner queries the "owner" edge of the Dirs entity.
func (*Dirs) QuerySaves ¶
func (d *Dirs) QuerySaves() *SavesQuery
QuerySaves queries the "saves" edge of the Dirs entity.
func (*Dirs) QuerySubdir ¶
QuerySubdir queries the "subdir" edge of the Dirs entity.
func (*Dirs) Unwrap ¶
Unwrap unwraps the Dirs 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 (*Dirs) Update ¶
func (d *Dirs) Update() *DirsUpdateOne
Update returns a builder for updating this Dirs. Note that you need to call Dirs.Unwrap() before calling this method if this Dirs was returned from a transaction, and the transaction was committed or rolled back.
type DirsClient ¶
type DirsClient struct {
// contains filtered or unexported fields
}
DirsClient is a client for the Dirs schema.
func NewDirsClient ¶
func NewDirsClient(c config) *DirsClient
NewDirsClient returns a client for the Dirs from the given config.
func (*DirsClient) Create ¶
func (c *DirsClient) Create() *DirsCreate
Create returns a builder for creating a Dirs entity.
func (*DirsClient) CreateBulk ¶
func (c *DirsClient) CreateBulk(builders ...*DirsCreate) *DirsCreateBulk
CreateBulk returns a builder for creating a bulk of Dirs entities.
func (*DirsClient) Delete ¶
func (c *DirsClient) Delete() *DirsDelete
Delete returns a delete builder for Dirs.
func (*DirsClient) DeleteOne ¶
func (c *DirsClient) DeleteOne(d *Dirs) *DirsDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*DirsClient) DeleteOneID ¶
func (c *DirsClient) DeleteOneID(id uint64) *DirsDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*DirsClient) GetX ¶
func (c *DirsClient) GetX(ctx context.Context, id uint64) *Dirs
GetX is like Get, but panics if an error occurs.
func (*DirsClient) Intercept ¶
func (c *DirsClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `dirs.Intercept(f(g(h())))`.
func (*DirsClient) Interceptors ¶
func (c *DirsClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*DirsClient) MapCreateBulk ¶
func (c *DirsClient) MapCreateBulk(slice any, setFunc func(*DirsCreate, int)) *DirsCreateBulk
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 (*DirsClient) Query ¶
func (c *DirsClient) Query() *DirsQuery
Query returns a query builder for Dirs.
func (*DirsClient) QueryOwner ¶
func (c *DirsClient) QueryOwner(d *Dirs) *UsersQuery
QueryOwner queries the owner edge of a Dirs.
func (*DirsClient) QueryPdir ¶
func (c *DirsClient) QueryPdir(d *Dirs) *DirsQuery
QueryPdir queries the pdir edge of a Dirs.
func (*DirsClient) QuerySaves ¶
func (c *DirsClient) QuerySaves(d *Dirs) *SavesQuery
QuerySaves queries the saves edge of a Dirs.
func (*DirsClient) QuerySubdir ¶
func (c *DirsClient) QuerySubdir(d *Dirs) *DirsQuery
QuerySubdir queries the subdir edge of a Dirs.
func (*DirsClient) Update ¶
func (c *DirsClient) Update() *DirsUpdate
Update returns an update builder for Dirs.
func (*DirsClient) UpdateOne ¶
func (c *DirsClient) UpdateOne(d *Dirs) *DirsUpdateOne
UpdateOne returns an update builder for the given entity.
func (*DirsClient) UpdateOneID ¶
func (c *DirsClient) UpdateOneID(id uint64) *DirsUpdateOne
UpdateOneID returns an update builder for the given id.
func (*DirsClient) Use ¶
func (c *DirsClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `dirs.Hooks(f(g(h())))`.
type DirsCreate ¶
type DirsCreate struct {
// contains filtered or unexported fields
}
DirsCreate is the builder for creating a Dirs entity.
func (*DirsCreate) AddPdir ¶
func (dc *DirsCreate) AddPdir(d ...*Dirs) *DirsCreate
AddPdir adds the "pdir" edges to the Dirs entity.
func (*DirsCreate) AddPdirIDs ¶
func (dc *DirsCreate) AddPdirIDs(ids ...uint64) *DirsCreate
AddPdirIDs adds the "pdir" edge to the Dirs entity by IDs.
func (*DirsCreate) AddSafeIDs ¶
func (dc *DirsCreate) AddSafeIDs(ids ...uint64) *DirsCreate
AddSafeIDs adds the "saves" edge to the Saves entity by IDs.
func (*DirsCreate) AddSaves ¶
func (dc *DirsCreate) AddSaves(s ...*Saves) *DirsCreate
AddSaves adds the "saves" edges to the Saves entity.
func (*DirsCreate) AddSubdir ¶
func (dc *DirsCreate) AddSubdir(d ...*Dirs) *DirsCreate
AddSubdir adds the "subdir" edges to the Dirs entity.
func (*DirsCreate) AddSubdirIDs ¶
func (dc *DirsCreate) AddSubdirIDs(ids ...uint64) *DirsCreate
AddSubdirIDs adds the "subdir" edge to the Dirs entity by IDs.
func (*DirsCreate) Exec ¶
func (dc *DirsCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*DirsCreate) ExecX ¶
func (dc *DirsCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DirsCreate) Mutation ¶
func (dc *DirsCreate) Mutation() *DirsMutation
Mutation returns the DirsMutation object of the builder.
func (*DirsCreate) Save ¶
func (dc *DirsCreate) Save(ctx context.Context) (*Dirs, error)
Save creates the Dirs in the database.
func (*DirsCreate) SaveX ¶
func (dc *DirsCreate) SaveX(ctx context.Context) *Dirs
SaveX calls Save and panics if Save returns an error.
func (*DirsCreate) SetCreateTime ¶
func (dc *DirsCreate) SetCreateTime(t time.Time) *DirsCreate
SetCreateTime sets the "create_time" field.
func (*DirsCreate) SetID ¶
func (dc *DirsCreate) SetID(u uint64) *DirsCreate
SetID sets the "id" field.
func (*DirsCreate) SetName ¶
func (dc *DirsCreate) SetName(s string) *DirsCreate
SetName sets the "name" field.
func (*DirsCreate) SetNillableCreateTime ¶
func (dc *DirsCreate) SetNillableCreateTime(t *time.Time) *DirsCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*DirsCreate) SetNillableOwnerID ¶
func (dc *DirsCreate) SetNillableOwnerID(id *uint64) *DirsCreate
SetNillableOwnerID sets the "owner" edge to the Users entity by ID if the given value is not nil.
func (*DirsCreate) SetNillableUpdateTime ¶
func (dc *DirsCreate) SetNillableUpdateTime(t *time.Time) *DirsCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*DirsCreate) SetOwner ¶
func (dc *DirsCreate) SetOwner(u *Users) *DirsCreate
SetOwner sets the "owner" edge to the Users entity.
func (*DirsCreate) SetOwnerID ¶
func (dc *DirsCreate) SetOwnerID(id uint64) *DirsCreate
SetOwnerID sets the "owner" edge to the Users entity by ID.
func (*DirsCreate) SetUpdateTime ¶
func (dc *DirsCreate) SetUpdateTime(t time.Time) *DirsCreate
SetUpdateTime sets the "update_time" field.
type DirsCreateBulk ¶
type DirsCreateBulk struct {
// contains filtered or unexported fields
}
DirsCreateBulk is the builder for creating many Dirs entities in bulk.
func (*DirsCreateBulk) Exec ¶
func (dcb *DirsCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*DirsCreateBulk) ExecX ¶
func (dcb *DirsCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type DirsDelete ¶
type DirsDelete struct {
// contains filtered or unexported fields
}
DirsDelete is the builder for deleting a Dirs entity.
func (*DirsDelete) Exec ¶
func (dd *DirsDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*DirsDelete) ExecX ¶
func (dd *DirsDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*DirsDelete) Where ¶
func (dd *DirsDelete) Where(ps ...predicate.Dirs) *DirsDelete
Where appends a list predicates to the DirsDelete builder.
type DirsDeleteOne ¶
type DirsDeleteOne struct {
// contains filtered or unexported fields
}
DirsDeleteOne is the builder for deleting a single Dirs entity.
func (*DirsDeleteOne) Exec ¶
func (ddo *DirsDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*DirsDeleteOne) ExecX ¶
func (ddo *DirsDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DirsDeleteOne) Where ¶
func (ddo *DirsDeleteOne) Where(ps ...predicate.Dirs) *DirsDeleteOne
Where appends a list predicates to the DirsDelete builder.
type DirsEdges ¶
type DirsEdges struct { // Owner holds the value of the owner edge. Owner *Users `json:"owner,omitempty"` // Saves holds the value of the saves edge. Saves []*Saves `json:"saves,omitempty"` // Subdir holds the value of the subdir edge. Subdir []*Dirs `json:"subdir,omitempty"` // Pdir holds the value of the pdir edge. Pdir []*Dirs `json:"pdir,omitempty"` // contains filtered or unexported fields }
DirsEdges holds the relations/edges for other nodes in the graph.
func (DirsEdges) OwnerOrErr ¶
OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (DirsEdges) PdirOrErr ¶
PdirOrErr returns the Pdir value or an error if the edge was not loaded in eager-loading.
func (DirsEdges) SavesOrErr ¶
SavesOrErr returns the Saves value or an error if the edge was not loaded in eager-loading.
func (DirsEdges) SubdirOrErr ¶
SubdirOrErr returns the Subdir value or an error if the edge was not loaded in eager-loading.
type DirsGroupBy ¶
type DirsGroupBy struct {
// contains filtered or unexported fields
}
DirsGroupBy is the group-by builder for Dirs entities.
func (*DirsGroupBy) Aggregate ¶
func (dgb *DirsGroupBy) Aggregate(fns ...AggregateFunc) *DirsGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*DirsGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*DirsGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*DirsGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*DirsGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*DirsGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*DirsGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*DirsGroupBy) Scan ¶
func (dgb *DirsGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*DirsGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type DirsMutation ¶
type DirsMutation struct {
// contains filtered or unexported fields
}
DirsMutation represents an operation that mutates the Dirs nodes in the graph.
func (*DirsMutation) AddField ¶
func (m *DirsMutation) 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 (*DirsMutation) AddPdirIDs ¶
func (m *DirsMutation) AddPdirIDs(ids ...uint64)
AddPdirIDs adds the "pdir" edge to the Dirs entity by ids.
func (*DirsMutation) AddSafeIDs ¶
func (m *DirsMutation) AddSafeIDs(ids ...uint64)
AddSafeIDs adds the "saves" edge to the Saves entity by ids.
func (*DirsMutation) AddSubdirIDs ¶
func (m *DirsMutation) AddSubdirIDs(ids ...uint64)
AddSubdirIDs adds the "subdir" edge to the Dirs entity by ids.
func (*DirsMutation) AddedEdges ¶
func (m *DirsMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*DirsMutation) AddedField ¶
func (m *DirsMutation) 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 (*DirsMutation) AddedFields ¶
func (m *DirsMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*DirsMutation) AddedIDs ¶
func (m *DirsMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*DirsMutation) ClearEdge ¶
func (m *DirsMutation) 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 (*DirsMutation) ClearField ¶
func (m *DirsMutation) 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 (*DirsMutation) ClearOwner ¶
func (m *DirsMutation) ClearOwner()
ClearOwner clears the "owner" edge to the Users entity.
func (*DirsMutation) ClearPdir ¶
func (m *DirsMutation) ClearPdir()
ClearPdir clears the "pdir" edge to the Dirs entity.
func (*DirsMutation) ClearSaves ¶
func (m *DirsMutation) ClearSaves()
ClearSaves clears the "saves" edge to the Saves entity.
func (*DirsMutation) ClearSubdir ¶
func (m *DirsMutation) ClearSubdir()
ClearSubdir clears the "subdir" edge to the Dirs entity.
func (*DirsMutation) ClearedEdges ¶
func (m *DirsMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*DirsMutation) ClearedFields ¶
func (m *DirsMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (DirsMutation) Client ¶
func (m DirsMutation) 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 (*DirsMutation) CreateTime ¶
func (m *DirsMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*DirsMutation) EdgeCleared ¶
func (m *DirsMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*DirsMutation) Field ¶
func (m *DirsMutation) 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 (*DirsMutation) FieldCleared ¶
func (m *DirsMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*DirsMutation) Fields ¶
func (m *DirsMutation) 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 (*DirsMutation) ID ¶
func (m *DirsMutation) ID() (id uint64, 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 (*DirsMutation) IDs ¶
func (m *DirsMutation) IDs(ctx context.Context) ([]uint64, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*DirsMutation) Name ¶
func (m *DirsMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*DirsMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the Dirs entity. If the Dirs 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 (*DirsMutation) 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 (*DirsMutation) OldName ¶
func (m *DirsMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Dirs entity. If the Dirs 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 (*DirsMutation) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" field's value of the Dirs entity. If the Dirs 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 (*DirsMutation) OwnerCleared ¶
func (m *DirsMutation) OwnerCleared() bool
OwnerCleared reports if the "owner" edge to the Users entity was cleared.
func (*DirsMutation) OwnerID ¶
func (m *DirsMutation) OwnerID() (id uint64, exists bool)
OwnerID returns the "owner" edge ID in the mutation.
func (*DirsMutation) OwnerIDs ¶
func (m *DirsMutation) OwnerIDs() (ids []uint64)
OwnerIDs returns the "owner" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OwnerID instead. It exists only for internal usage by the builders.
func (*DirsMutation) PdirCleared ¶
func (m *DirsMutation) PdirCleared() bool
PdirCleared reports if the "pdir" edge to the Dirs entity was cleared.
func (*DirsMutation) PdirIDs ¶
func (m *DirsMutation) PdirIDs() (ids []uint64)
PdirIDs returns the "pdir" edge IDs in the mutation.
func (*DirsMutation) RemovePdirIDs ¶
func (m *DirsMutation) RemovePdirIDs(ids ...uint64)
RemovePdirIDs removes the "pdir" edge to the Dirs entity by IDs.
func (*DirsMutation) RemoveSafeIDs ¶
func (m *DirsMutation) RemoveSafeIDs(ids ...uint64)
RemoveSafeIDs removes the "saves" edge to the Saves entity by IDs.
func (*DirsMutation) RemoveSubdirIDs ¶
func (m *DirsMutation) RemoveSubdirIDs(ids ...uint64)
RemoveSubdirIDs removes the "subdir" edge to the Dirs entity by IDs.
func (*DirsMutation) RemovedEdges ¶
func (m *DirsMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*DirsMutation) RemovedIDs ¶
func (m *DirsMutation) 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 (*DirsMutation) RemovedPdirIDs ¶
func (m *DirsMutation) RemovedPdirIDs() (ids []uint64)
RemovedPdir returns the removed IDs of the "pdir" edge to the Dirs entity.
func (*DirsMutation) RemovedSavesIDs ¶
func (m *DirsMutation) RemovedSavesIDs() (ids []uint64)
RemovedSaves returns the removed IDs of the "saves" edge to the Saves entity.
func (*DirsMutation) RemovedSubdirIDs ¶
func (m *DirsMutation) RemovedSubdirIDs() (ids []uint64)
RemovedSubdir returns the removed IDs of the "subdir" edge to the Dirs entity.
func (*DirsMutation) ResetCreateTime ¶
func (m *DirsMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*DirsMutation) ResetEdge ¶
func (m *DirsMutation) 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 (*DirsMutation) ResetField ¶
func (m *DirsMutation) 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 (*DirsMutation) ResetName ¶
func (m *DirsMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*DirsMutation) ResetOwner ¶
func (m *DirsMutation) ResetOwner()
ResetOwner resets all changes to the "owner" edge.
func (*DirsMutation) ResetPdir ¶
func (m *DirsMutation) ResetPdir()
ResetPdir resets all changes to the "pdir" edge.
func (*DirsMutation) ResetSaves ¶
func (m *DirsMutation) ResetSaves()
ResetSaves resets all changes to the "saves" edge.
func (*DirsMutation) ResetSubdir ¶
func (m *DirsMutation) ResetSubdir()
ResetSubdir resets all changes to the "subdir" edge.
func (*DirsMutation) ResetUpdateTime ¶
func (m *DirsMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*DirsMutation) SavesCleared ¶
func (m *DirsMutation) SavesCleared() bool
SavesCleared reports if the "saves" edge to the Saves entity was cleared.
func (*DirsMutation) SavesIDs ¶
func (m *DirsMutation) SavesIDs() (ids []uint64)
SavesIDs returns the "saves" edge IDs in the mutation.
func (*DirsMutation) SetCreateTime ¶
func (m *DirsMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*DirsMutation) SetField ¶
func (m *DirsMutation) 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 (*DirsMutation) SetID ¶
func (m *DirsMutation) SetID(id uint64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Dirs entities.
func (*DirsMutation) SetName ¶
func (m *DirsMutation) SetName(s string)
SetName sets the "name" field.
func (*DirsMutation) SetOp ¶
func (m *DirsMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*DirsMutation) SetOwnerID ¶
func (m *DirsMutation) SetOwnerID(id uint64)
SetOwnerID sets the "owner" edge to the Users entity by id.
func (*DirsMutation) SetUpdateTime ¶
func (m *DirsMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (*DirsMutation) SubdirCleared ¶
func (m *DirsMutation) SubdirCleared() bool
SubdirCleared reports if the "subdir" edge to the Dirs entity was cleared.
func (*DirsMutation) SubdirIDs ¶
func (m *DirsMutation) SubdirIDs() (ids []uint64)
SubdirIDs returns the "subdir" edge IDs in the mutation.
func (DirsMutation) Tx ¶
func (m DirsMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*DirsMutation) Type ¶
func (m *DirsMutation) Type() string
Type returns the node type of this mutation (Dirs).
func (*DirsMutation) UpdateTime ¶
func (m *DirsMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*DirsMutation) Where ¶
func (m *DirsMutation) Where(ps ...predicate.Dirs)
Where appends a list predicates to the DirsMutation builder.
func (*DirsMutation) WhereP ¶
func (m *DirsMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the DirsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type DirsQuery ¶
type DirsQuery struct {
// contains filtered or unexported fields
}
DirsQuery is the builder for querying Dirs entities.
func (*DirsQuery) Aggregate ¶
func (dq *DirsQuery) Aggregate(fns ...AggregateFunc) *DirsSelect
Aggregate returns a DirsSelect configured with the given aggregations.
func (*DirsQuery) Clone ¶
Clone returns a duplicate of the DirsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*DirsQuery) First ¶
First returns the first Dirs entity from the query. Returns a *NotFoundError when no Dirs was found.
func (*DirsQuery) FirstID ¶
FirstID returns the first Dirs ID from the query. Returns a *NotFoundError when no Dirs ID was found.
func (*DirsQuery) GroupBy ¶
func (dq *DirsQuery) GroupBy(field string, fields ...string) *DirsGroupBy
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 { CreateTime time.Time `json:"create_time,omitempty"` Count int `json:"count,omitempty"` } client.Dirs.Query(). GroupBy(dirs.FieldCreateTime). Aggregate(ent.Count()). Scan(ctx, &v)
func (*DirsQuery) Only ¶
Only returns a single Dirs entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Dirs entity is found. Returns a *NotFoundError when no Dirs entities are found.
func (*DirsQuery) OnlyID ¶
OnlyID is like Only, but returns the only Dirs ID in the query. Returns a *NotSingularError when more than one Dirs ID is found. Returns a *NotFoundError when no entities are found.
func (*DirsQuery) Order ¶
func (dq *DirsQuery) Order(o ...dirs.OrderOption) *DirsQuery
Order specifies how the records should be ordered.
func (*DirsQuery) QueryOwner ¶
func (dq *DirsQuery) QueryOwner() *UsersQuery
QueryOwner chains the current query on the "owner" edge.
func (*DirsQuery) QuerySaves ¶
func (dq *DirsQuery) QuerySaves() *SavesQuery
QuerySaves chains the current query on the "saves" edge.
func (*DirsQuery) QuerySubdir ¶
QuerySubdir chains the current query on the "subdir" edge.
func (*DirsQuery) Select ¶
func (dq *DirsQuery) Select(fields ...string) *DirsSelect
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 { CreateTime time.Time `json:"create_time,omitempty"` } client.Dirs.Query(). Select(dirs.FieldCreateTime). Scan(ctx, &v)
func (*DirsQuery) 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 (*DirsQuery) WithOwner ¶
func (dq *DirsQuery) WithOwner(opts ...func(*UsersQuery)) *DirsQuery
WithOwner tells the query-builder to eager-load the nodes that are connected to the "owner" edge. The optional arguments are used to configure the query builder of the edge.
func (*DirsQuery) WithPdir ¶
WithPdir tells the query-builder to eager-load the nodes that are connected to the "pdir" edge. The optional arguments are used to configure the query builder of the edge.
func (*DirsQuery) WithSaves ¶
func (dq *DirsQuery) WithSaves(opts ...func(*SavesQuery)) *DirsQuery
WithSaves tells the query-builder to eager-load the nodes that are connected to the "saves" edge. The optional arguments are used to configure the query builder of the edge.
func (*DirsQuery) WithSubdir ¶
WithSubdir tells the query-builder to eager-load the nodes that are connected to the "subdir" edge. The optional arguments are used to configure the query builder of the edge.
type DirsSelect ¶
type DirsSelect struct { *DirsQuery // contains filtered or unexported fields }
DirsSelect is the builder for selecting fields of Dirs entities.
func (*DirsSelect) Aggregate ¶
func (ds *DirsSelect) Aggregate(fns ...AggregateFunc) *DirsSelect
Aggregate adds the given aggregation functions to the selector query.
func (*DirsSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*DirsSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*DirsSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*DirsSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*DirsSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*DirsSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*DirsSelect) Scan ¶
func (ds *DirsSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*DirsSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type DirsUpdate ¶
type DirsUpdate struct {
// contains filtered or unexported fields
}
DirsUpdate is the builder for updating Dirs entities.
func (*DirsUpdate) AddPdir ¶
func (du *DirsUpdate) AddPdir(d ...*Dirs) *DirsUpdate
AddPdir adds the "pdir" edges to the Dirs entity.
func (*DirsUpdate) AddPdirIDs ¶
func (du *DirsUpdate) AddPdirIDs(ids ...uint64) *DirsUpdate
AddPdirIDs adds the "pdir" edge to the Dirs entity by IDs.
func (*DirsUpdate) AddSafeIDs ¶
func (du *DirsUpdate) AddSafeIDs(ids ...uint64) *DirsUpdate
AddSafeIDs adds the "saves" edge to the Saves entity by IDs.
func (*DirsUpdate) AddSaves ¶
func (du *DirsUpdate) AddSaves(s ...*Saves) *DirsUpdate
AddSaves adds the "saves" edges to the Saves entity.
func (*DirsUpdate) AddSubdir ¶
func (du *DirsUpdate) AddSubdir(d ...*Dirs) *DirsUpdate
AddSubdir adds the "subdir" edges to the Dirs entity.
func (*DirsUpdate) AddSubdirIDs ¶
func (du *DirsUpdate) AddSubdirIDs(ids ...uint64) *DirsUpdate
AddSubdirIDs adds the "subdir" edge to the Dirs entity by IDs.
func (*DirsUpdate) ClearOwner ¶
func (du *DirsUpdate) ClearOwner() *DirsUpdate
ClearOwner clears the "owner" edge to the Users entity.
func (*DirsUpdate) ClearPdir ¶
func (du *DirsUpdate) ClearPdir() *DirsUpdate
ClearPdir clears all "pdir" edges to the Dirs entity.
func (*DirsUpdate) ClearSaves ¶
func (du *DirsUpdate) ClearSaves() *DirsUpdate
ClearSaves clears all "saves" edges to the Saves entity.
func (*DirsUpdate) ClearSubdir ¶
func (du *DirsUpdate) ClearSubdir() *DirsUpdate
ClearSubdir clears all "subdir" edges to the Dirs entity.
func (*DirsUpdate) Exec ¶
func (du *DirsUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*DirsUpdate) ExecX ¶
func (du *DirsUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DirsUpdate) Mutation ¶
func (du *DirsUpdate) Mutation() *DirsMutation
Mutation returns the DirsMutation object of the builder.
func (*DirsUpdate) RemovePdir ¶
func (du *DirsUpdate) RemovePdir(d ...*Dirs) *DirsUpdate
RemovePdir removes "pdir" edges to Dirs entities.
func (*DirsUpdate) RemovePdirIDs ¶
func (du *DirsUpdate) RemovePdirIDs(ids ...uint64) *DirsUpdate
RemovePdirIDs removes the "pdir" edge to Dirs entities by IDs.
func (*DirsUpdate) RemoveSafeIDs ¶
func (du *DirsUpdate) RemoveSafeIDs(ids ...uint64) *DirsUpdate
RemoveSafeIDs removes the "saves" edge to Saves entities by IDs.
func (*DirsUpdate) RemoveSaves ¶
func (du *DirsUpdate) RemoveSaves(s ...*Saves) *DirsUpdate
RemoveSaves removes "saves" edges to Saves entities.
func (*DirsUpdate) RemoveSubdir ¶
func (du *DirsUpdate) RemoveSubdir(d ...*Dirs) *DirsUpdate
RemoveSubdir removes "subdir" edges to Dirs entities.
func (*DirsUpdate) RemoveSubdirIDs ¶
func (du *DirsUpdate) RemoveSubdirIDs(ids ...uint64) *DirsUpdate
RemoveSubdirIDs removes the "subdir" edge to Dirs entities by IDs.
func (*DirsUpdate) Save ¶
func (du *DirsUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*DirsUpdate) SaveX ¶
func (du *DirsUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*DirsUpdate) SetName ¶
func (du *DirsUpdate) SetName(s string) *DirsUpdate
SetName sets the "name" field.
func (*DirsUpdate) SetNillableName ¶
func (du *DirsUpdate) SetNillableName(s *string) *DirsUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*DirsUpdate) SetNillableOwnerID ¶
func (du *DirsUpdate) SetNillableOwnerID(id *uint64) *DirsUpdate
SetNillableOwnerID sets the "owner" edge to the Users entity by ID if the given value is not nil.
func (*DirsUpdate) SetOwner ¶
func (du *DirsUpdate) SetOwner(u *Users) *DirsUpdate
SetOwner sets the "owner" edge to the Users entity.
func (*DirsUpdate) SetOwnerID ¶
func (du *DirsUpdate) SetOwnerID(id uint64) *DirsUpdate
SetOwnerID sets the "owner" edge to the Users entity by ID.
func (*DirsUpdate) SetUpdateTime ¶
func (du *DirsUpdate) SetUpdateTime(t time.Time) *DirsUpdate
SetUpdateTime sets the "update_time" field.
func (*DirsUpdate) Where ¶
func (du *DirsUpdate) Where(ps ...predicate.Dirs) *DirsUpdate
Where appends a list predicates to the DirsUpdate builder.
type DirsUpdateOne ¶
type DirsUpdateOne struct {
// contains filtered or unexported fields
}
DirsUpdateOne is the builder for updating a single Dirs entity.
func (*DirsUpdateOne) AddPdir ¶
func (duo *DirsUpdateOne) AddPdir(d ...*Dirs) *DirsUpdateOne
AddPdir adds the "pdir" edges to the Dirs entity.
func (*DirsUpdateOne) AddPdirIDs ¶
func (duo *DirsUpdateOne) AddPdirIDs(ids ...uint64) *DirsUpdateOne
AddPdirIDs adds the "pdir" edge to the Dirs entity by IDs.
func (*DirsUpdateOne) AddSafeIDs ¶
func (duo *DirsUpdateOne) AddSafeIDs(ids ...uint64) *DirsUpdateOne
AddSafeIDs adds the "saves" edge to the Saves entity by IDs.
func (*DirsUpdateOne) AddSaves ¶
func (duo *DirsUpdateOne) AddSaves(s ...*Saves) *DirsUpdateOne
AddSaves adds the "saves" edges to the Saves entity.
func (*DirsUpdateOne) AddSubdir ¶
func (duo *DirsUpdateOne) AddSubdir(d ...*Dirs) *DirsUpdateOne
AddSubdir adds the "subdir" edges to the Dirs entity.
func (*DirsUpdateOne) AddSubdirIDs ¶
func (duo *DirsUpdateOne) AddSubdirIDs(ids ...uint64) *DirsUpdateOne
AddSubdirIDs adds the "subdir" edge to the Dirs entity by IDs.
func (*DirsUpdateOne) ClearOwner ¶
func (duo *DirsUpdateOne) ClearOwner() *DirsUpdateOne
ClearOwner clears the "owner" edge to the Users entity.
func (*DirsUpdateOne) ClearPdir ¶
func (duo *DirsUpdateOne) ClearPdir() *DirsUpdateOne
ClearPdir clears all "pdir" edges to the Dirs entity.
func (*DirsUpdateOne) ClearSaves ¶
func (duo *DirsUpdateOne) ClearSaves() *DirsUpdateOne
ClearSaves clears all "saves" edges to the Saves entity.
func (*DirsUpdateOne) ClearSubdir ¶
func (duo *DirsUpdateOne) ClearSubdir() *DirsUpdateOne
ClearSubdir clears all "subdir" edges to the Dirs entity.
func (*DirsUpdateOne) Exec ¶
func (duo *DirsUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*DirsUpdateOne) ExecX ¶
func (duo *DirsUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*DirsUpdateOne) Mutation ¶
func (duo *DirsUpdateOne) Mutation() *DirsMutation
Mutation returns the DirsMutation object of the builder.
func (*DirsUpdateOne) RemovePdir ¶
func (duo *DirsUpdateOne) RemovePdir(d ...*Dirs) *DirsUpdateOne
RemovePdir removes "pdir" edges to Dirs entities.
func (*DirsUpdateOne) RemovePdirIDs ¶
func (duo *DirsUpdateOne) RemovePdirIDs(ids ...uint64) *DirsUpdateOne
RemovePdirIDs removes the "pdir" edge to Dirs entities by IDs.
func (*DirsUpdateOne) RemoveSafeIDs ¶
func (duo *DirsUpdateOne) RemoveSafeIDs(ids ...uint64) *DirsUpdateOne
RemoveSafeIDs removes the "saves" edge to Saves entities by IDs.
func (*DirsUpdateOne) RemoveSaves ¶
func (duo *DirsUpdateOne) RemoveSaves(s ...*Saves) *DirsUpdateOne
RemoveSaves removes "saves" edges to Saves entities.
func (*DirsUpdateOne) RemoveSubdir ¶
func (duo *DirsUpdateOne) RemoveSubdir(d ...*Dirs) *DirsUpdateOne
RemoveSubdir removes "subdir" edges to Dirs entities.
func (*DirsUpdateOne) RemoveSubdirIDs ¶
func (duo *DirsUpdateOne) RemoveSubdirIDs(ids ...uint64) *DirsUpdateOne
RemoveSubdirIDs removes the "subdir" edge to Dirs entities by IDs.
func (*DirsUpdateOne) Save ¶
func (duo *DirsUpdateOne) Save(ctx context.Context) (*Dirs, error)
Save executes the query and returns the updated Dirs entity.
func (*DirsUpdateOne) SaveX ¶
func (duo *DirsUpdateOne) SaveX(ctx context.Context) *Dirs
SaveX is like Save, but panics if an error occurs.
func (*DirsUpdateOne) Select ¶
func (duo *DirsUpdateOne) Select(field string, fields ...string) *DirsUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*DirsUpdateOne) SetName ¶
func (duo *DirsUpdateOne) SetName(s string) *DirsUpdateOne
SetName sets the "name" field.
func (*DirsUpdateOne) SetNillableName ¶
func (duo *DirsUpdateOne) SetNillableName(s *string) *DirsUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*DirsUpdateOne) SetNillableOwnerID ¶
func (duo *DirsUpdateOne) SetNillableOwnerID(id *uint64) *DirsUpdateOne
SetNillableOwnerID sets the "owner" edge to the Users entity by ID if the given value is not nil.
func (*DirsUpdateOne) SetOwner ¶
func (duo *DirsUpdateOne) SetOwner(u *Users) *DirsUpdateOne
SetOwner sets the "owner" edge to the Users entity.
func (*DirsUpdateOne) SetOwnerID ¶
func (duo *DirsUpdateOne) SetOwnerID(id uint64) *DirsUpdateOne
SetOwnerID sets the "owner" edge to the Users entity by ID.
func (*DirsUpdateOne) SetUpdateTime ¶
func (duo *DirsUpdateOne) SetUpdateTime(t time.Time) *DirsUpdateOne
SetUpdateTime sets the "update_time" field.
func (*DirsUpdateOne) Where ¶
func (duo *DirsUpdateOne) Where(ps ...predicate.Dirs) *DirsUpdateOne
Where appends a list predicates to the DirsUpdate builder.
type Files ¶
type Files struct { // ID of the ent. ID uint64 `json:"id,omitempty"` // ipfs hash Hash string `json:"hash,omitempty"` // file name Name string `json:"name,omitempty"` // file size, number of bytes in the stored file Size uint64 `json:"size,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the FilesQuery when eager-loading is set. Edges FilesEdges `json:"edges"` // contains filtered or unexported fields }
Files is the model entity for the Files schema.
func (*Files) QuerySaves ¶
func (f *Files) QuerySaves() *SavesQuery
QuerySaves queries the "saves" edge of the Files entity.
func (*Files) Unwrap ¶
Unwrap unwraps the Files 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 (*Files) Update ¶
func (f *Files) Update() *FilesUpdateOne
Update returns a builder for updating this Files. Note that you need to call Files.Unwrap() before calling this method if this Files was returned from a transaction, and the transaction was committed or rolled back.
type FilesClient ¶
type FilesClient struct {
// contains filtered or unexported fields
}
FilesClient is a client for the Files schema.
func NewFilesClient ¶
func NewFilesClient(c config) *FilesClient
NewFilesClient returns a client for the Files from the given config.
func (*FilesClient) Create ¶
func (c *FilesClient) Create() *FilesCreate
Create returns a builder for creating a Files entity.
func (*FilesClient) CreateBulk ¶
func (c *FilesClient) CreateBulk(builders ...*FilesCreate) *FilesCreateBulk
CreateBulk returns a builder for creating a bulk of Files entities.
func (*FilesClient) Delete ¶
func (c *FilesClient) Delete() *FilesDelete
Delete returns a delete builder for Files.
func (*FilesClient) DeleteOne ¶
func (c *FilesClient) DeleteOne(f *Files) *FilesDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*FilesClient) DeleteOneID ¶
func (c *FilesClient) DeleteOneID(id uint64) *FilesDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*FilesClient) GetX ¶
func (c *FilesClient) GetX(ctx context.Context, id uint64) *Files
GetX is like Get, but panics if an error occurs.
func (*FilesClient) Intercept ¶
func (c *FilesClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `files.Intercept(f(g(h())))`.
func (*FilesClient) Interceptors ¶
func (c *FilesClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*FilesClient) MapCreateBulk ¶
func (c *FilesClient) MapCreateBulk(slice any, setFunc func(*FilesCreate, int)) *FilesCreateBulk
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 (*FilesClient) Query ¶
func (c *FilesClient) Query() *FilesQuery
Query returns a query builder for Files.
func (*FilesClient) QuerySaves ¶
func (c *FilesClient) QuerySaves(f *Files) *SavesQuery
QuerySaves queries the saves edge of a Files.
func (*FilesClient) Update ¶
func (c *FilesClient) Update() *FilesUpdate
Update returns an update builder for Files.
func (*FilesClient) UpdateOne ¶
func (c *FilesClient) UpdateOne(f *Files) *FilesUpdateOne
UpdateOne returns an update builder for the given entity.
func (*FilesClient) UpdateOneID ¶
func (c *FilesClient) UpdateOneID(id uint64) *FilesUpdateOne
UpdateOneID returns an update builder for the given id.
func (*FilesClient) Use ¶
func (c *FilesClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `files.Hooks(f(g(h())))`.
type FilesCreate ¶
type FilesCreate struct {
// contains filtered or unexported fields
}
FilesCreate is the builder for creating a Files entity.
func (*FilesCreate) AddSafeIDs ¶
func (fc *FilesCreate) AddSafeIDs(ids ...uint64) *FilesCreate
AddSafeIDs adds the "saves" edge to the Saves entity by IDs.
func (*FilesCreate) AddSaves ¶
func (fc *FilesCreate) AddSaves(s ...*Saves) *FilesCreate
AddSaves adds the "saves" edges to the Saves entity.
func (*FilesCreate) Exec ¶
func (fc *FilesCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*FilesCreate) ExecX ¶
func (fc *FilesCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FilesCreate) Mutation ¶
func (fc *FilesCreate) Mutation() *FilesMutation
Mutation returns the FilesMutation object of the builder.
func (*FilesCreate) Save ¶
func (fc *FilesCreate) Save(ctx context.Context) (*Files, error)
Save creates the Files in the database.
func (*FilesCreate) SaveX ¶
func (fc *FilesCreate) SaveX(ctx context.Context) *Files
SaveX calls Save and panics if Save returns an error.
func (*FilesCreate) SetHash ¶
func (fc *FilesCreate) SetHash(s string) *FilesCreate
SetHash sets the "hash" field.
func (*FilesCreate) SetID ¶
func (fc *FilesCreate) SetID(u uint64) *FilesCreate
SetID sets the "id" field.
func (*FilesCreate) SetName ¶
func (fc *FilesCreate) SetName(s string) *FilesCreate
SetName sets the "name" field.
func (*FilesCreate) SetSize ¶
func (fc *FilesCreate) SetSize(u uint64) *FilesCreate
SetSize sets the "size" field.
type FilesCreateBulk ¶
type FilesCreateBulk struct {
// contains filtered or unexported fields
}
FilesCreateBulk is the builder for creating many Files entities in bulk.
func (*FilesCreateBulk) Exec ¶
func (fcb *FilesCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*FilesCreateBulk) ExecX ¶
func (fcb *FilesCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type FilesDelete ¶
type FilesDelete struct {
// contains filtered or unexported fields
}
FilesDelete is the builder for deleting a Files entity.
func (*FilesDelete) Exec ¶
func (fd *FilesDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*FilesDelete) ExecX ¶
func (fd *FilesDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*FilesDelete) Where ¶
func (fd *FilesDelete) Where(ps ...predicate.Files) *FilesDelete
Where appends a list predicates to the FilesDelete builder.
type FilesDeleteOne ¶
type FilesDeleteOne struct {
// contains filtered or unexported fields
}
FilesDeleteOne is the builder for deleting a single Files entity.
func (*FilesDeleteOne) Exec ¶
func (fdo *FilesDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*FilesDeleteOne) ExecX ¶
func (fdo *FilesDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FilesDeleteOne) Where ¶
func (fdo *FilesDeleteOne) Where(ps ...predicate.Files) *FilesDeleteOne
Where appends a list predicates to the FilesDelete builder.
type FilesEdges ¶
type FilesEdges struct { // Saves holds the value of the saves edge. Saves []*Saves `json:"saves,omitempty"` // contains filtered or unexported fields }
FilesEdges holds the relations/edges for other nodes in the graph.
func (FilesEdges) SavesOrErr ¶
func (e FilesEdges) SavesOrErr() ([]*Saves, error)
SavesOrErr returns the Saves value or an error if the edge was not loaded in eager-loading.
type FilesGroupBy ¶
type FilesGroupBy struct {
// contains filtered or unexported fields
}
FilesGroupBy is the group-by builder for Files entities.
func (*FilesGroupBy) Aggregate ¶
func (fgb *FilesGroupBy) Aggregate(fns ...AggregateFunc) *FilesGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*FilesGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FilesGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FilesGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FilesGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FilesGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FilesGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*FilesGroupBy) Scan ¶
func (fgb *FilesGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*FilesGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FilesMutation ¶
type FilesMutation struct {
// contains filtered or unexported fields
}
FilesMutation represents an operation that mutates the Files nodes in the graph.
func (*FilesMutation) AddField ¶
func (m *FilesMutation) 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 (*FilesMutation) AddSafeIDs ¶
func (m *FilesMutation) AddSafeIDs(ids ...uint64)
AddSafeIDs adds the "saves" edge to the Saves entity by ids.
func (*FilesMutation) AddSize ¶
func (m *FilesMutation) AddSize(u int64)
AddSize adds u to the "size" field.
func (*FilesMutation) AddedEdges ¶
func (m *FilesMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*FilesMutation) AddedField ¶
func (m *FilesMutation) 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 (*FilesMutation) AddedFields ¶
func (m *FilesMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*FilesMutation) AddedIDs ¶
func (m *FilesMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*FilesMutation) AddedSize ¶
func (m *FilesMutation) AddedSize() (r int64, exists bool)
AddedSize returns the value that was added to the "size" field in this mutation.
func (*FilesMutation) ClearEdge ¶
func (m *FilesMutation) 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 (*FilesMutation) ClearField ¶
func (m *FilesMutation) 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 (*FilesMutation) ClearSaves ¶
func (m *FilesMutation) ClearSaves()
ClearSaves clears the "saves" edge to the Saves entity.
func (*FilesMutation) ClearedEdges ¶
func (m *FilesMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*FilesMutation) ClearedFields ¶
func (m *FilesMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (FilesMutation) Client ¶
func (m FilesMutation) 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 (*FilesMutation) EdgeCleared ¶
func (m *FilesMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*FilesMutation) Field ¶
func (m *FilesMutation) 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 (*FilesMutation) FieldCleared ¶
func (m *FilesMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*FilesMutation) Fields ¶
func (m *FilesMutation) 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 (*FilesMutation) Hash ¶
func (m *FilesMutation) Hash() (r string, exists bool)
Hash returns the value of the "hash" field in the mutation.
func (*FilesMutation) ID ¶
func (m *FilesMutation) ID() (id uint64, 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 (*FilesMutation) IDs ¶
func (m *FilesMutation) IDs(ctx context.Context) ([]uint64, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*FilesMutation) Name ¶
func (m *FilesMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*FilesMutation) 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 (*FilesMutation) OldHash ¶
func (m *FilesMutation) OldHash(ctx context.Context) (v string, err error)
OldHash returns the old "hash" field's value of the Files entity. If the Files 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 (*FilesMutation) OldName ¶
func (m *FilesMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Files entity. If the Files 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 (*FilesMutation) OldSize ¶
func (m *FilesMutation) OldSize(ctx context.Context) (v uint64, err error)
OldSize returns the old "size" field's value of the Files entity. If the Files 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 (*FilesMutation) RemoveSafeIDs ¶
func (m *FilesMutation) RemoveSafeIDs(ids ...uint64)
RemoveSafeIDs removes the "saves" edge to the Saves entity by IDs.
func (*FilesMutation) RemovedEdges ¶
func (m *FilesMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*FilesMutation) RemovedIDs ¶
func (m *FilesMutation) 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 (*FilesMutation) RemovedSavesIDs ¶
func (m *FilesMutation) RemovedSavesIDs() (ids []uint64)
RemovedSaves returns the removed IDs of the "saves" edge to the Saves entity.
func (*FilesMutation) ResetEdge ¶
func (m *FilesMutation) 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 (*FilesMutation) ResetField ¶
func (m *FilesMutation) 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 (*FilesMutation) ResetHash ¶
func (m *FilesMutation) ResetHash()
ResetHash resets all changes to the "hash" field.
func (*FilesMutation) ResetName ¶
func (m *FilesMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*FilesMutation) ResetSaves ¶
func (m *FilesMutation) ResetSaves()
ResetSaves resets all changes to the "saves" edge.
func (*FilesMutation) ResetSize ¶
func (m *FilesMutation) ResetSize()
ResetSize resets all changes to the "size" field.
func (*FilesMutation) SavesCleared ¶
func (m *FilesMutation) SavesCleared() bool
SavesCleared reports if the "saves" edge to the Saves entity was cleared.
func (*FilesMutation) SavesIDs ¶
func (m *FilesMutation) SavesIDs() (ids []uint64)
SavesIDs returns the "saves" edge IDs in the mutation.
func (*FilesMutation) SetField ¶
func (m *FilesMutation) 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 (*FilesMutation) SetHash ¶
func (m *FilesMutation) SetHash(s string)
SetHash sets the "hash" field.
func (*FilesMutation) SetID ¶
func (m *FilesMutation) SetID(id uint64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Files entities.
func (*FilesMutation) SetName ¶
func (m *FilesMutation) SetName(s string)
SetName sets the "name" field.
func (*FilesMutation) SetOp ¶
func (m *FilesMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*FilesMutation) SetSize ¶
func (m *FilesMutation) SetSize(u uint64)
SetSize sets the "size" field.
func (*FilesMutation) Size ¶
func (m *FilesMutation) Size() (r uint64, exists bool)
Size returns the value of the "size" field in the mutation.
func (FilesMutation) Tx ¶
func (m FilesMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*FilesMutation) Type ¶
func (m *FilesMutation) Type() string
Type returns the node type of this mutation (Files).
func (*FilesMutation) Where ¶
func (m *FilesMutation) Where(ps ...predicate.Files)
Where appends a list predicates to the FilesMutation builder.
func (*FilesMutation) WhereP ¶
func (m *FilesMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the FilesMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type FilesQuery ¶
type FilesQuery struct {
// contains filtered or unexported fields
}
FilesQuery is the builder for querying Files entities.
func (*FilesQuery) Aggregate ¶
func (fq *FilesQuery) Aggregate(fns ...AggregateFunc) *FilesSelect
Aggregate returns a FilesSelect configured with the given aggregations.
func (*FilesQuery) All ¶
func (fq *FilesQuery) All(ctx context.Context) ([]*Files, error)
All executes the query and returns a list of FilesSlice.
func (*FilesQuery) AllX ¶
func (fq *FilesQuery) AllX(ctx context.Context) []*Files
AllX is like All, but panics if an error occurs.
func (*FilesQuery) Clone ¶
func (fq *FilesQuery) Clone() *FilesQuery
Clone returns a duplicate of the FilesQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*FilesQuery) Count ¶
func (fq *FilesQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*FilesQuery) CountX ¶
func (fq *FilesQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*FilesQuery) Exist ¶
func (fq *FilesQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*FilesQuery) ExistX ¶
func (fq *FilesQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*FilesQuery) First ¶
func (fq *FilesQuery) First(ctx context.Context) (*Files, error)
First returns the first Files entity from the query. Returns a *NotFoundError when no Files was found.
func (*FilesQuery) FirstID ¶
func (fq *FilesQuery) FirstID(ctx context.Context) (id uint64, err error)
FirstID returns the first Files ID from the query. Returns a *NotFoundError when no Files ID was found.
func (*FilesQuery) FirstIDX ¶
func (fq *FilesQuery) FirstIDX(ctx context.Context) uint64
FirstIDX is like FirstID, but panics if an error occurs.
func (*FilesQuery) FirstX ¶
func (fq *FilesQuery) FirstX(ctx context.Context) *Files
FirstX is like First, but panics if an error occurs.
func (*FilesQuery) GroupBy ¶
func (fq *FilesQuery) GroupBy(field string, fields ...string) *FilesGroupBy
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 { Hash string `json:"hash,omitempty"` Count int `json:"count,omitempty"` } client.Files.Query(). GroupBy(files.FieldHash). Aggregate(ent.Count()). Scan(ctx, &v)
func (*FilesQuery) IDs ¶
func (fq *FilesQuery) IDs(ctx context.Context) (ids []uint64, err error)
IDs executes the query and returns a list of Files IDs.
func (*FilesQuery) IDsX ¶
func (fq *FilesQuery) IDsX(ctx context.Context) []uint64
IDsX is like IDs, but panics if an error occurs.
func (*FilesQuery) Limit ¶
func (fq *FilesQuery) Limit(limit int) *FilesQuery
Limit the number of records to be returned by this query.
func (*FilesQuery) Offset ¶
func (fq *FilesQuery) Offset(offset int) *FilesQuery
Offset to start from.
func (*FilesQuery) Only ¶
func (fq *FilesQuery) Only(ctx context.Context) (*Files, error)
Only returns a single Files entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Files entity is found. Returns a *NotFoundError when no Files entities are found.
func (*FilesQuery) OnlyID ¶
func (fq *FilesQuery) OnlyID(ctx context.Context) (id uint64, err error)
OnlyID is like Only, but returns the only Files ID in the query. Returns a *NotSingularError when more than one Files ID is found. Returns a *NotFoundError when no entities are found.
func (*FilesQuery) OnlyIDX ¶
func (fq *FilesQuery) OnlyIDX(ctx context.Context) uint64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*FilesQuery) OnlyX ¶
func (fq *FilesQuery) OnlyX(ctx context.Context) *Files
OnlyX is like Only, but panics if an error occurs.
func (*FilesQuery) Order ¶
func (fq *FilesQuery) Order(o ...files.OrderOption) *FilesQuery
Order specifies how the records should be ordered.
func (*FilesQuery) QuerySaves ¶
func (fq *FilesQuery) QuerySaves() *SavesQuery
QuerySaves chains the current query on the "saves" edge.
func (*FilesQuery) Select ¶
func (fq *FilesQuery) Select(fields ...string) *FilesSelect
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 { Hash string `json:"hash,omitempty"` } client.Files.Query(). Select(files.FieldHash). Scan(ctx, &v)
func (*FilesQuery) Unique ¶
func (fq *FilesQuery) Unique(unique bool) *FilesQuery
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 (*FilesQuery) Where ¶
func (fq *FilesQuery) Where(ps ...predicate.Files) *FilesQuery
Where adds a new predicate for the FilesQuery builder.
func (*FilesQuery) WithSaves ¶
func (fq *FilesQuery) WithSaves(opts ...func(*SavesQuery)) *FilesQuery
WithSaves tells the query-builder to eager-load the nodes that are connected to the "saves" edge. The optional arguments are used to configure the query builder of the edge.
type FilesSelect ¶
type FilesSelect struct { *FilesQuery // contains filtered or unexported fields }
FilesSelect is the builder for selecting fields of Files entities.
func (*FilesSelect) Aggregate ¶
func (fs *FilesSelect) Aggregate(fns ...AggregateFunc) *FilesSelect
Aggregate adds the given aggregation functions to the selector query.
func (*FilesSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*FilesSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*FilesSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*FilesSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*FilesSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*FilesSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*FilesSelect) Scan ¶
func (fs *FilesSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*FilesSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type FilesUpdate ¶
type FilesUpdate struct {
// contains filtered or unexported fields
}
FilesUpdate is the builder for updating Files entities.
func (*FilesUpdate) AddSafeIDs ¶
func (fu *FilesUpdate) AddSafeIDs(ids ...uint64) *FilesUpdate
AddSafeIDs adds the "saves" edge to the Saves entity by IDs.
func (*FilesUpdate) AddSaves ¶
func (fu *FilesUpdate) AddSaves(s ...*Saves) *FilesUpdate
AddSaves adds the "saves" edges to the Saves entity.
func (*FilesUpdate) AddSize ¶
func (fu *FilesUpdate) AddSize(u int64) *FilesUpdate
AddSize adds u to the "size" field.
func (*FilesUpdate) ClearSaves ¶
func (fu *FilesUpdate) ClearSaves() *FilesUpdate
ClearSaves clears all "saves" edges to the Saves entity.
func (*FilesUpdate) Exec ¶
func (fu *FilesUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*FilesUpdate) ExecX ¶
func (fu *FilesUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FilesUpdate) Mutation ¶
func (fu *FilesUpdate) Mutation() *FilesMutation
Mutation returns the FilesMutation object of the builder.
func (*FilesUpdate) RemoveSafeIDs ¶
func (fu *FilesUpdate) RemoveSafeIDs(ids ...uint64) *FilesUpdate
RemoveSafeIDs removes the "saves" edge to Saves entities by IDs.
func (*FilesUpdate) RemoveSaves ¶
func (fu *FilesUpdate) RemoveSaves(s ...*Saves) *FilesUpdate
RemoveSaves removes "saves" edges to Saves entities.
func (*FilesUpdate) Save ¶
func (fu *FilesUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*FilesUpdate) SaveX ¶
func (fu *FilesUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*FilesUpdate) SetHash ¶
func (fu *FilesUpdate) SetHash(s string) *FilesUpdate
SetHash sets the "hash" field.
func (*FilesUpdate) SetName ¶
func (fu *FilesUpdate) SetName(s string) *FilesUpdate
SetName sets the "name" field.
func (*FilesUpdate) SetNillableHash ¶
func (fu *FilesUpdate) SetNillableHash(s *string) *FilesUpdate
SetNillableHash sets the "hash" field if the given value is not nil.
func (*FilesUpdate) SetNillableName ¶
func (fu *FilesUpdate) SetNillableName(s *string) *FilesUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*FilesUpdate) SetNillableSize ¶
func (fu *FilesUpdate) SetNillableSize(u *uint64) *FilesUpdate
SetNillableSize sets the "size" field if the given value is not nil.
func (*FilesUpdate) SetSize ¶
func (fu *FilesUpdate) SetSize(u uint64) *FilesUpdate
SetSize sets the "size" field.
func (*FilesUpdate) Where ¶
func (fu *FilesUpdate) Where(ps ...predicate.Files) *FilesUpdate
Where appends a list predicates to the FilesUpdate builder.
type FilesUpdateOne ¶
type FilesUpdateOne struct {
// contains filtered or unexported fields
}
FilesUpdateOne is the builder for updating a single Files entity.
func (*FilesUpdateOne) AddSafeIDs ¶
func (fuo *FilesUpdateOne) AddSafeIDs(ids ...uint64) *FilesUpdateOne
AddSafeIDs adds the "saves" edge to the Saves entity by IDs.
func (*FilesUpdateOne) AddSaves ¶
func (fuo *FilesUpdateOne) AddSaves(s ...*Saves) *FilesUpdateOne
AddSaves adds the "saves" edges to the Saves entity.
func (*FilesUpdateOne) AddSize ¶
func (fuo *FilesUpdateOne) AddSize(u int64) *FilesUpdateOne
AddSize adds u to the "size" field.
func (*FilesUpdateOne) ClearSaves ¶
func (fuo *FilesUpdateOne) ClearSaves() *FilesUpdateOne
ClearSaves clears all "saves" edges to the Saves entity.
func (*FilesUpdateOne) Exec ¶
func (fuo *FilesUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*FilesUpdateOne) ExecX ¶
func (fuo *FilesUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*FilesUpdateOne) Mutation ¶
func (fuo *FilesUpdateOne) Mutation() *FilesMutation
Mutation returns the FilesMutation object of the builder.
func (*FilesUpdateOne) RemoveSafeIDs ¶
func (fuo *FilesUpdateOne) RemoveSafeIDs(ids ...uint64) *FilesUpdateOne
RemoveSafeIDs removes the "saves" edge to Saves entities by IDs.
func (*FilesUpdateOne) RemoveSaves ¶
func (fuo *FilesUpdateOne) RemoveSaves(s ...*Saves) *FilesUpdateOne
RemoveSaves removes "saves" edges to Saves entities.
func (*FilesUpdateOne) Save ¶
func (fuo *FilesUpdateOne) Save(ctx context.Context) (*Files, error)
Save executes the query and returns the updated Files entity.
func (*FilesUpdateOne) SaveX ¶
func (fuo *FilesUpdateOne) SaveX(ctx context.Context) *Files
SaveX is like Save, but panics if an error occurs.
func (*FilesUpdateOne) Select ¶
func (fuo *FilesUpdateOne) Select(field string, fields ...string) *FilesUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*FilesUpdateOne) SetHash ¶
func (fuo *FilesUpdateOne) SetHash(s string) *FilesUpdateOne
SetHash sets the "hash" field.
func (*FilesUpdateOne) SetName ¶
func (fuo *FilesUpdateOne) SetName(s string) *FilesUpdateOne
SetName sets the "name" field.
func (*FilesUpdateOne) SetNillableHash ¶
func (fuo *FilesUpdateOne) SetNillableHash(s *string) *FilesUpdateOne
SetNillableHash sets the "hash" field if the given value is not nil.
func (*FilesUpdateOne) SetNillableName ¶
func (fuo *FilesUpdateOne) SetNillableName(s *string) *FilesUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*FilesUpdateOne) SetNillableSize ¶
func (fuo *FilesUpdateOne) SetNillableSize(u *uint64) *FilesUpdateOne
SetNillableSize sets the "size" field if the given value is not nil.
func (*FilesUpdateOne) SetSize ¶
func (fuo *FilesUpdateOne) SetSize(u uint64) *FilesUpdateOne
SetSize sets the "size" field.
func (*FilesUpdateOne) Where ¶
func (fuo *FilesUpdateOne) Where(ps ...predicate.Files) *FilesUpdateOne
Where appends a list predicates to the FilesUpdate builder.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type 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 Saves ¶
type Saves struct { // ID of the ent. ID uint64 `json:"id,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // the descriptive text or title of a document, image, or other media element. It is used to provide a short description of the content, characteristics or context of a document. Caption string `json:"caption,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the SavesQuery when eager-loading is set. Edges SavesEdges `json:"edges"` // contains filtered or unexported fields }
Saves is the model entity for the Saves schema.
func (*Saves) QueryFile ¶
func (s *Saves) QueryFile() *FilesQuery
QueryFile queries the "file" edge of the Saves entity.
func (*Saves) QueryOwner ¶
func (s *Saves) QueryOwner() *UsersQuery
QueryOwner queries the "owner" edge of the Saves entity.
func (*Saves) Unwrap ¶
Unwrap unwraps the Saves 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 (*Saves) Update ¶
func (s *Saves) Update() *SavesUpdateOne
Update returns a builder for updating this Saves. Note that you need to call Saves.Unwrap() before calling this method if this Saves was returned from a transaction, and the transaction was committed or rolled back.
type SavesClient ¶
type SavesClient struct {
// contains filtered or unexported fields
}
SavesClient is a client for the Saves schema.
func NewSavesClient ¶
func NewSavesClient(c config) *SavesClient
NewSavesClient returns a client for the Saves from the given config.
func (*SavesClient) Create ¶
func (c *SavesClient) Create() *SavesCreate
Create returns a builder for creating a Saves entity.
func (*SavesClient) CreateBulk ¶
func (c *SavesClient) CreateBulk(builders ...*SavesCreate) *SavesCreateBulk
CreateBulk returns a builder for creating a bulk of Saves entities.
func (*SavesClient) Delete ¶
func (c *SavesClient) Delete() *SavesDelete
Delete returns a delete builder for Saves.
func (*SavesClient) DeleteOne ¶
func (c *SavesClient) DeleteOne(s *Saves) *SavesDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*SavesClient) DeleteOneID ¶
func (c *SavesClient) DeleteOneID(id uint64) *SavesDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*SavesClient) GetX ¶
func (c *SavesClient) GetX(ctx context.Context, id uint64) *Saves
GetX is like Get, but panics if an error occurs.
func (*SavesClient) Intercept ¶
func (c *SavesClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `saves.Intercept(f(g(h())))`.
func (*SavesClient) Interceptors ¶
func (c *SavesClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*SavesClient) MapCreateBulk ¶
func (c *SavesClient) MapCreateBulk(slice any, setFunc func(*SavesCreate, int)) *SavesCreateBulk
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 (*SavesClient) Query ¶
func (c *SavesClient) Query() *SavesQuery
Query returns a query builder for Saves.
func (*SavesClient) QueryDir ¶
func (c *SavesClient) QueryDir(s *Saves) *DirsQuery
QueryDir queries the dir edge of a Saves.
func (*SavesClient) QueryFile ¶
func (c *SavesClient) QueryFile(s *Saves) *FilesQuery
QueryFile queries the file edge of a Saves.
func (*SavesClient) QueryOwner ¶
func (c *SavesClient) QueryOwner(s *Saves) *UsersQuery
QueryOwner queries the owner edge of a Saves.
func (*SavesClient) Update ¶
func (c *SavesClient) Update() *SavesUpdate
Update returns an update builder for Saves.
func (*SavesClient) UpdateOne ¶
func (c *SavesClient) UpdateOne(s *Saves) *SavesUpdateOne
UpdateOne returns an update builder for the given entity.
func (*SavesClient) UpdateOneID ¶
func (c *SavesClient) UpdateOneID(id uint64) *SavesUpdateOne
UpdateOneID returns an update builder for the given id.
func (*SavesClient) Use ¶
func (c *SavesClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `saves.Hooks(f(g(h())))`.
type SavesCreate ¶
type SavesCreate struct {
// contains filtered or unexported fields
}
SavesCreate is the builder for creating a Saves entity.
func (*SavesCreate) AddDir ¶
func (sc *SavesCreate) AddDir(d ...*Dirs) *SavesCreate
AddDir adds the "dir" edges to the Dirs entity.
func (*SavesCreate) AddDirIDs ¶
func (sc *SavesCreate) AddDirIDs(ids ...uint64) *SavesCreate
AddDirIDs adds the "dir" edge to the Dirs entity by IDs.
func (*SavesCreate) Exec ¶
func (sc *SavesCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*SavesCreate) ExecX ¶
func (sc *SavesCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SavesCreate) Mutation ¶
func (sc *SavesCreate) Mutation() *SavesMutation
Mutation returns the SavesMutation object of the builder.
func (*SavesCreate) Save ¶
func (sc *SavesCreate) Save(ctx context.Context) (*Saves, error)
Save creates the Saves in the database.
func (*SavesCreate) SaveX ¶
func (sc *SavesCreate) SaveX(ctx context.Context) *Saves
SaveX calls Save and panics if Save returns an error.
func (*SavesCreate) SetCaption ¶
func (sc *SavesCreate) SetCaption(s string) *SavesCreate
SetCaption sets the "caption" field.
func (*SavesCreate) SetCreateTime ¶
func (sc *SavesCreate) SetCreateTime(t time.Time) *SavesCreate
SetCreateTime sets the "create_time" field.
func (*SavesCreate) SetFile ¶
func (sc *SavesCreate) SetFile(f *Files) *SavesCreate
SetFile sets the "file" edge to the Files entity.
func (*SavesCreate) SetFileID ¶
func (sc *SavesCreate) SetFileID(id uint64) *SavesCreate
SetFileID sets the "file" edge to the Files entity by ID.
func (*SavesCreate) SetID ¶
func (sc *SavesCreate) SetID(u uint64) *SavesCreate
SetID sets the "id" field.
func (*SavesCreate) SetName ¶
func (sc *SavesCreate) SetName(s string) *SavesCreate
SetName sets the "name" field.
func (*SavesCreate) SetNillableCaption ¶
func (sc *SavesCreate) SetNillableCaption(s *string) *SavesCreate
SetNillableCaption sets the "caption" field if the given value is not nil.
func (*SavesCreate) SetNillableCreateTime ¶
func (sc *SavesCreate) SetNillableCreateTime(t *time.Time) *SavesCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*SavesCreate) SetNillableFileID ¶
func (sc *SavesCreate) SetNillableFileID(id *uint64) *SavesCreate
SetNillableFileID sets the "file" edge to the Files entity by ID if the given value is not nil.
func (*SavesCreate) SetNillableOwnerID ¶
func (sc *SavesCreate) SetNillableOwnerID(id *uint64) *SavesCreate
SetNillableOwnerID sets the "owner" edge to the Users entity by ID if the given value is not nil.
func (*SavesCreate) SetNillableUpdateTime ¶
func (sc *SavesCreate) SetNillableUpdateTime(t *time.Time) *SavesCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*SavesCreate) SetOwner ¶
func (sc *SavesCreate) SetOwner(u *Users) *SavesCreate
SetOwner sets the "owner" edge to the Users entity.
func (*SavesCreate) SetOwnerID ¶
func (sc *SavesCreate) SetOwnerID(id uint64) *SavesCreate
SetOwnerID sets the "owner" edge to the Users entity by ID.
func (*SavesCreate) SetUpdateTime ¶
func (sc *SavesCreate) SetUpdateTime(t time.Time) *SavesCreate
SetUpdateTime sets the "update_time" field.
type SavesCreateBulk ¶
type SavesCreateBulk struct {
// contains filtered or unexported fields
}
SavesCreateBulk is the builder for creating many Saves entities in bulk.
func (*SavesCreateBulk) Exec ¶
func (scb *SavesCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*SavesCreateBulk) ExecX ¶
func (scb *SavesCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type SavesDelete ¶
type SavesDelete struct {
// contains filtered or unexported fields
}
SavesDelete is the builder for deleting a Saves entity.
func (*SavesDelete) Exec ¶
func (sd *SavesDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*SavesDelete) ExecX ¶
func (sd *SavesDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*SavesDelete) Where ¶
func (sd *SavesDelete) Where(ps ...predicate.Saves) *SavesDelete
Where appends a list predicates to the SavesDelete builder.
type SavesDeleteOne ¶
type SavesDeleteOne struct {
// contains filtered or unexported fields
}
SavesDeleteOne is the builder for deleting a single Saves entity.
func (*SavesDeleteOne) Exec ¶
func (sdo *SavesDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*SavesDeleteOne) ExecX ¶
func (sdo *SavesDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SavesDeleteOne) Where ¶
func (sdo *SavesDeleteOne) Where(ps ...predicate.Saves) *SavesDeleteOne
Where appends a list predicates to the SavesDelete builder.
type SavesEdges ¶
type SavesEdges struct { // File holds the value of the file edge. File *Files `json:"file,omitempty"` // Owner holds the value of the owner edge. Owner *Users `json:"owner,omitempty"` // Dir holds the value of the dir edge. Dir []*Dirs `json:"dir,omitempty"` // contains filtered or unexported fields }
SavesEdges holds the relations/edges for other nodes in the graph.
func (SavesEdges) DirOrErr ¶
func (e SavesEdges) DirOrErr() ([]*Dirs, error)
DirOrErr returns the Dir value or an error if the edge was not loaded in eager-loading.
func (SavesEdges) FileOrErr ¶
func (e SavesEdges) FileOrErr() (*Files, error)
FileOrErr returns the File value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (SavesEdges) OwnerOrErr ¶
func (e SavesEdges) OwnerOrErr() (*Users, error)
OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type SavesGroupBy ¶
type SavesGroupBy struct {
// contains filtered or unexported fields
}
SavesGroupBy is the group-by builder for Saves entities.
func (*SavesGroupBy) Aggregate ¶
func (sgb *SavesGroupBy) Aggregate(fns ...AggregateFunc) *SavesGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*SavesGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SavesGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SavesGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SavesGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SavesGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SavesGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SavesGroupBy) Scan ¶
func (sgb *SavesGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SavesGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SavesMutation ¶
type SavesMutation struct {
// contains filtered or unexported fields
}
SavesMutation represents an operation that mutates the Saves nodes in the graph.
func (*SavesMutation) AddDirIDs ¶
func (m *SavesMutation) AddDirIDs(ids ...uint64)
AddDirIDs adds the "dir" edge to the Dirs entity by ids.
func (*SavesMutation) AddField ¶
func (m *SavesMutation) 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 (*SavesMutation) AddedEdges ¶
func (m *SavesMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*SavesMutation) AddedField ¶
func (m *SavesMutation) 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 (*SavesMutation) AddedFields ¶
func (m *SavesMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*SavesMutation) AddedIDs ¶
func (m *SavesMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*SavesMutation) Caption ¶
func (m *SavesMutation) Caption() (r string, exists bool)
Caption returns the value of the "caption" field in the mutation.
func (*SavesMutation) CaptionCleared ¶
func (m *SavesMutation) CaptionCleared() bool
CaptionCleared returns if the "caption" field was cleared in this mutation.
func (*SavesMutation) ClearCaption ¶
func (m *SavesMutation) ClearCaption()
ClearCaption clears the value of the "caption" field.
func (*SavesMutation) ClearDir ¶
func (m *SavesMutation) ClearDir()
ClearDir clears the "dir" edge to the Dirs entity.
func (*SavesMutation) ClearEdge ¶
func (m *SavesMutation) 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 (*SavesMutation) ClearField ¶
func (m *SavesMutation) 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 (*SavesMutation) ClearFile ¶
func (m *SavesMutation) ClearFile()
ClearFile clears the "file" edge to the Files entity.
func (*SavesMutation) ClearOwner ¶
func (m *SavesMutation) ClearOwner()
ClearOwner clears the "owner" edge to the Users entity.
func (*SavesMutation) ClearedEdges ¶
func (m *SavesMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*SavesMutation) ClearedFields ¶
func (m *SavesMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (SavesMutation) Client ¶
func (m SavesMutation) 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 (*SavesMutation) CreateTime ¶
func (m *SavesMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*SavesMutation) DirCleared ¶
func (m *SavesMutation) DirCleared() bool
DirCleared reports if the "dir" edge to the Dirs entity was cleared.
func (*SavesMutation) DirIDs ¶
func (m *SavesMutation) DirIDs() (ids []uint64)
DirIDs returns the "dir" edge IDs in the mutation.
func (*SavesMutation) EdgeCleared ¶
func (m *SavesMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*SavesMutation) Field ¶
func (m *SavesMutation) 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 (*SavesMutation) FieldCleared ¶
func (m *SavesMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*SavesMutation) Fields ¶
func (m *SavesMutation) 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 (*SavesMutation) FileCleared ¶
func (m *SavesMutation) FileCleared() bool
FileCleared reports if the "file" edge to the Files entity was cleared.
func (*SavesMutation) FileID ¶
func (m *SavesMutation) FileID() (id uint64, exists bool)
FileID returns the "file" edge ID in the mutation.
func (*SavesMutation) FileIDs ¶
func (m *SavesMutation) FileIDs() (ids []uint64)
FileIDs returns the "file" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use FileID instead. It exists only for internal usage by the builders.
func (*SavesMutation) ID ¶
func (m *SavesMutation) ID() (id uint64, 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 (*SavesMutation) IDs ¶
func (m *SavesMutation) IDs(ctx context.Context) ([]uint64, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*SavesMutation) Name ¶
func (m *SavesMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*SavesMutation) OldCaption ¶
func (m *SavesMutation) OldCaption(ctx context.Context) (v string, err error)
OldCaption returns the old "caption" field's value of the Saves entity. If the Saves 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 (*SavesMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the Saves entity. If the Saves 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 (*SavesMutation) 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 (*SavesMutation) OldName ¶
func (m *SavesMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Saves entity. If the Saves 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 (*SavesMutation) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" field's value of the Saves entity. If the Saves 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 (*SavesMutation) OwnerCleared ¶
func (m *SavesMutation) OwnerCleared() bool
OwnerCleared reports if the "owner" edge to the Users entity was cleared.
func (*SavesMutation) OwnerID ¶
func (m *SavesMutation) OwnerID() (id uint64, exists bool)
OwnerID returns the "owner" edge ID in the mutation.
func (*SavesMutation) OwnerIDs ¶
func (m *SavesMutation) OwnerIDs() (ids []uint64)
OwnerIDs returns the "owner" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OwnerID instead. It exists only for internal usage by the builders.
func (*SavesMutation) RemoveDirIDs ¶
func (m *SavesMutation) RemoveDirIDs(ids ...uint64)
RemoveDirIDs removes the "dir" edge to the Dirs entity by IDs.
func (*SavesMutation) RemovedDirIDs ¶
func (m *SavesMutation) RemovedDirIDs() (ids []uint64)
RemovedDir returns the removed IDs of the "dir" edge to the Dirs entity.
func (*SavesMutation) RemovedEdges ¶
func (m *SavesMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*SavesMutation) RemovedIDs ¶
func (m *SavesMutation) 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 (*SavesMutation) ResetCaption ¶
func (m *SavesMutation) ResetCaption()
ResetCaption resets all changes to the "caption" field.
func (*SavesMutation) ResetCreateTime ¶
func (m *SavesMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*SavesMutation) ResetDir ¶
func (m *SavesMutation) ResetDir()
ResetDir resets all changes to the "dir" edge.
func (*SavesMutation) ResetEdge ¶
func (m *SavesMutation) 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 (*SavesMutation) ResetField ¶
func (m *SavesMutation) 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 (*SavesMutation) ResetFile ¶
func (m *SavesMutation) ResetFile()
ResetFile resets all changes to the "file" edge.
func (*SavesMutation) ResetName ¶
func (m *SavesMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*SavesMutation) ResetOwner ¶
func (m *SavesMutation) ResetOwner()
ResetOwner resets all changes to the "owner" edge.
func (*SavesMutation) ResetUpdateTime ¶
func (m *SavesMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*SavesMutation) SetCaption ¶
func (m *SavesMutation) SetCaption(s string)
SetCaption sets the "caption" field.
func (*SavesMutation) SetCreateTime ¶
func (m *SavesMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*SavesMutation) SetField ¶
func (m *SavesMutation) 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 (*SavesMutation) SetFileID ¶
func (m *SavesMutation) SetFileID(id uint64)
SetFileID sets the "file" edge to the Files entity by id.
func (*SavesMutation) SetID ¶
func (m *SavesMutation) SetID(id uint64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Saves entities.
func (*SavesMutation) SetName ¶
func (m *SavesMutation) SetName(s string)
SetName sets the "name" field.
func (*SavesMutation) SetOp ¶
func (m *SavesMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*SavesMutation) SetOwnerID ¶
func (m *SavesMutation) SetOwnerID(id uint64)
SetOwnerID sets the "owner" edge to the Users entity by id.
func (*SavesMutation) SetUpdateTime ¶
func (m *SavesMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (SavesMutation) Tx ¶
func (m SavesMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*SavesMutation) Type ¶
func (m *SavesMutation) Type() string
Type returns the node type of this mutation (Saves).
func (*SavesMutation) UpdateTime ¶
func (m *SavesMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*SavesMutation) Where ¶
func (m *SavesMutation) Where(ps ...predicate.Saves)
Where appends a list predicates to the SavesMutation builder.
func (*SavesMutation) WhereP ¶
func (m *SavesMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the SavesMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type SavesQuery ¶
type SavesQuery struct {
// contains filtered or unexported fields
}
SavesQuery is the builder for querying Saves entities.
func (*SavesQuery) Aggregate ¶
func (sq *SavesQuery) Aggregate(fns ...AggregateFunc) *SavesSelect
Aggregate returns a SavesSelect configured with the given aggregations.
func (*SavesQuery) All ¶
func (sq *SavesQuery) All(ctx context.Context) ([]*Saves, error)
All executes the query and returns a list of SavesSlice.
func (*SavesQuery) AllX ¶
func (sq *SavesQuery) AllX(ctx context.Context) []*Saves
AllX is like All, but panics if an error occurs.
func (*SavesQuery) Clone ¶
func (sq *SavesQuery) Clone() *SavesQuery
Clone returns a duplicate of the SavesQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*SavesQuery) Count ¶
func (sq *SavesQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*SavesQuery) CountX ¶
func (sq *SavesQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*SavesQuery) Exist ¶
func (sq *SavesQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*SavesQuery) ExistX ¶
func (sq *SavesQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*SavesQuery) First ¶
func (sq *SavesQuery) First(ctx context.Context) (*Saves, error)
First returns the first Saves entity from the query. Returns a *NotFoundError when no Saves was found.
func (*SavesQuery) FirstID ¶
func (sq *SavesQuery) FirstID(ctx context.Context) (id uint64, err error)
FirstID returns the first Saves ID from the query. Returns a *NotFoundError when no Saves ID was found.
func (*SavesQuery) FirstIDX ¶
func (sq *SavesQuery) FirstIDX(ctx context.Context) uint64
FirstIDX is like FirstID, but panics if an error occurs.
func (*SavesQuery) FirstX ¶
func (sq *SavesQuery) FirstX(ctx context.Context) *Saves
FirstX is like First, but panics if an error occurs.
func (*SavesQuery) GroupBy ¶
func (sq *SavesQuery) GroupBy(field string, fields ...string) *SavesGroupBy
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 { CreateTime time.Time `json:"create_time,omitempty"` Count int `json:"count,omitempty"` } client.Saves.Query(). GroupBy(saves.FieldCreateTime). Aggregate(ent.Count()). Scan(ctx, &v)
func (*SavesQuery) IDs ¶
func (sq *SavesQuery) IDs(ctx context.Context) (ids []uint64, err error)
IDs executes the query and returns a list of Saves IDs.
func (*SavesQuery) IDsX ¶
func (sq *SavesQuery) IDsX(ctx context.Context) []uint64
IDsX is like IDs, but panics if an error occurs.
func (*SavesQuery) Limit ¶
func (sq *SavesQuery) Limit(limit int) *SavesQuery
Limit the number of records to be returned by this query.
func (*SavesQuery) Offset ¶
func (sq *SavesQuery) Offset(offset int) *SavesQuery
Offset to start from.
func (*SavesQuery) Only ¶
func (sq *SavesQuery) Only(ctx context.Context) (*Saves, error)
Only returns a single Saves entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Saves entity is found. Returns a *NotFoundError when no Saves entities are found.
func (*SavesQuery) OnlyID ¶
func (sq *SavesQuery) OnlyID(ctx context.Context) (id uint64, err error)
OnlyID is like Only, but returns the only Saves ID in the query. Returns a *NotSingularError when more than one Saves ID is found. Returns a *NotFoundError when no entities are found.
func (*SavesQuery) OnlyIDX ¶
func (sq *SavesQuery) OnlyIDX(ctx context.Context) uint64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*SavesQuery) OnlyX ¶
func (sq *SavesQuery) OnlyX(ctx context.Context) *Saves
OnlyX is like Only, but panics if an error occurs.
func (*SavesQuery) Order ¶
func (sq *SavesQuery) Order(o ...saves.OrderOption) *SavesQuery
Order specifies how the records should be ordered.
func (*SavesQuery) QueryDir ¶
func (sq *SavesQuery) QueryDir() *DirsQuery
QueryDir chains the current query on the "dir" edge.
func (*SavesQuery) QueryFile ¶
func (sq *SavesQuery) QueryFile() *FilesQuery
QueryFile chains the current query on the "file" edge.
func (*SavesQuery) QueryOwner ¶
func (sq *SavesQuery) QueryOwner() *UsersQuery
QueryOwner chains the current query on the "owner" edge.
func (*SavesQuery) Select ¶
func (sq *SavesQuery) Select(fields ...string) *SavesSelect
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 { CreateTime time.Time `json:"create_time,omitempty"` } client.Saves.Query(). Select(saves.FieldCreateTime). Scan(ctx, &v)
func (*SavesQuery) Unique ¶
func (sq *SavesQuery) Unique(unique bool) *SavesQuery
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 (*SavesQuery) Where ¶
func (sq *SavesQuery) Where(ps ...predicate.Saves) *SavesQuery
Where adds a new predicate for the SavesQuery builder.
func (*SavesQuery) WithDir ¶
func (sq *SavesQuery) WithDir(opts ...func(*DirsQuery)) *SavesQuery
WithDir tells the query-builder to eager-load the nodes that are connected to the "dir" edge. The optional arguments are used to configure the query builder of the edge.
func (*SavesQuery) WithFile ¶
func (sq *SavesQuery) WithFile(opts ...func(*FilesQuery)) *SavesQuery
WithFile tells the query-builder to eager-load the nodes that are connected to the "file" edge. The optional arguments are used to configure the query builder of the edge.
func (*SavesQuery) WithOwner ¶
func (sq *SavesQuery) WithOwner(opts ...func(*UsersQuery)) *SavesQuery
WithOwner tells the query-builder to eager-load the nodes that are connected to the "owner" edge. The optional arguments are used to configure the query builder of the edge.
type SavesSelect ¶
type SavesSelect struct { *SavesQuery // contains filtered or unexported fields }
SavesSelect is the builder for selecting fields of Saves entities.
func (*SavesSelect) Aggregate ¶
func (ss *SavesSelect) Aggregate(fns ...AggregateFunc) *SavesSelect
Aggregate adds the given aggregation functions to the selector query.
func (*SavesSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SavesSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SavesSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SavesSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SavesSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SavesSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SavesSelect) Scan ¶
func (ss *SavesSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SavesSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SavesUpdate ¶
type SavesUpdate struct {
// contains filtered or unexported fields
}
SavesUpdate is the builder for updating Saves entities.
func (*SavesUpdate) AddDir ¶
func (su *SavesUpdate) AddDir(d ...*Dirs) *SavesUpdate
AddDir adds the "dir" edges to the Dirs entity.
func (*SavesUpdate) AddDirIDs ¶
func (su *SavesUpdate) AddDirIDs(ids ...uint64) *SavesUpdate
AddDirIDs adds the "dir" edge to the Dirs entity by IDs.
func (*SavesUpdate) ClearCaption ¶
func (su *SavesUpdate) ClearCaption() *SavesUpdate
ClearCaption clears the value of the "caption" field.
func (*SavesUpdate) ClearDir ¶
func (su *SavesUpdate) ClearDir() *SavesUpdate
ClearDir clears all "dir" edges to the Dirs entity.
func (*SavesUpdate) ClearFile ¶
func (su *SavesUpdate) ClearFile() *SavesUpdate
ClearFile clears the "file" edge to the Files entity.
func (*SavesUpdate) ClearOwner ¶
func (su *SavesUpdate) ClearOwner() *SavesUpdate
ClearOwner clears the "owner" edge to the Users entity.
func (*SavesUpdate) Exec ¶
func (su *SavesUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*SavesUpdate) ExecX ¶
func (su *SavesUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SavesUpdate) Mutation ¶
func (su *SavesUpdate) Mutation() *SavesMutation
Mutation returns the SavesMutation object of the builder.
func (*SavesUpdate) RemoveDir ¶
func (su *SavesUpdate) RemoveDir(d ...*Dirs) *SavesUpdate
RemoveDir removes "dir" edges to Dirs entities.
func (*SavesUpdate) RemoveDirIDs ¶
func (su *SavesUpdate) RemoveDirIDs(ids ...uint64) *SavesUpdate
RemoveDirIDs removes the "dir" edge to Dirs entities by IDs.
func (*SavesUpdate) Save ¶
func (su *SavesUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*SavesUpdate) SaveX ¶
func (su *SavesUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*SavesUpdate) SetCaption ¶
func (su *SavesUpdate) SetCaption(s string) *SavesUpdate
SetCaption sets the "caption" field.
func (*SavesUpdate) SetFile ¶
func (su *SavesUpdate) SetFile(f *Files) *SavesUpdate
SetFile sets the "file" edge to the Files entity.
func (*SavesUpdate) SetFileID ¶
func (su *SavesUpdate) SetFileID(id uint64) *SavesUpdate
SetFileID sets the "file" edge to the Files entity by ID.
func (*SavesUpdate) SetName ¶
func (su *SavesUpdate) SetName(s string) *SavesUpdate
SetName sets the "name" field.
func (*SavesUpdate) SetNillableCaption ¶
func (su *SavesUpdate) SetNillableCaption(s *string) *SavesUpdate
SetNillableCaption sets the "caption" field if the given value is not nil.
func (*SavesUpdate) SetNillableFileID ¶
func (su *SavesUpdate) SetNillableFileID(id *uint64) *SavesUpdate
SetNillableFileID sets the "file" edge to the Files entity by ID if the given value is not nil.
func (*SavesUpdate) SetNillableName ¶
func (su *SavesUpdate) SetNillableName(s *string) *SavesUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*SavesUpdate) SetNillableOwnerID ¶
func (su *SavesUpdate) SetNillableOwnerID(id *uint64) *SavesUpdate
SetNillableOwnerID sets the "owner" edge to the Users entity by ID if the given value is not nil.
func (*SavesUpdate) SetOwner ¶
func (su *SavesUpdate) SetOwner(u *Users) *SavesUpdate
SetOwner sets the "owner" edge to the Users entity.
func (*SavesUpdate) SetOwnerID ¶
func (su *SavesUpdate) SetOwnerID(id uint64) *SavesUpdate
SetOwnerID sets the "owner" edge to the Users entity by ID.
func (*SavesUpdate) SetUpdateTime ¶
func (su *SavesUpdate) SetUpdateTime(t time.Time) *SavesUpdate
SetUpdateTime sets the "update_time" field.
func (*SavesUpdate) Where ¶
func (su *SavesUpdate) Where(ps ...predicate.Saves) *SavesUpdate
Where appends a list predicates to the SavesUpdate builder.
type SavesUpdateOne ¶
type SavesUpdateOne struct {
// contains filtered or unexported fields
}
SavesUpdateOne is the builder for updating a single Saves entity.
func (*SavesUpdateOne) AddDir ¶
func (suo *SavesUpdateOne) AddDir(d ...*Dirs) *SavesUpdateOne
AddDir adds the "dir" edges to the Dirs entity.
func (*SavesUpdateOne) AddDirIDs ¶
func (suo *SavesUpdateOne) AddDirIDs(ids ...uint64) *SavesUpdateOne
AddDirIDs adds the "dir" edge to the Dirs entity by IDs.
func (*SavesUpdateOne) ClearCaption ¶
func (suo *SavesUpdateOne) ClearCaption() *SavesUpdateOne
ClearCaption clears the value of the "caption" field.
func (*SavesUpdateOne) ClearDir ¶
func (suo *SavesUpdateOne) ClearDir() *SavesUpdateOne
ClearDir clears all "dir" edges to the Dirs entity.
func (*SavesUpdateOne) ClearFile ¶
func (suo *SavesUpdateOne) ClearFile() *SavesUpdateOne
ClearFile clears the "file" edge to the Files entity.
func (*SavesUpdateOne) ClearOwner ¶
func (suo *SavesUpdateOne) ClearOwner() *SavesUpdateOne
ClearOwner clears the "owner" edge to the Users entity.
func (*SavesUpdateOne) Exec ¶
func (suo *SavesUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*SavesUpdateOne) ExecX ¶
func (suo *SavesUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SavesUpdateOne) Mutation ¶
func (suo *SavesUpdateOne) Mutation() *SavesMutation
Mutation returns the SavesMutation object of the builder.
func (*SavesUpdateOne) RemoveDir ¶
func (suo *SavesUpdateOne) RemoveDir(d ...*Dirs) *SavesUpdateOne
RemoveDir removes "dir" edges to Dirs entities.
func (*SavesUpdateOne) RemoveDirIDs ¶
func (suo *SavesUpdateOne) RemoveDirIDs(ids ...uint64) *SavesUpdateOne
RemoveDirIDs removes the "dir" edge to Dirs entities by IDs.
func (*SavesUpdateOne) Save ¶
func (suo *SavesUpdateOne) Save(ctx context.Context) (*Saves, error)
Save executes the query and returns the updated Saves entity.
func (*SavesUpdateOne) SaveX ¶
func (suo *SavesUpdateOne) SaveX(ctx context.Context) *Saves
SaveX is like Save, but panics if an error occurs.
func (*SavesUpdateOne) Select ¶
func (suo *SavesUpdateOne) Select(field string, fields ...string) *SavesUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*SavesUpdateOne) SetCaption ¶
func (suo *SavesUpdateOne) SetCaption(s string) *SavesUpdateOne
SetCaption sets the "caption" field.
func (*SavesUpdateOne) SetFile ¶
func (suo *SavesUpdateOne) SetFile(f *Files) *SavesUpdateOne
SetFile sets the "file" edge to the Files entity.
func (*SavesUpdateOne) SetFileID ¶
func (suo *SavesUpdateOne) SetFileID(id uint64) *SavesUpdateOne
SetFileID sets the "file" edge to the Files entity by ID.
func (*SavesUpdateOne) SetName ¶
func (suo *SavesUpdateOne) SetName(s string) *SavesUpdateOne
SetName sets the "name" field.
func (*SavesUpdateOne) SetNillableCaption ¶
func (suo *SavesUpdateOne) SetNillableCaption(s *string) *SavesUpdateOne
SetNillableCaption sets the "caption" field if the given value is not nil.
func (*SavesUpdateOne) SetNillableFileID ¶
func (suo *SavesUpdateOne) SetNillableFileID(id *uint64) *SavesUpdateOne
SetNillableFileID sets the "file" edge to the Files entity by ID if the given value is not nil.
func (*SavesUpdateOne) SetNillableName ¶
func (suo *SavesUpdateOne) SetNillableName(s *string) *SavesUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*SavesUpdateOne) SetNillableOwnerID ¶
func (suo *SavesUpdateOne) SetNillableOwnerID(id *uint64) *SavesUpdateOne
SetNillableOwnerID sets the "owner" edge to the Users entity by ID if the given value is not nil.
func (*SavesUpdateOne) SetOwner ¶
func (suo *SavesUpdateOne) SetOwner(u *Users) *SavesUpdateOne
SetOwner sets the "owner" edge to the Users entity.
func (*SavesUpdateOne) SetOwnerID ¶
func (suo *SavesUpdateOne) SetOwnerID(id uint64) *SavesUpdateOne
SetOwnerID sets the "owner" edge to the Users entity by ID.
func (*SavesUpdateOne) SetUpdateTime ¶
func (suo *SavesUpdateOne) SetUpdateTime(t time.Time) *SavesUpdateOne
SetUpdateTime sets the "update_time" field.
func (*SavesUpdateOne) Where ¶
func (suo *SavesUpdateOne) Where(ps ...predicate.Saves) *SavesUpdateOne
Where appends a list predicates to the SavesUpdate builder.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Devices is the client for interacting with the Devices builders. Devices *DevicesClient // Dirs is the client for interacting with the Dirs builders. Dirs *DirsClient // Files is the client for interacting with the Files builders. Files *FilesClient // Saves is the client for interacting with the Saves builders. Saves *SavesClient // Users is the client for interacting with the Users builders. Users *UsersClient // 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 Users ¶
type Users struct { // ID of the ent. ID uint64 `json:"id,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,omitempty"` // Username holds the value of the "username" field. Username string `json:"username,omitempty"` // Password holds the value of the "password" field. Password string `json:"password,omitempty"` // Email holds the value of the "email" field. Email string `json:"email,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Bio holds the value of the "bio" field. Bio string `json:"bio,omitempty"` // Avatar holds the value of the "avatar" field. Avatar string `json:"avatar,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the UsersQuery when eager-loading is set. Edges UsersEdges `json:"edges"` // contains filtered or unexported fields }
Users is the model entity for the Users schema.
func (*Users) QueryDevices ¶
func (u *Users) QueryDevices() *DevicesQuery
QueryDevices queries the "devices" edge of the Users entity.
func (*Users) QuerySaves ¶
func (u *Users) QuerySaves() *SavesQuery
QuerySaves queries the "saves" edge of the Users entity.
func (*Users) Unwrap ¶
Unwrap unwraps the Users 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 (*Users) Update ¶
func (u *Users) Update() *UsersUpdateOne
Update returns a builder for updating this Users. Note that you need to call Users.Unwrap() before calling this method if this Users was returned from a transaction, and the transaction was committed or rolled back.
type UsersClient ¶
type UsersClient struct {
// contains filtered or unexported fields
}
UsersClient is a client for the Users schema.
func NewUsersClient ¶
func NewUsersClient(c config) *UsersClient
NewUsersClient returns a client for the Users from the given config.
func (*UsersClient) Create ¶
func (c *UsersClient) Create() *UsersCreate
Create returns a builder for creating a Users entity.
func (*UsersClient) CreateBulk ¶
func (c *UsersClient) CreateBulk(builders ...*UsersCreate) *UsersCreateBulk
CreateBulk returns a builder for creating a bulk of Users entities.
func (*UsersClient) Delete ¶
func (c *UsersClient) Delete() *UsersDelete
Delete returns a delete builder for Users.
func (*UsersClient) DeleteOne ¶
func (c *UsersClient) DeleteOne(u *Users) *UsersDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UsersClient) DeleteOneID ¶
func (c *UsersClient) DeleteOneID(id uint64) *UsersDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UsersClient) GetX ¶
func (c *UsersClient) GetX(ctx context.Context, id uint64) *Users
GetX is like Get, but panics if an error occurs.
func (*UsersClient) Intercept ¶
func (c *UsersClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `users.Intercept(f(g(h())))`.
func (*UsersClient) Interceptors ¶
func (c *UsersClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*UsersClient) MapCreateBulk ¶
func (c *UsersClient) MapCreateBulk(slice any, setFunc func(*UsersCreate, int)) *UsersCreateBulk
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 (*UsersClient) Query ¶
func (c *UsersClient) Query() *UsersQuery
Query returns a query builder for Users.
func (*UsersClient) QueryDevices ¶
func (c *UsersClient) QueryDevices(u *Users) *DevicesQuery
QueryDevices queries the devices edge of a Users.
func (*UsersClient) QueryDirs ¶
func (c *UsersClient) QueryDirs(u *Users) *DirsQuery
QueryDirs queries the dirs edge of a Users.
func (*UsersClient) QuerySaves ¶
func (c *UsersClient) QuerySaves(u *Users) *SavesQuery
QuerySaves queries the saves edge of a Users.
func (*UsersClient) Update ¶
func (c *UsersClient) Update() *UsersUpdate
Update returns an update builder for Users.
func (*UsersClient) UpdateOne ¶
func (c *UsersClient) UpdateOne(u *Users) *UsersUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UsersClient) UpdateOneID ¶
func (c *UsersClient) UpdateOneID(id uint64) *UsersUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UsersClient) Use ¶
func (c *UsersClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `users.Hooks(f(g(h())))`.
type UsersCreate ¶
type UsersCreate struct {
// contains filtered or unexported fields
}
UsersCreate is the builder for creating a Users entity.
func (*UsersCreate) AddDeviceIDs ¶
func (uc *UsersCreate) AddDeviceIDs(ids ...uint64) *UsersCreate
AddDeviceIDs adds the "devices" edge to the Devices entity by IDs.
func (*UsersCreate) AddDevices ¶
func (uc *UsersCreate) AddDevices(d ...*Devices) *UsersCreate
AddDevices adds the "devices" edges to the Devices entity.
func (*UsersCreate) AddDirIDs ¶
func (uc *UsersCreate) AddDirIDs(ids ...uint64) *UsersCreate
AddDirIDs adds the "dirs" edge to the Dirs entity by IDs.
func (*UsersCreate) AddDirs ¶
func (uc *UsersCreate) AddDirs(d ...*Dirs) *UsersCreate
AddDirs adds the "dirs" edges to the Dirs entity.
func (*UsersCreate) AddSafeIDs ¶
func (uc *UsersCreate) AddSafeIDs(ids ...uint64) *UsersCreate
AddSafeIDs adds the "saves" edge to the Saves entity by IDs.
func (*UsersCreate) AddSaves ¶
func (uc *UsersCreate) AddSaves(s ...*Saves) *UsersCreate
AddSaves adds the "saves" edges to the Saves entity.
func (*UsersCreate) Exec ¶
func (uc *UsersCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UsersCreate) ExecX ¶
func (uc *UsersCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UsersCreate) Mutation ¶
func (uc *UsersCreate) Mutation() *UsersMutation
Mutation returns the UsersMutation object of the builder.
func (*UsersCreate) Save ¶
func (uc *UsersCreate) Save(ctx context.Context) (*Users, error)
Save creates the Users in the database.
func (*UsersCreate) SaveX ¶
func (uc *UsersCreate) SaveX(ctx context.Context) *Users
SaveX calls Save and panics if Save returns an error.
func (*UsersCreate) SetAvatar ¶
func (uc *UsersCreate) SetAvatar(s string) *UsersCreate
SetAvatar sets the "avatar" field.
func (*UsersCreate) SetBio ¶
func (uc *UsersCreate) SetBio(s string) *UsersCreate
SetBio sets the "bio" field.
func (*UsersCreate) SetCreateTime ¶
func (uc *UsersCreate) SetCreateTime(t time.Time) *UsersCreate
SetCreateTime sets the "create_time" field.
func (*UsersCreate) SetEmail ¶
func (uc *UsersCreate) SetEmail(s string) *UsersCreate
SetEmail sets the "email" field.
func (*UsersCreate) SetID ¶
func (uc *UsersCreate) SetID(u uint64) *UsersCreate
SetID sets the "id" field.
func (*UsersCreate) SetName ¶
func (uc *UsersCreate) SetName(s string) *UsersCreate
SetName sets the "name" field.
func (*UsersCreate) SetNillableAvatar ¶
func (uc *UsersCreate) SetNillableAvatar(s *string) *UsersCreate
SetNillableAvatar sets the "avatar" field if the given value is not nil.
func (*UsersCreate) SetNillableBio ¶
func (uc *UsersCreate) SetNillableBio(s *string) *UsersCreate
SetNillableBio sets the "bio" field if the given value is not nil.
func (*UsersCreate) SetNillableCreateTime ¶
func (uc *UsersCreate) SetNillableCreateTime(t *time.Time) *UsersCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*UsersCreate) SetNillableEmail ¶
func (uc *UsersCreate) SetNillableEmail(s *string) *UsersCreate
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UsersCreate) SetNillableName ¶
func (uc *UsersCreate) SetNillableName(s *string) *UsersCreate
SetNillableName sets the "name" field if the given value is not nil.
func (*UsersCreate) SetNillablePassword ¶
func (uc *UsersCreate) SetNillablePassword(s *string) *UsersCreate
SetNillablePassword sets the "password" field if the given value is not nil.
func (*UsersCreate) SetNillableUpdateTime ¶
func (uc *UsersCreate) SetNillableUpdateTime(t *time.Time) *UsersCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*UsersCreate) SetPassword ¶
func (uc *UsersCreate) SetPassword(s string) *UsersCreate
SetPassword sets the "password" field.
func (*UsersCreate) SetUpdateTime ¶
func (uc *UsersCreate) SetUpdateTime(t time.Time) *UsersCreate
SetUpdateTime sets the "update_time" field.
func (*UsersCreate) SetUsername ¶
func (uc *UsersCreate) SetUsername(s string) *UsersCreate
SetUsername sets the "username" field.
type UsersCreateBulk ¶
type UsersCreateBulk struct {
// contains filtered or unexported fields
}
UsersCreateBulk is the builder for creating many Users entities in bulk.
func (*UsersCreateBulk) Exec ¶
func (ucb *UsersCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UsersCreateBulk) ExecX ¶
func (ucb *UsersCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UsersDelete ¶
type UsersDelete struct {
// contains filtered or unexported fields
}
UsersDelete is the builder for deleting a Users entity.
func (*UsersDelete) Exec ¶
func (ud *UsersDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UsersDelete) ExecX ¶
func (ud *UsersDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UsersDelete) Where ¶
func (ud *UsersDelete) Where(ps ...predicate.Users) *UsersDelete
Where appends a list predicates to the UsersDelete builder.
type UsersDeleteOne ¶
type UsersDeleteOne struct {
// contains filtered or unexported fields
}
UsersDeleteOne is the builder for deleting a single Users entity.
func (*UsersDeleteOne) Exec ¶
func (udo *UsersDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UsersDeleteOne) ExecX ¶
func (udo *UsersDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UsersDeleteOne) Where ¶
func (udo *UsersDeleteOne) Where(ps ...predicate.Users) *UsersDeleteOne
Where appends a list predicates to the UsersDelete builder.
type UsersEdges ¶
type UsersEdges struct { // Devices holds the value of the devices edge. Devices []*Devices `json:"devices,omitempty"` // Dirs holds the value of the dirs edge. Dirs []*Dirs `json:"dirs,omitempty"` // Saves holds the value of the saves edge. Saves []*Saves `json:"saves,omitempty"` // contains filtered or unexported fields }
UsersEdges holds the relations/edges for other nodes in the graph.
func (UsersEdges) DevicesOrErr ¶
func (e UsersEdges) DevicesOrErr() ([]*Devices, error)
DevicesOrErr returns the Devices value or an error if the edge was not loaded in eager-loading.
func (UsersEdges) DirsOrErr ¶
func (e UsersEdges) DirsOrErr() ([]*Dirs, error)
DirsOrErr returns the Dirs value or an error if the edge was not loaded in eager-loading.
func (UsersEdges) SavesOrErr ¶
func (e UsersEdges) SavesOrErr() ([]*Saves, error)
SavesOrErr returns the Saves value or an error if the edge was not loaded in eager-loading.
type UsersGroupBy ¶
type UsersGroupBy struct {
// contains filtered or unexported fields
}
UsersGroupBy is the group-by builder for Users entities.
func (*UsersGroupBy) Aggregate ¶
func (ugb *UsersGroupBy) Aggregate(fns ...AggregateFunc) *UsersGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UsersGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UsersGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UsersGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UsersGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UsersGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UsersGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UsersGroupBy) Scan ¶
func (ugb *UsersGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UsersGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UsersMutation ¶
type UsersMutation struct {
// contains filtered or unexported fields
}
UsersMutation represents an operation that mutates the Users nodes in the graph.
func (*UsersMutation) AddDeviceIDs ¶
func (m *UsersMutation) AddDeviceIDs(ids ...uint64)
AddDeviceIDs adds the "devices" edge to the Devices entity by ids.
func (*UsersMutation) AddDirIDs ¶
func (m *UsersMutation) AddDirIDs(ids ...uint64)
AddDirIDs adds the "dirs" edge to the Dirs entity by ids.
func (*UsersMutation) AddField ¶
func (m *UsersMutation) 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 (*UsersMutation) AddSafeIDs ¶
func (m *UsersMutation) AddSafeIDs(ids ...uint64)
AddSafeIDs adds the "saves" edge to the Saves entity by ids.
func (*UsersMutation) AddedEdges ¶
func (m *UsersMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UsersMutation) AddedField ¶
func (m *UsersMutation) 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 (*UsersMutation) AddedFields ¶
func (m *UsersMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UsersMutation) AddedIDs ¶
func (m *UsersMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UsersMutation) Avatar ¶
func (m *UsersMutation) Avatar() (r string, exists bool)
Avatar returns the value of the "avatar" field in the mutation.
func (*UsersMutation) AvatarCleared ¶
func (m *UsersMutation) AvatarCleared() bool
AvatarCleared returns if the "avatar" field was cleared in this mutation.
func (*UsersMutation) Bio ¶
func (m *UsersMutation) Bio() (r string, exists bool)
Bio returns the value of the "bio" field in the mutation.
func (*UsersMutation) BioCleared ¶
func (m *UsersMutation) BioCleared() bool
BioCleared returns if the "bio" field was cleared in this mutation.
func (*UsersMutation) ClearAvatar ¶
func (m *UsersMutation) ClearAvatar()
ClearAvatar clears the value of the "avatar" field.
func (*UsersMutation) ClearBio ¶
func (m *UsersMutation) ClearBio()
ClearBio clears the value of the "bio" field.
func (*UsersMutation) ClearDevices ¶
func (m *UsersMutation) ClearDevices()
ClearDevices clears the "devices" edge to the Devices entity.
func (*UsersMutation) ClearDirs ¶
func (m *UsersMutation) ClearDirs()
ClearDirs clears the "dirs" edge to the Dirs entity.
func (*UsersMutation) ClearEdge ¶
func (m *UsersMutation) 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 (*UsersMutation) ClearEmail ¶
func (m *UsersMutation) ClearEmail()
ClearEmail clears the value of the "email" field.
func (*UsersMutation) ClearField ¶
func (m *UsersMutation) 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 (*UsersMutation) ClearName ¶
func (m *UsersMutation) ClearName()
ClearName clears the value of the "name" field.
func (*UsersMutation) ClearPassword ¶
func (m *UsersMutation) ClearPassword()
ClearPassword clears the value of the "password" field.
func (*UsersMutation) ClearSaves ¶
func (m *UsersMutation) ClearSaves()
ClearSaves clears the "saves" edge to the Saves entity.
func (*UsersMutation) ClearedEdges ¶
func (m *UsersMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UsersMutation) ClearedFields ¶
func (m *UsersMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UsersMutation) Client ¶
func (m UsersMutation) 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 (*UsersMutation) CreateTime ¶
func (m *UsersMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*UsersMutation) DevicesCleared ¶
func (m *UsersMutation) DevicesCleared() bool
DevicesCleared reports if the "devices" edge to the Devices entity was cleared.
func (*UsersMutation) DevicesIDs ¶
func (m *UsersMutation) DevicesIDs() (ids []uint64)
DevicesIDs returns the "devices" edge IDs in the mutation.
func (*UsersMutation) DirsCleared ¶
func (m *UsersMutation) DirsCleared() bool
DirsCleared reports if the "dirs" edge to the Dirs entity was cleared.
func (*UsersMutation) DirsIDs ¶
func (m *UsersMutation) DirsIDs() (ids []uint64)
DirsIDs returns the "dirs" edge IDs in the mutation.
func (*UsersMutation) EdgeCleared ¶
func (m *UsersMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UsersMutation) Email ¶
func (m *UsersMutation) Email() (r string, exists bool)
Email returns the value of the "email" field in the mutation.
func (*UsersMutation) EmailCleared ¶
func (m *UsersMutation) EmailCleared() bool
EmailCleared returns if the "email" field was cleared in this mutation.
func (*UsersMutation) Field ¶
func (m *UsersMutation) 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 (*UsersMutation) FieldCleared ¶
func (m *UsersMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UsersMutation) Fields ¶
func (m *UsersMutation) 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 (*UsersMutation) ID ¶
func (m *UsersMutation) ID() (id uint64, 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 (*UsersMutation) IDs ¶
func (m *UsersMutation) IDs(ctx context.Context) ([]uint64, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*UsersMutation) Name ¶
func (m *UsersMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*UsersMutation) NameCleared ¶
func (m *UsersMutation) NameCleared() bool
NameCleared returns if the "name" field was cleared in this mutation.
func (*UsersMutation) OldAvatar ¶
func (m *UsersMutation) OldAvatar(ctx context.Context) (v string, err error)
OldAvatar returns the old "avatar" field's value of the Users entity. If the Users 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 (*UsersMutation) OldBio ¶
func (m *UsersMutation) OldBio(ctx context.Context) (v string, err error)
OldBio returns the old "bio" field's value of the Users entity. If the Users 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 (*UsersMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the Users entity. If the Users 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 (*UsersMutation) OldEmail ¶
func (m *UsersMutation) OldEmail(ctx context.Context) (v string, err error)
OldEmail returns the old "email" field's value of the Users entity. If the Users 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 (*UsersMutation) 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 (*UsersMutation) OldName ¶
func (m *UsersMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Users entity. If the Users 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 (*UsersMutation) OldPassword ¶
func (m *UsersMutation) OldPassword(ctx context.Context) (v string, err error)
OldPassword returns the old "password" field's value of the Users entity. If the Users 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 (*UsersMutation) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" field's value of the Users entity. If the Users 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 (*UsersMutation) OldUsername ¶
func (m *UsersMutation) OldUsername(ctx context.Context) (v string, err error)
OldUsername returns the old "username" field's value of the Users entity. If the Users 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 (*UsersMutation) Password ¶
func (m *UsersMutation) Password() (r string, exists bool)
Password returns the value of the "password" field in the mutation.
func (*UsersMutation) PasswordCleared ¶
func (m *UsersMutation) PasswordCleared() bool
PasswordCleared returns if the "password" field was cleared in this mutation.
func (*UsersMutation) RemoveDeviceIDs ¶
func (m *UsersMutation) RemoveDeviceIDs(ids ...uint64)
RemoveDeviceIDs removes the "devices" edge to the Devices entity by IDs.
func (*UsersMutation) RemoveDirIDs ¶
func (m *UsersMutation) RemoveDirIDs(ids ...uint64)
RemoveDirIDs removes the "dirs" edge to the Dirs entity by IDs.
func (*UsersMutation) RemoveSafeIDs ¶
func (m *UsersMutation) RemoveSafeIDs(ids ...uint64)
RemoveSafeIDs removes the "saves" edge to the Saves entity by IDs.
func (*UsersMutation) RemovedDevicesIDs ¶
func (m *UsersMutation) RemovedDevicesIDs() (ids []uint64)
RemovedDevices returns the removed IDs of the "devices" edge to the Devices entity.
func (*UsersMutation) RemovedDirsIDs ¶
func (m *UsersMutation) RemovedDirsIDs() (ids []uint64)
RemovedDirs returns the removed IDs of the "dirs" edge to the Dirs entity.
func (*UsersMutation) RemovedEdges ¶
func (m *UsersMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UsersMutation) RemovedIDs ¶
func (m *UsersMutation) 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 (*UsersMutation) RemovedSavesIDs ¶
func (m *UsersMutation) RemovedSavesIDs() (ids []uint64)
RemovedSaves returns the removed IDs of the "saves" edge to the Saves entity.
func (*UsersMutation) ResetAvatar ¶
func (m *UsersMutation) ResetAvatar()
ResetAvatar resets all changes to the "avatar" field.
func (*UsersMutation) ResetBio ¶
func (m *UsersMutation) ResetBio()
ResetBio resets all changes to the "bio" field.
func (*UsersMutation) ResetCreateTime ¶
func (m *UsersMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*UsersMutation) ResetDevices ¶
func (m *UsersMutation) ResetDevices()
ResetDevices resets all changes to the "devices" edge.
func (*UsersMutation) ResetDirs ¶
func (m *UsersMutation) ResetDirs()
ResetDirs resets all changes to the "dirs" edge.
func (*UsersMutation) ResetEdge ¶
func (m *UsersMutation) 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 (*UsersMutation) ResetEmail ¶
func (m *UsersMutation) ResetEmail()
ResetEmail resets all changes to the "email" field.
func (*UsersMutation) ResetField ¶
func (m *UsersMutation) 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 (*UsersMutation) ResetName ¶
func (m *UsersMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*UsersMutation) ResetPassword ¶
func (m *UsersMutation) ResetPassword()
ResetPassword resets all changes to the "password" field.
func (*UsersMutation) ResetSaves ¶
func (m *UsersMutation) ResetSaves()
ResetSaves resets all changes to the "saves" edge.
func (*UsersMutation) ResetUpdateTime ¶
func (m *UsersMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*UsersMutation) ResetUsername ¶
func (m *UsersMutation) ResetUsername()
ResetUsername resets all changes to the "username" field.
func (*UsersMutation) SavesCleared ¶
func (m *UsersMutation) SavesCleared() bool
SavesCleared reports if the "saves" edge to the Saves entity was cleared.
func (*UsersMutation) SavesIDs ¶
func (m *UsersMutation) SavesIDs() (ids []uint64)
SavesIDs returns the "saves" edge IDs in the mutation.
func (*UsersMutation) SetAvatar ¶
func (m *UsersMutation) SetAvatar(s string)
SetAvatar sets the "avatar" field.
func (*UsersMutation) SetBio ¶
func (m *UsersMutation) SetBio(s string)
SetBio sets the "bio" field.
func (*UsersMutation) SetCreateTime ¶
func (m *UsersMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*UsersMutation) SetEmail ¶
func (m *UsersMutation) SetEmail(s string)
SetEmail sets the "email" field.
func (*UsersMutation) SetField ¶
func (m *UsersMutation) 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 (*UsersMutation) SetID ¶
func (m *UsersMutation) SetID(id uint64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Users entities.
func (*UsersMutation) SetName ¶
func (m *UsersMutation) SetName(s string)
SetName sets the "name" field.
func (*UsersMutation) SetOp ¶
func (m *UsersMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UsersMutation) SetPassword ¶
func (m *UsersMutation) SetPassword(s string)
SetPassword sets the "password" field.
func (*UsersMutation) SetUpdateTime ¶
func (m *UsersMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (*UsersMutation) SetUsername ¶
func (m *UsersMutation) SetUsername(s string)
SetUsername sets the "username" field.
func (UsersMutation) Tx ¶
func (m UsersMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UsersMutation) Type ¶
func (m *UsersMutation) Type() string
Type returns the node type of this mutation (Users).
func (*UsersMutation) UpdateTime ¶
func (m *UsersMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*UsersMutation) Username ¶
func (m *UsersMutation) Username() (r string, exists bool)
Username returns the value of the "username" field in the mutation.
func (*UsersMutation) Where ¶
func (m *UsersMutation) Where(ps ...predicate.Users)
Where appends a list predicates to the UsersMutation builder.
func (*UsersMutation) WhereP ¶
func (m *UsersMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UsersMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UsersQuery ¶
type UsersQuery struct {
// contains filtered or unexported fields
}
UsersQuery is the builder for querying Users entities.
func (*UsersQuery) Aggregate ¶
func (uq *UsersQuery) Aggregate(fns ...AggregateFunc) *UsersSelect
Aggregate returns a UsersSelect configured with the given aggregations.
func (*UsersQuery) All ¶
func (uq *UsersQuery) All(ctx context.Context) ([]*Users, error)
All executes the query and returns a list of UsersSlice.
func (*UsersQuery) AllX ¶
func (uq *UsersQuery) AllX(ctx context.Context) []*Users
AllX is like All, but panics if an error occurs.
func (*UsersQuery) Clone ¶
func (uq *UsersQuery) Clone() *UsersQuery
Clone returns a duplicate of the UsersQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UsersQuery) Count ¶
func (uq *UsersQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*UsersQuery) CountX ¶
func (uq *UsersQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*UsersQuery) Exist ¶
func (uq *UsersQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*UsersQuery) ExistX ¶
func (uq *UsersQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*UsersQuery) First ¶
func (uq *UsersQuery) First(ctx context.Context) (*Users, error)
First returns the first Users entity from the query. Returns a *NotFoundError when no Users was found.
func (*UsersQuery) FirstID ¶
func (uq *UsersQuery) FirstID(ctx context.Context) (id uint64, err error)
FirstID returns the first Users ID from the query. Returns a *NotFoundError when no Users ID was found.
func (*UsersQuery) FirstIDX ¶
func (uq *UsersQuery) FirstIDX(ctx context.Context) uint64
FirstIDX is like FirstID, but panics if an error occurs.
func (*UsersQuery) FirstX ¶
func (uq *UsersQuery) FirstX(ctx context.Context) *Users
FirstX is like First, but panics if an error occurs.
func (*UsersQuery) GroupBy ¶
func (uq *UsersQuery) GroupBy(field string, fields ...string) *UsersGroupBy
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 { CreateTime time.Time `json:"create_time,omitempty"` Count int `json:"count,omitempty"` } client.Users.Query(). GroupBy(users.FieldCreateTime). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UsersQuery) IDs ¶
func (uq *UsersQuery) IDs(ctx context.Context) (ids []uint64, err error)
IDs executes the query and returns a list of Users IDs.
func (*UsersQuery) IDsX ¶
func (uq *UsersQuery) IDsX(ctx context.Context) []uint64
IDsX is like IDs, but panics if an error occurs.
func (*UsersQuery) Limit ¶
func (uq *UsersQuery) Limit(limit int) *UsersQuery
Limit the number of records to be returned by this query.
func (*UsersQuery) Offset ¶
func (uq *UsersQuery) Offset(offset int) *UsersQuery
Offset to start from.
func (*UsersQuery) Only ¶
func (uq *UsersQuery) Only(ctx context.Context) (*Users, error)
Only returns a single Users entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Users entity is found. Returns a *NotFoundError when no Users entities are found.
func (*UsersQuery) OnlyID ¶
func (uq *UsersQuery) OnlyID(ctx context.Context) (id uint64, err error)
OnlyID is like Only, but returns the only Users ID in the query. Returns a *NotSingularError when more than one Users ID is found. Returns a *NotFoundError when no entities are found.
func (*UsersQuery) OnlyIDX ¶
func (uq *UsersQuery) OnlyIDX(ctx context.Context) uint64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*UsersQuery) OnlyX ¶
func (uq *UsersQuery) OnlyX(ctx context.Context) *Users
OnlyX is like Only, but panics if an error occurs.
func (*UsersQuery) Order ¶
func (uq *UsersQuery) Order(o ...users.OrderOption) *UsersQuery
Order specifies how the records should be ordered.
func (*UsersQuery) QueryDevices ¶
func (uq *UsersQuery) QueryDevices() *DevicesQuery
QueryDevices chains the current query on the "devices" edge.
func (*UsersQuery) QueryDirs ¶
func (uq *UsersQuery) QueryDirs() *DirsQuery
QueryDirs chains the current query on the "dirs" edge.
func (*UsersQuery) QuerySaves ¶
func (uq *UsersQuery) QuerySaves() *SavesQuery
QuerySaves chains the current query on the "saves" edge.
func (*UsersQuery) Select ¶
func (uq *UsersQuery) Select(fields ...string) *UsersSelect
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 { CreateTime time.Time `json:"create_time,omitempty"` } client.Users.Query(). Select(users.FieldCreateTime). Scan(ctx, &v)
func (*UsersQuery) Unique ¶
func (uq *UsersQuery) Unique(unique bool) *UsersQuery
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 (*UsersQuery) Where ¶
func (uq *UsersQuery) Where(ps ...predicate.Users) *UsersQuery
Where adds a new predicate for the UsersQuery builder.
func (*UsersQuery) WithDevices ¶
func (uq *UsersQuery) WithDevices(opts ...func(*DevicesQuery)) *UsersQuery
WithDevices tells the query-builder to eager-load the nodes that are connected to the "devices" edge. The optional arguments are used to configure the query builder of the edge.
func (*UsersQuery) WithDirs ¶
func (uq *UsersQuery) WithDirs(opts ...func(*DirsQuery)) *UsersQuery
WithDirs tells the query-builder to eager-load the nodes that are connected to the "dirs" edge. The optional arguments are used to configure the query builder of the edge.
func (*UsersQuery) WithSaves ¶
func (uq *UsersQuery) WithSaves(opts ...func(*SavesQuery)) *UsersQuery
WithSaves tells the query-builder to eager-load the nodes that are connected to the "saves" edge. The optional arguments are used to configure the query builder of the edge.
type UsersSelect ¶
type UsersSelect struct { *UsersQuery // contains filtered or unexported fields }
UsersSelect is the builder for selecting fields of Users entities.
func (*UsersSelect) Aggregate ¶
func (us *UsersSelect) Aggregate(fns ...AggregateFunc) *UsersSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UsersSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UsersSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UsersSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UsersSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UsersSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UsersSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UsersSelect) Scan ¶
func (us *UsersSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UsersSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UsersUpdate ¶
type UsersUpdate struct {
// contains filtered or unexported fields
}
UsersUpdate is the builder for updating Users entities.
func (*UsersUpdate) AddDeviceIDs ¶
func (uu *UsersUpdate) AddDeviceIDs(ids ...uint64) *UsersUpdate
AddDeviceIDs adds the "devices" edge to the Devices entity by IDs.
func (*UsersUpdate) AddDevices ¶
func (uu *UsersUpdate) AddDevices(d ...*Devices) *UsersUpdate
AddDevices adds the "devices" edges to the Devices entity.
func (*UsersUpdate) AddDirIDs ¶
func (uu *UsersUpdate) AddDirIDs(ids ...uint64) *UsersUpdate
AddDirIDs adds the "dirs" edge to the Dirs entity by IDs.
func (*UsersUpdate) AddDirs ¶
func (uu *UsersUpdate) AddDirs(d ...*Dirs) *UsersUpdate
AddDirs adds the "dirs" edges to the Dirs entity.
func (*UsersUpdate) AddSafeIDs ¶
func (uu *UsersUpdate) AddSafeIDs(ids ...uint64) *UsersUpdate
AddSafeIDs adds the "saves" edge to the Saves entity by IDs.
func (*UsersUpdate) AddSaves ¶
func (uu *UsersUpdate) AddSaves(s ...*Saves) *UsersUpdate
AddSaves adds the "saves" edges to the Saves entity.
func (*UsersUpdate) ClearAvatar ¶
func (uu *UsersUpdate) ClearAvatar() *UsersUpdate
ClearAvatar clears the value of the "avatar" field.
func (*UsersUpdate) ClearBio ¶
func (uu *UsersUpdate) ClearBio() *UsersUpdate
ClearBio clears the value of the "bio" field.
func (*UsersUpdate) ClearDevices ¶
func (uu *UsersUpdate) ClearDevices() *UsersUpdate
ClearDevices clears all "devices" edges to the Devices entity.
func (*UsersUpdate) ClearDirs ¶
func (uu *UsersUpdate) ClearDirs() *UsersUpdate
ClearDirs clears all "dirs" edges to the Dirs entity.
func (*UsersUpdate) ClearEmail ¶
func (uu *UsersUpdate) ClearEmail() *UsersUpdate
ClearEmail clears the value of the "email" field.
func (*UsersUpdate) ClearName ¶
func (uu *UsersUpdate) ClearName() *UsersUpdate
ClearName clears the value of the "name" field.
func (*UsersUpdate) ClearPassword ¶
func (uu *UsersUpdate) ClearPassword() *UsersUpdate
ClearPassword clears the value of the "password" field.
func (*UsersUpdate) ClearSaves ¶
func (uu *UsersUpdate) ClearSaves() *UsersUpdate
ClearSaves clears all "saves" edges to the Saves entity.
func (*UsersUpdate) Exec ¶
func (uu *UsersUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UsersUpdate) ExecX ¶
func (uu *UsersUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UsersUpdate) Mutation ¶
func (uu *UsersUpdate) Mutation() *UsersMutation
Mutation returns the UsersMutation object of the builder.
func (*UsersUpdate) RemoveDeviceIDs ¶
func (uu *UsersUpdate) RemoveDeviceIDs(ids ...uint64) *UsersUpdate
RemoveDeviceIDs removes the "devices" edge to Devices entities by IDs.
func (*UsersUpdate) RemoveDevices ¶
func (uu *UsersUpdate) RemoveDevices(d ...*Devices) *UsersUpdate
RemoveDevices removes "devices" edges to Devices entities.
func (*UsersUpdate) RemoveDirIDs ¶
func (uu *UsersUpdate) RemoveDirIDs(ids ...uint64) *UsersUpdate
RemoveDirIDs removes the "dirs" edge to Dirs entities by IDs.
func (*UsersUpdate) RemoveDirs ¶
func (uu *UsersUpdate) RemoveDirs(d ...*Dirs) *UsersUpdate
RemoveDirs removes "dirs" edges to Dirs entities.
func (*UsersUpdate) RemoveSafeIDs ¶
func (uu *UsersUpdate) RemoveSafeIDs(ids ...uint64) *UsersUpdate
RemoveSafeIDs removes the "saves" edge to Saves entities by IDs.
func (*UsersUpdate) RemoveSaves ¶
func (uu *UsersUpdate) RemoveSaves(s ...*Saves) *UsersUpdate
RemoveSaves removes "saves" edges to Saves entities.
func (*UsersUpdate) Save ¶
func (uu *UsersUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UsersUpdate) SaveX ¶
func (uu *UsersUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UsersUpdate) SetAvatar ¶
func (uu *UsersUpdate) SetAvatar(s string) *UsersUpdate
SetAvatar sets the "avatar" field.
func (*UsersUpdate) SetBio ¶
func (uu *UsersUpdate) SetBio(s string) *UsersUpdate
SetBio sets the "bio" field.
func (*UsersUpdate) SetEmail ¶
func (uu *UsersUpdate) SetEmail(s string) *UsersUpdate
SetEmail sets the "email" field.
func (*UsersUpdate) SetName ¶
func (uu *UsersUpdate) SetName(s string) *UsersUpdate
SetName sets the "name" field.
func (*UsersUpdate) SetNillableAvatar ¶
func (uu *UsersUpdate) SetNillableAvatar(s *string) *UsersUpdate
SetNillableAvatar sets the "avatar" field if the given value is not nil.
func (*UsersUpdate) SetNillableBio ¶
func (uu *UsersUpdate) SetNillableBio(s *string) *UsersUpdate
SetNillableBio sets the "bio" field if the given value is not nil.
func (*UsersUpdate) SetNillableEmail ¶
func (uu *UsersUpdate) SetNillableEmail(s *string) *UsersUpdate
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UsersUpdate) SetNillableName ¶
func (uu *UsersUpdate) SetNillableName(s *string) *UsersUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*UsersUpdate) SetNillablePassword ¶
func (uu *UsersUpdate) SetNillablePassword(s *string) *UsersUpdate
SetNillablePassword sets the "password" field if the given value is not nil.
func (*UsersUpdate) SetNillableUsername ¶
func (uu *UsersUpdate) SetNillableUsername(s *string) *UsersUpdate
SetNillableUsername sets the "username" field if the given value is not nil.
func (*UsersUpdate) SetPassword ¶
func (uu *UsersUpdate) SetPassword(s string) *UsersUpdate
SetPassword sets the "password" field.
func (*UsersUpdate) SetUpdateTime ¶
func (uu *UsersUpdate) SetUpdateTime(t time.Time) *UsersUpdate
SetUpdateTime sets the "update_time" field.
func (*UsersUpdate) SetUsername ¶
func (uu *UsersUpdate) SetUsername(s string) *UsersUpdate
SetUsername sets the "username" field.
func (*UsersUpdate) Where ¶
func (uu *UsersUpdate) Where(ps ...predicate.Users) *UsersUpdate
Where appends a list predicates to the UsersUpdate builder.
type UsersUpdateOne ¶
type UsersUpdateOne struct {
// contains filtered or unexported fields
}
UsersUpdateOne is the builder for updating a single Users entity.
func (*UsersUpdateOne) AddDeviceIDs ¶
func (uuo *UsersUpdateOne) AddDeviceIDs(ids ...uint64) *UsersUpdateOne
AddDeviceIDs adds the "devices" edge to the Devices entity by IDs.
func (*UsersUpdateOne) AddDevices ¶
func (uuo *UsersUpdateOne) AddDevices(d ...*Devices) *UsersUpdateOne
AddDevices adds the "devices" edges to the Devices entity.
func (*UsersUpdateOne) AddDirIDs ¶
func (uuo *UsersUpdateOne) AddDirIDs(ids ...uint64) *UsersUpdateOne
AddDirIDs adds the "dirs" edge to the Dirs entity by IDs.
func (*UsersUpdateOne) AddDirs ¶
func (uuo *UsersUpdateOne) AddDirs(d ...*Dirs) *UsersUpdateOne
AddDirs adds the "dirs" edges to the Dirs entity.
func (*UsersUpdateOne) AddSafeIDs ¶
func (uuo *UsersUpdateOne) AddSafeIDs(ids ...uint64) *UsersUpdateOne
AddSafeIDs adds the "saves" edge to the Saves entity by IDs.
func (*UsersUpdateOne) AddSaves ¶
func (uuo *UsersUpdateOne) AddSaves(s ...*Saves) *UsersUpdateOne
AddSaves adds the "saves" edges to the Saves entity.
func (*UsersUpdateOne) ClearAvatar ¶
func (uuo *UsersUpdateOne) ClearAvatar() *UsersUpdateOne
ClearAvatar clears the value of the "avatar" field.
func (*UsersUpdateOne) ClearBio ¶
func (uuo *UsersUpdateOne) ClearBio() *UsersUpdateOne
ClearBio clears the value of the "bio" field.
func (*UsersUpdateOne) ClearDevices ¶
func (uuo *UsersUpdateOne) ClearDevices() *UsersUpdateOne
ClearDevices clears all "devices" edges to the Devices entity.
func (*UsersUpdateOne) ClearDirs ¶
func (uuo *UsersUpdateOne) ClearDirs() *UsersUpdateOne
ClearDirs clears all "dirs" edges to the Dirs entity.
func (*UsersUpdateOne) ClearEmail ¶
func (uuo *UsersUpdateOne) ClearEmail() *UsersUpdateOne
ClearEmail clears the value of the "email" field.
func (*UsersUpdateOne) ClearName ¶
func (uuo *UsersUpdateOne) ClearName() *UsersUpdateOne
ClearName clears the value of the "name" field.
func (*UsersUpdateOne) ClearPassword ¶
func (uuo *UsersUpdateOne) ClearPassword() *UsersUpdateOne
ClearPassword clears the value of the "password" field.
func (*UsersUpdateOne) ClearSaves ¶
func (uuo *UsersUpdateOne) ClearSaves() *UsersUpdateOne
ClearSaves clears all "saves" edges to the Saves entity.
func (*UsersUpdateOne) Exec ¶
func (uuo *UsersUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UsersUpdateOne) ExecX ¶
func (uuo *UsersUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UsersUpdateOne) Mutation ¶
func (uuo *UsersUpdateOne) Mutation() *UsersMutation
Mutation returns the UsersMutation object of the builder.
func (*UsersUpdateOne) RemoveDeviceIDs ¶
func (uuo *UsersUpdateOne) RemoveDeviceIDs(ids ...uint64) *UsersUpdateOne
RemoveDeviceIDs removes the "devices" edge to Devices entities by IDs.
func (*UsersUpdateOne) RemoveDevices ¶
func (uuo *UsersUpdateOne) RemoveDevices(d ...*Devices) *UsersUpdateOne
RemoveDevices removes "devices" edges to Devices entities.
func (*UsersUpdateOne) RemoveDirIDs ¶
func (uuo *UsersUpdateOne) RemoveDirIDs(ids ...uint64) *UsersUpdateOne
RemoveDirIDs removes the "dirs" edge to Dirs entities by IDs.
func (*UsersUpdateOne) RemoveDirs ¶
func (uuo *UsersUpdateOne) RemoveDirs(d ...*Dirs) *UsersUpdateOne
RemoveDirs removes "dirs" edges to Dirs entities.
func (*UsersUpdateOne) RemoveSafeIDs ¶
func (uuo *UsersUpdateOne) RemoveSafeIDs(ids ...uint64) *UsersUpdateOne
RemoveSafeIDs removes the "saves" edge to Saves entities by IDs.
func (*UsersUpdateOne) RemoveSaves ¶
func (uuo *UsersUpdateOne) RemoveSaves(s ...*Saves) *UsersUpdateOne
RemoveSaves removes "saves" edges to Saves entities.
func (*UsersUpdateOne) Save ¶
func (uuo *UsersUpdateOne) Save(ctx context.Context) (*Users, error)
Save executes the query and returns the updated Users entity.
func (*UsersUpdateOne) SaveX ¶
func (uuo *UsersUpdateOne) SaveX(ctx context.Context) *Users
SaveX is like Save, but panics if an error occurs.
func (*UsersUpdateOne) Select ¶
func (uuo *UsersUpdateOne) Select(field string, fields ...string) *UsersUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UsersUpdateOne) SetAvatar ¶
func (uuo *UsersUpdateOne) SetAvatar(s string) *UsersUpdateOne
SetAvatar sets the "avatar" field.
func (*UsersUpdateOne) SetBio ¶
func (uuo *UsersUpdateOne) SetBio(s string) *UsersUpdateOne
SetBio sets the "bio" field.
func (*UsersUpdateOne) SetEmail ¶
func (uuo *UsersUpdateOne) SetEmail(s string) *UsersUpdateOne
SetEmail sets the "email" field.
func (*UsersUpdateOne) SetName ¶
func (uuo *UsersUpdateOne) SetName(s string) *UsersUpdateOne
SetName sets the "name" field.
func (*UsersUpdateOne) SetNillableAvatar ¶
func (uuo *UsersUpdateOne) SetNillableAvatar(s *string) *UsersUpdateOne
SetNillableAvatar sets the "avatar" field if the given value is not nil.
func (*UsersUpdateOne) SetNillableBio ¶
func (uuo *UsersUpdateOne) SetNillableBio(s *string) *UsersUpdateOne
SetNillableBio sets the "bio" field if the given value is not nil.
func (*UsersUpdateOne) SetNillableEmail ¶
func (uuo *UsersUpdateOne) SetNillableEmail(s *string) *UsersUpdateOne
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UsersUpdateOne) SetNillableName ¶
func (uuo *UsersUpdateOne) SetNillableName(s *string) *UsersUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*UsersUpdateOne) SetNillablePassword ¶
func (uuo *UsersUpdateOne) SetNillablePassword(s *string) *UsersUpdateOne
SetNillablePassword sets the "password" field if the given value is not nil.
func (*UsersUpdateOne) SetNillableUsername ¶
func (uuo *UsersUpdateOne) SetNillableUsername(s *string) *UsersUpdateOne
SetNillableUsername sets the "username" field if the given value is not nil.
func (*UsersUpdateOne) SetPassword ¶
func (uuo *UsersUpdateOne) SetPassword(s string) *UsersUpdateOne
SetPassword sets the "password" field.
func (*UsersUpdateOne) SetUpdateTime ¶
func (uuo *UsersUpdateOne) SetUpdateTime(t time.Time) *UsersUpdateOne
SetUpdateTime sets the "update_time" field.
func (*UsersUpdateOne) SetUsername ¶
func (uuo *UsersUpdateOne) SetUsername(s string) *UsersUpdateOne
SetUsername sets the "username" field.
func (*UsersUpdateOne) Where ¶
func (uuo *UsersUpdateOne) Where(ps ...predicate.Users) *UsersUpdateOne
Where appends a list predicates to the UsersUpdate builder.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
Source Files
¶
- client.go
- devices.go
- devices_create.go
- devices_delete.go
- devices_query.go
- devices_update.go
- dirs.go
- dirs_create.go
- dirs_delete.go
- dirs_query.go
- dirs_update.go
- ent.go
- files.go
- files_create.go
- files_delete.go
- files_query.go
- files_update.go
- generate.go
- mutation.go
- runtime.go
- saves.go
- saves_create.go
- saves_delete.go
- saves_query.go
- saves_update.go
- tx.go
- users.go
- users_create.go
- users_delete.go
- users_query.go
- users_update.go