Documentation ¶
Index ¶
- Constants
- 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 Car
- type CarClient
- func (c *CarClient) Create() *CarCreate
- func (c *CarClient) CreateBulk(builders ...*CarCreate) *CarCreateBulk
- func (c *CarClient) Delete() *CarDelete
- func (c *CarClient) DeleteOne(ca *Car) *CarDeleteOne
- func (c *CarClient) DeleteOneID(id uuid.UUID) *CarDeleteOne
- func (c *CarClient) Get(ctx context.Context, id uuid.UUID) (*Car, error)
- func (c *CarClient) GetX(ctx context.Context, id uuid.UUID) *Car
- func (c *CarClient) Hooks() []Hook
- func (c *CarClient) Query() *CarQuery
- func (c *CarClient) QueryRentals(ca *Car) *RentalQuery
- func (c *CarClient) Update() *CarUpdate
- func (c *CarClient) UpdateOne(ca *Car) *CarUpdateOne
- func (c *CarClient) UpdateOneID(id uuid.UUID) *CarUpdateOne
- func (c *CarClient) Use(hooks ...Hook)
- type CarCreate
- func (cc *CarCreate) AddRentalIDs(ids ...int) *CarCreate
- func (cc *CarCreate) AddRentals(r ...*Rental) *CarCreate
- func (cc *CarCreate) Exec(ctx context.Context) error
- func (cc *CarCreate) ExecX(ctx context.Context)
- func (cc *CarCreate) Mutation() *CarMutation
- func (cc *CarCreate) Save(ctx context.Context) (*Car, error)
- func (cc *CarCreate) SaveX(ctx context.Context) *Car
- func (cc *CarCreate) SetID(u uuid.UUID) *CarCreate
- func (cc *CarCreate) SetNillableID(u *uuid.UUID) *CarCreate
- func (cc *CarCreate) SetNillableNumber(s *string) *CarCreate
- func (cc *CarCreate) SetNumber(s string) *CarCreate
- type CarCreateBulk
- type CarDelete
- type CarDeleteOne
- type CarEdges
- type CarGroupBy
- func (cgb *CarGroupBy) Aggregate(fns ...AggregateFunc) *CarGroupBy
- func (s *CarGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *CarGroupBy) BoolX(ctx context.Context) bool
- func (s *CarGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *CarGroupBy) BoolsX(ctx context.Context) []bool
- func (s *CarGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *CarGroupBy) Float64X(ctx context.Context) float64
- func (s *CarGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *CarGroupBy) Float64sX(ctx context.Context) []float64
- func (s *CarGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *CarGroupBy) IntX(ctx context.Context) int
- func (s *CarGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *CarGroupBy) IntsX(ctx context.Context) []int
- func (cgb *CarGroupBy) Scan(ctx context.Context, v interface{}) error
- func (s *CarGroupBy) ScanX(ctx context.Context, v interface{})
- func (s *CarGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *CarGroupBy) StringX(ctx context.Context) string
- func (s *CarGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *CarGroupBy) StringsX(ctx context.Context) []string
- type CarMutation
- func (m *CarMutation) AddField(name string, value ent.Value) error
- func (m *CarMutation) AddRentalIDs(ids ...int)
- func (m *CarMutation) AddedEdges() []string
- func (m *CarMutation) AddedField(name string) (ent.Value, bool)
- func (m *CarMutation) AddedFields() []string
- func (m *CarMutation) AddedIDs(name string) []ent.Value
- func (m *CarMutation) ClearEdge(name string) error
- func (m *CarMutation) ClearField(name string) error
- func (m *CarMutation) ClearNumber()
- func (m *CarMutation) ClearRentals()
- func (m *CarMutation) ClearedEdges() []string
- func (m *CarMutation) ClearedFields() []string
- func (m CarMutation) Client() *Client
- func (m *CarMutation) EdgeCleared(name string) bool
- func (m *CarMutation) Field(name string) (ent.Value, bool)
- func (m *CarMutation) FieldCleared(name string) bool
- func (m *CarMutation) Fields() []string
- func (m *CarMutation) ID() (id uuid.UUID, exists bool)
- func (m *CarMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *CarMutation) Number() (r string, exists bool)
- func (m *CarMutation) NumberCleared() bool
- func (m *CarMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CarMutation) OldNumber(ctx context.Context) (v string, err error)
- func (m *CarMutation) Op() Op
- func (m *CarMutation) RemoveRentalIDs(ids ...int)
- func (m *CarMutation) RemovedEdges() []string
- func (m *CarMutation) RemovedIDs(name string) []ent.Value
- func (m *CarMutation) RemovedRentalsIDs() (ids []int)
- func (m *CarMutation) RentalsCleared() bool
- func (m *CarMutation) RentalsIDs() (ids []int)
- func (m *CarMutation) ResetEdge(name string) error
- func (m *CarMutation) ResetField(name string) error
- func (m *CarMutation) ResetNumber()
- func (m *CarMutation) ResetRentals()
- func (m *CarMutation) SetField(name string, value ent.Value) error
- func (m *CarMutation) SetID(id uuid.UUID)
- func (m *CarMutation) SetNumber(s string)
- func (m CarMutation) Tx() (*Tx, error)
- func (m *CarMutation) Type() string
- func (m *CarMutation) Where(ps ...predicate.Car)
- type CarQuery
- func (cq *CarQuery) All(ctx context.Context) ([]*Car, error)
- func (cq *CarQuery) AllX(ctx context.Context) []*Car
- func (cq *CarQuery) Clone() *CarQuery
- func (cq *CarQuery) Count(ctx context.Context) (int, error)
- func (cq *CarQuery) CountX(ctx context.Context) int
- func (cq *CarQuery) Exist(ctx context.Context) (bool, error)
- func (cq *CarQuery) ExistX(ctx context.Context) bool
- func (cq *CarQuery) First(ctx context.Context) (*Car, error)
- func (cq *CarQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (cq *CarQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (cq *CarQuery) FirstX(ctx context.Context) *Car
- func (cq *CarQuery) GroupBy(field string, fields ...string) *CarGroupBy
- func (cq *CarQuery) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (cq *CarQuery) IDsX(ctx context.Context) []uuid.UUID
- func (cq *CarQuery) Limit(limit int) *CarQuery
- func (cq *CarQuery) Offset(offset int) *CarQuery
- func (cq *CarQuery) Only(ctx context.Context) (*Car, error)
- func (cq *CarQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (cq *CarQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (cq *CarQuery) OnlyX(ctx context.Context) *Car
- func (cq *CarQuery) Order(o ...OrderFunc) *CarQuery
- func (cq *CarQuery) QueryRentals() *RentalQuery
- func (cq *CarQuery) Select(fields ...string) *CarSelect
- func (cq *CarQuery) Unique(unique bool) *CarQuery
- func (cq *CarQuery) Where(ps ...predicate.Car) *CarQuery
- func (cq *CarQuery) WithRentals(opts ...func(*RentalQuery)) *CarQuery
- type CarSelect
- func (s *CarSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *CarSelect) BoolX(ctx context.Context) bool
- func (s *CarSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *CarSelect) BoolsX(ctx context.Context) []bool
- func (s *CarSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *CarSelect) Float64X(ctx context.Context) float64
- func (s *CarSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *CarSelect) Float64sX(ctx context.Context) []float64
- func (s *CarSelect) Int(ctx context.Context) (_ int, err error)
- func (s *CarSelect) IntX(ctx context.Context) int
- func (s *CarSelect) Ints(ctx context.Context) ([]int, error)
- func (s *CarSelect) IntsX(ctx context.Context) []int
- func (cs *CarSelect) Scan(ctx context.Context, v interface{}) error
- func (s *CarSelect) ScanX(ctx context.Context, v interface{})
- func (s *CarSelect) String(ctx context.Context) (_ string, err error)
- func (s *CarSelect) StringX(ctx context.Context) string
- func (s *CarSelect) Strings(ctx context.Context) ([]string, error)
- func (s *CarSelect) StringsX(ctx context.Context) []string
- type CarUpdate
- func (cu *CarUpdate) AddRentalIDs(ids ...int) *CarUpdate
- func (cu *CarUpdate) AddRentals(r ...*Rental) *CarUpdate
- func (cu *CarUpdate) ClearNumber() *CarUpdate
- func (cu *CarUpdate) ClearRentals() *CarUpdate
- func (cu *CarUpdate) Exec(ctx context.Context) error
- func (cu *CarUpdate) ExecX(ctx context.Context)
- func (cu *CarUpdate) Mutation() *CarMutation
- func (cu *CarUpdate) RemoveRentalIDs(ids ...int) *CarUpdate
- func (cu *CarUpdate) RemoveRentals(r ...*Rental) *CarUpdate
- func (cu *CarUpdate) Save(ctx context.Context) (int, error)
- func (cu *CarUpdate) SaveX(ctx context.Context) int
- func (cu *CarUpdate) SetNillableNumber(s *string) *CarUpdate
- func (cu *CarUpdate) SetNumber(s string) *CarUpdate
- func (cu *CarUpdate) Where(ps ...predicate.Car) *CarUpdate
- type CarUpdateOne
- func (cuo *CarUpdateOne) AddRentalIDs(ids ...int) *CarUpdateOne
- func (cuo *CarUpdateOne) AddRentals(r ...*Rental) *CarUpdateOne
- func (cuo *CarUpdateOne) ClearNumber() *CarUpdateOne
- func (cuo *CarUpdateOne) ClearRentals() *CarUpdateOne
- func (cuo *CarUpdateOne) Exec(ctx context.Context) error
- func (cuo *CarUpdateOne) ExecX(ctx context.Context)
- func (cuo *CarUpdateOne) Mutation() *CarMutation
- func (cuo *CarUpdateOne) RemoveRentalIDs(ids ...int) *CarUpdateOne
- func (cuo *CarUpdateOne) RemoveRentals(r ...*Rental) *CarUpdateOne
- func (cuo *CarUpdateOne) Save(ctx context.Context) (*Car, error)
- func (cuo *CarUpdateOne) SaveX(ctx context.Context) *Car
- func (cuo *CarUpdateOne) Select(field string, fields ...string) *CarUpdateOne
- func (cuo *CarUpdateOne) SetNillableNumber(s *string) *CarUpdateOne
- func (cuo *CarUpdateOne) SetNumber(s string) *CarUpdateOne
- type Card
- type CardClient
- func (c *CardClient) Create() *CardCreate
- func (c *CardClient) CreateBulk(builders ...*CardCreate) *CardCreateBulk
- func (c *CardClient) Delete() *CardDelete
- func (c *CardClient) DeleteOne(ca *Card) *CardDeleteOne
- func (c *CardClient) DeleteOneID(id int) *CardDeleteOne
- func (c *CardClient) Get(ctx context.Context, id int) (*Card, error)
- func (c *CardClient) GetX(ctx context.Context, id int) *Card
- func (c *CardClient) Hooks() []Hook
- func (c *CardClient) Query() *CardQuery
- func (c *CardClient) QueryOwner(ca *Card) *UserQuery
- func (c *CardClient) Update() *CardUpdate
- func (c *CardClient) UpdateOne(ca *Card) *CardUpdateOne
- func (c *CardClient) UpdateOneID(id int) *CardUpdateOne
- func (c *CardClient) Use(hooks ...Hook)
- type CardCreate
- func (cc *CardCreate) Exec(ctx context.Context) error
- func (cc *CardCreate) ExecX(ctx context.Context)
- func (cc *CardCreate) Mutation() *CardMutation
- func (cc *CardCreate) Save(ctx context.Context) (*Card, error)
- func (cc *CardCreate) SaveX(ctx context.Context) *Card
- func (cc *CardCreate) SetNillableNumber(s *string) *CardCreate
- func (cc *CardCreate) SetNillableOwnerID(i *int) *CardCreate
- func (cc *CardCreate) SetNumber(s string) *CardCreate
- func (cc *CardCreate) SetOwner(u *User) *CardCreate
- func (cc *CardCreate) SetOwnerID(i int) *CardCreate
- type CardCreateBulk
- type CardDelete
- type CardDeleteOne
- type CardEdges
- type CardGroupBy
- func (cgb *CardGroupBy) Aggregate(fns ...AggregateFunc) *CardGroupBy
- func (s *CardGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *CardGroupBy) BoolX(ctx context.Context) bool
- func (s *CardGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *CardGroupBy) BoolsX(ctx context.Context) []bool
- func (s *CardGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *CardGroupBy) Float64X(ctx context.Context) float64
- func (s *CardGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *CardGroupBy) Float64sX(ctx context.Context) []float64
- func (s *CardGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *CardGroupBy) IntX(ctx context.Context) int
- func (s *CardGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *CardGroupBy) IntsX(ctx context.Context) []int
- func (cgb *CardGroupBy) Scan(ctx context.Context, v interface{}) error
- func (s *CardGroupBy) ScanX(ctx context.Context, v interface{})
- func (s *CardGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *CardGroupBy) StringX(ctx context.Context) string
- func (s *CardGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *CardGroupBy) StringsX(ctx context.Context) []string
- type CardMutation
- func (m *CardMutation) AddField(name string, value ent.Value) error
- func (m *CardMutation) AddedEdges() []string
- func (m *CardMutation) AddedField(name string) (ent.Value, bool)
- func (m *CardMutation) AddedFields() []string
- func (m *CardMutation) AddedIDs(name string) []ent.Value
- func (m *CardMutation) ClearEdge(name string) error
- func (m *CardMutation) ClearField(name string) error
- func (m *CardMutation) ClearNumber()
- func (m *CardMutation) ClearOwner()
- func (m *CardMutation) ClearOwnerID()
- func (m *CardMutation) ClearedEdges() []string
- func (m *CardMutation) ClearedFields() []string
- func (m CardMutation) Client() *Client
- func (m *CardMutation) EdgeCleared(name string) bool
- func (m *CardMutation) Field(name string) (ent.Value, bool)
- func (m *CardMutation) FieldCleared(name string) bool
- func (m *CardMutation) Fields() []string
- func (m *CardMutation) ID() (id int, exists bool)
- func (m *CardMutation) IDs(ctx context.Context) ([]int, error)
- func (m *CardMutation) Number() (r string, exists bool)
- func (m *CardMutation) NumberCleared() bool
- func (m *CardMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CardMutation) OldNumber(ctx context.Context) (v string, err error)
- func (m *CardMutation) OldOwnerID(ctx context.Context) (v int, err error)
- func (m *CardMutation) Op() Op
- func (m *CardMutation) OwnerCleared() bool
- func (m *CardMutation) OwnerID() (r int, exists bool)
- func (m *CardMutation) OwnerIDCleared() bool
- func (m *CardMutation) OwnerIDs() (ids []int)
- func (m *CardMutation) RemovedEdges() []string
- func (m *CardMutation) RemovedIDs(name string) []ent.Value
- func (m *CardMutation) ResetEdge(name string) error
- func (m *CardMutation) ResetField(name string) error
- func (m *CardMutation) ResetNumber()
- func (m *CardMutation) ResetOwner()
- func (m *CardMutation) ResetOwnerID()
- func (m *CardMutation) SetField(name string, value ent.Value) error
- func (m *CardMutation) SetNumber(s string)
- func (m *CardMutation) SetOwnerID(i int)
- func (m CardMutation) Tx() (*Tx, error)
- func (m *CardMutation) Type() string
- func (m *CardMutation) Where(ps ...predicate.Card)
- type CardQuery
- func (cq *CardQuery) All(ctx context.Context) ([]*Card, error)
- func (cq *CardQuery) AllX(ctx context.Context) []*Card
- func (cq *CardQuery) Clone() *CardQuery
- func (cq *CardQuery) Count(ctx context.Context) (int, error)
- func (cq *CardQuery) CountX(ctx context.Context) int
- func (cq *CardQuery) Exist(ctx context.Context) (bool, error)
- func (cq *CardQuery) ExistX(ctx context.Context) bool
- func (cq *CardQuery) First(ctx context.Context) (*Card, error)
- func (cq *CardQuery) FirstID(ctx context.Context) (id int, err error)
- func (cq *CardQuery) FirstIDX(ctx context.Context) int
- func (cq *CardQuery) FirstX(ctx context.Context) *Card
- func (cq *CardQuery) GroupBy(field string, fields ...string) *CardGroupBy
- func (cq *CardQuery) IDs(ctx context.Context) ([]int, error)
- func (cq *CardQuery) IDsX(ctx context.Context) []int
- func (cq *CardQuery) Limit(limit int) *CardQuery
- func (cq *CardQuery) Offset(offset int) *CardQuery
- func (cq *CardQuery) Only(ctx context.Context) (*Card, error)
- func (cq *CardQuery) OnlyID(ctx context.Context) (id int, err error)
- func (cq *CardQuery) OnlyIDX(ctx context.Context) int
- func (cq *CardQuery) OnlyX(ctx context.Context) *Card
- func (cq *CardQuery) Order(o ...OrderFunc) *CardQuery
- func (cq *CardQuery) QueryOwner() *UserQuery
- func (cq *CardQuery) Select(fields ...string) *CardSelect
- func (cq *CardQuery) Unique(unique bool) *CardQuery
- func (cq *CardQuery) Where(ps ...predicate.Card) *CardQuery
- func (cq *CardQuery) WithOwner(opts ...func(*UserQuery)) *CardQuery
- type CardSelect
- func (s *CardSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *CardSelect) BoolX(ctx context.Context) bool
- func (s *CardSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *CardSelect) BoolsX(ctx context.Context) []bool
- func (s *CardSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *CardSelect) Float64X(ctx context.Context) float64
- func (s *CardSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *CardSelect) Float64sX(ctx context.Context) []float64
- func (s *CardSelect) Int(ctx context.Context) (_ int, err error)
- func (s *CardSelect) IntX(ctx context.Context) int
- func (s *CardSelect) Ints(ctx context.Context) ([]int, error)
- func (s *CardSelect) IntsX(ctx context.Context) []int
- func (cs *CardSelect) Scan(ctx context.Context, v interface{}) error
- func (s *CardSelect) ScanX(ctx context.Context, v interface{})
- func (s *CardSelect) String(ctx context.Context) (_ string, err error)
- func (s *CardSelect) StringX(ctx context.Context) string
- func (s *CardSelect) Strings(ctx context.Context) ([]string, error)
- func (s *CardSelect) StringsX(ctx context.Context) []string
- type CardUpdate
- func (cu *CardUpdate) ClearNumber() *CardUpdate
- func (cu *CardUpdate) ClearOwner() *CardUpdate
- func (cu *CardUpdate) ClearOwnerID() *CardUpdate
- func (cu *CardUpdate) Exec(ctx context.Context) error
- func (cu *CardUpdate) ExecX(ctx context.Context)
- func (cu *CardUpdate) Mutation() *CardMutation
- func (cu *CardUpdate) Save(ctx context.Context) (int, error)
- func (cu *CardUpdate) SaveX(ctx context.Context) int
- func (cu *CardUpdate) SetNillableNumber(s *string) *CardUpdate
- func (cu *CardUpdate) SetNillableOwnerID(i *int) *CardUpdate
- func (cu *CardUpdate) SetNumber(s string) *CardUpdate
- func (cu *CardUpdate) SetOwner(u *User) *CardUpdate
- func (cu *CardUpdate) SetOwnerID(i int) *CardUpdate
- func (cu *CardUpdate) Where(ps ...predicate.Card) *CardUpdate
- type CardUpdateOne
- func (cuo *CardUpdateOne) ClearNumber() *CardUpdateOne
- func (cuo *CardUpdateOne) ClearOwner() *CardUpdateOne
- func (cuo *CardUpdateOne) ClearOwnerID() *CardUpdateOne
- func (cuo *CardUpdateOne) Exec(ctx context.Context) error
- func (cuo *CardUpdateOne) ExecX(ctx context.Context)
- func (cuo *CardUpdateOne) Mutation() *CardMutation
- func (cuo *CardUpdateOne) Save(ctx context.Context) (*Card, error)
- func (cuo *CardUpdateOne) SaveX(ctx context.Context) *Card
- func (cuo *CardUpdateOne) Select(field string, fields ...string) *CardUpdateOne
- func (cuo *CardUpdateOne) SetNillableNumber(s *string) *CardUpdateOne
- func (cuo *CardUpdateOne) SetNillableOwnerID(i *int) *CardUpdateOne
- func (cuo *CardUpdateOne) SetNumber(s string) *CardUpdateOne
- func (cuo *CardUpdateOne) SetOwner(u *User) *CardUpdateOne
- func (cuo *CardUpdateOne) SetOwnerID(i int) *CardUpdateOne
- type Cards
- type Cars
- type Client
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type Info
- type InfoClient
- func (c *InfoClient) Create() *InfoCreate
- func (c *InfoClient) CreateBulk(builders ...*InfoCreate) *InfoCreateBulk
- func (c *InfoClient) Delete() *InfoDelete
- func (c *InfoClient) DeleteOne(i *Info) *InfoDeleteOne
- func (c *InfoClient) DeleteOneID(id int) *InfoDeleteOne
- func (c *InfoClient) Get(ctx context.Context, id int) (*Info, error)
- func (c *InfoClient) GetX(ctx context.Context, id int) *Info
- func (c *InfoClient) Hooks() []Hook
- func (c *InfoClient) Query() *InfoQuery
- func (c *InfoClient) QueryUser(i *Info) *UserQuery
- func (c *InfoClient) Update() *InfoUpdate
- func (c *InfoClient) UpdateOne(i *Info) *InfoUpdateOne
- func (c *InfoClient) UpdateOneID(id int) *InfoUpdateOne
- func (c *InfoClient) Use(hooks ...Hook)
- type InfoCreate
- func (ic *InfoCreate) Exec(ctx context.Context) error
- func (ic *InfoCreate) ExecX(ctx context.Context)
- func (ic *InfoCreate) Mutation() *InfoMutation
- func (ic *InfoCreate) Save(ctx context.Context) (*Info, error)
- func (ic *InfoCreate) SaveX(ctx context.Context) *Info
- func (ic *InfoCreate) SetContent(jm json.RawMessage) *InfoCreate
- func (ic *InfoCreate) SetID(i int) *InfoCreate
- func (ic *InfoCreate) SetNillableUserID(id *int) *InfoCreate
- func (ic *InfoCreate) SetUser(u *User) *InfoCreate
- func (ic *InfoCreate) SetUserID(id int) *InfoCreate
- type InfoCreateBulk
- type InfoDelete
- type InfoDeleteOne
- type InfoEdges
- type InfoGroupBy
- func (igb *InfoGroupBy) Aggregate(fns ...AggregateFunc) *InfoGroupBy
- func (s *InfoGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *InfoGroupBy) BoolX(ctx context.Context) bool
- func (s *InfoGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *InfoGroupBy) BoolsX(ctx context.Context) []bool
- func (s *InfoGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *InfoGroupBy) Float64X(ctx context.Context) float64
- func (s *InfoGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *InfoGroupBy) Float64sX(ctx context.Context) []float64
- func (s *InfoGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *InfoGroupBy) IntX(ctx context.Context) int
- func (s *InfoGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *InfoGroupBy) IntsX(ctx context.Context) []int
- func (igb *InfoGroupBy) Scan(ctx context.Context, v interface{}) error
- func (s *InfoGroupBy) ScanX(ctx context.Context, v interface{})
- func (s *InfoGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *InfoGroupBy) StringX(ctx context.Context) string
- func (s *InfoGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *InfoGroupBy) StringsX(ctx context.Context) []string
- type InfoMutation
- func (m *InfoMutation) AddField(name string, value ent.Value) error
- func (m *InfoMutation) AddedEdges() []string
- func (m *InfoMutation) AddedField(name string) (ent.Value, bool)
- func (m *InfoMutation) AddedFields() []string
- func (m *InfoMutation) AddedIDs(name string) []ent.Value
- func (m *InfoMutation) ClearEdge(name string) error
- func (m *InfoMutation) ClearField(name string) error
- func (m *InfoMutation) ClearUser()
- func (m *InfoMutation) ClearedEdges() []string
- func (m *InfoMutation) ClearedFields() []string
- func (m InfoMutation) Client() *Client
- func (m *InfoMutation) Content() (r json.RawMessage, exists bool)
- func (m *InfoMutation) EdgeCleared(name string) bool
- func (m *InfoMutation) Field(name string) (ent.Value, bool)
- func (m *InfoMutation) FieldCleared(name string) bool
- func (m *InfoMutation) Fields() []string
- func (m *InfoMutation) ID() (id int, exists bool)
- func (m *InfoMutation) IDs(ctx context.Context) ([]int, error)
- func (m *InfoMutation) OldContent(ctx context.Context) (v json.RawMessage, err error)
- func (m *InfoMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *InfoMutation) Op() Op
- func (m *InfoMutation) RemovedEdges() []string
- func (m *InfoMutation) RemovedIDs(name string) []ent.Value
- func (m *InfoMutation) ResetContent()
- func (m *InfoMutation) ResetEdge(name string) error
- func (m *InfoMutation) ResetField(name string) error
- func (m *InfoMutation) ResetUser()
- func (m *InfoMutation) SetContent(jm json.RawMessage)
- func (m *InfoMutation) SetField(name string, value ent.Value) error
- func (m *InfoMutation) SetID(id int)
- func (m *InfoMutation) SetUserID(id int)
- func (m InfoMutation) Tx() (*Tx, error)
- func (m *InfoMutation) Type() string
- func (m *InfoMutation) UserCleared() bool
- func (m *InfoMutation) UserID() (id int, exists bool)
- func (m *InfoMutation) UserIDs() (ids []int)
- func (m *InfoMutation) Where(ps ...predicate.Info)
- type InfoQuery
- func (iq *InfoQuery) All(ctx context.Context) ([]*Info, error)
- func (iq *InfoQuery) AllX(ctx context.Context) []*Info
- func (iq *InfoQuery) Clone() *InfoQuery
- func (iq *InfoQuery) Count(ctx context.Context) (int, error)
- func (iq *InfoQuery) CountX(ctx context.Context) int
- func (iq *InfoQuery) Exist(ctx context.Context) (bool, error)
- func (iq *InfoQuery) ExistX(ctx context.Context) bool
- func (iq *InfoQuery) First(ctx context.Context) (*Info, error)
- func (iq *InfoQuery) FirstID(ctx context.Context) (id int, err error)
- func (iq *InfoQuery) FirstIDX(ctx context.Context) int
- func (iq *InfoQuery) FirstX(ctx context.Context) *Info
- func (iq *InfoQuery) GroupBy(field string, fields ...string) *InfoGroupBy
- func (iq *InfoQuery) IDs(ctx context.Context) ([]int, error)
- func (iq *InfoQuery) IDsX(ctx context.Context) []int
- func (iq *InfoQuery) Limit(limit int) *InfoQuery
- func (iq *InfoQuery) Offset(offset int) *InfoQuery
- func (iq *InfoQuery) Only(ctx context.Context) (*Info, error)
- func (iq *InfoQuery) OnlyID(ctx context.Context) (id int, err error)
- func (iq *InfoQuery) OnlyIDX(ctx context.Context) int
- func (iq *InfoQuery) OnlyX(ctx context.Context) *Info
- func (iq *InfoQuery) Order(o ...OrderFunc) *InfoQuery
- func (iq *InfoQuery) QueryUser() *UserQuery
- func (iq *InfoQuery) Select(fields ...string) *InfoSelect
- func (iq *InfoQuery) Unique(unique bool) *InfoQuery
- func (iq *InfoQuery) Where(ps ...predicate.Info) *InfoQuery
- func (iq *InfoQuery) WithUser(opts ...func(*UserQuery)) *InfoQuery
- type InfoSelect
- func (s *InfoSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *InfoSelect) BoolX(ctx context.Context) bool
- func (s *InfoSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *InfoSelect) BoolsX(ctx context.Context) []bool
- func (s *InfoSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *InfoSelect) Float64X(ctx context.Context) float64
- func (s *InfoSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *InfoSelect) Float64sX(ctx context.Context) []float64
- func (s *InfoSelect) Int(ctx context.Context) (_ int, err error)
- func (s *InfoSelect) IntX(ctx context.Context) int
- func (s *InfoSelect) Ints(ctx context.Context) ([]int, error)
- func (s *InfoSelect) IntsX(ctx context.Context) []int
- func (is *InfoSelect) Scan(ctx context.Context, v interface{}) error
- func (s *InfoSelect) ScanX(ctx context.Context, v interface{})
- func (s *InfoSelect) String(ctx context.Context) (_ string, err error)
- func (s *InfoSelect) StringX(ctx context.Context) string
- func (s *InfoSelect) Strings(ctx context.Context) ([]string, error)
- func (s *InfoSelect) StringsX(ctx context.Context) []string
- type InfoUpdate
- func (iu *InfoUpdate) ClearUser() *InfoUpdate
- func (iu *InfoUpdate) Exec(ctx context.Context) error
- func (iu *InfoUpdate) ExecX(ctx context.Context)
- func (iu *InfoUpdate) Mutation() *InfoMutation
- func (iu *InfoUpdate) Save(ctx context.Context) (int, error)
- func (iu *InfoUpdate) SaveX(ctx context.Context) int
- func (iu *InfoUpdate) SetContent(jm json.RawMessage) *InfoUpdate
- func (iu *InfoUpdate) SetNillableUserID(id *int) *InfoUpdate
- func (iu *InfoUpdate) SetUser(u *User) *InfoUpdate
- func (iu *InfoUpdate) SetUserID(id int) *InfoUpdate
- func (iu *InfoUpdate) Where(ps ...predicate.Info) *InfoUpdate
- type InfoUpdateOne
- func (iuo *InfoUpdateOne) ClearUser() *InfoUpdateOne
- func (iuo *InfoUpdateOne) Exec(ctx context.Context) error
- func (iuo *InfoUpdateOne) ExecX(ctx context.Context)
- func (iuo *InfoUpdateOne) Mutation() *InfoMutation
- func (iuo *InfoUpdateOne) Save(ctx context.Context) (*Info, error)
- func (iuo *InfoUpdateOne) SaveX(ctx context.Context) *Info
- func (iuo *InfoUpdateOne) Select(field string, fields ...string) *InfoUpdateOne
- func (iuo *InfoUpdateOne) SetContent(jm json.RawMessage) *InfoUpdateOne
- func (iuo *InfoUpdateOne) SetNillableUserID(id *int) *InfoUpdateOne
- func (iuo *InfoUpdateOne) SetUser(u *User) *InfoUpdateOne
- func (iuo *InfoUpdateOne) SetUserID(id int) *InfoUpdateOne
- type Infos
- type Metadata
- type MetadataClient
- func (c *MetadataClient) Create() *MetadataCreate
- func (c *MetadataClient) CreateBulk(builders ...*MetadataCreate) *MetadataCreateBulk
- func (c *MetadataClient) Delete() *MetadataDelete
- func (c *MetadataClient) DeleteOne(m *Metadata) *MetadataDeleteOne
- func (c *MetadataClient) DeleteOneID(id int) *MetadataDeleteOne
- func (c *MetadataClient) Get(ctx context.Context, id int) (*Metadata, error)
- func (c *MetadataClient) GetX(ctx context.Context, id int) *Metadata
- func (c *MetadataClient) Hooks() []Hook
- func (c *MetadataClient) Query() *MetadataQuery
- func (c *MetadataClient) QueryChildren(m *Metadata) *MetadataQuery
- func (c *MetadataClient) QueryParent(m *Metadata) *MetadataQuery
- func (c *MetadataClient) QueryUser(m *Metadata) *UserQuery
- func (c *MetadataClient) Update() *MetadataUpdate
- func (c *MetadataClient) UpdateOne(m *Metadata) *MetadataUpdateOne
- func (c *MetadataClient) UpdateOneID(id int) *MetadataUpdateOne
- func (c *MetadataClient) Use(hooks ...Hook)
- type MetadataCreate
- func (mc *MetadataCreate) AddChildIDs(ids ...int) *MetadataCreate
- func (mc *MetadataCreate) AddChildren(m ...*Metadata) *MetadataCreate
- func (mc *MetadataCreate) Exec(ctx context.Context) error
- func (mc *MetadataCreate) ExecX(ctx context.Context)
- func (mc *MetadataCreate) Mutation() *MetadataMutation
- func (mc *MetadataCreate) Save(ctx context.Context) (*Metadata, error)
- func (mc *MetadataCreate) SaveX(ctx context.Context) *Metadata
- func (mc *MetadataCreate) SetAge(i int) *MetadataCreate
- func (mc *MetadataCreate) SetID(i int) *MetadataCreate
- func (mc *MetadataCreate) SetNillableAge(i *int) *MetadataCreate
- func (mc *MetadataCreate) SetNillableParentID(i *int) *MetadataCreate
- func (mc *MetadataCreate) SetNillableUserID(id *int) *MetadataCreate
- func (mc *MetadataCreate) SetParent(m *Metadata) *MetadataCreate
- func (mc *MetadataCreate) SetParentID(i int) *MetadataCreate
- func (mc *MetadataCreate) SetUser(u *User) *MetadataCreate
- func (mc *MetadataCreate) SetUserID(id int) *MetadataCreate
- type MetadataCreateBulk
- type MetadataDelete
- type MetadataDeleteOne
- type MetadataEdges
- type MetadataGroupBy
- func (mgb *MetadataGroupBy) Aggregate(fns ...AggregateFunc) *MetadataGroupBy
- func (s *MetadataGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *MetadataGroupBy) BoolX(ctx context.Context) bool
- func (s *MetadataGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *MetadataGroupBy) BoolsX(ctx context.Context) []bool
- func (s *MetadataGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *MetadataGroupBy) Float64X(ctx context.Context) float64
- func (s *MetadataGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *MetadataGroupBy) Float64sX(ctx context.Context) []float64
- func (s *MetadataGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *MetadataGroupBy) IntX(ctx context.Context) int
- func (s *MetadataGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *MetadataGroupBy) IntsX(ctx context.Context) []int
- func (mgb *MetadataGroupBy) Scan(ctx context.Context, v interface{}) error
- func (s *MetadataGroupBy) ScanX(ctx context.Context, v interface{})
- func (s *MetadataGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *MetadataGroupBy) StringX(ctx context.Context) string
- func (s *MetadataGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *MetadataGroupBy) StringsX(ctx context.Context) []string
- type MetadataMutation
- func (m *MetadataMutation) AddAge(i int)
- func (m *MetadataMutation) AddChildIDs(ids ...int)
- func (m *MetadataMutation) AddField(name string, value ent.Value) error
- func (m *MetadataMutation) AddedAge() (r int, exists bool)
- func (m *MetadataMutation) AddedEdges() []string
- func (m *MetadataMutation) AddedField(name string) (ent.Value, bool)
- func (m *MetadataMutation) AddedFields() []string
- func (m *MetadataMutation) AddedIDs(name string) []ent.Value
- func (m *MetadataMutation) Age() (r int, exists bool)
- func (m *MetadataMutation) ChildrenCleared() bool
- func (m *MetadataMutation) ChildrenIDs() (ids []int)
- func (m *MetadataMutation) ClearChildren()
- func (m *MetadataMutation) ClearEdge(name string) error
- func (m *MetadataMutation) ClearField(name string) error
- func (m *MetadataMutation) ClearParent()
- func (m *MetadataMutation) ClearParentID()
- func (m *MetadataMutation) ClearUser()
- func (m *MetadataMutation) ClearedEdges() []string
- func (m *MetadataMutation) ClearedFields() []string
- func (m MetadataMutation) Client() *Client
- func (m *MetadataMutation) EdgeCleared(name string) bool
- func (m *MetadataMutation) Field(name string) (ent.Value, bool)
- func (m *MetadataMutation) FieldCleared(name string) bool
- func (m *MetadataMutation) Fields() []string
- func (m *MetadataMutation) ID() (id int, exists bool)
- func (m *MetadataMutation) IDs(ctx context.Context) ([]int, error)
- func (m *MetadataMutation) OldAge(ctx context.Context) (v int, err error)
- func (m *MetadataMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *MetadataMutation) OldParentID(ctx context.Context) (v int, err error)
- func (m *MetadataMutation) Op() Op
- func (m *MetadataMutation) ParentCleared() bool
- func (m *MetadataMutation) ParentID() (r int, exists bool)
- func (m *MetadataMutation) ParentIDCleared() bool
- func (m *MetadataMutation) ParentIDs() (ids []int)
- func (m *MetadataMutation) RemoveChildIDs(ids ...int)
- func (m *MetadataMutation) RemovedChildrenIDs() (ids []int)
- func (m *MetadataMutation) RemovedEdges() []string
- func (m *MetadataMutation) RemovedIDs(name string) []ent.Value
- func (m *MetadataMutation) ResetAge()
- func (m *MetadataMutation) ResetChildren()
- func (m *MetadataMutation) ResetEdge(name string) error
- func (m *MetadataMutation) ResetField(name string) error
- func (m *MetadataMutation) ResetParent()
- func (m *MetadataMutation) ResetParentID()
- func (m *MetadataMutation) ResetUser()
- func (m *MetadataMutation) SetAge(i int)
- func (m *MetadataMutation) SetField(name string, value ent.Value) error
- func (m *MetadataMutation) SetID(id int)
- func (m *MetadataMutation) SetParentID(i int)
- func (m *MetadataMutation) SetUserID(id int)
- func (m MetadataMutation) Tx() (*Tx, error)
- func (m *MetadataMutation) Type() string
- func (m *MetadataMutation) UserCleared() bool
- func (m *MetadataMutation) UserID() (id int, exists bool)
- func (m *MetadataMutation) UserIDs() (ids []int)
- func (m *MetadataMutation) Where(ps ...predicate.Metadata)
- type MetadataQuery
- func (mq *MetadataQuery) All(ctx context.Context) ([]*Metadata, error)
- func (mq *MetadataQuery) AllX(ctx context.Context) []*Metadata
- func (mq *MetadataQuery) Clone() *MetadataQuery
- func (mq *MetadataQuery) Count(ctx context.Context) (int, error)
- func (mq *MetadataQuery) CountX(ctx context.Context) int
- func (mq *MetadataQuery) Exist(ctx context.Context) (bool, error)
- func (mq *MetadataQuery) ExistX(ctx context.Context) bool
- func (mq *MetadataQuery) First(ctx context.Context) (*Metadata, error)
- func (mq *MetadataQuery) FirstID(ctx context.Context) (id int, err error)
- func (mq *MetadataQuery) FirstIDX(ctx context.Context) int
- func (mq *MetadataQuery) FirstX(ctx context.Context) *Metadata
- func (mq *MetadataQuery) GroupBy(field string, fields ...string) *MetadataGroupBy
- func (mq *MetadataQuery) IDs(ctx context.Context) ([]int, error)
- func (mq *MetadataQuery) IDsX(ctx context.Context) []int
- func (mq *MetadataQuery) Limit(limit int) *MetadataQuery
- func (mq *MetadataQuery) Offset(offset int) *MetadataQuery
- func (mq *MetadataQuery) Only(ctx context.Context) (*Metadata, error)
- func (mq *MetadataQuery) OnlyID(ctx context.Context) (id int, err error)
- func (mq *MetadataQuery) OnlyIDX(ctx context.Context) int
- func (mq *MetadataQuery) OnlyX(ctx context.Context) *Metadata
- func (mq *MetadataQuery) Order(o ...OrderFunc) *MetadataQuery
- func (mq *MetadataQuery) QueryChildren() *MetadataQuery
- func (mq *MetadataQuery) QueryParent() *MetadataQuery
- func (mq *MetadataQuery) QueryUser() *UserQuery
- func (mq *MetadataQuery) Select(fields ...string) *MetadataSelect
- func (mq *MetadataQuery) Unique(unique bool) *MetadataQuery
- func (mq *MetadataQuery) Where(ps ...predicate.Metadata) *MetadataQuery
- func (mq *MetadataQuery) WithChildren(opts ...func(*MetadataQuery)) *MetadataQuery
- func (mq *MetadataQuery) WithParent(opts ...func(*MetadataQuery)) *MetadataQuery
- func (mq *MetadataQuery) WithUser(opts ...func(*UserQuery)) *MetadataQuery
- type MetadataSelect
- func (s *MetadataSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *MetadataSelect) BoolX(ctx context.Context) bool
- func (s *MetadataSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *MetadataSelect) BoolsX(ctx context.Context) []bool
- func (s *MetadataSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *MetadataSelect) Float64X(ctx context.Context) float64
- func (s *MetadataSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *MetadataSelect) Float64sX(ctx context.Context) []float64
- func (s *MetadataSelect) Int(ctx context.Context) (_ int, err error)
- func (s *MetadataSelect) IntX(ctx context.Context) int
- func (s *MetadataSelect) Ints(ctx context.Context) ([]int, error)
- func (s *MetadataSelect) IntsX(ctx context.Context) []int
- func (ms *MetadataSelect) Scan(ctx context.Context, v interface{}) error
- func (s *MetadataSelect) ScanX(ctx context.Context, v interface{})
- func (s *MetadataSelect) String(ctx context.Context) (_ string, err error)
- func (s *MetadataSelect) StringX(ctx context.Context) string
- func (s *MetadataSelect) Strings(ctx context.Context) ([]string, error)
- func (s *MetadataSelect) StringsX(ctx context.Context) []string
- type MetadataSlice
- type MetadataUpdate
- func (mu *MetadataUpdate) AddAge(i int) *MetadataUpdate
- func (mu *MetadataUpdate) AddChildIDs(ids ...int) *MetadataUpdate
- func (mu *MetadataUpdate) AddChildren(m ...*Metadata) *MetadataUpdate
- func (mu *MetadataUpdate) ClearChildren() *MetadataUpdate
- func (mu *MetadataUpdate) ClearParent() *MetadataUpdate
- func (mu *MetadataUpdate) ClearParentID() *MetadataUpdate
- func (mu *MetadataUpdate) ClearUser() *MetadataUpdate
- func (mu *MetadataUpdate) Exec(ctx context.Context) error
- func (mu *MetadataUpdate) ExecX(ctx context.Context)
- func (mu *MetadataUpdate) Mutation() *MetadataMutation
- func (mu *MetadataUpdate) RemoveChildIDs(ids ...int) *MetadataUpdate
- func (mu *MetadataUpdate) RemoveChildren(m ...*Metadata) *MetadataUpdate
- func (mu *MetadataUpdate) Save(ctx context.Context) (int, error)
- func (mu *MetadataUpdate) SaveX(ctx context.Context) int
- func (mu *MetadataUpdate) SetAge(i int) *MetadataUpdate
- func (mu *MetadataUpdate) SetNillableAge(i *int) *MetadataUpdate
- func (mu *MetadataUpdate) SetNillableParentID(i *int) *MetadataUpdate
- func (mu *MetadataUpdate) SetNillableUserID(id *int) *MetadataUpdate
- func (mu *MetadataUpdate) SetParent(m *Metadata) *MetadataUpdate
- func (mu *MetadataUpdate) SetParentID(i int) *MetadataUpdate
- func (mu *MetadataUpdate) SetUser(u *User) *MetadataUpdate
- func (mu *MetadataUpdate) SetUserID(id int) *MetadataUpdate
- func (mu *MetadataUpdate) Where(ps ...predicate.Metadata) *MetadataUpdate
- type MetadataUpdateOne
- func (muo *MetadataUpdateOne) AddAge(i int) *MetadataUpdateOne
- func (muo *MetadataUpdateOne) AddChildIDs(ids ...int) *MetadataUpdateOne
- func (muo *MetadataUpdateOne) AddChildren(m ...*Metadata) *MetadataUpdateOne
- func (muo *MetadataUpdateOne) ClearChildren() *MetadataUpdateOne
- func (muo *MetadataUpdateOne) ClearParent() *MetadataUpdateOne
- func (muo *MetadataUpdateOne) ClearParentID() *MetadataUpdateOne
- func (muo *MetadataUpdateOne) ClearUser() *MetadataUpdateOne
- func (muo *MetadataUpdateOne) Exec(ctx context.Context) error
- func (muo *MetadataUpdateOne) ExecX(ctx context.Context)
- func (muo *MetadataUpdateOne) Mutation() *MetadataMutation
- func (muo *MetadataUpdateOne) RemoveChildIDs(ids ...int) *MetadataUpdateOne
- func (muo *MetadataUpdateOne) RemoveChildren(m ...*Metadata) *MetadataUpdateOne
- func (muo *MetadataUpdateOne) Save(ctx context.Context) (*Metadata, error)
- func (muo *MetadataUpdateOne) SaveX(ctx context.Context) *Metadata
- func (muo *MetadataUpdateOne) Select(field string, fields ...string) *MetadataUpdateOne
- func (muo *MetadataUpdateOne) SetAge(i int) *MetadataUpdateOne
- func (muo *MetadataUpdateOne) SetNillableAge(i *int) *MetadataUpdateOne
- func (muo *MetadataUpdateOne) SetNillableParentID(i *int) *MetadataUpdateOne
- func (muo *MetadataUpdateOne) SetNillableUserID(id *int) *MetadataUpdateOne
- func (muo *MetadataUpdateOne) SetParent(m *Metadata) *MetadataUpdateOne
- func (muo *MetadataUpdateOne) SetParentID(i int) *MetadataUpdateOne
- func (muo *MetadataUpdateOne) SetUser(u *User) *MetadataUpdateOne
- func (muo *MetadataUpdateOne) SetUserID(id int) *MetadataUpdateOne
- type MutateFunc
- type Mutation
- type Mutator
- type Node
- type NodeClient
- func (c *NodeClient) Create() *NodeCreate
- func (c *NodeClient) CreateBulk(builders ...*NodeCreate) *NodeCreateBulk
- func (c *NodeClient) Delete() *NodeDelete
- func (c *NodeClient) DeleteOne(n *Node) *NodeDeleteOne
- func (c *NodeClient) DeleteOneID(id int) *NodeDeleteOne
- func (c *NodeClient) Get(ctx context.Context, id int) (*Node, error)
- func (c *NodeClient) GetX(ctx context.Context, id int) *Node
- func (c *NodeClient) Hooks() []Hook
- func (c *NodeClient) Query() *NodeQuery
- func (c *NodeClient) QueryNext(n *Node) *NodeQuery
- func (c *NodeClient) QueryPrev(n *Node) *NodeQuery
- func (c *NodeClient) Update() *NodeUpdate
- func (c *NodeClient) UpdateOne(n *Node) *NodeUpdateOne
- func (c *NodeClient) UpdateOneID(id int) *NodeUpdateOne
- func (c *NodeClient) Use(hooks ...Hook)
- type NodeCreate
- func (nc *NodeCreate) Exec(ctx context.Context) error
- func (nc *NodeCreate) ExecX(ctx context.Context)
- func (nc *NodeCreate) Mutation() *NodeMutation
- func (nc *NodeCreate) Save(ctx context.Context) (*Node, error)
- func (nc *NodeCreate) SaveX(ctx context.Context) *Node
- func (nc *NodeCreate) SetNext(n *Node) *NodeCreate
- func (nc *NodeCreate) SetNextID(id int) *NodeCreate
- func (nc *NodeCreate) SetNillableNextID(id *int) *NodeCreate
- func (nc *NodeCreate) SetNillablePrevID(i *int) *NodeCreate
- func (nc *NodeCreate) SetNillableValue(i *int) *NodeCreate
- func (nc *NodeCreate) SetPrev(n *Node) *NodeCreate
- func (nc *NodeCreate) SetPrevID(i int) *NodeCreate
- func (nc *NodeCreate) SetValue(i int) *NodeCreate
- type NodeCreateBulk
- type NodeDelete
- type NodeDeleteOne
- type NodeEdges
- type NodeGroupBy
- func (ngb *NodeGroupBy) Aggregate(fns ...AggregateFunc) *NodeGroupBy
- func (s *NodeGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *NodeGroupBy) BoolX(ctx context.Context) bool
- func (s *NodeGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *NodeGroupBy) BoolsX(ctx context.Context) []bool
- func (s *NodeGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *NodeGroupBy) Float64X(ctx context.Context) float64
- func (s *NodeGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *NodeGroupBy) Float64sX(ctx context.Context) []float64
- func (s *NodeGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *NodeGroupBy) IntX(ctx context.Context) int
- func (s *NodeGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *NodeGroupBy) IntsX(ctx context.Context) []int
- func (ngb *NodeGroupBy) Scan(ctx context.Context, v interface{}) error
- func (s *NodeGroupBy) ScanX(ctx context.Context, v interface{})
- func (s *NodeGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *NodeGroupBy) StringX(ctx context.Context) string
- func (s *NodeGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *NodeGroupBy) StringsX(ctx context.Context) []string
- type NodeMutation
- func (m *NodeMutation) AddField(name string, value ent.Value) error
- func (m *NodeMutation) AddValue(i int)
- func (m *NodeMutation) AddedEdges() []string
- func (m *NodeMutation) AddedField(name string) (ent.Value, bool)
- func (m *NodeMutation) AddedFields() []string
- func (m *NodeMutation) AddedIDs(name string) []ent.Value
- func (m *NodeMutation) AddedValue() (r int, exists bool)
- func (m *NodeMutation) ClearEdge(name string) error
- func (m *NodeMutation) ClearField(name string) error
- func (m *NodeMutation) ClearNext()
- func (m *NodeMutation) ClearPrev()
- func (m *NodeMutation) ClearPrevID()
- func (m *NodeMutation) ClearedEdges() []string
- func (m *NodeMutation) ClearedFields() []string
- func (m NodeMutation) Client() *Client
- func (m *NodeMutation) EdgeCleared(name string) bool
- func (m *NodeMutation) Field(name string) (ent.Value, bool)
- func (m *NodeMutation) FieldCleared(name string) bool
- func (m *NodeMutation) Fields() []string
- func (m *NodeMutation) ID() (id int, exists bool)
- func (m *NodeMutation) IDs(ctx context.Context) ([]int, error)
- func (m *NodeMutation) NextCleared() bool
- func (m *NodeMutation) NextID() (id int, exists bool)
- func (m *NodeMutation) NextIDs() (ids []int)
- func (m *NodeMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *NodeMutation) OldPrevID(ctx context.Context) (v int, err error)
- func (m *NodeMutation) OldValue(ctx context.Context) (v int, err error)
- func (m *NodeMutation) Op() Op
- func (m *NodeMutation) PrevCleared() bool
- func (m *NodeMutation) PrevID() (r int, exists bool)
- func (m *NodeMutation) PrevIDCleared() bool
- func (m *NodeMutation) PrevIDs() (ids []int)
- func (m *NodeMutation) RemovedEdges() []string
- func (m *NodeMutation) RemovedIDs(name string) []ent.Value
- func (m *NodeMutation) ResetEdge(name string) error
- func (m *NodeMutation) ResetField(name string) error
- func (m *NodeMutation) ResetNext()
- func (m *NodeMutation) ResetPrev()
- func (m *NodeMutation) ResetPrevID()
- func (m *NodeMutation) ResetValue()
- func (m *NodeMutation) SetField(name string, value ent.Value) error
- func (m *NodeMutation) SetNextID(id int)
- func (m *NodeMutation) SetPrevID(i int)
- func (m *NodeMutation) SetValue(i int)
- func (m NodeMutation) Tx() (*Tx, error)
- func (m *NodeMutation) Type() string
- func (m *NodeMutation) Value() (r int, exists bool)
- func (m *NodeMutation) Where(ps ...predicate.Node)
- type NodeQuery
- func (nq *NodeQuery) All(ctx context.Context) ([]*Node, error)
- func (nq *NodeQuery) AllX(ctx context.Context) []*Node
- func (nq *NodeQuery) Clone() *NodeQuery
- func (nq *NodeQuery) Count(ctx context.Context) (int, error)
- func (nq *NodeQuery) CountX(ctx context.Context) int
- func (nq *NodeQuery) Exist(ctx context.Context) (bool, error)
- func (nq *NodeQuery) ExistX(ctx context.Context) bool
- func (nq *NodeQuery) First(ctx context.Context) (*Node, error)
- func (nq *NodeQuery) FirstID(ctx context.Context) (id int, err error)
- func (nq *NodeQuery) FirstIDX(ctx context.Context) int
- func (nq *NodeQuery) FirstX(ctx context.Context) *Node
- func (nq *NodeQuery) GroupBy(field string, fields ...string) *NodeGroupBy
- func (nq *NodeQuery) IDs(ctx context.Context) ([]int, error)
- func (nq *NodeQuery) IDsX(ctx context.Context) []int
- func (nq *NodeQuery) Limit(limit int) *NodeQuery
- func (nq *NodeQuery) Offset(offset int) *NodeQuery
- func (nq *NodeQuery) Only(ctx context.Context) (*Node, error)
- func (nq *NodeQuery) OnlyID(ctx context.Context) (id int, err error)
- func (nq *NodeQuery) OnlyIDX(ctx context.Context) int
- func (nq *NodeQuery) OnlyX(ctx context.Context) *Node
- func (nq *NodeQuery) Order(o ...OrderFunc) *NodeQuery
- func (nq *NodeQuery) QueryNext() *NodeQuery
- func (nq *NodeQuery) QueryPrev() *NodeQuery
- func (nq *NodeQuery) Select(fields ...string) *NodeSelect
- func (nq *NodeQuery) Unique(unique bool) *NodeQuery
- func (nq *NodeQuery) Where(ps ...predicate.Node) *NodeQuery
- func (nq *NodeQuery) WithNext(opts ...func(*NodeQuery)) *NodeQuery
- func (nq *NodeQuery) WithPrev(opts ...func(*NodeQuery)) *NodeQuery
- type NodeSelect
- func (s *NodeSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *NodeSelect) BoolX(ctx context.Context) bool
- func (s *NodeSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *NodeSelect) BoolsX(ctx context.Context) []bool
- func (s *NodeSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *NodeSelect) Float64X(ctx context.Context) float64
- func (s *NodeSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *NodeSelect) Float64sX(ctx context.Context) []float64
- func (s *NodeSelect) Int(ctx context.Context) (_ int, err error)
- func (s *NodeSelect) IntX(ctx context.Context) int
- func (s *NodeSelect) Ints(ctx context.Context) ([]int, error)
- func (s *NodeSelect) IntsX(ctx context.Context) []int
- func (ns *NodeSelect) Scan(ctx context.Context, v interface{}) error
- func (s *NodeSelect) ScanX(ctx context.Context, v interface{})
- func (s *NodeSelect) String(ctx context.Context) (_ string, err error)
- func (s *NodeSelect) StringX(ctx context.Context) string
- func (s *NodeSelect) Strings(ctx context.Context) ([]string, error)
- func (s *NodeSelect) StringsX(ctx context.Context) []string
- type NodeUpdate
- func (nu *NodeUpdate) AddValue(i int) *NodeUpdate
- func (nu *NodeUpdate) ClearNext() *NodeUpdate
- func (nu *NodeUpdate) ClearPrev() *NodeUpdate
- func (nu *NodeUpdate) ClearPrevID() *NodeUpdate
- func (nu *NodeUpdate) Exec(ctx context.Context) error
- func (nu *NodeUpdate) ExecX(ctx context.Context)
- func (nu *NodeUpdate) Mutation() *NodeMutation
- func (nu *NodeUpdate) Save(ctx context.Context) (int, error)
- func (nu *NodeUpdate) SaveX(ctx context.Context) int
- func (nu *NodeUpdate) SetNext(n *Node) *NodeUpdate
- func (nu *NodeUpdate) SetNextID(id int) *NodeUpdate
- func (nu *NodeUpdate) SetNillableNextID(id *int) *NodeUpdate
- func (nu *NodeUpdate) SetNillablePrevID(i *int) *NodeUpdate
- func (nu *NodeUpdate) SetNillableValue(i *int) *NodeUpdate
- func (nu *NodeUpdate) SetPrev(n *Node) *NodeUpdate
- func (nu *NodeUpdate) SetPrevID(i int) *NodeUpdate
- func (nu *NodeUpdate) SetValue(i int) *NodeUpdate
- func (nu *NodeUpdate) Where(ps ...predicate.Node) *NodeUpdate
- type NodeUpdateOne
- func (nuo *NodeUpdateOne) AddValue(i int) *NodeUpdateOne
- func (nuo *NodeUpdateOne) ClearNext() *NodeUpdateOne
- func (nuo *NodeUpdateOne) ClearPrev() *NodeUpdateOne
- func (nuo *NodeUpdateOne) ClearPrevID() *NodeUpdateOne
- func (nuo *NodeUpdateOne) Exec(ctx context.Context) error
- func (nuo *NodeUpdateOne) ExecX(ctx context.Context)
- func (nuo *NodeUpdateOne) Mutation() *NodeMutation
- func (nuo *NodeUpdateOne) Save(ctx context.Context) (*Node, error)
- func (nuo *NodeUpdateOne) SaveX(ctx context.Context) *Node
- func (nuo *NodeUpdateOne) Select(field string, fields ...string) *NodeUpdateOne
- func (nuo *NodeUpdateOne) SetNext(n *Node) *NodeUpdateOne
- func (nuo *NodeUpdateOne) SetNextID(id int) *NodeUpdateOne
- func (nuo *NodeUpdateOne) SetNillableNextID(id *int) *NodeUpdateOne
- func (nuo *NodeUpdateOne) SetNillablePrevID(i *int) *NodeUpdateOne
- func (nuo *NodeUpdateOne) SetNillableValue(i *int) *NodeUpdateOne
- func (nuo *NodeUpdateOne) SetPrev(n *Node) *NodeUpdateOne
- func (nuo *NodeUpdateOne) SetPrevID(i int) *NodeUpdateOne
- func (nuo *NodeUpdateOne) SetValue(i int) *NodeUpdateOne
- type Nodes
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Pet
- type PetClient
- func (c *PetClient) Create() *PetCreate
- func (c *PetClient) CreateBulk(builders ...*PetCreate) *PetCreateBulk
- func (c *PetClient) Delete() *PetDelete
- func (c *PetClient) DeleteOne(pe *Pet) *PetDeleteOne
- func (c *PetClient) DeleteOneID(id int) *PetDeleteOne
- func (c *PetClient) Get(ctx context.Context, id int) (*Pet, error)
- func (c *PetClient) GetX(ctx context.Context, id int) *Pet
- func (c *PetClient) Hooks() []Hook
- func (c *PetClient) Query() *PetQuery
- func (c *PetClient) QueryOwner(pe *Pet) *UserQuery
- func (c *PetClient) Update() *PetUpdate
- func (c *PetClient) UpdateOne(pe *Pet) *PetUpdateOne
- func (c *PetClient) UpdateOneID(id int) *PetUpdateOne
- func (c *PetClient) Use(hooks ...Hook)
- type PetCreate
- func (pc *PetCreate) Exec(ctx context.Context) error
- func (pc *PetCreate) ExecX(ctx context.Context)
- func (pc *PetCreate) Mutation() *PetMutation
- func (pc *PetCreate) Save(ctx context.Context) (*Pet, error)
- func (pc *PetCreate) SaveX(ctx context.Context) *Pet
- func (pc *PetCreate) SetNillableOwnerID(i *int) *PetCreate
- func (pc *PetCreate) SetOwner(u *User) *PetCreate
- func (pc *PetCreate) SetOwnerID(i int) *PetCreate
- type PetCreateBulk
- type PetDelete
- type PetDeleteOne
- type PetEdges
- type PetGroupBy
- func (pgb *PetGroupBy) Aggregate(fns ...AggregateFunc) *PetGroupBy
- func (s *PetGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *PetGroupBy) BoolX(ctx context.Context) bool
- func (s *PetGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *PetGroupBy) BoolsX(ctx context.Context) []bool
- func (s *PetGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *PetGroupBy) Float64X(ctx context.Context) float64
- func (s *PetGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *PetGroupBy) Float64sX(ctx context.Context) []float64
- func (s *PetGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *PetGroupBy) IntX(ctx context.Context) int
- func (s *PetGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *PetGroupBy) IntsX(ctx context.Context) []int
- func (pgb *PetGroupBy) Scan(ctx context.Context, v interface{}) error
- func (s *PetGroupBy) ScanX(ctx context.Context, v interface{})
- func (s *PetGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *PetGroupBy) StringX(ctx context.Context) string
- func (s *PetGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *PetGroupBy) StringsX(ctx context.Context) []string
- type PetMutation
- func (m *PetMutation) AddField(name string, value ent.Value) error
- func (m *PetMutation) AddedEdges() []string
- func (m *PetMutation) AddedField(name string) (ent.Value, bool)
- func (m *PetMutation) AddedFields() []string
- func (m *PetMutation) AddedIDs(name string) []ent.Value
- func (m *PetMutation) ClearEdge(name string) error
- func (m *PetMutation) ClearField(name string) error
- func (m *PetMutation) ClearOwner()
- func (m *PetMutation) ClearOwnerID()
- func (m *PetMutation) ClearedEdges() []string
- func (m *PetMutation) ClearedFields() []string
- func (m PetMutation) Client() *Client
- func (m *PetMutation) EdgeCleared(name string) bool
- func (m *PetMutation) Field(name string) (ent.Value, bool)
- func (m *PetMutation) FieldCleared(name string) bool
- func (m *PetMutation) Fields() []string
- func (m *PetMutation) ID() (id int, exists bool)
- func (m *PetMutation) IDs(ctx context.Context) ([]int, error)
- func (m *PetMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *PetMutation) OldOwnerID(ctx context.Context) (v int, err error)
- func (m *PetMutation) Op() Op
- func (m *PetMutation) OwnerCleared() bool
- func (m *PetMutation) OwnerID() (r int, exists bool)
- func (m *PetMutation) OwnerIDCleared() bool
- func (m *PetMutation) OwnerIDs() (ids []int)
- func (m *PetMutation) RemovedEdges() []string
- func (m *PetMutation) RemovedIDs(name string) []ent.Value
- func (m *PetMutation) ResetEdge(name string) error
- func (m *PetMutation) ResetField(name string) error
- func (m *PetMutation) ResetOwner()
- func (m *PetMutation) ResetOwnerID()
- func (m *PetMutation) SetField(name string, value ent.Value) error
- func (m *PetMutation) SetOwnerID(i int)
- func (m PetMutation) Tx() (*Tx, error)
- func (m *PetMutation) Type() string
- func (m *PetMutation) Where(ps ...predicate.Pet)
- type PetQuery
- func (pq *PetQuery) All(ctx context.Context) ([]*Pet, error)
- func (pq *PetQuery) AllX(ctx context.Context) []*Pet
- func (pq *PetQuery) Clone() *PetQuery
- func (pq *PetQuery) Count(ctx context.Context) (int, error)
- func (pq *PetQuery) CountX(ctx context.Context) int
- func (pq *PetQuery) Exist(ctx context.Context) (bool, error)
- func (pq *PetQuery) ExistX(ctx context.Context) bool
- func (pq *PetQuery) First(ctx context.Context) (*Pet, error)
- func (pq *PetQuery) FirstID(ctx context.Context) (id int, err error)
- func (pq *PetQuery) FirstIDX(ctx context.Context) int
- func (pq *PetQuery) FirstX(ctx context.Context) *Pet
- func (pq *PetQuery) GroupBy(field string, fields ...string) *PetGroupBy
- func (pq *PetQuery) IDs(ctx context.Context) ([]int, error)
- func (pq *PetQuery) IDsX(ctx context.Context) []int
- func (pq *PetQuery) Limit(limit int) *PetQuery
- func (pq *PetQuery) Offset(offset int) *PetQuery
- func (pq *PetQuery) Only(ctx context.Context) (*Pet, error)
- func (pq *PetQuery) OnlyID(ctx context.Context) (id int, err error)
- func (pq *PetQuery) OnlyIDX(ctx context.Context) int
- func (pq *PetQuery) OnlyX(ctx context.Context) *Pet
- func (pq *PetQuery) Order(o ...OrderFunc) *PetQuery
- func (pq *PetQuery) QueryOwner() *UserQuery
- func (pq *PetQuery) Select(fields ...string) *PetSelect
- func (pq *PetQuery) Unique(unique bool) *PetQuery
- func (pq *PetQuery) Where(ps ...predicate.Pet) *PetQuery
- func (pq *PetQuery) WithOwner(opts ...func(*UserQuery)) *PetQuery
- type PetSelect
- func (s *PetSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *PetSelect) BoolX(ctx context.Context) bool
- func (s *PetSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *PetSelect) BoolsX(ctx context.Context) []bool
- func (s *PetSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *PetSelect) Float64X(ctx context.Context) float64
- func (s *PetSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *PetSelect) Float64sX(ctx context.Context) []float64
- func (s *PetSelect) Int(ctx context.Context) (_ int, err error)
- func (s *PetSelect) IntX(ctx context.Context) int
- func (s *PetSelect) Ints(ctx context.Context) ([]int, error)
- func (s *PetSelect) IntsX(ctx context.Context) []int
- func (ps *PetSelect) Scan(ctx context.Context, v interface{}) error
- func (s *PetSelect) ScanX(ctx context.Context, v interface{})
- func (s *PetSelect) String(ctx context.Context) (_ string, err error)
- func (s *PetSelect) StringX(ctx context.Context) string
- func (s *PetSelect) Strings(ctx context.Context) ([]string, error)
- func (s *PetSelect) StringsX(ctx context.Context) []string
- type PetUpdate
- func (pu *PetUpdate) ClearOwner() *PetUpdate
- func (pu *PetUpdate) ClearOwnerID() *PetUpdate
- func (pu *PetUpdate) Exec(ctx context.Context) error
- func (pu *PetUpdate) ExecX(ctx context.Context)
- func (pu *PetUpdate) Mutation() *PetMutation
- func (pu *PetUpdate) Save(ctx context.Context) (int, error)
- func (pu *PetUpdate) SaveX(ctx context.Context) int
- func (pu *PetUpdate) SetNillableOwnerID(i *int) *PetUpdate
- func (pu *PetUpdate) SetOwner(u *User) *PetUpdate
- func (pu *PetUpdate) SetOwnerID(i int) *PetUpdate
- func (pu *PetUpdate) Where(ps ...predicate.Pet) *PetUpdate
- type PetUpdateOne
- func (puo *PetUpdateOne) ClearOwner() *PetUpdateOne
- func (puo *PetUpdateOne) ClearOwnerID() *PetUpdateOne
- func (puo *PetUpdateOne) Exec(ctx context.Context) error
- func (puo *PetUpdateOne) ExecX(ctx context.Context)
- func (puo *PetUpdateOne) Mutation() *PetMutation
- func (puo *PetUpdateOne) Save(ctx context.Context) (*Pet, error)
- func (puo *PetUpdateOne) SaveX(ctx context.Context) *Pet
- func (puo *PetUpdateOne) Select(field string, fields ...string) *PetUpdateOne
- func (puo *PetUpdateOne) SetNillableOwnerID(i *int) *PetUpdateOne
- func (puo *PetUpdateOne) SetOwner(u *User) *PetUpdateOne
- func (puo *PetUpdateOne) SetOwnerID(i int) *PetUpdateOne
- type Pets
- type Policy
- type Post
- type PostClient
- func (c *PostClient) Create() *PostCreate
- func (c *PostClient) CreateBulk(builders ...*PostCreate) *PostCreateBulk
- func (c *PostClient) Delete() *PostDelete
- func (c *PostClient) DeleteOne(po *Post) *PostDeleteOne
- func (c *PostClient) DeleteOneID(id int) *PostDeleteOne
- func (c *PostClient) Get(ctx context.Context, id int) (*Post, error)
- func (c *PostClient) GetX(ctx context.Context, id int) *Post
- func (c *PostClient) Hooks() []Hook
- func (c *PostClient) Query() *PostQuery
- func (c *PostClient) QueryAuthor(po *Post) *UserQuery
- func (c *PostClient) Update() *PostUpdate
- func (c *PostClient) UpdateOne(po *Post) *PostUpdateOne
- func (c *PostClient) UpdateOneID(id int) *PostUpdateOne
- func (c *PostClient) Use(hooks ...Hook)
- type PostCreate
- func (pc *PostCreate) Exec(ctx context.Context) error
- func (pc *PostCreate) ExecX(ctx context.Context)
- func (pc *PostCreate) Mutation() *PostMutation
- func (pc *PostCreate) Save(ctx context.Context) (*Post, error)
- func (pc *PostCreate) SaveX(ctx context.Context) *Post
- func (pc *PostCreate) SetAuthor(u *User) *PostCreate
- func (pc *PostCreate) SetAuthorID(i int) *PostCreate
- func (pc *PostCreate) SetNillableAuthorID(i *int) *PostCreate
- func (pc *PostCreate) SetText(s string) *PostCreate
- type PostCreateBulk
- type PostDelete
- type PostDeleteOne
- type PostEdges
- type PostGroupBy
- func (pgb *PostGroupBy) Aggregate(fns ...AggregateFunc) *PostGroupBy
- func (s *PostGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *PostGroupBy) BoolX(ctx context.Context) bool
- func (s *PostGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *PostGroupBy) BoolsX(ctx context.Context) []bool
- func (s *PostGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *PostGroupBy) Float64X(ctx context.Context) float64
- func (s *PostGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *PostGroupBy) Float64sX(ctx context.Context) []float64
- func (s *PostGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *PostGroupBy) IntX(ctx context.Context) int
- func (s *PostGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *PostGroupBy) IntsX(ctx context.Context) []int
- func (pgb *PostGroupBy) Scan(ctx context.Context, v interface{}) error
- func (s *PostGroupBy) ScanX(ctx context.Context, v interface{})
- func (s *PostGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *PostGroupBy) StringX(ctx context.Context) string
- func (s *PostGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *PostGroupBy) StringsX(ctx context.Context) []string
- type PostMutation
- func (m *PostMutation) AddField(name string, value ent.Value) error
- func (m *PostMutation) AddedEdges() []string
- func (m *PostMutation) AddedField(name string) (ent.Value, bool)
- func (m *PostMutation) AddedFields() []string
- func (m *PostMutation) AddedIDs(name string) []ent.Value
- func (m *PostMutation) AuthorCleared() bool
- func (m *PostMutation) AuthorID() (r int, exists bool)
- func (m *PostMutation) AuthorIDCleared() bool
- func (m *PostMutation) AuthorIDs() (ids []int)
- func (m *PostMutation) ClearAuthor()
- func (m *PostMutation) ClearAuthorID()
- func (m *PostMutation) ClearEdge(name string) error
- func (m *PostMutation) ClearField(name string) error
- func (m *PostMutation) ClearedEdges() []string
- func (m *PostMutation) ClearedFields() []string
- func (m PostMutation) Client() *Client
- func (m *PostMutation) EdgeCleared(name string) bool
- func (m *PostMutation) Field(name string) (ent.Value, bool)
- func (m *PostMutation) FieldCleared(name string) bool
- func (m *PostMutation) Fields() []string
- func (m *PostMutation) ID() (id int, exists bool)
- func (m *PostMutation) IDs(ctx context.Context) ([]int, error)
- func (m *PostMutation) OldAuthorID(ctx context.Context) (v *int, err error)
- func (m *PostMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *PostMutation) OldText(ctx context.Context) (v string, err error)
- func (m *PostMutation) Op() Op
- func (m *PostMutation) RemovedEdges() []string
- func (m *PostMutation) RemovedIDs(name string) []ent.Value
- func (m *PostMutation) ResetAuthor()
- func (m *PostMutation) ResetAuthorID()
- func (m *PostMutation) ResetEdge(name string) error
- func (m *PostMutation) ResetField(name string) error
- func (m *PostMutation) ResetText()
- func (m *PostMutation) SetAuthorID(i int)
- func (m *PostMutation) SetField(name string, value ent.Value) error
- func (m *PostMutation) SetText(s string)
- func (m *PostMutation) Text() (r string, exists bool)
- func (m PostMutation) Tx() (*Tx, error)
- func (m *PostMutation) Type() string
- func (m *PostMutation) Where(ps ...predicate.Post)
- type PostQuery
- func (pq *PostQuery) All(ctx context.Context) ([]*Post, error)
- func (pq *PostQuery) AllX(ctx context.Context) []*Post
- func (pq *PostQuery) Clone() *PostQuery
- func (pq *PostQuery) Count(ctx context.Context) (int, error)
- func (pq *PostQuery) CountX(ctx context.Context) int
- func (pq *PostQuery) Exist(ctx context.Context) (bool, error)
- func (pq *PostQuery) ExistX(ctx context.Context) bool
- func (pq *PostQuery) First(ctx context.Context) (*Post, error)
- func (pq *PostQuery) FirstID(ctx context.Context) (id int, err error)
- func (pq *PostQuery) FirstIDX(ctx context.Context) int
- func (pq *PostQuery) FirstX(ctx context.Context) *Post
- func (pq *PostQuery) GroupBy(field string, fields ...string) *PostGroupBy
- func (pq *PostQuery) IDs(ctx context.Context) ([]int, error)
- func (pq *PostQuery) IDsX(ctx context.Context) []int
- func (pq *PostQuery) Limit(limit int) *PostQuery
- func (pq *PostQuery) Offset(offset int) *PostQuery
- func (pq *PostQuery) Only(ctx context.Context) (*Post, error)
- func (pq *PostQuery) OnlyID(ctx context.Context) (id int, err error)
- func (pq *PostQuery) OnlyIDX(ctx context.Context) int
- func (pq *PostQuery) OnlyX(ctx context.Context) *Post
- func (pq *PostQuery) Order(o ...OrderFunc) *PostQuery
- func (pq *PostQuery) QueryAuthor() *UserQuery
- func (pq *PostQuery) Select(fields ...string) *PostSelect
- func (pq *PostQuery) Unique(unique bool) *PostQuery
- func (pq *PostQuery) Where(ps ...predicate.Post) *PostQuery
- func (pq *PostQuery) WithAuthor(opts ...func(*UserQuery)) *PostQuery
- type PostSelect
- func (s *PostSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *PostSelect) BoolX(ctx context.Context) bool
- func (s *PostSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *PostSelect) BoolsX(ctx context.Context) []bool
- func (s *PostSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *PostSelect) Float64X(ctx context.Context) float64
- func (s *PostSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *PostSelect) Float64sX(ctx context.Context) []float64
- func (s *PostSelect) Int(ctx context.Context) (_ int, err error)
- func (s *PostSelect) IntX(ctx context.Context) int
- func (s *PostSelect) Ints(ctx context.Context) ([]int, error)
- func (s *PostSelect) IntsX(ctx context.Context) []int
- func (ps *PostSelect) Scan(ctx context.Context, v interface{}) error
- func (s *PostSelect) ScanX(ctx context.Context, v interface{})
- func (s *PostSelect) String(ctx context.Context) (_ string, err error)
- func (s *PostSelect) StringX(ctx context.Context) string
- func (s *PostSelect) Strings(ctx context.Context) ([]string, error)
- func (s *PostSelect) StringsX(ctx context.Context) []string
- type PostUpdate
- func (pu *PostUpdate) ClearAuthor() *PostUpdate
- func (pu *PostUpdate) ClearAuthorID() *PostUpdate
- func (pu *PostUpdate) Exec(ctx context.Context) error
- func (pu *PostUpdate) ExecX(ctx context.Context)
- func (pu *PostUpdate) Mutation() *PostMutation
- func (pu *PostUpdate) Save(ctx context.Context) (int, error)
- func (pu *PostUpdate) SaveX(ctx context.Context) int
- func (pu *PostUpdate) SetAuthor(u *User) *PostUpdate
- func (pu *PostUpdate) SetAuthorID(i int) *PostUpdate
- func (pu *PostUpdate) SetNillableAuthorID(i *int) *PostUpdate
- func (pu *PostUpdate) SetText(s string) *PostUpdate
- func (pu *PostUpdate) Where(ps ...predicate.Post) *PostUpdate
- type PostUpdateOne
- func (puo *PostUpdateOne) ClearAuthor() *PostUpdateOne
- func (puo *PostUpdateOne) ClearAuthorID() *PostUpdateOne
- func (puo *PostUpdateOne) Exec(ctx context.Context) error
- func (puo *PostUpdateOne) ExecX(ctx context.Context)
- func (puo *PostUpdateOne) Mutation() *PostMutation
- func (puo *PostUpdateOne) Save(ctx context.Context) (*Post, error)
- func (puo *PostUpdateOne) SaveX(ctx context.Context) *Post
- func (puo *PostUpdateOne) Select(field string, fields ...string) *PostUpdateOne
- func (puo *PostUpdateOne) SetAuthor(u *User) *PostUpdateOne
- func (puo *PostUpdateOne) SetAuthorID(i int) *PostUpdateOne
- func (puo *PostUpdateOne) SetNillableAuthorID(i *int) *PostUpdateOne
- func (puo *PostUpdateOne) SetText(s string) *PostUpdateOne
- type Posts
- type Query
- type Rental
- type RentalClient
- func (c *RentalClient) Create() *RentalCreate
- func (c *RentalClient) CreateBulk(builders ...*RentalCreate) *RentalCreateBulk
- func (c *RentalClient) Delete() *RentalDelete
- func (c *RentalClient) DeleteOne(r *Rental) *RentalDeleteOne
- func (c *RentalClient) DeleteOneID(id int) *RentalDeleteOne
- func (c *RentalClient) Get(ctx context.Context, id int) (*Rental, error)
- func (c *RentalClient) GetX(ctx context.Context, id int) *Rental
- func (c *RentalClient) Hooks() []Hook
- func (c *RentalClient) Query() *RentalQuery
- func (c *RentalClient) QueryCar(r *Rental) *CarQuery
- func (c *RentalClient) QueryUser(r *Rental) *UserQuery
- func (c *RentalClient) Update() *RentalUpdate
- func (c *RentalClient) UpdateOne(r *Rental) *RentalUpdateOne
- func (c *RentalClient) UpdateOneID(id int) *RentalUpdateOne
- func (c *RentalClient) Use(hooks ...Hook)
- type RentalCreate
- func (rc *RentalCreate) Exec(ctx context.Context) error
- func (rc *RentalCreate) ExecX(ctx context.Context)
- func (rc *RentalCreate) Mutation() *RentalMutation
- func (rc *RentalCreate) Save(ctx context.Context) (*Rental, error)
- func (rc *RentalCreate) SaveX(ctx context.Context) *Rental
- func (rc *RentalCreate) SetCar(c *Car) *RentalCreate
- func (rc *RentalCreate) SetCarID(u uuid.UUID) *RentalCreate
- func (rc *RentalCreate) SetDate(t time.Time) *RentalCreate
- func (rc *RentalCreate) SetNillableDate(t *time.Time) *RentalCreate
- func (rc *RentalCreate) SetUser(u *User) *RentalCreate
- func (rc *RentalCreate) SetUserID(i int) *RentalCreate
- type RentalCreateBulk
- type RentalDelete
- type RentalDeleteOne
- type RentalEdges
- type RentalGroupBy
- func (rgb *RentalGroupBy) Aggregate(fns ...AggregateFunc) *RentalGroupBy
- func (s *RentalGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *RentalGroupBy) BoolX(ctx context.Context) bool
- func (s *RentalGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *RentalGroupBy) BoolsX(ctx context.Context) []bool
- func (s *RentalGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *RentalGroupBy) Float64X(ctx context.Context) float64
- func (s *RentalGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *RentalGroupBy) Float64sX(ctx context.Context) []float64
- func (s *RentalGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *RentalGroupBy) IntX(ctx context.Context) int
- func (s *RentalGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *RentalGroupBy) IntsX(ctx context.Context) []int
- func (rgb *RentalGroupBy) Scan(ctx context.Context, v interface{}) error
- func (s *RentalGroupBy) ScanX(ctx context.Context, v interface{})
- func (s *RentalGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *RentalGroupBy) StringX(ctx context.Context) string
- func (s *RentalGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *RentalGroupBy) StringsX(ctx context.Context) []string
- type RentalMutation
- func (m *RentalMutation) AddField(name string, value ent.Value) error
- func (m *RentalMutation) AddedEdges() []string
- func (m *RentalMutation) AddedField(name string) (ent.Value, bool)
- func (m *RentalMutation) AddedFields() []string
- func (m *RentalMutation) AddedIDs(name string) []ent.Value
- func (m *RentalMutation) CarCleared() bool
- func (m *RentalMutation) CarID() (r uuid.UUID, exists bool)
- func (m *RentalMutation) CarIDs() (ids []uuid.UUID)
- func (m *RentalMutation) ClearCar()
- func (m *RentalMutation) ClearEdge(name string) error
- func (m *RentalMutation) ClearField(name string) error
- func (m *RentalMutation) ClearUser()
- func (m *RentalMutation) ClearedEdges() []string
- func (m *RentalMutation) ClearedFields() []string
- func (m RentalMutation) Client() *Client
- func (m *RentalMutation) Date() (r time.Time, exists bool)
- func (m *RentalMutation) EdgeCleared(name string) bool
- func (m *RentalMutation) Field(name string) (ent.Value, bool)
- func (m *RentalMutation) FieldCleared(name string) bool
- func (m *RentalMutation) Fields() []string
- func (m *RentalMutation) ID() (id int, exists bool)
- func (m *RentalMutation) IDs(ctx context.Context) ([]int, error)
- func (m *RentalMutation) OldCarID(ctx context.Context) (v uuid.UUID, err error)
- func (m *RentalMutation) OldDate(ctx context.Context) (v time.Time, err error)
- func (m *RentalMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *RentalMutation) OldUserID(ctx context.Context) (v int, err error)
- func (m *RentalMutation) Op() Op
- func (m *RentalMutation) RemovedEdges() []string
- func (m *RentalMutation) RemovedIDs(name string) []ent.Value
- func (m *RentalMutation) ResetCar()
- func (m *RentalMutation) ResetCarID()
- func (m *RentalMutation) ResetDate()
- func (m *RentalMutation) ResetEdge(name string) error
- func (m *RentalMutation) ResetField(name string) error
- func (m *RentalMutation) ResetUser()
- func (m *RentalMutation) ResetUserID()
- func (m *RentalMutation) SetCarID(u uuid.UUID)
- func (m *RentalMutation) SetDate(t time.Time)
- func (m *RentalMutation) SetField(name string, value ent.Value) error
- func (m *RentalMutation) SetUserID(i int)
- func (m RentalMutation) Tx() (*Tx, error)
- func (m *RentalMutation) Type() string
- func (m *RentalMutation) UserCleared() bool
- func (m *RentalMutation) UserID() (r int, exists bool)
- func (m *RentalMutation) UserIDs() (ids []int)
- func (m *RentalMutation) Where(ps ...predicate.Rental)
- type RentalQuery
- func (rq *RentalQuery) All(ctx context.Context) ([]*Rental, error)
- func (rq *RentalQuery) AllX(ctx context.Context) []*Rental
- func (rq *RentalQuery) Clone() *RentalQuery
- func (rq *RentalQuery) Count(ctx context.Context) (int, error)
- func (rq *RentalQuery) CountX(ctx context.Context) int
- func (rq *RentalQuery) Exist(ctx context.Context) (bool, error)
- func (rq *RentalQuery) ExistX(ctx context.Context) bool
- func (rq *RentalQuery) First(ctx context.Context) (*Rental, error)
- func (rq *RentalQuery) FirstID(ctx context.Context) (id int, err error)
- func (rq *RentalQuery) FirstIDX(ctx context.Context) int
- func (rq *RentalQuery) FirstX(ctx context.Context) *Rental
- func (rq *RentalQuery) GroupBy(field string, fields ...string) *RentalGroupBy
- func (rq *RentalQuery) IDs(ctx context.Context) ([]int, error)
- func (rq *RentalQuery) IDsX(ctx context.Context) []int
- func (rq *RentalQuery) Limit(limit int) *RentalQuery
- func (rq *RentalQuery) Offset(offset int) *RentalQuery
- func (rq *RentalQuery) Only(ctx context.Context) (*Rental, error)
- func (rq *RentalQuery) OnlyID(ctx context.Context) (id int, err error)
- func (rq *RentalQuery) OnlyIDX(ctx context.Context) int
- func (rq *RentalQuery) OnlyX(ctx context.Context) *Rental
- func (rq *RentalQuery) Order(o ...OrderFunc) *RentalQuery
- func (rq *RentalQuery) QueryCar() *CarQuery
- func (rq *RentalQuery) QueryUser() *UserQuery
- func (rq *RentalQuery) Select(fields ...string) *RentalSelect
- func (rq *RentalQuery) Unique(unique bool) *RentalQuery
- func (rq *RentalQuery) Where(ps ...predicate.Rental) *RentalQuery
- func (rq *RentalQuery) WithCar(opts ...func(*CarQuery)) *RentalQuery
- func (rq *RentalQuery) WithUser(opts ...func(*UserQuery)) *RentalQuery
- type RentalSelect
- func (s *RentalSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *RentalSelect) BoolX(ctx context.Context) bool
- func (s *RentalSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *RentalSelect) BoolsX(ctx context.Context) []bool
- func (s *RentalSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *RentalSelect) Float64X(ctx context.Context) float64
- func (s *RentalSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *RentalSelect) Float64sX(ctx context.Context) []float64
- func (s *RentalSelect) Int(ctx context.Context) (_ int, err error)
- func (s *RentalSelect) IntX(ctx context.Context) int
- func (s *RentalSelect) Ints(ctx context.Context) ([]int, error)
- func (s *RentalSelect) IntsX(ctx context.Context) []int
- func (rs *RentalSelect) Scan(ctx context.Context, v interface{}) error
- func (s *RentalSelect) ScanX(ctx context.Context, v interface{})
- func (s *RentalSelect) String(ctx context.Context) (_ string, err error)
- func (s *RentalSelect) StringX(ctx context.Context) string
- func (s *RentalSelect) Strings(ctx context.Context) ([]string, error)
- func (s *RentalSelect) StringsX(ctx context.Context) []string
- type RentalUpdate
- func (ru *RentalUpdate) ClearCar() *RentalUpdate
- func (ru *RentalUpdate) ClearUser() *RentalUpdate
- func (ru *RentalUpdate) Exec(ctx context.Context) error
- func (ru *RentalUpdate) ExecX(ctx context.Context)
- func (ru *RentalUpdate) Mutation() *RentalMutation
- func (ru *RentalUpdate) Save(ctx context.Context) (int, error)
- func (ru *RentalUpdate) SaveX(ctx context.Context) int
- func (ru *RentalUpdate) SetCar(c *Car) *RentalUpdate
- func (ru *RentalUpdate) SetCarID(u uuid.UUID) *RentalUpdate
- func (ru *RentalUpdate) SetDate(t time.Time) *RentalUpdate
- func (ru *RentalUpdate) SetNillableDate(t *time.Time) *RentalUpdate
- func (ru *RentalUpdate) SetUser(u *User) *RentalUpdate
- func (ru *RentalUpdate) SetUserID(i int) *RentalUpdate
- func (ru *RentalUpdate) Where(ps ...predicate.Rental) *RentalUpdate
- type RentalUpdateOne
- func (ruo *RentalUpdateOne) ClearCar() *RentalUpdateOne
- func (ruo *RentalUpdateOne) ClearUser() *RentalUpdateOne
- func (ruo *RentalUpdateOne) Exec(ctx context.Context) error
- func (ruo *RentalUpdateOne) ExecX(ctx context.Context)
- func (ruo *RentalUpdateOne) Mutation() *RentalMutation
- func (ruo *RentalUpdateOne) Save(ctx context.Context) (*Rental, error)
- func (ruo *RentalUpdateOne) SaveX(ctx context.Context) *Rental
- func (ruo *RentalUpdateOne) Select(field string, fields ...string) *RentalUpdateOne
- func (ruo *RentalUpdateOne) SetCar(c *Car) *RentalUpdateOne
- func (ruo *RentalUpdateOne) SetCarID(u uuid.UUID) *RentalUpdateOne
- func (ruo *RentalUpdateOne) SetDate(t time.Time) *RentalUpdateOne
- func (ruo *RentalUpdateOne) SetNillableDate(t *time.Time) *RentalUpdateOne
- func (ruo *RentalUpdateOne) SetUser(u *User) *RentalUpdateOne
- func (ruo *RentalUpdateOne) SetUserID(i int) *RentalUpdateOne
- type Rentals
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Tx
- type User
- func (u *User) QueryCard() *CardQuery
- func (u *User) QueryChildren() *UserQuery
- func (u *User) QueryInfo() *InfoQuery
- func (u *User) QueryMetadata() *MetadataQuery
- func (u *User) QueryParent() *UserQuery
- func (u *User) QueryPets() *PetQuery
- func (u *User) QueryRentals() *RentalQuery
- func (u *User) QuerySpouse() *UserQuery
- func (u *User) String() string
- func (u *User) Unwrap() *User
- func (u *User) Update() *UserUpdateOne
- type UserClient
- func (c *UserClient) Create() *UserCreate
- func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
- func (c *UserClient) Delete() *UserDelete
- func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
- func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id int) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id int) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) QueryCard(u *User) *CardQuery
- func (c *UserClient) QueryChildren(u *User) *UserQuery
- func (c *UserClient) QueryInfo(u *User) *InfoQuery
- func (c *UserClient) QueryMetadata(u *User) *MetadataQuery
- func (c *UserClient) QueryParent(u *User) *UserQuery
- func (c *UserClient) QueryPets(u *User) *PetQuery
- func (c *UserClient) QueryRentals(u *User) *RentalQuery
- func (c *UserClient) QuerySpouse(u *User) *UserQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- func (uc *UserCreate) AddChildIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddChildren(u ...*User) *UserCreate
- func (uc *UserCreate) AddInfo(i ...*Info) *UserCreate
- func (uc *UserCreate) AddInfoIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddPetIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddPets(p ...*Pet) *UserCreate
- func (uc *UserCreate) AddRentalIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddRentals(r ...*Rental) *UserCreate
- func (uc *UserCreate) Exec(ctx context.Context) error
- func (uc *UserCreate) ExecX(ctx context.Context)
- func (uc *UserCreate) Mutation() *UserMutation
- func (uc *UserCreate) Save(ctx context.Context) (*User, error)
- func (uc *UserCreate) SaveX(ctx context.Context) *User
- func (uc *UserCreate) SetCard(c *Card) *UserCreate
- func (uc *UserCreate) SetCardID(id int) *UserCreate
- func (uc *UserCreate) SetID(i int) *UserCreate
- func (uc *UserCreate) SetMetadata(m *Metadata) *UserCreate
- func (uc *UserCreate) SetMetadataID(id int) *UserCreate
- func (uc *UserCreate) SetNillableCardID(id *int) *UserCreate
- func (uc *UserCreate) SetNillableMetadataID(id *int) *UserCreate
- func (uc *UserCreate) SetNillableParentID(i *int) *UserCreate
- func (uc *UserCreate) SetNillableSpouseID(i *int) *UserCreate
- func (uc *UserCreate) SetParent(u *User) *UserCreate
- func (uc *UserCreate) SetParentID(i int) *UserCreate
- func (uc *UserCreate) SetSpouse(u *User) *UserCreate
- func (uc *UserCreate) SetSpouseID(i int) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserEdges
- func (e UserEdges) CardOrErr() (*Card, error)
- func (e UserEdges) ChildrenOrErr() ([]*User, error)
- func (e UserEdges) InfoOrErr() ([]*Info, error)
- func (e UserEdges) MetadataOrErr() (*Metadata, error)
- func (e UserEdges) ParentOrErr() (*User, error)
- func (e UserEdges) PetsOrErr() ([]*Pet, error)
- func (e UserEdges) RentalsOrErr() ([]*Rental, error)
- func (e UserEdges) SpouseOrErr() (*User, error)
- type UserGroupBy
- func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserGroupBy) BoolX(ctx context.Context) bool
- func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserGroupBy) Float64X(ctx context.Context) float64
- func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserGroupBy) IntX(ctx context.Context) int
- func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error
- func (s *UserGroupBy) ScanX(ctx context.Context, v interface{})
- func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserGroupBy) StringX(ctx context.Context) string
- func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) AddChildIDs(ids ...int)
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddInfoIDs(ids ...int)
- func (m *UserMutation) AddPetIDs(ids ...int)
- func (m *UserMutation) AddRentalIDs(ids ...int)
- func (m *UserMutation) AddedEdges() []string
- func (m *UserMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserMutation) AddedFields() []string
- func (m *UserMutation) AddedIDs(name string) []ent.Value
- func (m *UserMutation) CardCleared() bool
- func (m *UserMutation) CardID() (id int, exists bool)
- func (m *UserMutation) CardIDs() (ids []int)
- func (m *UserMutation) ChildrenCleared() bool
- func (m *UserMutation) ChildrenIDs() (ids []int)
- func (m *UserMutation) ClearCard()
- func (m *UserMutation) ClearChildren()
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearInfo()
- func (m *UserMutation) ClearMetadata()
- func (m *UserMutation) ClearParent()
- func (m *UserMutation) ClearParentID()
- func (m *UserMutation) ClearPets()
- func (m *UserMutation) ClearRentals()
- func (m *UserMutation) ClearSpouse()
- func (m *UserMutation) ClearSpouseID()
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) Field(name string) (ent.Value, bool)
- func (m *UserMutation) FieldCleared(name string) bool
- func (m *UserMutation) Fields() []string
- func (m *UserMutation) ID() (id int, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
- func (m *UserMutation) InfoCleared() bool
- func (m *UserMutation) InfoIDs() (ids []int)
- func (m *UserMutation) MetadataCleared() bool
- func (m *UserMutation) MetadataID() (id int, exists bool)
- func (m *UserMutation) MetadataIDs() (ids []int)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldParentID(ctx context.Context) (v int, err error)
- func (m *UserMutation) OldSpouseID(ctx context.Context) (v int, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) ParentCleared() bool
- func (m *UserMutation) ParentID() (r int, exists bool)
- func (m *UserMutation) ParentIDCleared() bool
- func (m *UserMutation) ParentIDs() (ids []int)
- func (m *UserMutation) PetsCleared() bool
- func (m *UserMutation) PetsIDs() (ids []int)
- func (m *UserMutation) RemoveChildIDs(ids ...int)
- func (m *UserMutation) RemoveInfoIDs(ids ...int)
- func (m *UserMutation) RemovePetIDs(ids ...int)
- func (m *UserMutation) RemoveRentalIDs(ids ...int)
- func (m *UserMutation) RemovedChildrenIDs() (ids []int)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedInfoIDs() (ids []int)
- func (m *UserMutation) RemovedPetsIDs() (ids []int)
- func (m *UserMutation) RemovedRentalsIDs() (ids []int)
- func (m *UserMutation) RentalsCleared() bool
- func (m *UserMutation) RentalsIDs() (ids []int)
- func (m *UserMutation) ResetCard()
- func (m *UserMutation) ResetChildren()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetInfo()
- func (m *UserMutation) ResetMetadata()
- func (m *UserMutation) ResetParent()
- func (m *UserMutation) ResetParentID()
- func (m *UserMutation) ResetPets()
- func (m *UserMutation) ResetRentals()
- func (m *UserMutation) ResetSpouse()
- func (m *UserMutation) ResetSpouseID()
- func (m *UserMutation) SetCardID(id int)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetID(id int)
- func (m *UserMutation) SetMetadataID(id int)
- func (m *UserMutation) SetParentID(i int)
- func (m *UserMutation) SetSpouseID(i int)
- func (m *UserMutation) SpouseCleared() bool
- func (m *UserMutation) SpouseID() (r int, exists bool)
- func (m *UserMutation) SpouseIDCleared() bool
- func (m *UserMutation) SpouseIDs() (ids []int)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) Where(ps ...predicate.User)
- type UserQuery
- func (uq *UserQuery) All(ctx context.Context) ([]*User, error)
- func (uq *UserQuery) AllX(ctx context.Context) []*User
- func (uq *UserQuery) Clone() *UserQuery
- func (uq *UserQuery) Count(ctx context.Context) (int, error)
- func (uq *UserQuery) CountX(ctx context.Context) int
- func (uq *UserQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UserQuery) ExistX(ctx context.Context) bool
- func (uq *UserQuery) First(ctx context.Context) (*User, error)
- func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) int
- func (uq *UserQuery) FirstX(ctx context.Context) *User
- func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (uq *UserQuery) IDs(ctx context.Context) ([]int, error)
- func (uq *UserQuery) IDsX(ctx context.Context) []int
- func (uq *UserQuery) Limit(limit int) *UserQuery
- func (uq *UserQuery) Offset(offset int) *UserQuery
- func (uq *UserQuery) Only(ctx context.Context) (*User, error)
- func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) int
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery
- func (uq *UserQuery) QueryCard() *CardQuery
- func (uq *UserQuery) QueryChildren() *UserQuery
- func (uq *UserQuery) QueryInfo() *InfoQuery
- func (uq *UserQuery) QueryMetadata() *MetadataQuery
- func (uq *UserQuery) QueryParent() *UserQuery
- func (uq *UserQuery) QueryPets() *PetQuery
- func (uq *UserQuery) QueryRentals() *RentalQuery
- func (uq *UserQuery) QuerySpouse() *UserQuery
- func (uq *UserQuery) Select(fields ...string) *UserSelect
- func (uq *UserQuery) Unique(unique bool) *UserQuery
- func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery
- func (uq *UserQuery) WithCard(opts ...func(*CardQuery)) *UserQuery
- func (uq *UserQuery) WithChildren(opts ...func(*UserQuery)) *UserQuery
- func (uq *UserQuery) WithInfo(opts ...func(*InfoQuery)) *UserQuery
- func (uq *UserQuery) WithMetadata(opts ...func(*MetadataQuery)) *UserQuery
- func (uq *UserQuery) WithParent(opts ...func(*UserQuery)) *UserQuery
- func (uq *UserQuery) WithPets(opts ...func(*PetQuery)) *UserQuery
- func (uq *UserQuery) WithRentals(opts ...func(*RentalQuery)) *UserQuery
- func (uq *UserQuery) WithSpouse(opts ...func(*UserQuery)) *UserQuery
- type UserSelect
- func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserSelect) BoolX(ctx context.Context) bool
- func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserSelect) BoolsX(ctx context.Context) []bool
- func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserSelect) Float64X(ctx context.Context) float64
- func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserSelect) Float64sX(ctx context.Context) []float64
- func (s *UserSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserSelect) IntX(ctx context.Context) int
- func (s *UserSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserSelect) IntsX(ctx context.Context) []int
- func (us *UserSelect) Scan(ctx context.Context, v interface{}) error
- func (s *UserSelect) ScanX(ctx context.Context, v interface{})
- func (s *UserSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserSelect) StringX(ctx context.Context) string
- func (s *UserSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserSelect) StringsX(ctx context.Context) []string
- type UserUpdate
- func (uu *UserUpdate) AddChildIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddChildren(u ...*User) *UserUpdate
- func (uu *UserUpdate) AddInfo(i ...*Info) *UserUpdate
- func (uu *UserUpdate) AddInfoIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddPetIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddPets(p ...*Pet) *UserUpdate
- func (uu *UserUpdate) AddRentalIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddRentals(r ...*Rental) *UserUpdate
- func (uu *UserUpdate) ClearCard() *UserUpdate
- func (uu *UserUpdate) ClearChildren() *UserUpdate
- func (uu *UserUpdate) ClearInfo() *UserUpdate
- func (uu *UserUpdate) ClearMetadata() *UserUpdate
- func (uu *UserUpdate) ClearParent() *UserUpdate
- func (uu *UserUpdate) ClearParentID() *UserUpdate
- func (uu *UserUpdate) ClearPets() *UserUpdate
- func (uu *UserUpdate) ClearRentals() *UserUpdate
- func (uu *UserUpdate) ClearSpouse() *UserUpdate
- func (uu *UserUpdate) ClearSpouseID() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) RemoveChildIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveChildren(u ...*User) *UserUpdate
- func (uu *UserUpdate) RemoveInfo(i ...*Info) *UserUpdate
- func (uu *UserUpdate) RemoveInfoIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemovePetIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemovePets(p ...*Pet) *UserUpdate
- func (uu *UserUpdate) RemoveRentalIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveRentals(r ...*Rental) *UserUpdate
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetCard(c *Card) *UserUpdate
- func (uu *UserUpdate) SetCardID(id int) *UserUpdate
- func (uu *UserUpdate) SetMetadata(m *Metadata) *UserUpdate
- func (uu *UserUpdate) SetMetadataID(id int) *UserUpdate
- func (uu *UserUpdate) SetNillableCardID(id *int) *UserUpdate
- func (uu *UserUpdate) SetNillableMetadataID(id *int) *UserUpdate
- func (uu *UserUpdate) SetNillableParentID(i *int) *UserUpdate
- func (uu *UserUpdate) SetNillableSpouseID(i *int) *UserUpdate
- func (uu *UserUpdate) SetParent(u *User) *UserUpdate
- func (uu *UserUpdate) SetParentID(i int) *UserUpdate
- func (uu *UserUpdate) SetSpouse(u *User) *UserUpdate
- func (uu *UserUpdate) SetSpouseID(i int) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddChildIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddChildren(u ...*User) *UserUpdateOne
- func (uuo *UserUpdateOne) AddInfo(i ...*Info) *UserUpdateOne
- func (uuo *UserUpdateOne) AddInfoIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddPetIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddPets(p ...*Pet) *UserUpdateOne
- func (uuo *UserUpdateOne) AddRentalIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddRentals(r ...*Rental) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearCard() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearChildren() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearInfo() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearMetadata() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearParent() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearParentID() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearPets() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearRentals() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearSpouse() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearSpouseID() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) RemoveChildIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveChildren(u ...*User) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveInfo(i ...*Info) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveInfoIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemovePetIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemovePets(p ...*Pet) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveRentalIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveRentals(r ...*Rental) *UserUpdateOne
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetCard(c *Card) *UserUpdateOne
- func (uuo *UserUpdateOne) SetCardID(id int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetMetadata(m *Metadata) *UserUpdateOne
- func (uuo *UserUpdateOne) SetMetadataID(id int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableCardID(id *int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableMetadataID(id *int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableParentID(i *int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableSpouseID(i *int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetParent(u *User) *UserUpdateOne
- func (uuo *UserUpdateOne) SetParentID(i int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetSpouse(u *User) *UserUpdateOne
- func (uuo *UserUpdateOne) SetSpouseID(i int) *UserUpdateOne
- type Users
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeCar = "Car" TypeCard = "Card" TypeInfo = "Info" TypeMetadata = "Metadata" TypeNode = "Node" TypePet = "Pet" TypePost = "Post" TypeRental = "Rental" TypeUser = "User" )
Variables ¶
This section is empty.
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 Car ¶
type Car struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // Number holds the value of the "number" field. Number string `json:"number,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the CarQuery when eager-loading is set. Edges CarEdges `json:"edges"` // contains filtered or unexported fields }
Car is the model entity for the Car schema.
func (*Car) QueryRentals ¶
func (c *Car) QueryRentals() *RentalQuery
QueryRentals queries the "rentals" edge of the Car entity.
func (*Car) Unwrap ¶
Unwrap unwraps the Car 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 (*Car) Update ¶
func (c *Car) Update() *CarUpdateOne
Update returns a builder for updating this Car. Note that you need to call Car.Unwrap() before calling this method if this Car was returned from a transaction, and the transaction was committed or rolled back.
type CarClient ¶
type CarClient struct {
// contains filtered or unexported fields
}
CarClient is a client for the Car schema.
func NewCarClient ¶
func NewCarClient(c config) *CarClient
NewCarClient returns a client for the Car from the given config.
func (*CarClient) CreateBulk ¶
func (c *CarClient) CreateBulk(builders ...*CarCreate) *CarCreateBulk
CreateBulk returns a builder for creating a bulk of Car entities.
func (*CarClient) DeleteOne ¶
func (c *CarClient) DeleteOne(ca *Car) *CarDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*CarClient) DeleteOneID ¶
func (c *CarClient) DeleteOneID(id uuid.UUID) *CarDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*CarClient) QueryRentals ¶
func (c *CarClient) QueryRentals(ca *Car) *RentalQuery
QueryRentals queries the rentals edge of a Car.
func (*CarClient) UpdateOne ¶
func (c *CarClient) UpdateOne(ca *Car) *CarUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CarClient) UpdateOneID ¶
func (c *CarClient) UpdateOneID(id uuid.UUID) *CarUpdateOne
UpdateOneID returns an update builder for the given id.
type CarCreate ¶
type CarCreate struct {
// contains filtered or unexported fields
}
CarCreate is the builder for creating a Car entity.
func (*CarCreate) AddRentalIDs ¶
AddRentalIDs adds the "rentals" edge to the Rental entity by IDs.
func (*CarCreate) AddRentals ¶
AddRentals adds the "rentals" edges to the Rental entity.
func (*CarCreate) Mutation ¶
func (cc *CarCreate) Mutation() *CarMutation
Mutation returns the CarMutation object of the builder.
func (*CarCreate) SetNillableID ¶
SetNillableID sets the "id" field if the given value is not nil.
func (*CarCreate) SetNillableNumber ¶
SetNillableNumber sets the "number" field if the given value is not nil.
type CarCreateBulk ¶
type CarCreateBulk struct {
// contains filtered or unexported fields
}
CarCreateBulk is the builder for creating many Car entities in bulk.
func (*CarCreateBulk) Exec ¶
func (ccb *CarCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CarCreateBulk) ExecX ¶
func (ccb *CarCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type CarDelete ¶
type CarDelete struct {
// contains filtered or unexported fields
}
CarDelete is the builder for deleting a Car entity.
func (*CarDelete) Exec ¶
Exec executes the deletion query and returns how many vertices were deleted.
type CarDeleteOne ¶
type CarDeleteOne struct {
// contains filtered or unexported fields
}
CarDeleteOne is the builder for deleting a single Car entity.
func (*CarDeleteOne) Exec ¶
func (cdo *CarDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CarDeleteOne) ExecX ¶
func (cdo *CarDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type CarEdges ¶
type CarEdges struct { // Rentals holds the value of the rentals edge. Rentals []*Rental `json:"rentals,omitempty"` // contains filtered or unexported fields }
CarEdges holds the relations/edges for other nodes in the graph.
func (CarEdges) RentalsOrErr ¶
RentalsOrErr returns the Rentals value or an error if the edge was not loaded in eager-loading.
type CarGroupBy ¶
type CarGroupBy struct {
// contains filtered or unexported fields
}
CarGroupBy is the group-by builder for Car entities.
func (*CarGroupBy) Aggregate ¶
func (cgb *CarGroupBy) Aggregate(fns ...AggregateFunc) *CarGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CarGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CarGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CarGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CarGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CarGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CarGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CarGroupBy) Scan ¶
func (cgb *CarGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*CarGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CarMutation ¶
type CarMutation struct {
// contains filtered or unexported fields
}
CarMutation represents an operation that mutates the Car nodes in the graph.
func (*CarMutation) AddField ¶
func (m *CarMutation) 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 (*CarMutation) AddRentalIDs ¶
func (m *CarMutation) AddRentalIDs(ids ...int)
AddRentalIDs adds the "rentals" edge to the Rental entity by ids.
func (*CarMutation) AddedEdges ¶
func (m *CarMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CarMutation) AddedField ¶
func (m *CarMutation) 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 (*CarMutation) AddedFields ¶
func (m *CarMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CarMutation) AddedIDs ¶
func (m *CarMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CarMutation) ClearEdge ¶
func (m *CarMutation) 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 (*CarMutation) ClearField ¶
func (m *CarMutation) 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 (*CarMutation) ClearNumber ¶
func (m *CarMutation) ClearNumber()
ClearNumber clears the value of the "number" field.
func (*CarMutation) ClearRentals ¶
func (m *CarMutation) ClearRentals()
ClearRentals clears the "rentals" edge to the Rental entity.
func (*CarMutation) ClearedEdges ¶
func (m *CarMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CarMutation) ClearedFields ¶
func (m *CarMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CarMutation) Client ¶
func (m CarMutation) 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 (*CarMutation) EdgeCleared ¶
func (m *CarMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CarMutation) Field ¶
func (m *CarMutation) 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 (*CarMutation) FieldCleared ¶
func (m *CarMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CarMutation) Fields ¶
func (m *CarMutation) 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 (*CarMutation) ID ¶
func (m *CarMutation) ID() (id uuid.UUID, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*CarMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*CarMutation) Number ¶
func (m *CarMutation) Number() (r string, exists bool)
Number returns the value of the "number" field in the mutation.
func (*CarMutation) NumberCleared ¶
func (m *CarMutation) NumberCleared() bool
NumberCleared returns if the "number" field was cleared in this mutation.
func (*CarMutation) 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 (*CarMutation) OldNumber ¶
func (m *CarMutation) OldNumber(ctx context.Context) (v string, err error)
OldNumber returns the old "number" field's value of the Car entity. If the Car 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 (*CarMutation) RemoveRentalIDs ¶
func (m *CarMutation) RemoveRentalIDs(ids ...int)
RemoveRentalIDs removes the "rentals" edge to the Rental entity by IDs.
func (*CarMutation) RemovedEdges ¶
func (m *CarMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CarMutation) RemovedIDs ¶
func (m *CarMutation) 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 (*CarMutation) RemovedRentalsIDs ¶
func (m *CarMutation) RemovedRentalsIDs() (ids []int)
RemovedRentals returns the removed IDs of the "rentals" edge to the Rental entity.
func (*CarMutation) RentalsCleared ¶
func (m *CarMutation) RentalsCleared() bool
RentalsCleared reports if the "rentals" edge to the Rental entity was cleared.
func (*CarMutation) RentalsIDs ¶
func (m *CarMutation) RentalsIDs() (ids []int)
RentalsIDs returns the "rentals" edge IDs in the mutation.
func (*CarMutation) ResetEdge ¶
func (m *CarMutation) 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 (*CarMutation) ResetField ¶
func (m *CarMutation) 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 (*CarMutation) ResetNumber ¶
func (m *CarMutation) ResetNumber()
ResetNumber resets all changes to the "number" field.
func (*CarMutation) ResetRentals ¶
func (m *CarMutation) ResetRentals()
ResetRentals resets all changes to the "rentals" edge.
func (*CarMutation) SetField ¶
func (m *CarMutation) 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 (*CarMutation) SetID ¶
func (m *CarMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Car entities.
func (*CarMutation) SetNumber ¶
func (m *CarMutation) SetNumber(s string)
SetNumber sets the "number" field.
func (CarMutation) Tx ¶
func (m CarMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CarMutation) Type ¶
func (m *CarMutation) Type() string
Type returns the node type of this mutation (Car).
func (*CarMutation) Where ¶
func (m *CarMutation) Where(ps ...predicate.Car)
Where appends a list predicates to the CarMutation builder.
type CarQuery ¶
type CarQuery struct {
// contains filtered or unexported fields
}
CarQuery is the builder for querying Car entities.
func (*CarQuery) Clone ¶
Clone returns a duplicate of the CarQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CarQuery) First ¶
First returns the first Car entity from the query. Returns a *NotFoundError when no Car was found.
func (*CarQuery) FirstID ¶
FirstID returns the first Car ID from the query. Returns a *NotFoundError when no Car ID was found.
func (*CarQuery) GroupBy ¶
func (cq *CarQuery) GroupBy(field string, fields ...string) *CarGroupBy
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 { Number string `json:"number,omitempty"` Count int `json:"count,omitempty"` } client.Car.Query(). GroupBy(car.FieldNumber). Aggregate(ent.Count()). Scan(ctx, &v)
func (*CarQuery) Only ¶
Only returns a single Car entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Car entity is found. Returns a *NotFoundError when no Car entities are found.
func (*CarQuery) OnlyID ¶
OnlyID is like Only, but returns the only Car ID in the query. Returns a *NotSingularError when more than one Car ID is found. Returns a *NotFoundError when no entities are found.
func (*CarQuery) QueryRentals ¶
func (cq *CarQuery) QueryRentals() *RentalQuery
QueryRentals chains the current query on the "rentals" edge.
func (*CarQuery) Select ¶
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 { Number string `json:"number,omitempty"` } client.Car.Query(). Select(car.FieldNumber). Scan(ctx, &v)
func (*CarQuery) 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 (*CarQuery) WithRentals ¶
func (cq *CarQuery) WithRentals(opts ...func(*RentalQuery)) *CarQuery
WithRentals tells the query-builder to eager-load the nodes that are connected to the "rentals" edge. The optional arguments are used to configure the query builder of the edge.
type CarSelect ¶
type CarSelect struct { *CarQuery // contains filtered or unexported fields }
CarSelect is the builder for selecting fields of Car entities.
func (*CarSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CarSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CarSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CarSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CarSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CarSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CarSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CarUpdate ¶
type CarUpdate struct {
// contains filtered or unexported fields
}
CarUpdate is the builder for updating Car entities.
func (*CarUpdate) AddRentalIDs ¶
AddRentalIDs adds the "rentals" edge to the Rental entity by IDs.
func (*CarUpdate) AddRentals ¶
AddRentals adds the "rentals" edges to the Rental entity.
func (*CarUpdate) ClearNumber ¶
ClearNumber clears the value of the "number" field.
func (*CarUpdate) ClearRentals ¶
ClearRentals clears all "rentals" edges to the Rental entity.
func (*CarUpdate) Mutation ¶
func (cu *CarUpdate) Mutation() *CarMutation
Mutation returns the CarMutation object of the builder.
func (*CarUpdate) RemoveRentalIDs ¶
RemoveRentalIDs removes the "rentals" edge to Rental entities by IDs.
func (*CarUpdate) RemoveRentals ¶
RemoveRentals removes "rentals" edges to Rental entities.
func (*CarUpdate) Save ¶
Save executes the query and returns the number of nodes affected by the update operation.
func (*CarUpdate) SetNillableNumber ¶
SetNillableNumber sets the "number" field if the given value is not nil.
type CarUpdateOne ¶
type CarUpdateOne struct {
// contains filtered or unexported fields
}
CarUpdateOne is the builder for updating a single Car entity.
func (*CarUpdateOne) AddRentalIDs ¶
func (cuo *CarUpdateOne) AddRentalIDs(ids ...int) *CarUpdateOne
AddRentalIDs adds the "rentals" edge to the Rental entity by IDs.
func (*CarUpdateOne) AddRentals ¶
func (cuo *CarUpdateOne) AddRentals(r ...*Rental) *CarUpdateOne
AddRentals adds the "rentals" edges to the Rental entity.
func (*CarUpdateOne) ClearNumber ¶
func (cuo *CarUpdateOne) ClearNumber() *CarUpdateOne
ClearNumber clears the value of the "number" field.
func (*CarUpdateOne) ClearRentals ¶
func (cuo *CarUpdateOne) ClearRentals() *CarUpdateOne
ClearRentals clears all "rentals" edges to the Rental entity.
func (*CarUpdateOne) Exec ¶
func (cuo *CarUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CarUpdateOne) ExecX ¶
func (cuo *CarUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CarUpdateOne) Mutation ¶
func (cuo *CarUpdateOne) Mutation() *CarMutation
Mutation returns the CarMutation object of the builder.
func (*CarUpdateOne) RemoveRentalIDs ¶
func (cuo *CarUpdateOne) RemoveRentalIDs(ids ...int) *CarUpdateOne
RemoveRentalIDs removes the "rentals" edge to Rental entities by IDs.
func (*CarUpdateOne) RemoveRentals ¶
func (cuo *CarUpdateOne) RemoveRentals(r ...*Rental) *CarUpdateOne
RemoveRentals removes "rentals" edges to Rental entities.
func (*CarUpdateOne) Save ¶
func (cuo *CarUpdateOne) Save(ctx context.Context) (*Car, error)
Save executes the query and returns the updated Car entity.
func (*CarUpdateOne) SaveX ¶
func (cuo *CarUpdateOne) SaveX(ctx context.Context) *Car
SaveX is like Save, but panics if an error occurs.
func (*CarUpdateOne) Select ¶
func (cuo *CarUpdateOne) Select(field string, fields ...string) *CarUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CarUpdateOne) SetNillableNumber ¶
func (cuo *CarUpdateOne) SetNillableNumber(s *string) *CarUpdateOne
SetNillableNumber sets the "number" field if the given value is not nil.
func (*CarUpdateOne) SetNumber ¶
func (cuo *CarUpdateOne) SetNumber(s string) *CarUpdateOne
SetNumber sets the "number" field.
type Card ¶
type Card struct { // ID of the ent. ID int `json:"id,omitempty"` // Number holds the value of the "number" field. Number string `json:"number,omitempty"` // OwnerID holds the value of the "owner_id" field. OwnerID int `json:"owner_id,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the CardQuery when eager-loading is set. Edges CardEdges `json:"edges"` // contains filtered or unexported fields }
Card is the model entity for the Card schema.
func (*Card) QueryOwner ¶
QueryOwner queries the "owner" edge of the Card entity.
func (*Card) Unwrap ¶
Unwrap unwraps the Card 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 (*Card) Update ¶
func (c *Card) Update() *CardUpdateOne
Update returns a builder for updating this Card. Note that you need to call Card.Unwrap() before calling this method if this Card was returned from a transaction, and the transaction was committed or rolled back.
type CardClient ¶
type CardClient struct {
// contains filtered or unexported fields
}
CardClient is a client for the Card schema.
func NewCardClient ¶
func NewCardClient(c config) *CardClient
NewCardClient returns a client for the Card from the given config.
func (*CardClient) Create ¶
func (c *CardClient) Create() *CardCreate
Create returns a create builder for Card.
func (*CardClient) CreateBulk ¶
func (c *CardClient) CreateBulk(builders ...*CardCreate) *CardCreateBulk
CreateBulk returns a builder for creating a bulk of Card entities.
func (*CardClient) Delete ¶
func (c *CardClient) Delete() *CardDelete
Delete returns a delete builder for Card.
func (*CardClient) DeleteOne ¶
func (c *CardClient) DeleteOne(ca *Card) *CardDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*CardClient) DeleteOneID ¶
func (c *CardClient) DeleteOneID(id int) *CardDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*CardClient) GetX ¶
func (c *CardClient) GetX(ctx context.Context, id int) *Card
GetX is like Get, but panics if an error occurs.
func (*CardClient) Query ¶
func (c *CardClient) Query() *CardQuery
Query returns a query builder for Card.
func (*CardClient) QueryOwner ¶
func (c *CardClient) QueryOwner(ca *Card) *UserQuery
QueryOwner queries the owner edge of a Card.
func (*CardClient) Update ¶
func (c *CardClient) Update() *CardUpdate
Update returns an update builder for Card.
func (*CardClient) UpdateOne ¶
func (c *CardClient) UpdateOne(ca *Card) *CardUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CardClient) UpdateOneID ¶
func (c *CardClient) UpdateOneID(id int) *CardUpdateOne
UpdateOneID returns an update builder for the given id.
func (*CardClient) Use ¶
func (c *CardClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `card.Hooks(f(g(h())))`.
type CardCreate ¶
type CardCreate struct {
// contains filtered or unexported fields
}
CardCreate is the builder for creating a Card entity.
func (*CardCreate) Exec ¶
func (cc *CardCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*CardCreate) ExecX ¶
func (cc *CardCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CardCreate) Mutation ¶
func (cc *CardCreate) Mutation() *CardMutation
Mutation returns the CardMutation object of the builder.
func (*CardCreate) Save ¶
func (cc *CardCreate) Save(ctx context.Context) (*Card, error)
Save creates the Card in the database.
func (*CardCreate) SaveX ¶
func (cc *CardCreate) SaveX(ctx context.Context) *Card
SaveX calls Save and panics if Save returns an error.
func (*CardCreate) SetNillableNumber ¶
func (cc *CardCreate) SetNillableNumber(s *string) *CardCreate
SetNillableNumber sets the "number" field if the given value is not nil.
func (*CardCreate) SetNillableOwnerID ¶
func (cc *CardCreate) SetNillableOwnerID(i *int) *CardCreate
SetNillableOwnerID sets the "owner_id" field if the given value is not nil.
func (*CardCreate) SetNumber ¶
func (cc *CardCreate) SetNumber(s string) *CardCreate
SetNumber sets the "number" field.
func (*CardCreate) SetOwner ¶
func (cc *CardCreate) SetOwner(u *User) *CardCreate
SetOwner sets the "owner" edge to the User entity.
func (*CardCreate) SetOwnerID ¶
func (cc *CardCreate) SetOwnerID(i int) *CardCreate
SetOwnerID sets the "owner_id" field.
type CardCreateBulk ¶
type CardCreateBulk struct {
// contains filtered or unexported fields
}
CardCreateBulk is the builder for creating many Card entities in bulk.
func (*CardCreateBulk) Exec ¶
func (ccb *CardCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CardCreateBulk) ExecX ¶
func (ccb *CardCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type CardDelete ¶
type CardDelete struct {
// contains filtered or unexported fields
}
CardDelete is the builder for deleting a Card entity.
func (*CardDelete) Exec ¶
func (cd *CardDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*CardDelete) ExecX ¶
func (cd *CardDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*CardDelete) Where ¶
func (cd *CardDelete) Where(ps ...predicate.Card) *CardDelete
Where appends a list predicates to the CardDelete builder.
type CardDeleteOne ¶
type CardDeleteOne struct {
// contains filtered or unexported fields
}
CardDeleteOne is the builder for deleting a single Card entity.
func (*CardDeleteOne) Exec ¶
func (cdo *CardDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CardDeleteOne) ExecX ¶
func (cdo *CardDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type CardEdges ¶
type CardEdges struct { // Owner holds the value of the owner edge. Owner *User `json:"owner,omitempty"` // contains filtered or unexported fields }
CardEdges holds the relations/edges for other nodes in the graph.
func (CardEdges) OwnerOrErr ¶
OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type CardGroupBy ¶
type CardGroupBy struct {
// contains filtered or unexported fields
}
CardGroupBy is the group-by builder for Card entities.
func (*CardGroupBy) Aggregate ¶
func (cgb *CardGroupBy) Aggregate(fns ...AggregateFunc) *CardGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CardGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CardGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CardGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CardGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CardGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CardGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CardGroupBy) Scan ¶
func (cgb *CardGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*CardGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CardMutation ¶
type CardMutation struct {
// contains filtered or unexported fields
}
CardMutation represents an operation that mutates the Card nodes in the graph.
func (*CardMutation) AddField ¶
func (m *CardMutation) 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 (*CardMutation) AddedEdges ¶
func (m *CardMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CardMutation) AddedField ¶
func (m *CardMutation) 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 (*CardMutation) AddedFields ¶
func (m *CardMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CardMutation) AddedIDs ¶
func (m *CardMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CardMutation) ClearEdge ¶
func (m *CardMutation) 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 (*CardMutation) ClearField ¶
func (m *CardMutation) 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 (*CardMutation) ClearNumber ¶
func (m *CardMutation) ClearNumber()
ClearNumber clears the value of the "number" field.
func (*CardMutation) ClearOwner ¶
func (m *CardMutation) ClearOwner()
ClearOwner clears the "owner" edge to the User entity.
func (*CardMutation) ClearOwnerID ¶
func (m *CardMutation) ClearOwnerID()
ClearOwnerID clears the value of the "owner_id" field.
func (*CardMutation) ClearedEdges ¶
func (m *CardMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CardMutation) ClearedFields ¶
func (m *CardMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CardMutation) Client ¶
func (m CardMutation) 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 (*CardMutation) EdgeCleared ¶
func (m *CardMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CardMutation) Field ¶
func (m *CardMutation) 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 (*CardMutation) FieldCleared ¶
func (m *CardMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CardMutation) Fields ¶
func (m *CardMutation) 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 (*CardMutation) ID ¶
func (m *CardMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*CardMutation) IDs ¶
func (m *CardMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*CardMutation) Number ¶
func (m *CardMutation) Number() (r string, exists bool)
Number returns the value of the "number" field in the mutation.
func (*CardMutation) NumberCleared ¶
func (m *CardMutation) NumberCleared() bool
NumberCleared returns if the "number" field was cleared in this mutation.
func (*CardMutation) 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 (*CardMutation) OldNumber ¶
func (m *CardMutation) OldNumber(ctx context.Context) (v string, err error)
OldNumber returns the old "number" field's value of the Card entity. If the Card 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 (*CardMutation) OldOwnerID ¶
func (m *CardMutation) OldOwnerID(ctx context.Context) (v int, err error)
OldOwnerID returns the old "owner_id" field's value of the Card entity. If the Card 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 (*CardMutation) OwnerCleared ¶
func (m *CardMutation) OwnerCleared() bool
OwnerCleared reports if the "owner" edge to the User entity was cleared.
func (*CardMutation) OwnerID ¶
func (m *CardMutation) OwnerID() (r int, exists bool)
OwnerID returns the value of the "owner_id" field in the mutation.
func (*CardMutation) OwnerIDCleared ¶
func (m *CardMutation) OwnerIDCleared() bool
OwnerIDCleared returns if the "owner_id" field was cleared in this mutation.
func (*CardMutation) OwnerIDs ¶
func (m *CardMutation) OwnerIDs() (ids []int)
OwnerIDs returns the "owner" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OwnerID instead. It exists only for internal usage by the builders.
func (*CardMutation) RemovedEdges ¶
func (m *CardMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CardMutation) RemovedIDs ¶
func (m *CardMutation) 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 (*CardMutation) ResetEdge ¶
func (m *CardMutation) 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 (*CardMutation) ResetField ¶
func (m *CardMutation) 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 (*CardMutation) ResetNumber ¶
func (m *CardMutation) ResetNumber()
ResetNumber resets all changes to the "number" field.
func (*CardMutation) ResetOwner ¶
func (m *CardMutation) ResetOwner()
ResetOwner resets all changes to the "owner" edge.
func (*CardMutation) ResetOwnerID ¶
func (m *CardMutation) ResetOwnerID()
ResetOwnerID resets all changes to the "owner_id" field.
func (*CardMutation) SetField ¶
func (m *CardMutation) 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 (*CardMutation) SetNumber ¶
func (m *CardMutation) SetNumber(s string)
SetNumber sets the "number" field.
func (*CardMutation) SetOwnerID ¶
func (m *CardMutation) SetOwnerID(i int)
SetOwnerID sets the "owner_id" field.
func (CardMutation) Tx ¶
func (m CardMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CardMutation) Type ¶
func (m *CardMutation) Type() string
Type returns the node type of this mutation (Card).
func (*CardMutation) Where ¶
func (m *CardMutation) Where(ps ...predicate.Card)
Where appends a list predicates to the CardMutation builder.
type CardQuery ¶
type CardQuery struct {
// contains filtered or unexported fields
}
CardQuery is the builder for querying Card entities.
func (*CardQuery) Clone ¶
Clone returns a duplicate of the CardQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CardQuery) First ¶
First returns the first Card entity from the query. Returns a *NotFoundError when no Card was found.
func (*CardQuery) FirstID ¶
FirstID returns the first Card ID from the query. Returns a *NotFoundError when no Card ID was found.
func (*CardQuery) GroupBy ¶
func (cq *CardQuery) GroupBy(field string, fields ...string) *CardGroupBy
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 { Number string `json:"number,omitempty"` Count int `json:"count,omitempty"` } client.Card.Query(). GroupBy(card.FieldNumber). Aggregate(ent.Count()). Scan(ctx, &v)
func (*CardQuery) Only ¶
Only returns a single Card entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Card entity is found. Returns a *NotFoundError when no Card entities are found.
func (*CardQuery) OnlyID ¶
OnlyID is like Only, but returns the only Card ID in the query. Returns a *NotSingularError when more than one Card ID is found. Returns a *NotFoundError when no entities are found.
func (*CardQuery) QueryOwner ¶
QueryOwner chains the current query on the "owner" edge.
func (*CardQuery) Select ¶
func (cq *CardQuery) Select(fields ...string) *CardSelect
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 { Number string `json:"number,omitempty"` } client.Card.Query(). Select(card.FieldNumber). Scan(ctx, &v)
func (*CardQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
type CardSelect ¶
type CardSelect struct { *CardQuery // contains filtered or unexported fields }
CardSelect is the builder for selecting fields of Card entities.
func (*CardSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CardSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CardSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CardSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CardSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CardSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CardSelect) Scan ¶
func (cs *CardSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*CardSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CardUpdate ¶
type CardUpdate struct {
// contains filtered or unexported fields
}
CardUpdate is the builder for updating Card entities.
func (*CardUpdate) ClearNumber ¶
func (cu *CardUpdate) ClearNumber() *CardUpdate
ClearNumber clears the value of the "number" field.
func (*CardUpdate) ClearOwner ¶
func (cu *CardUpdate) ClearOwner() *CardUpdate
ClearOwner clears the "owner" edge to the User entity.
func (*CardUpdate) ClearOwnerID ¶
func (cu *CardUpdate) ClearOwnerID() *CardUpdate
ClearOwnerID clears the value of the "owner_id" field.
func (*CardUpdate) Exec ¶
func (cu *CardUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*CardUpdate) ExecX ¶
func (cu *CardUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CardUpdate) Mutation ¶
func (cu *CardUpdate) Mutation() *CardMutation
Mutation returns the CardMutation object of the builder.
func (*CardUpdate) Save ¶
func (cu *CardUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*CardUpdate) SaveX ¶
func (cu *CardUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*CardUpdate) SetNillableNumber ¶
func (cu *CardUpdate) SetNillableNumber(s *string) *CardUpdate
SetNillableNumber sets the "number" field if the given value is not nil.
func (*CardUpdate) SetNillableOwnerID ¶
func (cu *CardUpdate) SetNillableOwnerID(i *int) *CardUpdate
SetNillableOwnerID sets the "owner_id" field if the given value is not nil.
func (*CardUpdate) SetNumber ¶
func (cu *CardUpdate) SetNumber(s string) *CardUpdate
SetNumber sets the "number" field.
func (*CardUpdate) SetOwner ¶
func (cu *CardUpdate) SetOwner(u *User) *CardUpdate
SetOwner sets the "owner" edge to the User entity.
func (*CardUpdate) SetOwnerID ¶
func (cu *CardUpdate) SetOwnerID(i int) *CardUpdate
SetOwnerID sets the "owner_id" field.
func (*CardUpdate) Where ¶
func (cu *CardUpdate) Where(ps ...predicate.Card) *CardUpdate
Where appends a list predicates to the CardUpdate builder.
type CardUpdateOne ¶
type CardUpdateOne struct {
// contains filtered or unexported fields
}
CardUpdateOne is the builder for updating a single Card entity.
func (*CardUpdateOne) ClearNumber ¶
func (cuo *CardUpdateOne) ClearNumber() *CardUpdateOne
ClearNumber clears the value of the "number" field.
func (*CardUpdateOne) ClearOwner ¶
func (cuo *CardUpdateOne) ClearOwner() *CardUpdateOne
ClearOwner clears the "owner" edge to the User entity.
func (*CardUpdateOne) ClearOwnerID ¶
func (cuo *CardUpdateOne) ClearOwnerID() *CardUpdateOne
ClearOwnerID clears the value of the "owner_id" field.
func (*CardUpdateOne) Exec ¶
func (cuo *CardUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CardUpdateOne) ExecX ¶
func (cuo *CardUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CardUpdateOne) Mutation ¶
func (cuo *CardUpdateOne) Mutation() *CardMutation
Mutation returns the CardMutation object of the builder.
func (*CardUpdateOne) Save ¶
func (cuo *CardUpdateOne) Save(ctx context.Context) (*Card, error)
Save executes the query and returns the updated Card entity.
func (*CardUpdateOne) SaveX ¶
func (cuo *CardUpdateOne) SaveX(ctx context.Context) *Card
SaveX is like Save, but panics if an error occurs.
func (*CardUpdateOne) Select ¶
func (cuo *CardUpdateOne) Select(field string, fields ...string) *CardUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CardUpdateOne) SetNillableNumber ¶
func (cuo *CardUpdateOne) SetNillableNumber(s *string) *CardUpdateOne
SetNillableNumber sets the "number" field if the given value is not nil.
func (*CardUpdateOne) SetNillableOwnerID ¶
func (cuo *CardUpdateOne) SetNillableOwnerID(i *int) *CardUpdateOne
SetNillableOwnerID sets the "owner_id" field if the given value is not nil.
func (*CardUpdateOne) SetNumber ¶
func (cuo *CardUpdateOne) SetNumber(s string) *CardUpdateOne
SetNumber sets the "number" field.
func (*CardUpdateOne) SetOwner ¶
func (cuo *CardUpdateOne) SetOwner(u *User) *CardUpdateOne
SetOwner sets the "owner" edge to the User entity.
func (*CardUpdateOne) SetOwnerID ¶
func (cuo *CardUpdateOne) SetOwnerID(i int) *CardUpdateOne
SetOwnerID sets the "owner_id" field.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Car is the client for interacting with the Car builders. Car *CarClient // Card is the client for interacting with the Card builders. Card *CardClient // Info is the client for interacting with the Info builders. Info *InfoClient // Metadata is the client for interacting with the Metadata builders. Metadata *MetadataClient // Node is the client for interacting with the Node builders. Node *NodeClient // Pet is the client for interacting with the Pet builders. Pet *PetClient // Post is the client for interacting with the Post builders. Post *PostClient // Rental is the client for interacting with the Rental builders. Rental *RentalClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.
func (*Client) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). Car. Query(). Count(ctx)
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 Info ¶
type Info struct { // ID of the ent. ID int `json:"id,omitempty"` // Content holds the value of the "content" field. Content json.RawMessage `json:"content,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the InfoQuery when eager-loading is set. Edges InfoEdges `json:"edges"` // contains filtered or unexported fields }
Info is the model entity for the Info schema.
func (*Info) Unwrap ¶
Unwrap unwraps the Info 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 (*Info) Update ¶
func (i *Info) Update() *InfoUpdateOne
Update returns a builder for updating this Info. Note that you need to call Info.Unwrap() before calling this method if this Info was returned from a transaction, and the transaction was committed or rolled back.
type InfoClient ¶
type InfoClient struct {
// contains filtered or unexported fields
}
InfoClient is a client for the Info schema.
func NewInfoClient ¶
func NewInfoClient(c config) *InfoClient
NewInfoClient returns a client for the Info from the given config.
func (*InfoClient) Create ¶
func (c *InfoClient) Create() *InfoCreate
Create returns a create builder for Info.
func (*InfoClient) CreateBulk ¶
func (c *InfoClient) CreateBulk(builders ...*InfoCreate) *InfoCreateBulk
CreateBulk returns a builder for creating a bulk of Info entities.
func (*InfoClient) Delete ¶
func (c *InfoClient) Delete() *InfoDelete
Delete returns a delete builder for Info.
func (*InfoClient) DeleteOne ¶
func (c *InfoClient) DeleteOne(i *Info) *InfoDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*InfoClient) DeleteOneID ¶
func (c *InfoClient) DeleteOneID(id int) *InfoDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*InfoClient) GetX ¶
func (c *InfoClient) GetX(ctx context.Context, id int) *Info
GetX is like Get, but panics if an error occurs.
func (*InfoClient) Query ¶
func (c *InfoClient) Query() *InfoQuery
Query returns a query builder for Info.
func (*InfoClient) QueryUser ¶
func (c *InfoClient) QueryUser(i *Info) *UserQuery
QueryUser queries the user edge of a Info.
func (*InfoClient) Update ¶
func (c *InfoClient) Update() *InfoUpdate
Update returns an update builder for Info.
func (*InfoClient) UpdateOne ¶
func (c *InfoClient) UpdateOne(i *Info) *InfoUpdateOne
UpdateOne returns an update builder for the given entity.
func (*InfoClient) UpdateOneID ¶
func (c *InfoClient) UpdateOneID(id int) *InfoUpdateOne
UpdateOneID returns an update builder for the given id.
func (*InfoClient) Use ¶
func (c *InfoClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `info.Hooks(f(g(h())))`.
type InfoCreate ¶
type InfoCreate struct {
// contains filtered or unexported fields
}
InfoCreate is the builder for creating a Info entity.
func (*InfoCreate) Exec ¶
func (ic *InfoCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*InfoCreate) ExecX ¶
func (ic *InfoCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*InfoCreate) Mutation ¶
func (ic *InfoCreate) Mutation() *InfoMutation
Mutation returns the InfoMutation object of the builder.
func (*InfoCreate) Save ¶
func (ic *InfoCreate) Save(ctx context.Context) (*Info, error)
Save creates the Info in the database.
func (*InfoCreate) SaveX ¶
func (ic *InfoCreate) SaveX(ctx context.Context) *Info
SaveX calls Save and panics if Save returns an error.
func (*InfoCreate) SetContent ¶
func (ic *InfoCreate) SetContent(jm json.RawMessage) *InfoCreate
SetContent sets the "content" field.
func (*InfoCreate) SetID ¶
func (ic *InfoCreate) SetID(i int) *InfoCreate
SetID sets the "id" field.
func (*InfoCreate) SetNillableUserID ¶
func (ic *InfoCreate) SetNillableUserID(id *int) *InfoCreate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*InfoCreate) SetUser ¶
func (ic *InfoCreate) SetUser(u *User) *InfoCreate
SetUser sets the "user" edge to the User entity.
func (*InfoCreate) SetUserID ¶
func (ic *InfoCreate) SetUserID(id int) *InfoCreate
SetUserID sets the "user" edge to the User entity by ID.
type InfoCreateBulk ¶
type InfoCreateBulk struct {
// contains filtered or unexported fields
}
InfoCreateBulk is the builder for creating many Info entities in bulk.
func (*InfoCreateBulk) Exec ¶
func (icb *InfoCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*InfoCreateBulk) ExecX ¶
func (icb *InfoCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type InfoDelete ¶
type InfoDelete struct {
// contains filtered or unexported fields
}
InfoDelete is the builder for deleting a Info entity.
func (*InfoDelete) Exec ¶
func (id *InfoDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*InfoDelete) ExecX ¶
func (id *InfoDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*InfoDelete) Where ¶
func (id *InfoDelete) Where(ps ...predicate.Info) *InfoDelete
Where appends a list predicates to the InfoDelete builder.
type InfoDeleteOne ¶
type InfoDeleteOne struct {
// contains filtered or unexported fields
}
InfoDeleteOne is the builder for deleting a single Info entity.
func (*InfoDeleteOne) Exec ¶
func (ido *InfoDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*InfoDeleteOne) ExecX ¶
func (ido *InfoDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type InfoEdges ¶
type InfoEdges struct { // User holds the value of the user edge. User *User `json:"user,omitempty"` // contains filtered or unexported fields }
InfoEdges holds the relations/edges for other nodes in the graph.
type InfoGroupBy ¶
type InfoGroupBy struct {
// contains filtered or unexported fields
}
InfoGroupBy is the group-by builder for Info entities.
func (*InfoGroupBy) Aggregate ¶
func (igb *InfoGroupBy) Aggregate(fns ...AggregateFunc) *InfoGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*InfoGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*InfoGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*InfoGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*InfoGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*InfoGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*InfoGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*InfoGroupBy) Scan ¶
func (igb *InfoGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*InfoGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type InfoMutation ¶
type InfoMutation struct {
// contains filtered or unexported fields
}
InfoMutation represents an operation that mutates the Info nodes in the graph.
func (*InfoMutation) AddField ¶
func (m *InfoMutation) 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 (*InfoMutation) AddedEdges ¶
func (m *InfoMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*InfoMutation) AddedField ¶
func (m *InfoMutation) 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 (*InfoMutation) AddedFields ¶
func (m *InfoMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*InfoMutation) AddedIDs ¶
func (m *InfoMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*InfoMutation) ClearEdge ¶
func (m *InfoMutation) 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 (*InfoMutation) ClearField ¶
func (m *InfoMutation) 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 (*InfoMutation) ClearUser ¶
func (m *InfoMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*InfoMutation) ClearedEdges ¶
func (m *InfoMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*InfoMutation) ClearedFields ¶
func (m *InfoMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (InfoMutation) Client ¶
func (m InfoMutation) 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 (*InfoMutation) Content ¶
func (m *InfoMutation) Content() (r json.RawMessage, exists bool)
Content returns the value of the "content" field in the mutation.
func (*InfoMutation) EdgeCleared ¶
func (m *InfoMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*InfoMutation) Field ¶
func (m *InfoMutation) 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 (*InfoMutation) FieldCleared ¶
func (m *InfoMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*InfoMutation) Fields ¶
func (m *InfoMutation) 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 (*InfoMutation) ID ¶
func (m *InfoMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*InfoMutation) IDs ¶
func (m *InfoMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*InfoMutation) OldContent ¶
func (m *InfoMutation) OldContent(ctx context.Context) (v json.RawMessage, err error)
OldContent returns the old "content" field's value of the Info entity. If the Info 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 (*InfoMutation) 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 (*InfoMutation) RemovedEdges ¶
func (m *InfoMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*InfoMutation) RemovedIDs ¶
func (m *InfoMutation) 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 (*InfoMutation) ResetContent ¶
func (m *InfoMutation) ResetContent()
ResetContent resets all changes to the "content" field.
func (*InfoMutation) ResetEdge ¶
func (m *InfoMutation) 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 (*InfoMutation) ResetField ¶
func (m *InfoMutation) 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 (*InfoMutation) ResetUser ¶
func (m *InfoMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*InfoMutation) SetContent ¶
func (m *InfoMutation) SetContent(jm json.RawMessage)
SetContent sets the "content" field.
func (*InfoMutation) SetField ¶
func (m *InfoMutation) 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 (*InfoMutation) SetID ¶
func (m *InfoMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Info entities.
func (*InfoMutation) SetUserID ¶
func (m *InfoMutation) SetUserID(id int)
SetUserID sets the "user" edge to the User entity by id.
func (InfoMutation) Tx ¶
func (m InfoMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*InfoMutation) Type ¶
func (m *InfoMutation) Type() string
Type returns the node type of this mutation (Info).
func (*InfoMutation) UserCleared ¶
func (m *InfoMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*InfoMutation) UserID ¶
func (m *InfoMutation) UserID() (id int, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*InfoMutation) UserIDs ¶
func (m *InfoMutation) UserIDs() (ids []int)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*InfoMutation) Where ¶
func (m *InfoMutation) Where(ps ...predicate.Info)
Where appends a list predicates to the InfoMutation builder.
type InfoQuery ¶
type InfoQuery struct {
// contains filtered or unexported fields
}
InfoQuery is the builder for querying Info entities.
func (*InfoQuery) Clone ¶
Clone returns a duplicate of the InfoQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*InfoQuery) First ¶
First returns the first Info entity from the query. Returns a *NotFoundError when no Info was found.
func (*InfoQuery) FirstID ¶
FirstID returns the first Info ID from the query. Returns a *NotFoundError when no Info ID was found.
func (*InfoQuery) GroupBy ¶
func (iq *InfoQuery) GroupBy(field string, fields ...string) *InfoGroupBy
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 { Content json.RawMessage `json:"content,omitempty"` Count int `json:"count,omitempty"` } client.Info.Query(). GroupBy(info.FieldContent). Aggregate(ent.Count()). Scan(ctx, &v)
func (*InfoQuery) Only ¶
Only returns a single Info entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Info entity is found. Returns a *NotFoundError when no Info entities are found.
func (*InfoQuery) OnlyID ¶
OnlyID is like Only, but returns the only Info ID in the query. Returns a *NotSingularError when more than one Info ID is found. Returns a *NotFoundError when no entities are found.
func (*InfoQuery) Select ¶
func (iq *InfoQuery) Select(fields ...string) *InfoSelect
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 { Content json.RawMessage `json:"content,omitempty"` } client.Info.Query(). Select(info.FieldContent). Scan(ctx, &v)
func (*InfoQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
type InfoSelect ¶
type InfoSelect struct { *InfoQuery // contains filtered or unexported fields }
InfoSelect is the builder for selecting fields of Info entities.
func (*InfoSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*InfoSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*InfoSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*InfoSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*InfoSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*InfoSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*InfoSelect) Scan ¶
func (is *InfoSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*InfoSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type InfoUpdate ¶
type InfoUpdate struct {
// contains filtered or unexported fields
}
InfoUpdate is the builder for updating Info entities.
func (*InfoUpdate) ClearUser ¶
func (iu *InfoUpdate) ClearUser() *InfoUpdate
ClearUser clears the "user" edge to the User entity.
func (*InfoUpdate) Exec ¶
func (iu *InfoUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*InfoUpdate) ExecX ¶
func (iu *InfoUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*InfoUpdate) Mutation ¶
func (iu *InfoUpdate) Mutation() *InfoMutation
Mutation returns the InfoMutation object of the builder.
func (*InfoUpdate) Save ¶
func (iu *InfoUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*InfoUpdate) SaveX ¶
func (iu *InfoUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*InfoUpdate) SetContent ¶
func (iu *InfoUpdate) SetContent(jm json.RawMessage) *InfoUpdate
SetContent sets the "content" field.
func (*InfoUpdate) SetNillableUserID ¶
func (iu *InfoUpdate) SetNillableUserID(id *int) *InfoUpdate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*InfoUpdate) SetUser ¶
func (iu *InfoUpdate) SetUser(u *User) *InfoUpdate
SetUser sets the "user" edge to the User entity.
func (*InfoUpdate) SetUserID ¶
func (iu *InfoUpdate) SetUserID(id int) *InfoUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*InfoUpdate) Where ¶
func (iu *InfoUpdate) Where(ps ...predicate.Info) *InfoUpdate
Where appends a list predicates to the InfoUpdate builder.
type InfoUpdateOne ¶
type InfoUpdateOne struct {
// contains filtered or unexported fields
}
InfoUpdateOne is the builder for updating a single Info entity.
func (*InfoUpdateOne) ClearUser ¶
func (iuo *InfoUpdateOne) ClearUser() *InfoUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*InfoUpdateOne) Exec ¶
func (iuo *InfoUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*InfoUpdateOne) ExecX ¶
func (iuo *InfoUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*InfoUpdateOne) Mutation ¶
func (iuo *InfoUpdateOne) Mutation() *InfoMutation
Mutation returns the InfoMutation object of the builder.
func (*InfoUpdateOne) Save ¶
func (iuo *InfoUpdateOne) Save(ctx context.Context) (*Info, error)
Save executes the query and returns the updated Info entity.
func (*InfoUpdateOne) SaveX ¶
func (iuo *InfoUpdateOne) SaveX(ctx context.Context) *Info
SaveX is like Save, but panics if an error occurs.
func (*InfoUpdateOne) Select ¶
func (iuo *InfoUpdateOne) Select(field string, fields ...string) *InfoUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*InfoUpdateOne) SetContent ¶
func (iuo *InfoUpdateOne) SetContent(jm json.RawMessage) *InfoUpdateOne
SetContent sets the "content" field.
func (*InfoUpdateOne) SetNillableUserID ¶
func (iuo *InfoUpdateOne) SetNillableUserID(id *int) *InfoUpdateOne
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*InfoUpdateOne) SetUser ¶
func (iuo *InfoUpdateOne) SetUser(u *User) *InfoUpdateOne
SetUser sets the "user" edge to the User entity.
func (*InfoUpdateOne) SetUserID ¶
func (iuo *InfoUpdateOne) SetUserID(id int) *InfoUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
type Metadata ¶
type Metadata struct { // ID of the ent. ID int `json:"id,omitempty"` // Age holds the value of the "age" field. Age int `json:"age,omitempty"` // ParentID holds the value of the "parent_id" field. ParentID int `json:"parent_id,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the MetadataQuery when eager-loading is set. Edges MetadataEdges `json:"edges"` // contains filtered or unexported fields }
Metadata is the model entity for the Metadata schema.
func (*Metadata) QueryChildren ¶
func (m *Metadata) QueryChildren() *MetadataQuery
QueryChildren queries the "children" edge of the Metadata entity.
func (*Metadata) QueryParent ¶
func (m *Metadata) QueryParent() *MetadataQuery
QueryParent queries the "parent" edge of the Metadata entity.
func (*Metadata) Unwrap ¶
Unwrap unwraps the Metadata 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 (*Metadata) Update ¶
func (m *Metadata) Update() *MetadataUpdateOne
Update returns a builder for updating this Metadata. Note that you need to call Metadata.Unwrap() before calling this method if this Metadata was returned from a transaction, and the transaction was committed or rolled back.
type MetadataClient ¶
type MetadataClient struct {
// contains filtered or unexported fields
}
MetadataClient is a client for the Metadata schema.
func NewMetadataClient ¶
func NewMetadataClient(c config) *MetadataClient
NewMetadataClient returns a client for the Metadata from the given config.
func (*MetadataClient) Create ¶
func (c *MetadataClient) Create() *MetadataCreate
Create returns a create builder for Metadata.
func (*MetadataClient) CreateBulk ¶
func (c *MetadataClient) CreateBulk(builders ...*MetadataCreate) *MetadataCreateBulk
CreateBulk returns a builder for creating a bulk of Metadata entities.
func (*MetadataClient) Delete ¶
func (c *MetadataClient) Delete() *MetadataDelete
Delete returns a delete builder for Metadata.
func (*MetadataClient) DeleteOne ¶
func (c *MetadataClient) DeleteOne(m *Metadata) *MetadataDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*MetadataClient) DeleteOneID ¶
func (c *MetadataClient) DeleteOneID(id int) *MetadataDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*MetadataClient) GetX ¶
func (c *MetadataClient) GetX(ctx context.Context, id int) *Metadata
GetX is like Get, but panics if an error occurs.
func (*MetadataClient) Hooks ¶
func (c *MetadataClient) Hooks() []Hook
Hooks returns the client hooks.
func (*MetadataClient) Query ¶
func (c *MetadataClient) Query() *MetadataQuery
Query returns a query builder for Metadata.
func (*MetadataClient) QueryChildren ¶
func (c *MetadataClient) QueryChildren(m *Metadata) *MetadataQuery
QueryChildren queries the children edge of a Metadata.
func (*MetadataClient) QueryParent ¶
func (c *MetadataClient) QueryParent(m *Metadata) *MetadataQuery
QueryParent queries the parent edge of a Metadata.
func (*MetadataClient) QueryUser ¶
func (c *MetadataClient) QueryUser(m *Metadata) *UserQuery
QueryUser queries the user edge of a Metadata.
func (*MetadataClient) Update ¶
func (c *MetadataClient) Update() *MetadataUpdate
Update returns an update builder for Metadata.
func (*MetadataClient) UpdateOne ¶
func (c *MetadataClient) UpdateOne(m *Metadata) *MetadataUpdateOne
UpdateOne returns an update builder for the given entity.
func (*MetadataClient) UpdateOneID ¶
func (c *MetadataClient) UpdateOneID(id int) *MetadataUpdateOne
UpdateOneID returns an update builder for the given id.
func (*MetadataClient) Use ¶
func (c *MetadataClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `metadata.Hooks(f(g(h())))`.
type MetadataCreate ¶
type MetadataCreate struct {
// contains filtered or unexported fields
}
MetadataCreate is the builder for creating a Metadata entity.
func (*MetadataCreate) AddChildIDs ¶
func (mc *MetadataCreate) AddChildIDs(ids ...int) *MetadataCreate
AddChildIDs adds the "children" edge to the Metadata entity by IDs.
func (*MetadataCreate) AddChildren ¶
func (mc *MetadataCreate) AddChildren(m ...*Metadata) *MetadataCreate
AddChildren adds the "children" edges to the Metadata entity.
func (*MetadataCreate) Exec ¶
func (mc *MetadataCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*MetadataCreate) ExecX ¶
func (mc *MetadataCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MetadataCreate) Mutation ¶
func (mc *MetadataCreate) Mutation() *MetadataMutation
Mutation returns the MetadataMutation object of the builder.
func (*MetadataCreate) Save ¶
func (mc *MetadataCreate) Save(ctx context.Context) (*Metadata, error)
Save creates the Metadata in the database.
func (*MetadataCreate) SaveX ¶
func (mc *MetadataCreate) SaveX(ctx context.Context) *Metadata
SaveX calls Save and panics if Save returns an error.
func (*MetadataCreate) SetAge ¶
func (mc *MetadataCreate) SetAge(i int) *MetadataCreate
SetAge sets the "age" field.
func (*MetadataCreate) SetID ¶
func (mc *MetadataCreate) SetID(i int) *MetadataCreate
SetID sets the "id" field.
func (*MetadataCreate) SetNillableAge ¶
func (mc *MetadataCreate) SetNillableAge(i *int) *MetadataCreate
SetNillableAge sets the "age" field if the given value is not nil.
func (*MetadataCreate) SetNillableParentID ¶
func (mc *MetadataCreate) SetNillableParentID(i *int) *MetadataCreate
SetNillableParentID sets the "parent_id" field if the given value is not nil.
func (*MetadataCreate) SetNillableUserID ¶
func (mc *MetadataCreate) SetNillableUserID(id *int) *MetadataCreate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*MetadataCreate) SetParent ¶
func (mc *MetadataCreate) SetParent(m *Metadata) *MetadataCreate
SetParent sets the "parent" edge to the Metadata entity.
func (*MetadataCreate) SetParentID ¶
func (mc *MetadataCreate) SetParentID(i int) *MetadataCreate
SetParentID sets the "parent_id" field.
func (*MetadataCreate) SetUser ¶
func (mc *MetadataCreate) SetUser(u *User) *MetadataCreate
SetUser sets the "user" edge to the User entity.
func (*MetadataCreate) SetUserID ¶
func (mc *MetadataCreate) SetUserID(id int) *MetadataCreate
SetUserID sets the "user" edge to the User entity by ID.
type MetadataCreateBulk ¶
type MetadataCreateBulk struct {
// contains filtered or unexported fields
}
MetadataCreateBulk is the builder for creating many Metadata entities in bulk.
func (*MetadataCreateBulk) Exec ¶
func (mcb *MetadataCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*MetadataCreateBulk) ExecX ¶
func (mcb *MetadataCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type MetadataDelete ¶
type MetadataDelete struct {
// contains filtered or unexported fields
}
MetadataDelete is the builder for deleting a Metadata entity.
func (*MetadataDelete) Exec ¶
func (md *MetadataDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*MetadataDelete) ExecX ¶
func (md *MetadataDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*MetadataDelete) Where ¶
func (md *MetadataDelete) Where(ps ...predicate.Metadata) *MetadataDelete
Where appends a list predicates to the MetadataDelete builder.
type MetadataDeleteOne ¶
type MetadataDeleteOne struct {
// contains filtered or unexported fields
}
MetadataDeleteOne is the builder for deleting a single Metadata entity.
func (*MetadataDeleteOne) Exec ¶
func (mdo *MetadataDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*MetadataDeleteOne) ExecX ¶
func (mdo *MetadataDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type MetadataEdges ¶
type MetadataEdges struct { // User holds the value of the user edge. User *User `json:"user,omitempty"` // Children holds the value of the children edge. Children []*Metadata `json:"children,omitempty"` // Parent holds the value of the parent edge. Parent *Metadata `json:"parent,omitempty"` // contains filtered or unexported fields }
MetadataEdges holds the relations/edges for other nodes in the graph.
func (MetadataEdges) ChildrenOrErr ¶
func (e MetadataEdges) ChildrenOrErr() ([]*Metadata, error)
ChildrenOrErr returns the Children value or an error if the edge was not loaded in eager-loading.
func (MetadataEdges) ParentOrErr ¶
func (e MetadataEdges) ParentOrErr() (*Metadata, error)
ParentOrErr returns the Parent value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (MetadataEdges) UserOrErr ¶
func (e MetadataEdges) UserOrErr() (*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type MetadataGroupBy ¶
type MetadataGroupBy struct {
// contains filtered or unexported fields
}
MetadataGroupBy is the group-by builder for Metadata entities.
func (*MetadataGroupBy) Aggregate ¶
func (mgb *MetadataGroupBy) Aggregate(fns ...AggregateFunc) *MetadataGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*MetadataGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*MetadataGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*MetadataGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*MetadataGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*MetadataGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*MetadataGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*MetadataGroupBy) Scan ¶
func (mgb *MetadataGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*MetadataGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type MetadataMutation ¶
type MetadataMutation struct {
// contains filtered or unexported fields
}
MetadataMutation represents an operation that mutates the Metadata nodes in the graph.
func (*MetadataMutation) AddAge ¶
func (m *MetadataMutation) AddAge(i int)
AddAge adds i to the "age" field.
func (*MetadataMutation) AddChildIDs ¶
func (m *MetadataMutation) AddChildIDs(ids ...int)
AddChildIDs adds the "children" edge to the Metadata entity by ids.
func (*MetadataMutation) AddField ¶
func (m *MetadataMutation) 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 (*MetadataMutation) AddedAge ¶
func (m *MetadataMutation) AddedAge() (r int, exists bool)
AddedAge returns the value that was added to the "age" field in this mutation.
func (*MetadataMutation) AddedEdges ¶
func (m *MetadataMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*MetadataMutation) AddedField ¶
func (m *MetadataMutation) 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 (*MetadataMutation) AddedFields ¶
func (m *MetadataMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*MetadataMutation) AddedIDs ¶
func (m *MetadataMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*MetadataMutation) Age ¶
func (m *MetadataMutation) Age() (r int, exists bool)
Age returns the value of the "age" field in the mutation.
func (*MetadataMutation) ChildrenCleared ¶
func (m *MetadataMutation) ChildrenCleared() bool
ChildrenCleared reports if the "children" edge to the Metadata entity was cleared.
func (*MetadataMutation) ChildrenIDs ¶
func (m *MetadataMutation) ChildrenIDs() (ids []int)
ChildrenIDs returns the "children" edge IDs in the mutation.
func (*MetadataMutation) ClearChildren ¶
func (m *MetadataMutation) ClearChildren()
ClearChildren clears the "children" edge to the Metadata entity.
func (*MetadataMutation) ClearEdge ¶
func (m *MetadataMutation) 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 (*MetadataMutation) ClearField ¶
func (m *MetadataMutation) 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 (*MetadataMutation) ClearParent ¶
func (m *MetadataMutation) ClearParent()
ClearParent clears the "parent" edge to the Metadata entity.
func (*MetadataMutation) ClearParentID ¶
func (m *MetadataMutation) ClearParentID()
ClearParentID clears the value of the "parent_id" field.
func (*MetadataMutation) ClearUser ¶
func (m *MetadataMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*MetadataMutation) ClearedEdges ¶
func (m *MetadataMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*MetadataMutation) ClearedFields ¶
func (m *MetadataMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (MetadataMutation) Client ¶
func (m MetadataMutation) 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 (*MetadataMutation) EdgeCleared ¶
func (m *MetadataMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*MetadataMutation) Field ¶
func (m *MetadataMutation) 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 (*MetadataMutation) FieldCleared ¶
func (m *MetadataMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*MetadataMutation) Fields ¶
func (m *MetadataMutation) 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 (*MetadataMutation) ID ¶
func (m *MetadataMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*MetadataMutation) IDs ¶
func (m *MetadataMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*MetadataMutation) OldAge ¶
func (m *MetadataMutation) OldAge(ctx context.Context) (v int, err error)
OldAge returns the old "age" field's value of the Metadata entity. If the Metadata 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 (*MetadataMutation) 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 (*MetadataMutation) OldParentID ¶
func (m *MetadataMutation) OldParentID(ctx context.Context) (v int, err error)
OldParentID returns the old "parent_id" field's value of the Metadata entity. If the Metadata 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 (*MetadataMutation) ParentCleared ¶
func (m *MetadataMutation) ParentCleared() bool
ParentCleared reports if the "parent" edge to the Metadata entity was cleared.
func (*MetadataMutation) ParentID ¶
func (m *MetadataMutation) ParentID() (r int, exists bool)
ParentID returns the value of the "parent_id" field in the mutation.
func (*MetadataMutation) ParentIDCleared ¶
func (m *MetadataMutation) ParentIDCleared() bool
ParentIDCleared returns if the "parent_id" field was cleared in this mutation.
func (*MetadataMutation) ParentIDs ¶
func (m *MetadataMutation) ParentIDs() (ids []int)
ParentIDs returns the "parent" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ParentID instead. It exists only for internal usage by the builders.
func (*MetadataMutation) RemoveChildIDs ¶
func (m *MetadataMutation) RemoveChildIDs(ids ...int)
RemoveChildIDs removes the "children" edge to the Metadata entity by IDs.
func (*MetadataMutation) RemovedChildrenIDs ¶
func (m *MetadataMutation) RemovedChildrenIDs() (ids []int)
RemovedChildren returns the removed IDs of the "children" edge to the Metadata entity.
func (*MetadataMutation) RemovedEdges ¶
func (m *MetadataMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*MetadataMutation) RemovedIDs ¶
func (m *MetadataMutation) 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 (*MetadataMutation) ResetAge ¶
func (m *MetadataMutation) ResetAge()
ResetAge resets all changes to the "age" field.
func (*MetadataMutation) ResetChildren ¶
func (m *MetadataMutation) ResetChildren()
ResetChildren resets all changes to the "children" edge.
func (*MetadataMutation) ResetEdge ¶
func (m *MetadataMutation) 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 (*MetadataMutation) ResetField ¶
func (m *MetadataMutation) 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 (*MetadataMutation) ResetParent ¶
func (m *MetadataMutation) ResetParent()
ResetParent resets all changes to the "parent" edge.
func (*MetadataMutation) ResetParentID ¶
func (m *MetadataMutation) ResetParentID()
ResetParentID resets all changes to the "parent_id" field.
func (*MetadataMutation) ResetUser ¶
func (m *MetadataMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*MetadataMutation) SetAge ¶
func (m *MetadataMutation) SetAge(i int)
SetAge sets the "age" field.
func (*MetadataMutation) SetField ¶
func (m *MetadataMutation) 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 (*MetadataMutation) SetID ¶
func (m *MetadataMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Metadata entities.
func (*MetadataMutation) SetParentID ¶
func (m *MetadataMutation) SetParentID(i int)
SetParentID sets the "parent_id" field.
func (*MetadataMutation) SetUserID ¶
func (m *MetadataMutation) SetUserID(id int)
SetUserID sets the "user" edge to the User entity by id.
func (MetadataMutation) Tx ¶
func (m MetadataMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*MetadataMutation) Type ¶
func (m *MetadataMutation) Type() string
Type returns the node type of this mutation (Metadata).
func (*MetadataMutation) UserCleared ¶
func (m *MetadataMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*MetadataMutation) UserID ¶
func (m *MetadataMutation) UserID() (id int, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*MetadataMutation) UserIDs ¶
func (m *MetadataMutation) UserIDs() (ids []int)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*MetadataMutation) Where ¶
func (m *MetadataMutation) Where(ps ...predicate.Metadata)
Where appends a list predicates to the MetadataMutation builder.
type MetadataQuery ¶
type MetadataQuery struct {
// contains filtered or unexported fields
}
MetadataQuery is the builder for querying Metadata entities.
func (*MetadataQuery) All ¶
func (mq *MetadataQuery) All(ctx context.Context) ([]*Metadata, error)
All executes the query and returns a list of MetadataSlice.
func (*MetadataQuery) AllX ¶
func (mq *MetadataQuery) AllX(ctx context.Context) []*Metadata
AllX is like All, but panics if an error occurs.
func (*MetadataQuery) Clone ¶
func (mq *MetadataQuery) Clone() *MetadataQuery
Clone returns a duplicate of the MetadataQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*MetadataQuery) Count ¶
func (mq *MetadataQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*MetadataQuery) CountX ¶
func (mq *MetadataQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*MetadataQuery) Exist ¶
func (mq *MetadataQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*MetadataQuery) ExistX ¶
func (mq *MetadataQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*MetadataQuery) First ¶
func (mq *MetadataQuery) First(ctx context.Context) (*Metadata, error)
First returns the first Metadata entity from the query. Returns a *NotFoundError when no Metadata was found.
func (*MetadataQuery) FirstID ¶
func (mq *MetadataQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Metadata ID from the query. Returns a *NotFoundError when no Metadata ID was found.
func (*MetadataQuery) FirstIDX ¶
func (mq *MetadataQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*MetadataQuery) FirstX ¶
func (mq *MetadataQuery) FirstX(ctx context.Context) *Metadata
FirstX is like First, but panics if an error occurs.
func (*MetadataQuery) GroupBy ¶
func (mq *MetadataQuery) GroupBy(field string, fields ...string) *MetadataGroupBy
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 { Age int `json:"age,omitempty"` Count int `json:"count,omitempty"` } client.Metadata.Query(). GroupBy(metadata.FieldAge). Aggregate(ent.Count()). Scan(ctx, &v)
func (*MetadataQuery) IDs ¶
func (mq *MetadataQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of Metadata IDs.
func (*MetadataQuery) IDsX ¶
func (mq *MetadataQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*MetadataQuery) Limit ¶
func (mq *MetadataQuery) Limit(limit int) *MetadataQuery
Limit adds a limit step to the query.
func (*MetadataQuery) Offset ¶
func (mq *MetadataQuery) Offset(offset int) *MetadataQuery
Offset adds an offset step to the query.
func (*MetadataQuery) Only ¶
func (mq *MetadataQuery) Only(ctx context.Context) (*Metadata, error)
Only returns a single Metadata entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Metadata entity is found. Returns a *NotFoundError when no Metadata entities are found.
func (*MetadataQuery) OnlyID ¶
func (mq *MetadataQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Metadata ID in the query. Returns a *NotSingularError when more than one Metadata ID is found. Returns a *NotFoundError when no entities are found.
func (*MetadataQuery) OnlyIDX ¶
func (mq *MetadataQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*MetadataQuery) OnlyX ¶
func (mq *MetadataQuery) OnlyX(ctx context.Context) *Metadata
OnlyX is like Only, but panics if an error occurs.
func (*MetadataQuery) Order ¶
func (mq *MetadataQuery) Order(o ...OrderFunc) *MetadataQuery
Order adds an order step to the query.
func (*MetadataQuery) QueryChildren ¶
func (mq *MetadataQuery) QueryChildren() *MetadataQuery
QueryChildren chains the current query on the "children" edge.
func (*MetadataQuery) QueryParent ¶
func (mq *MetadataQuery) QueryParent() *MetadataQuery
QueryParent chains the current query on the "parent" edge.
func (*MetadataQuery) QueryUser ¶
func (mq *MetadataQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*MetadataQuery) Select ¶
func (mq *MetadataQuery) Select(fields ...string) *MetadataSelect
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 { Age int `json:"age,omitempty"` } client.Metadata.Query(). Select(metadata.FieldAge). Scan(ctx, &v)
func (*MetadataQuery) Unique ¶
func (mq *MetadataQuery) Unique(unique bool) *MetadataQuery
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 (*MetadataQuery) Where ¶
func (mq *MetadataQuery) Where(ps ...predicate.Metadata) *MetadataQuery
Where adds a new predicate for the MetadataQuery builder.
func (*MetadataQuery) WithChildren ¶
func (mq *MetadataQuery) WithChildren(opts ...func(*MetadataQuery)) *MetadataQuery
WithChildren tells the query-builder to eager-load the nodes that are connected to the "children" edge. The optional arguments are used to configure the query builder of the edge.
func (*MetadataQuery) WithParent ¶
func (mq *MetadataQuery) WithParent(opts ...func(*MetadataQuery)) *MetadataQuery
WithParent tells the query-builder to eager-load the nodes that are connected to the "parent" edge. The optional arguments are used to configure the query builder of the edge.
func (*MetadataQuery) WithUser ¶
func (mq *MetadataQuery) WithUser(opts ...func(*UserQuery)) *MetadataQuery
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 MetadataSelect ¶
type MetadataSelect struct { *MetadataQuery // contains filtered or unexported fields }
MetadataSelect is the builder for selecting fields of Metadata entities.
func (*MetadataSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*MetadataSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*MetadataSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*MetadataSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*MetadataSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*MetadataSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*MetadataSelect) Scan ¶
func (ms *MetadataSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*MetadataSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type MetadataUpdate ¶
type MetadataUpdate struct {
// contains filtered or unexported fields
}
MetadataUpdate is the builder for updating Metadata entities.
func (*MetadataUpdate) AddAge ¶
func (mu *MetadataUpdate) AddAge(i int) *MetadataUpdate
AddAge adds i to the "age" field.
func (*MetadataUpdate) AddChildIDs ¶
func (mu *MetadataUpdate) AddChildIDs(ids ...int) *MetadataUpdate
AddChildIDs adds the "children" edge to the Metadata entity by IDs.
func (*MetadataUpdate) AddChildren ¶
func (mu *MetadataUpdate) AddChildren(m ...*Metadata) *MetadataUpdate
AddChildren adds the "children" edges to the Metadata entity.
func (*MetadataUpdate) ClearChildren ¶
func (mu *MetadataUpdate) ClearChildren() *MetadataUpdate
ClearChildren clears all "children" edges to the Metadata entity.
func (*MetadataUpdate) ClearParent ¶
func (mu *MetadataUpdate) ClearParent() *MetadataUpdate
ClearParent clears the "parent" edge to the Metadata entity.
func (*MetadataUpdate) ClearParentID ¶
func (mu *MetadataUpdate) ClearParentID() *MetadataUpdate
ClearParentID clears the value of the "parent_id" field.
func (*MetadataUpdate) ClearUser ¶
func (mu *MetadataUpdate) ClearUser() *MetadataUpdate
ClearUser clears the "user" edge to the User entity.
func (*MetadataUpdate) Exec ¶
func (mu *MetadataUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*MetadataUpdate) ExecX ¶
func (mu *MetadataUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MetadataUpdate) Mutation ¶
func (mu *MetadataUpdate) Mutation() *MetadataMutation
Mutation returns the MetadataMutation object of the builder.
func (*MetadataUpdate) RemoveChildIDs ¶
func (mu *MetadataUpdate) RemoveChildIDs(ids ...int) *MetadataUpdate
RemoveChildIDs removes the "children" edge to Metadata entities by IDs.
func (*MetadataUpdate) RemoveChildren ¶
func (mu *MetadataUpdate) RemoveChildren(m ...*Metadata) *MetadataUpdate
RemoveChildren removes "children" edges to Metadata entities.
func (*MetadataUpdate) Save ¶
func (mu *MetadataUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*MetadataUpdate) SaveX ¶
func (mu *MetadataUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*MetadataUpdate) SetAge ¶
func (mu *MetadataUpdate) SetAge(i int) *MetadataUpdate
SetAge sets the "age" field.
func (*MetadataUpdate) SetNillableAge ¶
func (mu *MetadataUpdate) SetNillableAge(i *int) *MetadataUpdate
SetNillableAge sets the "age" field if the given value is not nil.
func (*MetadataUpdate) SetNillableParentID ¶
func (mu *MetadataUpdate) SetNillableParentID(i *int) *MetadataUpdate
SetNillableParentID sets the "parent_id" field if the given value is not nil.
func (*MetadataUpdate) SetNillableUserID ¶
func (mu *MetadataUpdate) SetNillableUserID(id *int) *MetadataUpdate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*MetadataUpdate) SetParent ¶
func (mu *MetadataUpdate) SetParent(m *Metadata) *MetadataUpdate
SetParent sets the "parent" edge to the Metadata entity.
func (*MetadataUpdate) SetParentID ¶
func (mu *MetadataUpdate) SetParentID(i int) *MetadataUpdate
SetParentID sets the "parent_id" field.
func (*MetadataUpdate) SetUser ¶
func (mu *MetadataUpdate) SetUser(u *User) *MetadataUpdate
SetUser sets the "user" edge to the User entity.
func (*MetadataUpdate) SetUserID ¶
func (mu *MetadataUpdate) SetUserID(id int) *MetadataUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*MetadataUpdate) Where ¶
func (mu *MetadataUpdate) Where(ps ...predicate.Metadata) *MetadataUpdate
Where appends a list predicates to the MetadataUpdate builder.
type MetadataUpdateOne ¶
type MetadataUpdateOne struct {
// contains filtered or unexported fields
}
MetadataUpdateOne is the builder for updating a single Metadata entity.
func (*MetadataUpdateOne) AddAge ¶
func (muo *MetadataUpdateOne) AddAge(i int) *MetadataUpdateOne
AddAge adds i to the "age" field.
func (*MetadataUpdateOne) AddChildIDs ¶
func (muo *MetadataUpdateOne) AddChildIDs(ids ...int) *MetadataUpdateOne
AddChildIDs adds the "children" edge to the Metadata entity by IDs.
func (*MetadataUpdateOne) AddChildren ¶
func (muo *MetadataUpdateOne) AddChildren(m ...*Metadata) *MetadataUpdateOne
AddChildren adds the "children" edges to the Metadata entity.
func (*MetadataUpdateOne) ClearChildren ¶
func (muo *MetadataUpdateOne) ClearChildren() *MetadataUpdateOne
ClearChildren clears all "children" edges to the Metadata entity.
func (*MetadataUpdateOne) ClearParent ¶
func (muo *MetadataUpdateOne) ClearParent() *MetadataUpdateOne
ClearParent clears the "parent" edge to the Metadata entity.
func (*MetadataUpdateOne) ClearParentID ¶
func (muo *MetadataUpdateOne) ClearParentID() *MetadataUpdateOne
ClearParentID clears the value of the "parent_id" field.
func (*MetadataUpdateOne) ClearUser ¶
func (muo *MetadataUpdateOne) ClearUser() *MetadataUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*MetadataUpdateOne) Exec ¶
func (muo *MetadataUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*MetadataUpdateOne) ExecX ¶
func (muo *MetadataUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MetadataUpdateOne) Mutation ¶
func (muo *MetadataUpdateOne) Mutation() *MetadataMutation
Mutation returns the MetadataMutation object of the builder.
func (*MetadataUpdateOne) RemoveChildIDs ¶
func (muo *MetadataUpdateOne) RemoveChildIDs(ids ...int) *MetadataUpdateOne
RemoveChildIDs removes the "children" edge to Metadata entities by IDs.
func (*MetadataUpdateOne) RemoveChildren ¶
func (muo *MetadataUpdateOne) RemoveChildren(m ...*Metadata) *MetadataUpdateOne
RemoveChildren removes "children" edges to Metadata entities.
func (*MetadataUpdateOne) Save ¶
func (muo *MetadataUpdateOne) Save(ctx context.Context) (*Metadata, error)
Save executes the query and returns the updated Metadata entity.
func (*MetadataUpdateOne) SaveX ¶
func (muo *MetadataUpdateOne) SaveX(ctx context.Context) *Metadata
SaveX is like Save, but panics if an error occurs.
func (*MetadataUpdateOne) Select ¶
func (muo *MetadataUpdateOne) Select(field string, fields ...string) *MetadataUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*MetadataUpdateOne) SetAge ¶
func (muo *MetadataUpdateOne) SetAge(i int) *MetadataUpdateOne
SetAge sets the "age" field.
func (*MetadataUpdateOne) SetNillableAge ¶
func (muo *MetadataUpdateOne) SetNillableAge(i *int) *MetadataUpdateOne
SetNillableAge sets the "age" field if the given value is not nil.
func (*MetadataUpdateOne) SetNillableParentID ¶
func (muo *MetadataUpdateOne) SetNillableParentID(i *int) *MetadataUpdateOne
SetNillableParentID sets the "parent_id" field if the given value is not nil.
func (*MetadataUpdateOne) SetNillableUserID ¶
func (muo *MetadataUpdateOne) SetNillableUserID(id *int) *MetadataUpdateOne
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*MetadataUpdateOne) SetParent ¶
func (muo *MetadataUpdateOne) SetParent(m *Metadata) *MetadataUpdateOne
SetParent sets the "parent" edge to the Metadata entity.
func (*MetadataUpdateOne) SetParentID ¶
func (muo *MetadataUpdateOne) SetParentID(i int) *MetadataUpdateOne
SetParentID sets the "parent_id" field.
func (*MetadataUpdateOne) SetUser ¶
func (muo *MetadataUpdateOne) SetUser(u *User) *MetadataUpdateOne
SetUser sets the "user" edge to the User entity.
func (*MetadataUpdateOne) SetUserID ¶
func (muo *MetadataUpdateOne) SetUserID(id int) *MetadataUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type Node ¶
type Node struct { // ID of the ent. ID int `json:"id,omitempty"` // Value holds the value of the "value" field. Value int `json:"value,omitempty"` // PrevID holds the value of the "prev_id" field. PrevID int `json:"prev_id,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the NodeQuery when eager-loading is set. Edges NodeEdges `json:"edges"` // contains filtered or unexported fields }
Node is the model entity for the Node schema.
func (*Node) Unwrap ¶
Unwrap unwraps the Node 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 (*Node) Update ¶
func (n *Node) Update() *NodeUpdateOne
Update returns a builder for updating this Node. Note that you need to call Node.Unwrap() before calling this method if this Node was returned from a transaction, and the transaction was committed or rolled back.
type NodeClient ¶
type NodeClient struct {
// contains filtered or unexported fields
}
NodeClient is a client for the Node schema.
func NewNodeClient ¶
func NewNodeClient(c config) *NodeClient
NewNodeClient returns a client for the Node from the given config.
func (*NodeClient) Create ¶
func (c *NodeClient) Create() *NodeCreate
Create returns a create builder for Node.
func (*NodeClient) CreateBulk ¶
func (c *NodeClient) CreateBulk(builders ...*NodeCreate) *NodeCreateBulk
CreateBulk returns a builder for creating a bulk of Node entities.
func (*NodeClient) Delete ¶
func (c *NodeClient) Delete() *NodeDelete
Delete returns a delete builder for Node.
func (*NodeClient) DeleteOne ¶
func (c *NodeClient) DeleteOne(n *Node) *NodeDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*NodeClient) DeleteOneID ¶
func (c *NodeClient) DeleteOneID(id int) *NodeDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*NodeClient) GetX ¶
func (c *NodeClient) GetX(ctx context.Context, id int) *Node
GetX is like Get, but panics if an error occurs.
func (*NodeClient) Query ¶
func (c *NodeClient) Query() *NodeQuery
Query returns a query builder for Node.
func (*NodeClient) QueryNext ¶
func (c *NodeClient) QueryNext(n *Node) *NodeQuery
QueryNext queries the next edge of a Node.
func (*NodeClient) QueryPrev ¶
func (c *NodeClient) QueryPrev(n *Node) *NodeQuery
QueryPrev queries the prev edge of a Node.
func (*NodeClient) Update ¶
func (c *NodeClient) Update() *NodeUpdate
Update returns an update builder for Node.
func (*NodeClient) UpdateOne ¶
func (c *NodeClient) UpdateOne(n *Node) *NodeUpdateOne
UpdateOne returns an update builder for the given entity.
func (*NodeClient) UpdateOneID ¶
func (c *NodeClient) UpdateOneID(id int) *NodeUpdateOne
UpdateOneID returns an update builder for the given id.
func (*NodeClient) Use ¶
func (c *NodeClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `node.Hooks(f(g(h())))`.
type NodeCreate ¶
type NodeCreate struct {
// contains filtered or unexported fields
}
NodeCreate is the builder for creating a Node entity.
func (*NodeCreate) Exec ¶
func (nc *NodeCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*NodeCreate) ExecX ¶
func (nc *NodeCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NodeCreate) Mutation ¶
func (nc *NodeCreate) Mutation() *NodeMutation
Mutation returns the NodeMutation object of the builder.
func (*NodeCreate) Save ¶
func (nc *NodeCreate) Save(ctx context.Context) (*Node, error)
Save creates the Node in the database.
func (*NodeCreate) SaveX ¶
func (nc *NodeCreate) SaveX(ctx context.Context) *Node
SaveX calls Save and panics if Save returns an error.
func (*NodeCreate) SetNext ¶
func (nc *NodeCreate) SetNext(n *Node) *NodeCreate
SetNext sets the "next" edge to the Node entity.
func (*NodeCreate) SetNextID ¶
func (nc *NodeCreate) SetNextID(id int) *NodeCreate
SetNextID sets the "next" edge to the Node entity by ID.
func (*NodeCreate) SetNillableNextID ¶
func (nc *NodeCreate) SetNillableNextID(id *int) *NodeCreate
SetNillableNextID sets the "next" edge to the Node entity by ID if the given value is not nil.
func (*NodeCreate) SetNillablePrevID ¶
func (nc *NodeCreate) SetNillablePrevID(i *int) *NodeCreate
SetNillablePrevID sets the "prev_id" field if the given value is not nil.
func (*NodeCreate) SetNillableValue ¶
func (nc *NodeCreate) SetNillableValue(i *int) *NodeCreate
SetNillableValue sets the "value" field if the given value is not nil.
func (*NodeCreate) SetPrev ¶
func (nc *NodeCreate) SetPrev(n *Node) *NodeCreate
SetPrev sets the "prev" edge to the Node entity.
func (*NodeCreate) SetPrevID ¶
func (nc *NodeCreate) SetPrevID(i int) *NodeCreate
SetPrevID sets the "prev_id" field.
func (*NodeCreate) SetValue ¶
func (nc *NodeCreate) SetValue(i int) *NodeCreate
SetValue sets the "value" field.
type NodeCreateBulk ¶
type NodeCreateBulk struct {
// contains filtered or unexported fields
}
NodeCreateBulk is the builder for creating many Node entities in bulk.
func (*NodeCreateBulk) Exec ¶
func (ncb *NodeCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*NodeCreateBulk) ExecX ¶
func (ncb *NodeCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type NodeDelete ¶
type NodeDelete struct {
// contains filtered or unexported fields
}
NodeDelete is the builder for deleting a Node entity.
func (*NodeDelete) Exec ¶
func (nd *NodeDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*NodeDelete) ExecX ¶
func (nd *NodeDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*NodeDelete) Where ¶
func (nd *NodeDelete) Where(ps ...predicate.Node) *NodeDelete
Where appends a list predicates to the NodeDelete builder.
type NodeDeleteOne ¶
type NodeDeleteOne struct {
// contains filtered or unexported fields
}
NodeDeleteOne is the builder for deleting a single Node entity.
func (*NodeDeleteOne) Exec ¶
func (ndo *NodeDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*NodeDeleteOne) ExecX ¶
func (ndo *NodeDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type NodeEdges ¶
type NodeEdges struct { // Prev holds the value of the prev edge. Prev *Node `json:"prev,omitempty"` // Next holds the value of the next edge. Next *Node `json:"next,omitempty"` // contains filtered or unexported fields }
NodeEdges holds the relations/edges for other nodes in the graph.
type NodeGroupBy ¶
type NodeGroupBy struct {
// contains filtered or unexported fields
}
NodeGroupBy is the group-by builder for Node entities.
func (*NodeGroupBy) Aggregate ¶
func (ngb *NodeGroupBy) Aggregate(fns ...AggregateFunc) *NodeGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*NodeGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*NodeGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*NodeGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*NodeGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*NodeGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*NodeGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*NodeGroupBy) Scan ¶
func (ngb *NodeGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*NodeGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type NodeMutation ¶
type NodeMutation struct {
// contains filtered or unexported fields
}
NodeMutation represents an operation that mutates the Node nodes in the graph.
func (*NodeMutation) AddField ¶
func (m *NodeMutation) 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 (*NodeMutation) AddValue ¶
func (m *NodeMutation) AddValue(i int)
AddValue adds i to the "value" field.
func (*NodeMutation) AddedEdges ¶
func (m *NodeMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*NodeMutation) AddedField ¶
func (m *NodeMutation) 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 (*NodeMutation) AddedFields ¶
func (m *NodeMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*NodeMutation) AddedIDs ¶
func (m *NodeMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*NodeMutation) AddedValue ¶
func (m *NodeMutation) AddedValue() (r int, exists bool)
AddedValue returns the value that was added to the "value" field in this mutation.
func (*NodeMutation) ClearEdge ¶
func (m *NodeMutation) 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 (*NodeMutation) ClearField ¶
func (m *NodeMutation) 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 (*NodeMutation) ClearNext ¶
func (m *NodeMutation) ClearNext()
ClearNext clears the "next" edge to the Node entity.
func (*NodeMutation) ClearPrev ¶
func (m *NodeMutation) ClearPrev()
ClearPrev clears the "prev" edge to the Node entity.
func (*NodeMutation) ClearPrevID ¶
func (m *NodeMutation) ClearPrevID()
ClearPrevID clears the value of the "prev_id" field.
func (*NodeMutation) ClearedEdges ¶
func (m *NodeMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*NodeMutation) ClearedFields ¶
func (m *NodeMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (NodeMutation) Client ¶
func (m NodeMutation) 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 (*NodeMutation) EdgeCleared ¶
func (m *NodeMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*NodeMutation) Field ¶
func (m *NodeMutation) 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 (*NodeMutation) FieldCleared ¶
func (m *NodeMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*NodeMutation) Fields ¶
func (m *NodeMutation) 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 (*NodeMutation) ID ¶
func (m *NodeMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*NodeMutation) IDs ¶
func (m *NodeMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*NodeMutation) NextCleared ¶
func (m *NodeMutation) NextCleared() bool
NextCleared reports if the "next" edge to the Node entity was cleared.
func (*NodeMutation) NextID ¶
func (m *NodeMutation) NextID() (id int, exists bool)
NextID returns the "next" edge ID in the mutation.
func (*NodeMutation) NextIDs ¶
func (m *NodeMutation) NextIDs() (ids []int)
NextIDs returns the "next" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use NextID instead. It exists only for internal usage by the builders.
func (*NodeMutation) 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 (*NodeMutation) OldPrevID ¶
func (m *NodeMutation) OldPrevID(ctx context.Context) (v int, err error)
OldPrevID returns the old "prev_id" field's value of the Node entity. If the Node 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 (*NodeMutation) OldValue ¶
func (m *NodeMutation) OldValue(ctx context.Context) (v int, err error)
OldValue returns the old "value" field's value of the Node entity. If the Node 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 (*NodeMutation) PrevCleared ¶
func (m *NodeMutation) PrevCleared() bool
PrevCleared reports if the "prev" edge to the Node entity was cleared.
func (*NodeMutation) PrevID ¶
func (m *NodeMutation) PrevID() (r int, exists bool)
PrevID returns the value of the "prev_id" field in the mutation.
func (*NodeMutation) PrevIDCleared ¶
func (m *NodeMutation) PrevIDCleared() bool
PrevIDCleared returns if the "prev_id" field was cleared in this mutation.
func (*NodeMutation) PrevIDs ¶
func (m *NodeMutation) PrevIDs() (ids []int)
PrevIDs returns the "prev" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use PrevID instead. It exists only for internal usage by the builders.
func (*NodeMutation) RemovedEdges ¶
func (m *NodeMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*NodeMutation) RemovedIDs ¶
func (m *NodeMutation) 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 (*NodeMutation) ResetEdge ¶
func (m *NodeMutation) 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 (*NodeMutation) ResetField ¶
func (m *NodeMutation) 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 (*NodeMutation) ResetNext ¶
func (m *NodeMutation) ResetNext()
ResetNext resets all changes to the "next" edge.
func (*NodeMutation) ResetPrev ¶
func (m *NodeMutation) ResetPrev()
ResetPrev resets all changes to the "prev" edge.
func (*NodeMutation) ResetPrevID ¶
func (m *NodeMutation) ResetPrevID()
ResetPrevID resets all changes to the "prev_id" field.
func (*NodeMutation) ResetValue ¶
func (m *NodeMutation) ResetValue()
ResetValue resets all changes to the "value" field.
func (*NodeMutation) SetField ¶
func (m *NodeMutation) 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 (*NodeMutation) SetNextID ¶
func (m *NodeMutation) SetNextID(id int)
SetNextID sets the "next" edge to the Node entity by id.
func (*NodeMutation) SetPrevID ¶
func (m *NodeMutation) SetPrevID(i int)
SetPrevID sets the "prev_id" field.
func (*NodeMutation) SetValue ¶
func (m *NodeMutation) SetValue(i int)
SetValue sets the "value" field.
func (NodeMutation) Tx ¶
func (m NodeMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*NodeMutation) Type ¶
func (m *NodeMutation) Type() string
Type returns the node type of this mutation (Node).
func (*NodeMutation) Value ¶
func (m *NodeMutation) Value() (r int, exists bool)
Value returns the value of the "value" field in the mutation.
func (*NodeMutation) Where ¶
func (m *NodeMutation) Where(ps ...predicate.Node)
Where appends a list predicates to the NodeMutation builder.
type NodeQuery ¶
type NodeQuery struct {
// contains filtered or unexported fields
}
NodeQuery is the builder for querying Node entities.
func (*NodeQuery) Clone ¶
Clone returns a duplicate of the NodeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*NodeQuery) First ¶
First returns the first Node entity from the query. Returns a *NotFoundError when no Node was found.
func (*NodeQuery) FirstID ¶
FirstID returns the first Node ID from the query. Returns a *NotFoundError when no Node ID was found.
func (*NodeQuery) GroupBy ¶
func (nq *NodeQuery) GroupBy(field string, fields ...string) *NodeGroupBy
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 { Value int `json:"value,omitempty"` Count int `json:"count,omitempty"` } client.Node.Query(). GroupBy(node.FieldValue). Aggregate(ent.Count()). Scan(ctx, &v)
func (*NodeQuery) Only ¶
Only returns a single Node entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Node entity is found. Returns a *NotFoundError when no Node entities are found.
func (*NodeQuery) OnlyID ¶
OnlyID is like Only, but returns the only Node ID in the query. Returns a *NotSingularError when more than one Node ID is found. Returns a *NotFoundError when no entities are found.
func (*NodeQuery) Select ¶
func (nq *NodeQuery) Select(fields ...string) *NodeSelect
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 { Value int `json:"value,omitempty"` } client.Node.Query(). Select(node.FieldValue). Scan(ctx, &v)
func (*NodeQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
type NodeSelect ¶
type NodeSelect struct { *NodeQuery // contains filtered or unexported fields }
NodeSelect is the builder for selecting fields of Node entities.
func (*NodeSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*NodeSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*NodeSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*NodeSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*NodeSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*NodeSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*NodeSelect) Scan ¶
func (ns *NodeSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*NodeSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type NodeUpdate ¶
type NodeUpdate struct {
// contains filtered or unexported fields
}
NodeUpdate is the builder for updating Node entities.
func (*NodeUpdate) AddValue ¶
func (nu *NodeUpdate) AddValue(i int) *NodeUpdate
AddValue adds i to the "value" field.
func (*NodeUpdate) ClearNext ¶
func (nu *NodeUpdate) ClearNext() *NodeUpdate
ClearNext clears the "next" edge to the Node entity.
func (*NodeUpdate) ClearPrev ¶
func (nu *NodeUpdate) ClearPrev() *NodeUpdate
ClearPrev clears the "prev" edge to the Node entity.
func (*NodeUpdate) ClearPrevID ¶
func (nu *NodeUpdate) ClearPrevID() *NodeUpdate
ClearPrevID clears the value of the "prev_id" field.
func (*NodeUpdate) Exec ¶
func (nu *NodeUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*NodeUpdate) ExecX ¶
func (nu *NodeUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NodeUpdate) Mutation ¶
func (nu *NodeUpdate) Mutation() *NodeMutation
Mutation returns the NodeMutation object of the builder.
func (*NodeUpdate) Save ¶
func (nu *NodeUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*NodeUpdate) SaveX ¶
func (nu *NodeUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*NodeUpdate) SetNext ¶
func (nu *NodeUpdate) SetNext(n *Node) *NodeUpdate
SetNext sets the "next" edge to the Node entity.
func (*NodeUpdate) SetNextID ¶
func (nu *NodeUpdate) SetNextID(id int) *NodeUpdate
SetNextID sets the "next" edge to the Node entity by ID.
func (*NodeUpdate) SetNillableNextID ¶
func (nu *NodeUpdate) SetNillableNextID(id *int) *NodeUpdate
SetNillableNextID sets the "next" edge to the Node entity by ID if the given value is not nil.
func (*NodeUpdate) SetNillablePrevID ¶
func (nu *NodeUpdate) SetNillablePrevID(i *int) *NodeUpdate
SetNillablePrevID sets the "prev_id" field if the given value is not nil.
func (*NodeUpdate) SetNillableValue ¶
func (nu *NodeUpdate) SetNillableValue(i *int) *NodeUpdate
SetNillableValue sets the "value" field if the given value is not nil.
func (*NodeUpdate) SetPrev ¶
func (nu *NodeUpdate) SetPrev(n *Node) *NodeUpdate
SetPrev sets the "prev" edge to the Node entity.
func (*NodeUpdate) SetPrevID ¶
func (nu *NodeUpdate) SetPrevID(i int) *NodeUpdate
SetPrevID sets the "prev_id" field.
func (*NodeUpdate) SetValue ¶
func (nu *NodeUpdate) SetValue(i int) *NodeUpdate
SetValue sets the "value" field.
func (*NodeUpdate) Where ¶
func (nu *NodeUpdate) Where(ps ...predicate.Node) *NodeUpdate
Where appends a list predicates to the NodeUpdate builder.
type NodeUpdateOne ¶
type NodeUpdateOne struct {
// contains filtered or unexported fields
}
NodeUpdateOne is the builder for updating a single Node entity.
func (*NodeUpdateOne) AddValue ¶
func (nuo *NodeUpdateOne) AddValue(i int) *NodeUpdateOne
AddValue adds i to the "value" field.
func (*NodeUpdateOne) ClearNext ¶
func (nuo *NodeUpdateOne) ClearNext() *NodeUpdateOne
ClearNext clears the "next" edge to the Node entity.
func (*NodeUpdateOne) ClearPrev ¶
func (nuo *NodeUpdateOne) ClearPrev() *NodeUpdateOne
ClearPrev clears the "prev" edge to the Node entity.
func (*NodeUpdateOne) ClearPrevID ¶
func (nuo *NodeUpdateOne) ClearPrevID() *NodeUpdateOne
ClearPrevID clears the value of the "prev_id" field.
func (*NodeUpdateOne) Exec ¶
func (nuo *NodeUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*NodeUpdateOne) ExecX ¶
func (nuo *NodeUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*NodeUpdateOne) Mutation ¶
func (nuo *NodeUpdateOne) Mutation() *NodeMutation
Mutation returns the NodeMutation object of the builder.
func (*NodeUpdateOne) Save ¶
func (nuo *NodeUpdateOne) Save(ctx context.Context) (*Node, error)
Save executes the query and returns the updated Node entity.
func (*NodeUpdateOne) SaveX ¶
func (nuo *NodeUpdateOne) SaveX(ctx context.Context) *Node
SaveX is like Save, but panics if an error occurs.
func (*NodeUpdateOne) Select ¶
func (nuo *NodeUpdateOne) Select(field string, fields ...string) *NodeUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*NodeUpdateOne) SetNext ¶
func (nuo *NodeUpdateOne) SetNext(n *Node) *NodeUpdateOne
SetNext sets the "next" edge to the Node entity.
func (*NodeUpdateOne) SetNextID ¶
func (nuo *NodeUpdateOne) SetNextID(id int) *NodeUpdateOne
SetNextID sets the "next" edge to the Node entity by ID.
func (*NodeUpdateOne) SetNillableNextID ¶
func (nuo *NodeUpdateOne) SetNillableNextID(id *int) *NodeUpdateOne
SetNillableNextID sets the "next" edge to the Node entity by ID if the given value is not nil.
func (*NodeUpdateOne) SetNillablePrevID ¶
func (nuo *NodeUpdateOne) SetNillablePrevID(i *int) *NodeUpdateOne
SetNillablePrevID sets the "prev_id" field if the given value is not nil.
func (*NodeUpdateOne) SetNillableValue ¶
func (nuo *NodeUpdateOne) SetNillableValue(i *int) *NodeUpdateOne
SetNillableValue sets the "value" field if the given value is not nil.
func (*NodeUpdateOne) SetPrev ¶
func (nuo *NodeUpdateOne) SetPrev(n *Node) *NodeUpdateOne
SetPrev sets the "prev" edge to the Node entity.
func (*NodeUpdateOne) SetPrevID ¶
func (nuo *NodeUpdateOne) SetPrevID(i int) *NodeUpdateOne
SetPrevID sets the "prev_id" field.
func (*NodeUpdateOne) SetValue ¶
func (nuo *NodeUpdateOne) SetValue(i int) *NodeUpdateOne
SetValue sets the "value" field.
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 Pet ¶
type Pet struct { // ID of the ent. ID int `json:"id,omitempty"` // OwnerID holds the value of the "owner_id" field. OwnerID int `json:"owner_id,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the PetQuery when eager-loading is set. Edges PetEdges `json:"edges"` // contains filtered or unexported fields }
Pet is the model entity for the Pet schema.
func (*Pet) QueryOwner ¶
QueryOwner queries the "owner" edge of the Pet entity.
func (*Pet) Unwrap ¶
Unwrap unwraps the Pet 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 (*Pet) Update ¶
func (pe *Pet) Update() *PetUpdateOne
Update returns a builder for updating this Pet. Note that you need to call Pet.Unwrap() before calling this method if this Pet was returned from a transaction, and the transaction was committed or rolled back.
type PetClient ¶
type PetClient struct {
// contains filtered or unexported fields
}
PetClient is a client for the Pet schema.
func NewPetClient ¶
func NewPetClient(c config) *PetClient
NewPetClient returns a client for the Pet from the given config.
func (*PetClient) CreateBulk ¶
func (c *PetClient) CreateBulk(builders ...*PetCreate) *PetCreateBulk
CreateBulk returns a builder for creating a bulk of Pet entities.
func (*PetClient) DeleteOne ¶
func (c *PetClient) DeleteOne(pe *Pet) *PetDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*PetClient) DeleteOneID ¶
func (c *PetClient) DeleteOneID(id int) *PetDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*PetClient) QueryOwner ¶
QueryOwner queries the owner edge of a Pet.
func (*PetClient) UpdateOne ¶
func (c *PetClient) UpdateOne(pe *Pet) *PetUpdateOne
UpdateOne returns an update builder for the given entity.
func (*PetClient) UpdateOneID ¶
func (c *PetClient) UpdateOneID(id int) *PetUpdateOne
UpdateOneID returns an update builder for the given id.
type PetCreate ¶
type PetCreate struct {
// contains filtered or unexported fields
}
PetCreate is the builder for creating a Pet entity.
func (*PetCreate) Mutation ¶
func (pc *PetCreate) Mutation() *PetMutation
Mutation returns the PetMutation object of the builder.
func (*PetCreate) SetNillableOwnerID ¶
SetNillableOwnerID sets the "owner_id" field if the given value is not nil.
func (*PetCreate) SetOwnerID ¶
SetOwnerID sets the "owner_id" field.
type PetCreateBulk ¶
type PetCreateBulk struct {
// contains filtered or unexported fields
}
PetCreateBulk is the builder for creating many Pet entities in bulk.
func (*PetCreateBulk) Exec ¶
func (pcb *PetCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*PetCreateBulk) ExecX ¶
func (pcb *PetCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type PetDelete ¶
type PetDelete struct {
// contains filtered or unexported fields
}
PetDelete is the builder for deleting a Pet entity.
func (*PetDelete) Exec ¶
Exec executes the deletion query and returns how many vertices were deleted.
type PetDeleteOne ¶
type PetDeleteOne struct {
// contains filtered or unexported fields
}
PetDeleteOne is the builder for deleting a single Pet entity.
func (*PetDeleteOne) Exec ¶
func (pdo *PetDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*PetDeleteOne) ExecX ¶
func (pdo *PetDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type PetEdges ¶
type PetEdges struct { // Owner holds the value of the owner edge. Owner *User `json:"owner,omitempty"` // contains filtered or unexported fields }
PetEdges holds the relations/edges for other nodes in the graph.
func (PetEdges) OwnerOrErr ¶
OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type PetGroupBy ¶
type PetGroupBy struct {
// contains filtered or unexported fields
}
PetGroupBy is the group-by builder for Pet entities.
func (*PetGroupBy) Aggregate ¶
func (pgb *PetGroupBy) Aggregate(fns ...AggregateFunc) *PetGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*PetGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PetGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PetGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PetGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PetGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PetGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PetGroupBy) Scan ¶
func (pgb *PetGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*PetGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PetMutation ¶
type PetMutation struct {
// contains filtered or unexported fields
}
PetMutation represents an operation that mutates the Pet nodes in the graph.
func (*PetMutation) AddField ¶
func (m *PetMutation) 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 (*PetMutation) AddedEdges ¶
func (m *PetMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*PetMutation) AddedField ¶
func (m *PetMutation) 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 (*PetMutation) AddedFields ¶
func (m *PetMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*PetMutation) AddedIDs ¶
func (m *PetMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*PetMutation) ClearEdge ¶
func (m *PetMutation) 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 (*PetMutation) ClearField ¶
func (m *PetMutation) 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 (*PetMutation) ClearOwner ¶
func (m *PetMutation) ClearOwner()
ClearOwner clears the "owner" edge to the User entity.
func (*PetMutation) ClearOwnerID ¶
func (m *PetMutation) ClearOwnerID()
ClearOwnerID clears the value of the "owner_id" field.
func (*PetMutation) ClearedEdges ¶
func (m *PetMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*PetMutation) ClearedFields ¶
func (m *PetMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (PetMutation) Client ¶
func (m PetMutation) 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 (*PetMutation) EdgeCleared ¶
func (m *PetMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*PetMutation) Field ¶
func (m *PetMutation) 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 (*PetMutation) FieldCleared ¶
func (m *PetMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*PetMutation) Fields ¶
func (m *PetMutation) 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 (*PetMutation) ID ¶
func (m *PetMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*PetMutation) IDs ¶
func (m *PetMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*PetMutation) 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 (*PetMutation) OldOwnerID ¶
func (m *PetMutation) OldOwnerID(ctx context.Context) (v int, err error)
OldOwnerID returns the old "owner_id" field's value of the Pet entity. If the Pet 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 (*PetMutation) OwnerCleared ¶
func (m *PetMutation) OwnerCleared() bool
OwnerCleared reports if the "owner" edge to the User entity was cleared.
func (*PetMutation) OwnerID ¶
func (m *PetMutation) OwnerID() (r int, exists bool)
OwnerID returns the value of the "owner_id" field in the mutation.
func (*PetMutation) OwnerIDCleared ¶
func (m *PetMutation) OwnerIDCleared() bool
OwnerIDCleared returns if the "owner_id" field was cleared in this mutation.
func (*PetMutation) OwnerIDs ¶
func (m *PetMutation) OwnerIDs() (ids []int)
OwnerIDs returns the "owner" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OwnerID instead. It exists only for internal usage by the builders.
func (*PetMutation) RemovedEdges ¶
func (m *PetMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*PetMutation) RemovedIDs ¶
func (m *PetMutation) 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 (*PetMutation) ResetEdge ¶
func (m *PetMutation) 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 (*PetMutation) ResetField ¶
func (m *PetMutation) 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 (*PetMutation) ResetOwner ¶
func (m *PetMutation) ResetOwner()
ResetOwner resets all changes to the "owner" edge.
func (*PetMutation) ResetOwnerID ¶
func (m *PetMutation) ResetOwnerID()
ResetOwnerID resets all changes to the "owner_id" field.
func (*PetMutation) SetField ¶
func (m *PetMutation) 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 (*PetMutation) SetOwnerID ¶
func (m *PetMutation) SetOwnerID(i int)
SetOwnerID sets the "owner_id" field.
func (PetMutation) Tx ¶
func (m PetMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*PetMutation) Type ¶
func (m *PetMutation) Type() string
Type returns the node type of this mutation (Pet).
func (*PetMutation) Where ¶
func (m *PetMutation) Where(ps ...predicate.Pet)
Where appends a list predicates to the PetMutation builder.
type PetQuery ¶
type PetQuery struct {
// contains filtered or unexported fields
}
PetQuery is the builder for querying Pet entities.
func (*PetQuery) Clone ¶
Clone returns a duplicate of the PetQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*PetQuery) First ¶
First returns the first Pet entity from the query. Returns a *NotFoundError when no Pet was found.
func (*PetQuery) FirstID ¶
FirstID returns the first Pet ID from the query. Returns a *NotFoundError when no Pet ID was found.
func (*PetQuery) GroupBy ¶
func (pq *PetQuery) GroupBy(field string, fields ...string) *PetGroupBy
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 { OwnerID int `json:"owner_id,omitempty"` Count int `json:"count,omitempty"` } client.Pet.Query(). GroupBy(pet.FieldOwnerID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*PetQuery) Only ¶
Only returns a single Pet entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Pet entity is found. Returns a *NotFoundError when no Pet entities are found.
func (*PetQuery) OnlyID ¶
OnlyID is like Only, but returns the only Pet ID in the query. Returns a *NotSingularError when more than one Pet ID is found. Returns a *NotFoundError when no entities are found.
func (*PetQuery) QueryOwner ¶
QueryOwner chains the current query on the "owner" edge.
func (*PetQuery) Select ¶
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 { OwnerID int `json:"owner_id,omitempty"` } client.Pet.Query(). Select(pet.FieldOwnerID). Scan(ctx, &v)
func (*PetQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
type PetSelect ¶
type PetSelect struct { *PetQuery // contains filtered or unexported fields }
PetSelect is the builder for selecting fields of Pet entities.
func (*PetSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PetSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PetSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PetSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PetSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PetSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PetSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PetUpdate ¶
type PetUpdate struct {
// contains filtered or unexported fields
}
PetUpdate is the builder for updating Pet entities.
func (*PetUpdate) ClearOwner ¶
ClearOwner clears the "owner" edge to the User entity.
func (*PetUpdate) ClearOwnerID ¶
ClearOwnerID clears the value of the "owner_id" field.
func (*PetUpdate) Mutation ¶
func (pu *PetUpdate) Mutation() *PetMutation
Mutation returns the PetMutation object of the builder.
func (*PetUpdate) Save ¶
Save executes the query and returns the number of nodes affected by the update operation.
func (*PetUpdate) SetNillableOwnerID ¶
SetNillableOwnerID sets the "owner_id" field if the given value is not nil.
func (*PetUpdate) SetOwnerID ¶
SetOwnerID sets the "owner_id" field.
type PetUpdateOne ¶
type PetUpdateOne struct {
// contains filtered or unexported fields
}
PetUpdateOne is the builder for updating a single Pet entity.
func (*PetUpdateOne) ClearOwner ¶
func (puo *PetUpdateOne) ClearOwner() *PetUpdateOne
ClearOwner clears the "owner" edge to the User entity.
func (*PetUpdateOne) ClearOwnerID ¶
func (puo *PetUpdateOne) ClearOwnerID() *PetUpdateOne
ClearOwnerID clears the value of the "owner_id" field.
func (*PetUpdateOne) Exec ¶
func (puo *PetUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*PetUpdateOne) ExecX ¶
func (puo *PetUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PetUpdateOne) Mutation ¶
func (puo *PetUpdateOne) Mutation() *PetMutation
Mutation returns the PetMutation object of the builder.
func (*PetUpdateOne) Save ¶
func (puo *PetUpdateOne) Save(ctx context.Context) (*Pet, error)
Save executes the query and returns the updated Pet entity.
func (*PetUpdateOne) SaveX ¶
func (puo *PetUpdateOne) SaveX(ctx context.Context) *Pet
SaveX is like Save, but panics if an error occurs.
func (*PetUpdateOne) Select ¶
func (puo *PetUpdateOne) Select(field string, fields ...string) *PetUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*PetUpdateOne) SetNillableOwnerID ¶
func (puo *PetUpdateOne) SetNillableOwnerID(i *int) *PetUpdateOne
SetNillableOwnerID sets the "owner_id" field if the given value is not nil.
func (*PetUpdateOne) SetOwner ¶
func (puo *PetUpdateOne) SetOwner(u *User) *PetUpdateOne
SetOwner sets the "owner" edge to the User entity.
func (*PetUpdateOne) SetOwnerID ¶
func (puo *PetUpdateOne) SetOwnerID(i int) *PetUpdateOne
SetOwnerID sets the "owner_id" field.
type Post ¶
type Post struct { // ID of the ent. ID int `json:"id,omitempty"` // Text holds the value of the "text" field. Text string `json:"text,omitempty"` // AuthorID holds the value of the "author_id" field. AuthorID *int `json:"author_id,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the PostQuery when eager-loading is set. Edges PostEdges `json:"edges"` // contains filtered or unexported fields }
Post is the model entity for the Post schema.
func (*Post) QueryAuthor ¶
QueryAuthor queries the "author" edge of the Post entity.
func (*Post) Unwrap ¶
Unwrap unwraps the Post entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Post) Update ¶
func (po *Post) Update() *PostUpdateOne
Update returns a builder for updating this Post. Note that you need to call Post.Unwrap() before calling this method if this Post was returned from a transaction, and the transaction was committed or rolled back.
type PostClient ¶
type PostClient struct {
// contains filtered or unexported fields
}
PostClient is a client for the Post schema.
func NewPostClient ¶
func NewPostClient(c config) *PostClient
NewPostClient returns a client for the Post from the given config.
func (*PostClient) Create ¶
func (c *PostClient) Create() *PostCreate
Create returns a create builder for Post.
func (*PostClient) CreateBulk ¶
func (c *PostClient) CreateBulk(builders ...*PostCreate) *PostCreateBulk
CreateBulk returns a builder for creating a bulk of Post entities.
func (*PostClient) Delete ¶
func (c *PostClient) Delete() *PostDelete
Delete returns a delete builder for Post.
func (*PostClient) DeleteOne ¶
func (c *PostClient) DeleteOne(po *Post) *PostDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*PostClient) DeleteOneID ¶
func (c *PostClient) DeleteOneID(id int) *PostDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*PostClient) GetX ¶
func (c *PostClient) GetX(ctx context.Context, id int) *Post
GetX is like Get, but panics if an error occurs.
func (*PostClient) Query ¶
func (c *PostClient) Query() *PostQuery
Query returns a query builder for Post.
func (*PostClient) QueryAuthor ¶
func (c *PostClient) QueryAuthor(po *Post) *UserQuery
QueryAuthor queries the author edge of a Post.
func (*PostClient) Update ¶
func (c *PostClient) Update() *PostUpdate
Update returns an update builder for Post.
func (*PostClient) UpdateOne ¶
func (c *PostClient) UpdateOne(po *Post) *PostUpdateOne
UpdateOne returns an update builder for the given entity.
func (*PostClient) UpdateOneID ¶
func (c *PostClient) UpdateOneID(id int) *PostUpdateOne
UpdateOneID returns an update builder for the given id.
func (*PostClient) Use ¶
func (c *PostClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `post.Hooks(f(g(h())))`.
type PostCreate ¶
type PostCreate struct {
// contains filtered or unexported fields
}
PostCreate is the builder for creating a Post entity.
func (*PostCreate) Exec ¶
func (pc *PostCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*PostCreate) ExecX ¶
func (pc *PostCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PostCreate) Mutation ¶
func (pc *PostCreate) Mutation() *PostMutation
Mutation returns the PostMutation object of the builder.
func (*PostCreate) Save ¶
func (pc *PostCreate) Save(ctx context.Context) (*Post, error)
Save creates the Post in the database.
func (*PostCreate) SaveX ¶
func (pc *PostCreate) SaveX(ctx context.Context) *Post
SaveX calls Save and panics if Save returns an error.
func (*PostCreate) SetAuthor ¶
func (pc *PostCreate) SetAuthor(u *User) *PostCreate
SetAuthor sets the "author" edge to the User entity.
func (*PostCreate) SetAuthorID ¶
func (pc *PostCreate) SetAuthorID(i int) *PostCreate
SetAuthorID sets the "author_id" field.
func (*PostCreate) SetNillableAuthorID ¶
func (pc *PostCreate) SetNillableAuthorID(i *int) *PostCreate
SetNillableAuthorID sets the "author_id" field if the given value is not nil.
func (*PostCreate) SetText ¶
func (pc *PostCreate) SetText(s string) *PostCreate
SetText sets the "text" field.
type PostCreateBulk ¶
type PostCreateBulk struct {
// contains filtered or unexported fields
}
PostCreateBulk is the builder for creating many Post entities in bulk.
func (*PostCreateBulk) Exec ¶
func (pcb *PostCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*PostCreateBulk) ExecX ¶
func (pcb *PostCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type PostDelete ¶
type PostDelete struct {
// contains filtered or unexported fields
}
PostDelete is the builder for deleting a Post entity.
func (*PostDelete) Exec ¶
func (pd *PostDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*PostDelete) ExecX ¶
func (pd *PostDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*PostDelete) Where ¶
func (pd *PostDelete) Where(ps ...predicate.Post) *PostDelete
Where appends a list predicates to the PostDelete builder.
type PostDeleteOne ¶
type PostDeleteOne struct {
// contains filtered or unexported fields
}
PostDeleteOne is the builder for deleting a single Post entity.
func (*PostDeleteOne) Exec ¶
func (pdo *PostDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*PostDeleteOne) ExecX ¶
func (pdo *PostDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type PostEdges ¶
type PostEdges struct { // Author holds the value of the author edge. Author *User `json:"author,omitempty"` // contains filtered or unexported fields }
PostEdges holds the relations/edges for other nodes in the graph.
func (PostEdges) AuthorOrErr ¶
AuthorOrErr returns the Author value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type PostGroupBy ¶
type PostGroupBy struct {
// contains filtered or unexported fields
}
PostGroupBy is the group-by builder for Post entities.
func (*PostGroupBy) Aggregate ¶
func (pgb *PostGroupBy) Aggregate(fns ...AggregateFunc) *PostGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*PostGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PostGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PostGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PostGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PostGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PostGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PostGroupBy) Scan ¶
func (pgb *PostGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*PostGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PostMutation ¶
type PostMutation struct {
// contains filtered or unexported fields
}
PostMutation represents an operation that mutates the Post nodes in the graph.
func (*PostMutation) AddField ¶
func (m *PostMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*PostMutation) AddedEdges ¶
func (m *PostMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*PostMutation) AddedField ¶
func (m *PostMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*PostMutation) AddedFields ¶
func (m *PostMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*PostMutation) AddedIDs ¶
func (m *PostMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*PostMutation) AuthorCleared ¶
func (m *PostMutation) AuthorCleared() bool
AuthorCleared reports if the "author" edge to the User entity was cleared.
func (*PostMutation) AuthorID ¶
func (m *PostMutation) AuthorID() (r int, exists bool)
AuthorID returns the value of the "author_id" field in the mutation.
func (*PostMutation) AuthorIDCleared ¶
func (m *PostMutation) AuthorIDCleared() bool
AuthorIDCleared returns if the "author_id" field was cleared in this mutation.
func (*PostMutation) AuthorIDs ¶
func (m *PostMutation) AuthorIDs() (ids []int)
AuthorIDs returns the "author" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AuthorID instead. It exists only for internal usage by the builders.
func (*PostMutation) ClearAuthor ¶
func (m *PostMutation) ClearAuthor()
ClearAuthor clears the "author" edge to the User entity.
func (*PostMutation) ClearAuthorID ¶
func (m *PostMutation) ClearAuthorID()
ClearAuthorID clears the value of the "author_id" field.
func (*PostMutation) ClearEdge ¶
func (m *PostMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*PostMutation) ClearField ¶
func (m *PostMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*PostMutation) ClearedEdges ¶
func (m *PostMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*PostMutation) ClearedFields ¶
func (m *PostMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (PostMutation) Client ¶
func (m PostMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*PostMutation) EdgeCleared ¶
func (m *PostMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*PostMutation) Field ¶
func (m *PostMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*PostMutation) FieldCleared ¶
func (m *PostMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*PostMutation) Fields ¶
func (m *PostMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*PostMutation) ID ¶
func (m *PostMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*PostMutation) IDs ¶
func (m *PostMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*PostMutation) OldAuthorID ¶
func (m *PostMutation) OldAuthorID(ctx context.Context) (v *int, err error)
OldAuthorID returns the old "author_id" field's value of the Post entity. If the Post object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*PostMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*PostMutation) OldText ¶
func (m *PostMutation) OldText(ctx context.Context) (v string, err error)
OldText returns the old "text" field's value of the Post entity. If the Post object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*PostMutation) RemovedEdges ¶
func (m *PostMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*PostMutation) RemovedIDs ¶
func (m *PostMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*PostMutation) ResetAuthor ¶
func (m *PostMutation) ResetAuthor()
ResetAuthor resets all changes to the "author" edge.
func (*PostMutation) ResetAuthorID ¶
func (m *PostMutation) ResetAuthorID()
ResetAuthorID resets all changes to the "author_id" field.
func (*PostMutation) ResetEdge ¶
func (m *PostMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*PostMutation) ResetField ¶
func (m *PostMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*PostMutation) ResetText ¶
func (m *PostMutation) ResetText()
ResetText resets all changes to the "text" field.
func (*PostMutation) SetAuthorID ¶
func (m *PostMutation) SetAuthorID(i int)
SetAuthorID sets the "author_id" field.
func (*PostMutation) SetField ¶
func (m *PostMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*PostMutation) SetText ¶
func (m *PostMutation) SetText(s string)
SetText sets the "text" field.
func (*PostMutation) Text ¶
func (m *PostMutation) Text() (r string, exists bool)
Text returns the value of the "text" field in the mutation.
func (PostMutation) Tx ¶
func (m PostMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*PostMutation) Type ¶
func (m *PostMutation) Type() string
Type returns the node type of this mutation (Post).
func (*PostMutation) Where ¶
func (m *PostMutation) Where(ps ...predicate.Post)
Where appends a list predicates to the PostMutation builder.
type PostQuery ¶
type PostQuery struct {
// contains filtered or unexported fields
}
PostQuery is the builder for querying Post entities.
func (*PostQuery) Clone ¶
Clone returns a duplicate of the PostQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*PostQuery) First ¶
First returns the first Post entity from the query. Returns a *NotFoundError when no Post was found.
func (*PostQuery) FirstID ¶
FirstID returns the first Post ID from the query. Returns a *NotFoundError when no Post ID was found.
func (*PostQuery) GroupBy ¶
func (pq *PostQuery) GroupBy(field string, fields ...string) *PostGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Text string `json:"text,omitempty"` Count int `json:"count,omitempty"` } client.Post.Query(). GroupBy(post.FieldText). Aggregate(ent.Count()). Scan(ctx, &v)
func (*PostQuery) Only ¶
Only returns a single Post entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Post entity is found. Returns a *NotFoundError when no Post entities are found.
func (*PostQuery) OnlyID ¶
OnlyID is like Only, but returns the only Post ID in the query. Returns a *NotSingularError when more than one Post ID is found. Returns a *NotFoundError when no entities are found.
func (*PostQuery) QueryAuthor ¶
QueryAuthor chains the current query on the "author" edge.
func (*PostQuery) Select ¶
func (pq *PostQuery) Select(fields ...string) *PostSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Text string `json:"text,omitempty"` } client.Post.Query(). Select(post.FieldText). Scan(ctx, &v)
func (*PostQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*PostQuery) WithAuthor ¶
WithAuthor tells the query-builder to eager-load the nodes that are connected to the "author" edge. The optional arguments are used to configure the query builder of the edge.
type PostSelect ¶
type PostSelect struct { *PostQuery // contains filtered or unexported fields }
PostSelect is the builder for selecting fields of Post entities.
func (*PostSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PostSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PostSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PostSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PostSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PostSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PostSelect) Scan ¶
func (ps *PostSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*PostSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PostUpdate ¶
type PostUpdate struct {
// contains filtered or unexported fields
}
PostUpdate is the builder for updating Post entities.
func (*PostUpdate) ClearAuthor ¶
func (pu *PostUpdate) ClearAuthor() *PostUpdate
ClearAuthor clears the "author" edge to the User entity.
func (*PostUpdate) ClearAuthorID ¶
func (pu *PostUpdate) ClearAuthorID() *PostUpdate
ClearAuthorID clears the value of the "author_id" field.
func (*PostUpdate) Exec ¶
func (pu *PostUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*PostUpdate) ExecX ¶
func (pu *PostUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PostUpdate) Mutation ¶
func (pu *PostUpdate) Mutation() *PostMutation
Mutation returns the PostMutation object of the builder.
func (*PostUpdate) Save ¶
func (pu *PostUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*PostUpdate) SaveX ¶
func (pu *PostUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*PostUpdate) SetAuthor ¶
func (pu *PostUpdate) SetAuthor(u *User) *PostUpdate
SetAuthor sets the "author" edge to the User entity.
func (*PostUpdate) SetAuthorID ¶
func (pu *PostUpdate) SetAuthorID(i int) *PostUpdate
SetAuthorID sets the "author_id" field.
func (*PostUpdate) SetNillableAuthorID ¶
func (pu *PostUpdate) SetNillableAuthorID(i *int) *PostUpdate
SetNillableAuthorID sets the "author_id" field if the given value is not nil.
func (*PostUpdate) SetText ¶
func (pu *PostUpdate) SetText(s string) *PostUpdate
SetText sets the "text" field.
func (*PostUpdate) Where ¶
func (pu *PostUpdate) Where(ps ...predicate.Post) *PostUpdate
Where appends a list predicates to the PostUpdate builder.
type PostUpdateOne ¶
type PostUpdateOne struct {
// contains filtered or unexported fields
}
PostUpdateOne is the builder for updating a single Post entity.
func (*PostUpdateOne) ClearAuthor ¶
func (puo *PostUpdateOne) ClearAuthor() *PostUpdateOne
ClearAuthor clears the "author" edge to the User entity.
func (*PostUpdateOne) ClearAuthorID ¶
func (puo *PostUpdateOne) ClearAuthorID() *PostUpdateOne
ClearAuthorID clears the value of the "author_id" field.
func (*PostUpdateOne) Exec ¶
func (puo *PostUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*PostUpdateOne) ExecX ¶
func (puo *PostUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PostUpdateOne) Mutation ¶
func (puo *PostUpdateOne) Mutation() *PostMutation
Mutation returns the PostMutation object of the builder.
func (*PostUpdateOne) Save ¶
func (puo *PostUpdateOne) Save(ctx context.Context) (*Post, error)
Save executes the query and returns the updated Post entity.
func (*PostUpdateOne) SaveX ¶
func (puo *PostUpdateOne) SaveX(ctx context.Context) *Post
SaveX is like Save, but panics if an error occurs.
func (*PostUpdateOne) Select ¶
func (puo *PostUpdateOne) Select(field string, fields ...string) *PostUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*PostUpdateOne) SetAuthor ¶
func (puo *PostUpdateOne) SetAuthor(u *User) *PostUpdateOne
SetAuthor sets the "author" edge to the User entity.
func (*PostUpdateOne) SetAuthorID ¶
func (puo *PostUpdateOne) SetAuthorID(i int) *PostUpdateOne
SetAuthorID sets the "author_id" field.
func (*PostUpdateOne) SetNillableAuthorID ¶
func (puo *PostUpdateOne) SetNillableAuthorID(i *int) *PostUpdateOne
SetNillableAuthorID sets the "author_id" field if the given value is not nil.
func (*PostUpdateOne) SetText ¶
func (puo *PostUpdateOne) SetText(s string) *PostUpdateOne
SetText sets the "text" field.
type Rental ¶
type Rental struct { // ID of the ent. ID int `json:"id,omitempty"` // Date holds the value of the "date" field. Date time.Time `json:"date,omitempty"` // UserID holds the value of the "user_id" field. UserID int `json:"user_id,omitempty"` // CarID holds the value of the "car_id" field. CarID uuid.UUID `json:"car_id,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the RentalQuery when eager-loading is set. Edges RentalEdges `json:"edges"` // contains filtered or unexported fields }
Rental is the model entity for the Rental schema.
func (*Rental) Unwrap ¶
Unwrap unwraps the Rental 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 (*Rental) Update ¶
func (r *Rental) Update() *RentalUpdateOne
Update returns a builder for updating this Rental. Note that you need to call Rental.Unwrap() before calling this method if this Rental was returned from a transaction, and the transaction was committed or rolled back.
type RentalClient ¶
type RentalClient struct {
// contains filtered or unexported fields
}
RentalClient is a client for the Rental schema.
func NewRentalClient ¶
func NewRentalClient(c config) *RentalClient
NewRentalClient returns a client for the Rental from the given config.
func (*RentalClient) Create ¶
func (c *RentalClient) Create() *RentalCreate
Create returns a create builder for Rental.
func (*RentalClient) CreateBulk ¶
func (c *RentalClient) CreateBulk(builders ...*RentalCreate) *RentalCreateBulk
CreateBulk returns a builder for creating a bulk of Rental entities.
func (*RentalClient) Delete ¶
func (c *RentalClient) Delete() *RentalDelete
Delete returns a delete builder for Rental.
func (*RentalClient) DeleteOne ¶
func (c *RentalClient) DeleteOne(r *Rental) *RentalDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*RentalClient) DeleteOneID ¶
func (c *RentalClient) DeleteOneID(id int) *RentalDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*RentalClient) GetX ¶
func (c *RentalClient) GetX(ctx context.Context, id int) *Rental
GetX is like Get, but panics if an error occurs.
func (*RentalClient) Query ¶
func (c *RentalClient) Query() *RentalQuery
Query returns a query builder for Rental.
func (*RentalClient) QueryCar ¶
func (c *RentalClient) QueryCar(r *Rental) *CarQuery
QueryCar queries the car edge of a Rental.
func (*RentalClient) QueryUser ¶
func (c *RentalClient) QueryUser(r *Rental) *UserQuery
QueryUser queries the user edge of a Rental.
func (*RentalClient) Update ¶
func (c *RentalClient) Update() *RentalUpdate
Update returns an update builder for Rental.
func (*RentalClient) UpdateOne ¶
func (c *RentalClient) UpdateOne(r *Rental) *RentalUpdateOne
UpdateOne returns an update builder for the given entity.
func (*RentalClient) UpdateOneID ¶
func (c *RentalClient) UpdateOneID(id int) *RentalUpdateOne
UpdateOneID returns an update builder for the given id.
func (*RentalClient) Use ¶
func (c *RentalClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `rental.Hooks(f(g(h())))`.
type RentalCreate ¶
type RentalCreate struct {
// contains filtered or unexported fields
}
RentalCreate is the builder for creating a Rental entity.
func (*RentalCreate) Exec ¶
func (rc *RentalCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*RentalCreate) ExecX ¶
func (rc *RentalCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RentalCreate) Mutation ¶
func (rc *RentalCreate) Mutation() *RentalMutation
Mutation returns the RentalMutation object of the builder.
func (*RentalCreate) Save ¶
func (rc *RentalCreate) Save(ctx context.Context) (*Rental, error)
Save creates the Rental in the database.
func (*RentalCreate) SaveX ¶
func (rc *RentalCreate) SaveX(ctx context.Context) *Rental
SaveX calls Save and panics if Save returns an error.
func (*RentalCreate) SetCar ¶
func (rc *RentalCreate) SetCar(c *Car) *RentalCreate
SetCar sets the "car" edge to the Car entity.
func (*RentalCreate) SetCarID ¶
func (rc *RentalCreate) SetCarID(u uuid.UUID) *RentalCreate
SetCarID sets the "car_id" field.
func (*RentalCreate) SetDate ¶
func (rc *RentalCreate) SetDate(t time.Time) *RentalCreate
SetDate sets the "date" field.
func (*RentalCreate) SetNillableDate ¶
func (rc *RentalCreate) SetNillableDate(t *time.Time) *RentalCreate
SetNillableDate sets the "date" field if the given value is not nil.
func (*RentalCreate) SetUser ¶
func (rc *RentalCreate) SetUser(u *User) *RentalCreate
SetUser sets the "user" edge to the User entity.
func (*RentalCreate) SetUserID ¶
func (rc *RentalCreate) SetUserID(i int) *RentalCreate
SetUserID sets the "user_id" field.
type RentalCreateBulk ¶
type RentalCreateBulk struct {
// contains filtered or unexported fields
}
RentalCreateBulk is the builder for creating many Rental entities in bulk.
func (*RentalCreateBulk) Exec ¶
func (rcb *RentalCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*RentalCreateBulk) ExecX ¶
func (rcb *RentalCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type RentalDelete ¶
type RentalDelete struct {
// contains filtered or unexported fields
}
RentalDelete is the builder for deleting a Rental entity.
func (*RentalDelete) Exec ¶
func (rd *RentalDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*RentalDelete) ExecX ¶
func (rd *RentalDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*RentalDelete) Where ¶
func (rd *RentalDelete) Where(ps ...predicate.Rental) *RentalDelete
Where appends a list predicates to the RentalDelete builder.
type RentalDeleteOne ¶
type RentalDeleteOne struct {
// contains filtered or unexported fields
}
RentalDeleteOne is the builder for deleting a single Rental entity.
func (*RentalDeleteOne) Exec ¶
func (rdo *RentalDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*RentalDeleteOne) ExecX ¶
func (rdo *RentalDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type RentalEdges ¶
type RentalEdges struct { // User holds the value of the user edge. User *User `json:"user,omitempty"` // Car holds the value of the car edge. Car *Car `json:"car,omitempty"` // contains filtered or unexported fields }
RentalEdges holds the relations/edges for other nodes in the graph.
func (RentalEdges) CarOrErr ¶
func (e RentalEdges) CarOrErr() (*Car, error)
CarOrErr returns the Car value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (RentalEdges) UserOrErr ¶
func (e RentalEdges) UserOrErr() (*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type RentalGroupBy ¶
type RentalGroupBy struct {
// contains filtered or unexported fields
}
RentalGroupBy is the group-by builder for Rental entities.
func (*RentalGroupBy) Aggregate ¶
func (rgb *RentalGroupBy) Aggregate(fns ...AggregateFunc) *RentalGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*RentalGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RentalGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RentalGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RentalGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RentalGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RentalGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RentalGroupBy) Scan ¶
func (rgb *RentalGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*RentalGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type RentalMutation ¶
type RentalMutation struct {
// contains filtered or unexported fields
}
RentalMutation represents an operation that mutates the Rental nodes in the graph.
func (*RentalMutation) AddField ¶
func (m *RentalMutation) 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 (*RentalMutation) AddedEdges ¶
func (m *RentalMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*RentalMutation) AddedField ¶
func (m *RentalMutation) 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 (*RentalMutation) AddedFields ¶
func (m *RentalMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*RentalMutation) AddedIDs ¶
func (m *RentalMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*RentalMutation) CarCleared ¶
func (m *RentalMutation) CarCleared() bool
CarCleared reports if the "car" edge to the Car entity was cleared.
func (*RentalMutation) CarID ¶
func (m *RentalMutation) CarID() (r uuid.UUID, exists bool)
CarID returns the value of the "car_id" field in the mutation.
func (*RentalMutation) CarIDs ¶
func (m *RentalMutation) CarIDs() (ids []uuid.UUID)
CarIDs returns the "car" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CarID instead. It exists only for internal usage by the builders.
func (*RentalMutation) ClearCar ¶
func (m *RentalMutation) ClearCar()
ClearCar clears the "car" edge to the Car entity.
func (*RentalMutation) ClearEdge ¶
func (m *RentalMutation) 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 (*RentalMutation) ClearField ¶
func (m *RentalMutation) 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 (*RentalMutation) ClearUser ¶
func (m *RentalMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*RentalMutation) ClearedEdges ¶
func (m *RentalMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*RentalMutation) ClearedFields ¶
func (m *RentalMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (RentalMutation) Client ¶
func (m RentalMutation) 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 (*RentalMutation) Date ¶
func (m *RentalMutation) Date() (r time.Time, exists bool)
Date returns the value of the "date" field in the mutation.
func (*RentalMutation) EdgeCleared ¶
func (m *RentalMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*RentalMutation) Field ¶
func (m *RentalMutation) 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 (*RentalMutation) FieldCleared ¶
func (m *RentalMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*RentalMutation) Fields ¶
func (m *RentalMutation) 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 (*RentalMutation) ID ¶
func (m *RentalMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*RentalMutation) IDs ¶
func (m *RentalMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*RentalMutation) OldCarID ¶
OldCarID returns the old "car_id" field's value of the Rental entity. If the Rental 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 (*RentalMutation) OldDate ¶
OldDate returns the old "date" field's value of the Rental entity. If the Rental 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 (*RentalMutation) 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 (*RentalMutation) OldUserID ¶
func (m *RentalMutation) OldUserID(ctx context.Context) (v int, err error)
OldUserID returns the old "user_id" field's value of the Rental entity. If the Rental 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 (*RentalMutation) RemovedEdges ¶
func (m *RentalMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*RentalMutation) RemovedIDs ¶
func (m *RentalMutation) 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 (*RentalMutation) ResetCar ¶
func (m *RentalMutation) ResetCar()
ResetCar resets all changes to the "car" edge.
func (*RentalMutation) ResetCarID ¶
func (m *RentalMutation) ResetCarID()
ResetCarID resets all changes to the "car_id" field.
func (*RentalMutation) ResetDate ¶
func (m *RentalMutation) ResetDate()
ResetDate resets all changes to the "date" field.
func (*RentalMutation) ResetEdge ¶
func (m *RentalMutation) 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 (*RentalMutation) ResetField ¶
func (m *RentalMutation) 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 (*RentalMutation) ResetUser ¶
func (m *RentalMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*RentalMutation) ResetUserID ¶
func (m *RentalMutation) ResetUserID()
ResetUserID resets all changes to the "user_id" field.
func (*RentalMutation) SetCarID ¶
func (m *RentalMutation) SetCarID(u uuid.UUID)
SetCarID sets the "car_id" field.
func (*RentalMutation) SetDate ¶
func (m *RentalMutation) SetDate(t time.Time)
SetDate sets the "date" field.
func (*RentalMutation) SetField ¶
func (m *RentalMutation) 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 (*RentalMutation) SetUserID ¶
func (m *RentalMutation) SetUserID(i int)
SetUserID sets the "user_id" field.
func (RentalMutation) Tx ¶
func (m RentalMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*RentalMutation) Type ¶
func (m *RentalMutation) Type() string
Type returns the node type of this mutation (Rental).
func (*RentalMutation) UserCleared ¶
func (m *RentalMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*RentalMutation) UserID ¶
func (m *RentalMutation) UserID() (r int, exists bool)
UserID returns the value of the "user_id" field in the mutation.
func (*RentalMutation) UserIDs ¶
func (m *RentalMutation) UserIDs() (ids []int)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*RentalMutation) Where ¶
func (m *RentalMutation) Where(ps ...predicate.Rental)
Where appends a list predicates to the RentalMutation builder.
type RentalQuery ¶
type RentalQuery struct {
// contains filtered or unexported fields
}
RentalQuery is the builder for querying Rental entities.
func (*RentalQuery) All ¶
func (rq *RentalQuery) All(ctx context.Context) ([]*Rental, error)
All executes the query and returns a list of Rentals.
func (*RentalQuery) AllX ¶
func (rq *RentalQuery) AllX(ctx context.Context) []*Rental
AllX is like All, but panics if an error occurs.
func (*RentalQuery) Clone ¶
func (rq *RentalQuery) Clone() *RentalQuery
Clone returns a duplicate of the RentalQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*RentalQuery) Count ¶
func (rq *RentalQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*RentalQuery) CountX ¶
func (rq *RentalQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*RentalQuery) Exist ¶
func (rq *RentalQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*RentalQuery) ExistX ¶
func (rq *RentalQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*RentalQuery) First ¶
func (rq *RentalQuery) First(ctx context.Context) (*Rental, error)
First returns the first Rental entity from the query. Returns a *NotFoundError when no Rental was found.
func (*RentalQuery) FirstID ¶
func (rq *RentalQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Rental ID from the query. Returns a *NotFoundError when no Rental ID was found.
func (*RentalQuery) FirstIDX ¶
func (rq *RentalQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*RentalQuery) FirstX ¶
func (rq *RentalQuery) FirstX(ctx context.Context) *Rental
FirstX is like First, but panics if an error occurs.
func (*RentalQuery) GroupBy ¶
func (rq *RentalQuery) GroupBy(field string, fields ...string) *RentalGroupBy
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 { Date time.Time `json:"date,omitempty"` Count int `json:"count,omitempty"` } client.Rental.Query(). GroupBy(rental.FieldDate). Aggregate(ent.Count()). Scan(ctx, &v)
func (*RentalQuery) IDs ¶
func (rq *RentalQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of Rental IDs.
func (*RentalQuery) IDsX ¶
func (rq *RentalQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*RentalQuery) Limit ¶
func (rq *RentalQuery) Limit(limit int) *RentalQuery
Limit adds a limit step to the query.
func (*RentalQuery) Offset ¶
func (rq *RentalQuery) Offset(offset int) *RentalQuery
Offset adds an offset step to the query.
func (*RentalQuery) Only ¶
func (rq *RentalQuery) Only(ctx context.Context) (*Rental, error)
Only returns a single Rental entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Rental entity is found. Returns a *NotFoundError when no Rental entities are found.
func (*RentalQuery) OnlyID ¶
func (rq *RentalQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Rental ID in the query. Returns a *NotSingularError when more than one Rental ID is found. Returns a *NotFoundError when no entities are found.
func (*RentalQuery) OnlyIDX ¶
func (rq *RentalQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*RentalQuery) OnlyX ¶
func (rq *RentalQuery) OnlyX(ctx context.Context) *Rental
OnlyX is like Only, but panics if an error occurs.
func (*RentalQuery) Order ¶
func (rq *RentalQuery) Order(o ...OrderFunc) *RentalQuery
Order adds an order step to the query.
func (*RentalQuery) QueryCar ¶
func (rq *RentalQuery) QueryCar() *CarQuery
QueryCar chains the current query on the "car" edge.
func (*RentalQuery) QueryUser ¶
func (rq *RentalQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*RentalQuery) Select ¶
func (rq *RentalQuery) Select(fields ...string) *RentalSelect
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 { Date time.Time `json:"date,omitempty"` } client.Rental.Query(). Select(rental.FieldDate). Scan(ctx, &v)
func (*RentalQuery) Unique ¶
func (rq *RentalQuery) Unique(unique bool) *RentalQuery
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 (*RentalQuery) Where ¶
func (rq *RentalQuery) Where(ps ...predicate.Rental) *RentalQuery
Where adds a new predicate for the RentalQuery builder.
func (*RentalQuery) WithCar ¶
func (rq *RentalQuery) WithCar(opts ...func(*CarQuery)) *RentalQuery
WithCar tells the query-builder to eager-load the nodes that are connected to the "car" edge. The optional arguments are used to configure the query builder of the edge.
func (*RentalQuery) WithUser ¶
func (rq *RentalQuery) WithUser(opts ...func(*UserQuery)) *RentalQuery
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 RentalSelect ¶
type RentalSelect struct { *RentalQuery // contains filtered or unexported fields }
RentalSelect is the builder for selecting fields of Rental entities.
func (*RentalSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RentalSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RentalSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RentalSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RentalSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RentalSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RentalSelect) Scan ¶
func (rs *RentalSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*RentalSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type RentalUpdate ¶
type RentalUpdate struct {
// contains filtered or unexported fields
}
RentalUpdate is the builder for updating Rental entities.
func (*RentalUpdate) ClearCar ¶
func (ru *RentalUpdate) ClearCar() *RentalUpdate
ClearCar clears the "car" edge to the Car entity.
func (*RentalUpdate) ClearUser ¶
func (ru *RentalUpdate) ClearUser() *RentalUpdate
ClearUser clears the "user" edge to the User entity.
func (*RentalUpdate) Exec ¶
func (ru *RentalUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*RentalUpdate) ExecX ¶
func (ru *RentalUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RentalUpdate) Mutation ¶
func (ru *RentalUpdate) Mutation() *RentalMutation
Mutation returns the RentalMutation object of the builder.
func (*RentalUpdate) Save ¶
func (ru *RentalUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*RentalUpdate) SaveX ¶
func (ru *RentalUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*RentalUpdate) SetCar ¶
func (ru *RentalUpdate) SetCar(c *Car) *RentalUpdate
SetCar sets the "car" edge to the Car entity.
func (*RentalUpdate) SetCarID ¶
func (ru *RentalUpdate) SetCarID(u uuid.UUID) *RentalUpdate
SetCarID sets the "car_id" field.
func (*RentalUpdate) SetDate ¶
func (ru *RentalUpdate) SetDate(t time.Time) *RentalUpdate
SetDate sets the "date" field.
func (*RentalUpdate) SetNillableDate ¶
func (ru *RentalUpdate) SetNillableDate(t *time.Time) *RentalUpdate
SetNillableDate sets the "date" field if the given value is not nil.
func (*RentalUpdate) SetUser ¶
func (ru *RentalUpdate) SetUser(u *User) *RentalUpdate
SetUser sets the "user" edge to the User entity.
func (*RentalUpdate) SetUserID ¶
func (ru *RentalUpdate) SetUserID(i int) *RentalUpdate
SetUserID sets the "user_id" field.
func (*RentalUpdate) Where ¶
func (ru *RentalUpdate) Where(ps ...predicate.Rental) *RentalUpdate
Where appends a list predicates to the RentalUpdate builder.
type RentalUpdateOne ¶
type RentalUpdateOne struct {
// contains filtered or unexported fields
}
RentalUpdateOne is the builder for updating a single Rental entity.
func (*RentalUpdateOne) ClearCar ¶
func (ruo *RentalUpdateOne) ClearCar() *RentalUpdateOne
ClearCar clears the "car" edge to the Car entity.
func (*RentalUpdateOne) ClearUser ¶
func (ruo *RentalUpdateOne) ClearUser() *RentalUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*RentalUpdateOne) Exec ¶
func (ruo *RentalUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*RentalUpdateOne) ExecX ¶
func (ruo *RentalUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RentalUpdateOne) Mutation ¶
func (ruo *RentalUpdateOne) Mutation() *RentalMutation
Mutation returns the RentalMutation object of the builder.
func (*RentalUpdateOne) Save ¶
func (ruo *RentalUpdateOne) Save(ctx context.Context) (*Rental, error)
Save executes the query and returns the updated Rental entity.
func (*RentalUpdateOne) SaveX ¶
func (ruo *RentalUpdateOne) SaveX(ctx context.Context) *Rental
SaveX is like Save, but panics if an error occurs.
func (*RentalUpdateOne) Select ¶
func (ruo *RentalUpdateOne) Select(field string, fields ...string) *RentalUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*RentalUpdateOne) SetCar ¶
func (ruo *RentalUpdateOne) SetCar(c *Car) *RentalUpdateOne
SetCar sets the "car" edge to the Car entity.
func (*RentalUpdateOne) SetCarID ¶
func (ruo *RentalUpdateOne) SetCarID(u uuid.UUID) *RentalUpdateOne
SetCarID sets the "car_id" field.
func (*RentalUpdateOne) SetDate ¶
func (ruo *RentalUpdateOne) SetDate(t time.Time) *RentalUpdateOne
SetDate sets the "date" field.
func (*RentalUpdateOne) SetNillableDate ¶
func (ruo *RentalUpdateOne) SetNillableDate(t *time.Time) *RentalUpdateOne
SetNillableDate sets the "date" field if the given value is not nil.
func (*RentalUpdateOne) SetUser ¶
func (ruo *RentalUpdateOne) SetUser(u *User) *RentalUpdateOne
SetUser sets the "user" edge to the User entity.
func (*RentalUpdateOne) SetUserID ¶
func (ruo *RentalUpdateOne) SetUserID(i int) *RentalUpdateOne
SetUserID sets the "user_id" field.
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 Tx ¶
type Tx struct { // Car is the client for interacting with the Car builders. Car *CarClient // Card is the client for interacting with the Card builders. Card *CardClient // Info is the client for interacting with the Info builders. Info *InfoClient // Metadata is the client for interacting with the Metadata builders. Metadata *MetadataClient // Node is the client for interacting with the Node builders. Node *NodeClient // Pet is the client for interacting with the Pet builders. Pet *PetClient // Post is the client for interacting with the Post builders. Post *PostClient // Rental is the client for interacting with the Rental builders. Rental *RentalClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type User ¶
type User struct { // ID of the ent. ID int `json:"id,omitempty"` // ParentID holds the value of the "parent_id" field. ParentID int `json:"parent_id,omitempty"` // SpouseID holds the value of the "spouse_id" field. SpouseID int `json:"spouse_id,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the UserQuery when eager-loading is set. Edges UserEdges `json:"edges"` // contains filtered or unexported fields }
User is the model entity for the User schema.
func (*User) QueryChildren ¶
QueryChildren queries the "children" edge of the User entity.
func (*User) QueryMetadata ¶
func (u *User) QueryMetadata() *MetadataQuery
QueryMetadata queries the "metadata" edge of the User entity.
func (*User) QueryParent ¶
QueryParent queries the "parent" edge of the User entity.
func (*User) QueryRentals ¶
func (u *User) QueryRentals() *RentalQuery
QueryRentals queries the "rentals" edge of the User entity.
func (*User) QuerySpouse ¶
QuerySpouse queries the "spouse" edge of the User entity.
func (*User) Unwrap ¶
Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*User) Update ¶
func (u *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is a client for the User schema.
func NewUserClient ¶
func NewUserClient(c config) *UserClient
NewUserClient returns a client for the User from the given config.
func (*UserClient) Create ¶
func (c *UserClient) Create() *UserCreate
Create returns a create builder for User.
func (*UserClient) CreateBulk ¶
func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
CreateBulk returns a builder for creating a bulk of User entities.
func (*UserClient) Delete ¶
func (c *UserClient) Delete() *UserDelete
Delete returns a delete builder for User.
func (*UserClient) DeleteOne ¶
func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*UserClient) GetX ¶
func (c *UserClient) GetX(ctx context.Context, id int) *User
GetX is like Get, but panics if an error occurs.
func (*UserClient) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) QueryCard ¶
func (c *UserClient) QueryCard(u *User) *CardQuery
QueryCard queries the card edge of a User.
func (*UserClient) QueryChildren ¶
func (c *UserClient) QueryChildren(u *User) *UserQuery
QueryChildren queries the children edge of a User.
func (*UserClient) QueryInfo ¶
func (c *UserClient) QueryInfo(u *User) *InfoQuery
QueryInfo queries the info edge of a User.
func (*UserClient) QueryMetadata ¶
func (c *UserClient) QueryMetadata(u *User) *MetadataQuery
QueryMetadata queries the metadata edge of a User.
func (*UserClient) QueryParent ¶
func (c *UserClient) QueryParent(u *User) *UserQuery
QueryParent queries the parent edge of a User.
func (*UserClient) QueryPets ¶
func (c *UserClient) QueryPets(u *User) *PetQuery
QueryPets queries the pets edge of a User.
func (*UserClient) QueryRentals ¶
func (c *UserClient) QueryRentals(u *User) *RentalQuery
QueryRentals queries the rentals edge of a User.
func (*UserClient) QuerySpouse ¶
func (c *UserClient) QuerySpouse(u *User) *UserQuery
QuerySpouse queries the spouse edge of a User.
func (*UserClient) Update ¶
func (c *UserClient) Update() *UserUpdate
Update returns an update builder for User.
func (*UserClient) UpdateOne ¶
func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserClient) UpdateOneID ¶
func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserClient) Use ¶
func (c *UserClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.
type UserCreate ¶
type UserCreate struct {
// contains filtered or unexported fields
}
UserCreate is the builder for creating a User entity.
func (*UserCreate) AddChildIDs ¶
func (uc *UserCreate) AddChildIDs(ids ...int) *UserCreate
AddChildIDs adds the "children" edge to the User entity by IDs.
func (*UserCreate) AddChildren ¶
func (uc *UserCreate) AddChildren(u ...*User) *UserCreate
AddChildren adds the "children" edges to the User entity.
func (*UserCreate) AddInfo ¶
func (uc *UserCreate) AddInfo(i ...*Info) *UserCreate
AddInfo adds the "info" edges to the Info entity.
func (*UserCreate) AddInfoIDs ¶
func (uc *UserCreate) AddInfoIDs(ids ...int) *UserCreate
AddInfoIDs adds the "info" edge to the Info entity by IDs.
func (*UserCreate) AddPetIDs ¶
func (uc *UserCreate) AddPetIDs(ids ...int) *UserCreate
AddPetIDs adds the "pets" edge to the Pet entity by IDs.
func (*UserCreate) AddPets ¶
func (uc *UserCreate) AddPets(p ...*Pet) *UserCreate
AddPets adds the "pets" edges to the Pet entity.
func (*UserCreate) AddRentalIDs ¶
func (uc *UserCreate) AddRentalIDs(ids ...int) *UserCreate
AddRentalIDs adds the "rentals" edge to the Rental entity by IDs.
func (*UserCreate) AddRentals ¶
func (uc *UserCreate) AddRentals(r ...*Rental) *UserCreate
AddRentals adds the "rentals" edges to the Rental entity.
func (*UserCreate) Exec ¶
func (uc *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecX ¶
func (uc *UserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreate) Mutation ¶
func (uc *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) Save ¶
func (uc *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶
func (uc *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetCard ¶
func (uc *UserCreate) SetCard(c *Card) *UserCreate
SetCard sets the "card" edge to the Card entity.
func (*UserCreate) SetCardID ¶
func (uc *UserCreate) SetCardID(id int) *UserCreate
SetCardID sets the "card" edge to the Card entity by ID.
func (*UserCreate) SetID ¶
func (uc *UserCreate) SetID(i int) *UserCreate
SetID sets the "id" field.
func (*UserCreate) SetMetadata ¶
func (uc *UserCreate) SetMetadata(m *Metadata) *UserCreate
SetMetadata sets the "metadata" edge to the Metadata entity.
func (*UserCreate) SetMetadataID ¶
func (uc *UserCreate) SetMetadataID(id int) *UserCreate
SetMetadataID sets the "metadata" edge to the Metadata entity by ID.
func (*UserCreate) SetNillableCardID ¶
func (uc *UserCreate) SetNillableCardID(id *int) *UserCreate
SetNillableCardID sets the "card" edge to the Card entity by ID if the given value is not nil.
func (*UserCreate) SetNillableMetadataID ¶
func (uc *UserCreate) SetNillableMetadataID(id *int) *UserCreate
SetNillableMetadataID sets the "metadata" edge to the Metadata entity by ID if the given value is not nil.
func (*UserCreate) SetNillableParentID ¶
func (uc *UserCreate) SetNillableParentID(i *int) *UserCreate
SetNillableParentID sets the "parent_id" field if the given value is not nil.
func (*UserCreate) SetNillableSpouseID ¶
func (uc *UserCreate) SetNillableSpouseID(i *int) *UserCreate
SetNillableSpouseID sets the "spouse_id" field if the given value is not nil.
func (*UserCreate) SetParent ¶
func (uc *UserCreate) SetParent(u *User) *UserCreate
SetParent sets the "parent" edge to the User entity.
func (*UserCreate) SetParentID ¶
func (uc *UserCreate) SetParentID(i int) *UserCreate
SetParentID sets the "parent_id" field.
func (*UserCreate) SetSpouse ¶
func (uc *UserCreate) SetSpouse(u *User) *UserCreate
SetSpouse sets the "spouse" edge to the User entity.
func (*UserCreate) SetSpouseID ¶
func (uc *UserCreate) SetSpouseID(i int) *UserCreate
SetSpouseID sets the "spouse_id" field.
type UserCreateBulk ¶
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating many User entities in bulk.
func (*UserCreateBulk) Exec ¶
func (ucb *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (ucb *UserCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserDelete ¶
type UserDelete struct {
// contains filtered or unexported fields
}
UserDelete is the builder for deleting a User entity.
func (*UserDelete) Exec ¶
func (ud *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶
func (ud *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶
func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete
Where appends a list predicates to the UserDelete builder.
type UserDeleteOne ¶
type UserDeleteOne struct {
// contains filtered or unexported fields
}
UserDeleteOne is the builder for deleting a single User entity.
func (*UserDeleteOne) Exec ¶
func (udo *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (udo *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserEdges ¶
type UserEdges struct { // Pets holds the value of the pets edge. Pets []*Pet `json:"pets,omitempty"` // Parent holds the value of the parent edge. Parent *User `json:"parent,omitempty"` // Children holds the value of the children edge. Children []*User `json:"children,omitempty"` // Spouse holds the value of the spouse edge. Spouse *User `json:"spouse,omitempty"` // Card holds the value of the card edge. Card *Card `json:"card,omitempty"` // Metadata holds the value of the metadata edge. Metadata *Metadata `json:"metadata,omitempty"` // Info holds the value of the info edge. Info []*Info `json:"info,omitempty"` // Rentals holds the value of the rentals edge. Rentals []*Rental `json:"rentals,omitempty"` // contains filtered or unexported fields }
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) CardOrErr ¶
CardOrErr returns the Card value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (UserEdges) ChildrenOrErr ¶
ChildrenOrErr returns the Children value or an error if the edge was not loaded in eager-loading.
func (UserEdges) InfoOrErr ¶
InfoOrErr returns the Info value or an error if the edge was not loaded in eager-loading.
func (UserEdges) MetadataOrErr ¶
MetadataOrErr returns the Metadata value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (UserEdges) ParentOrErr ¶
ParentOrErr returns the Parent value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (UserEdges) PetsOrErr ¶
PetsOrErr returns the Pets value or an error if the edge was not loaded in eager-loading.
func (UserEdges) RentalsOrErr ¶
RentalsOrErr returns the Rentals value or an error if the edge was not loaded in eager-loading.
func (UserEdges) SpouseOrErr ¶
SpouseOrErr returns the Spouse value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type UserGroupBy ¶
type UserGroupBy struct {
// contains filtered or unexported fields
}
UserGroupBy is the group-by builder for User entities.
func (*UserGroupBy) Aggregate ¶
func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Scan ¶
func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*UserGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserMutation ¶
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutates the User nodes in the graph.
func (*UserMutation) AddChildIDs ¶
func (m *UserMutation) AddChildIDs(ids ...int)
AddChildIDs adds the "children" edge to the User entity by ids.
func (*UserMutation) AddField ¶
func (m *UserMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) AddInfoIDs ¶
func (m *UserMutation) AddInfoIDs(ids ...int)
AddInfoIDs adds the "info" edge to the Info entity by ids.
func (*UserMutation) AddPetIDs ¶
func (m *UserMutation) AddPetIDs(ids ...int)
AddPetIDs adds the "pets" edge to the Pet entity by ids.
func (*UserMutation) AddRentalIDs ¶
func (m *UserMutation) AddRentalIDs(ids ...int)
AddRentalIDs adds the "rentals" edge to the Rental entity by ids.
func (*UserMutation) AddedEdges ¶
func (m *UserMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserMutation) AddedField ¶
func (m *UserMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) AddedFields ¶
func (m *UserMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserMutation) AddedIDs ¶
func (m *UserMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserMutation) CardCleared ¶
func (m *UserMutation) CardCleared() bool
CardCleared reports if the "card" edge to the Card entity was cleared.
func (*UserMutation) CardID ¶
func (m *UserMutation) CardID() (id int, exists bool)
CardID returns the "card" edge ID in the mutation.
func (*UserMutation) CardIDs ¶
func (m *UserMutation) CardIDs() (ids []int)
CardIDs returns the "card" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CardID instead. It exists only for internal usage by the builders.
func (*UserMutation) ChildrenCleared ¶
func (m *UserMutation) ChildrenCleared() bool
ChildrenCleared reports if the "children" edge to the User entity was cleared.
func (*UserMutation) ChildrenIDs ¶
func (m *UserMutation) ChildrenIDs() (ids []int)
ChildrenIDs returns the "children" edge IDs in the mutation.
func (*UserMutation) ClearCard ¶
func (m *UserMutation) ClearCard()
ClearCard clears the "card" edge to the Card entity.
func (*UserMutation) ClearChildren ¶
func (m *UserMutation) ClearChildren()
ClearChildren clears the "children" edge to the User entity.
func (*UserMutation) ClearEdge ¶
func (m *UserMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*UserMutation) ClearField ¶
func (m *UserMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ClearInfo ¶
func (m *UserMutation) ClearInfo()
ClearInfo clears the "info" edge to the Info entity.
func (*UserMutation) ClearMetadata ¶
func (m *UserMutation) ClearMetadata()
ClearMetadata clears the "metadata" edge to the Metadata entity.
func (*UserMutation) ClearParent ¶
func (m *UserMutation) ClearParent()
ClearParent clears the "parent" edge to the User entity.
func (*UserMutation) ClearParentID ¶
func (m *UserMutation) ClearParentID()
ClearParentID clears the value of the "parent_id" field.
func (*UserMutation) ClearPets ¶
func (m *UserMutation) ClearPets()
ClearPets clears the "pets" edge to the Pet entity.
func (*UserMutation) ClearRentals ¶
func (m *UserMutation) ClearRentals()
ClearRentals clears the "rentals" edge to the Rental entity.
func (*UserMutation) ClearSpouse ¶
func (m *UserMutation) ClearSpouse()
ClearSpouse clears the "spouse" edge to the User entity.
func (*UserMutation) ClearSpouseID ¶
func (m *UserMutation) ClearSpouseID()
ClearSpouseID clears the value of the "spouse_id" field.
func (*UserMutation) ClearedEdges ¶
func (m *UserMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserMutation) ClearedFields ¶
func (m *UserMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserMutation) Client ¶
func (m UserMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*UserMutation) EdgeCleared ¶
func (m *UserMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserMutation) Field ¶
func (m *UserMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) FieldCleared ¶
func (m *UserMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserMutation) Fields ¶
func (m *UserMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*UserMutation) ID ¶
func (m *UserMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*UserMutation) IDs ¶
func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*UserMutation) InfoCleared ¶
func (m *UserMutation) InfoCleared() bool
InfoCleared reports if the "info" edge to the Info entity was cleared.
func (*UserMutation) InfoIDs ¶
func (m *UserMutation) InfoIDs() (ids []int)
InfoIDs returns the "info" edge IDs in the mutation.
func (*UserMutation) MetadataCleared ¶
func (m *UserMutation) MetadataCleared() bool
MetadataCleared reports if the "metadata" edge to the Metadata entity was cleared.
func (*UserMutation) MetadataID ¶
func (m *UserMutation) MetadataID() (id int, exists bool)
MetadataID returns the "metadata" edge ID in the mutation.
func (*UserMutation) MetadataIDs ¶
func (m *UserMutation) MetadataIDs() (ids []int)
MetadataIDs returns the "metadata" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use MetadataID instead. It exists only for internal usage by the builders.
func (*UserMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*UserMutation) OldParentID ¶
func (m *UserMutation) OldParentID(ctx context.Context) (v int, err error)
OldParentID returns the old "parent_id" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldSpouseID ¶
func (m *UserMutation) OldSpouseID(ctx context.Context) (v int, err error)
OldSpouseID returns the old "spouse_id" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) ParentCleared ¶
func (m *UserMutation) ParentCleared() bool
ParentCleared reports if the "parent" edge to the User entity was cleared.
func (*UserMutation) ParentID ¶
func (m *UserMutation) ParentID() (r int, exists bool)
ParentID returns the value of the "parent_id" field in the mutation.
func (*UserMutation) ParentIDCleared ¶
func (m *UserMutation) ParentIDCleared() bool
ParentIDCleared returns if the "parent_id" field was cleared in this mutation.
func (*UserMutation) ParentIDs ¶
func (m *UserMutation) ParentIDs() (ids []int)
ParentIDs returns the "parent" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ParentID instead. It exists only for internal usage by the builders.
func (*UserMutation) PetsCleared ¶
func (m *UserMutation) PetsCleared() bool
PetsCleared reports if the "pets" edge to the Pet entity was cleared.
func (*UserMutation) PetsIDs ¶
func (m *UserMutation) PetsIDs() (ids []int)
PetsIDs returns the "pets" edge IDs in the mutation.
func (*UserMutation) RemoveChildIDs ¶
func (m *UserMutation) RemoveChildIDs(ids ...int)
RemoveChildIDs removes the "children" edge to the User entity by IDs.
func (*UserMutation) RemoveInfoIDs ¶
func (m *UserMutation) RemoveInfoIDs(ids ...int)
RemoveInfoIDs removes the "info" edge to the Info entity by IDs.
func (*UserMutation) RemovePetIDs ¶
func (m *UserMutation) RemovePetIDs(ids ...int)
RemovePetIDs removes the "pets" edge to the Pet entity by IDs.
func (*UserMutation) RemoveRentalIDs ¶
func (m *UserMutation) RemoveRentalIDs(ids ...int)
RemoveRentalIDs removes the "rentals" edge to the Rental entity by IDs.
func (*UserMutation) RemovedChildrenIDs ¶
func (m *UserMutation) RemovedChildrenIDs() (ids []int)
RemovedChildren returns the removed IDs of the "children" edge to the User entity.
func (*UserMutation) RemovedEdges ¶
func (m *UserMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserMutation) RemovedIDs ¶
func (m *UserMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*UserMutation) RemovedInfoIDs ¶
func (m *UserMutation) RemovedInfoIDs() (ids []int)
RemovedInfo returns the removed IDs of the "info" edge to the Info entity.
func (*UserMutation) RemovedPetsIDs ¶
func (m *UserMutation) RemovedPetsIDs() (ids []int)
RemovedPets returns the removed IDs of the "pets" edge to the Pet entity.
func (*UserMutation) RemovedRentalsIDs ¶
func (m *UserMutation) RemovedRentalsIDs() (ids []int)
RemovedRentals returns the removed IDs of the "rentals" edge to the Rental entity.
func (*UserMutation) RentalsCleared ¶
func (m *UserMutation) RentalsCleared() bool
RentalsCleared reports if the "rentals" edge to the Rental entity was cleared.
func (*UserMutation) RentalsIDs ¶
func (m *UserMutation) RentalsIDs() (ids []int)
RentalsIDs returns the "rentals" edge IDs in the mutation.
func (*UserMutation) ResetCard ¶
func (m *UserMutation) ResetCard()
ResetCard resets all changes to the "card" edge.
func (*UserMutation) ResetChildren ¶
func (m *UserMutation) ResetChildren()
ResetChildren resets all changes to the "children" edge.
func (*UserMutation) ResetEdge ¶
func (m *UserMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*UserMutation) ResetField ¶
func (m *UserMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ResetInfo ¶
func (m *UserMutation) ResetInfo()
ResetInfo resets all changes to the "info" edge.
func (*UserMutation) ResetMetadata ¶
func (m *UserMutation) ResetMetadata()
ResetMetadata resets all changes to the "metadata" edge.
func (*UserMutation) ResetParent ¶
func (m *UserMutation) ResetParent()
ResetParent resets all changes to the "parent" edge.
func (*UserMutation) ResetParentID ¶
func (m *UserMutation) ResetParentID()
ResetParentID resets all changes to the "parent_id" field.
func (*UserMutation) ResetPets ¶
func (m *UserMutation) ResetPets()
ResetPets resets all changes to the "pets" edge.
func (*UserMutation) ResetRentals ¶
func (m *UserMutation) ResetRentals()
ResetRentals resets all changes to the "rentals" edge.
func (*UserMutation) ResetSpouse ¶
func (m *UserMutation) ResetSpouse()
ResetSpouse resets all changes to the "spouse" edge.
func (*UserMutation) ResetSpouseID ¶
func (m *UserMutation) ResetSpouseID()
ResetSpouseID resets all changes to the "spouse_id" field.
func (*UserMutation) SetCardID ¶
func (m *UserMutation) SetCardID(id int)
SetCardID sets the "card" edge to the Card entity by id.
func (*UserMutation) SetField ¶
func (m *UserMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) SetID ¶
func (m *UserMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.
func (*UserMutation) SetMetadataID ¶
func (m *UserMutation) SetMetadataID(id int)
SetMetadataID sets the "metadata" edge to the Metadata entity by id.
func (*UserMutation) SetParentID ¶
func (m *UserMutation) SetParentID(i int)
SetParentID sets the "parent_id" field.
func (*UserMutation) SetSpouseID ¶
func (m *UserMutation) SetSpouseID(i int)
SetSpouseID sets the "spouse_id" field.
func (*UserMutation) SpouseCleared ¶
func (m *UserMutation) SpouseCleared() bool
SpouseCleared reports if the "spouse" edge to the User entity was cleared.
func (*UserMutation) SpouseID ¶
func (m *UserMutation) SpouseID() (r int, exists bool)
SpouseID returns the value of the "spouse_id" field in the mutation.
func (*UserMutation) SpouseIDCleared ¶
func (m *UserMutation) SpouseIDCleared() bool
SpouseIDCleared returns if the "spouse_id" field was cleared in this mutation.
func (*UserMutation) SpouseIDs ¶
func (m *UserMutation) SpouseIDs() (ids []int)
SpouseIDs returns the "spouse" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use SpouseID instead. It exists only for internal usage by the builders.
func (UserMutation) Tx ¶
func (m UserMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserMutation) Type ¶
func (m *UserMutation) Type() string
Type returns the node type of this mutation (User).
func (*UserMutation) Where ¶
func (m *UserMutation) Where(ps ...predicate.User)
Where appends a list predicates to the UserMutation builder.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Clone ¶
Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserQuery) First ¶
First returns the first User entity from the query. Returns a *NotFoundError when no User was found.
func (*UserQuery) FirstID ¶
FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.
func (*UserQuery) GroupBy ¶
func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { ParentID int `json:"parent_id,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldParentID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserQuery) Only ¶
Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.
func (*UserQuery) OnlyID ¶
OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.
func (*UserQuery) QueryChildren ¶
QueryChildren chains the current query on the "children" edge.
func (*UserQuery) QueryMetadata ¶
func (uq *UserQuery) QueryMetadata() *MetadataQuery
QueryMetadata chains the current query on the "metadata" edge.
func (*UserQuery) QueryParent ¶
QueryParent chains the current query on the "parent" edge.
func (*UserQuery) QueryRentals ¶
func (uq *UserQuery) QueryRentals() *RentalQuery
QueryRentals chains the current query on the "rentals" edge.
func (*UserQuery) QuerySpouse ¶
QuerySpouse chains the current query on the "spouse" edge.
func (*UserQuery) Select ¶
func (uq *UserQuery) Select(fields ...string) *UserSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { ParentID int `json:"parent_id,omitempty"` } client.User.Query(). Select(user.FieldParentID). Scan(ctx, &v)
func (*UserQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*UserQuery) WithCard ¶
WithCard tells the query-builder to eager-load the nodes that are connected to the "card" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithChildren ¶
WithChildren tells the query-builder to eager-load the nodes that are connected to the "children" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithInfo ¶
WithInfo tells the query-builder to eager-load the nodes that are connected to the "info" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithMetadata ¶
func (uq *UserQuery) WithMetadata(opts ...func(*MetadataQuery)) *UserQuery
WithMetadata tells the query-builder to eager-load the nodes that are connected to the "metadata" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithParent ¶
WithParent tells the query-builder to eager-load the nodes that are connected to the "parent" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithPets ¶
WithPets tells the query-builder to eager-load the nodes that are connected to the "pets" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithRentals ¶
func (uq *UserQuery) WithRentals(opts ...func(*RentalQuery)) *UserQuery
WithRentals tells the query-builder to eager-load the nodes that are connected to the "rentals" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithSpouse ¶
WithSpouse tells the query-builder to eager-load the nodes that are connected to the "spouse" edge. The optional arguments are used to configure the query builder of the edge.
type UserSelect ¶
type UserSelect struct { *UserQuery // contains filtered or unexported fields }
UserSelect is the builder for selecting fields of User entities.
func (*UserSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSelect) Scan ¶
func (us *UserSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*UserSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) AddChildIDs ¶
func (uu *UserUpdate) AddChildIDs(ids ...int) *UserUpdate
AddChildIDs adds the "children" edge to the User entity by IDs.
func (*UserUpdate) AddChildren ¶
func (uu *UserUpdate) AddChildren(u ...*User) *UserUpdate
AddChildren adds the "children" edges to the User entity.
func (*UserUpdate) AddInfo ¶
func (uu *UserUpdate) AddInfo(i ...*Info) *UserUpdate
AddInfo adds the "info" edges to the Info entity.
func (*UserUpdate) AddInfoIDs ¶
func (uu *UserUpdate) AddInfoIDs(ids ...int) *UserUpdate
AddInfoIDs adds the "info" edge to the Info entity by IDs.
func (*UserUpdate) AddPetIDs ¶
func (uu *UserUpdate) AddPetIDs(ids ...int) *UserUpdate
AddPetIDs adds the "pets" edge to the Pet entity by IDs.
func (*UserUpdate) AddPets ¶
func (uu *UserUpdate) AddPets(p ...*Pet) *UserUpdate
AddPets adds the "pets" edges to the Pet entity.
func (*UserUpdate) AddRentalIDs ¶
func (uu *UserUpdate) AddRentalIDs(ids ...int) *UserUpdate
AddRentalIDs adds the "rentals" edge to the Rental entity by IDs.
func (*UserUpdate) AddRentals ¶
func (uu *UserUpdate) AddRentals(r ...*Rental) *UserUpdate
AddRentals adds the "rentals" edges to the Rental entity.
func (*UserUpdate) ClearCard ¶
func (uu *UserUpdate) ClearCard() *UserUpdate
ClearCard clears the "card" edge to the Card entity.
func (*UserUpdate) ClearChildren ¶
func (uu *UserUpdate) ClearChildren() *UserUpdate
ClearChildren clears all "children" edges to the User entity.
func (*UserUpdate) ClearInfo ¶
func (uu *UserUpdate) ClearInfo() *UserUpdate
ClearInfo clears all "info" edges to the Info entity.
func (*UserUpdate) ClearMetadata ¶
func (uu *UserUpdate) ClearMetadata() *UserUpdate
ClearMetadata clears the "metadata" edge to the Metadata entity.
func (*UserUpdate) ClearParent ¶
func (uu *UserUpdate) ClearParent() *UserUpdate
ClearParent clears the "parent" edge to the User entity.
func (*UserUpdate) ClearParentID ¶
func (uu *UserUpdate) ClearParentID() *UserUpdate
ClearParentID clears the value of the "parent_id" field.
func (*UserUpdate) ClearPets ¶
func (uu *UserUpdate) ClearPets() *UserUpdate
ClearPets clears all "pets" edges to the Pet entity.
func (*UserUpdate) ClearRentals ¶
func (uu *UserUpdate) ClearRentals() *UserUpdate
ClearRentals clears all "rentals" edges to the Rental entity.
func (*UserUpdate) ClearSpouse ¶
func (uu *UserUpdate) ClearSpouse() *UserUpdate
ClearSpouse clears the "spouse" edge to the User entity.
func (*UserUpdate) ClearSpouseID ¶
func (uu *UserUpdate) ClearSpouseID() *UserUpdate
ClearSpouseID clears the value of the "spouse_id" field.
func (*UserUpdate) Exec ¶
func (uu *UserUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpdate) ExecX ¶
func (uu *UserUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdate) Mutation ¶
func (uu *UserUpdate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdate) RemoveChildIDs ¶
func (uu *UserUpdate) RemoveChildIDs(ids ...int) *UserUpdate
RemoveChildIDs removes the "children" edge to User entities by IDs.
func (*UserUpdate) RemoveChildren ¶
func (uu *UserUpdate) RemoveChildren(u ...*User) *UserUpdate
RemoveChildren removes "children" edges to User entities.
func (*UserUpdate) RemoveInfo ¶
func (uu *UserUpdate) RemoveInfo(i ...*Info) *UserUpdate
RemoveInfo removes "info" edges to Info entities.
func (*UserUpdate) RemoveInfoIDs ¶
func (uu *UserUpdate) RemoveInfoIDs(ids ...int) *UserUpdate
RemoveInfoIDs removes the "info" edge to Info entities by IDs.
func (*UserUpdate) RemovePetIDs ¶
func (uu *UserUpdate) RemovePetIDs(ids ...int) *UserUpdate
RemovePetIDs removes the "pets" edge to Pet entities by IDs.
func (*UserUpdate) RemovePets ¶
func (uu *UserUpdate) RemovePets(p ...*Pet) *UserUpdate
RemovePets removes "pets" edges to Pet entities.
func (*UserUpdate) RemoveRentalIDs ¶
func (uu *UserUpdate) RemoveRentalIDs(ids ...int) *UserUpdate
RemoveRentalIDs removes the "rentals" edge to Rental entities by IDs.
func (*UserUpdate) RemoveRentals ¶
func (uu *UserUpdate) RemoveRentals(r ...*Rental) *UserUpdate
RemoveRentals removes "rentals" edges to Rental entities.
func (*UserUpdate) Save ¶
func (uu *UserUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserUpdate) SaveX ¶
func (uu *UserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserUpdate) SetCard ¶
func (uu *UserUpdate) SetCard(c *Card) *UserUpdate
SetCard sets the "card" edge to the Card entity.
func (*UserUpdate) SetCardID ¶
func (uu *UserUpdate) SetCardID(id int) *UserUpdate
SetCardID sets the "card" edge to the Card entity by ID.
func (*UserUpdate) SetMetadata ¶
func (uu *UserUpdate) SetMetadata(m *Metadata) *UserUpdate
SetMetadata sets the "metadata" edge to the Metadata entity.
func (*UserUpdate) SetMetadataID ¶
func (uu *UserUpdate) SetMetadataID(id int) *UserUpdate
SetMetadataID sets the "metadata" edge to the Metadata entity by ID.
func (*UserUpdate) SetNillableCardID ¶
func (uu *UserUpdate) SetNillableCardID(id *int) *UserUpdate
SetNillableCardID sets the "card" edge to the Card entity by ID if the given value is not nil.
func (*UserUpdate) SetNillableMetadataID ¶
func (uu *UserUpdate) SetNillableMetadataID(id *int) *UserUpdate
SetNillableMetadataID sets the "metadata" edge to the Metadata entity by ID if the given value is not nil.
func (*UserUpdate) SetNillableParentID ¶
func (uu *UserUpdate) SetNillableParentID(i *int) *UserUpdate
SetNillableParentID sets the "parent_id" field if the given value is not nil.
func (*UserUpdate) SetNillableSpouseID ¶
func (uu *UserUpdate) SetNillableSpouseID(i *int) *UserUpdate
SetNillableSpouseID sets the "spouse_id" field if the given value is not nil.
func (*UserUpdate) SetParent ¶
func (uu *UserUpdate) SetParent(u *User) *UserUpdate
SetParent sets the "parent" edge to the User entity.
func (*UserUpdate) SetParentID ¶
func (uu *UserUpdate) SetParentID(i int) *UserUpdate
SetParentID sets the "parent_id" field.
func (*UserUpdate) SetSpouse ¶
func (uu *UserUpdate) SetSpouse(u *User) *UserUpdate
SetSpouse sets the "spouse" edge to the User entity.
func (*UserUpdate) SetSpouseID ¶
func (uu *UserUpdate) SetSpouseID(i int) *UserUpdate
SetSpouseID sets the "spouse_id" field.
func (*UserUpdate) Where ¶
func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
Where appends a list predicates to the UserUpdate builder.
type UserUpdateOne ¶
type UserUpdateOne struct {
// contains filtered or unexported fields
}
UserUpdateOne is the builder for updating a single User entity.
func (*UserUpdateOne) AddChildIDs ¶
func (uuo *UserUpdateOne) AddChildIDs(ids ...int) *UserUpdateOne
AddChildIDs adds the "children" edge to the User entity by IDs.
func (*UserUpdateOne) AddChildren ¶
func (uuo *UserUpdateOne) AddChildren(u ...*User) *UserUpdateOne
AddChildren adds the "children" edges to the User entity.
func (*UserUpdateOne) AddInfo ¶
func (uuo *UserUpdateOne) AddInfo(i ...*Info) *UserUpdateOne
AddInfo adds the "info" edges to the Info entity.
func (*UserUpdateOne) AddInfoIDs ¶
func (uuo *UserUpdateOne) AddInfoIDs(ids ...int) *UserUpdateOne
AddInfoIDs adds the "info" edge to the Info entity by IDs.
func (*UserUpdateOne) AddPetIDs ¶
func (uuo *UserUpdateOne) AddPetIDs(ids ...int) *UserUpdateOne
AddPetIDs adds the "pets" edge to the Pet entity by IDs.
func (*UserUpdateOne) AddPets ¶
func (uuo *UserUpdateOne) AddPets(p ...*Pet) *UserUpdateOne
AddPets adds the "pets" edges to the Pet entity.
func (*UserUpdateOne) AddRentalIDs ¶
func (uuo *UserUpdateOne) AddRentalIDs(ids ...int) *UserUpdateOne
AddRentalIDs adds the "rentals" edge to the Rental entity by IDs.
func (*UserUpdateOne) AddRentals ¶
func (uuo *UserUpdateOne) AddRentals(r ...*Rental) *UserUpdateOne
AddRentals adds the "rentals" edges to the Rental entity.
func (*UserUpdateOne) ClearCard ¶
func (uuo *UserUpdateOne) ClearCard() *UserUpdateOne
ClearCard clears the "card" edge to the Card entity.
func (*UserUpdateOne) ClearChildren ¶
func (uuo *UserUpdateOne) ClearChildren() *UserUpdateOne
ClearChildren clears all "children" edges to the User entity.
func (*UserUpdateOne) ClearInfo ¶
func (uuo *UserUpdateOne) ClearInfo() *UserUpdateOne
ClearInfo clears all "info" edges to the Info entity.
func (*UserUpdateOne) ClearMetadata ¶
func (uuo *UserUpdateOne) ClearMetadata() *UserUpdateOne
ClearMetadata clears the "metadata" edge to the Metadata entity.
func (*UserUpdateOne) ClearParent ¶
func (uuo *UserUpdateOne) ClearParent() *UserUpdateOne
ClearParent clears the "parent" edge to the User entity.
func (*UserUpdateOne) ClearParentID ¶
func (uuo *UserUpdateOne) ClearParentID() *UserUpdateOne
ClearParentID clears the value of the "parent_id" field.
func (*UserUpdateOne) ClearPets ¶
func (uuo *UserUpdateOne) ClearPets() *UserUpdateOne
ClearPets clears all "pets" edges to the Pet entity.
func (*UserUpdateOne) ClearRentals ¶
func (uuo *UserUpdateOne) ClearRentals() *UserUpdateOne
ClearRentals clears all "rentals" edges to the Rental entity.
func (*UserUpdateOne) ClearSpouse ¶
func (uuo *UserUpdateOne) ClearSpouse() *UserUpdateOne
ClearSpouse clears the "spouse" edge to the User entity.
func (*UserUpdateOne) ClearSpouseID ¶
func (uuo *UserUpdateOne) ClearSpouseID() *UserUpdateOne
ClearSpouseID clears the value of the "spouse_id" field.
func (*UserUpdateOne) Exec ¶
func (uuo *UserUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserUpdateOne) ExecX ¶
func (uuo *UserUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdateOne) Mutation ¶
func (uuo *UserUpdateOne) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdateOne) RemoveChildIDs ¶
func (uuo *UserUpdateOne) RemoveChildIDs(ids ...int) *UserUpdateOne
RemoveChildIDs removes the "children" edge to User entities by IDs.
func (*UserUpdateOne) RemoveChildren ¶
func (uuo *UserUpdateOne) RemoveChildren(u ...*User) *UserUpdateOne
RemoveChildren removes "children" edges to User entities.
func (*UserUpdateOne) RemoveInfo ¶
func (uuo *UserUpdateOne) RemoveInfo(i ...*Info) *UserUpdateOne
RemoveInfo removes "info" edges to Info entities.
func (*UserUpdateOne) RemoveInfoIDs ¶
func (uuo *UserUpdateOne) RemoveInfoIDs(ids ...int) *UserUpdateOne
RemoveInfoIDs removes the "info" edge to Info entities by IDs.
func (*UserUpdateOne) RemovePetIDs ¶
func (uuo *UserUpdateOne) RemovePetIDs(ids ...int) *UserUpdateOne
RemovePetIDs removes the "pets" edge to Pet entities by IDs.
func (*UserUpdateOne) RemovePets ¶
func (uuo *UserUpdateOne) RemovePets(p ...*Pet) *UserUpdateOne
RemovePets removes "pets" edges to Pet entities.
func (*UserUpdateOne) RemoveRentalIDs ¶
func (uuo *UserUpdateOne) RemoveRentalIDs(ids ...int) *UserUpdateOne
RemoveRentalIDs removes the "rentals" edge to Rental entities by IDs.
func (*UserUpdateOne) RemoveRentals ¶
func (uuo *UserUpdateOne) RemoveRentals(r ...*Rental) *UserUpdateOne
RemoveRentals removes "rentals" edges to Rental entities.
func (*UserUpdateOne) Save ¶
func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
Save executes the query and returns the updated User entity.
func (*UserUpdateOne) SaveX ¶
func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
SaveX is like Save, but panics if an error occurs.
func (*UserUpdateOne) Select ¶
func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserUpdateOne) SetCard ¶
func (uuo *UserUpdateOne) SetCard(c *Card) *UserUpdateOne
SetCard sets the "card" edge to the Card entity.
func (*UserUpdateOne) SetCardID ¶
func (uuo *UserUpdateOne) SetCardID(id int) *UserUpdateOne
SetCardID sets the "card" edge to the Card entity by ID.
func (*UserUpdateOne) SetMetadata ¶
func (uuo *UserUpdateOne) SetMetadata(m *Metadata) *UserUpdateOne
SetMetadata sets the "metadata" edge to the Metadata entity.
func (*UserUpdateOne) SetMetadataID ¶
func (uuo *UserUpdateOne) SetMetadataID(id int) *UserUpdateOne
SetMetadataID sets the "metadata" edge to the Metadata entity by ID.
func (*UserUpdateOne) SetNillableCardID ¶
func (uuo *UserUpdateOne) SetNillableCardID(id *int) *UserUpdateOne
SetNillableCardID sets the "card" edge to the Card entity by ID if the given value is not nil.
func (*UserUpdateOne) SetNillableMetadataID ¶
func (uuo *UserUpdateOne) SetNillableMetadataID(id *int) *UserUpdateOne
SetNillableMetadataID sets the "metadata" edge to the Metadata entity by ID if the given value is not nil.
func (*UserUpdateOne) SetNillableParentID ¶
func (uuo *UserUpdateOne) SetNillableParentID(i *int) *UserUpdateOne
SetNillableParentID sets the "parent_id" field if the given value is not nil.
func (*UserUpdateOne) SetNillableSpouseID ¶
func (uuo *UserUpdateOne) SetNillableSpouseID(i *int) *UserUpdateOne
SetNillableSpouseID sets the "spouse_id" field if the given value is not nil.
func (*UserUpdateOne) SetParent ¶
func (uuo *UserUpdateOne) SetParent(u *User) *UserUpdateOne
SetParent sets the "parent" edge to the User entity.
func (*UserUpdateOne) SetParentID ¶
func (uuo *UserUpdateOne) SetParentID(i int) *UserUpdateOne
SetParentID sets the "parent_id" field.
func (*UserUpdateOne) SetSpouse ¶
func (uuo *UserUpdateOne) SetSpouse(u *User) *UserUpdateOne
SetSpouse sets the "spouse" edge to the User entity.
func (*UserUpdateOne) SetSpouseID ¶
func (uuo *UserUpdateOne) SetSpouseID(i int) *UserUpdateOne
SetSpouseID sets the "spouse_id" field.
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 ¶
- car.go
- car_create.go
- car_delete.go
- car_query.go
- car_update.go
- card.go
- card_create.go
- card_delete.go
- card_query.go
- card_update.go
- client.go
- config.go
- context.go
- ent.go
- generate.go
- info.go
- info_create.go
- info_delete.go
- info_query.go
- info_update.go
- metadata.go
- metadata_create.go
- metadata_delete.go
- metadata_query.go
- metadata_update.go
- mutation.go
- node.go
- node_create.go
- node_delete.go
- node_query.go
- node_update.go
- pet.go
- pet_create.go
- pet_delete.go
- pet_query.go
- pet_update.go
- post.go
- post_create.go
- post_delete.go
- post_query.go
- post_update.go
- rental.go
- rental_create.go
- rental_delete.go
- rental_query.go
- rental_update.go
- runtime.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go