Documentation ¶
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type TestA
- type TestAClient
- func (c *TestAClient) Create() *TestACreate
- func (c *TestAClient) CreateBulk(builders ...*TestACreate) *TestACreateBulk
- func (c *TestAClient) Delete() *TestADelete
- func (c *TestAClient) DeleteOne(t *TestA) *TestADeleteOne
- func (c *TestAClient) DeleteOneID(id int) *TestADeleteOne
- func (c *TestAClient) Get(ctx context.Context, id int) (*TestA, error)
- func (c *TestAClient) GetX(ctx context.Context, id int) *TestA
- func (c *TestAClient) Hooks() []Hook
- func (c *TestAClient) Intercept(interceptors ...Interceptor)
- func (c *TestAClient) Interceptors() []Interceptor
- func (c *TestAClient) MapCreateBulk(slice any, setFunc func(*TestACreate, int)) *TestACreateBulk
- func (c *TestAClient) Query() *TestAQuery
- func (c *TestAClient) QueryTestBs(t *TestA) *TestBQuery
- func (c *TestAClient) Update() *TestAUpdate
- func (c *TestAClient) UpdateOne(t *TestA) *TestAUpdateOne
- func (c *TestAClient) UpdateOneID(id int) *TestAUpdateOne
- func (c *TestAClient) Use(hooks ...Hook)
- type TestACreate
- func (ta *TestACreate) AddTestBIDs(ids ...int) *TestACreate
- func (ta *TestACreate) AddTestBs(t ...*TestB) *TestACreate
- func (ta *TestACreate) Exec(ctx context.Context) error
- func (ta *TestACreate) ExecX(ctx context.Context)
- func (ta *TestACreate) Mutation() *TestAMutation
- func (ta *TestACreate) Save(ctx context.Context) (*TestA, error)
- func (ta *TestACreate) SaveX(ctx context.Context) *TestA
- func (ta *TestACreate) SetBool(b bool) *TestACreate
- func (ta *TestACreate) SetFloat4(f float32) *TestACreate
- func (ta *TestACreate) SetFloat8(f float64) *TestACreate
- func (ta *TestACreate) SetID(i int) *TestACreate
- func (ta *TestACreate) SetInt4(i int32) *TestACreate
- func (ta *TestACreate) SetInt8(i int) *TestACreate
- func (ta *TestACreate) SetName(s string) *TestACreate
- func (ta *TestACreate) SetText(s string) *TestACreate
- func (ta *TestACreate) SetTime(t time.Time) *TestACreate
- type TestACreateBulk
- type TestADelete
- type TestADeleteOne
- type TestAEdges
- type TestAGroupBy
- func (tab *TestAGroupBy) Aggregate(fns ...AggregateFunc) *TestAGroupBy
- func (s *TestAGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *TestAGroupBy) BoolX(ctx context.Context) bool
- func (s *TestAGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *TestAGroupBy) BoolsX(ctx context.Context) []bool
- func (s *TestAGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *TestAGroupBy) Float64X(ctx context.Context) float64
- func (s *TestAGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *TestAGroupBy) Float64sX(ctx context.Context) []float64
- func (s *TestAGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *TestAGroupBy) IntX(ctx context.Context) int
- func (s *TestAGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *TestAGroupBy) IntsX(ctx context.Context) []int
- func (tab *TestAGroupBy) Scan(ctx context.Context, v any) error
- func (s *TestAGroupBy) ScanX(ctx context.Context, v any)
- func (s *TestAGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *TestAGroupBy) StringX(ctx context.Context) string
- func (s *TestAGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *TestAGroupBy) StringsX(ctx context.Context) []string
- type TestAMutation
- func (m *TestAMutation) AddField(name string, value ent.Value) error
- func (m *TestAMutation) AddFloat4(f float32)
- func (m *TestAMutation) AddFloat8(f float64)
- func (m *TestAMutation) AddInt4(i int32)
- func (m *TestAMutation) AddInt8(i int)
- func (m *TestAMutation) AddTestBIDs(ids ...int)
- func (m *TestAMutation) AddedEdges() []string
- func (m *TestAMutation) AddedField(name string) (ent.Value, bool)
- func (m *TestAMutation) AddedFields() []string
- func (m *TestAMutation) AddedFloat4() (r float32, exists bool)
- func (m *TestAMutation) AddedFloat8() (r float64, exists bool)
- func (m *TestAMutation) AddedIDs(name string) []ent.Value
- func (m *TestAMutation) AddedInt4() (r int32, exists bool)
- func (m *TestAMutation) AddedInt8() (r int, exists bool)
- func (m *TestAMutation) Bool() (r bool, exists bool)
- func (m *TestAMutation) ClearEdge(name string) error
- func (m *TestAMutation) ClearField(name string) error
- func (m *TestAMutation) ClearTestBs()
- func (m *TestAMutation) ClearedEdges() []string
- func (m *TestAMutation) ClearedFields() []string
- func (m TestAMutation) Client() *Client
- func (m *TestAMutation) EdgeCleared(name string) bool
- func (m *TestAMutation) Field(name string) (ent.Value, bool)
- func (m *TestAMutation) FieldCleared(name string) bool
- func (m *TestAMutation) Fields() []string
- func (m *TestAMutation) Float4() (r float32, exists bool)
- func (m *TestAMutation) Float8() (r float64, exists bool)
- func (m *TestAMutation) ID() (id int, exists bool)
- func (m *TestAMutation) IDs(ctx context.Context) ([]int, error)
- func (m *TestAMutation) Int4() (r int32, exists bool)
- func (m *TestAMutation) Int8() (r int, exists bool)
- func (m *TestAMutation) Name() (r string, exists bool)
- func (m *TestAMutation) OldBool(ctx context.Context) (v bool, err error)
- func (m *TestAMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TestAMutation) OldFloat4(ctx context.Context) (v float32, err error)
- func (m *TestAMutation) OldFloat8(ctx context.Context) (v float64, err error)
- func (m *TestAMutation) OldInt4(ctx context.Context) (v int32, err error)
- func (m *TestAMutation) OldInt8(ctx context.Context) (v int, err error)
- func (m *TestAMutation) OldName(ctx context.Context) (v string, err error)
- func (m *TestAMutation) OldText(ctx context.Context) (v string, err error)
- func (m *TestAMutation) OldTime(ctx context.Context) (v time.Time, err error)
- func (m *TestAMutation) Op() Op
- func (m *TestAMutation) RemoveTestBIDs(ids ...int)
- func (m *TestAMutation) RemovedEdges() []string
- func (m *TestAMutation) RemovedIDs(name string) []ent.Value
- func (m *TestAMutation) RemovedTestBsIDs() (ids []int)
- func (m *TestAMutation) ResetBool()
- func (m *TestAMutation) ResetEdge(name string) error
- func (m *TestAMutation) ResetField(name string) error
- func (m *TestAMutation) ResetFloat4()
- func (m *TestAMutation) ResetFloat8()
- func (m *TestAMutation) ResetInt4()
- func (m *TestAMutation) ResetInt8()
- func (m *TestAMutation) ResetName()
- func (m *TestAMutation) ResetTestBs()
- func (m *TestAMutation) ResetText()
- func (m *TestAMutation) ResetTime()
- func (m *TestAMutation) SetBool(b bool)
- func (m *TestAMutation) SetField(name string, value ent.Value) error
- func (m *TestAMutation) SetFloat4(f float32)
- func (m *TestAMutation) SetFloat8(f float64)
- func (m *TestAMutation) SetID(id int)
- func (m *TestAMutation) SetInt4(i int32)
- func (m *TestAMutation) SetInt8(i int)
- func (m *TestAMutation) SetName(s string)
- func (m *TestAMutation) SetOp(op Op)
- func (m *TestAMutation) SetText(s string)
- func (m *TestAMutation) SetTime(t time.Time)
- func (m *TestAMutation) TestBsCleared() bool
- func (m *TestAMutation) TestBsIDs() (ids []int)
- func (m *TestAMutation) Text() (r string, exists bool)
- func (m *TestAMutation) Time() (r time.Time, exists bool)
- func (m TestAMutation) Tx() (*Tx, error)
- func (m *TestAMutation) Type() string
- func (m *TestAMutation) Where(ps ...predicate.TestA)
- func (m *TestAMutation) WhereP(ps ...func(*sql.Selector))
- type TestAQuery
- func (ta *TestAQuery) Aggregate(fns ...AggregateFunc) *TestASelect
- func (ta *TestAQuery) All(ctx context.Context) ([]*TestA, error)
- func (ta *TestAQuery) AllX(ctx context.Context) []*TestA
- func (ta *TestAQuery) Clone() *TestAQuery
- func (ta *TestAQuery) Count(ctx context.Context) (int, error)
- func (ta *TestAQuery) CountX(ctx context.Context) int
- func (ta *TestAQuery) Exist(ctx context.Context) (bool, error)
- func (ta *TestAQuery) ExistX(ctx context.Context) bool
- func (ta *TestAQuery) First(ctx context.Context) (*TestA, error)
- func (ta *TestAQuery) FirstID(ctx context.Context) (id int, err error)
- func (ta *TestAQuery) FirstIDX(ctx context.Context) int
- func (ta *TestAQuery) FirstX(ctx context.Context) *TestA
- func (ta *TestAQuery) GroupBy(field string, fields ...string) *TestAGroupBy
- func (ta *TestAQuery) IDs(ctx context.Context) (ids []int, err error)
- func (ta *TestAQuery) IDsX(ctx context.Context) []int
- func (ta *TestAQuery) Limit(limit int) *TestAQuery
- func (ta *TestAQuery) Offset(offset int) *TestAQuery
- func (ta *TestAQuery) Only(ctx context.Context) (*TestA, error)
- func (ta *TestAQuery) OnlyID(ctx context.Context) (id int, err error)
- func (ta *TestAQuery) OnlyIDX(ctx context.Context) int
- func (ta *TestAQuery) OnlyX(ctx context.Context) *TestA
- func (ta *TestAQuery) Order(o ...testa.OrderOption) *TestAQuery
- func (ta *TestAQuery) QueryTestBs() *TestBQuery
- func (ta *TestAQuery) Select(fields ...string) *TestASelect
- func (ta *TestAQuery) Unique(unique bool) *TestAQuery
- func (ta *TestAQuery) Where(ps ...predicate.TestA) *TestAQuery
- func (ta *TestAQuery) WithTestBs(opts ...func(*TestBQuery)) *TestAQuery
- type TestASelect
- func (ta *TestASelect) Aggregate(fns ...AggregateFunc) *TestASelect
- func (s *TestASelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *TestASelect) BoolX(ctx context.Context) bool
- func (s *TestASelect) Bools(ctx context.Context) ([]bool, error)
- func (s *TestASelect) BoolsX(ctx context.Context) []bool
- func (s *TestASelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *TestASelect) Float64X(ctx context.Context) float64
- func (s *TestASelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *TestASelect) Float64sX(ctx context.Context) []float64
- func (s *TestASelect) Int(ctx context.Context) (_ int, err error)
- func (s *TestASelect) IntX(ctx context.Context) int
- func (s *TestASelect) Ints(ctx context.Context) ([]int, error)
- func (s *TestASelect) IntsX(ctx context.Context) []int
- func (ta *TestASelect) Scan(ctx context.Context, v any) error
- func (s *TestASelect) ScanX(ctx context.Context, v any)
- func (s *TestASelect) String(ctx context.Context) (_ string, err error)
- func (s *TestASelect) StringX(ctx context.Context) string
- func (s *TestASelect) Strings(ctx context.Context) ([]string, error)
- func (s *TestASelect) StringsX(ctx context.Context) []string
- type TestAUpdate
- func (ta *TestAUpdate) AddFloat4(f float32) *TestAUpdate
- func (ta *TestAUpdate) AddFloat8(f float64) *TestAUpdate
- func (ta *TestAUpdate) AddInt4(i int32) *TestAUpdate
- func (ta *TestAUpdate) AddInt8(i int) *TestAUpdate
- func (ta *TestAUpdate) AddTestBIDs(ids ...int) *TestAUpdate
- func (ta *TestAUpdate) AddTestBs(t ...*TestB) *TestAUpdate
- func (ta *TestAUpdate) ClearTestBs() *TestAUpdate
- func (ta *TestAUpdate) Exec(ctx context.Context) error
- func (ta *TestAUpdate) ExecX(ctx context.Context)
- func (ta *TestAUpdate) Mutation() *TestAMutation
- func (ta *TestAUpdate) RemoveTestBIDs(ids ...int) *TestAUpdate
- func (ta *TestAUpdate) RemoveTestBs(t ...*TestB) *TestAUpdate
- func (ta *TestAUpdate) Save(ctx context.Context) (int, error)
- func (ta *TestAUpdate) SaveX(ctx context.Context) int
- func (ta *TestAUpdate) SetBool(b bool) *TestAUpdate
- func (ta *TestAUpdate) SetFloat4(f float32) *TestAUpdate
- func (ta *TestAUpdate) SetFloat8(f float64) *TestAUpdate
- func (ta *TestAUpdate) SetInt4(i int32) *TestAUpdate
- func (ta *TestAUpdate) SetInt8(i int) *TestAUpdate
- func (ta *TestAUpdate) SetName(s string) *TestAUpdate
- func (ta *TestAUpdate) SetNillableBool(b *bool) *TestAUpdate
- func (ta *TestAUpdate) SetNillableFloat4(f *float32) *TestAUpdate
- func (ta *TestAUpdate) SetNillableFloat8(f *float64) *TestAUpdate
- func (ta *TestAUpdate) SetNillableInt4(i *int32) *TestAUpdate
- func (ta *TestAUpdate) SetNillableInt8(i *int) *TestAUpdate
- func (ta *TestAUpdate) SetNillableName(s *string) *TestAUpdate
- func (ta *TestAUpdate) SetNillableText(s *string) *TestAUpdate
- func (ta *TestAUpdate) SetNillableTime(t *time.Time) *TestAUpdate
- func (ta *TestAUpdate) SetText(s string) *TestAUpdate
- func (ta *TestAUpdate) SetTime(t time.Time) *TestAUpdate
- func (ta *TestAUpdate) Where(ps ...predicate.TestA) *TestAUpdate
- type TestAUpdateOne
- func (tao *TestAUpdateOne) AddFloat4(f float32) *TestAUpdateOne
- func (tao *TestAUpdateOne) AddFloat8(f float64) *TestAUpdateOne
- func (tao *TestAUpdateOne) AddInt4(i int32) *TestAUpdateOne
- func (tao *TestAUpdateOne) AddInt8(i int) *TestAUpdateOne
- func (tao *TestAUpdateOne) AddTestBIDs(ids ...int) *TestAUpdateOne
- func (tao *TestAUpdateOne) AddTestBs(t ...*TestB) *TestAUpdateOne
- func (tao *TestAUpdateOne) ClearTestBs() *TestAUpdateOne
- func (tao *TestAUpdateOne) Exec(ctx context.Context) error
- func (tao *TestAUpdateOne) ExecX(ctx context.Context)
- func (tao *TestAUpdateOne) Mutation() *TestAMutation
- func (tao *TestAUpdateOne) RemoveTestBIDs(ids ...int) *TestAUpdateOne
- func (tao *TestAUpdateOne) RemoveTestBs(t ...*TestB) *TestAUpdateOne
- func (tao *TestAUpdateOne) Save(ctx context.Context) (*TestA, error)
- func (tao *TestAUpdateOne) SaveX(ctx context.Context) *TestA
- func (tao *TestAUpdateOne) Select(field string, fields ...string) *TestAUpdateOne
- func (tao *TestAUpdateOne) SetBool(b bool) *TestAUpdateOne
- func (tao *TestAUpdateOne) SetFloat4(f float32) *TestAUpdateOne
- func (tao *TestAUpdateOne) SetFloat8(f float64) *TestAUpdateOne
- func (tao *TestAUpdateOne) SetInt4(i int32) *TestAUpdateOne
- func (tao *TestAUpdateOne) SetInt8(i int) *TestAUpdateOne
- func (tao *TestAUpdateOne) SetName(s string) *TestAUpdateOne
- func (tao *TestAUpdateOne) SetNillableBool(b *bool) *TestAUpdateOne
- func (tao *TestAUpdateOne) SetNillableFloat4(f *float32) *TestAUpdateOne
- func (tao *TestAUpdateOne) SetNillableFloat8(f *float64) *TestAUpdateOne
- func (tao *TestAUpdateOne) SetNillableInt4(i *int32) *TestAUpdateOne
- func (tao *TestAUpdateOne) SetNillableInt8(i *int) *TestAUpdateOne
- func (tao *TestAUpdateOne) SetNillableName(s *string) *TestAUpdateOne
- func (tao *TestAUpdateOne) SetNillableText(s *string) *TestAUpdateOne
- func (tao *TestAUpdateOne) SetNillableTime(t *time.Time) *TestAUpdateOne
- func (tao *TestAUpdateOne) SetText(s string) *TestAUpdateOne
- func (tao *TestAUpdateOne) SetTime(t time.Time) *TestAUpdateOne
- func (tao *TestAUpdateOne) Where(ps ...predicate.TestA) *TestAUpdateOne
- type TestAs
- type TestB
- type TestBClient
- func (c *TestBClient) Create() *TestBCreate
- func (c *TestBClient) CreateBulk(builders ...*TestBCreate) *TestBCreateBulk
- func (c *TestBClient) Delete() *TestBDelete
- func (c *TestBClient) DeleteOne(t *TestB) *TestBDeleteOne
- func (c *TestBClient) DeleteOneID(id int) *TestBDeleteOne
- func (c *TestBClient) Get(ctx context.Context, id int) (*TestB, error)
- func (c *TestBClient) GetX(ctx context.Context, id int) *TestB
- func (c *TestBClient) Hooks() []Hook
- func (c *TestBClient) Intercept(interceptors ...Interceptor)
- func (c *TestBClient) Interceptors() []Interceptor
- func (c *TestBClient) MapCreateBulk(slice any, setFunc func(*TestBCreate, int)) *TestBCreateBulk
- func (c *TestBClient) Query() *TestBQuery
- func (c *TestBClient) QueryTestA(t *TestB) *TestAQuery
- func (c *TestBClient) QueryTestCs(t *TestB) *TestCQuery
- func (c *TestBClient) Update() *TestBUpdate
- func (c *TestBClient) UpdateOne(t *TestB) *TestBUpdateOne
- func (c *TestBClient) UpdateOneID(id int) *TestBUpdateOne
- func (c *TestBClient) Use(hooks ...Hook)
- type TestBCreate
- func (tb *TestBCreate) AddTestCIDs(ids ...int) *TestBCreate
- func (tb *TestBCreate) AddTestCs(t ...*TestC) *TestBCreate
- func (tb *TestBCreate) Exec(ctx context.Context) error
- func (tb *TestBCreate) ExecX(ctx context.Context)
- func (tb *TestBCreate) Mutation() *TestBMutation
- func (tb *TestBCreate) Save(ctx context.Context) (*TestB, error)
- func (tb *TestBCreate) SaveX(ctx context.Context) *TestB
- func (tb *TestBCreate) SetAID(i int) *TestBCreate
- func (tb *TestBCreate) SetBool(b bool) *TestBCreate
- func (tb *TestBCreate) SetFloat4(f float32) *TestBCreate
- func (tb *TestBCreate) SetFloat8(f float64) *TestBCreate
- func (tb *TestBCreate) SetID(i int) *TestBCreate
- func (tb *TestBCreate) SetInt4(i int32) *TestBCreate
- func (tb *TestBCreate) SetInt8(i int) *TestBCreate
- func (tb *TestBCreate) SetName(s string) *TestBCreate
- func (tb *TestBCreate) SetNillableAID(i *int) *TestBCreate
- func (tb *TestBCreate) SetNillableTestAID(id *int) *TestBCreate
- func (tb *TestBCreate) SetTestA(t *TestA) *TestBCreate
- func (tb *TestBCreate) SetTestAID(id int) *TestBCreate
- func (tb *TestBCreate) SetText(s string) *TestBCreate
- func (tb *TestBCreate) SetTime(t time.Time) *TestBCreate
- type TestBCreateBulk
- type TestBDelete
- type TestBDeleteOne
- type TestBEdges
- type TestBGroupBy
- func (tbb *TestBGroupBy) Aggregate(fns ...AggregateFunc) *TestBGroupBy
- func (s *TestBGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *TestBGroupBy) BoolX(ctx context.Context) bool
- func (s *TestBGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *TestBGroupBy) BoolsX(ctx context.Context) []bool
- func (s *TestBGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *TestBGroupBy) Float64X(ctx context.Context) float64
- func (s *TestBGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *TestBGroupBy) Float64sX(ctx context.Context) []float64
- func (s *TestBGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *TestBGroupBy) IntX(ctx context.Context) int
- func (s *TestBGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *TestBGroupBy) IntsX(ctx context.Context) []int
- func (tbb *TestBGroupBy) Scan(ctx context.Context, v any) error
- func (s *TestBGroupBy) ScanX(ctx context.Context, v any)
- func (s *TestBGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *TestBGroupBy) StringX(ctx context.Context) string
- func (s *TestBGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *TestBGroupBy) StringsX(ctx context.Context) []string
- type TestBMutation
- func (m *TestBMutation) AID() (r int, exists bool)
- func (m *TestBMutation) AIDCleared() bool
- func (m *TestBMutation) AddField(name string, value ent.Value) error
- func (m *TestBMutation) AddFloat4(f float32)
- func (m *TestBMutation) AddFloat8(f float64)
- func (m *TestBMutation) AddInt4(i int32)
- func (m *TestBMutation) AddInt8(i int)
- func (m *TestBMutation) AddTestCIDs(ids ...int)
- func (m *TestBMutation) AddedEdges() []string
- func (m *TestBMutation) AddedField(name string) (ent.Value, bool)
- func (m *TestBMutation) AddedFields() []string
- func (m *TestBMutation) AddedFloat4() (r float32, exists bool)
- func (m *TestBMutation) AddedFloat8() (r float64, exists bool)
- func (m *TestBMutation) AddedIDs(name string) []ent.Value
- func (m *TestBMutation) AddedInt4() (r int32, exists bool)
- func (m *TestBMutation) AddedInt8() (r int, exists bool)
- func (m *TestBMutation) Bool() (r bool, exists bool)
- func (m *TestBMutation) ClearAID()
- func (m *TestBMutation) ClearEdge(name string) error
- func (m *TestBMutation) ClearField(name string) error
- func (m *TestBMutation) ClearTestA()
- func (m *TestBMutation) ClearTestCs()
- func (m *TestBMutation) ClearedEdges() []string
- func (m *TestBMutation) ClearedFields() []string
- func (m TestBMutation) Client() *Client
- func (m *TestBMutation) EdgeCleared(name string) bool
- func (m *TestBMutation) Field(name string) (ent.Value, bool)
- func (m *TestBMutation) FieldCleared(name string) bool
- func (m *TestBMutation) Fields() []string
- func (m *TestBMutation) Float4() (r float32, exists bool)
- func (m *TestBMutation) Float8() (r float64, exists bool)
- func (m *TestBMutation) ID() (id int, exists bool)
- func (m *TestBMutation) IDs(ctx context.Context) ([]int, error)
- func (m *TestBMutation) Int4() (r int32, exists bool)
- func (m *TestBMutation) Int8() (r int, exists bool)
- func (m *TestBMutation) Name() (r string, exists bool)
- func (m *TestBMutation) OldAID(ctx context.Context) (v int, err error)
- func (m *TestBMutation) OldBool(ctx context.Context) (v bool, err error)
- func (m *TestBMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TestBMutation) OldFloat4(ctx context.Context) (v float32, err error)
- func (m *TestBMutation) OldFloat8(ctx context.Context) (v float64, err error)
- func (m *TestBMutation) OldInt4(ctx context.Context) (v int32, err error)
- func (m *TestBMutation) OldInt8(ctx context.Context) (v int, err error)
- func (m *TestBMutation) OldName(ctx context.Context) (v string, err error)
- func (m *TestBMutation) OldText(ctx context.Context) (v string, err error)
- func (m *TestBMutation) OldTime(ctx context.Context) (v time.Time, err error)
- func (m *TestBMutation) Op() Op
- func (m *TestBMutation) RemoveTestCIDs(ids ...int)
- func (m *TestBMutation) RemovedEdges() []string
- func (m *TestBMutation) RemovedIDs(name string) []ent.Value
- func (m *TestBMutation) RemovedTestCsIDs() (ids []int)
- func (m *TestBMutation) ResetAID()
- func (m *TestBMutation) ResetBool()
- func (m *TestBMutation) ResetEdge(name string) error
- func (m *TestBMutation) ResetField(name string) error
- func (m *TestBMutation) ResetFloat4()
- func (m *TestBMutation) ResetFloat8()
- func (m *TestBMutation) ResetInt4()
- func (m *TestBMutation) ResetInt8()
- func (m *TestBMutation) ResetName()
- func (m *TestBMutation) ResetTestA()
- func (m *TestBMutation) ResetTestCs()
- func (m *TestBMutation) ResetText()
- func (m *TestBMutation) ResetTime()
- func (m *TestBMutation) SetAID(i int)
- func (m *TestBMutation) SetBool(b bool)
- func (m *TestBMutation) SetField(name string, value ent.Value) error
- func (m *TestBMutation) SetFloat4(f float32)
- func (m *TestBMutation) SetFloat8(f float64)
- func (m *TestBMutation) SetID(id int)
- func (m *TestBMutation) SetInt4(i int32)
- func (m *TestBMutation) SetInt8(i int)
- func (m *TestBMutation) SetName(s string)
- func (m *TestBMutation) SetOp(op Op)
- func (m *TestBMutation) SetTestAID(id int)
- func (m *TestBMutation) SetText(s string)
- func (m *TestBMutation) SetTime(t time.Time)
- func (m *TestBMutation) TestACleared() bool
- func (m *TestBMutation) TestAID() (id int, exists bool)
- func (m *TestBMutation) TestAIDs() (ids []int)
- func (m *TestBMutation) TestCsCleared() bool
- func (m *TestBMutation) TestCsIDs() (ids []int)
- func (m *TestBMutation) Text() (r string, exists bool)
- func (m *TestBMutation) Time() (r time.Time, exists bool)
- func (m TestBMutation) Tx() (*Tx, error)
- func (m *TestBMutation) Type() string
- func (m *TestBMutation) Where(ps ...predicate.TestB)
- func (m *TestBMutation) WhereP(ps ...func(*sql.Selector))
- type TestBQuery
- func (tb *TestBQuery) Aggregate(fns ...AggregateFunc) *TestBSelect
- func (tb *TestBQuery) All(ctx context.Context) ([]*TestB, error)
- func (tb *TestBQuery) AllX(ctx context.Context) []*TestB
- func (tb *TestBQuery) Clone() *TestBQuery
- func (tb *TestBQuery) Count(ctx context.Context) (int, error)
- func (tb *TestBQuery) CountX(ctx context.Context) int
- func (tb *TestBQuery) Exist(ctx context.Context) (bool, error)
- func (tb *TestBQuery) ExistX(ctx context.Context) bool
- func (tb *TestBQuery) First(ctx context.Context) (*TestB, error)
- func (tb *TestBQuery) FirstID(ctx context.Context) (id int, err error)
- func (tb *TestBQuery) FirstIDX(ctx context.Context) int
- func (tb *TestBQuery) FirstX(ctx context.Context) *TestB
- func (tb *TestBQuery) GroupBy(field string, fields ...string) *TestBGroupBy
- func (tb *TestBQuery) IDs(ctx context.Context) (ids []int, err error)
- func (tb *TestBQuery) IDsX(ctx context.Context) []int
- func (tb *TestBQuery) Limit(limit int) *TestBQuery
- func (tb *TestBQuery) Offset(offset int) *TestBQuery
- func (tb *TestBQuery) Only(ctx context.Context) (*TestB, error)
- func (tb *TestBQuery) OnlyID(ctx context.Context) (id int, err error)
- func (tb *TestBQuery) OnlyIDX(ctx context.Context) int
- func (tb *TestBQuery) OnlyX(ctx context.Context) *TestB
- func (tb *TestBQuery) Order(o ...testb.OrderOption) *TestBQuery
- func (tb *TestBQuery) QueryTestA() *TestAQuery
- func (tb *TestBQuery) QueryTestCs() *TestCQuery
- func (tb *TestBQuery) Select(fields ...string) *TestBSelect
- func (tb *TestBQuery) Unique(unique bool) *TestBQuery
- func (tb *TestBQuery) Where(ps ...predicate.TestB) *TestBQuery
- func (tb *TestBQuery) WithTestA(opts ...func(*TestAQuery)) *TestBQuery
- func (tb *TestBQuery) WithTestCs(opts ...func(*TestCQuery)) *TestBQuery
- type TestBSelect
- func (tb *TestBSelect) Aggregate(fns ...AggregateFunc) *TestBSelect
- func (s *TestBSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *TestBSelect) BoolX(ctx context.Context) bool
- func (s *TestBSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *TestBSelect) BoolsX(ctx context.Context) []bool
- func (s *TestBSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *TestBSelect) Float64X(ctx context.Context) float64
- func (s *TestBSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *TestBSelect) Float64sX(ctx context.Context) []float64
- func (s *TestBSelect) Int(ctx context.Context) (_ int, err error)
- func (s *TestBSelect) IntX(ctx context.Context) int
- func (s *TestBSelect) Ints(ctx context.Context) ([]int, error)
- func (s *TestBSelect) IntsX(ctx context.Context) []int
- func (tb *TestBSelect) Scan(ctx context.Context, v any) error
- func (s *TestBSelect) ScanX(ctx context.Context, v any)
- func (s *TestBSelect) String(ctx context.Context) (_ string, err error)
- func (s *TestBSelect) StringX(ctx context.Context) string
- func (s *TestBSelect) Strings(ctx context.Context) ([]string, error)
- func (s *TestBSelect) StringsX(ctx context.Context) []string
- type TestBUpdate
- func (tb *TestBUpdate) AddFloat4(f float32) *TestBUpdate
- func (tb *TestBUpdate) AddFloat8(f float64) *TestBUpdate
- func (tb *TestBUpdate) AddInt4(i int32) *TestBUpdate
- func (tb *TestBUpdate) AddInt8(i int) *TestBUpdate
- func (tb *TestBUpdate) AddTestCIDs(ids ...int) *TestBUpdate
- func (tb *TestBUpdate) AddTestCs(t ...*TestC) *TestBUpdate
- func (tb *TestBUpdate) ClearAID() *TestBUpdate
- func (tb *TestBUpdate) ClearTestA() *TestBUpdate
- func (tb *TestBUpdate) ClearTestCs() *TestBUpdate
- func (tb *TestBUpdate) Exec(ctx context.Context) error
- func (tb *TestBUpdate) ExecX(ctx context.Context)
- func (tb *TestBUpdate) Mutation() *TestBMutation
- func (tb *TestBUpdate) RemoveTestCIDs(ids ...int) *TestBUpdate
- func (tb *TestBUpdate) RemoveTestCs(t ...*TestC) *TestBUpdate
- func (tb *TestBUpdate) Save(ctx context.Context) (int, error)
- func (tb *TestBUpdate) SaveX(ctx context.Context) int
- func (tb *TestBUpdate) SetAID(i int) *TestBUpdate
- func (tb *TestBUpdate) SetBool(b bool) *TestBUpdate
- func (tb *TestBUpdate) SetFloat4(f float32) *TestBUpdate
- func (tb *TestBUpdate) SetFloat8(f float64) *TestBUpdate
- func (tb *TestBUpdate) SetInt4(i int32) *TestBUpdate
- func (tb *TestBUpdate) SetInt8(i int) *TestBUpdate
- func (tb *TestBUpdate) SetName(s string) *TestBUpdate
- func (tb *TestBUpdate) SetNillableAID(i *int) *TestBUpdate
- func (tb *TestBUpdate) SetNillableBool(b *bool) *TestBUpdate
- func (tb *TestBUpdate) SetNillableFloat4(f *float32) *TestBUpdate
- func (tb *TestBUpdate) SetNillableFloat8(f *float64) *TestBUpdate
- func (tb *TestBUpdate) SetNillableInt4(i *int32) *TestBUpdate
- func (tb *TestBUpdate) SetNillableInt8(i *int) *TestBUpdate
- func (tb *TestBUpdate) SetNillableName(s *string) *TestBUpdate
- func (tb *TestBUpdate) SetNillableTestAID(id *int) *TestBUpdate
- func (tb *TestBUpdate) SetNillableText(s *string) *TestBUpdate
- func (tb *TestBUpdate) SetNillableTime(t *time.Time) *TestBUpdate
- func (tb *TestBUpdate) SetTestA(t *TestA) *TestBUpdate
- func (tb *TestBUpdate) SetTestAID(id int) *TestBUpdate
- func (tb *TestBUpdate) SetText(s string) *TestBUpdate
- func (tb *TestBUpdate) SetTime(t time.Time) *TestBUpdate
- func (tb *TestBUpdate) Where(ps ...predicate.TestB) *TestBUpdate
- type TestBUpdateOne
- func (tbo *TestBUpdateOne) AddFloat4(f float32) *TestBUpdateOne
- func (tbo *TestBUpdateOne) AddFloat8(f float64) *TestBUpdateOne
- func (tbo *TestBUpdateOne) AddInt4(i int32) *TestBUpdateOne
- func (tbo *TestBUpdateOne) AddInt8(i int) *TestBUpdateOne
- func (tbo *TestBUpdateOne) AddTestCIDs(ids ...int) *TestBUpdateOne
- func (tbo *TestBUpdateOne) AddTestCs(t ...*TestC) *TestBUpdateOne
- func (tbo *TestBUpdateOne) ClearAID() *TestBUpdateOne
- func (tbo *TestBUpdateOne) ClearTestA() *TestBUpdateOne
- func (tbo *TestBUpdateOne) ClearTestCs() *TestBUpdateOne
- func (tbo *TestBUpdateOne) Exec(ctx context.Context) error
- func (tbo *TestBUpdateOne) ExecX(ctx context.Context)
- func (tbo *TestBUpdateOne) Mutation() *TestBMutation
- func (tbo *TestBUpdateOne) RemoveTestCIDs(ids ...int) *TestBUpdateOne
- func (tbo *TestBUpdateOne) RemoveTestCs(t ...*TestC) *TestBUpdateOne
- func (tbo *TestBUpdateOne) Save(ctx context.Context) (*TestB, error)
- func (tbo *TestBUpdateOne) SaveX(ctx context.Context) *TestB
- func (tbo *TestBUpdateOne) Select(field string, fields ...string) *TestBUpdateOne
- func (tbo *TestBUpdateOne) SetAID(i int) *TestBUpdateOne
- func (tbo *TestBUpdateOne) SetBool(b bool) *TestBUpdateOne
- func (tbo *TestBUpdateOne) SetFloat4(f float32) *TestBUpdateOne
- func (tbo *TestBUpdateOne) SetFloat8(f float64) *TestBUpdateOne
- func (tbo *TestBUpdateOne) SetInt4(i int32) *TestBUpdateOne
- func (tbo *TestBUpdateOne) SetInt8(i int) *TestBUpdateOne
- func (tbo *TestBUpdateOne) SetName(s string) *TestBUpdateOne
- func (tbo *TestBUpdateOne) SetNillableAID(i *int) *TestBUpdateOne
- func (tbo *TestBUpdateOne) SetNillableBool(b *bool) *TestBUpdateOne
- func (tbo *TestBUpdateOne) SetNillableFloat4(f *float32) *TestBUpdateOne
- func (tbo *TestBUpdateOne) SetNillableFloat8(f *float64) *TestBUpdateOne
- func (tbo *TestBUpdateOne) SetNillableInt4(i *int32) *TestBUpdateOne
- func (tbo *TestBUpdateOne) SetNillableInt8(i *int) *TestBUpdateOne
- func (tbo *TestBUpdateOne) SetNillableName(s *string) *TestBUpdateOne
- func (tbo *TestBUpdateOne) SetNillableTestAID(id *int) *TestBUpdateOne
- func (tbo *TestBUpdateOne) SetNillableText(s *string) *TestBUpdateOne
- func (tbo *TestBUpdateOne) SetNillableTime(t *time.Time) *TestBUpdateOne
- func (tbo *TestBUpdateOne) SetTestA(t *TestA) *TestBUpdateOne
- func (tbo *TestBUpdateOne) SetTestAID(id int) *TestBUpdateOne
- func (tbo *TestBUpdateOne) SetText(s string) *TestBUpdateOne
- func (tbo *TestBUpdateOne) SetTime(t time.Time) *TestBUpdateOne
- func (tbo *TestBUpdateOne) Where(ps ...predicate.TestB) *TestBUpdateOne
- type TestBs
- type TestC
- type TestCClient
- func (c *TestCClient) Create() *TestCCreate
- func (c *TestCClient) CreateBulk(builders ...*TestCCreate) *TestCCreateBulk
- func (c *TestCClient) Delete() *TestCDelete
- func (c *TestCClient) DeleteOne(t *TestC) *TestCDeleteOne
- func (c *TestCClient) DeleteOneID(id int) *TestCDeleteOne
- func (c *TestCClient) Get(ctx context.Context, id int) (*TestC, error)
- func (c *TestCClient) GetX(ctx context.Context, id int) *TestC
- func (c *TestCClient) Hooks() []Hook
- func (c *TestCClient) Intercept(interceptors ...Interceptor)
- func (c *TestCClient) Interceptors() []Interceptor
- func (c *TestCClient) MapCreateBulk(slice any, setFunc func(*TestCCreate, int)) *TestCCreateBulk
- func (c *TestCClient) Query() *TestCQuery
- func (c *TestCClient) QueryTestB(t *TestC) *TestBQuery
- func (c *TestCClient) Update() *TestCUpdate
- func (c *TestCClient) UpdateOne(t *TestC) *TestCUpdateOne
- func (c *TestCClient) UpdateOneID(id int) *TestCUpdateOne
- func (c *TestCClient) Use(hooks ...Hook)
- type TestCCreate
- func (tc *TestCCreate) Exec(ctx context.Context) error
- func (tc *TestCCreate) ExecX(ctx context.Context)
- func (tc *TestCCreate) Mutation() *TestCMutation
- func (tc *TestCCreate) Save(ctx context.Context) (*TestC, error)
- func (tc *TestCCreate) SaveX(ctx context.Context) *TestC
- func (tc *TestCCreate) SetBID(i int) *TestCCreate
- func (tc *TestCCreate) SetBool(b bool) *TestCCreate
- func (tc *TestCCreate) SetFloat4(f float32) *TestCCreate
- func (tc *TestCCreate) SetFloat8(f float64) *TestCCreate
- func (tc *TestCCreate) SetID(i int) *TestCCreate
- func (tc *TestCCreate) SetInt4(i int32) *TestCCreate
- func (tc *TestCCreate) SetInt8(i int) *TestCCreate
- func (tc *TestCCreate) SetName(s string) *TestCCreate
- func (tc *TestCCreate) SetNillableBID(i *int) *TestCCreate
- func (tc *TestCCreate) SetNillableTestBID(id *int) *TestCCreate
- func (tc *TestCCreate) SetTestB(t *TestB) *TestCCreate
- func (tc *TestCCreate) SetTestBID(id int) *TestCCreate
- func (tc *TestCCreate) SetText(s string) *TestCCreate
- func (tc *TestCCreate) SetTime(t time.Time) *TestCCreate
- type TestCCreateBulk
- type TestCDelete
- type TestCDeleteOne
- type TestCEdges
- type TestCGroupBy
- func (tcb *TestCGroupBy) Aggregate(fns ...AggregateFunc) *TestCGroupBy
- func (s *TestCGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *TestCGroupBy) BoolX(ctx context.Context) bool
- func (s *TestCGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *TestCGroupBy) BoolsX(ctx context.Context) []bool
- func (s *TestCGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *TestCGroupBy) Float64X(ctx context.Context) float64
- func (s *TestCGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *TestCGroupBy) Float64sX(ctx context.Context) []float64
- func (s *TestCGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *TestCGroupBy) IntX(ctx context.Context) int
- func (s *TestCGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *TestCGroupBy) IntsX(ctx context.Context) []int
- func (tcb *TestCGroupBy) Scan(ctx context.Context, v any) error
- func (s *TestCGroupBy) ScanX(ctx context.Context, v any)
- func (s *TestCGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *TestCGroupBy) StringX(ctx context.Context) string
- func (s *TestCGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *TestCGroupBy) StringsX(ctx context.Context) []string
- type TestCMutation
- func (m *TestCMutation) AddField(name string, value ent.Value) error
- func (m *TestCMutation) AddFloat4(f float32)
- func (m *TestCMutation) AddFloat8(f float64)
- func (m *TestCMutation) AddInt4(i int32)
- func (m *TestCMutation) AddInt8(i int)
- func (m *TestCMutation) AddedEdges() []string
- func (m *TestCMutation) AddedField(name string) (ent.Value, bool)
- func (m *TestCMutation) AddedFields() []string
- func (m *TestCMutation) AddedFloat4() (r float32, exists bool)
- func (m *TestCMutation) AddedFloat8() (r float64, exists bool)
- func (m *TestCMutation) AddedIDs(name string) []ent.Value
- func (m *TestCMutation) AddedInt4() (r int32, exists bool)
- func (m *TestCMutation) AddedInt8() (r int, exists bool)
- func (m *TestCMutation) BID() (r int, exists bool)
- func (m *TestCMutation) BIDCleared() bool
- func (m *TestCMutation) Bool() (r bool, exists bool)
- func (m *TestCMutation) ClearBID()
- func (m *TestCMutation) ClearEdge(name string) error
- func (m *TestCMutation) ClearField(name string) error
- func (m *TestCMutation) ClearTestB()
- func (m *TestCMutation) ClearedEdges() []string
- func (m *TestCMutation) ClearedFields() []string
- func (m TestCMutation) Client() *Client
- func (m *TestCMutation) EdgeCleared(name string) bool
- func (m *TestCMutation) Field(name string) (ent.Value, bool)
- func (m *TestCMutation) FieldCleared(name string) bool
- func (m *TestCMutation) Fields() []string
- func (m *TestCMutation) Float4() (r float32, exists bool)
- func (m *TestCMutation) Float8() (r float64, exists bool)
- func (m *TestCMutation) ID() (id int, exists bool)
- func (m *TestCMutation) IDs(ctx context.Context) ([]int, error)
- func (m *TestCMutation) Int4() (r int32, exists bool)
- func (m *TestCMutation) Int8() (r int, exists bool)
- func (m *TestCMutation) Name() (r string, exists bool)
- func (m *TestCMutation) OldBID(ctx context.Context) (v int, err error)
- func (m *TestCMutation) OldBool(ctx context.Context) (v bool, err error)
- func (m *TestCMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TestCMutation) OldFloat4(ctx context.Context) (v float32, err error)
- func (m *TestCMutation) OldFloat8(ctx context.Context) (v float64, err error)
- func (m *TestCMutation) OldInt4(ctx context.Context) (v int32, err error)
- func (m *TestCMutation) OldInt8(ctx context.Context) (v int, err error)
- func (m *TestCMutation) OldName(ctx context.Context) (v string, err error)
- func (m *TestCMutation) OldText(ctx context.Context) (v string, err error)
- func (m *TestCMutation) OldTime(ctx context.Context) (v time.Time, err error)
- func (m *TestCMutation) Op() Op
- func (m *TestCMutation) RemovedEdges() []string
- func (m *TestCMutation) RemovedIDs(name string) []ent.Value
- func (m *TestCMutation) ResetBID()
- func (m *TestCMutation) ResetBool()
- func (m *TestCMutation) ResetEdge(name string) error
- func (m *TestCMutation) ResetField(name string) error
- func (m *TestCMutation) ResetFloat4()
- func (m *TestCMutation) ResetFloat8()
- func (m *TestCMutation) ResetInt4()
- func (m *TestCMutation) ResetInt8()
- func (m *TestCMutation) ResetName()
- func (m *TestCMutation) ResetTestB()
- func (m *TestCMutation) ResetText()
- func (m *TestCMutation) ResetTime()
- func (m *TestCMutation) SetBID(i int)
- func (m *TestCMutation) SetBool(b bool)
- func (m *TestCMutation) SetField(name string, value ent.Value) error
- func (m *TestCMutation) SetFloat4(f float32)
- func (m *TestCMutation) SetFloat8(f float64)
- func (m *TestCMutation) SetID(id int)
- func (m *TestCMutation) SetInt4(i int32)
- func (m *TestCMutation) SetInt8(i int)
- func (m *TestCMutation) SetName(s string)
- func (m *TestCMutation) SetOp(op Op)
- func (m *TestCMutation) SetTestBID(id int)
- func (m *TestCMutation) SetText(s string)
- func (m *TestCMutation) SetTime(t time.Time)
- func (m *TestCMutation) TestBCleared() bool
- func (m *TestCMutation) TestBID() (id int, exists bool)
- func (m *TestCMutation) TestBIDs() (ids []int)
- func (m *TestCMutation) Text() (r string, exists bool)
- func (m *TestCMutation) Time() (r time.Time, exists bool)
- func (m TestCMutation) Tx() (*Tx, error)
- func (m *TestCMutation) Type() string
- func (m *TestCMutation) Where(ps ...predicate.TestC)
- func (m *TestCMutation) WhereP(ps ...func(*sql.Selector))
- type TestCQuery
- func (tc *TestCQuery) Aggregate(fns ...AggregateFunc) *TestCSelect
- func (tc *TestCQuery) All(ctx context.Context) ([]*TestC, error)
- func (tc *TestCQuery) AllX(ctx context.Context) []*TestC
- func (tc *TestCQuery) Clone() *TestCQuery
- func (tc *TestCQuery) Count(ctx context.Context) (int, error)
- func (tc *TestCQuery) CountX(ctx context.Context) int
- func (tc *TestCQuery) Exist(ctx context.Context) (bool, error)
- func (tc *TestCQuery) ExistX(ctx context.Context) bool
- func (tc *TestCQuery) First(ctx context.Context) (*TestC, error)
- func (tc *TestCQuery) FirstID(ctx context.Context) (id int, err error)
- func (tc *TestCQuery) FirstIDX(ctx context.Context) int
- func (tc *TestCQuery) FirstX(ctx context.Context) *TestC
- func (tc *TestCQuery) GroupBy(field string, fields ...string) *TestCGroupBy
- func (tc *TestCQuery) IDs(ctx context.Context) (ids []int, err error)
- func (tc *TestCQuery) IDsX(ctx context.Context) []int
- func (tc *TestCQuery) Limit(limit int) *TestCQuery
- func (tc *TestCQuery) Offset(offset int) *TestCQuery
- func (tc *TestCQuery) Only(ctx context.Context) (*TestC, error)
- func (tc *TestCQuery) OnlyID(ctx context.Context) (id int, err error)
- func (tc *TestCQuery) OnlyIDX(ctx context.Context) int
- func (tc *TestCQuery) OnlyX(ctx context.Context) *TestC
- func (tc *TestCQuery) Order(o ...testc.OrderOption) *TestCQuery
- func (tc *TestCQuery) QueryTestB() *TestBQuery
- func (tc *TestCQuery) Select(fields ...string) *TestCSelect
- func (tc *TestCQuery) Unique(unique bool) *TestCQuery
- func (tc *TestCQuery) Where(ps ...predicate.TestC) *TestCQuery
- func (tc *TestCQuery) WithTestB(opts ...func(*TestBQuery)) *TestCQuery
- type TestCSelect
- func (tc *TestCSelect) Aggregate(fns ...AggregateFunc) *TestCSelect
- func (s *TestCSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *TestCSelect) BoolX(ctx context.Context) bool
- func (s *TestCSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *TestCSelect) BoolsX(ctx context.Context) []bool
- func (s *TestCSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *TestCSelect) Float64X(ctx context.Context) float64
- func (s *TestCSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *TestCSelect) Float64sX(ctx context.Context) []float64
- func (s *TestCSelect) Int(ctx context.Context) (_ int, err error)
- func (s *TestCSelect) IntX(ctx context.Context) int
- func (s *TestCSelect) Ints(ctx context.Context) ([]int, error)
- func (s *TestCSelect) IntsX(ctx context.Context) []int
- func (tc *TestCSelect) Scan(ctx context.Context, v any) error
- func (s *TestCSelect) ScanX(ctx context.Context, v any)
- func (s *TestCSelect) String(ctx context.Context) (_ string, err error)
- func (s *TestCSelect) StringX(ctx context.Context) string
- func (s *TestCSelect) Strings(ctx context.Context) ([]string, error)
- func (s *TestCSelect) StringsX(ctx context.Context) []string
- type TestCUpdate
- func (tc *TestCUpdate) AddFloat4(f float32) *TestCUpdate
- func (tc *TestCUpdate) AddFloat8(f float64) *TestCUpdate
- func (tc *TestCUpdate) AddInt4(i int32) *TestCUpdate
- func (tc *TestCUpdate) AddInt8(i int) *TestCUpdate
- func (tc *TestCUpdate) ClearBID() *TestCUpdate
- func (tc *TestCUpdate) ClearTestB() *TestCUpdate
- func (tc *TestCUpdate) Exec(ctx context.Context) error
- func (tc *TestCUpdate) ExecX(ctx context.Context)
- func (tc *TestCUpdate) Mutation() *TestCMutation
- func (tc *TestCUpdate) Save(ctx context.Context) (int, error)
- func (tc *TestCUpdate) SaveX(ctx context.Context) int
- func (tc *TestCUpdate) SetBID(i int) *TestCUpdate
- func (tc *TestCUpdate) SetBool(b bool) *TestCUpdate
- func (tc *TestCUpdate) SetFloat4(f float32) *TestCUpdate
- func (tc *TestCUpdate) SetFloat8(f float64) *TestCUpdate
- func (tc *TestCUpdate) SetInt4(i int32) *TestCUpdate
- func (tc *TestCUpdate) SetInt8(i int) *TestCUpdate
- func (tc *TestCUpdate) SetName(s string) *TestCUpdate
- func (tc *TestCUpdate) SetNillableBID(i *int) *TestCUpdate
- func (tc *TestCUpdate) SetNillableBool(b *bool) *TestCUpdate
- func (tc *TestCUpdate) SetNillableFloat4(f *float32) *TestCUpdate
- func (tc *TestCUpdate) SetNillableFloat8(f *float64) *TestCUpdate
- func (tc *TestCUpdate) SetNillableInt4(i *int32) *TestCUpdate
- func (tc *TestCUpdate) SetNillableInt8(i *int) *TestCUpdate
- func (tc *TestCUpdate) SetNillableName(s *string) *TestCUpdate
- func (tc *TestCUpdate) SetNillableTestBID(id *int) *TestCUpdate
- func (tc *TestCUpdate) SetNillableText(s *string) *TestCUpdate
- func (tc *TestCUpdate) SetNillableTime(t *time.Time) *TestCUpdate
- func (tc *TestCUpdate) SetTestB(t *TestB) *TestCUpdate
- func (tc *TestCUpdate) SetTestBID(id int) *TestCUpdate
- func (tc *TestCUpdate) SetText(s string) *TestCUpdate
- func (tc *TestCUpdate) SetTime(t time.Time) *TestCUpdate
- func (tc *TestCUpdate) Where(ps ...predicate.TestC) *TestCUpdate
- type TestCUpdateOne
- func (tco *TestCUpdateOne) AddFloat4(f float32) *TestCUpdateOne
- func (tco *TestCUpdateOne) AddFloat8(f float64) *TestCUpdateOne
- func (tco *TestCUpdateOne) AddInt4(i int32) *TestCUpdateOne
- func (tco *TestCUpdateOne) AddInt8(i int) *TestCUpdateOne
- func (tco *TestCUpdateOne) ClearBID() *TestCUpdateOne
- func (tco *TestCUpdateOne) ClearTestB() *TestCUpdateOne
- func (tco *TestCUpdateOne) Exec(ctx context.Context) error
- func (tco *TestCUpdateOne) ExecX(ctx context.Context)
- func (tco *TestCUpdateOne) Mutation() *TestCMutation
- func (tco *TestCUpdateOne) Save(ctx context.Context) (*TestC, error)
- func (tco *TestCUpdateOne) SaveX(ctx context.Context) *TestC
- func (tco *TestCUpdateOne) Select(field string, fields ...string) *TestCUpdateOne
- func (tco *TestCUpdateOne) SetBID(i int) *TestCUpdateOne
- func (tco *TestCUpdateOne) SetBool(b bool) *TestCUpdateOne
- func (tco *TestCUpdateOne) SetFloat4(f float32) *TestCUpdateOne
- func (tco *TestCUpdateOne) SetFloat8(f float64) *TestCUpdateOne
- func (tco *TestCUpdateOne) SetInt4(i int32) *TestCUpdateOne
- func (tco *TestCUpdateOne) SetInt8(i int) *TestCUpdateOne
- func (tco *TestCUpdateOne) SetName(s string) *TestCUpdateOne
- func (tco *TestCUpdateOne) SetNillableBID(i *int) *TestCUpdateOne
- func (tco *TestCUpdateOne) SetNillableBool(b *bool) *TestCUpdateOne
- func (tco *TestCUpdateOne) SetNillableFloat4(f *float32) *TestCUpdateOne
- func (tco *TestCUpdateOne) SetNillableFloat8(f *float64) *TestCUpdateOne
- func (tco *TestCUpdateOne) SetNillableInt4(i *int32) *TestCUpdateOne
- func (tco *TestCUpdateOne) SetNillableInt8(i *int) *TestCUpdateOne
- func (tco *TestCUpdateOne) SetNillableName(s *string) *TestCUpdateOne
- func (tco *TestCUpdateOne) SetNillableTestBID(id *int) *TestCUpdateOne
- func (tco *TestCUpdateOne) SetNillableText(s *string) *TestCUpdateOne
- func (tco *TestCUpdateOne) SetNillableTime(t *time.Time) *TestCUpdateOne
- func (tco *TestCUpdateOne) SetTestB(t *TestB) *TestCUpdateOne
- func (tco *TestCUpdateOne) SetTestBID(id int) *TestCUpdateOne
- func (tco *TestCUpdateOne) SetText(s string) *TestCUpdateOne
- func (tco *TestCUpdateOne) SetTime(t time.Time) *TestCUpdateOne
- func (tco *TestCUpdateOne) Where(ps ...predicate.TestC) *TestCUpdateOne
- type TestCs
- type TraverseFunc
- type Traverser
- type Tx
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeTestA = "TestA" TypeTestB = "TestB" TypeTestC = "TestC" )
Variables ¶
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // TestA is the client for interacting with the TestA builders. TestA *TestAClient // TestB is the client for interacting with the TestB builders. TestB *TestBClient // TestC is the client for interacting with the TestC builders. TestC *TestCClient // 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(). TestA. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer { return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Commit(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type TestA ¶
type TestA struct { // ID of the ent. ID int `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Int4 holds the value of the "int4" field. Int4 int32 `json:"int4,omitempty"` // Int8 holds the value of the "int8" field. Int8 int `json:"int8,omitempty"` // Float4 holds the value of the "float4" field. Float4 float32 `json:"float4,omitempty"` // Float8 holds the value of the "float8" field. Float8 float64 `json:"float8,omitempty"` // Bool holds the value of the "bool" field. Bool bool `json:"bool,omitempty"` // Text holds the value of the "text" field. Text string `json:"text,omitempty"` // Time holds the value of the "time" field. Time time.Time `json:"time,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the TestAQuery when eager-loading is set. Edges TestAEdges `json:"edges"` // contains filtered or unexported fields }
TestA is the model entity for the TestA schema.
func (*TestA) QueryTestBs ¶
func (t *TestA) QueryTestBs() *TestBQuery
QueryTestBs queries the "test_bs" edge of the TestA entity.
func (*TestA) Unwrap ¶
Unwrap unwraps the TestA 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 (*TestA) Update ¶
func (t *TestA) Update() *TestAUpdateOne
Update returns a builder for updating this TestA. Note that you need to call TestA.Unwrap() before calling this method if this TestA was returned from a transaction, and the transaction was committed or rolled back.
type TestAClient ¶
type TestAClient struct {
// contains filtered or unexported fields
}
TestAClient is a client for the TestA schema.
func NewTestAClient ¶
func NewTestAClient(c config) *TestAClient
NewTestAClient returns a client for the TestA from the given config.
func (*TestAClient) Create ¶
func (c *TestAClient) Create() *TestACreate
Create returns a builder for creating a TestA entity.
func (*TestAClient) CreateBulk ¶
func (c *TestAClient) CreateBulk(builders ...*TestACreate) *TestACreateBulk
CreateBulk returns a builder for creating a bulk of TestA entities.
func (*TestAClient) Delete ¶
func (c *TestAClient) Delete() *TestADelete
Delete returns a delete builder for TestA.
func (*TestAClient) DeleteOne ¶
func (c *TestAClient) DeleteOne(t *TestA) *TestADeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*TestAClient) DeleteOneID ¶
func (c *TestAClient) DeleteOneID(id int) *TestADeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*TestAClient) GetX ¶
func (c *TestAClient) GetX(ctx context.Context, id int) *TestA
GetX is like Get, but panics if an error occurs.
func (*TestAClient) Intercept ¶
func (c *TestAClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `testa.Intercept(f(g(h())))`.
func (*TestAClient) Interceptors ¶
func (c *TestAClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*TestAClient) MapCreateBulk ¶
func (c *TestAClient) MapCreateBulk(slice any, setFunc func(*TestACreate, int)) *TestACreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*TestAClient) Query ¶
func (c *TestAClient) Query() *TestAQuery
Query returns a query builder for TestA.
func (*TestAClient) QueryTestBs ¶
func (c *TestAClient) QueryTestBs(t *TestA) *TestBQuery
QueryTestBs queries the test_bs edge of a TestA.
func (*TestAClient) Update ¶
func (c *TestAClient) Update() *TestAUpdate
Update returns an update builder for TestA.
func (*TestAClient) UpdateOne ¶
func (c *TestAClient) UpdateOne(t *TestA) *TestAUpdateOne
UpdateOne returns an update builder for the given entity.
func (*TestAClient) UpdateOneID ¶
func (c *TestAClient) UpdateOneID(id int) *TestAUpdateOne
UpdateOneID returns an update builder for the given id.
func (*TestAClient) Use ¶
func (c *TestAClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `testa.Hooks(f(g(h())))`.
type TestACreate ¶
type TestACreate struct {
// contains filtered or unexported fields
}
TestACreate is the builder for creating a TestA entity.
func (*TestACreate) AddTestBIDs ¶
func (ta *TestACreate) AddTestBIDs(ids ...int) *TestACreate
AddTestBIDs adds the "test_bs" edge to the TestB entity by IDs.
func (*TestACreate) AddTestBs ¶
func (ta *TestACreate) AddTestBs(t ...*TestB) *TestACreate
AddTestBs adds the "test_bs" edges to the TestB entity.
func (*TestACreate) Exec ¶
func (ta *TestACreate) Exec(ctx context.Context) error
Exec executes the query.
func (*TestACreate) ExecX ¶
func (ta *TestACreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TestACreate) Mutation ¶
func (ta *TestACreate) Mutation() *TestAMutation
Mutation returns the TestAMutation object of the builder.
func (*TestACreate) Save ¶
func (ta *TestACreate) Save(ctx context.Context) (*TestA, error)
Save creates the TestA in the database.
func (*TestACreate) SaveX ¶
func (ta *TestACreate) SaveX(ctx context.Context) *TestA
SaveX calls Save and panics if Save returns an error.
func (*TestACreate) SetBool ¶
func (ta *TestACreate) SetBool(b bool) *TestACreate
SetBool sets the "bool" field.
func (*TestACreate) SetFloat4 ¶
func (ta *TestACreate) SetFloat4(f float32) *TestACreate
SetFloat4 sets the "float4" field.
func (*TestACreate) SetFloat8 ¶
func (ta *TestACreate) SetFloat8(f float64) *TestACreate
SetFloat8 sets the "float8" field.
func (*TestACreate) SetID ¶
func (ta *TestACreate) SetID(i int) *TestACreate
SetID sets the "id" field.
func (*TestACreate) SetInt4 ¶
func (ta *TestACreate) SetInt4(i int32) *TestACreate
SetInt4 sets the "int4" field.
func (*TestACreate) SetInt8 ¶
func (ta *TestACreate) SetInt8(i int) *TestACreate
SetInt8 sets the "int8" field.
func (*TestACreate) SetName ¶
func (ta *TestACreate) SetName(s string) *TestACreate
SetName sets the "name" field.
func (*TestACreate) SetText ¶
func (ta *TestACreate) SetText(s string) *TestACreate
SetText sets the "text" field.
func (*TestACreate) SetTime ¶
func (ta *TestACreate) SetTime(t time.Time) *TestACreate
SetTime sets the "time" field.
type TestACreateBulk ¶
type TestACreateBulk struct {
// contains filtered or unexported fields
}
TestACreateBulk is the builder for creating many TestA entities in bulk.
func (*TestACreateBulk) Exec ¶
func (tab *TestACreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TestACreateBulk) ExecX ¶
func (tab *TestACreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type TestADelete ¶
type TestADelete struct {
// contains filtered or unexported fields
}
TestADelete is the builder for deleting a TestA entity.
func (*TestADelete) Exec ¶
func (ta *TestADelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*TestADelete) ExecX ¶
func (ta *TestADelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*TestADelete) Where ¶
func (ta *TestADelete) Where(ps ...predicate.TestA) *TestADelete
Where appends a list predicates to the TestADelete builder.
type TestADeleteOne ¶
type TestADeleteOne struct {
// contains filtered or unexported fields
}
TestADeleteOne is the builder for deleting a single TestA entity.
func (*TestADeleteOne) Exec ¶
func (tao *TestADeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*TestADeleteOne) ExecX ¶
func (tao *TestADeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TestADeleteOne) Where ¶
func (tao *TestADeleteOne) Where(ps ...predicate.TestA) *TestADeleteOne
Where appends a list predicates to the TestADelete builder.
type TestAEdges ¶
type TestAEdges struct { // TestBs holds the value of the test_bs edge. TestBs []*TestB `json:"test_bs,omitempty"` // contains filtered or unexported fields }
TestAEdges holds the relations/edges for other nodes in the graph.
func (TestAEdges) TestBsOrErr ¶
func (e TestAEdges) TestBsOrErr() ([]*TestB, error)
TestBsOrErr returns the TestBs value or an error if the edge was not loaded in eager-loading.
type TestAGroupBy ¶
type TestAGroupBy struct {
// contains filtered or unexported fields
}
TestAGroupBy is the group-by builder for TestA entities.
func (*TestAGroupBy) Aggregate ¶
func (tab *TestAGroupBy) Aggregate(fns ...AggregateFunc) *TestAGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*TestAGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TestAGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TestAGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TestAGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TestAGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TestAGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TestAGroupBy) Scan ¶
func (tab *TestAGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TestAGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TestAMutation ¶
type TestAMutation struct {
// contains filtered or unexported fields
}
TestAMutation represents an operation that mutates the TestA nodes in the graph.
func (*TestAMutation) AddField ¶
func (m *TestAMutation) 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 (*TestAMutation) AddFloat4 ¶
func (m *TestAMutation) AddFloat4(f float32)
AddFloat4 adds f to the "float4" field.
func (*TestAMutation) AddFloat8 ¶
func (m *TestAMutation) AddFloat8(f float64)
AddFloat8 adds f to the "float8" field.
func (*TestAMutation) AddInt4 ¶
func (m *TestAMutation) AddInt4(i int32)
AddInt4 adds i to the "int4" field.
func (*TestAMutation) AddInt8 ¶
func (m *TestAMutation) AddInt8(i int)
AddInt8 adds i to the "int8" field.
func (*TestAMutation) AddTestBIDs ¶
func (m *TestAMutation) AddTestBIDs(ids ...int)
AddTestBIDs adds the "test_bs" edge to the TestB entity by ids.
func (*TestAMutation) AddedEdges ¶
func (m *TestAMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*TestAMutation) AddedField ¶
func (m *TestAMutation) 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 (*TestAMutation) AddedFields ¶
func (m *TestAMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*TestAMutation) AddedFloat4 ¶
func (m *TestAMutation) AddedFloat4() (r float32, exists bool)
AddedFloat4 returns the value that was added to the "float4" field in this mutation.
func (*TestAMutation) AddedFloat8 ¶
func (m *TestAMutation) AddedFloat8() (r float64, exists bool)
AddedFloat8 returns the value that was added to the "float8" field in this mutation.
func (*TestAMutation) AddedIDs ¶
func (m *TestAMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*TestAMutation) AddedInt4 ¶
func (m *TestAMutation) AddedInt4() (r int32, exists bool)
AddedInt4 returns the value that was added to the "int4" field in this mutation.
func (*TestAMutation) AddedInt8 ¶
func (m *TestAMutation) AddedInt8() (r int, exists bool)
AddedInt8 returns the value that was added to the "int8" field in this mutation.
func (*TestAMutation) Bool ¶
func (m *TestAMutation) Bool() (r bool, exists bool)
Bool returns the value of the "bool" field in the mutation.
func (*TestAMutation) ClearEdge ¶
func (m *TestAMutation) 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 (*TestAMutation) ClearField ¶
func (m *TestAMutation) 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 (*TestAMutation) ClearTestBs ¶
func (m *TestAMutation) ClearTestBs()
ClearTestBs clears the "test_bs" edge to the TestB entity.
func (*TestAMutation) ClearedEdges ¶
func (m *TestAMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*TestAMutation) ClearedFields ¶
func (m *TestAMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (TestAMutation) Client ¶
func (m TestAMutation) 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 (*TestAMutation) EdgeCleared ¶
func (m *TestAMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*TestAMutation) Field ¶
func (m *TestAMutation) 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 (*TestAMutation) FieldCleared ¶
func (m *TestAMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*TestAMutation) Fields ¶
func (m *TestAMutation) 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 (*TestAMutation) Float4 ¶
func (m *TestAMutation) Float4() (r float32, exists bool)
Float4 returns the value of the "float4" field in the mutation.
func (*TestAMutation) Float8 ¶
func (m *TestAMutation) Float8() (r float64, exists bool)
Float8 returns the value of the "float8" field in the mutation.
func (*TestAMutation) ID ¶
func (m *TestAMutation) 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 (*TestAMutation) IDs ¶
func (m *TestAMutation) 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 (*TestAMutation) Int4 ¶
func (m *TestAMutation) Int4() (r int32, exists bool)
Int4 returns the value of the "int4" field in the mutation.
func (*TestAMutation) Int8 ¶
func (m *TestAMutation) Int8() (r int, exists bool)
Int8 returns the value of the "int8" field in the mutation.
func (*TestAMutation) Name ¶
func (m *TestAMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*TestAMutation) OldBool ¶
func (m *TestAMutation) OldBool(ctx context.Context) (v bool, err error)
OldBool returns the old "bool" field's value of the TestA entity. If the TestA 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 (*TestAMutation) 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 (*TestAMutation) OldFloat4 ¶
func (m *TestAMutation) OldFloat4(ctx context.Context) (v float32, err error)
OldFloat4 returns the old "float4" field's value of the TestA entity. If the TestA 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 (*TestAMutation) OldFloat8 ¶
func (m *TestAMutation) OldFloat8(ctx context.Context) (v float64, err error)
OldFloat8 returns the old "float8" field's value of the TestA entity. If the TestA 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 (*TestAMutation) OldInt4 ¶
func (m *TestAMutation) OldInt4(ctx context.Context) (v int32, err error)
OldInt4 returns the old "int4" field's value of the TestA entity. If the TestA 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 (*TestAMutation) OldInt8 ¶
func (m *TestAMutation) OldInt8(ctx context.Context) (v int, err error)
OldInt8 returns the old "int8" field's value of the TestA entity. If the TestA 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 (*TestAMutation) OldName ¶
func (m *TestAMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the TestA entity. If the TestA 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 (*TestAMutation) OldText ¶
func (m *TestAMutation) OldText(ctx context.Context) (v string, err error)
OldText returns the old "text" field's value of the TestA entity. If the TestA 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 (*TestAMutation) OldTime ¶
OldTime returns the old "time" field's value of the TestA entity. If the TestA 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 (*TestAMutation) RemoveTestBIDs ¶
func (m *TestAMutation) RemoveTestBIDs(ids ...int)
RemoveTestBIDs removes the "test_bs" edge to the TestB entity by IDs.
func (*TestAMutation) RemovedEdges ¶
func (m *TestAMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*TestAMutation) RemovedIDs ¶
func (m *TestAMutation) 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 (*TestAMutation) RemovedTestBsIDs ¶
func (m *TestAMutation) RemovedTestBsIDs() (ids []int)
RemovedTestBs returns the removed IDs of the "test_bs" edge to the TestB entity.
func (*TestAMutation) ResetBool ¶
func (m *TestAMutation) ResetBool()
ResetBool resets all changes to the "bool" field.
func (*TestAMutation) ResetEdge ¶
func (m *TestAMutation) 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 (*TestAMutation) ResetField ¶
func (m *TestAMutation) 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 (*TestAMutation) ResetFloat4 ¶
func (m *TestAMutation) ResetFloat4()
ResetFloat4 resets all changes to the "float4" field.
func (*TestAMutation) ResetFloat8 ¶
func (m *TestAMutation) ResetFloat8()
ResetFloat8 resets all changes to the "float8" field.
func (*TestAMutation) ResetInt4 ¶
func (m *TestAMutation) ResetInt4()
ResetInt4 resets all changes to the "int4" field.
func (*TestAMutation) ResetInt8 ¶
func (m *TestAMutation) ResetInt8()
ResetInt8 resets all changes to the "int8" field.
func (*TestAMutation) ResetName ¶
func (m *TestAMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*TestAMutation) ResetTestBs ¶
func (m *TestAMutation) ResetTestBs()
ResetTestBs resets all changes to the "test_bs" edge.
func (*TestAMutation) ResetText ¶
func (m *TestAMutation) ResetText()
ResetText resets all changes to the "text" field.
func (*TestAMutation) ResetTime ¶
func (m *TestAMutation) ResetTime()
ResetTime resets all changes to the "time" field.
func (*TestAMutation) SetBool ¶
func (m *TestAMutation) SetBool(b bool)
SetBool sets the "bool" field.
func (*TestAMutation) SetField ¶
func (m *TestAMutation) 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 (*TestAMutation) SetFloat4 ¶
func (m *TestAMutation) SetFloat4(f float32)
SetFloat4 sets the "float4" field.
func (*TestAMutation) SetFloat8 ¶
func (m *TestAMutation) SetFloat8(f float64)
SetFloat8 sets the "float8" field.
func (*TestAMutation) SetID ¶
func (m *TestAMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of TestA entities.
func (*TestAMutation) SetInt4 ¶
func (m *TestAMutation) SetInt4(i int32)
SetInt4 sets the "int4" field.
func (*TestAMutation) SetInt8 ¶
func (m *TestAMutation) SetInt8(i int)
SetInt8 sets the "int8" field.
func (*TestAMutation) SetName ¶
func (m *TestAMutation) SetName(s string)
SetName sets the "name" field.
func (*TestAMutation) SetOp ¶
func (m *TestAMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*TestAMutation) SetText ¶
func (m *TestAMutation) SetText(s string)
SetText sets the "text" field.
func (*TestAMutation) SetTime ¶
func (m *TestAMutation) SetTime(t time.Time)
SetTime sets the "time" field.
func (*TestAMutation) TestBsCleared ¶
func (m *TestAMutation) TestBsCleared() bool
TestBsCleared reports if the "test_bs" edge to the TestB entity was cleared.
func (*TestAMutation) TestBsIDs ¶
func (m *TestAMutation) TestBsIDs() (ids []int)
TestBsIDs returns the "test_bs" edge IDs in the mutation.
func (*TestAMutation) Text ¶
func (m *TestAMutation) Text() (r string, exists bool)
Text returns the value of the "text" field in the mutation.
func (*TestAMutation) Time ¶
func (m *TestAMutation) Time() (r time.Time, exists bool)
Time returns the value of the "time" field in the mutation.
func (TestAMutation) Tx ¶
func (m TestAMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*TestAMutation) Type ¶
func (m *TestAMutation) Type() string
Type returns the node type of this mutation (TestA).
func (*TestAMutation) Where ¶
func (m *TestAMutation) Where(ps ...predicate.TestA)
Where appends a list predicates to the TestAMutation builder.
func (*TestAMutation) WhereP ¶
func (m *TestAMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the TestAMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type TestAQuery ¶
type TestAQuery struct {
// contains filtered or unexported fields
}
TestAQuery is the builder for querying TestA entities.
func (*TestAQuery) Aggregate ¶
func (ta *TestAQuery) Aggregate(fns ...AggregateFunc) *TestASelect
Aggregate returns a TestASelect configured with the given aggregations.
func (*TestAQuery) All ¶
func (ta *TestAQuery) All(ctx context.Context) ([]*TestA, error)
All executes the query and returns a list of TestAs.
func (*TestAQuery) AllX ¶
func (ta *TestAQuery) AllX(ctx context.Context) []*TestA
AllX is like All, but panics if an error occurs.
func (*TestAQuery) Clone ¶
func (ta *TestAQuery) Clone() *TestAQuery
Clone returns a duplicate of the TestAQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*TestAQuery) Count ¶
func (ta *TestAQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*TestAQuery) CountX ¶
func (ta *TestAQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*TestAQuery) Exist ¶
func (ta *TestAQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*TestAQuery) ExistX ¶
func (ta *TestAQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*TestAQuery) First ¶
func (ta *TestAQuery) First(ctx context.Context) (*TestA, error)
First returns the first TestA entity from the query. Returns a *NotFoundError when no TestA was found.
func (*TestAQuery) FirstID ¶
func (ta *TestAQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first TestA ID from the query. Returns a *NotFoundError when no TestA ID was found.
func (*TestAQuery) FirstIDX ¶
func (ta *TestAQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*TestAQuery) FirstX ¶
func (ta *TestAQuery) FirstX(ctx context.Context) *TestA
FirstX is like First, but panics if an error occurs.
func (*TestAQuery) GroupBy ¶
func (ta *TestAQuery) GroupBy(field string, fields ...string) *TestAGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.TestA.Query(). GroupBy(testa.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*TestAQuery) IDs ¶
func (ta *TestAQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of TestA IDs.
func (*TestAQuery) IDsX ¶
func (ta *TestAQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*TestAQuery) Limit ¶
func (ta *TestAQuery) Limit(limit int) *TestAQuery
Limit the number of records to be returned by this query.
func (*TestAQuery) Offset ¶
func (ta *TestAQuery) Offset(offset int) *TestAQuery
Offset to start from.
func (*TestAQuery) Only ¶
func (ta *TestAQuery) Only(ctx context.Context) (*TestA, error)
Only returns a single TestA entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one TestA entity is found. Returns a *NotFoundError when no TestA entities are found.
func (*TestAQuery) OnlyID ¶
func (ta *TestAQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only TestA ID in the query. Returns a *NotSingularError when more than one TestA ID is found. Returns a *NotFoundError when no entities are found.
func (*TestAQuery) OnlyIDX ¶
func (ta *TestAQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*TestAQuery) OnlyX ¶
func (ta *TestAQuery) OnlyX(ctx context.Context) *TestA
OnlyX is like Only, but panics if an error occurs.
func (*TestAQuery) Order ¶
func (ta *TestAQuery) Order(o ...testa.OrderOption) *TestAQuery
Order specifies how the records should be ordered.
func (*TestAQuery) QueryTestBs ¶
func (ta *TestAQuery) QueryTestBs() *TestBQuery
QueryTestBs chains the current query on the "test_bs" edge.
func (*TestAQuery) Select ¶
func (ta *TestAQuery) Select(fields ...string) *TestASelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.TestA.Query(). Select(testa.FieldName). Scan(ctx, &v)
func (*TestAQuery) Unique ¶
func (ta *TestAQuery) Unique(unique bool) *TestAQuery
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 (*TestAQuery) Where ¶
func (ta *TestAQuery) Where(ps ...predicate.TestA) *TestAQuery
Where adds a new predicate for the TestAQuery builder.
func (*TestAQuery) WithTestBs ¶
func (ta *TestAQuery) WithTestBs(opts ...func(*TestBQuery)) *TestAQuery
WithTestBs tells the query-builder to eager-load the nodes that are connected to the "test_bs" edge. The optional arguments are used to configure the query builder of the edge.
type TestASelect ¶
type TestASelect struct { *TestAQuery // contains filtered or unexported fields }
TestASelect is the builder for selecting fields of TestA entities.
func (*TestASelect) Aggregate ¶
func (ta *TestASelect) Aggregate(fns ...AggregateFunc) *TestASelect
Aggregate adds the given aggregation functions to the selector query.
func (*TestASelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TestASelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TestASelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TestASelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TestASelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TestASelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TestASelect) Scan ¶
func (ta *TestASelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TestASelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TestAUpdate ¶
type TestAUpdate struct {
// contains filtered or unexported fields
}
TestAUpdate is the builder for updating TestA entities.
func (*TestAUpdate) AddFloat4 ¶
func (ta *TestAUpdate) AddFloat4(f float32) *TestAUpdate
AddFloat4 adds f to the "float4" field.
func (*TestAUpdate) AddFloat8 ¶
func (ta *TestAUpdate) AddFloat8(f float64) *TestAUpdate
AddFloat8 adds f to the "float8" field.
func (*TestAUpdate) AddInt4 ¶
func (ta *TestAUpdate) AddInt4(i int32) *TestAUpdate
AddInt4 adds i to the "int4" field.
func (*TestAUpdate) AddInt8 ¶
func (ta *TestAUpdate) AddInt8(i int) *TestAUpdate
AddInt8 adds i to the "int8" field.
func (*TestAUpdate) AddTestBIDs ¶
func (ta *TestAUpdate) AddTestBIDs(ids ...int) *TestAUpdate
AddTestBIDs adds the "test_bs" edge to the TestB entity by IDs.
func (*TestAUpdate) AddTestBs ¶
func (ta *TestAUpdate) AddTestBs(t ...*TestB) *TestAUpdate
AddTestBs adds the "test_bs" edges to the TestB entity.
func (*TestAUpdate) ClearTestBs ¶
func (ta *TestAUpdate) ClearTestBs() *TestAUpdate
ClearTestBs clears all "test_bs" edges to the TestB entity.
func (*TestAUpdate) Exec ¶
func (ta *TestAUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*TestAUpdate) ExecX ¶
func (ta *TestAUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TestAUpdate) Mutation ¶
func (ta *TestAUpdate) Mutation() *TestAMutation
Mutation returns the TestAMutation object of the builder.
func (*TestAUpdate) RemoveTestBIDs ¶
func (ta *TestAUpdate) RemoveTestBIDs(ids ...int) *TestAUpdate
RemoveTestBIDs removes the "test_bs" edge to TestB entities by IDs.
func (*TestAUpdate) RemoveTestBs ¶
func (ta *TestAUpdate) RemoveTestBs(t ...*TestB) *TestAUpdate
RemoveTestBs removes "test_bs" edges to TestB entities.
func (*TestAUpdate) Save ¶
func (ta *TestAUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*TestAUpdate) SaveX ¶
func (ta *TestAUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*TestAUpdate) SetBool ¶
func (ta *TestAUpdate) SetBool(b bool) *TestAUpdate
SetBool sets the "bool" field.
func (*TestAUpdate) SetFloat4 ¶
func (ta *TestAUpdate) SetFloat4(f float32) *TestAUpdate
SetFloat4 sets the "float4" field.
func (*TestAUpdate) SetFloat8 ¶
func (ta *TestAUpdate) SetFloat8(f float64) *TestAUpdate
SetFloat8 sets the "float8" field.
func (*TestAUpdate) SetInt4 ¶
func (ta *TestAUpdate) SetInt4(i int32) *TestAUpdate
SetInt4 sets the "int4" field.
func (*TestAUpdate) SetInt8 ¶
func (ta *TestAUpdate) SetInt8(i int) *TestAUpdate
SetInt8 sets the "int8" field.
func (*TestAUpdate) SetName ¶
func (ta *TestAUpdate) SetName(s string) *TestAUpdate
SetName sets the "name" field.
func (*TestAUpdate) SetNillableBool ¶
func (ta *TestAUpdate) SetNillableBool(b *bool) *TestAUpdate
SetNillableBool sets the "bool" field if the given value is not nil.
func (*TestAUpdate) SetNillableFloat4 ¶
func (ta *TestAUpdate) SetNillableFloat4(f *float32) *TestAUpdate
SetNillableFloat4 sets the "float4" field if the given value is not nil.
func (*TestAUpdate) SetNillableFloat8 ¶
func (ta *TestAUpdate) SetNillableFloat8(f *float64) *TestAUpdate
SetNillableFloat8 sets the "float8" field if the given value is not nil.
func (*TestAUpdate) SetNillableInt4 ¶
func (ta *TestAUpdate) SetNillableInt4(i *int32) *TestAUpdate
SetNillableInt4 sets the "int4" field if the given value is not nil.
func (*TestAUpdate) SetNillableInt8 ¶
func (ta *TestAUpdate) SetNillableInt8(i *int) *TestAUpdate
SetNillableInt8 sets the "int8" field if the given value is not nil.
func (*TestAUpdate) SetNillableName ¶
func (ta *TestAUpdate) SetNillableName(s *string) *TestAUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*TestAUpdate) SetNillableText ¶
func (ta *TestAUpdate) SetNillableText(s *string) *TestAUpdate
SetNillableText sets the "text" field if the given value is not nil.
func (*TestAUpdate) SetNillableTime ¶
func (ta *TestAUpdate) SetNillableTime(t *time.Time) *TestAUpdate
SetNillableTime sets the "time" field if the given value is not nil.
func (*TestAUpdate) SetText ¶
func (ta *TestAUpdate) SetText(s string) *TestAUpdate
SetText sets the "text" field.
func (*TestAUpdate) SetTime ¶
func (ta *TestAUpdate) SetTime(t time.Time) *TestAUpdate
SetTime sets the "time" field.
func (*TestAUpdate) Where ¶
func (ta *TestAUpdate) Where(ps ...predicate.TestA) *TestAUpdate
Where appends a list predicates to the TestAUpdate builder.
type TestAUpdateOne ¶
type TestAUpdateOne struct {
// contains filtered or unexported fields
}
TestAUpdateOne is the builder for updating a single TestA entity.
func (*TestAUpdateOne) AddFloat4 ¶
func (tao *TestAUpdateOne) AddFloat4(f float32) *TestAUpdateOne
AddFloat4 adds f to the "float4" field.
func (*TestAUpdateOne) AddFloat8 ¶
func (tao *TestAUpdateOne) AddFloat8(f float64) *TestAUpdateOne
AddFloat8 adds f to the "float8" field.
func (*TestAUpdateOne) AddInt4 ¶
func (tao *TestAUpdateOne) AddInt4(i int32) *TestAUpdateOne
AddInt4 adds i to the "int4" field.
func (*TestAUpdateOne) AddInt8 ¶
func (tao *TestAUpdateOne) AddInt8(i int) *TestAUpdateOne
AddInt8 adds i to the "int8" field.
func (*TestAUpdateOne) AddTestBIDs ¶
func (tao *TestAUpdateOne) AddTestBIDs(ids ...int) *TestAUpdateOne
AddTestBIDs adds the "test_bs" edge to the TestB entity by IDs.
func (*TestAUpdateOne) AddTestBs ¶
func (tao *TestAUpdateOne) AddTestBs(t ...*TestB) *TestAUpdateOne
AddTestBs adds the "test_bs" edges to the TestB entity.
func (*TestAUpdateOne) ClearTestBs ¶
func (tao *TestAUpdateOne) ClearTestBs() *TestAUpdateOne
ClearTestBs clears all "test_bs" edges to the TestB entity.
func (*TestAUpdateOne) Exec ¶
func (tao *TestAUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*TestAUpdateOne) ExecX ¶
func (tao *TestAUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TestAUpdateOne) Mutation ¶
func (tao *TestAUpdateOne) Mutation() *TestAMutation
Mutation returns the TestAMutation object of the builder.
func (*TestAUpdateOne) RemoveTestBIDs ¶
func (tao *TestAUpdateOne) RemoveTestBIDs(ids ...int) *TestAUpdateOne
RemoveTestBIDs removes the "test_bs" edge to TestB entities by IDs.
func (*TestAUpdateOne) RemoveTestBs ¶
func (tao *TestAUpdateOne) RemoveTestBs(t ...*TestB) *TestAUpdateOne
RemoveTestBs removes "test_bs" edges to TestB entities.
func (*TestAUpdateOne) Save ¶
func (tao *TestAUpdateOne) Save(ctx context.Context) (*TestA, error)
Save executes the query and returns the updated TestA entity.
func (*TestAUpdateOne) SaveX ¶
func (tao *TestAUpdateOne) SaveX(ctx context.Context) *TestA
SaveX is like Save, but panics if an error occurs.
func (*TestAUpdateOne) Select ¶
func (tao *TestAUpdateOne) Select(field string, fields ...string) *TestAUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*TestAUpdateOne) SetBool ¶
func (tao *TestAUpdateOne) SetBool(b bool) *TestAUpdateOne
SetBool sets the "bool" field.
func (*TestAUpdateOne) SetFloat4 ¶
func (tao *TestAUpdateOne) SetFloat4(f float32) *TestAUpdateOne
SetFloat4 sets the "float4" field.
func (*TestAUpdateOne) SetFloat8 ¶
func (tao *TestAUpdateOne) SetFloat8(f float64) *TestAUpdateOne
SetFloat8 sets the "float8" field.
func (*TestAUpdateOne) SetInt4 ¶
func (tao *TestAUpdateOne) SetInt4(i int32) *TestAUpdateOne
SetInt4 sets the "int4" field.
func (*TestAUpdateOne) SetInt8 ¶
func (tao *TestAUpdateOne) SetInt8(i int) *TestAUpdateOne
SetInt8 sets the "int8" field.
func (*TestAUpdateOne) SetName ¶
func (tao *TestAUpdateOne) SetName(s string) *TestAUpdateOne
SetName sets the "name" field.
func (*TestAUpdateOne) SetNillableBool ¶
func (tao *TestAUpdateOne) SetNillableBool(b *bool) *TestAUpdateOne
SetNillableBool sets the "bool" field if the given value is not nil.
func (*TestAUpdateOne) SetNillableFloat4 ¶
func (tao *TestAUpdateOne) SetNillableFloat4(f *float32) *TestAUpdateOne
SetNillableFloat4 sets the "float4" field if the given value is not nil.
func (*TestAUpdateOne) SetNillableFloat8 ¶
func (tao *TestAUpdateOne) SetNillableFloat8(f *float64) *TestAUpdateOne
SetNillableFloat8 sets the "float8" field if the given value is not nil.
func (*TestAUpdateOne) SetNillableInt4 ¶
func (tao *TestAUpdateOne) SetNillableInt4(i *int32) *TestAUpdateOne
SetNillableInt4 sets the "int4" field if the given value is not nil.
func (*TestAUpdateOne) SetNillableInt8 ¶
func (tao *TestAUpdateOne) SetNillableInt8(i *int) *TestAUpdateOne
SetNillableInt8 sets the "int8" field if the given value is not nil.
func (*TestAUpdateOne) SetNillableName ¶
func (tao *TestAUpdateOne) SetNillableName(s *string) *TestAUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*TestAUpdateOne) SetNillableText ¶
func (tao *TestAUpdateOne) SetNillableText(s *string) *TestAUpdateOne
SetNillableText sets the "text" field if the given value is not nil.
func (*TestAUpdateOne) SetNillableTime ¶
func (tao *TestAUpdateOne) SetNillableTime(t *time.Time) *TestAUpdateOne
SetNillableTime sets the "time" field if the given value is not nil.
func (*TestAUpdateOne) SetText ¶
func (tao *TestAUpdateOne) SetText(s string) *TestAUpdateOne
SetText sets the "text" field.
func (*TestAUpdateOne) SetTime ¶
func (tao *TestAUpdateOne) SetTime(t time.Time) *TestAUpdateOne
SetTime sets the "time" field.
func (*TestAUpdateOne) Where ¶
func (tao *TestAUpdateOne) Where(ps ...predicate.TestA) *TestAUpdateOne
Where appends a list predicates to the TestAUpdate builder.
type TestB ¶
type TestB struct { // ID of the ent. ID int `json:"id,omitempty"` // AID holds the value of the "a_id" field. AID int `json:"a_id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Int4 holds the value of the "int4" field. Int4 int32 `json:"int4,omitempty"` // Int8 holds the value of the "int8" field. Int8 int `json:"int8,omitempty"` // Float4 holds the value of the "float4" field. Float4 float32 `json:"float4,omitempty"` // Float8 holds the value of the "float8" field. Float8 float64 `json:"float8,omitempty"` // Bool holds the value of the "bool" field. Bool bool `json:"bool,omitempty"` // Text holds the value of the "text" field. Text string `json:"text,omitempty"` // Time holds the value of the "time" field. Time time.Time `json:"time,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the TestBQuery when eager-loading is set. Edges TestBEdges `json:"edges"` // contains filtered or unexported fields }
TestB is the model entity for the TestB schema.
func (*TestB) QueryTestA ¶
func (t *TestB) QueryTestA() *TestAQuery
QueryTestA queries the "test_a" edge of the TestB entity.
func (*TestB) QueryTestCs ¶
func (t *TestB) QueryTestCs() *TestCQuery
QueryTestCs queries the "test_cs" edge of the TestB entity.
func (*TestB) Unwrap ¶
Unwrap unwraps the TestB 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 (*TestB) Update ¶
func (t *TestB) Update() *TestBUpdateOne
Update returns a builder for updating this TestB. Note that you need to call TestB.Unwrap() before calling this method if this TestB was returned from a transaction, and the transaction was committed or rolled back.
type TestBClient ¶
type TestBClient struct {
// contains filtered or unexported fields
}
TestBClient is a client for the TestB schema.
func NewTestBClient ¶
func NewTestBClient(c config) *TestBClient
NewTestBClient returns a client for the TestB from the given config.
func (*TestBClient) Create ¶
func (c *TestBClient) Create() *TestBCreate
Create returns a builder for creating a TestB entity.
func (*TestBClient) CreateBulk ¶
func (c *TestBClient) CreateBulk(builders ...*TestBCreate) *TestBCreateBulk
CreateBulk returns a builder for creating a bulk of TestB entities.
func (*TestBClient) Delete ¶
func (c *TestBClient) Delete() *TestBDelete
Delete returns a delete builder for TestB.
func (*TestBClient) DeleteOne ¶
func (c *TestBClient) DeleteOne(t *TestB) *TestBDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*TestBClient) DeleteOneID ¶
func (c *TestBClient) DeleteOneID(id int) *TestBDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*TestBClient) GetX ¶
func (c *TestBClient) GetX(ctx context.Context, id int) *TestB
GetX is like Get, but panics if an error occurs.
func (*TestBClient) Intercept ¶
func (c *TestBClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `testb.Intercept(f(g(h())))`.
func (*TestBClient) Interceptors ¶
func (c *TestBClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*TestBClient) MapCreateBulk ¶
func (c *TestBClient) MapCreateBulk(slice any, setFunc func(*TestBCreate, int)) *TestBCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*TestBClient) Query ¶
func (c *TestBClient) Query() *TestBQuery
Query returns a query builder for TestB.
func (*TestBClient) QueryTestA ¶
func (c *TestBClient) QueryTestA(t *TestB) *TestAQuery
QueryTestA queries the test_a edge of a TestB.
func (*TestBClient) QueryTestCs ¶
func (c *TestBClient) QueryTestCs(t *TestB) *TestCQuery
QueryTestCs queries the test_cs edge of a TestB.
func (*TestBClient) Update ¶
func (c *TestBClient) Update() *TestBUpdate
Update returns an update builder for TestB.
func (*TestBClient) UpdateOne ¶
func (c *TestBClient) UpdateOne(t *TestB) *TestBUpdateOne
UpdateOne returns an update builder for the given entity.
func (*TestBClient) UpdateOneID ¶
func (c *TestBClient) UpdateOneID(id int) *TestBUpdateOne
UpdateOneID returns an update builder for the given id.
func (*TestBClient) Use ¶
func (c *TestBClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `testb.Hooks(f(g(h())))`.
type TestBCreate ¶
type TestBCreate struct {
// contains filtered or unexported fields
}
TestBCreate is the builder for creating a TestB entity.
func (*TestBCreate) AddTestCIDs ¶
func (tb *TestBCreate) AddTestCIDs(ids ...int) *TestBCreate
AddTestCIDs adds the "test_cs" edge to the TestC entity by IDs.
func (*TestBCreate) AddTestCs ¶
func (tb *TestBCreate) AddTestCs(t ...*TestC) *TestBCreate
AddTestCs adds the "test_cs" edges to the TestC entity.
func (*TestBCreate) Exec ¶
func (tb *TestBCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*TestBCreate) ExecX ¶
func (tb *TestBCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TestBCreate) Mutation ¶
func (tb *TestBCreate) Mutation() *TestBMutation
Mutation returns the TestBMutation object of the builder.
func (*TestBCreate) Save ¶
func (tb *TestBCreate) Save(ctx context.Context) (*TestB, error)
Save creates the TestB in the database.
func (*TestBCreate) SaveX ¶
func (tb *TestBCreate) SaveX(ctx context.Context) *TestB
SaveX calls Save and panics if Save returns an error.
func (*TestBCreate) SetAID ¶
func (tb *TestBCreate) SetAID(i int) *TestBCreate
SetAID sets the "a_id" field.
func (*TestBCreate) SetBool ¶
func (tb *TestBCreate) SetBool(b bool) *TestBCreate
SetBool sets the "bool" field.
func (*TestBCreate) SetFloat4 ¶
func (tb *TestBCreate) SetFloat4(f float32) *TestBCreate
SetFloat4 sets the "float4" field.
func (*TestBCreate) SetFloat8 ¶
func (tb *TestBCreate) SetFloat8(f float64) *TestBCreate
SetFloat8 sets the "float8" field.
func (*TestBCreate) SetID ¶
func (tb *TestBCreate) SetID(i int) *TestBCreate
SetID sets the "id" field.
func (*TestBCreate) SetInt4 ¶
func (tb *TestBCreate) SetInt4(i int32) *TestBCreate
SetInt4 sets the "int4" field.
func (*TestBCreate) SetInt8 ¶
func (tb *TestBCreate) SetInt8(i int) *TestBCreate
SetInt8 sets the "int8" field.
func (*TestBCreate) SetName ¶
func (tb *TestBCreate) SetName(s string) *TestBCreate
SetName sets the "name" field.
func (*TestBCreate) SetNillableAID ¶
func (tb *TestBCreate) SetNillableAID(i *int) *TestBCreate
SetNillableAID sets the "a_id" field if the given value is not nil.
func (*TestBCreate) SetNillableTestAID ¶
func (tb *TestBCreate) SetNillableTestAID(id *int) *TestBCreate
SetNillableTestAID sets the "test_a" edge to the TestA entity by ID if the given value is not nil.
func (*TestBCreate) SetTestA ¶
func (tb *TestBCreate) SetTestA(t *TestA) *TestBCreate
SetTestA sets the "test_a" edge to the TestA entity.
func (*TestBCreate) SetTestAID ¶
func (tb *TestBCreate) SetTestAID(id int) *TestBCreate
SetTestAID sets the "test_a" edge to the TestA entity by ID.
func (*TestBCreate) SetText ¶
func (tb *TestBCreate) SetText(s string) *TestBCreate
SetText sets the "text" field.
func (*TestBCreate) SetTime ¶
func (tb *TestBCreate) SetTime(t time.Time) *TestBCreate
SetTime sets the "time" field.
type TestBCreateBulk ¶
type TestBCreateBulk struct {
// contains filtered or unexported fields
}
TestBCreateBulk is the builder for creating many TestB entities in bulk.
func (*TestBCreateBulk) Exec ¶
func (tbb *TestBCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TestBCreateBulk) ExecX ¶
func (tbb *TestBCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type TestBDelete ¶
type TestBDelete struct {
// contains filtered or unexported fields
}
TestBDelete is the builder for deleting a TestB entity.
func (*TestBDelete) Exec ¶
func (tb *TestBDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*TestBDelete) ExecX ¶
func (tb *TestBDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*TestBDelete) Where ¶
func (tb *TestBDelete) Where(ps ...predicate.TestB) *TestBDelete
Where appends a list predicates to the TestBDelete builder.
type TestBDeleteOne ¶
type TestBDeleteOne struct {
// contains filtered or unexported fields
}
TestBDeleteOne is the builder for deleting a single TestB entity.
func (*TestBDeleteOne) Exec ¶
func (tbo *TestBDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*TestBDeleteOne) ExecX ¶
func (tbo *TestBDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TestBDeleteOne) Where ¶
func (tbo *TestBDeleteOne) Where(ps ...predicate.TestB) *TestBDeleteOne
Where appends a list predicates to the TestBDelete builder.
type TestBEdges ¶
type TestBEdges struct { // TestA holds the value of the test_a edge. TestA *TestA `json:"test_a,omitempty"` // TestCs holds the value of the test_cs edge. TestCs []*TestC `json:"test_cs,omitempty"` // contains filtered or unexported fields }
TestBEdges holds the relations/edges for other nodes in the graph.
func (TestBEdges) TestAOrErr ¶
func (e TestBEdges) TestAOrErr() (*TestA, error)
TestAOrErr returns the TestA value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (TestBEdges) TestCsOrErr ¶
func (e TestBEdges) TestCsOrErr() ([]*TestC, error)
TestCsOrErr returns the TestCs value or an error if the edge was not loaded in eager-loading.
type TestBGroupBy ¶
type TestBGroupBy struct {
// contains filtered or unexported fields
}
TestBGroupBy is the group-by builder for TestB entities.
func (*TestBGroupBy) Aggregate ¶
func (tbb *TestBGroupBy) Aggregate(fns ...AggregateFunc) *TestBGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*TestBGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TestBGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TestBGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TestBGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TestBGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TestBGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TestBGroupBy) Scan ¶
func (tbb *TestBGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TestBGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TestBMutation ¶
type TestBMutation struct {
// contains filtered or unexported fields
}
TestBMutation represents an operation that mutates the TestB nodes in the graph.
func (*TestBMutation) AID ¶
func (m *TestBMutation) AID() (r int, exists bool)
AID returns the value of the "a_id" field in the mutation.
func (*TestBMutation) AIDCleared ¶
func (m *TestBMutation) AIDCleared() bool
AIDCleared returns if the "a_id" field was cleared in this mutation.
func (*TestBMutation) AddField ¶
func (m *TestBMutation) 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 (*TestBMutation) AddFloat4 ¶
func (m *TestBMutation) AddFloat4(f float32)
AddFloat4 adds f to the "float4" field.
func (*TestBMutation) AddFloat8 ¶
func (m *TestBMutation) AddFloat8(f float64)
AddFloat8 adds f to the "float8" field.
func (*TestBMutation) AddInt4 ¶
func (m *TestBMutation) AddInt4(i int32)
AddInt4 adds i to the "int4" field.
func (*TestBMutation) AddInt8 ¶
func (m *TestBMutation) AddInt8(i int)
AddInt8 adds i to the "int8" field.
func (*TestBMutation) AddTestCIDs ¶
func (m *TestBMutation) AddTestCIDs(ids ...int)
AddTestCIDs adds the "test_cs" edge to the TestC entity by ids.
func (*TestBMutation) AddedEdges ¶
func (m *TestBMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*TestBMutation) AddedField ¶
func (m *TestBMutation) 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 (*TestBMutation) AddedFields ¶
func (m *TestBMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*TestBMutation) AddedFloat4 ¶
func (m *TestBMutation) AddedFloat4() (r float32, exists bool)
AddedFloat4 returns the value that was added to the "float4" field in this mutation.
func (*TestBMutation) AddedFloat8 ¶
func (m *TestBMutation) AddedFloat8() (r float64, exists bool)
AddedFloat8 returns the value that was added to the "float8" field in this mutation.
func (*TestBMutation) AddedIDs ¶
func (m *TestBMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*TestBMutation) AddedInt4 ¶
func (m *TestBMutation) AddedInt4() (r int32, exists bool)
AddedInt4 returns the value that was added to the "int4" field in this mutation.
func (*TestBMutation) AddedInt8 ¶
func (m *TestBMutation) AddedInt8() (r int, exists bool)
AddedInt8 returns the value that was added to the "int8" field in this mutation.
func (*TestBMutation) Bool ¶
func (m *TestBMutation) Bool() (r bool, exists bool)
Bool returns the value of the "bool" field in the mutation.
func (*TestBMutation) ClearAID ¶
func (m *TestBMutation) ClearAID()
ClearAID clears the value of the "a_id" field.
func (*TestBMutation) ClearEdge ¶
func (m *TestBMutation) 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 (*TestBMutation) ClearField ¶
func (m *TestBMutation) 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 (*TestBMutation) ClearTestA ¶
func (m *TestBMutation) ClearTestA()
ClearTestA clears the "test_a" edge to the TestA entity.
func (*TestBMutation) ClearTestCs ¶
func (m *TestBMutation) ClearTestCs()
ClearTestCs clears the "test_cs" edge to the TestC entity.
func (*TestBMutation) ClearedEdges ¶
func (m *TestBMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*TestBMutation) ClearedFields ¶
func (m *TestBMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (TestBMutation) Client ¶
func (m TestBMutation) 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 (*TestBMutation) EdgeCleared ¶
func (m *TestBMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*TestBMutation) Field ¶
func (m *TestBMutation) 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 (*TestBMutation) FieldCleared ¶
func (m *TestBMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*TestBMutation) Fields ¶
func (m *TestBMutation) 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 (*TestBMutation) Float4 ¶
func (m *TestBMutation) Float4() (r float32, exists bool)
Float4 returns the value of the "float4" field in the mutation.
func (*TestBMutation) Float8 ¶
func (m *TestBMutation) Float8() (r float64, exists bool)
Float8 returns the value of the "float8" field in the mutation.
func (*TestBMutation) ID ¶
func (m *TestBMutation) 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 (*TestBMutation) IDs ¶
func (m *TestBMutation) 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 (*TestBMutation) Int4 ¶
func (m *TestBMutation) Int4() (r int32, exists bool)
Int4 returns the value of the "int4" field in the mutation.
func (*TestBMutation) Int8 ¶
func (m *TestBMutation) Int8() (r int, exists bool)
Int8 returns the value of the "int8" field in the mutation.
func (*TestBMutation) Name ¶
func (m *TestBMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*TestBMutation) OldAID ¶
func (m *TestBMutation) OldAID(ctx context.Context) (v int, err error)
OldAID returns the old "a_id" field's value of the TestB entity. If the TestB 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 (*TestBMutation) OldBool ¶
func (m *TestBMutation) OldBool(ctx context.Context) (v bool, err error)
OldBool returns the old "bool" field's value of the TestB entity. If the TestB 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 (*TestBMutation) 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 (*TestBMutation) OldFloat4 ¶
func (m *TestBMutation) OldFloat4(ctx context.Context) (v float32, err error)
OldFloat4 returns the old "float4" field's value of the TestB entity. If the TestB 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 (*TestBMutation) OldFloat8 ¶
func (m *TestBMutation) OldFloat8(ctx context.Context) (v float64, err error)
OldFloat8 returns the old "float8" field's value of the TestB entity. If the TestB 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 (*TestBMutation) OldInt4 ¶
func (m *TestBMutation) OldInt4(ctx context.Context) (v int32, err error)
OldInt4 returns the old "int4" field's value of the TestB entity. If the TestB 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 (*TestBMutation) OldInt8 ¶
func (m *TestBMutation) OldInt8(ctx context.Context) (v int, err error)
OldInt8 returns the old "int8" field's value of the TestB entity. If the TestB 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 (*TestBMutation) OldName ¶
func (m *TestBMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the TestB entity. If the TestB 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 (*TestBMutation) OldText ¶
func (m *TestBMutation) OldText(ctx context.Context) (v string, err error)
OldText returns the old "text" field's value of the TestB entity. If the TestB 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 (*TestBMutation) OldTime ¶
OldTime returns the old "time" field's value of the TestB entity. If the TestB 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 (*TestBMutation) RemoveTestCIDs ¶
func (m *TestBMutation) RemoveTestCIDs(ids ...int)
RemoveTestCIDs removes the "test_cs" edge to the TestC entity by IDs.
func (*TestBMutation) RemovedEdges ¶
func (m *TestBMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*TestBMutation) RemovedIDs ¶
func (m *TestBMutation) 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 (*TestBMutation) RemovedTestCsIDs ¶
func (m *TestBMutation) RemovedTestCsIDs() (ids []int)
RemovedTestCs returns the removed IDs of the "test_cs" edge to the TestC entity.
func (*TestBMutation) ResetAID ¶
func (m *TestBMutation) ResetAID()
ResetAID resets all changes to the "a_id" field.
func (*TestBMutation) ResetBool ¶
func (m *TestBMutation) ResetBool()
ResetBool resets all changes to the "bool" field.
func (*TestBMutation) ResetEdge ¶
func (m *TestBMutation) 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 (*TestBMutation) ResetField ¶
func (m *TestBMutation) 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 (*TestBMutation) ResetFloat4 ¶
func (m *TestBMutation) ResetFloat4()
ResetFloat4 resets all changes to the "float4" field.
func (*TestBMutation) ResetFloat8 ¶
func (m *TestBMutation) ResetFloat8()
ResetFloat8 resets all changes to the "float8" field.
func (*TestBMutation) ResetInt4 ¶
func (m *TestBMutation) ResetInt4()
ResetInt4 resets all changes to the "int4" field.
func (*TestBMutation) ResetInt8 ¶
func (m *TestBMutation) ResetInt8()
ResetInt8 resets all changes to the "int8" field.
func (*TestBMutation) ResetName ¶
func (m *TestBMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*TestBMutation) ResetTestA ¶
func (m *TestBMutation) ResetTestA()
ResetTestA resets all changes to the "test_a" edge.
func (*TestBMutation) ResetTestCs ¶
func (m *TestBMutation) ResetTestCs()
ResetTestCs resets all changes to the "test_cs" edge.
func (*TestBMutation) ResetText ¶
func (m *TestBMutation) ResetText()
ResetText resets all changes to the "text" field.
func (*TestBMutation) ResetTime ¶
func (m *TestBMutation) ResetTime()
ResetTime resets all changes to the "time" field.
func (*TestBMutation) SetBool ¶
func (m *TestBMutation) SetBool(b bool)
SetBool sets the "bool" field.
func (*TestBMutation) SetField ¶
func (m *TestBMutation) 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 (*TestBMutation) SetFloat4 ¶
func (m *TestBMutation) SetFloat4(f float32)
SetFloat4 sets the "float4" field.
func (*TestBMutation) SetFloat8 ¶
func (m *TestBMutation) SetFloat8(f float64)
SetFloat8 sets the "float8" field.
func (*TestBMutation) SetID ¶
func (m *TestBMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of TestB entities.
func (*TestBMutation) SetInt4 ¶
func (m *TestBMutation) SetInt4(i int32)
SetInt4 sets the "int4" field.
func (*TestBMutation) SetInt8 ¶
func (m *TestBMutation) SetInt8(i int)
SetInt8 sets the "int8" field.
func (*TestBMutation) SetName ¶
func (m *TestBMutation) SetName(s string)
SetName sets the "name" field.
func (*TestBMutation) SetOp ¶
func (m *TestBMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*TestBMutation) SetTestAID ¶
func (m *TestBMutation) SetTestAID(id int)
SetTestAID sets the "test_a" edge to the TestA entity by id.
func (*TestBMutation) SetText ¶
func (m *TestBMutation) SetText(s string)
SetText sets the "text" field.
func (*TestBMutation) SetTime ¶
func (m *TestBMutation) SetTime(t time.Time)
SetTime sets the "time" field.
func (*TestBMutation) TestACleared ¶
func (m *TestBMutation) TestACleared() bool
TestACleared reports if the "test_a" edge to the TestA entity was cleared.
func (*TestBMutation) TestAID ¶
func (m *TestBMutation) TestAID() (id int, exists bool)
TestAID returns the "test_a" edge ID in the mutation.
func (*TestBMutation) TestAIDs ¶
func (m *TestBMutation) TestAIDs() (ids []int)
TestAIDs returns the "test_a" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TestAID instead. It exists only for internal usage by the builders.
func (*TestBMutation) TestCsCleared ¶
func (m *TestBMutation) TestCsCleared() bool
TestCsCleared reports if the "test_cs" edge to the TestC entity was cleared.
func (*TestBMutation) TestCsIDs ¶
func (m *TestBMutation) TestCsIDs() (ids []int)
TestCsIDs returns the "test_cs" edge IDs in the mutation.
func (*TestBMutation) Text ¶
func (m *TestBMutation) Text() (r string, exists bool)
Text returns the value of the "text" field in the mutation.
func (*TestBMutation) Time ¶
func (m *TestBMutation) Time() (r time.Time, exists bool)
Time returns the value of the "time" field in the mutation.
func (TestBMutation) Tx ¶
func (m TestBMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*TestBMutation) Type ¶
func (m *TestBMutation) Type() string
Type returns the node type of this mutation (TestB).
func (*TestBMutation) Where ¶
func (m *TestBMutation) Where(ps ...predicate.TestB)
Where appends a list predicates to the TestBMutation builder.
func (*TestBMutation) WhereP ¶
func (m *TestBMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the TestBMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type TestBQuery ¶
type TestBQuery struct {
// contains filtered or unexported fields
}
TestBQuery is the builder for querying TestB entities.
func (*TestBQuery) Aggregate ¶
func (tb *TestBQuery) Aggregate(fns ...AggregateFunc) *TestBSelect
Aggregate returns a TestBSelect configured with the given aggregations.
func (*TestBQuery) All ¶
func (tb *TestBQuery) All(ctx context.Context) ([]*TestB, error)
All executes the query and returns a list of TestBs.
func (*TestBQuery) AllX ¶
func (tb *TestBQuery) AllX(ctx context.Context) []*TestB
AllX is like All, but panics if an error occurs.
func (*TestBQuery) Clone ¶
func (tb *TestBQuery) Clone() *TestBQuery
Clone returns a duplicate of the TestBQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*TestBQuery) Count ¶
func (tb *TestBQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*TestBQuery) CountX ¶
func (tb *TestBQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*TestBQuery) Exist ¶
func (tb *TestBQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*TestBQuery) ExistX ¶
func (tb *TestBQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*TestBQuery) First ¶
func (tb *TestBQuery) First(ctx context.Context) (*TestB, error)
First returns the first TestB entity from the query. Returns a *NotFoundError when no TestB was found.
func (*TestBQuery) FirstID ¶
func (tb *TestBQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first TestB ID from the query. Returns a *NotFoundError when no TestB ID was found.
func (*TestBQuery) FirstIDX ¶
func (tb *TestBQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*TestBQuery) FirstX ¶
func (tb *TestBQuery) FirstX(ctx context.Context) *TestB
FirstX is like First, but panics if an error occurs.
func (*TestBQuery) GroupBy ¶
func (tb *TestBQuery) GroupBy(field string, fields ...string) *TestBGroupBy
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 { AID int `json:"a_id,omitempty"` Count int `json:"count,omitempty"` } client.TestB.Query(). GroupBy(testb.FieldAID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*TestBQuery) IDs ¶
func (tb *TestBQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of TestB IDs.
func (*TestBQuery) IDsX ¶
func (tb *TestBQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*TestBQuery) Limit ¶
func (tb *TestBQuery) Limit(limit int) *TestBQuery
Limit the number of records to be returned by this query.
func (*TestBQuery) Offset ¶
func (tb *TestBQuery) Offset(offset int) *TestBQuery
Offset to start from.
func (*TestBQuery) Only ¶
func (tb *TestBQuery) Only(ctx context.Context) (*TestB, error)
Only returns a single TestB entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one TestB entity is found. Returns a *NotFoundError when no TestB entities are found.
func (*TestBQuery) OnlyID ¶
func (tb *TestBQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only TestB ID in the query. Returns a *NotSingularError when more than one TestB ID is found. Returns a *NotFoundError when no entities are found.
func (*TestBQuery) OnlyIDX ¶
func (tb *TestBQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*TestBQuery) OnlyX ¶
func (tb *TestBQuery) OnlyX(ctx context.Context) *TestB
OnlyX is like Only, but panics if an error occurs.
func (*TestBQuery) Order ¶
func (tb *TestBQuery) Order(o ...testb.OrderOption) *TestBQuery
Order specifies how the records should be ordered.
func (*TestBQuery) QueryTestA ¶
func (tb *TestBQuery) QueryTestA() *TestAQuery
QueryTestA chains the current query on the "test_a" edge.
func (*TestBQuery) QueryTestCs ¶
func (tb *TestBQuery) QueryTestCs() *TestCQuery
QueryTestCs chains the current query on the "test_cs" edge.
func (*TestBQuery) Select ¶
func (tb *TestBQuery) Select(fields ...string) *TestBSelect
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 { AID int `json:"a_id,omitempty"` } client.TestB.Query(). Select(testb.FieldAID). Scan(ctx, &v)
func (*TestBQuery) Unique ¶
func (tb *TestBQuery) Unique(unique bool) *TestBQuery
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 (*TestBQuery) Where ¶
func (tb *TestBQuery) Where(ps ...predicate.TestB) *TestBQuery
Where adds a new predicate for the TestBQuery builder.
func (*TestBQuery) WithTestA ¶
func (tb *TestBQuery) WithTestA(opts ...func(*TestAQuery)) *TestBQuery
WithTestA tells the query-builder to eager-load the nodes that are connected to the "test_a" edge. The optional arguments are used to configure the query builder of the edge.
func (*TestBQuery) WithTestCs ¶
func (tb *TestBQuery) WithTestCs(opts ...func(*TestCQuery)) *TestBQuery
WithTestCs tells the query-builder to eager-load the nodes that are connected to the "test_cs" edge. The optional arguments are used to configure the query builder of the edge.
type TestBSelect ¶
type TestBSelect struct { *TestBQuery // contains filtered or unexported fields }
TestBSelect is the builder for selecting fields of TestB entities.
func (*TestBSelect) Aggregate ¶
func (tb *TestBSelect) Aggregate(fns ...AggregateFunc) *TestBSelect
Aggregate adds the given aggregation functions to the selector query.
func (*TestBSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TestBSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TestBSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TestBSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TestBSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TestBSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TestBSelect) Scan ¶
func (tb *TestBSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TestBSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TestBUpdate ¶
type TestBUpdate struct {
// contains filtered or unexported fields
}
TestBUpdate is the builder for updating TestB entities.
func (*TestBUpdate) AddFloat4 ¶
func (tb *TestBUpdate) AddFloat4(f float32) *TestBUpdate
AddFloat4 adds f to the "float4" field.
func (*TestBUpdate) AddFloat8 ¶
func (tb *TestBUpdate) AddFloat8(f float64) *TestBUpdate
AddFloat8 adds f to the "float8" field.
func (*TestBUpdate) AddInt4 ¶
func (tb *TestBUpdate) AddInt4(i int32) *TestBUpdate
AddInt4 adds i to the "int4" field.
func (*TestBUpdate) AddInt8 ¶
func (tb *TestBUpdate) AddInt8(i int) *TestBUpdate
AddInt8 adds i to the "int8" field.
func (*TestBUpdate) AddTestCIDs ¶
func (tb *TestBUpdate) AddTestCIDs(ids ...int) *TestBUpdate
AddTestCIDs adds the "test_cs" edge to the TestC entity by IDs.
func (*TestBUpdate) AddTestCs ¶
func (tb *TestBUpdate) AddTestCs(t ...*TestC) *TestBUpdate
AddTestCs adds the "test_cs" edges to the TestC entity.
func (*TestBUpdate) ClearAID ¶
func (tb *TestBUpdate) ClearAID() *TestBUpdate
ClearAID clears the value of the "a_id" field.
func (*TestBUpdate) ClearTestA ¶
func (tb *TestBUpdate) ClearTestA() *TestBUpdate
ClearTestA clears the "test_a" edge to the TestA entity.
func (*TestBUpdate) ClearTestCs ¶
func (tb *TestBUpdate) ClearTestCs() *TestBUpdate
ClearTestCs clears all "test_cs" edges to the TestC entity.
func (*TestBUpdate) Exec ¶
func (tb *TestBUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*TestBUpdate) ExecX ¶
func (tb *TestBUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TestBUpdate) Mutation ¶
func (tb *TestBUpdate) Mutation() *TestBMutation
Mutation returns the TestBMutation object of the builder.
func (*TestBUpdate) RemoveTestCIDs ¶
func (tb *TestBUpdate) RemoveTestCIDs(ids ...int) *TestBUpdate
RemoveTestCIDs removes the "test_cs" edge to TestC entities by IDs.
func (*TestBUpdate) RemoveTestCs ¶
func (tb *TestBUpdate) RemoveTestCs(t ...*TestC) *TestBUpdate
RemoveTestCs removes "test_cs" edges to TestC entities.
func (*TestBUpdate) Save ¶
func (tb *TestBUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*TestBUpdate) SaveX ¶
func (tb *TestBUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*TestBUpdate) SetAID ¶
func (tb *TestBUpdate) SetAID(i int) *TestBUpdate
SetAID sets the "a_id" field.
func (*TestBUpdate) SetBool ¶
func (tb *TestBUpdate) SetBool(b bool) *TestBUpdate
SetBool sets the "bool" field.
func (*TestBUpdate) SetFloat4 ¶
func (tb *TestBUpdate) SetFloat4(f float32) *TestBUpdate
SetFloat4 sets the "float4" field.
func (*TestBUpdate) SetFloat8 ¶
func (tb *TestBUpdate) SetFloat8(f float64) *TestBUpdate
SetFloat8 sets the "float8" field.
func (*TestBUpdate) SetInt4 ¶
func (tb *TestBUpdate) SetInt4(i int32) *TestBUpdate
SetInt4 sets the "int4" field.
func (*TestBUpdate) SetInt8 ¶
func (tb *TestBUpdate) SetInt8(i int) *TestBUpdate
SetInt8 sets the "int8" field.
func (*TestBUpdate) SetName ¶
func (tb *TestBUpdate) SetName(s string) *TestBUpdate
SetName sets the "name" field.
func (*TestBUpdate) SetNillableAID ¶
func (tb *TestBUpdate) SetNillableAID(i *int) *TestBUpdate
SetNillableAID sets the "a_id" field if the given value is not nil.
func (*TestBUpdate) SetNillableBool ¶
func (tb *TestBUpdate) SetNillableBool(b *bool) *TestBUpdate
SetNillableBool sets the "bool" field if the given value is not nil.
func (*TestBUpdate) SetNillableFloat4 ¶
func (tb *TestBUpdate) SetNillableFloat4(f *float32) *TestBUpdate
SetNillableFloat4 sets the "float4" field if the given value is not nil.
func (*TestBUpdate) SetNillableFloat8 ¶
func (tb *TestBUpdate) SetNillableFloat8(f *float64) *TestBUpdate
SetNillableFloat8 sets the "float8" field if the given value is not nil.
func (*TestBUpdate) SetNillableInt4 ¶
func (tb *TestBUpdate) SetNillableInt4(i *int32) *TestBUpdate
SetNillableInt4 sets the "int4" field if the given value is not nil.
func (*TestBUpdate) SetNillableInt8 ¶
func (tb *TestBUpdate) SetNillableInt8(i *int) *TestBUpdate
SetNillableInt8 sets the "int8" field if the given value is not nil.
func (*TestBUpdate) SetNillableName ¶
func (tb *TestBUpdate) SetNillableName(s *string) *TestBUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*TestBUpdate) SetNillableTestAID ¶
func (tb *TestBUpdate) SetNillableTestAID(id *int) *TestBUpdate
SetNillableTestAID sets the "test_a" edge to the TestA entity by ID if the given value is not nil.
func (*TestBUpdate) SetNillableText ¶
func (tb *TestBUpdate) SetNillableText(s *string) *TestBUpdate
SetNillableText sets the "text" field if the given value is not nil.
func (*TestBUpdate) SetNillableTime ¶
func (tb *TestBUpdate) SetNillableTime(t *time.Time) *TestBUpdate
SetNillableTime sets the "time" field if the given value is not nil.
func (*TestBUpdate) SetTestA ¶
func (tb *TestBUpdate) SetTestA(t *TestA) *TestBUpdate
SetTestA sets the "test_a" edge to the TestA entity.
func (*TestBUpdate) SetTestAID ¶
func (tb *TestBUpdate) SetTestAID(id int) *TestBUpdate
SetTestAID sets the "test_a" edge to the TestA entity by ID.
func (*TestBUpdate) SetText ¶
func (tb *TestBUpdate) SetText(s string) *TestBUpdate
SetText sets the "text" field.
func (*TestBUpdate) SetTime ¶
func (tb *TestBUpdate) SetTime(t time.Time) *TestBUpdate
SetTime sets the "time" field.
func (*TestBUpdate) Where ¶
func (tb *TestBUpdate) Where(ps ...predicate.TestB) *TestBUpdate
Where appends a list predicates to the TestBUpdate builder.
type TestBUpdateOne ¶
type TestBUpdateOne struct {
// contains filtered or unexported fields
}
TestBUpdateOne is the builder for updating a single TestB entity.
func (*TestBUpdateOne) AddFloat4 ¶
func (tbo *TestBUpdateOne) AddFloat4(f float32) *TestBUpdateOne
AddFloat4 adds f to the "float4" field.
func (*TestBUpdateOne) AddFloat8 ¶
func (tbo *TestBUpdateOne) AddFloat8(f float64) *TestBUpdateOne
AddFloat8 adds f to the "float8" field.
func (*TestBUpdateOne) AddInt4 ¶
func (tbo *TestBUpdateOne) AddInt4(i int32) *TestBUpdateOne
AddInt4 adds i to the "int4" field.
func (*TestBUpdateOne) AddInt8 ¶
func (tbo *TestBUpdateOne) AddInt8(i int) *TestBUpdateOne
AddInt8 adds i to the "int8" field.
func (*TestBUpdateOne) AddTestCIDs ¶
func (tbo *TestBUpdateOne) AddTestCIDs(ids ...int) *TestBUpdateOne
AddTestCIDs adds the "test_cs" edge to the TestC entity by IDs.
func (*TestBUpdateOne) AddTestCs ¶
func (tbo *TestBUpdateOne) AddTestCs(t ...*TestC) *TestBUpdateOne
AddTestCs adds the "test_cs" edges to the TestC entity.
func (*TestBUpdateOne) ClearAID ¶
func (tbo *TestBUpdateOne) ClearAID() *TestBUpdateOne
ClearAID clears the value of the "a_id" field.
func (*TestBUpdateOne) ClearTestA ¶
func (tbo *TestBUpdateOne) ClearTestA() *TestBUpdateOne
ClearTestA clears the "test_a" edge to the TestA entity.
func (*TestBUpdateOne) ClearTestCs ¶
func (tbo *TestBUpdateOne) ClearTestCs() *TestBUpdateOne
ClearTestCs clears all "test_cs" edges to the TestC entity.
func (*TestBUpdateOne) Exec ¶
func (tbo *TestBUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*TestBUpdateOne) ExecX ¶
func (tbo *TestBUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TestBUpdateOne) Mutation ¶
func (tbo *TestBUpdateOne) Mutation() *TestBMutation
Mutation returns the TestBMutation object of the builder.
func (*TestBUpdateOne) RemoveTestCIDs ¶
func (tbo *TestBUpdateOne) RemoveTestCIDs(ids ...int) *TestBUpdateOne
RemoveTestCIDs removes the "test_cs" edge to TestC entities by IDs.
func (*TestBUpdateOne) RemoveTestCs ¶
func (tbo *TestBUpdateOne) RemoveTestCs(t ...*TestC) *TestBUpdateOne
RemoveTestCs removes "test_cs" edges to TestC entities.
func (*TestBUpdateOne) Save ¶
func (tbo *TestBUpdateOne) Save(ctx context.Context) (*TestB, error)
Save executes the query and returns the updated TestB entity.
func (*TestBUpdateOne) SaveX ¶
func (tbo *TestBUpdateOne) SaveX(ctx context.Context) *TestB
SaveX is like Save, but panics if an error occurs.
func (*TestBUpdateOne) Select ¶
func (tbo *TestBUpdateOne) Select(field string, fields ...string) *TestBUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*TestBUpdateOne) SetAID ¶
func (tbo *TestBUpdateOne) SetAID(i int) *TestBUpdateOne
SetAID sets the "a_id" field.
func (*TestBUpdateOne) SetBool ¶
func (tbo *TestBUpdateOne) SetBool(b bool) *TestBUpdateOne
SetBool sets the "bool" field.
func (*TestBUpdateOne) SetFloat4 ¶
func (tbo *TestBUpdateOne) SetFloat4(f float32) *TestBUpdateOne
SetFloat4 sets the "float4" field.
func (*TestBUpdateOne) SetFloat8 ¶
func (tbo *TestBUpdateOne) SetFloat8(f float64) *TestBUpdateOne
SetFloat8 sets the "float8" field.
func (*TestBUpdateOne) SetInt4 ¶
func (tbo *TestBUpdateOne) SetInt4(i int32) *TestBUpdateOne
SetInt4 sets the "int4" field.
func (*TestBUpdateOne) SetInt8 ¶
func (tbo *TestBUpdateOne) SetInt8(i int) *TestBUpdateOne
SetInt8 sets the "int8" field.
func (*TestBUpdateOne) SetName ¶
func (tbo *TestBUpdateOne) SetName(s string) *TestBUpdateOne
SetName sets the "name" field.
func (*TestBUpdateOne) SetNillableAID ¶
func (tbo *TestBUpdateOne) SetNillableAID(i *int) *TestBUpdateOne
SetNillableAID sets the "a_id" field if the given value is not nil.
func (*TestBUpdateOne) SetNillableBool ¶
func (tbo *TestBUpdateOne) SetNillableBool(b *bool) *TestBUpdateOne
SetNillableBool sets the "bool" field if the given value is not nil.
func (*TestBUpdateOne) SetNillableFloat4 ¶
func (tbo *TestBUpdateOne) SetNillableFloat4(f *float32) *TestBUpdateOne
SetNillableFloat4 sets the "float4" field if the given value is not nil.
func (*TestBUpdateOne) SetNillableFloat8 ¶
func (tbo *TestBUpdateOne) SetNillableFloat8(f *float64) *TestBUpdateOne
SetNillableFloat8 sets the "float8" field if the given value is not nil.
func (*TestBUpdateOne) SetNillableInt4 ¶
func (tbo *TestBUpdateOne) SetNillableInt4(i *int32) *TestBUpdateOne
SetNillableInt4 sets the "int4" field if the given value is not nil.
func (*TestBUpdateOne) SetNillableInt8 ¶
func (tbo *TestBUpdateOne) SetNillableInt8(i *int) *TestBUpdateOne
SetNillableInt8 sets the "int8" field if the given value is not nil.
func (*TestBUpdateOne) SetNillableName ¶
func (tbo *TestBUpdateOne) SetNillableName(s *string) *TestBUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*TestBUpdateOne) SetNillableTestAID ¶
func (tbo *TestBUpdateOne) SetNillableTestAID(id *int) *TestBUpdateOne
SetNillableTestAID sets the "test_a" edge to the TestA entity by ID if the given value is not nil.
func (*TestBUpdateOne) SetNillableText ¶
func (tbo *TestBUpdateOne) SetNillableText(s *string) *TestBUpdateOne
SetNillableText sets the "text" field if the given value is not nil.
func (*TestBUpdateOne) SetNillableTime ¶
func (tbo *TestBUpdateOne) SetNillableTime(t *time.Time) *TestBUpdateOne
SetNillableTime sets the "time" field if the given value is not nil.
func (*TestBUpdateOne) SetTestA ¶
func (tbo *TestBUpdateOne) SetTestA(t *TestA) *TestBUpdateOne
SetTestA sets the "test_a" edge to the TestA entity.
func (*TestBUpdateOne) SetTestAID ¶
func (tbo *TestBUpdateOne) SetTestAID(id int) *TestBUpdateOne
SetTestAID sets the "test_a" edge to the TestA entity by ID.
func (*TestBUpdateOne) SetText ¶
func (tbo *TestBUpdateOne) SetText(s string) *TestBUpdateOne
SetText sets the "text" field.
func (*TestBUpdateOne) SetTime ¶
func (tbo *TestBUpdateOne) SetTime(t time.Time) *TestBUpdateOne
SetTime sets the "time" field.
func (*TestBUpdateOne) Where ¶
func (tbo *TestBUpdateOne) Where(ps ...predicate.TestB) *TestBUpdateOne
Where appends a list predicates to the TestBUpdate builder.
type TestC ¶
type TestC struct { // ID of the ent. ID int `json:"id,omitempty"` // BID holds the value of the "b_id" field. BID int `json:"b_id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Int4 holds the value of the "int4" field. Int4 int32 `json:"int4,omitempty"` // Int8 holds the value of the "int8" field. Int8 int `json:"int8,omitempty"` // Float4 holds the value of the "float4" field. Float4 float32 `json:"float4,omitempty"` // Float8 holds the value of the "float8" field. Float8 float64 `json:"float8,omitempty"` // Bool holds the value of the "bool" field. Bool bool `json:"bool,omitempty"` // Text holds the value of the "text" field. Text string `json:"text,omitempty"` // Time holds the value of the "time" field. Time time.Time `json:"time,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the TestCQuery when eager-loading is set. Edges TestCEdges `json:"edges"` // contains filtered or unexported fields }
TestC is the model entity for the TestC schema.
func (*TestC) QueryTestB ¶
func (t *TestC) QueryTestB() *TestBQuery
QueryTestB queries the "test_b" edge of the TestC entity.
func (*TestC) Unwrap ¶
Unwrap unwraps the TestC 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 (*TestC) Update ¶
func (t *TestC) Update() *TestCUpdateOne
Update returns a builder for updating this TestC. Note that you need to call TestC.Unwrap() before calling this method if this TestC was returned from a transaction, and the transaction was committed or rolled back.
type TestCClient ¶
type TestCClient struct {
// contains filtered or unexported fields
}
TestCClient is a client for the TestC schema.
func NewTestCClient ¶
func NewTestCClient(c config) *TestCClient
NewTestCClient returns a client for the TestC from the given config.
func (*TestCClient) Create ¶
func (c *TestCClient) Create() *TestCCreate
Create returns a builder for creating a TestC entity.
func (*TestCClient) CreateBulk ¶
func (c *TestCClient) CreateBulk(builders ...*TestCCreate) *TestCCreateBulk
CreateBulk returns a builder for creating a bulk of TestC entities.
func (*TestCClient) Delete ¶
func (c *TestCClient) Delete() *TestCDelete
Delete returns a delete builder for TestC.
func (*TestCClient) DeleteOne ¶
func (c *TestCClient) DeleteOne(t *TestC) *TestCDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*TestCClient) DeleteOneID ¶
func (c *TestCClient) DeleteOneID(id int) *TestCDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*TestCClient) GetX ¶
func (c *TestCClient) GetX(ctx context.Context, id int) *TestC
GetX is like Get, but panics if an error occurs.
func (*TestCClient) Intercept ¶
func (c *TestCClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `testc.Intercept(f(g(h())))`.
func (*TestCClient) Interceptors ¶
func (c *TestCClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*TestCClient) MapCreateBulk ¶
func (c *TestCClient) MapCreateBulk(slice any, setFunc func(*TestCCreate, int)) *TestCCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*TestCClient) Query ¶
func (c *TestCClient) Query() *TestCQuery
Query returns a query builder for TestC.
func (*TestCClient) QueryTestB ¶
func (c *TestCClient) QueryTestB(t *TestC) *TestBQuery
QueryTestB queries the test_b edge of a TestC.
func (*TestCClient) Update ¶
func (c *TestCClient) Update() *TestCUpdate
Update returns an update builder for TestC.
func (*TestCClient) UpdateOne ¶
func (c *TestCClient) UpdateOne(t *TestC) *TestCUpdateOne
UpdateOne returns an update builder for the given entity.
func (*TestCClient) UpdateOneID ¶
func (c *TestCClient) UpdateOneID(id int) *TestCUpdateOne
UpdateOneID returns an update builder for the given id.
func (*TestCClient) Use ¶
func (c *TestCClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `testc.Hooks(f(g(h())))`.
type TestCCreate ¶
type TestCCreate struct {
// contains filtered or unexported fields
}
TestCCreate is the builder for creating a TestC entity.
func (*TestCCreate) Exec ¶
func (tc *TestCCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*TestCCreate) ExecX ¶
func (tc *TestCCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TestCCreate) Mutation ¶
func (tc *TestCCreate) Mutation() *TestCMutation
Mutation returns the TestCMutation object of the builder.
func (*TestCCreate) Save ¶
func (tc *TestCCreate) Save(ctx context.Context) (*TestC, error)
Save creates the TestC in the database.
func (*TestCCreate) SaveX ¶
func (tc *TestCCreate) SaveX(ctx context.Context) *TestC
SaveX calls Save and panics if Save returns an error.
func (*TestCCreate) SetBID ¶
func (tc *TestCCreate) SetBID(i int) *TestCCreate
SetBID sets the "b_id" field.
func (*TestCCreate) SetBool ¶
func (tc *TestCCreate) SetBool(b bool) *TestCCreate
SetBool sets the "bool" field.
func (*TestCCreate) SetFloat4 ¶
func (tc *TestCCreate) SetFloat4(f float32) *TestCCreate
SetFloat4 sets the "float4" field.
func (*TestCCreate) SetFloat8 ¶
func (tc *TestCCreate) SetFloat8(f float64) *TestCCreate
SetFloat8 sets the "float8" field.
func (*TestCCreate) SetID ¶
func (tc *TestCCreate) SetID(i int) *TestCCreate
SetID sets the "id" field.
func (*TestCCreate) SetInt4 ¶
func (tc *TestCCreate) SetInt4(i int32) *TestCCreate
SetInt4 sets the "int4" field.
func (*TestCCreate) SetInt8 ¶
func (tc *TestCCreate) SetInt8(i int) *TestCCreate
SetInt8 sets the "int8" field.
func (*TestCCreate) SetName ¶
func (tc *TestCCreate) SetName(s string) *TestCCreate
SetName sets the "name" field.
func (*TestCCreate) SetNillableBID ¶
func (tc *TestCCreate) SetNillableBID(i *int) *TestCCreate
SetNillableBID sets the "b_id" field if the given value is not nil.
func (*TestCCreate) SetNillableTestBID ¶
func (tc *TestCCreate) SetNillableTestBID(id *int) *TestCCreate
SetNillableTestBID sets the "test_b" edge to the TestB entity by ID if the given value is not nil.
func (*TestCCreate) SetTestB ¶
func (tc *TestCCreate) SetTestB(t *TestB) *TestCCreate
SetTestB sets the "test_b" edge to the TestB entity.
func (*TestCCreate) SetTestBID ¶
func (tc *TestCCreate) SetTestBID(id int) *TestCCreate
SetTestBID sets the "test_b" edge to the TestB entity by ID.
func (*TestCCreate) SetText ¶
func (tc *TestCCreate) SetText(s string) *TestCCreate
SetText sets the "text" field.
func (*TestCCreate) SetTime ¶
func (tc *TestCCreate) SetTime(t time.Time) *TestCCreate
SetTime sets the "time" field.
type TestCCreateBulk ¶
type TestCCreateBulk struct {
// contains filtered or unexported fields
}
TestCCreateBulk is the builder for creating many TestC entities in bulk.
func (*TestCCreateBulk) Exec ¶
func (tcb *TestCCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TestCCreateBulk) ExecX ¶
func (tcb *TestCCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type TestCDelete ¶
type TestCDelete struct {
// contains filtered or unexported fields
}
TestCDelete is the builder for deleting a TestC entity.
func (*TestCDelete) Exec ¶
func (tc *TestCDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*TestCDelete) ExecX ¶
func (tc *TestCDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*TestCDelete) Where ¶
func (tc *TestCDelete) Where(ps ...predicate.TestC) *TestCDelete
Where appends a list predicates to the TestCDelete builder.
type TestCDeleteOne ¶
type TestCDeleteOne struct {
// contains filtered or unexported fields
}
TestCDeleteOne is the builder for deleting a single TestC entity.
func (*TestCDeleteOne) Exec ¶
func (tco *TestCDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*TestCDeleteOne) ExecX ¶
func (tco *TestCDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TestCDeleteOne) Where ¶
func (tco *TestCDeleteOne) Where(ps ...predicate.TestC) *TestCDeleteOne
Where appends a list predicates to the TestCDelete builder.
type TestCEdges ¶
type TestCEdges struct { // TestB holds the value of the test_b edge. TestB *TestB `json:"test_b,omitempty"` // contains filtered or unexported fields }
TestCEdges holds the relations/edges for other nodes in the graph.
func (TestCEdges) TestBOrErr ¶
func (e TestCEdges) TestBOrErr() (*TestB, error)
TestBOrErr returns the TestB value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type TestCGroupBy ¶
type TestCGroupBy struct {
// contains filtered or unexported fields
}
TestCGroupBy is the group-by builder for TestC entities.
func (*TestCGroupBy) Aggregate ¶
func (tcb *TestCGroupBy) Aggregate(fns ...AggregateFunc) *TestCGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*TestCGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TestCGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TestCGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TestCGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TestCGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TestCGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TestCGroupBy) Scan ¶
func (tcb *TestCGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TestCGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TestCMutation ¶
type TestCMutation struct {
// contains filtered or unexported fields
}
TestCMutation represents an operation that mutates the TestC nodes in the graph.
func (*TestCMutation) AddField ¶
func (m *TestCMutation) 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 (*TestCMutation) AddFloat4 ¶
func (m *TestCMutation) AddFloat4(f float32)
AddFloat4 adds f to the "float4" field.
func (*TestCMutation) AddFloat8 ¶
func (m *TestCMutation) AddFloat8(f float64)
AddFloat8 adds f to the "float8" field.
func (*TestCMutation) AddInt4 ¶
func (m *TestCMutation) AddInt4(i int32)
AddInt4 adds i to the "int4" field.
func (*TestCMutation) AddInt8 ¶
func (m *TestCMutation) AddInt8(i int)
AddInt8 adds i to the "int8" field.
func (*TestCMutation) AddedEdges ¶
func (m *TestCMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*TestCMutation) AddedField ¶
func (m *TestCMutation) 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 (*TestCMutation) AddedFields ¶
func (m *TestCMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*TestCMutation) AddedFloat4 ¶
func (m *TestCMutation) AddedFloat4() (r float32, exists bool)
AddedFloat4 returns the value that was added to the "float4" field in this mutation.
func (*TestCMutation) AddedFloat8 ¶
func (m *TestCMutation) AddedFloat8() (r float64, exists bool)
AddedFloat8 returns the value that was added to the "float8" field in this mutation.
func (*TestCMutation) AddedIDs ¶
func (m *TestCMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*TestCMutation) AddedInt4 ¶
func (m *TestCMutation) AddedInt4() (r int32, exists bool)
AddedInt4 returns the value that was added to the "int4" field in this mutation.
func (*TestCMutation) AddedInt8 ¶
func (m *TestCMutation) AddedInt8() (r int, exists bool)
AddedInt8 returns the value that was added to the "int8" field in this mutation.
func (*TestCMutation) BID ¶
func (m *TestCMutation) BID() (r int, exists bool)
BID returns the value of the "b_id" field in the mutation.
func (*TestCMutation) BIDCleared ¶
func (m *TestCMutation) BIDCleared() bool
BIDCleared returns if the "b_id" field was cleared in this mutation.
func (*TestCMutation) Bool ¶
func (m *TestCMutation) Bool() (r bool, exists bool)
Bool returns the value of the "bool" field in the mutation.
func (*TestCMutation) ClearBID ¶
func (m *TestCMutation) ClearBID()
ClearBID clears the value of the "b_id" field.
func (*TestCMutation) ClearEdge ¶
func (m *TestCMutation) 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 (*TestCMutation) ClearField ¶
func (m *TestCMutation) 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 (*TestCMutation) ClearTestB ¶
func (m *TestCMutation) ClearTestB()
ClearTestB clears the "test_b" edge to the TestB entity.
func (*TestCMutation) ClearedEdges ¶
func (m *TestCMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*TestCMutation) ClearedFields ¶
func (m *TestCMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (TestCMutation) Client ¶
func (m TestCMutation) 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 (*TestCMutation) EdgeCleared ¶
func (m *TestCMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*TestCMutation) Field ¶
func (m *TestCMutation) 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 (*TestCMutation) FieldCleared ¶
func (m *TestCMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*TestCMutation) Fields ¶
func (m *TestCMutation) 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 (*TestCMutation) Float4 ¶
func (m *TestCMutation) Float4() (r float32, exists bool)
Float4 returns the value of the "float4" field in the mutation.
func (*TestCMutation) Float8 ¶
func (m *TestCMutation) Float8() (r float64, exists bool)
Float8 returns the value of the "float8" field in the mutation.
func (*TestCMutation) ID ¶
func (m *TestCMutation) 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 (*TestCMutation) IDs ¶
func (m *TestCMutation) 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 (*TestCMutation) Int4 ¶
func (m *TestCMutation) Int4() (r int32, exists bool)
Int4 returns the value of the "int4" field in the mutation.
func (*TestCMutation) Int8 ¶
func (m *TestCMutation) Int8() (r int, exists bool)
Int8 returns the value of the "int8" field in the mutation.
func (*TestCMutation) Name ¶
func (m *TestCMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*TestCMutation) OldBID ¶
func (m *TestCMutation) OldBID(ctx context.Context) (v int, err error)
OldBID returns the old "b_id" field's value of the TestC entity. If the TestC 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 (*TestCMutation) OldBool ¶
func (m *TestCMutation) OldBool(ctx context.Context) (v bool, err error)
OldBool returns the old "bool" field's value of the TestC entity. If the TestC 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 (*TestCMutation) 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 (*TestCMutation) OldFloat4 ¶
func (m *TestCMutation) OldFloat4(ctx context.Context) (v float32, err error)
OldFloat4 returns the old "float4" field's value of the TestC entity. If the TestC 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 (*TestCMutation) OldFloat8 ¶
func (m *TestCMutation) OldFloat8(ctx context.Context) (v float64, err error)
OldFloat8 returns the old "float8" field's value of the TestC entity. If the TestC 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 (*TestCMutation) OldInt4 ¶
func (m *TestCMutation) OldInt4(ctx context.Context) (v int32, err error)
OldInt4 returns the old "int4" field's value of the TestC entity. If the TestC 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 (*TestCMutation) OldInt8 ¶
func (m *TestCMutation) OldInt8(ctx context.Context) (v int, err error)
OldInt8 returns the old "int8" field's value of the TestC entity. If the TestC 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 (*TestCMutation) OldName ¶
func (m *TestCMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the TestC entity. If the TestC 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 (*TestCMutation) OldText ¶
func (m *TestCMutation) OldText(ctx context.Context) (v string, err error)
OldText returns the old "text" field's value of the TestC entity. If the TestC 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 (*TestCMutation) OldTime ¶
OldTime returns the old "time" field's value of the TestC entity. If the TestC 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 (*TestCMutation) RemovedEdges ¶
func (m *TestCMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*TestCMutation) RemovedIDs ¶
func (m *TestCMutation) 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 (*TestCMutation) ResetBID ¶
func (m *TestCMutation) ResetBID()
ResetBID resets all changes to the "b_id" field.
func (*TestCMutation) ResetBool ¶
func (m *TestCMutation) ResetBool()
ResetBool resets all changes to the "bool" field.
func (*TestCMutation) ResetEdge ¶
func (m *TestCMutation) 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 (*TestCMutation) ResetField ¶
func (m *TestCMutation) 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 (*TestCMutation) ResetFloat4 ¶
func (m *TestCMutation) ResetFloat4()
ResetFloat4 resets all changes to the "float4" field.
func (*TestCMutation) ResetFloat8 ¶
func (m *TestCMutation) ResetFloat8()
ResetFloat8 resets all changes to the "float8" field.
func (*TestCMutation) ResetInt4 ¶
func (m *TestCMutation) ResetInt4()
ResetInt4 resets all changes to the "int4" field.
func (*TestCMutation) ResetInt8 ¶
func (m *TestCMutation) ResetInt8()
ResetInt8 resets all changes to the "int8" field.
func (*TestCMutation) ResetName ¶
func (m *TestCMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*TestCMutation) ResetTestB ¶
func (m *TestCMutation) ResetTestB()
ResetTestB resets all changes to the "test_b" edge.
func (*TestCMutation) ResetText ¶
func (m *TestCMutation) ResetText()
ResetText resets all changes to the "text" field.
func (*TestCMutation) ResetTime ¶
func (m *TestCMutation) ResetTime()
ResetTime resets all changes to the "time" field.
func (*TestCMutation) SetBool ¶
func (m *TestCMutation) SetBool(b bool)
SetBool sets the "bool" field.
func (*TestCMutation) SetField ¶
func (m *TestCMutation) 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 (*TestCMutation) SetFloat4 ¶
func (m *TestCMutation) SetFloat4(f float32)
SetFloat4 sets the "float4" field.
func (*TestCMutation) SetFloat8 ¶
func (m *TestCMutation) SetFloat8(f float64)
SetFloat8 sets the "float8" field.
func (*TestCMutation) SetID ¶
func (m *TestCMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of TestC entities.
func (*TestCMutation) SetInt4 ¶
func (m *TestCMutation) SetInt4(i int32)
SetInt4 sets the "int4" field.
func (*TestCMutation) SetInt8 ¶
func (m *TestCMutation) SetInt8(i int)
SetInt8 sets the "int8" field.
func (*TestCMutation) SetName ¶
func (m *TestCMutation) SetName(s string)
SetName sets the "name" field.
func (*TestCMutation) SetOp ¶
func (m *TestCMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*TestCMutation) SetTestBID ¶
func (m *TestCMutation) SetTestBID(id int)
SetTestBID sets the "test_b" edge to the TestB entity by id.
func (*TestCMutation) SetText ¶
func (m *TestCMutation) SetText(s string)
SetText sets the "text" field.
func (*TestCMutation) SetTime ¶
func (m *TestCMutation) SetTime(t time.Time)
SetTime sets the "time" field.
func (*TestCMutation) TestBCleared ¶
func (m *TestCMutation) TestBCleared() bool
TestBCleared reports if the "test_b" edge to the TestB entity was cleared.
func (*TestCMutation) TestBID ¶
func (m *TestCMutation) TestBID() (id int, exists bool)
TestBID returns the "test_b" edge ID in the mutation.
func (*TestCMutation) TestBIDs ¶
func (m *TestCMutation) TestBIDs() (ids []int)
TestBIDs returns the "test_b" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TestBID instead. It exists only for internal usage by the builders.
func (*TestCMutation) Text ¶
func (m *TestCMutation) Text() (r string, exists bool)
Text returns the value of the "text" field in the mutation.
func (*TestCMutation) Time ¶
func (m *TestCMutation) Time() (r time.Time, exists bool)
Time returns the value of the "time" field in the mutation.
func (TestCMutation) Tx ¶
func (m TestCMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*TestCMutation) Type ¶
func (m *TestCMutation) Type() string
Type returns the node type of this mutation (TestC).
func (*TestCMutation) Where ¶
func (m *TestCMutation) Where(ps ...predicate.TestC)
Where appends a list predicates to the TestCMutation builder.
func (*TestCMutation) WhereP ¶
func (m *TestCMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the TestCMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type TestCQuery ¶
type TestCQuery struct {
// contains filtered or unexported fields
}
TestCQuery is the builder for querying TestC entities.
func (*TestCQuery) Aggregate ¶
func (tc *TestCQuery) Aggregate(fns ...AggregateFunc) *TestCSelect
Aggregate returns a TestCSelect configured with the given aggregations.
func (*TestCQuery) All ¶
func (tc *TestCQuery) All(ctx context.Context) ([]*TestC, error)
All executes the query and returns a list of TestCs.
func (*TestCQuery) AllX ¶
func (tc *TestCQuery) AllX(ctx context.Context) []*TestC
AllX is like All, but panics if an error occurs.
func (*TestCQuery) Clone ¶
func (tc *TestCQuery) Clone() *TestCQuery
Clone returns a duplicate of the TestCQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*TestCQuery) Count ¶
func (tc *TestCQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*TestCQuery) CountX ¶
func (tc *TestCQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*TestCQuery) Exist ¶
func (tc *TestCQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*TestCQuery) ExistX ¶
func (tc *TestCQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*TestCQuery) First ¶
func (tc *TestCQuery) First(ctx context.Context) (*TestC, error)
First returns the first TestC entity from the query. Returns a *NotFoundError when no TestC was found.
func (*TestCQuery) FirstID ¶
func (tc *TestCQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first TestC ID from the query. Returns a *NotFoundError when no TestC ID was found.
func (*TestCQuery) FirstIDX ¶
func (tc *TestCQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*TestCQuery) FirstX ¶
func (tc *TestCQuery) FirstX(ctx context.Context) *TestC
FirstX is like First, but panics if an error occurs.
func (*TestCQuery) GroupBy ¶
func (tc *TestCQuery) GroupBy(field string, fields ...string) *TestCGroupBy
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 { BID int `json:"b_id,omitempty"` Count int `json:"count,omitempty"` } client.TestC.Query(). GroupBy(testc.FieldBID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*TestCQuery) IDs ¶
func (tc *TestCQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of TestC IDs.
func (*TestCQuery) IDsX ¶
func (tc *TestCQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*TestCQuery) Limit ¶
func (tc *TestCQuery) Limit(limit int) *TestCQuery
Limit the number of records to be returned by this query.
func (*TestCQuery) Offset ¶
func (tc *TestCQuery) Offset(offset int) *TestCQuery
Offset to start from.
func (*TestCQuery) Only ¶
func (tc *TestCQuery) Only(ctx context.Context) (*TestC, error)
Only returns a single TestC entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one TestC entity is found. Returns a *NotFoundError when no TestC entities are found.
func (*TestCQuery) OnlyID ¶
func (tc *TestCQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only TestC ID in the query. Returns a *NotSingularError when more than one TestC ID is found. Returns a *NotFoundError when no entities are found.
func (*TestCQuery) OnlyIDX ¶
func (tc *TestCQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*TestCQuery) OnlyX ¶
func (tc *TestCQuery) OnlyX(ctx context.Context) *TestC
OnlyX is like Only, but panics if an error occurs.
func (*TestCQuery) Order ¶
func (tc *TestCQuery) Order(o ...testc.OrderOption) *TestCQuery
Order specifies how the records should be ordered.
func (*TestCQuery) QueryTestB ¶
func (tc *TestCQuery) QueryTestB() *TestBQuery
QueryTestB chains the current query on the "test_b" edge.
func (*TestCQuery) Select ¶
func (tc *TestCQuery) Select(fields ...string) *TestCSelect
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 { BID int `json:"b_id,omitempty"` } client.TestC.Query(). Select(testc.FieldBID). Scan(ctx, &v)
func (*TestCQuery) Unique ¶
func (tc *TestCQuery) Unique(unique bool) *TestCQuery
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 (*TestCQuery) Where ¶
func (tc *TestCQuery) Where(ps ...predicate.TestC) *TestCQuery
Where adds a new predicate for the TestCQuery builder.
func (*TestCQuery) WithTestB ¶
func (tc *TestCQuery) WithTestB(opts ...func(*TestBQuery)) *TestCQuery
WithTestB tells the query-builder to eager-load the nodes that are connected to the "test_b" edge. The optional arguments are used to configure the query builder of the edge.
type TestCSelect ¶
type TestCSelect struct { *TestCQuery // contains filtered or unexported fields }
TestCSelect is the builder for selecting fields of TestC entities.
func (*TestCSelect) Aggregate ¶
func (tc *TestCSelect) Aggregate(fns ...AggregateFunc) *TestCSelect
Aggregate adds the given aggregation functions to the selector query.
func (*TestCSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TestCSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TestCSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TestCSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TestCSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TestCSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TestCSelect) Scan ¶
func (tc *TestCSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TestCSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TestCUpdate ¶
type TestCUpdate struct {
// contains filtered or unexported fields
}
TestCUpdate is the builder for updating TestC entities.
func (*TestCUpdate) AddFloat4 ¶
func (tc *TestCUpdate) AddFloat4(f float32) *TestCUpdate
AddFloat4 adds f to the "float4" field.
func (*TestCUpdate) AddFloat8 ¶
func (tc *TestCUpdate) AddFloat8(f float64) *TestCUpdate
AddFloat8 adds f to the "float8" field.
func (*TestCUpdate) AddInt4 ¶
func (tc *TestCUpdate) AddInt4(i int32) *TestCUpdate
AddInt4 adds i to the "int4" field.
func (*TestCUpdate) AddInt8 ¶
func (tc *TestCUpdate) AddInt8(i int) *TestCUpdate
AddInt8 adds i to the "int8" field.
func (*TestCUpdate) ClearBID ¶
func (tc *TestCUpdate) ClearBID() *TestCUpdate
ClearBID clears the value of the "b_id" field.
func (*TestCUpdate) ClearTestB ¶
func (tc *TestCUpdate) ClearTestB() *TestCUpdate
ClearTestB clears the "test_b" edge to the TestB entity.
func (*TestCUpdate) Exec ¶
func (tc *TestCUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*TestCUpdate) ExecX ¶
func (tc *TestCUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TestCUpdate) Mutation ¶
func (tc *TestCUpdate) Mutation() *TestCMutation
Mutation returns the TestCMutation object of the builder.
func (*TestCUpdate) Save ¶
func (tc *TestCUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*TestCUpdate) SaveX ¶
func (tc *TestCUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*TestCUpdate) SetBID ¶
func (tc *TestCUpdate) SetBID(i int) *TestCUpdate
SetBID sets the "b_id" field.
func (*TestCUpdate) SetBool ¶
func (tc *TestCUpdate) SetBool(b bool) *TestCUpdate
SetBool sets the "bool" field.
func (*TestCUpdate) SetFloat4 ¶
func (tc *TestCUpdate) SetFloat4(f float32) *TestCUpdate
SetFloat4 sets the "float4" field.
func (*TestCUpdate) SetFloat8 ¶
func (tc *TestCUpdate) SetFloat8(f float64) *TestCUpdate
SetFloat8 sets the "float8" field.
func (*TestCUpdate) SetInt4 ¶
func (tc *TestCUpdate) SetInt4(i int32) *TestCUpdate
SetInt4 sets the "int4" field.
func (*TestCUpdate) SetInt8 ¶
func (tc *TestCUpdate) SetInt8(i int) *TestCUpdate
SetInt8 sets the "int8" field.
func (*TestCUpdate) SetName ¶
func (tc *TestCUpdate) SetName(s string) *TestCUpdate
SetName sets the "name" field.
func (*TestCUpdate) SetNillableBID ¶
func (tc *TestCUpdate) SetNillableBID(i *int) *TestCUpdate
SetNillableBID sets the "b_id" field if the given value is not nil.
func (*TestCUpdate) SetNillableBool ¶
func (tc *TestCUpdate) SetNillableBool(b *bool) *TestCUpdate
SetNillableBool sets the "bool" field if the given value is not nil.
func (*TestCUpdate) SetNillableFloat4 ¶
func (tc *TestCUpdate) SetNillableFloat4(f *float32) *TestCUpdate
SetNillableFloat4 sets the "float4" field if the given value is not nil.
func (*TestCUpdate) SetNillableFloat8 ¶
func (tc *TestCUpdate) SetNillableFloat8(f *float64) *TestCUpdate
SetNillableFloat8 sets the "float8" field if the given value is not nil.
func (*TestCUpdate) SetNillableInt4 ¶
func (tc *TestCUpdate) SetNillableInt4(i *int32) *TestCUpdate
SetNillableInt4 sets the "int4" field if the given value is not nil.
func (*TestCUpdate) SetNillableInt8 ¶
func (tc *TestCUpdate) SetNillableInt8(i *int) *TestCUpdate
SetNillableInt8 sets the "int8" field if the given value is not nil.
func (*TestCUpdate) SetNillableName ¶
func (tc *TestCUpdate) SetNillableName(s *string) *TestCUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*TestCUpdate) SetNillableTestBID ¶
func (tc *TestCUpdate) SetNillableTestBID(id *int) *TestCUpdate
SetNillableTestBID sets the "test_b" edge to the TestB entity by ID if the given value is not nil.
func (*TestCUpdate) SetNillableText ¶
func (tc *TestCUpdate) SetNillableText(s *string) *TestCUpdate
SetNillableText sets the "text" field if the given value is not nil.
func (*TestCUpdate) SetNillableTime ¶
func (tc *TestCUpdate) SetNillableTime(t *time.Time) *TestCUpdate
SetNillableTime sets the "time" field if the given value is not nil.
func (*TestCUpdate) SetTestB ¶
func (tc *TestCUpdate) SetTestB(t *TestB) *TestCUpdate
SetTestB sets the "test_b" edge to the TestB entity.
func (*TestCUpdate) SetTestBID ¶
func (tc *TestCUpdate) SetTestBID(id int) *TestCUpdate
SetTestBID sets the "test_b" edge to the TestB entity by ID.
func (*TestCUpdate) SetText ¶
func (tc *TestCUpdate) SetText(s string) *TestCUpdate
SetText sets the "text" field.
func (*TestCUpdate) SetTime ¶
func (tc *TestCUpdate) SetTime(t time.Time) *TestCUpdate
SetTime sets the "time" field.
func (*TestCUpdate) Where ¶
func (tc *TestCUpdate) Where(ps ...predicate.TestC) *TestCUpdate
Where appends a list predicates to the TestCUpdate builder.
type TestCUpdateOne ¶
type TestCUpdateOne struct {
// contains filtered or unexported fields
}
TestCUpdateOne is the builder for updating a single TestC entity.
func (*TestCUpdateOne) AddFloat4 ¶
func (tco *TestCUpdateOne) AddFloat4(f float32) *TestCUpdateOne
AddFloat4 adds f to the "float4" field.
func (*TestCUpdateOne) AddFloat8 ¶
func (tco *TestCUpdateOne) AddFloat8(f float64) *TestCUpdateOne
AddFloat8 adds f to the "float8" field.
func (*TestCUpdateOne) AddInt4 ¶
func (tco *TestCUpdateOne) AddInt4(i int32) *TestCUpdateOne
AddInt4 adds i to the "int4" field.
func (*TestCUpdateOne) AddInt8 ¶
func (tco *TestCUpdateOne) AddInt8(i int) *TestCUpdateOne
AddInt8 adds i to the "int8" field.
func (*TestCUpdateOne) ClearBID ¶
func (tco *TestCUpdateOne) ClearBID() *TestCUpdateOne
ClearBID clears the value of the "b_id" field.
func (*TestCUpdateOne) ClearTestB ¶
func (tco *TestCUpdateOne) ClearTestB() *TestCUpdateOne
ClearTestB clears the "test_b" edge to the TestB entity.
func (*TestCUpdateOne) Exec ¶
func (tco *TestCUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*TestCUpdateOne) ExecX ¶
func (tco *TestCUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TestCUpdateOne) Mutation ¶
func (tco *TestCUpdateOne) Mutation() *TestCMutation
Mutation returns the TestCMutation object of the builder.
func (*TestCUpdateOne) Save ¶
func (tco *TestCUpdateOne) Save(ctx context.Context) (*TestC, error)
Save executes the query and returns the updated TestC entity.
func (*TestCUpdateOne) SaveX ¶
func (tco *TestCUpdateOne) SaveX(ctx context.Context) *TestC
SaveX is like Save, but panics if an error occurs.
func (*TestCUpdateOne) Select ¶
func (tco *TestCUpdateOne) Select(field string, fields ...string) *TestCUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*TestCUpdateOne) SetBID ¶
func (tco *TestCUpdateOne) SetBID(i int) *TestCUpdateOne
SetBID sets the "b_id" field.
func (*TestCUpdateOne) SetBool ¶
func (tco *TestCUpdateOne) SetBool(b bool) *TestCUpdateOne
SetBool sets the "bool" field.
func (*TestCUpdateOne) SetFloat4 ¶
func (tco *TestCUpdateOne) SetFloat4(f float32) *TestCUpdateOne
SetFloat4 sets the "float4" field.
func (*TestCUpdateOne) SetFloat8 ¶
func (tco *TestCUpdateOne) SetFloat8(f float64) *TestCUpdateOne
SetFloat8 sets the "float8" field.
func (*TestCUpdateOne) SetInt4 ¶
func (tco *TestCUpdateOne) SetInt4(i int32) *TestCUpdateOne
SetInt4 sets the "int4" field.
func (*TestCUpdateOne) SetInt8 ¶
func (tco *TestCUpdateOne) SetInt8(i int) *TestCUpdateOne
SetInt8 sets the "int8" field.
func (*TestCUpdateOne) SetName ¶
func (tco *TestCUpdateOne) SetName(s string) *TestCUpdateOne
SetName sets the "name" field.
func (*TestCUpdateOne) SetNillableBID ¶
func (tco *TestCUpdateOne) SetNillableBID(i *int) *TestCUpdateOne
SetNillableBID sets the "b_id" field if the given value is not nil.
func (*TestCUpdateOne) SetNillableBool ¶
func (tco *TestCUpdateOne) SetNillableBool(b *bool) *TestCUpdateOne
SetNillableBool sets the "bool" field if the given value is not nil.
func (*TestCUpdateOne) SetNillableFloat4 ¶
func (tco *TestCUpdateOne) SetNillableFloat4(f *float32) *TestCUpdateOne
SetNillableFloat4 sets the "float4" field if the given value is not nil.
func (*TestCUpdateOne) SetNillableFloat8 ¶
func (tco *TestCUpdateOne) SetNillableFloat8(f *float64) *TestCUpdateOne
SetNillableFloat8 sets the "float8" field if the given value is not nil.
func (*TestCUpdateOne) SetNillableInt4 ¶
func (tco *TestCUpdateOne) SetNillableInt4(i *int32) *TestCUpdateOne
SetNillableInt4 sets the "int4" field if the given value is not nil.
func (*TestCUpdateOne) SetNillableInt8 ¶
func (tco *TestCUpdateOne) SetNillableInt8(i *int) *TestCUpdateOne
SetNillableInt8 sets the "int8" field if the given value is not nil.
func (*TestCUpdateOne) SetNillableName ¶
func (tco *TestCUpdateOne) SetNillableName(s *string) *TestCUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*TestCUpdateOne) SetNillableTestBID ¶
func (tco *TestCUpdateOne) SetNillableTestBID(id *int) *TestCUpdateOne
SetNillableTestBID sets the "test_b" edge to the TestB entity by ID if the given value is not nil.
func (*TestCUpdateOne) SetNillableText ¶
func (tco *TestCUpdateOne) SetNillableText(s *string) *TestCUpdateOne
SetNillableText sets the "text" field if the given value is not nil.
func (*TestCUpdateOne) SetNillableTime ¶
func (tco *TestCUpdateOne) SetNillableTime(t *time.Time) *TestCUpdateOne
SetNillableTime sets the "time" field if the given value is not nil.
func (*TestCUpdateOne) SetTestB ¶
func (tco *TestCUpdateOne) SetTestB(t *TestB) *TestCUpdateOne
SetTestB sets the "test_b" edge to the TestB entity.
func (*TestCUpdateOne) SetTestBID ¶
func (tco *TestCUpdateOne) SetTestBID(id int) *TestCUpdateOne
SetTestBID sets the "test_b" edge to the TestB entity by ID.
func (*TestCUpdateOne) SetText ¶
func (tco *TestCUpdateOne) SetText(s string) *TestCUpdateOne
SetText sets the "text" field.
func (*TestCUpdateOne) SetTime ¶
func (tco *TestCUpdateOne) SetTime(t time.Time) *TestCUpdateOne
SetTime sets the "time" field.
func (*TestCUpdateOne) Where ¶
func (tco *TestCUpdateOne) Where(ps ...predicate.TestC) *TestCUpdateOne
Where appends a list predicates to the TestCUpdate builder.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // TestA is the client for interacting with the TestA builders. TestA *TestAClient // TestB is the client for interacting with the TestB builders. TestB *TestBClient // TestC is the client for interacting with the TestC builders. TestC *TestCClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.