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 Post
- type PostClient
- func (c *PostClient) Create() *PostCreate
- func (c *PostClient) CreateBulk(builders ...*PostCreate) *PostCreateBulk
- func (c *PostClient) Delete() *PostDelete
- func (c *PostClient) DeleteOne(po *Post) *PostDeleteOne
- func (c *PostClient) DeleteOneID(id int) *PostDeleteOne
- func (c *PostClient) Get(ctx context.Context, id int) (*Post, error)
- func (c *PostClient) GetX(ctx context.Context, id int) *Post
- func (c *PostClient) Hooks() []Hook
- func (c *PostClient) Intercept(interceptors ...Interceptor)
- func (c *PostClient) Interceptors() []Interceptor
- func (c *PostClient) MapCreateBulk(slice any, setFunc func(*PostCreate, int)) *PostCreateBulk
- func (c *PostClient) Query() *PostQuery
- func (c *PostClient) Update() *PostUpdate
- func (c *PostClient) UpdateOne(po *Post) *PostUpdateOne
- func (c *PostClient) UpdateOneID(id int) *PostUpdateOne
- func (c *PostClient) Use(hooks ...Hook)
- type PostCreate
- func (pc *PostCreate) Exec(ctx context.Context) error
- func (pc *PostCreate) ExecX(ctx context.Context)
- func (pc *PostCreate) Mutation() *PostMutation
- func (pc *PostCreate) OnConflict(opts ...sql.ConflictOption) *PostUpsertOne
- func (pc *PostCreate) OnConflictColumns(columns ...string) *PostUpsertOne
- func (pc *PostCreate) Save(ctx context.Context) (*Post, error)
- func (pc *PostCreate) SaveX(ctx context.Context) *Post
- func (pc *PostCreate) SetDescription(s string) *PostCreate
- func (pc *PostCreate) SetDsn(s string) *PostCreate
- func (pc *PostCreate) SetID(i int) *PostCreate
- func (pc *PostCreate) SetNillableDescription(s *string) *PostCreate
- func (pc *PostCreate) SetNillableDsn(s *string) *PostCreate
- func (pc *PostCreate) SetTenantID(ss *sql.NullString) *PostCreate
- func (pc *PostCreate) SetTitle(s string) *PostCreate
- type PostCreateBulk
- func (pcb *PostCreateBulk) Exec(ctx context.Context) error
- func (pcb *PostCreateBulk) ExecX(ctx context.Context)
- func (pcb *PostCreateBulk) OnConflict(opts ...sql.ConflictOption) *PostUpsertBulk
- func (pcb *PostCreateBulk) OnConflictColumns(columns ...string) *PostUpsertBulk
- func (pcb *PostCreateBulk) Save(ctx context.Context) ([]*Post, error)
- func (pcb *PostCreateBulk) SaveX(ctx context.Context) []*Post
- type PostDelete
- type PostDeleteOne
- type PostGroupBy
- func (pgb *PostGroupBy) Aggregate(fns ...AggregateFunc) *PostGroupBy
- func (s *PostGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *PostGroupBy) BoolX(ctx context.Context) bool
- func (s *PostGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *PostGroupBy) BoolsX(ctx context.Context) []bool
- func (s *PostGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *PostGroupBy) Float64X(ctx context.Context) float64
- func (s *PostGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *PostGroupBy) Float64sX(ctx context.Context) []float64
- func (s *PostGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *PostGroupBy) IntX(ctx context.Context) int
- func (s *PostGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *PostGroupBy) IntsX(ctx context.Context) []int
- func (pgb *PostGroupBy) Scan(ctx context.Context, v any) error
- func (s *PostGroupBy) ScanX(ctx context.Context, v any)
- func (s *PostGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *PostGroupBy) StringX(ctx context.Context) string
- func (s *PostGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *PostGroupBy) StringsX(ctx context.Context) []string
- type PostMutation
- func (m *PostMutation) AddField(name string, value ent.Value) error
- func (m *PostMutation) AddedEdges() []string
- func (m *PostMutation) AddedField(name string) (ent.Value, bool)
- func (m *PostMutation) AddedFields() []string
- func (m *PostMutation) AddedIDs(name string) []ent.Value
- func (m *PostMutation) ClearDescription()
- func (m *PostMutation) ClearDsn()
- func (m *PostMutation) ClearEdge(name string) error
- func (m *PostMutation) ClearField(name string) error
- func (m *PostMutation) ClearTenantID()
- func (m *PostMutation) ClearedEdges() []string
- func (m *PostMutation) ClearedFields() []string
- func (m PostMutation) Client() *Client
- func (m *PostMutation) Description() (r string, exists bool)
- func (m *PostMutation) DescriptionCleared() bool
- func (m *PostMutation) Dsn() (r string, exists bool)
- func (m *PostMutation) DsnCleared() bool
- func (m *PostMutation) EdgeCleared(name string) bool
- func (m *PostMutation) Field(name string) (ent.Value, bool)
- func (m *PostMutation) FieldCleared(name string) bool
- func (m *PostMutation) Fields() []string
- func (m *PostMutation) ID() (id int, exists bool)
- func (m *PostMutation) IDs(ctx context.Context) ([]int, error)
- func (m *PostMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *PostMutation) OldDsn(ctx context.Context) (v string, err error)
- func (m *PostMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *PostMutation) OldTenantID(ctx context.Context) (v *sql.NullString, err error)
- func (m *PostMutation) OldTitle(ctx context.Context) (v string, err error)
- func (m *PostMutation) Op() Op
- func (m *PostMutation) RemovedEdges() []string
- func (m *PostMutation) RemovedIDs(name string) []ent.Value
- func (m *PostMutation) ResetDescription()
- func (m *PostMutation) ResetDsn()
- func (m *PostMutation) ResetEdge(name string) error
- func (m *PostMutation) ResetField(name string) error
- func (m *PostMutation) ResetTenantID()
- func (m *PostMutation) ResetTitle()
- func (m *PostMutation) SetDescription(s string)
- func (m *PostMutation) SetDsn(s string)
- func (m *PostMutation) SetField(name string, value ent.Value) error
- func (m *PostMutation) SetID(id int)
- func (m *PostMutation) SetOp(op Op)
- func (m *PostMutation) SetTenantID(ss *sql.NullString)
- func (m *PostMutation) SetTitle(s string)
- func (m *PostMutation) TenantID() (r *sql.NullString, exists bool)
- func (m *PostMutation) TenantIDCleared() bool
- func (m *PostMutation) Title() (r string, exists bool)
- func (m PostMutation) Tx() (*Tx, error)
- func (m *PostMutation) Type() string
- func (m *PostMutation) Where(ps ...predicate.Post)
- func (m *PostMutation) WhereP(ps ...func(*sql.Selector))
- type PostQuery
- func (pq *PostQuery) Aggregate(fns ...AggregateFunc) *PostSelect
- func (pq *PostQuery) All(ctx context.Context) ([]*Post, error)
- func (pq *PostQuery) AllX(ctx context.Context) []*Post
- func (pq *PostQuery) Clone() *PostQuery
- func (pq *PostQuery) Count(ctx context.Context) (int, error)
- func (pq *PostQuery) CountX(ctx context.Context) int
- func (pq *PostQuery) Exist(ctx context.Context) (bool, error)
- func (pq *PostQuery) ExistX(ctx context.Context) bool
- func (pq *PostQuery) First(ctx context.Context) (*Post, error)
- func (pq *PostQuery) FirstID(ctx context.Context) (id int, err error)
- func (pq *PostQuery) FirstIDX(ctx context.Context) int
- func (pq *PostQuery) FirstX(ctx context.Context) *Post
- func (pq *PostQuery) GroupBy(field string, fields ...string) *PostGroupBy
- func (pq *PostQuery) IDs(ctx context.Context) (ids []int, err error)
- func (pq *PostQuery) IDsX(ctx context.Context) []int
- func (pq *PostQuery) Limit(limit int) *PostQuery
- func (pq *PostQuery) Offset(offset int) *PostQuery
- func (pq *PostQuery) Only(ctx context.Context) (*Post, error)
- func (pq *PostQuery) OnlyID(ctx context.Context) (id int, err error)
- func (pq *PostQuery) OnlyIDX(ctx context.Context) int
- func (pq *PostQuery) OnlyX(ctx context.Context) *Post
- func (pq *PostQuery) Order(o ...post.OrderOption) *PostQuery
- func (pq *PostQuery) Select(fields ...string) *PostSelect
- func (pq *PostQuery) Unique(unique bool) *PostQuery
- func (pq *PostQuery) Where(ps ...predicate.Post) *PostQuery
- type PostSelect
- func (ps *PostSelect) Aggregate(fns ...AggregateFunc) *PostSelect
- func (s *PostSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *PostSelect) BoolX(ctx context.Context) bool
- func (s *PostSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *PostSelect) BoolsX(ctx context.Context) []bool
- func (s *PostSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *PostSelect) Float64X(ctx context.Context) float64
- func (s *PostSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *PostSelect) Float64sX(ctx context.Context) []float64
- func (s *PostSelect) Int(ctx context.Context) (_ int, err error)
- func (s *PostSelect) IntX(ctx context.Context) int
- func (s *PostSelect) Ints(ctx context.Context) ([]int, error)
- func (s *PostSelect) IntsX(ctx context.Context) []int
- func (ps *PostSelect) Scan(ctx context.Context, v any) error
- func (s *PostSelect) ScanX(ctx context.Context, v any)
- func (s *PostSelect) String(ctx context.Context) (_ string, err error)
- func (s *PostSelect) StringX(ctx context.Context) string
- func (s *PostSelect) Strings(ctx context.Context) ([]string, error)
- func (s *PostSelect) StringsX(ctx context.Context) []string
- type PostUpdate
- func (pu *PostUpdate) ClearDescription() *PostUpdate
- func (pu *PostUpdate) ClearDsn() *PostUpdate
- func (pu *PostUpdate) ClearTenantID() *PostUpdate
- func (pu *PostUpdate) Exec(ctx context.Context) error
- func (pu *PostUpdate) ExecX(ctx context.Context)
- func (pu *PostUpdate) Mutation() *PostMutation
- func (pu *PostUpdate) Save(ctx context.Context) (int, error)
- func (pu *PostUpdate) SaveX(ctx context.Context) int
- func (pu *PostUpdate) SetDescription(s string) *PostUpdate
- func (pu *PostUpdate) SetDsn(s string) *PostUpdate
- func (pu *PostUpdate) SetNillableDescription(s *string) *PostUpdate
- func (pu *PostUpdate) SetNillableDsn(s *string) *PostUpdate
- func (pu *PostUpdate) SetTenantID(ss *sql.NullString) *PostUpdate
- func (pu *PostUpdate) SetTitle(s string) *PostUpdate
- func (pu *PostUpdate) Where(ps ...predicate.Post) *PostUpdate
- type PostUpdateOne
- func (puo *PostUpdateOne) ClearDescription() *PostUpdateOne
- func (puo *PostUpdateOne) ClearDsn() *PostUpdateOne
- func (puo *PostUpdateOne) ClearTenantID() *PostUpdateOne
- func (puo *PostUpdateOne) Exec(ctx context.Context) error
- func (puo *PostUpdateOne) ExecX(ctx context.Context)
- func (puo *PostUpdateOne) Mutation() *PostMutation
- func (puo *PostUpdateOne) Save(ctx context.Context) (*Post, error)
- func (puo *PostUpdateOne) SaveX(ctx context.Context) *Post
- func (puo *PostUpdateOne) Select(field string, fields ...string) *PostUpdateOne
- func (puo *PostUpdateOne) SetDescription(s string) *PostUpdateOne
- func (puo *PostUpdateOne) SetDsn(s string) *PostUpdateOne
- func (puo *PostUpdateOne) SetNillableDescription(s *string) *PostUpdateOne
- func (puo *PostUpdateOne) SetNillableDsn(s *string) *PostUpdateOne
- func (puo *PostUpdateOne) SetTenantID(ss *sql.NullString) *PostUpdateOne
- func (puo *PostUpdateOne) SetTitle(s string) *PostUpdateOne
- func (puo *PostUpdateOne) Where(ps ...predicate.Post) *PostUpdateOne
- type PostUpsert
- func (u *PostUpsert) ClearDescription() *PostUpsert
- func (u *PostUpsert) ClearDsn() *PostUpsert
- func (u *PostUpsert) ClearTenantID() *PostUpsert
- func (u *PostUpsert) SetDescription(v string) *PostUpsert
- func (u *PostUpsert) SetDsn(v string) *PostUpsert
- func (u *PostUpsert) SetTenantID(v *sql.NullString) *PostUpsert
- func (u *PostUpsert) SetTitle(v string) *PostUpsert
- func (u *PostUpsert) UpdateDescription() *PostUpsert
- func (u *PostUpsert) UpdateDsn() *PostUpsert
- func (u *PostUpsert) UpdateTenantID() *PostUpsert
- func (u *PostUpsert) UpdateTitle() *PostUpsert
- type PostUpsertBulk
- func (u *PostUpsertBulk) ClearDescription() *PostUpsertBulk
- func (u *PostUpsertBulk) ClearDsn() *PostUpsertBulk
- func (u *PostUpsertBulk) ClearTenantID() *PostUpsertBulk
- func (u *PostUpsertBulk) DoNothing() *PostUpsertBulk
- func (u *PostUpsertBulk) Exec(ctx context.Context) error
- func (u *PostUpsertBulk) ExecX(ctx context.Context)
- func (u *PostUpsertBulk) Ignore() *PostUpsertBulk
- func (u *PostUpsertBulk) SetDescription(v string) *PostUpsertBulk
- func (u *PostUpsertBulk) SetDsn(v string) *PostUpsertBulk
- func (u *PostUpsertBulk) SetTenantID(v *sql.NullString) *PostUpsertBulk
- func (u *PostUpsertBulk) SetTitle(v string) *PostUpsertBulk
- func (u *PostUpsertBulk) Update(set func(*PostUpsert)) *PostUpsertBulk
- func (u *PostUpsertBulk) UpdateDescription() *PostUpsertBulk
- func (u *PostUpsertBulk) UpdateDsn() *PostUpsertBulk
- func (u *PostUpsertBulk) UpdateNewValues() *PostUpsertBulk
- func (u *PostUpsertBulk) UpdateTenantID() *PostUpsertBulk
- func (u *PostUpsertBulk) UpdateTitle() *PostUpsertBulk
- type PostUpsertOne
- func (u *PostUpsertOne) ClearDescription() *PostUpsertOne
- func (u *PostUpsertOne) ClearDsn() *PostUpsertOne
- func (u *PostUpsertOne) ClearTenantID() *PostUpsertOne
- func (u *PostUpsertOne) DoNothing() *PostUpsertOne
- func (u *PostUpsertOne) Exec(ctx context.Context) error
- func (u *PostUpsertOne) ExecX(ctx context.Context)
- func (u *PostUpsertOne) ID(ctx context.Context) (id int, err error)
- func (u *PostUpsertOne) IDX(ctx context.Context) int
- func (u *PostUpsertOne) Ignore() *PostUpsertOne
- func (u *PostUpsertOne) SetDescription(v string) *PostUpsertOne
- func (u *PostUpsertOne) SetDsn(v string) *PostUpsertOne
- func (u *PostUpsertOne) SetTenantID(v *sql.NullString) *PostUpsertOne
- func (u *PostUpsertOne) SetTitle(v string) *PostUpsertOne
- func (u *PostUpsertOne) Update(set func(*PostUpsert)) *PostUpsertOne
- func (u *PostUpsertOne) UpdateDescription() *PostUpsertOne
- func (u *PostUpsertOne) UpdateDsn() *PostUpsertOne
- func (u *PostUpsertOne) UpdateNewValues() *PostUpsertOne
- func (u *PostUpsertOne) UpdateTenantID() *PostUpsertOne
- func (u *PostUpsertOne) UpdateTitle() *PostUpsertOne
- type Posts
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Tenant
- type TenantClient
- func (c *TenantClient) Create() *TenantCreate
- func (c *TenantClient) CreateBulk(builders ...*TenantCreate) *TenantCreateBulk
- func (c *TenantClient) Delete() *TenantDelete
- func (c *TenantClient) DeleteOne(t *Tenant) *TenantDeleteOne
- func (c *TenantClient) DeleteOneID(id int) *TenantDeleteOne
- func (c *TenantClient) Get(ctx context.Context, id int) (*Tenant, error)
- func (c *TenantClient) GetX(ctx context.Context, id int) *Tenant
- func (c *TenantClient) Hooks() []Hook
- func (c *TenantClient) Intercept(interceptors ...Interceptor)
- func (c *TenantClient) Interceptors() []Interceptor
- func (c *TenantClient) MapCreateBulk(slice any, setFunc func(*TenantCreate, int)) *TenantCreateBulk
- func (c *TenantClient) Query() *TenantQuery
- func (c *TenantClient) QueryConn(t *Tenant) *TenantConnQuery
- func (c *TenantClient) Update() *TenantUpdate
- func (c *TenantClient) UpdateOne(t *Tenant) *TenantUpdateOne
- func (c *TenantClient) UpdateOneID(id int) *TenantUpdateOne
- func (c *TenantClient) Use(hooks ...Hook)
- type TenantConn
- type TenantConnClient
- func (c *TenantConnClient) Create() *TenantConnCreate
- func (c *TenantConnClient) CreateBulk(builders ...*TenantConnCreate) *TenantConnCreateBulk
- func (c *TenantConnClient) Delete() *TenantConnDelete
- func (c *TenantConnClient) DeleteOne(tc *TenantConn) *TenantConnDeleteOne
- func (c *TenantConnClient) DeleteOneID(id int) *TenantConnDeleteOne
- func (c *TenantConnClient) Get(ctx context.Context, id int) (*TenantConn, error)
- func (c *TenantConnClient) GetX(ctx context.Context, id int) *TenantConn
- func (c *TenantConnClient) Hooks() []Hook
- func (c *TenantConnClient) Intercept(interceptors ...Interceptor)
- func (c *TenantConnClient) Interceptors() []Interceptor
- func (c *TenantConnClient) MapCreateBulk(slice any, setFunc func(*TenantConnCreate, int)) *TenantConnCreateBulk
- func (c *TenantConnClient) Query() *TenantConnQuery
- func (c *TenantConnClient) Update() *TenantConnUpdate
- func (c *TenantConnClient) UpdateOne(tc *TenantConn) *TenantConnUpdateOne
- func (c *TenantConnClient) UpdateOneID(id int) *TenantConnUpdateOne
- func (c *TenantConnClient) Use(hooks ...Hook)
- type TenantConnCreate
- func (tcc *TenantConnCreate) Exec(ctx context.Context) error
- func (tcc *TenantConnCreate) ExecX(ctx context.Context)
- func (tcc *TenantConnCreate) Mutation() *TenantConnMutation
- func (tcc *TenantConnCreate) OnConflict(opts ...sql.ConflictOption) *TenantConnUpsertOne
- func (tcc *TenantConnCreate) OnConflictColumns(columns ...string) *TenantConnUpsertOne
- func (tcc *TenantConnCreate) Save(ctx context.Context) (*TenantConn, error)
- func (tcc *TenantConnCreate) SaveX(ctx context.Context) *TenantConn
- func (tcc *TenantConnCreate) SetCreateTime(t time.Time) *TenantConnCreate
- func (tcc *TenantConnCreate) SetKey(s string) *TenantConnCreate
- func (tcc *TenantConnCreate) SetNillableCreateTime(t *time.Time) *TenantConnCreate
- func (tcc *TenantConnCreate) SetNillableUpdateTime(t *time.Time) *TenantConnCreate
- func (tcc *TenantConnCreate) SetUpdateTime(t time.Time) *TenantConnCreate
- func (tcc *TenantConnCreate) SetValue(s string) *TenantConnCreate
- type TenantConnCreateBulk
- func (tccb *TenantConnCreateBulk) Exec(ctx context.Context) error
- func (tccb *TenantConnCreateBulk) ExecX(ctx context.Context)
- func (tccb *TenantConnCreateBulk) OnConflict(opts ...sql.ConflictOption) *TenantConnUpsertBulk
- func (tccb *TenantConnCreateBulk) OnConflictColumns(columns ...string) *TenantConnUpsertBulk
- func (tccb *TenantConnCreateBulk) Save(ctx context.Context) ([]*TenantConn, error)
- func (tccb *TenantConnCreateBulk) SaveX(ctx context.Context) []*TenantConn
- type TenantConnDelete
- type TenantConnDeleteOne
- type TenantConnGroupBy
- func (tcgb *TenantConnGroupBy) Aggregate(fns ...AggregateFunc) *TenantConnGroupBy
- func (s *TenantConnGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *TenantConnGroupBy) BoolX(ctx context.Context) bool
- func (s *TenantConnGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *TenantConnGroupBy) BoolsX(ctx context.Context) []bool
- func (s *TenantConnGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *TenantConnGroupBy) Float64X(ctx context.Context) float64
- func (s *TenantConnGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *TenantConnGroupBy) Float64sX(ctx context.Context) []float64
- func (s *TenantConnGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *TenantConnGroupBy) IntX(ctx context.Context) int
- func (s *TenantConnGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *TenantConnGroupBy) IntsX(ctx context.Context) []int
- func (tcgb *TenantConnGroupBy) Scan(ctx context.Context, v any) error
- func (s *TenantConnGroupBy) ScanX(ctx context.Context, v any)
- func (s *TenantConnGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *TenantConnGroupBy) StringX(ctx context.Context) string
- func (s *TenantConnGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *TenantConnGroupBy) StringsX(ctx context.Context) []string
- type TenantConnMutation
- func (m *TenantConnMutation) AddField(name string, value ent.Value) error
- func (m *TenantConnMutation) AddedEdges() []string
- func (m *TenantConnMutation) AddedField(name string) (ent.Value, bool)
- func (m *TenantConnMutation) AddedFields() []string
- func (m *TenantConnMutation) AddedIDs(name string) []ent.Value
- func (m *TenantConnMutation) ClearEdge(name string) error
- func (m *TenantConnMutation) ClearField(name string) error
- func (m *TenantConnMutation) ClearedEdges() []string
- func (m *TenantConnMutation) ClearedFields() []string
- func (m TenantConnMutation) Client() *Client
- func (m *TenantConnMutation) CreateTime() (r time.Time, exists bool)
- func (m *TenantConnMutation) EdgeCleared(name string) bool
- func (m *TenantConnMutation) Field(name string) (ent.Value, bool)
- func (m *TenantConnMutation) FieldCleared(name string) bool
- func (m *TenantConnMutation) Fields() []string
- func (m *TenantConnMutation) ID() (id int, exists bool)
- func (m *TenantConnMutation) IDs(ctx context.Context) ([]int, error)
- func (m *TenantConnMutation) Key() (r string, exists bool)
- func (m *TenantConnMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *TenantConnMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TenantConnMutation) OldKey(ctx context.Context) (v string, err error)
- func (m *TenantConnMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *TenantConnMutation) OldValue(ctx context.Context) (v string, err error)
- func (m *TenantConnMutation) Op() Op
- func (m *TenantConnMutation) RemovedEdges() []string
- func (m *TenantConnMutation) RemovedIDs(name string) []ent.Value
- func (m *TenantConnMutation) ResetCreateTime()
- func (m *TenantConnMutation) ResetEdge(name string) error
- func (m *TenantConnMutation) ResetField(name string) error
- func (m *TenantConnMutation) ResetKey()
- func (m *TenantConnMutation) ResetUpdateTime()
- func (m *TenantConnMutation) ResetValue()
- func (m *TenantConnMutation) SetCreateTime(t time.Time)
- func (m *TenantConnMutation) SetField(name string, value ent.Value) error
- func (m *TenantConnMutation) SetKey(s string)
- func (m *TenantConnMutation) SetOp(op Op)
- func (m *TenantConnMutation) SetUpdateTime(t time.Time)
- func (m *TenantConnMutation) SetValue(s string)
- func (m TenantConnMutation) Tx() (*Tx, error)
- func (m *TenantConnMutation) Type() string
- func (m *TenantConnMutation) UpdateTime() (r time.Time, exists bool)
- func (m *TenantConnMutation) Value() (r string, exists bool)
- func (m *TenantConnMutation) Where(ps ...predicate.TenantConn)
- func (m *TenantConnMutation) WhereP(ps ...func(*sql.Selector))
- type TenantConnQuery
- func (tcq *TenantConnQuery) Aggregate(fns ...AggregateFunc) *TenantConnSelect
- func (tcq *TenantConnQuery) All(ctx context.Context) ([]*TenantConn, error)
- func (tcq *TenantConnQuery) AllX(ctx context.Context) []*TenantConn
- func (tcq *TenantConnQuery) Clone() *TenantConnQuery
- func (tcq *TenantConnQuery) Count(ctx context.Context) (int, error)
- func (tcq *TenantConnQuery) CountX(ctx context.Context) int
- func (tcq *TenantConnQuery) Exist(ctx context.Context) (bool, error)
- func (tcq *TenantConnQuery) ExistX(ctx context.Context) bool
- func (tcq *TenantConnQuery) First(ctx context.Context) (*TenantConn, error)
- func (tcq *TenantConnQuery) FirstID(ctx context.Context) (id int, err error)
- func (tcq *TenantConnQuery) FirstIDX(ctx context.Context) int
- func (tcq *TenantConnQuery) FirstX(ctx context.Context) *TenantConn
- func (tcq *TenantConnQuery) GroupBy(field string, fields ...string) *TenantConnGroupBy
- func (tcq *TenantConnQuery) IDs(ctx context.Context) (ids []int, err error)
- func (tcq *TenantConnQuery) IDsX(ctx context.Context) []int
- func (tcq *TenantConnQuery) Limit(limit int) *TenantConnQuery
- func (tcq *TenantConnQuery) Offset(offset int) *TenantConnQuery
- func (tcq *TenantConnQuery) Only(ctx context.Context) (*TenantConn, error)
- func (tcq *TenantConnQuery) OnlyID(ctx context.Context) (id int, err error)
- func (tcq *TenantConnQuery) OnlyIDX(ctx context.Context) int
- func (tcq *TenantConnQuery) OnlyX(ctx context.Context) *TenantConn
- func (tcq *TenantConnQuery) Order(o ...tenantconn.OrderOption) *TenantConnQuery
- func (tcq *TenantConnQuery) Select(fields ...string) *TenantConnSelect
- func (tcq *TenantConnQuery) Unique(unique bool) *TenantConnQuery
- func (tcq *TenantConnQuery) Where(ps ...predicate.TenantConn) *TenantConnQuery
- type TenantConnSelect
- func (tcs *TenantConnSelect) Aggregate(fns ...AggregateFunc) *TenantConnSelect
- func (s *TenantConnSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *TenantConnSelect) BoolX(ctx context.Context) bool
- func (s *TenantConnSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *TenantConnSelect) BoolsX(ctx context.Context) []bool
- func (s *TenantConnSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *TenantConnSelect) Float64X(ctx context.Context) float64
- func (s *TenantConnSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *TenantConnSelect) Float64sX(ctx context.Context) []float64
- func (s *TenantConnSelect) Int(ctx context.Context) (_ int, err error)
- func (s *TenantConnSelect) IntX(ctx context.Context) int
- func (s *TenantConnSelect) Ints(ctx context.Context) ([]int, error)
- func (s *TenantConnSelect) IntsX(ctx context.Context) []int
- func (tcs *TenantConnSelect) Scan(ctx context.Context, v any) error
- func (s *TenantConnSelect) ScanX(ctx context.Context, v any)
- func (s *TenantConnSelect) String(ctx context.Context) (_ string, err error)
- func (s *TenantConnSelect) StringX(ctx context.Context) string
- func (s *TenantConnSelect) Strings(ctx context.Context) ([]string, error)
- func (s *TenantConnSelect) StringsX(ctx context.Context) []string
- type TenantConnUpdate
- func (tcu *TenantConnUpdate) Exec(ctx context.Context) error
- func (tcu *TenantConnUpdate) ExecX(ctx context.Context)
- func (tcu *TenantConnUpdate) Mutation() *TenantConnMutation
- func (tcu *TenantConnUpdate) Save(ctx context.Context) (int, error)
- func (tcu *TenantConnUpdate) SaveX(ctx context.Context) int
- func (tcu *TenantConnUpdate) SetKey(s string) *TenantConnUpdate
- func (tcu *TenantConnUpdate) SetUpdateTime(t time.Time) *TenantConnUpdate
- func (tcu *TenantConnUpdate) SetValue(s string) *TenantConnUpdate
- func (tcu *TenantConnUpdate) Where(ps ...predicate.TenantConn) *TenantConnUpdate
- type TenantConnUpdateOne
- func (tcuo *TenantConnUpdateOne) Exec(ctx context.Context) error
- func (tcuo *TenantConnUpdateOne) ExecX(ctx context.Context)
- func (tcuo *TenantConnUpdateOne) Mutation() *TenantConnMutation
- func (tcuo *TenantConnUpdateOne) Save(ctx context.Context) (*TenantConn, error)
- func (tcuo *TenantConnUpdateOne) SaveX(ctx context.Context) *TenantConn
- func (tcuo *TenantConnUpdateOne) Select(field string, fields ...string) *TenantConnUpdateOne
- func (tcuo *TenantConnUpdateOne) SetKey(s string) *TenantConnUpdateOne
- func (tcuo *TenantConnUpdateOne) SetUpdateTime(t time.Time) *TenantConnUpdateOne
- func (tcuo *TenantConnUpdateOne) SetValue(s string) *TenantConnUpdateOne
- func (tcuo *TenantConnUpdateOne) Where(ps ...predicate.TenantConn) *TenantConnUpdateOne
- type TenantConnUpsert
- func (u *TenantConnUpsert) SetKey(v string) *TenantConnUpsert
- func (u *TenantConnUpsert) SetUpdateTime(v time.Time) *TenantConnUpsert
- func (u *TenantConnUpsert) SetValue(v string) *TenantConnUpsert
- func (u *TenantConnUpsert) UpdateKey() *TenantConnUpsert
- func (u *TenantConnUpsert) UpdateUpdateTime() *TenantConnUpsert
- func (u *TenantConnUpsert) UpdateValue() *TenantConnUpsert
- type TenantConnUpsertBulk
- func (u *TenantConnUpsertBulk) DoNothing() *TenantConnUpsertBulk
- func (u *TenantConnUpsertBulk) Exec(ctx context.Context) error
- func (u *TenantConnUpsertBulk) ExecX(ctx context.Context)
- func (u *TenantConnUpsertBulk) Ignore() *TenantConnUpsertBulk
- func (u *TenantConnUpsertBulk) SetKey(v string) *TenantConnUpsertBulk
- func (u *TenantConnUpsertBulk) SetUpdateTime(v time.Time) *TenantConnUpsertBulk
- func (u *TenantConnUpsertBulk) SetValue(v string) *TenantConnUpsertBulk
- func (u *TenantConnUpsertBulk) Update(set func(*TenantConnUpsert)) *TenantConnUpsertBulk
- func (u *TenantConnUpsertBulk) UpdateKey() *TenantConnUpsertBulk
- func (u *TenantConnUpsertBulk) UpdateNewValues() *TenantConnUpsertBulk
- func (u *TenantConnUpsertBulk) UpdateUpdateTime() *TenantConnUpsertBulk
- func (u *TenantConnUpsertBulk) UpdateValue() *TenantConnUpsertBulk
- type TenantConnUpsertOne
- func (u *TenantConnUpsertOne) DoNothing() *TenantConnUpsertOne
- func (u *TenantConnUpsertOne) Exec(ctx context.Context) error
- func (u *TenantConnUpsertOne) ExecX(ctx context.Context)
- func (u *TenantConnUpsertOne) ID(ctx context.Context) (id int, err error)
- func (u *TenantConnUpsertOne) IDX(ctx context.Context) int
- func (u *TenantConnUpsertOne) Ignore() *TenantConnUpsertOne
- func (u *TenantConnUpsertOne) SetKey(v string) *TenantConnUpsertOne
- func (u *TenantConnUpsertOne) SetUpdateTime(v time.Time) *TenantConnUpsertOne
- func (u *TenantConnUpsertOne) SetValue(v string) *TenantConnUpsertOne
- func (u *TenantConnUpsertOne) Update(set func(*TenantConnUpsert)) *TenantConnUpsertOne
- func (u *TenantConnUpsertOne) UpdateKey() *TenantConnUpsertOne
- func (u *TenantConnUpsertOne) UpdateNewValues() *TenantConnUpsertOne
- func (u *TenantConnUpsertOne) UpdateUpdateTime() *TenantConnUpsertOne
- func (u *TenantConnUpsertOne) UpdateValue() *TenantConnUpsertOne
- type TenantConns
- type TenantCreate
- func (tc *TenantCreate) AddConn(t ...*TenantConn) *TenantCreate
- func (tc *TenantCreate) AddConnIDs(ids ...int) *TenantCreate
- func (tc *TenantCreate) Exec(ctx context.Context) error
- func (tc *TenantCreate) ExecX(ctx context.Context)
- func (tc *TenantCreate) Mutation() *TenantMutation
- func (tc *TenantCreate) OnConflict(opts ...sql.ConflictOption) *TenantUpsertOne
- func (tc *TenantCreate) OnConflictColumns(columns ...string) *TenantUpsertOne
- func (tc *TenantCreate) Save(ctx context.Context) (*Tenant, error)
- func (tc *TenantCreate) SaveX(ctx context.Context) *Tenant
- func (tc *TenantCreate) SetCreateTime(t time.Time) *TenantCreate
- func (tc *TenantCreate) SetDisplayName(s string) *TenantCreate
- func (tc *TenantCreate) SetID(i int) *TenantCreate
- func (tc *TenantCreate) SetName(s string) *TenantCreate
- func (tc *TenantCreate) SetNillableCreateTime(t *time.Time) *TenantCreate
- func (tc *TenantCreate) SetNillableDisplayName(s *string) *TenantCreate
- func (tc *TenantCreate) SetNillableRegion(s *string) *TenantCreate
- func (tc *TenantCreate) SetNillableUpdateTime(t *time.Time) *TenantCreate
- func (tc *TenantCreate) SetRegion(s string) *TenantCreate
- func (tc *TenantCreate) SetUpdateTime(t time.Time) *TenantCreate
- type TenantCreateBulk
- func (tcb *TenantCreateBulk) Exec(ctx context.Context) error
- func (tcb *TenantCreateBulk) ExecX(ctx context.Context)
- func (tcb *TenantCreateBulk) OnConflict(opts ...sql.ConflictOption) *TenantUpsertBulk
- func (tcb *TenantCreateBulk) OnConflictColumns(columns ...string) *TenantUpsertBulk
- func (tcb *TenantCreateBulk) Save(ctx context.Context) ([]*Tenant, error)
- func (tcb *TenantCreateBulk) SaveX(ctx context.Context) []*Tenant
- type TenantDelete
- type TenantDeleteOne
- type TenantEdges
- type TenantGroupBy
- func (tgb *TenantGroupBy) Aggregate(fns ...AggregateFunc) *TenantGroupBy
- func (s *TenantGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *TenantGroupBy) BoolX(ctx context.Context) bool
- func (s *TenantGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *TenantGroupBy) BoolsX(ctx context.Context) []bool
- func (s *TenantGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *TenantGroupBy) Float64X(ctx context.Context) float64
- func (s *TenantGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *TenantGroupBy) Float64sX(ctx context.Context) []float64
- func (s *TenantGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *TenantGroupBy) IntX(ctx context.Context) int
- func (s *TenantGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *TenantGroupBy) IntsX(ctx context.Context) []int
- func (tgb *TenantGroupBy) Scan(ctx context.Context, v any) error
- func (s *TenantGroupBy) ScanX(ctx context.Context, v any)
- func (s *TenantGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *TenantGroupBy) StringX(ctx context.Context) string
- func (s *TenantGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *TenantGroupBy) StringsX(ctx context.Context) []string
- type TenantMutation
- func (m *TenantMutation) AddConnIDs(ids ...int)
- func (m *TenantMutation) AddField(name string, value ent.Value) error
- func (m *TenantMutation) AddedEdges() []string
- func (m *TenantMutation) AddedField(name string) (ent.Value, bool)
- func (m *TenantMutation) AddedFields() []string
- func (m *TenantMutation) AddedIDs(name string) []ent.Value
- func (m *TenantMutation) ClearConn()
- func (m *TenantMutation) ClearDisplayName()
- func (m *TenantMutation) ClearEdge(name string) error
- func (m *TenantMutation) ClearField(name string) error
- func (m *TenantMutation) ClearRegion()
- func (m *TenantMutation) ClearedEdges() []string
- func (m *TenantMutation) ClearedFields() []string
- func (m TenantMutation) Client() *Client
- func (m *TenantMutation) ConnCleared() bool
- func (m *TenantMutation) ConnIDs() (ids []int)
- func (m *TenantMutation) CreateTime() (r time.Time, exists bool)
- func (m *TenantMutation) DisplayName() (r string, exists bool)
- func (m *TenantMutation) DisplayNameCleared() bool
- func (m *TenantMutation) EdgeCleared(name string) bool
- func (m *TenantMutation) Field(name string) (ent.Value, bool)
- func (m *TenantMutation) FieldCleared(name string) bool
- func (m *TenantMutation) Fields() []string
- func (m *TenantMutation) ID() (id int, exists bool)
- func (m *TenantMutation) IDs(ctx context.Context) ([]int, error)
- func (m *TenantMutation) Name() (r string, exists bool)
- func (m *TenantMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *TenantMutation) OldDisplayName(ctx context.Context) (v string, err error)
- func (m *TenantMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TenantMutation) OldName(ctx context.Context) (v string, err error)
- func (m *TenantMutation) OldRegion(ctx context.Context) (v string, err error)
- func (m *TenantMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *TenantMutation) Op() Op
- func (m *TenantMutation) Region() (r string, exists bool)
- func (m *TenantMutation) RegionCleared() bool
- func (m *TenantMutation) RemoveConnIDs(ids ...int)
- func (m *TenantMutation) RemovedConnIDs() (ids []int)
- func (m *TenantMutation) RemovedEdges() []string
- func (m *TenantMutation) RemovedIDs(name string) []ent.Value
- func (m *TenantMutation) ResetConn()
- func (m *TenantMutation) ResetCreateTime()
- func (m *TenantMutation) ResetDisplayName()
- func (m *TenantMutation) ResetEdge(name string) error
- func (m *TenantMutation) ResetField(name string) error
- func (m *TenantMutation) ResetName()
- func (m *TenantMutation) ResetRegion()
- func (m *TenantMutation) ResetUpdateTime()
- func (m *TenantMutation) SetCreateTime(t time.Time)
- func (m *TenantMutation) SetDisplayName(s string)
- func (m *TenantMutation) SetField(name string, value ent.Value) error
- func (m *TenantMutation) SetID(id int)
- func (m *TenantMutation) SetName(s string)
- func (m *TenantMutation) SetOp(op Op)
- func (m *TenantMutation) SetRegion(s string)
- func (m *TenantMutation) SetUpdateTime(t time.Time)
- func (m TenantMutation) Tx() (*Tx, error)
- func (m *TenantMutation) Type() string
- func (m *TenantMutation) UpdateTime() (r time.Time, exists bool)
- func (m *TenantMutation) Where(ps ...predicate.Tenant)
- func (m *TenantMutation) WhereP(ps ...func(*sql.Selector))
- type TenantQuery
- func (tq *TenantQuery) Aggregate(fns ...AggregateFunc) *TenantSelect
- func (tq *TenantQuery) All(ctx context.Context) ([]*Tenant, error)
- func (tq *TenantQuery) AllX(ctx context.Context) []*Tenant
- func (tq *TenantQuery) Clone() *TenantQuery
- func (tq *TenantQuery) Count(ctx context.Context) (int, error)
- func (tq *TenantQuery) CountX(ctx context.Context) int
- func (tq *TenantQuery) Exist(ctx context.Context) (bool, error)
- func (tq *TenantQuery) ExistX(ctx context.Context) bool
- func (tq *TenantQuery) First(ctx context.Context) (*Tenant, error)
- func (tq *TenantQuery) FirstID(ctx context.Context) (id int, err error)
- func (tq *TenantQuery) FirstIDX(ctx context.Context) int
- func (tq *TenantQuery) FirstX(ctx context.Context) *Tenant
- func (tq *TenantQuery) GroupBy(field string, fields ...string) *TenantGroupBy
- func (tq *TenantQuery) IDs(ctx context.Context) (ids []int, err error)
- func (tq *TenantQuery) IDsX(ctx context.Context) []int
- func (tq *TenantQuery) Limit(limit int) *TenantQuery
- func (tq *TenantQuery) Offset(offset int) *TenantQuery
- func (tq *TenantQuery) Only(ctx context.Context) (*Tenant, error)
- func (tq *TenantQuery) OnlyID(ctx context.Context) (id int, err error)
- func (tq *TenantQuery) OnlyIDX(ctx context.Context) int
- func (tq *TenantQuery) OnlyX(ctx context.Context) *Tenant
- func (tq *TenantQuery) Order(o ...tenant.OrderOption) *TenantQuery
- func (tq *TenantQuery) QueryConn() *TenantConnQuery
- func (tq *TenantQuery) Select(fields ...string) *TenantSelect
- func (tq *TenantQuery) Unique(unique bool) *TenantQuery
- func (tq *TenantQuery) Where(ps ...predicate.Tenant) *TenantQuery
- func (tq *TenantQuery) WithConn(opts ...func(*TenantConnQuery)) *TenantQuery
- type TenantSelect
- func (ts *TenantSelect) Aggregate(fns ...AggregateFunc) *TenantSelect
- func (s *TenantSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *TenantSelect) BoolX(ctx context.Context) bool
- func (s *TenantSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *TenantSelect) BoolsX(ctx context.Context) []bool
- func (s *TenantSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *TenantSelect) Float64X(ctx context.Context) float64
- func (s *TenantSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *TenantSelect) Float64sX(ctx context.Context) []float64
- func (s *TenantSelect) Int(ctx context.Context) (_ int, err error)
- func (s *TenantSelect) IntX(ctx context.Context) int
- func (s *TenantSelect) Ints(ctx context.Context) ([]int, error)
- func (s *TenantSelect) IntsX(ctx context.Context) []int
- func (ts *TenantSelect) Scan(ctx context.Context, v any) error
- func (s *TenantSelect) ScanX(ctx context.Context, v any)
- func (s *TenantSelect) String(ctx context.Context) (_ string, err error)
- func (s *TenantSelect) StringX(ctx context.Context) string
- func (s *TenantSelect) Strings(ctx context.Context) ([]string, error)
- func (s *TenantSelect) StringsX(ctx context.Context) []string
- type TenantUpdate
- func (tu *TenantUpdate) AddConn(t ...*TenantConn) *TenantUpdate
- func (tu *TenantUpdate) AddConnIDs(ids ...int) *TenantUpdate
- func (tu *TenantUpdate) ClearConn() *TenantUpdate
- func (tu *TenantUpdate) ClearDisplayName() *TenantUpdate
- func (tu *TenantUpdate) ClearRegion() *TenantUpdate
- func (tu *TenantUpdate) Exec(ctx context.Context) error
- func (tu *TenantUpdate) ExecX(ctx context.Context)
- func (tu *TenantUpdate) Mutation() *TenantMutation
- func (tu *TenantUpdate) RemoveConn(t ...*TenantConn) *TenantUpdate
- func (tu *TenantUpdate) RemoveConnIDs(ids ...int) *TenantUpdate
- func (tu *TenantUpdate) Save(ctx context.Context) (int, error)
- func (tu *TenantUpdate) SaveX(ctx context.Context) int
- func (tu *TenantUpdate) SetDisplayName(s string) *TenantUpdate
- func (tu *TenantUpdate) SetName(s string) *TenantUpdate
- func (tu *TenantUpdate) SetNillableDisplayName(s *string) *TenantUpdate
- func (tu *TenantUpdate) SetNillableRegion(s *string) *TenantUpdate
- func (tu *TenantUpdate) SetRegion(s string) *TenantUpdate
- func (tu *TenantUpdate) SetUpdateTime(t time.Time) *TenantUpdate
- func (tu *TenantUpdate) Where(ps ...predicate.Tenant) *TenantUpdate
- type TenantUpdateOne
- func (tuo *TenantUpdateOne) AddConn(t ...*TenantConn) *TenantUpdateOne
- func (tuo *TenantUpdateOne) AddConnIDs(ids ...int) *TenantUpdateOne
- func (tuo *TenantUpdateOne) ClearConn() *TenantUpdateOne
- func (tuo *TenantUpdateOne) ClearDisplayName() *TenantUpdateOne
- func (tuo *TenantUpdateOne) ClearRegion() *TenantUpdateOne
- func (tuo *TenantUpdateOne) Exec(ctx context.Context) error
- func (tuo *TenantUpdateOne) ExecX(ctx context.Context)
- func (tuo *TenantUpdateOne) Mutation() *TenantMutation
- func (tuo *TenantUpdateOne) RemoveConn(t ...*TenantConn) *TenantUpdateOne
- func (tuo *TenantUpdateOne) RemoveConnIDs(ids ...int) *TenantUpdateOne
- func (tuo *TenantUpdateOne) Save(ctx context.Context) (*Tenant, error)
- func (tuo *TenantUpdateOne) SaveX(ctx context.Context) *Tenant
- func (tuo *TenantUpdateOne) Select(field string, fields ...string) *TenantUpdateOne
- func (tuo *TenantUpdateOne) SetDisplayName(s string) *TenantUpdateOne
- func (tuo *TenantUpdateOne) SetName(s string) *TenantUpdateOne
- func (tuo *TenantUpdateOne) SetNillableDisplayName(s *string) *TenantUpdateOne
- func (tuo *TenantUpdateOne) SetNillableRegion(s *string) *TenantUpdateOne
- func (tuo *TenantUpdateOne) SetRegion(s string) *TenantUpdateOne
- func (tuo *TenantUpdateOne) SetUpdateTime(t time.Time) *TenantUpdateOne
- func (tuo *TenantUpdateOne) Where(ps ...predicate.Tenant) *TenantUpdateOne
- type TenantUpsert
- func (u *TenantUpsert) ClearDisplayName() *TenantUpsert
- func (u *TenantUpsert) ClearRegion() *TenantUpsert
- func (u *TenantUpsert) SetDisplayName(v string) *TenantUpsert
- func (u *TenantUpsert) SetName(v string) *TenantUpsert
- func (u *TenantUpsert) SetRegion(v string) *TenantUpsert
- func (u *TenantUpsert) SetUpdateTime(v time.Time) *TenantUpsert
- func (u *TenantUpsert) UpdateDisplayName() *TenantUpsert
- func (u *TenantUpsert) UpdateName() *TenantUpsert
- func (u *TenantUpsert) UpdateRegion() *TenantUpsert
- func (u *TenantUpsert) UpdateUpdateTime() *TenantUpsert
- type TenantUpsertBulk
- func (u *TenantUpsertBulk) ClearDisplayName() *TenantUpsertBulk
- func (u *TenantUpsertBulk) ClearRegion() *TenantUpsertBulk
- func (u *TenantUpsertBulk) DoNothing() *TenantUpsertBulk
- func (u *TenantUpsertBulk) Exec(ctx context.Context) error
- func (u *TenantUpsertBulk) ExecX(ctx context.Context)
- func (u *TenantUpsertBulk) Ignore() *TenantUpsertBulk
- func (u *TenantUpsertBulk) SetDisplayName(v string) *TenantUpsertBulk
- func (u *TenantUpsertBulk) SetName(v string) *TenantUpsertBulk
- func (u *TenantUpsertBulk) SetRegion(v string) *TenantUpsertBulk
- func (u *TenantUpsertBulk) SetUpdateTime(v time.Time) *TenantUpsertBulk
- func (u *TenantUpsertBulk) Update(set func(*TenantUpsert)) *TenantUpsertBulk
- func (u *TenantUpsertBulk) UpdateDisplayName() *TenantUpsertBulk
- func (u *TenantUpsertBulk) UpdateName() *TenantUpsertBulk
- func (u *TenantUpsertBulk) UpdateNewValues() *TenantUpsertBulk
- func (u *TenantUpsertBulk) UpdateRegion() *TenantUpsertBulk
- func (u *TenantUpsertBulk) UpdateUpdateTime() *TenantUpsertBulk
- type TenantUpsertOne
- func (u *TenantUpsertOne) ClearDisplayName() *TenantUpsertOne
- func (u *TenantUpsertOne) ClearRegion() *TenantUpsertOne
- func (u *TenantUpsertOne) DoNothing() *TenantUpsertOne
- func (u *TenantUpsertOne) Exec(ctx context.Context) error
- func (u *TenantUpsertOne) ExecX(ctx context.Context)
- func (u *TenantUpsertOne) ID(ctx context.Context) (id int, err error)
- func (u *TenantUpsertOne) IDX(ctx context.Context) int
- func (u *TenantUpsertOne) Ignore() *TenantUpsertOne
- func (u *TenantUpsertOne) SetDisplayName(v string) *TenantUpsertOne
- func (u *TenantUpsertOne) SetName(v string) *TenantUpsertOne
- func (u *TenantUpsertOne) SetRegion(v string) *TenantUpsertOne
- func (u *TenantUpsertOne) SetUpdateTime(v time.Time) *TenantUpsertOne
- func (u *TenantUpsertOne) Update(set func(*TenantUpsert)) *TenantUpsertOne
- func (u *TenantUpsertOne) UpdateDisplayName() *TenantUpsertOne
- func (u *TenantUpsertOne) UpdateName() *TenantUpsertOne
- func (u *TenantUpsertOne) UpdateNewValues() *TenantUpsertOne
- func (u *TenantUpsertOne) UpdateRegion() *TenantUpsertOne
- func (u *TenantUpsertOne) UpdateUpdateTime() *TenantUpsertOne
- type Tenants
- 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. TypePost = "Post" TypeTenant = "Tenant" TypeTenantConn = "TenantConn" )
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 // Post is the client for interacting with the Post builders. Post *PostClient // Tenant is the client for interacting with the Tenant builders. Tenant *TenantClient // TenantConn is the client for interacting with the TenantConn builders. TenantConn *TenantConnClient // 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(). Post. 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 Post ¶
type Post struct { // ID of the ent. ID int `json:"id,omitempty"` // TenantID holds the value of the "tenant_id" field. TenantID *sql.NullString `json:"tenant_id,omitempty"` // Title holds the value of the "title" field. Title string `json:"title,omitempty"` // Description holds the value of the "description" field. Description string `json:"description,omitempty"` // Dsn holds the value of the "dsn" field. Dsn string `json:"dsn,omitempty"` // contains filtered or unexported fields }
Post is the model entity for the Post schema.
func (*Post) Unwrap ¶
Unwrap unwraps the Post entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Post) Update ¶
func (po *Post) Update() *PostUpdateOne
Update returns a builder for updating this Post. Note that you need to call Post.Unwrap() before calling this method if this Post was returned from a transaction, and the transaction was committed or rolled back.
type PostClient ¶
type PostClient struct {
// contains filtered or unexported fields
}
PostClient is a client for the Post schema.
func NewPostClient ¶
func NewPostClient(c config) *PostClient
NewPostClient returns a client for the Post from the given config.
func (*PostClient) Create ¶
func (c *PostClient) Create() *PostCreate
Create returns a builder for creating a Post entity.
func (*PostClient) CreateBulk ¶
func (c *PostClient) CreateBulk(builders ...*PostCreate) *PostCreateBulk
CreateBulk returns a builder for creating a bulk of Post entities.
func (*PostClient) Delete ¶
func (c *PostClient) Delete() *PostDelete
Delete returns a delete builder for Post.
func (*PostClient) DeleteOne ¶
func (c *PostClient) DeleteOne(po *Post) *PostDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*PostClient) DeleteOneID ¶
func (c *PostClient) DeleteOneID(id int) *PostDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*PostClient) GetX ¶
func (c *PostClient) GetX(ctx context.Context, id int) *Post
GetX is like Get, but panics if an error occurs.
func (*PostClient) Intercept ¶
func (c *PostClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `post.Intercept(f(g(h())))`.
func (*PostClient) Interceptors ¶
func (c *PostClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*PostClient) MapCreateBulk ¶
func (c *PostClient) MapCreateBulk(slice any, setFunc func(*PostCreate, int)) *PostCreateBulk
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 (*PostClient) Query ¶
func (c *PostClient) Query() *PostQuery
Query returns a query builder for Post.
func (*PostClient) Update ¶
func (c *PostClient) Update() *PostUpdate
Update returns an update builder for Post.
func (*PostClient) UpdateOne ¶
func (c *PostClient) UpdateOne(po *Post) *PostUpdateOne
UpdateOne returns an update builder for the given entity.
func (*PostClient) UpdateOneID ¶
func (c *PostClient) UpdateOneID(id int) *PostUpdateOne
UpdateOneID returns an update builder for the given id.
func (*PostClient) Use ¶
func (c *PostClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `post.Hooks(f(g(h())))`.
type PostCreate ¶
type PostCreate struct {
// contains filtered or unexported fields
}
PostCreate is the builder for creating a Post entity.
func (*PostCreate) Exec ¶
func (pc *PostCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*PostCreate) ExecX ¶
func (pc *PostCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PostCreate) Mutation ¶
func (pc *PostCreate) Mutation() *PostMutation
Mutation returns the PostMutation object of the builder.
func (*PostCreate) OnConflict ¶
func (pc *PostCreate) OnConflict(opts ...sql.ConflictOption) *PostUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Post.Create(). SetTenantID(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.PostUpsert) { SetTenantID(v+v). }). Exec(ctx)
func (*PostCreate) OnConflictColumns ¶
func (pc *PostCreate) OnConflictColumns(columns ...string) *PostUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Post.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*PostCreate) Save ¶
func (pc *PostCreate) Save(ctx context.Context) (*Post, error)
Save creates the Post in the database.
func (*PostCreate) SaveX ¶
func (pc *PostCreate) SaveX(ctx context.Context) *Post
SaveX calls Save and panics if Save returns an error.
func (*PostCreate) SetDescription ¶
func (pc *PostCreate) SetDescription(s string) *PostCreate
SetDescription sets the "description" field.
func (*PostCreate) SetDsn ¶
func (pc *PostCreate) SetDsn(s string) *PostCreate
SetDsn sets the "dsn" field.
func (*PostCreate) SetID ¶
func (pc *PostCreate) SetID(i int) *PostCreate
SetID sets the "id" field.
func (*PostCreate) SetNillableDescription ¶
func (pc *PostCreate) SetNillableDescription(s *string) *PostCreate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*PostCreate) SetNillableDsn ¶
func (pc *PostCreate) SetNillableDsn(s *string) *PostCreate
SetNillableDsn sets the "dsn" field if the given value is not nil.
func (*PostCreate) SetTenantID ¶
func (pc *PostCreate) SetTenantID(ss *sql.NullString) *PostCreate
SetTenantID sets the "tenant_id" field.
func (*PostCreate) SetTitle ¶
func (pc *PostCreate) SetTitle(s string) *PostCreate
SetTitle sets the "title" field.
type PostCreateBulk ¶
type PostCreateBulk struct {
// contains filtered or unexported fields
}
PostCreateBulk is the builder for creating many Post entities in bulk.
func (*PostCreateBulk) Exec ¶
func (pcb *PostCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*PostCreateBulk) ExecX ¶
func (pcb *PostCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PostCreateBulk) OnConflict ¶
func (pcb *PostCreateBulk) OnConflict(opts ...sql.ConflictOption) *PostUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Post.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.PostUpsert) { SetTenantID(v+v). }). Exec(ctx)
func (*PostCreateBulk) OnConflictColumns ¶
func (pcb *PostCreateBulk) OnConflictColumns(columns ...string) *PostUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Post.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type PostDelete ¶
type PostDelete struct {
// contains filtered or unexported fields
}
PostDelete is the builder for deleting a Post entity.
func (*PostDelete) Exec ¶
func (pd *PostDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*PostDelete) ExecX ¶
func (pd *PostDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*PostDelete) Where ¶
func (pd *PostDelete) Where(ps ...predicate.Post) *PostDelete
Where appends a list predicates to the PostDelete builder.
type PostDeleteOne ¶
type PostDeleteOne struct {
// contains filtered or unexported fields
}
PostDeleteOne is the builder for deleting a single Post entity.
func (*PostDeleteOne) Exec ¶
func (pdo *PostDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*PostDeleteOne) ExecX ¶
func (pdo *PostDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PostDeleteOne) Where ¶
func (pdo *PostDeleteOne) Where(ps ...predicate.Post) *PostDeleteOne
Where appends a list predicates to the PostDelete builder.
type PostGroupBy ¶
type PostGroupBy struct {
// contains filtered or unexported fields
}
PostGroupBy is the group-by builder for Post entities.
func (*PostGroupBy) Aggregate ¶
func (pgb *PostGroupBy) Aggregate(fns ...AggregateFunc) *PostGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*PostGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PostGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PostGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PostGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PostGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PostGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PostGroupBy) Scan ¶
func (pgb *PostGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PostGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PostMutation ¶
type PostMutation struct {
// contains filtered or unexported fields
}
PostMutation represents an operation that mutates the Post nodes in the graph.
func (*PostMutation) AddField ¶
func (m *PostMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*PostMutation) AddedEdges ¶
func (m *PostMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*PostMutation) AddedField ¶
func (m *PostMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*PostMutation) AddedFields ¶
func (m *PostMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*PostMutation) AddedIDs ¶
func (m *PostMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*PostMutation) ClearDescription ¶
func (m *PostMutation) ClearDescription()
ClearDescription clears the value of the "description" field.
func (*PostMutation) ClearDsn ¶
func (m *PostMutation) ClearDsn()
ClearDsn clears the value of the "dsn" field.
func (*PostMutation) ClearEdge ¶
func (m *PostMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*PostMutation) ClearField ¶
func (m *PostMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*PostMutation) ClearTenantID ¶
func (m *PostMutation) ClearTenantID()
ClearTenantID clears the value of the "tenant_id" field.
func (*PostMutation) ClearedEdges ¶
func (m *PostMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*PostMutation) ClearedFields ¶
func (m *PostMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (PostMutation) Client ¶
func (m PostMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*PostMutation) Description ¶
func (m *PostMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*PostMutation) DescriptionCleared ¶
func (m *PostMutation) DescriptionCleared() bool
DescriptionCleared returns if the "description" field was cleared in this mutation.
func (*PostMutation) Dsn ¶
func (m *PostMutation) Dsn() (r string, exists bool)
Dsn returns the value of the "dsn" field in the mutation.
func (*PostMutation) DsnCleared ¶
func (m *PostMutation) DsnCleared() bool
DsnCleared returns if the "dsn" field was cleared in this mutation.
func (*PostMutation) EdgeCleared ¶
func (m *PostMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*PostMutation) Field ¶
func (m *PostMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*PostMutation) FieldCleared ¶
func (m *PostMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*PostMutation) Fields ¶
func (m *PostMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*PostMutation) ID ¶
func (m *PostMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*PostMutation) IDs ¶
func (m *PostMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*PostMutation) OldDescription ¶
func (m *PostMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the Post entity. If the Post object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*PostMutation) OldDsn ¶
func (m *PostMutation) OldDsn(ctx context.Context) (v string, err error)
OldDsn returns the old "dsn" field's value of the Post entity. If the Post object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*PostMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*PostMutation) OldTenantID ¶
func (m *PostMutation) OldTenantID(ctx context.Context) (v *sql.NullString, err error)
OldTenantID returns the old "tenant_id" field's value of the Post entity. If the Post object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*PostMutation) OldTitle ¶
func (m *PostMutation) OldTitle(ctx context.Context) (v string, err error)
OldTitle returns the old "title" field's value of the Post entity. If the Post object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*PostMutation) RemovedEdges ¶
func (m *PostMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*PostMutation) RemovedIDs ¶
func (m *PostMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*PostMutation) ResetDescription ¶
func (m *PostMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*PostMutation) ResetDsn ¶
func (m *PostMutation) ResetDsn()
ResetDsn resets all changes to the "dsn" field.
func (*PostMutation) ResetEdge ¶
func (m *PostMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*PostMutation) ResetField ¶
func (m *PostMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*PostMutation) ResetTenantID ¶
func (m *PostMutation) ResetTenantID()
ResetTenantID resets all changes to the "tenant_id" field.
func (*PostMutation) ResetTitle ¶
func (m *PostMutation) ResetTitle()
ResetTitle resets all changes to the "title" field.
func (*PostMutation) SetDescription ¶
func (m *PostMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*PostMutation) SetField ¶
func (m *PostMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*PostMutation) SetID ¶
func (m *PostMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Post entities.
func (*PostMutation) SetOp ¶
func (m *PostMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*PostMutation) SetTenantID ¶
func (m *PostMutation) SetTenantID(ss *sql.NullString)
SetTenantID sets the "tenant_id" field.
func (*PostMutation) SetTitle ¶
func (m *PostMutation) SetTitle(s string)
SetTitle sets the "title" field.
func (*PostMutation) TenantID ¶
func (m *PostMutation) TenantID() (r *sql.NullString, exists bool)
TenantID returns the value of the "tenant_id" field in the mutation.
func (*PostMutation) TenantIDCleared ¶
func (m *PostMutation) TenantIDCleared() bool
TenantIDCleared returns if the "tenant_id" field was cleared in this mutation.
func (*PostMutation) Title ¶
func (m *PostMutation) Title() (r string, exists bool)
Title returns the value of the "title" field in the mutation.
func (PostMutation) Tx ¶
func (m PostMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*PostMutation) Type ¶
func (m *PostMutation) Type() string
Type returns the node type of this mutation (Post).
func (*PostMutation) Where ¶
func (m *PostMutation) Where(ps ...predicate.Post)
Where appends a list predicates to the PostMutation builder.
func (*PostMutation) WhereP ¶
func (m *PostMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the PostMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type PostQuery ¶
type PostQuery struct {
// contains filtered or unexported fields
}
PostQuery is the builder for querying Post entities.
func (*PostQuery) Aggregate ¶
func (pq *PostQuery) Aggregate(fns ...AggregateFunc) *PostSelect
Aggregate returns a PostSelect configured with the given aggregations.
func (*PostQuery) Clone ¶
Clone returns a duplicate of the PostQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*PostQuery) First ¶
First returns the first Post entity from the query. Returns a *NotFoundError when no Post was found.
func (*PostQuery) FirstID ¶
FirstID returns the first Post ID from the query. Returns a *NotFoundError when no Post ID was found.
func (*PostQuery) GroupBy ¶
func (pq *PostQuery) GroupBy(field string, fields ...string) *PostGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { TenantID *sql.NullString `json:"tenant_id,omitempty"` Count int `json:"count,omitempty"` } client.Post.Query(). GroupBy(post.FieldTenantID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*PostQuery) Only ¶
Only returns a single Post entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Post entity is found. Returns a *NotFoundError when no Post entities are found.
func (*PostQuery) OnlyID ¶
OnlyID is like Only, but returns the only Post ID in the query. Returns a *NotSingularError when more than one Post ID is found. Returns a *NotFoundError when no entities are found.
func (*PostQuery) Order ¶
func (pq *PostQuery) Order(o ...post.OrderOption) *PostQuery
Order specifies how the records should be ordered.
func (*PostQuery) Select ¶
func (pq *PostQuery) Select(fields ...string) *PostSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { TenantID *sql.NullString `json:"tenant_id,omitempty"` } client.Post.Query(). Select(post.FieldTenantID). Scan(ctx, &v)
type PostSelect ¶
type PostSelect struct { *PostQuery // contains filtered or unexported fields }
PostSelect is the builder for selecting fields of Post entities.
func (*PostSelect) Aggregate ¶
func (ps *PostSelect) Aggregate(fns ...AggregateFunc) *PostSelect
Aggregate adds the given aggregation functions to the selector query.
func (*PostSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PostSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PostSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PostSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PostSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PostSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PostSelect) Scan ¶
func (ps *PostSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PostSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PostUpdate ¶
type PostUpdate struct {
// contains filtered or unexported fields
}
PostUpdate is the builder for updating Post entities.
func (*PostUpdate) ClearDescription ¶
func (pu *PostUpdate) ClearDescription() *PostUpdate
ClearDescription clears the value of the "description" field.
func (*PostUpdate) ClearDsn ¶
func (pu *PostUpdate) ClearDsn() *PostUpdate
ClearDsn clears the value of the "dsn" field.
func (*PostUpdate) ClearTenantID ¶
func (pu *PostUpdate) ClearTenantID() *PostUpdate
ClearTenantID clears the value of the "tenant_id" field.
func (*PostUpdate) Exec ¶
func (pu *PostUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*PostUpdate) ExecX ¶
func (pu *PostUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PostUpdate) Mutation ¶
func (pu *PostUpdate) Mutation() *PostMutation
Mutation returns the PostMutation object of the builder.
func (*PostUpdate) Save ¶
func (pu *PostUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*PostUpdate) SaveX ¶
func (pu *PostUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*PostUpdate) SetDescription ¶
func (pu *PostUpdate) SetDescription(s string) *PostUpdate
SetDescription sets the "description" field.
func (*PostUpdate) SetDsn ¶
func (pu *PostUpdate) SetDsn(s string) *PostUpdate
SetDsn sets the "dsn" field.
func (*PostUpdate) SetNillableDescription ¶
func (pu *PostUpdate) SetNillableDescription(s *string) *PostUpdate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*PostUpdate) SetNillableDsn ¶
func (pu *PostUpdate) SetNillableDsn(s *string) *PostUpdate
SetNillableDsn sets the "dsn" field if the given value is not nil.
func (*PostUpdate) SetTenantID ¶
func (pu *PostUpdate) SetTenantID(ss *sql.NullString) *PostUpdate
SetTenantID sets the "tenant_id" field.
func (*PostUpdate) SetTitle ¶
func (pu *PostUpdate) SetTitle(s string) *PostUpdate
SetTitle sets the "title" field.
func (*PostUpdate) Where ¶
func (pu *PostUpdate) Where(ps ...predicate.Post) *PostUpdate
Where appends a list predicates to the PostUpdate builder.
type PostUpdateOne ¶
type PostUpdateOne struct {
// contains filtered or unexported fields
}
PostUpdateOne is the builder for updating a single Post entity.
func (*PostUpdateOne) ClearDescription ¶
func (puo *PostUpdateOne) ClearDescription() *PostUpdateOne
ClearDescription clears the value of the "description" field.
func (*PostUpdateOne) ClearDsn ¶
func (puo *PostUpdateOne) ClearDsn() *PostUpdateOne
ClearDsn clears the value of the "dsn" field.
func (*PostUpdateOne) ClearTenantID ¶
func (puo *PostUpdateOne) ClearTenantID() *PostUpdateOne
ClearTenantID clears the value of the "tenant_id" field.
func (*PostUpdateOne) Exec ¶
func (puo *PostUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*PostUpdateOne) ExecX ¶
func (puo *PostUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PostUpdateOne) Mutation ¶
func (puo *PostUpdateOne) Mutation() *PostMutation
Mutation returns the PostMutation object of the builder.
func (*PostUpdateOne) Save ¶
func (puo *PostUpdateOne) Save(ctx context.Context) (*Post, error)
Save executes the query and returns the updated Post entity.
func (*PostUpdateOne) SaveX ¶
func (puo *PostUpdateOne) SaveX(ctx context.Context) *Post
SaveX is like Save, but panics if an error occurs.
func (*PostUpdateOne) Select ¶
func (puo *PostUpdateOne) Select(field string, fields ...string) *PostUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*PostUpdateOne) SetDescription ¶
func (puo *PostUpdateOne) SetDescription(s string) *PostUpdateOne
SetDescription sets the "description" field.
func (*PostUpdateOne) SetDsn ¶
func (puo *PostUpdateOne) SetDsn(s string) *PostUpdateOne
SetDsn sets the "dsn" field.
func (*PostUpdateOne) SetNillableDescription ¶
func (puo *PostUpdateOne) SetNillableDescription(s *string) *PostUpdateOne
SetNillableDescription sets the "description" field if the given value is not nil.
func (*PostUpdateOne) SetNillableDsn ¶
func (puo *PostUpdateOne) SetNillableDsn(s *string) *PostUpdateOne
SetNillableDsn sets the "dsn" field if the given value is not nil.
func (*PostUpdateOne) SetTenantID ¶
func (puo *PostUpdateOne) SetTenantID(ss *sql.NullString) *PostUpdateOne
SetTenantID sets the "tenant_id" field.
func (*PostUpdateOne) SetTitle ¶
func (puo *PostUpdateOne) SetTitle(s string) *PostUpdateOne
SetTitle sets the "title" field.
func (*PostUpdateOne) Where ¶
func (puo *PostUpdateOne) Where(ps ...predicate.Post) *PostUpdateOne
Where appends a list predicates to the PostUpdate builder.
type PostUpsert ¶
PostUpsert is the "OnConflict" setter.
func (*PostUpsert) ClearDescription ¶
func (u *PostUpsert) ClearDescription() *PostUpsert
ClearDescription clears the value of the "description" field.
func (*PostUpsert) ClearDsn ¶
func (u *PostUpsert) ClearDsn() *PostUpsert
ClearDsn clears the value of the "dsn" field.
func (*PostUpsert) ClearTenantID ¶
func (u *PostUpsert) ClearTenantID() *PostUpsert
ClearTenantID clears the value of the "tenant_id" field.
func (*PostUpsert) SetDescription ¶
func (u *PostUpsert) SetDescription(v string) *PostUpsert
SetDescription sets the "description" field.
func (*PostUpsert) SetDsn ¶
func (u *PostUpsert) SetDsn(v string) *PostUpsert
SetDsn sets the "dsn" field.
func (*PostUpsert) SetTenantID ¶
func (u *PostUpsert) SetTenantID(v *sql.NullString) *PostUpsert
SetTenantID sets the "tenant_id" field.
func (*PostUpsert) SetTitle ¶
func (u *PostUpsert) SetTitle(v string) *PostUpsert
SetTitle sets the "title" field.
func (*PostUpsert) UpdateDescription ¶
func (u *PostUpsert) UpdateDescription() *PostUpsert
UpdateDescription sets the "description" field to the value that was provided on create.
func (*PostUpsert) UpdateDsn ¶
func (u *PostUpsert) UpdateDsn() *PostUpsert
UpdateDsn sets the "dsn" field to the value that was provided on create.
func (*PostUpsert) UpdateTenantID ¶
func (u *PostUpsert) UpdateTenantID() *PostUpsert
UpdateTenantID sets the "tenant_id" field to the value that was provided on create.
func (*PostUpsert) UpdateTitle ¶
func (u *PostUpsert) UpdateTitle() *PostUpsert
UpdateTitle sets the "title" field to the value that was provided on create.
type PostUpsertBulk ¶
type PostUpsertBulk struct {
// contains filtered or unexported fields
}
PostUpsertBulk is the builder for "upsert"-ing a bulk of Post nodes.
func (*PostUpsertBulk) ClearDescription ¶
func (u *PostUpsertBulk) ClearDescription() *PostUpsertBulk
ClearDescription clears the value of the "description" field.
func (*PostUpsertBulk) ClearDsn ¶
func (u *PostUpsertBulk) ClearDsn() *PostUpsertBulk
ClearDsn clears the value of the "dsn" field.
func (*PostUpsertBulk) ClearTenantID ¶
func (u *PostUpsertBulk) ClearTenantID() *PostUpsertBulk
ClearTenantID clears the value of the "tenant_id" field.
func (*PostUpsertBulk) DoNothing ¶
func (u *PostUpsertBulk) DoNothing() *PostUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*PostUpsertBulk) Exec ¶
func (u *PostUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*PostUpsertBulk) ExecX ¶
func (u *PostUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PostUpsertBulk) Ignore ¶
func (u *PostUpsertBulk) Ignore() *PostUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Post.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*PostUpsertBulk) SetDescription ¶
func (u *PostUpsertBulk) SetDescription(v string) *PostUpsertBulk
SetDescription sets the "description" field.
func (*PostUpsertBulk) SetDsn ¶
func (u *PostUpsertBulk) SetDsn(v string) *PostUpsertBulk
SetDsn sets the "dsn" field.
func (*PostUpsertBulk) SetTenantID ¶
func (u *PostUpsertBulk) SetTenantID(v *sql.NullString) *PostUpsertBulk
SetTenantID sets the "tenant_id" field.
func (*PostUpsertBulk) SetTitle ¶
func (u *PostUpsertBulk) SetTitle(v string) *PostUpsertBulk
SetTitle sets the "title" field.
func (*PostUpsertBulk) Update ¶
func (u *PostUpsertBulk) Update(set func(*PostUpsert)) *PostUpsertBulk
Update allows overriding fields `UPDATE` values. See the PostCreateBulk.OnConflict documentation for more info.
func (*PostUpsertBulk) UpdateDescription ¶
func (u *PostUpsertBulk) UpdateDescription() *PostUpsertBulk
UpdateDescription sets the "description" field to the value that was provided on create.
func (*PostUpsertBulk) UpdateDsn ¶
func (u *PostUpsertBulk) UpdateDsn() *PostUpsertBulk
UpdateDsn sets the "dsn" field to the value that was provided on create.
func (*PostUpsertBulk) UpdateNewValues ¶
func (u *PostUpsertBulk) UpdateNewValues() *PostUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Post.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(post.FieldID) }), ). Exec(ctx)
func (*PostUpsertBulk) UpdateTenantID ¶
func (u *PostUpsertBulk) UpdateTenantID() *PostUpsertBulk
UpdateTenantID sets the "tenant_id" field to the value that was provided on create.
func (*PostUpsertBulk) UpdateTitle ¶
func (u *PostUpsertBulk) UpdateTitle() *PostUpsertBulk
UpdateTitle sets the "title" field to the value that was provided on create.
type PostUpsertOne ¶
type PostUpsertOne struct {
// contains filtered or unexported fields
}
PostUpsertOne is the builder for "upsert"-ing
one Post node.
func (*PostUpsertOne) ClearDescription ¶
func (u *PostUpsertOne) ClearDescription() *PostUpsertOne
ClearDescription clears the value of the "description" field.
func (*PostUpsertOne) ClearDsn ¶
func (u *PostUpsertOne) ClearDsn() *PostUpsertOne
ClearDsn clears the value of the "dsn" field.
func (*PostUpsertOne) ClearTenantID ¶
func (u *PostUpsertOne) ClearTenantID() *PostUpsertOne
ClearTenantID clears the value of the "tenant_id" field.
func (*PostUpsertOne) DoNothing ¶
func (u *PostUpsertOne) DoNothing() *PostUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*PostUpsertOne) Exec ¶
func (u *PostUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*PostUpsertOne) ExecX ¶
func (u *PostUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PostUpsertOne) ID ¶
func (u *PostUpsertOne) ID(ctx context.Context) (id int, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*PostUpsertOne) IDX ¶
func (u *PostUpsertOne) IDX(ctx context.Context) int
IDX is like ID, but panics if an error occurs.
func (*PostUpsertOne) Ignore ¶
func (u *PostUpsertOne) Ignore() *PostUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Post.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*PostUpsertOne) SetDescription ¶
func (u *PostUpsertOne) SetDescription(v string) *PostUpsertOne
SetDescription sets the "description" field.
func (*PostUpsertOne) SetDsn ¶
func (u *PostUpsertOne) SetDsn(v string) *PostUpsertOne
SetDsn sets the "dsn" field.
func (*PostUpsertOne) SetTenantID ¶
func (u *PostUpsertOne) SetTenantID(v *sql.NullString) *PostUpsertOne
SetTenantID sets the "tenant_id" field.
func (*PostUpsertOne) SetTitle ¶
func (u *PostUpsertOne) SetTitle(v string) *PostUpsertOne
SetTitle sets the "title" field.
func (*PostUpsertOne) Update ¶
func (u *PostUpsertOne) Update(set func(*PostUpsert)) *PostUpsertOne
Update allows overriding fields `UPDATE` values. See the PostCreate.OnConflict documentation for more info.
func (*PostUpsertOne) UpdateDescription ¶
func (u *PostUpsertOne) UpdateDescription() *PostUpsertOne
UpdateDescription sets the "description" field to the value that was provided on create.
func (*PostUpsertOne) UpdateDsn ¶
func (u *PostUpsertOne) UpdateDsn() *PostUpsertOne
UpdateDsn sets the "dsn" field to the value that was provided on create.
func (*PostUpsertOne) UpdateNewValues ¶
func (u *PostUpsertOne) UpdateNewValues() *PostUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:
client.Post.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(post.FieldID) }), ). Exec(ctx)
func (*PostUpsertOne) UpdateTenantID ¶
func (u *PostUpsertOne) UpdateTenantID() *PostUpsertOne
UpdateTenantID sets the "tenant_id" field to the value that was provided on create.
func (*PostUpsertOne) UpdateTitle ¶
func (u *PostUpsertOne) UpdateTitle() *PostUpsertOne
UpdateTitle sets the "title" field to the value that was provided on create.
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 Tenant ¶
type Tenant struct { // ID of the ent. ID int `json:"id,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // DisplayName holds the value of the "display_name" field. DisplayName string `json:"display_name,omitempty"` // Region holds the value of the "region" field. Region string `json:"region,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the TenantQuery when eager-loading is set. Edges TenantEdges `json:"edges"` // contains filtered or unexported fields }
Tenant is the model entity for the Tenant schema.
func (*Tenant) QueryConn ¶
func (t *Tenant) QueryConn() *TenantConnQuery
QueryConn queries the "conn" edge of the Tenant entity.
func (*Tenant) Unwrap ¶
Unwrap unwraps the Tenant 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 (*Tenant) Update ¶
func (t *Tenant) Update() *TenantUpdateOne
Update returns a builder for updating this Tenant. Note that you need to call Tenant.Unwrap() before calling this method if this Tenant was returned from a transaction, and the transaction was committed or rolled back.
type TenantClient ¶
type TenantClient struct {
// contains filtered or unexported fields
}
TenantClient is a client for the Tenant schema.
func NewTenantClient ¶
func NewTenantClient(c config) *TenantClient
NewTenantClient returns a client for the Tenant from the given config.
func (*TenantClient) Create ¶
func (c *TenantClient) Create() *TenantCreate
Create returns a builder for creating a Tenant entity.
func (*TenantClient) CreateBulk ¶
func (c *TenantClient) CreateBulk(builders ...*TenantCreate) *TenantCreateBulk
CreateBulk returns a builder for creating a bulk of Tenant entities.
func (*TenantClient) Delete ¶
func (c *TenantClient) Delete() *TenantDelete
Delete returns a delete builder for Tenant.
func (*TenantClient) DeleteOne ¶
func (c *TenantClient) DeleteOne(t *Tenant) *TenantDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*TenantClient) DeleteOneID ¶
func (c *TenantClient) DeleteOneID(id int) *TenantDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*TenantClient) GetX ¶
func (c *TenantClient) GetX(ctx context.Context, id int) *Tenant
GetX is like Get, but panics if an error occurs.
func (*TenantClient) Intercept ¶
func (c *TenantClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tenant.Intercept(f(g(h())))`.
func (*TenantClient) Interceptors ¶
func (c *TenantClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*TenantClient) MapCreateBulk ¶
func (c *TenantClient) MapCreateBulk(slice any, setFunc func(*TenantCreate, int)) *TenantCreateBulk
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 (*TenantClient) Query ¶
func (c *TenantClient) Query() *TenantQuery
Query returns a query builder for Tenant.
func (*TenantClient) QueryConn ¶
func (c *TenantClient) QueryConn(t *Tenant) *TenantConnQuery
QueryConn queries the conn edge of a Tenant.
func (*TenantClient) Update ¶
func (c *TenantClient) Update() *TenantUpdate
Update returns an update builder for Tenant.
func (*TenantClient) UpdateOne ¶
func (c *TenantClient) UpdateOne(t *Tenant) *TenantUpdateOne
UpdateOne returns an update builder for the given entity.
func (*TenantClient) UpdateOneID ¶
func (c *TenantClient) UpdateOneID(id int) *TenantUpdateOne
UpdateOneID returns an update builder for the given id.
func (*TenantClient) Use ¶
func (c *TenantClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tenant.Hooks(f(g(h())))`.
type TenantConn ¶
type TenantConn struct { // ID of the ent. ID int `json:"id,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,omitempty"` // Key holds the value of the "key" field. Key string `json:"key,omitempty"` // Value holds the value of the "value" field. Value string `json:"value,omitempty"` // contains filtered or unexported fields }
TenantConn is the model entity for the TenantConn schema.
func (*TenantConn) GetValue ¶
func (tc *TenantConn) GetValue(name string) (ent.Value, error)
GetValue returns the ent.Value that was dynamically selected and assigned to the TenantConn. This includes values selected through modifiers, order, etc.
func (*TenantConn) String ¶
func (tc *TenantConn) String() string
String implements the fmt.Stringer.
func (*TenantConn) Unwrap ¶
func (tc *TenantConn) Unwrap() *TenantConn
Unwrap unwraps the TenantConn 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 (*TenantConn) Update ¶
func (tc *TenantConn) Update() *TenantConnUpdateOne
Update returns a builder for updating this TenantConn. Note that you need to call TenantConn.Unwrap() before calling this method if this TenantConn was returned from a transaction, and the transaction was committed or rolled back.
type TenantConnClient ¶
type TenantConnClient struct {
// contains filtered or unexported fields
}
TenantConnClient is a client for the TenantConn schema.
func NewTenantConnClient ¶
func NewTenantConnClient(c config) *TenantConnClient
NewTenantConnClient returns a client for the TenantConn from the given config.
func (*TenantConnClient) Create ¶
func (c *TenantConnClient) Create() *TenantConnCreate
Create returns a builder for creating a TenantConn entity.
func (*TenantConnClient) CreateBulk ¶
func (c *TenantConnClient) CreateBulk(builders ...*TenantConnCreate) *TenantConnCreateBulk
CreateBulk returns a builder for creating a bulk of TenantConn entities.
func (*TenantConnClient) Delete ¶
func (c *TenantConnClient) Delete() *TenantConnDelete
Delete returns a delete builder for TenantConn.
func (*TenantConnClient) DeleteOne ¶
func (c *TenantConnClient) DeleteOne(tc *TenantConn) *TenantConnDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*TenantConnClient) DeleteOneID ¶
func (c *TenantConnClient) DeleteOneID(id int) *TenantConnDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*TenantConnClient) Get ¶
func (c *TenantConnClient) Get(ctx context.Context, id int) (*TenantConn, error)
Get returns a TenantConn entity by its id.
func (*TenantConnClient) GetX ¶
func (c *TenantConnClient) GetX(ctx context.Context, id int) *TenantConn
GetX is like Get, but panics if an error occurs.
func (*TenantConnClient) Hooks ¶
func (c *TenantConnClient) Hooks() []Hook
Hooks returns the client hooks.
func (*TenantConnClient) Intercept ¶
func (c *TenantConnClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tenantconn.Intercept(f(g(h())))`.
func (*TenantConnClient) Interceptors ¶
func (c *TenantConnClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*TenantConnClient) MapCreateBulk ¶
func (c *TenantConnClient) MapCreateBulk(slice any, setFunc func(*TenantConnCreate, int)) *TenantConnCreateBulk
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 (*TenantConnClient) Query ¶
func (c *TenantConnClient) Query() *TenantConnQuery
Query returns a query builder for TenantConn.
func (*TenantConnClient) Update ¶
func (c *TenantConnClient) Update() *TenantConnUpdate
Update returns an update builder for TenantConn.
func (*TenantConnClient) UpdateOne ¶
func (c *TenantConnClient) UpdateOne(tc *TenantConn) *TenantConnUpdateOne
UpdateOne returns an update builder for the given entity.
func (*TenantConnClient) UpdateOneID ¶
func (c *TenantConnClient) UpdateOneID(id int) *TenantConnUpdateOne
UpdateOneID returns an update builder for the given id.
func (*TenantConnClient) Use ¶
func (c *TenantConnClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tenantconn.Hooks(f(g(h())))`.
type TenantConnCreate ¶
type TenantConnCreate struct {
// contains filtered or unexported fields
}
TenantConnCreate is the builder for creating a TenantConn entity.
func (*TenantConnCreate) Exec ¶
func (tcc *TenantConnCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*TenantConnCreate) ExecX ¶
func (tcc *TenantConnCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TenantConnCreate) Mutation ¶
func (tcc *TenantConnCreate) Mutation() *TenantConnMutation
Mutation returns the TenantConnMutation object of the builder.
func (*TenantConnCreate) OnConflict ¶
func (tcc *TenantConnCreate) OnConflict(opts ...sql.ConflictOption) *TenantConnUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.TenantConn.Create(). SetCreateTime(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.TenantConnUpsert) { SetCreateTime(v+v). }). Exec(ctx)
func (*TenantConnCreate) OnConflictColumns ¶
func (tcc *TenantConnCreate) OnConflictColumns(columns ...string) *TenantConnUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.TenantConn.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*TenantConnCreate) Save ¶
func (tcc *TenantConnCreate) Save(ctx context.Context) (*TenantConn, error)
Save creates the TenantConn in the database.
func (*TenantConnCreate) SaveX ¶
func (tcc *TenantConnCreate) SaveX(ctx context.Context) *TenantConn
SaveX calls Save and panics if Save returns an error.
func (*TenantConnCreate) SetCreateTime ¶
func (tcc *TenantConnCreate) SetCreateTime(t time.Time) *TenantConnCreate
SetCreateTime sets the "create_time" field.
func (*TenantConnCreate) SetKey ¶
func (tcc *TenantConnCreate) SetKey(s string) *TenantConnCreate
SetKey sets the "key" field.
func (*TenantConnCreate) SetNillableCreateTime ¶
func (tcc *TenantConnCreate) SetNillableCreateTime(t *time.Time) *TenantConnCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*TenantConnCreate) SetNillableUpdateTime ¶
func (tcc *TenantConnCreate) SetNillableUpdateTime(t *time.Time) *TenantConnCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*TenantConnCreate) SetUpdateTime ¶
func (tcc *TenantConnCreate) SetUpdateTime(t time.Time) *TenantConnCreate
SetUpdateTime sets the "update_time" field.
func (*TenantConnCreate) SetValue ¶
func (tcc *TenantConnCreate) SetValue(s string) *TenantConnCreate
SetValue sets the "value" field.
type TenantConnCreateBulk ¶
type TenantConnCreateBulk struct {
// contains filtered or unexported fields
}
TenantConnCreateBulk is the builder for creating many TenantConn entities in bulk.
func (*TenantConnCreateBulk) Exec ¶
func (tccb *TenantConnCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TenantConnCreateBulk) ExecX ¶
func (tccb *TenantConnCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TenantConnCreateBulk) OnConflict ¶
func (tccb *TenantConnCreateBulk) OnConflict(opts ...sql.ConflictOption) *TenantConnUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.TenantConn.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.TenantConnUpsert) { SetCreateTime(v+v). }). Exec(ctx)
func (*TenantConnCreateBulk) OnConflictColumns ¶
func (tccb *TenantConnCreateBulk) OnConflictColumns(columns ...string) *TenantConnUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.TenantConn.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*TenantConnCreateBulk) Save ¶
func (tccb *TenantConnCreateBulk) Save(ctx context.Context) ([]*TenantConn, error)
Save creates the TenantConn entities in the database.
func (*TenantConnCreateBulk) SaveX ¶
func (tccb *TenantConnCreateBulk) SaveX(ctx context.Context) []*TenantConn
SaveX is like Save, but panics if an error occurs.
type TenantConnDelete ¶
type TenantConnDelete struct {
// contains filtered or unexported fields
}
TenantConnDelete is the builder for deleting a TenantConn entity.
func (*TenantConnDelete) Exec ¶
func (tcd *TenantConnDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*TenantConnDelete) ExecX ¶
func (tcd *TenantConnDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*TenantConnDelete) Where ¶
func (tcd *TenantConnDelete) Where(ps ...predicate.TenantConn) *TenantConnDelete
Where appends a list predicates to the TenantConnDelete builder.
type TenantConnDeleteOne ¶
type TenantConnDeleteOne struct {
// contains filtered or unexported fields
}
TenantConnDeleteOne is the builder for deleting a single TenantConn entity.
func (*TenantConnDeleteOne) Exec ¶
func (tcdo *TenantConnDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*TenantConnDeleteOne) ExecX ¶
func (tcdo *TenantConnDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TenantConnDeleteOne) Where ¶
func (tcdo *TenantConnDeleteOne) Where(ps ...predicate.TenantConn) *TenantConnDeleteOne
Where appends a list predicates to the TenantConnDelete builder.
type TenantConnGroupBy ¶
type TenantConnGroupBy struct {
// contains filtered or unexported fields
}
TenantConnGroupBy is the group-by builder for TenantConn entities.
func (*TenantConnGroupBy) Aggregate ¶
func (tcgb *TenantConnGroupBy) Aggregate(fns ...AggregateFunc) *TenantConnGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*TenantConnGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TenantConnGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TenantConnGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TenantConnGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TenantConnGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TenantConnGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TenantConnGroupBy) Scan ¶
func (tcgb *TenantConnGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TenantConnGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TenantConnMutation ¶
type TenantConnMutation struct {
// contains filtered or unexported fields
}
TenantConnMutation represents an operation that mutates the TenantConn nodes in the graph.
func (*TenantConnMutation) AddField ¶
func (m *TenantConnMutation) 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 (*TenantConnMutation) AddedEdges ¶
func (m *TenantConnMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*TenantConnMutation) AddedField ¶
func (m *TenantConnMutation) 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 (*TenantConnMutation) AddedFields ¶
func (m *TenantConnMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*TenantConnMutation) AddedIDs ¶
func (m *TenantConnMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*TenantConnMutation) ClearEdge ¶
func (m *TenantConnMutation) 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 (*TenantConnMutation) ClearField ¶
func (m *TenantConnMutation) 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 (*TenantConnMutation) ClearedEdges ¶
func (m *TenantConnMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*TenantConnMutation) ClearedFields ¶
func (m *TenantConnMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (TenantConnMutation) Client ¶
func (m TenantConnMutation) 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 (*TenantConnMutation) CreateTime ¶
func (m *TenantConnMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*TenantConnMutation) EdgeCleared ¶
func (m *TenantConnMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*TenantConnMutation) Field ¶
func (m *TenantConnMutation) 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 (*TenantConnMutation) FieldCleared ¶
func (m *TenantConnMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*TenantConnMutation) Fields ¶
func (m *TenantConnMutation) 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 (*TenantConnMutation) ID ¶
func (m *TenantConnMutation) 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 (*TenantConnMutation) IDs ¶
func (m *TenantConnMutation) 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 (*TenantConnMutation) Key ¶
func (m *TenantConnMutation) Key() (r string, exists bool)
Key returns the value of the "key" field in the mutation.
func (*TenantConnMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the TenantConn entity. If the TenantConn 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 (*TenantConnMutation) 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 (*TenantConnMutation) OldKey ¶
func (m *TenantConnMutation) OldKey(ctx context.Context) (v string, err error)
OldKey returns the old "key" field's value of the TenantConn entity. If the TenantConn 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 (*TenantConnMutation) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" field's value of the TenantConn entity. If the TenantConn 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 (*TenantConnMutation) OldValue ¶
func (m *TenantConnMutation) OldValue(ctx context.Context) (v string, err error)
OldValue returns the old "value" field's value of the TenantConn entity. If the TenantConn 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 (*TenantConnMutation) RemovedEdges ¶
func (m *TenantConnMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*TenantConnMutation) RemovedIDs ¶
func (m *TenantConnMutation) 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 (*TenantConnMutation) ResetCreateTime ¶
func (m *TenantConnMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*TenantConnMutation) ResetEdge ¶
func (m *TenantConnMutation) 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 (*TenantConnMutation) ResetField ¶
func (m *TenantConnMutation) 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 (*TenantConnMutation) ResetKey ¶
func (m *TenantConnMutation) ResetKey()
ResetKey resets all changes to the "key" field.
func (*TenantConnMutation) ResetUpdateTime ¶
func (m *TenantConnMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*TenantConnMutation) ResetValue ¶
func (m *TenantConnMutation) ResetValue()
ResetValue resets all changes to the "value" field.
func (*TenantConnMutation) SetCreateTime ¶
func (m *TenantConnMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*TenantConnMutation) SetField ¶
func (m *TenantConnMutation) 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 (*TenantConnMutation) SetKey ¶
func (m *TenantConnMutation) SetKey(s string)
SetKey sets the "key" field.
func (*TenantConnMutation) SetOp ¶
func (m *TenantConnMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*TenantConnMutation) SetUpdateTime ¶
func (m *TenantConnMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (*TenantConnMutation) SetValue ¶
func (m *TenantConnMutation) SetValue(s string)
SetValue sets the "value" field.
func (TenantConnMutation) Tx ¶
func (m TenantConnMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*TenantConnMutation) Type ¶
func (m *TenantConnMutation) Type() string
Type returns the node type of this mutation (TenantConn).
func (*TenantConnMutation) UpdateTime ¶
func (m *TenantConnMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*TenantConnMutation) Value ¶
func (m *TenantConnMutation) Value() (r string, exists bool)
Value returns the value of the "value" field in the mutation.
func (*TenantConnMutation) Where ¶
func (m *TenantConnMutation) Where(ps ...predicate.TenantConn)
Where appends a list predicates to the TenantConnMutation builder.
func (*TenantConnMutation) WhereP ¶
func (m *TenantConnMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the TenantConnMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type TenantConnQuery ¶
type TenantConnQuery struct {
// contains filtered or unexported fields
}
TenantConnQuery is the builder for querying TenantConn entities.
func (*TenantConnQuery) Aggregate ¶
func (tcq *TenantConnQuery) Aggregate(fns ...AggregateFunc) *TenantConnSelect
Aggregate returns a TenantConnSelect configured with the given aggregations.
func (*TenantConnQuery) All ¶
func (tcq *TenantConnQuery) All(ctx context.Context) ([]*TenantConn, error)
All executes the query and returns a list of TenantConns.
func (*TenantConnQuery) AllX ¶
func (tcq *TenantConnQuery) AllX(ctx context.Context) []*TenantConn
AllX is like All, but panics if an error occurs.
func (*TenantConnQuery) Clone ¶
func (tcq *TenantConnQuery) Clone() *TenantConnQuery
Clone returns a duplicate of the TenantConnQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*TenantConnQuery) Count ¶
func (tcq *TenantConnQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*TenantConnQuery) CountX ¶
func (tcq *TenantConnQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*TenantConnQuery) Exist ¶
func (tcq *TenantConnQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*TenantConnQuery) ExistX ¶
func (tcq *TenantConnQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*TenantConnQuery) First ¶
func (tcq *TenantConnQuery) First(ctx context.Context) (*TenantConn, error)
First returns the first TenantConn entity from the query. Returns a *NotFoundError when no TenantConn was found.
func (*TenantConnQuery) FirstID ¶
func (tcq *TenantConnQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first TenantConn ID from the query. Returns a *NotFoundError when no TenantConn ID was found.
func (*TenantConnQuery) FirstIDX ¶
func (tcq *TenantConnQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*TenantConnQuery) FirstX ¶
func (tcq *TenantConnQuery) FirstX(ctx context.Context) *TenantConn
FirstX is like First, but panics if an error occurs.
func (*TenantConnQuery) GroupBy ¶
func (tcq *TenantConnQuery) GroupBy(field string, fields ...string) *TenantConnGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreateTime time.Time `json:"create_time,omitempty"` Count int `json:"count,omitempty"` } client.TenantConn.Query(). GroupBy(tenantconn.FieldCreateTime). Aggregate(ent.Count()). Scan(ctx, &v)
func (*TenantConnQuery) IDs ¶
func (tcq *TenantConnQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of TenantConn IDs.
func (*TenantConnQuery) IDsX ¶
func (tcq *TenantConnQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*TenantConnQuery) Limit ¶
func (tcq *TenantConnQuery) Limit(limit int) *TenantConnQuery
Limit the number of records to be returned by this query.
func (*TenantConnQuery) Offset ¶
func (tcq *TenantConnQuery) Offset(offset int) *TenantConnQuery
Offset to start from.
func (*TenantConnQuery) Only ¶
func (tcq *TenantConnQuery) Only(ctx context.Context) (*TenantConn, error)
Only returns a single TenantConn entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one TenantConn entity is found. Returns a *NotFoundError when no TenantConn entities are found.
func (*TenantConnQuery) OnlyID ¶
func (tcq *TenantConnQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only TenantConn ID in the query. Returns a *NotSingularError when more than one TenantConn ID is found. Returns a *NotFoundError when no entities are found.
func (*TenantConnQuery) OnlyIDX ¶
func (tcq *TenantConnQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*TenantConnQuery) OnlyX ¶
func (tcq *TenantConnQuery) OnlyX(ctx context.Context) *TenantConn
OnlyX is like Only, but panics if an error occurs.
func (*TenantConnQuery) Order ¶
func (tcq *TenantConnQuery) Order(o ...tenantconn.OrderOption) *TenantConnQuery
Order specifies how the records should be ordered.
func (*TenantConnQuery) Select ¶
func (tcq *TenantConnQuery) Select(fields ...string) *TenantConnSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreateTime time.Time `json:"create_time,omitempty"` } client.TenantConn.Query(). Select(tenantconn.FieldCreateTime). Scan(ctx, &v)
func (*TenantConnQuery) Unique ¶
func (tcq *TenantConnQuery) Unique(unique bool) *TenantConnQuery
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 (*TenantConnQuery) Where ¶
func (tcq *TenantConnQuery) Where(ps ...predicate.TenantConn) *TenantConnQuery
Where adds a new predicate for the TenantConnQuery builder.
type TenantConnSelect ¶
type TenantConnSelect struct { *TenantConnQuery // contains filtered or unexported fields }
TenantConnSelect is the builder for selecting fields of TenantConn entities.
func (*TenantConnSelect) Aggregate ¶
func (tcs *TenantConnSelect) Aggregate(fns ...AggregateFunc) *TenantConnSelect
Aggregate adds the given aggregation functions to the selector query.
func (*TenantConnSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TenantConnSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TenantConnSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TenantConnSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TenantConnSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TenantConnSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TenantConnSelect) Scan ¶
func (tcs *TenantConnSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TenantConnSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TenantConnUpdate ¶
type TenantConnUpdate struct {
// contains filtered or unexported fields
}
TenantConnUpdate is the builder for updating TenantConn entities.
func (*TenantConnUpdate) Exec ¶
func (tcu *TenantConnUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*TenantConnUpdate) ExecX ¶
func (tcu *TenantConnUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TenantConnUpdate) Mutation ¶
func (tcu *TenantConnUpdate) Mutation() *TenantConnMutation
Mutation returns the TenantConnMutation object of the builder.
func (*TenantConnUpdate) Save ¶
func (tcu *TenantConnUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*TenantConnUpdate) SaveX ¶
func (tcu *TenantConnUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*TenantConnUpdate) SetKey ¶
func (tcu *TenantConnUpdate) SetKey(s string) *TenantConnUpdate
SetKey sets the "key" field.
func (*TenantConnUpdate) SetUpdateTime ¶
func (tcu *TenantConnUpdate) SetUpdateTime(t time.Time) *TenantConnUpdate
SetUpdateTime sets the "update_time" field.
func (*TenantConnUpdate) SetValue ¶
func (tcu *TenantConnUpdate) SetValue(s string) *TenantConnUpdate
SetValue sets the "value" field.
func (*TenantConnUpdate) Where ¶
func (tcu *TenantConnUpdate) Where(ps ...predicate.TenantConn) *TenantConnUpdate
Where appends a list predicates to the TenantConnUpdate builder.
type TenantConnUpdateOne ¶
type TenantConnUpdateOne struct {
// contains filtered or unexported fields
}
TenantConnUpdateOne is the builder for updating a single TenantConn entity.
func (*TenantConnUpdateOne) Exec ¶
func (tcuo *TenantConnUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*TenantConnUpdateOne) ExecX ¶
func (tcuo *TenantConnUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TenantConnUpdateOne) Mutation ¶
func (tcuo *TenantConnUpdateOne) Mutation() *TenantConnMutation
Mutation returns the TenantConnMutation object of the builder.
func (*TenantConnUpdateOne) Save ¶
func (tcuo *TenantConnUpdateOne) Save(ctx context.Context) (*TenantConn, error)
Save executes the query and returns the updated TenantConn entity.
func (*TenantConnUpdateOne) SaveX ¶
func (tcuo *TenantConnUpdateOne) SaveX(ctx context.Context) *TenantConn
SaveX is like Save, but panics if an error occurs.
func (*TenantConnUpdateOne) Select ¶
func (tcuo *TenantConnUpdateOne) Select(field string, fields ...string) *TenantConnUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*TenantConnUpdateOne) SetKey ¶
func (tcuo *TenantConnUpdateOne) SetKey(s string) *TenantConnUpdateOne
SetKey sets the "key" field.
func (*TenantConnUpdateOne) SetUpdateTime ¶
func (tcuo *TenantConnUpdateOne) SetUpdateTime(t time.Time) *TenantConnUpdateOne
SetUpdateTime sets the "update_time" field.
func (*TenantConnUpdateOne) SetValue ¶
func (tcuo *TenantConnUpdateOne) SetValue(s string) *TenantConnUpdateOne
SetValue sets the "value" field.
func (*TenantConnUpdateOne) Where ¶
func (tcuo *TenantConnUpdateOne) Where(ps ...predicate.TenantConn) *TenantConnUpdateOne
Where appends a list predicates to the TenantConnUpdate builder.
type TenantConnUpsert ¶
TenantConnUpsert is the "OnConflict" setter.
func (*TenantConnUpsert) SetKey ¶
func (u *TenantConnUpsert) SetKey(v string) *TenantConnUpsert
SetKey sets the "key" field.
func (*TenantConnUpsert) SetUpdateTime ¶
func (u *TenantConnUpsert) SetUpdateTime(v time.Time) *TenantConnUpsert
SetUpdateTime sets the "update_time" field.
func (*TenantConnUpsert) SetValue ¶
func (u *TenantConnUpsert) SetValue(v string) *TenantConnUpsert
SetValue sets the "value" field.
func (*TenantConnUpsert) UpdateKey ¶
func (u *TenantConnUpsert) UpdateKey() *TenantConnUpsert
UpdateKey sets the "key" field to the value that was provided on create.
func (*TenantConnUpsert) UpdateUpdateTime ¶
func (u *TenantConnUpsert) UpdateUpdateTime() *TenantConnUpsert
UpdateUpdateTime sets the "update_time" field to the value that was provided on create.
func (*TenantConnUpsert) UpdateValue ¶
func (u *TenantConnUpsert) UpdateValue() *TenantConnUpsert
UpdateValue sets the "value" field to the value that was provided on create.
type TenantConnUpsertBulk ¶
type TenantConnUpsertBulk struct {
// contains filtered or unexported fields
}
TenantConnUpsertBulk is the builder for "upsert"-ing a bulk of TenantConn nodes.
func (*TenantConnUpsertBulk) DoNothing ¶
func (u *TenantConnUpsertBulk) DoNothing() *TenantConnUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*TenantConnUpsertBulk) Exec ¶
func (u *TenantConnUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TenantConnUpsertBulk) ExecX ¶
func (u *TenantConnUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TenantConnUpsertBulk) Ignore ¶
func (u *TenantConnUpsertBulk) Ignore() *TenantConnUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.TenantConn.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*TenantConnUpsertBulk) SetKey ¶
func (u *TenantConnUpsertBulk) SetKey(v string) *TenantConnUpsertBulk
SetKey sets the "key" field.
func (*TenantConnUpsertBulk) SetUpdateTime ¶
func (u *TenantConnUpsertBulk) SetUpdateTime(v time.Time) *TenantConnUpsertBulk
SetUpdateTime sets the "update_time" field.
func (*TenantConnUpsertBulk) SetValue ¶
func (u *TenantConnUpsertBulk) SetValue(v string) *TenantConnUpsertBulk
SetValue sets the "value" field.
func (*TenantConnUpsertBulk) Update ¶
func (u *TenantConnUpsertBulk) Update(set func(*TenantConnUpsert)) *TenantConnUpsertBulk
Update allows overriding fields `UPDATE` values. See the TenantConnCreateBulk.OnConflict documentation for more info.
func (*TenantConnUpsertBulk) UpdateKey ¶
func (u *TenantConnUpsertBulk) UpdateKey() *TenantConnUpsertBulk
UpdateKey sets the "key" field to the value that was provided on create.
func (*TenantConnUpsertBulk) UpdateNewValues ¶
func (u *TenantConnUpsertBulk) UpdateNewValues() *TenantConnUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.TenantConn.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*TenantConnUpsertBulk) UpdateUpdateTime ¶
func (u *TenantConnUpsertBulk) UpdateUpdateTime() *TenantConnUpsertBulk
UpdateUpdateTime sets the "update_time" field to the value that was provided on create.
func (*TenantConnUpsertBulk) UpdateValue ¶
func (u *TenantConnUpsertBulk) UpdateValue() *TenantConnUpsertBulk
UpdateValue sets the "value" field to the value that was provided on create.
type TenantConnUpsertOne ¶
type TenantConnUpsertOne struct {
// contains filtered or unexported fields
}
TenantConnUpsertOne is the builder for "upsert"-ing
one TenantConn node.
func (*TenantConnUpsertOne) DoNothing ¶
func (u *TenantConnUpsertOne) DoNothing() *TenantConnUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*TenantConnUpsertOne) Exec ¶
func (u *TenantConnUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*TenantConnUpsertOne) ExecX ¶
func (u *TenantConnUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TenantConnUpsertOne) ID ¶
func (u *TenantConnUpsertOne) ID(ctx context.Context) (id int, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*TenantConnUpsertOne) IDX ¶
func (u *TenantConnUpsertOne) IDX(ctx context.Context) int
IDX is like ID, but panics if an error occurs.
func (*TenantConnUpsertOne) Ignore ¶
func (u *TenantConnUpsertOne) Ignore() *TenantConnUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.TenantConn.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*TenantConnUpsertOne) SetKey ¶
func (u *TenantConnUpsertOne) SetKey(v string) *TenantConnUpsertOne
SetKey sets the "key" field.
func (*TenantConnUpsertOne) SetUpdateTime ¶
func (u *TenantConnUpsertOne) SetUpdateTime(v time.Time) *TenantConnUpsertOne
SetUpdateTime sets the "update_time" field.
func (*TenantConnUpsertOne) SetValue ¶
func (u *TenantConnUpsertOne) SetValue(v string) *TenantConnUpsertOne
SetValue sets the "value" field.
func (*TenantConnUpsertOne) Update ¶
func (u *TenantConnUpsertOne) Update(set func(*TenantConnUpsert)) *TenantConnUpsertOne
Update allows overriding fields `UPDATE` values. See the TenantConnCreate.OnConflict documentation for more info.
func (*TenantConnUpsertOne) UpdateKey ¶
func (u *TenantConnUpsertOne) UpdateKey() *TenantConnUpsertOne
UpdateKey sets the "key" field to the value that was provided on create.
func (*TenantConnUpsertOne) UpdateNewValues ¶
func (u *TenantConnUpsertOne) UpdateNewValues() *TenantConnUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.TenantConn.Create(). OnConflict( sql.ResolveWithNewValues(), ). Exec(ctx)
func (*TenantConnUpsertOne) UpdateUpdateTime ¶
func (u *TenantConnUpsertOne) UpdateUpdateTime() *TenantConnUpsertOne
UpdateUpdateTime sets the "update_time" field to the value that was provided on create.
func (*TenantConnUpsertOne) UpdateValue ¶
func (u *TenantConnUpsertOne) UpdateValue() *TenantConnUpsertOne
UpdateValue sets the "value" field to the value that was provided on create.
type TenantCreate ¶
type TenantCreate struct {
// contains filtered or unexported fields
}
TenantCreate is the builder for creating a Tenant entity.
func (*TenantCreate) AddConn ¶
func (tc *TenantCreate) AddConn(t ...*TenantConn) *TenantCreate
AddConn adds the "conn" edges to the TenantConn entity.
func (*TenantCreate) AddConnIDs ¶
func (tc *TenantCreate) AddConnIDs(ids ...int) *TenantCreate
AddConnIDs adds the "conn" edge to the TenantConn entity by IDs.
func (*TenantCreate) Exec ¶
func (tc *TenantCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*TenantCreate) ExecX ¶
func (tc *TenantCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TenantCreate) Mutation ¶
func (tc *TenantCreate) Mutation() *TenantMutation
Mutation returns the TenantMutation object of the builder.
func (*TenantCreate) OnConflict ¶
func (tc *TenantCreate) OnConflict(opts ...sql.ConflictOption) *TenantUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Tenant.Create(). SetCreateTime(v). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.TenantUpsert) { SetCreateTime(v+v). }). Exec(ctx)
func (*TenantCreate) OnConflictColumns ¶
func (tc *TenantCreate) OnConflictColumns(columns ...string) *TenantUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Tenant.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*TenantCreate) Save ¶
func (tc *TenantCreate) Save(ctx context.Context) (*Tenant, error)
Save creates the Tenant in the database.
func (*TenantCreate) SaveX ¶
func (tc *TenantCreate) SaveX(ctx context.Context) *Tenant
SaveX calls Save and panics if Save returns an error.
func (*TenantCreate) SetCreateTime ¶
func (tc *TenantCreate) SetCreateTime(t time.Time) *TenantCreate
SetCreateTime sets the "create_time" field.
func (*TenantCreate) SetDisplayName ¶
func (tc *TenantCreate) SetDisplayName(s string) *TenantCreate
SetDisplayName sets the "display_name" field.
func (*TenantCreate) SetID ¶
func (tc *TenantCreate) SetID(i int) *TenantCreate
SetID sets the "id" field.
func (*TenantCreate) SetName ¶
func (tc *TenantCreate) SetName(s string) *TenantCreate
SetName sets the "name" field.
func (*TenantCreate) SetNillableCreateTime ¶
func (tc *TenantCreate) SetNillableCreateTime(t *time.Time) *TenantCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*TenantCreate) SetNillableDisplayName ¶
func (tc *TenantCreate) SetNillableDisplayName(s *string) *TenantCreate
SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (*TenantCreate) SetNillableRegion ¶
func (tc *TenantCreate) SetNillableRegion(s *string) *TenantCreate
SetNillableRegion sets the "region" field if the given value is not nil.
func (*TenantCreate) SetNillableUpdateTime ¶
func (tc *TenantCreate) SetNillableUpdateTime(t *time.Time) *TenantCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*TenantCreate) SetRegion ¶
func (tc *TenantCreate) SetRegion(s string) *TenantCreate
SetRegion sets the "region" field.
func (*TenantCreate) SetUpdateTime ¶
func (tc *TenantCreate) SetUpdateTime(t time.Time) *TenantCreate
SetUpdateTime sets the "update_time" field.
type TenantCreateBulk ¶
type TenantCreateBulk struct {
// contains filtered or unexported fields
}
TenantCreateBulk is the builder for creating many Tenant entities in bulk.
func (*TenantCreateBulk) Exec ¶
func (tcb *TenantCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TenantCreateBulk) ExecX ¶
func (tcb *TenantCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TenantCreateBulk) OnConflict ¶
func (tcb *TenantCreateBulk) OnConflict(opts ...sql.ConflictOption) *TenantUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Tenant.CreateBulk(builders...). OnConflict( // Update the row with the new values // the was proposed for insertion. sql.ResolveWithNewValues(), ). // Override some of the fields with custom // update values. Update(func(u *ent.TenantUpsert) { SetCreateTime(v+v). }). Exec(ctx)
func (*TenantCreateBulk) OnConflictColumns ¶
func (tcb *TenantCreateBulk) OnConflictColumns(columns ...string) *TenantUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Tenant.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type TenantDelete ¶
type TenantDelete struct {
// contains filtered or unexported fields
}
TenantDelete is the builder for deleting a Tenant entity.
func (*TenantDelete) Exec ¶
func (td *TenantDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*TenantDelete) ExecX ¶
func (td *TenantDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*TenantDelete) Where ¶
func (td *TenantDelete) Where(ps ...predicate.Tenant) *TenantDelete
Where appends a list predicates to the TenantDelete builder.
type TenantDeleteOne ¶
type TenantDeleteOne struct {
// contains filtered or unexported fields
}
TenantDeleteOne is the builder for deleting a single Tenant entity.
func (*TenantDeleteOne) Exec ¶
func (tdo *TenantDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*TenantDeleteOne) ExecX ¶
func (tdo *TenantDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TenantDeleteOne) Where ¶
func (tdo *TenantDeleteOne) Where(ps ...predicate.Tenant) *TenantDeleteOne
Where appends a list predicates to the TenantDelete builder.
type TenantEdges ¶
type TenantEdges struct { // Conn holds the value of the conn edge. Conn []*TenantConn `json:"conn,omitempty"` // contains filtered or unexported fields }
TenantEdges holds the relations/edges for other nodes in the graph.
func (TenantEdges) ConnOrErr ¶
func (e TenantEdges) ConnOrErr() ([]*TenantConn, error)
ConnOrErr returns the Conn value or an error if the edge was not loaded in eager-loading.
type TenantGroupBy ¶
type TenantGroupBy struct {
// contains filtered or unexported fields
}
TenantGroupBy is the group-by builder for Tenant entities.
func (*TenantGroupBy) Aggregate ¶
func (tgb *TenantGroupBy) Aggregate(fns ...AggregateFunc) *TenantGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*TenantGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TenantGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TenantGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TenantGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TenantGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TenantGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TenantGroupBy) Scan ¶
func (tgb *TenantGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TenantGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TenantMutation ¶
type TenantMutation struct {
// contains filtered or unexported fields
}
TenantMutation represents an operation that mutates the Tenant nodes in the graph.
func (*TenantMutation) AddConnIDs ¶
func (m *TenantMutation) AddConnIDs(ids ...int)
AddConnIDs adds the "conn" edge to the TenantConn entity by ids.
func (*TenantMutation) AddField ¶
func (m *TenantMutation) 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 (*TenantMutation) AddedEdges ¶
func (m *TenantMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*TenantMutation) AddedField ¶
func (m *TenantMutation) 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 (*TenantMutation) AddedFields ¶
func (m *TenantMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*TenantMutation) AddedIDs ¶
func (m *TenantMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*TenantMutation) ClearConn ¶
func (m *TenantMutation) ClearConn()
ClearConn clears the "conn" edge to the TenantConn entity.
func (*TenantMutation) ClearDisplayName ¶
func (m *TenantMutation) ClearDisplayName()
ClearDisplayName clears the value of the "display_name" field.
func (*TenantMutation) ClearEdge ¶
func (m *TenantMutation) 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 (*TenantMutation) ClearField ¶
func (m *TenantMutation) 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 (*TenantMutation) ClearRegion ¶
func (m *TenantMutation) ClearRegion()
ClearRegion clears the value of the "region" field.
func (*TenantMutation) ClearedEdges ¶
func (m *TenantMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*TenantMutation) ClearedFields ¶
func (m *TenantMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (TenantMutation) Client ¶
func (m TenantMutation) 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 (*TenantMutation) ConnCleared ¶
func (m *TenantMutation) ConnCleared() bool
ConnCleared reports if the "conn" edge to the TenantConn entity was cleared.
func (*TenantMutation) ConnIDs ¶
func (m *TenantMutation) ConnIDs() (ids []int)
ConnIDs returns the "conn" edge IDs in the mutation.
func (*TenantMutation) CreateTime ¶
func (m *TenantMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*TenantMutation) DisplayName ¶
func (m *TenantMutation) DisplayName() (r string, exists bool)
DisplayName returns the value of the "display_name" field in the mutation.
func (*TenantMutation) DisplayNameCleared ¶
func (m *TenantMutation) DisplayNameCleared() bool
DisplayNameCleared returns if the "display_name" field was cleared in this mutation.
func (*TenantMutation) EdgeCleared ¶
func (m *TenantMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*TenantMutation) Field ¶
func (m *TenantMutation) 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 (*TenantMutation) FieldCleared ¶
func (m *TenantMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*TenantMutation) Fields ¶
func (m *TenantMutation) 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 (*TenantMutation) ID ¶
func (m *TenantMutation) 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 (*TenantMutation) IDs ¶
func (m *TenantMutation) 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 (*TenantMutation) Name ¶
func (m *TenantMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*TenantMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the Tenant entity. If the Tenant 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 (*TenantMutation) OldDisplayName ¶
func (m *TenantMutation) OldDisplayName(ctx context.Context) (v string, err error)
OldDisplayName returns the old "display_name" field's value of the Tenant entity. If the Tenant 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 (*TenantMutation) 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 (*TenantMutation) OldName ¶
func (m *TenantMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Tenant entity. If the Tenant 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 (*TenantMutation) OldRegion ¶
func (m *TenantMutation) OldRegion(ctx context.Context) (v string, err error)
OldRegion returns the old "region" field's value of the Tenant entity. If the Tenant 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 (*TenantMutation) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" field's value of the Tenant entity. If the Tenant 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 (*TenantMutation) Region ¶
func (m *TenantMutation) Region() (r string, exists bool)
Region returns the value of the "region" field in the mutation.
func (*TenantMutation) RegionCleared ¶
func (m *TenantMutation) RegionCleared() bool
RegionCleared returns if the "region" field was cleared in this mutation.
func (*TenantMutation) RemoveConnIDs ¶
func (m *TenantMutation) RemoveConnIDs(ids ...int)
RemoveConnIDs removes the "conn" edge to the TenantConn entity by IDs.
func (*TenantMutation) RemovedConnIDs ¶
func (m *TenantMutation) RemovedConnIDs() (ids []int)
RemovedConn returns the removed IDs of the "conn" edge to the TenantConn entity.
func (*TenantMutation) RemovedEdges ¶
func (m *TenantMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*TenantMutation) RemovedIDs ¶
func (m *TenantMutation) 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 (*TenantMutation) ResetConn ¶
func (m *TenantMutation) ResetConn()
ResetConn resets all changes to the "conn" edge.
func (*TenantMutation) ResetCreateTime ¶
func (m *TenantMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*TenantMutation) ResetDisplayName ¶
func (m *TenantMutation) ResetDisplayName()
ResetDisplayName resets all changes to the "display_name" field.
func (*TenantMutation) ResetEdge ¶
func (m *TenantMutation) 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 (*TenantMutation) ResetField ¶
func (m *TenantMutation) 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 (*TenantMutation) ResetName ¶
func (m *TenantMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*TenantMutation) ResetRegion ¶
func (m *TenantMutation) ResetRegion()
ResetRegion resets all changes to the "region" field.
func (*TenantMutation) ResetUpdateTime ¶
func (m *TenantMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*TenantMutation) SetCreateTime ¶
func (m *TenantMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*TenantMutation) SetDisplayName ¶
func (m *TenantMutation) SetDisplayName(s string)
SetDisplayName sets the "display_name" field.
func (*TenantMutation) SetField ¶
func (m *TenantMutation) 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 (*TenantMutation) SetID ¶
func (m *TenantMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Tenant entities.
func (*TenantMutation) SetName ¶
func (m *TenantMutation) SetName(s string)
SetName sets the "name" field.
func (*TenantMutation) SetOp ¶
func (m *TenantMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*TenantMutation) SetRegion ¶
func (m *TenantMutation) SetRegion(s string)
SetRegion sets the "region" field.
func (*TenantMutation) SetUpdateTime ¶
func (m *TenantMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (TenantMutation) Tx ¶
func (m TenantMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*TenantMutation) Type ¶
func (m *TenantMutation) Type() string
Type returns the node type of this mutation (Tenant).
func (*TenantMutation) UpdateTime ¶
func (m *TenantMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*TenantMutation) Where ¶
func (m *TenantMutation) Where(ps ...predicate.Tenant)
Where appends a list predicates to the TenantMutation builder.
func (*TenantMutation) WhereP ¶
func (m *TenantMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the TenantMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type TenantQuery ¶
type TenantQuery struct {
// contains filtered or unexported fields
}
TenantQuery is the builder for querying Tenant entities.
func (*TenantQuery) Aggregate ¶
func (tq *TenantQuery) Aggregate(fns ...AggregateFunc) *TenantSelect
Aggregate returns a TenantSelect configured with the given aggregations.
func (*TenantQuery) All ¶
func (tq *TenantQuery) All(ctx context.Context) ([]*Tenant, error)
All executes the query and returns a list of Tenants.
func (*TenantQuery) AllX ¶
func (tq *TenantQuery) AllX(ctx context.Context) []*Tenant
AllX is like All, but panics if an error occurs.
func (*TenantQuery) Clone ¶
func (tq *TenantQuery) Clone() *TenantQuery
Clone returns a duplicate of the TenantQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*TenantQuery) Count ¶
func (tq *TenantQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*TenantQuery) CountX ¶
func (tq *TenantQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*TenantQuery) Exist ¶
func (tq *TenantQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*TenantQuery) ExistX ¶
func (tq *TenantQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*TenantQuery) First ¶
func (tq *TenantQuery) First(ctx context.Context) (*Tenant, error)
First returns the first Tenant entity from the query. Returns a *NotFoundError when no Tenant was found.
func (*TenantQuery) FirstID ¶
func (tq *TenantQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Tenant ID from the query. Returns a *NotFoundError when no Tenant ID was found.
func (*TenantQuery) FirstIDX ¶
func (tq *TenantQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*TenantQuery) FirstX ¶
func (tq *TenantQuery) FirstX(ctx context.Context) *Tenant
FirstX is like First, but panics if an error occurs.
func (*TenantQuery) GroupBy ¶
func (tq *TenantQuery) GroupBy(field string, fields ...string) *TenantGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreateTime time.Time `json:"create_time,omitempty"` Count int `json:"count,omitempty"` } client.Tenant.Query(). GroupBy(tenant.FieldCreateTime). Aggregate(ent.Count()). Scan(ctx, &v)
func (*TenantQuery) IDs ¶
func (tq *TenantQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Tenant IDs.
func (*TenantQuery) IDsX ¶
func (tq *TenantQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*TenantQuery) Limit ¶
func (tq *TenantQuery) Limit(limit int) *TenantQuery
Limit the number of records to be returned by this query.
func (*TenantQuery) Offset ¶
func (tq *TenantQuery) Offset(offset int) *TenantQuery
Offset to start from.
func (*TenantQuery) Only ¶
func (tq *TenantQuery) Only(ctx context.Context) (*Tenant, error)
Only returns a single Tenant entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Tenant entity is found. Returns a *NotFoundError when no Tenant entities are found.
func (*TenantQuery) OnlyID ¶
func (tq *TenantQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Tenant ID in the query. Returns a *NotSingularError when more than one Tenant ID is found. Returns a *NotFoundError when no entities are found.
func (*TenantQuery) OnlyIDX ¶
func (tq *TenantQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*TenantQuery) OnlyX ¶
func (tq *TenantQuery) OnlyX(ctx context.Context) *Tenant
OnlyX is like Only, but panics if an error occurs.
func (*TenantQuery) Order ¶
func (tq *TenantQuery) Order(o ...tenant.OrderOption) *TenantQuery
Order specifies how the records should be ordered.
func (*TenantQuery) QueryConn ¶
func (tq *TenantQuery) QueryConn() *TenantConnQuery
QueryConn chains the current query on the "conn" edge.
func (*TenantQuery) Select ¶
func (tq *TenantQuery) Select(fields ...string) *TenantSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreateTime time.Time `json:"create_time,omitempty"` } client.Tenant.Query(). Select(tenant.FieldCreateTime). Scan(ctx, &v)
func (*TenantQuery) Unique ¶
func (tq *TenantQuery) Unique(unique bool) *TenantQuery
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 (*TenantQuery) Where ¶
func (tq *TenantQuery) Where(ps ...predicate.Tenant) *TenantQuery
Where adds a new predicate for the TenantQuery builder.
func (*TenantQuery) WithConn ¶
func (tq *TenantQuery) WithConn(opts ...func(*TenantConnQuery)) *TenantQuery
WithConn tells the query-builder to eager-load the nodes that are connected to the "conn" edge. The optional arguments are used to configure the query builder of the edge.
type TenantSelect ¶
type TenantSelect struct { *TenantQuery // contains filtered or unexported fields }
TenantSelect is the builder for selecting fields of Tenant entities.
func (*TenantSelect) Aggregate ¶
func (ts *TenantSelect) Aggregate(fns ...AggregateFunc) *TenantSelect
Aggregate adds the given aggregation functions to the selector query.
func (*TenantSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TenantSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TenantSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TenantSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TenantSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TenantSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TenantSelect) Scan ¶
func (ts *TenantSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TenantSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TenantUpdate ¶
type TenantUpdate struct {
// contains filtered or unexported fields
}
TenantUpdate is the builder for updating Tenant entities.
func (*TenantUpdate) AddConn ¶
func (tu *TenantUpdate) AddConn(t ...*TenantConn) *TenantUpdate
AddConn adds the "conn" edges to the TenantConn entity.
func (*TenantUpdate) AddConnIDs ¶
func (tu *TenantUpdate) AddConnIDs(ids ...int) *TenantUpdate
AddConnIDs adds the "conn" edge to the TenantConn entity by IDs.
func (*TenantUpdate) ClearConn ¶
func (tu *TenantUpdate) ClearConn() *TenantUpdate
ClearConn clears all "conn" edges to the TenantConn entity.
func (*TenantUpdate) ClearDisplayName ¶
func (tu *TenantUpdate) ClearDisplayName() *TenantUpdate
ClearDisplayName clears the value of the "display_name" field.
func (*TenantUpdate) ClearRegion ¶
func (tu *TenantUpdate) ClearRegion() *TenantUpdate
ClearRegion clears the value of the "region" field.
func (*TenantUpdate) Exec ¶
func (tu *TenantUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*TenantUpdate) ExecX ¶
func (tu *TenantUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TenantUpdate) Mutation ¶
func (tu *TenantUpdate) Mutation() *TenantMutation
Mutation returns the TenantMutation object of the builder.
func (*TenantUpdate) RemoveConn ¶
func (tu *TenantUpdate) RemoveConn(t ...*TenantConn) *TenantUpdate
RemoveConn removes "conn" edges to TenantConn entities.
func (*TenantUpdate) RemoveConnIDs ¶
func (tu *TenantUpdate) RemoveConnIDs(ids ...int) *TenantUpdate
RemoveConnIDs removes the "conn" edge to TenantConn entities by IDs.
func (*TenantUpdate) Save ¶
func (tu *TenantUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*TenantUpdate) SaveX ¶
func (tu *TenantUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*TenantUpdate) SetDisplayName ¶
func (tu *TenantUpdate) SetDisplayName(s string) *TenantUpdate
SetDisplayName sets the "display_name" field.
func (*TenantUpdate) SetName ¶
func (tu *TenantUpdate) SetName(s string) *TenantUpdate
SetName sets the "name" field.
func (*TenantUpdate) SetNillableDisplayName ¶
func (tu *TenantUpdate) SetNillableDisplayName(s *string) *TenantUpdate
SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (*TenantUpdate) SetNillableRegion ¶
func (tu *TenantUpdate) SetNillableRegion(s *string) *TenantUpdate
SetNillableRegion sets the "region" field if the given value is not nil.
func (*TenantUpdate) SetRegion ¶
func (tu *TenantUpdate) SetRegion(s string) *TenantUpdate
SetRegion sets the "region" field.
func (*TenantUpdate) SetUpdateTime ¶
func (tu *TenantUpdate) SetUpdateTime(t time.Time) *TenantUpdate
SetUpdateTime sets the "update_time" field.
func (*TenantUpdate) Where ¶
func (tu *TenantUpdate) Where(ps ...predicate.Tenant) *TenantUpdate
Where appends a list predicates to the TenantUpdate builder.
type TenantUpdateOne ¶
type TenantUpdateOne struct {
// contains filtered or unexported fields
}
TenantUpdateOne is the builder for updating a single Tenant entity.
func (*TenantUpdateOne) AddConn ¶
func (tuo *TenantUpdateOne) AddConn(t ...*TenantConn) *TenantUpdateOne
AddConn adds the "conn" edges to the TenantConn entity.
func (*TenantUpdateOne) AddConnIDs ¶
func (tuo *TenantUpdateOne) AddConnIDs(ids ...int) *TenantUpdateOne
AddConnIDs adds the "conn" edge to the TenantConn entity by IDs.
func (*TenantUpdateOne) ClearConn ¶
func (tuo *TenantUpdateOne) ClearConn() *TenantUpdateOne
ClearConn clears all "conn" edges to the TenantConn entity.
func (*TenantUpdateOne) ClearDisplayName ¶
func (tuo *TenantUpdateOne) ClearDisplayName() *TenantUpdateOne
ClearDisplayName clears the value of the "display_name" field.
func (*TenantUpdateOne) ClearRegion ¶
func (tuo *TenantUpdateOne) ClearRegion() *TenantUpdateOne
ClearRegion clears the value of the "region" field.
func (*TenantUpdateOne) Exec ¶
func (tuo *TenantUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*TenantUpdateOne) ExecX ¶
func (tuo *TenantUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TenantUpdateOne) Mutation ¶
func (tuo *TenantUpdateOne) Mutation() *TenantMutation
Mutation returns the TenantMutation object of the builder.
func (*TenantUpdateOne) RemoveConn ¶
func (tuo *TenantUpdateOne) RemoveConn(t ...*TenantConn) *TenantUpdateOne
RemoveConn removes "conn" edges to TenantConn entities.
func (*TenantUpdateOne) RemoveConnIDs ¶
func (tuo *TenantUpdateOne) RemoveConnIDs(ids ...int) *TenantUpdateOne
RemoveConnIDs removes the "conn" edge to TenantConn entities by IDs.
func (*TenantUpdateOne) Save ¶
func (tuo *TenantUpdateOne) Save(ctx context.Context) (*Tenant, error)
Save executes the query and returns the updated Tenant entity.
func (*TenantUpdateOne) SaveX ¶
func (tuo *TenantUpdateOne) SaveX(ctx context.Context) *Tenant
SaveX is like Save, but panics if an error occurs.
func (*TenantUpdateOne) Select ¶
func (tuo *TenantUpdateOne) Select(field string, fields ...string) *TenantUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*TenantUpdateOne) SetDisplayName ¶
func (tuo *TenantUpdateOne) SetDisplayName(s string) *TenantUpdateOne
SetDisplayName sets the "display_name" field.
func (*TenantUpdateOne) SetName ¶
func (tuo *TenantUpdateOne) SetName(s string) *TenantUpdateOne
SetName sets the "name" field.
func (*TenantUpdateOne) SetNillableDisplayName ¶
func (tuo *TenantUpdateOne) SetNillableDisplayName(s *string) *TenantUpdateOne
SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (*TenantUpdateOne) SetNillableRegion ¶
func (tuo *TenantUpdateOne) SetNillableRegion(s *string) *TenantUpdateOne
SetNillableRegion sets the "region" field if the given value is not nil.
func (*TenantUpdateOne) SetRegion ¶
func (tuo *TenantUpdateOne) SetRegion(s string) *TenantUpdateOne
SetRegion sets the "region" field.
func (*TenantUpdateOne) SetUpdateTime ¶
func (tuo *TenantUpdateOne) SetUpdateTime(t time.Time) *TenantUpdateOne
SetUpdateTime sets the "update_time" field.
func (*TenantUpdateOne) Where ¶
func (tuo *TenantUpdateOne) Where(ps ...predicate.Tenant) *TenantUpdateOne
Where appends a list predicates to the TenantUpdate builder.
type TenantUpsert ¶
TenantUpsert is the "OnConflict" setter.
func (*TenantUpsert) ClearDisplayName ¶
func (u *TenantUpsert) ClearDisplayName() *TenantUpsert
ClearDisplayName clears the value of the "display_name" field.
func (*TenantUpsert) ClearRegion ¶
func (u *TenantUpsert) ClearRegion() *TenantUpsert
ClearRegion clears the value of the "region" field.
func (*TenantUpsert) SetDisplayName ¶
func (u *TenantUpsert) SetDisplayName(v string) *TenantUpsert
SetDisplayName sets the "display_name" field.
func (*TenantUpsert) SetName ¶
func (u *TenantUpsert) SetName(v string) *TenantUpsert
SetName sets the "name" field.
func (*TenantUpsert) SetRegion ¶
func (u *TenantUpsert) SetRegion(v string) *TenantUpsert
SetRegion sets the "region" field.
func (*TenantUpsert) SetUpdateTime ¶
func (u *TenantUpsert) SetUpdateTime(v time.Time) *TenantUpsert
SetUpdateTime sets the "update_time" field.
func (*TenantUpsert) UpdateDisplayName ¶
func (u *TenantUpsert) UpdateDisplayName() *TenantUpsert
UpdateDisplayName sets the "display_name" field to the value that was provided on create.
func (*TenantUpsert) UpdateName ¶
func (u *TenantUpsert) UpdateName() *TenantUpsert
UpdateName sets the "name" field to the value that was provided on create.
func (*TenantUpsert) UpdateRegion ¶
func (u *TenantUpsert) UpdateRegion() *TenantUpsert
UpdateRegion sets the "region" field to the value that was provided on create.
func (*TenantUpsert) UpdateUpdateTime ¶
func (u *TenantUpsert) UpdateUpdateTime() *TenantUpsert
UpdateUpdateTime sets the "update_time" field to the value that was provided on create.
type TenantUpsertBulk ¶
type TenantUpsertBulk struct {
// contains filtered or unexported fields
}
TenantUpsertBulk is the builder for "upsert"-ing a bulk of Tenant nodes.
func (*TenantUpsertBulk) ClearDisplayName ¶
func (u *TenantUpsertBulk) ClearDisplayName() *TenantUpsertBulk
ClearDisplayName clears the value of the "display_name" field.
func (*TenantUpsertBulk) ClearRegion ¶
func (u *TenantUpsertBulk) ClearRegion() *TenantUpsertBulk
ClearRegion clears the value of the "region" field.
func (*TenantUpsertBulk) DoNothing ¶
func (u *TenantUpsertBulk) DoNothing() *TenantUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*TenantUpsertBulk) Exec ¶
func (u *TenantUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TenantUpsertBulk) ExecX ¶
func (u *TenantUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TenantUpsertBulk) Ignore ¶
func (u *TenantUpsertBulk) Ignore() *TenantUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Tenant.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*TenantUpsertBulk) SetDisplayName ¶
func (u *TenantUpsertBulk) SetDisplayName(v string) *TenantUpsertBulk
SetDisplayName sets the "display_name" field.
func (*TenantUpsertBulk) SetName ¶
func (u *TenantUpsertBulk) SetName(v string) *TenantUpsertBulk
SetName sets the "name" field.
func (*TenantUpsertBulk) SetRegion ¶
func (u *TenantUpsertBulk) SetRegion(v string) *TenantUpsertBulk
SetRegion sets the "region" field.
func (*TenantUpsertBulk) SetUpdateTime ¶
func (u *TenantUpsertBulk) SetUpdateTime(v time.Time) *TenantUpsertBulk
SetUpdateTime sets the "update_time" field.
func (*TenantUpsertBulk) Update ¶
func (u *TenantUpsertBulk) Update(set func(*TenantUpsert)) *TenantUpsertBulk
Update allows overriding fields `UPDATE` values. See the TenantCreateBulk.OnConflict documentation for more info.
func (*TenantUpsertBulk) UpdateDisplayName ¶
func (u *TenantUpsertBulk) UpdateDisplayName() *TenantUpsertBulk
UpdateDisplayName sets the "display_name" field to the value that was provided on create.
func (*TenantUpsertBulk) UpdateName ¶
func (u *TenantUpsertBulk) UpdateName() *TenantUpsertBulk
UpdateName sets the "name" field to the value that was provided on create.
func (*TenantUpsertBulk) UpdateNewValues ¶
func (u *TenantUpsertBulk) UpdateNewValues() *TenantUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Tenant.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(tenant.FieldID) }), ). Exec(ctx)
func (*TenantUpsertBulk) UpdateRegion ¶
func (u *TenantUpsertBulk) UpdateRegion() *TenantUpsertBulk
UpdateRegion sets the "region" field to the value that was provided on create.
func (*TenantUpsertBulk) UpdateUpdateTime ¶
func (u *TenantUpsertBulk) UpdateUpdateTime() *TenantUpsertBulk
UpdateUpdateTime sets the "update_time" field to the value that was provided on create.
type TenantUpsertOne ¶
type TenantUpsertOne struct {
// contains filtered or unexported fields
}
TenantUpsertOne is the builder for "upsert"-ing
one Tenant node.
func (*TenantUpsertOne) ClearDisplayName ¶
func (u *TenantUpsertOne) ClearDisplayName() *TenantUpsertOne
ClearDisplayName clears the value of the "display_name" field.
func (*TenantUpsertOne) ClearRegion ¶
func (u *TenantUpsertOne) ClearRegion() *TenantUpsertOne
ClearRegion clears the value of the "region" field.
func (*TenantUpsertOne) DoNothing ¶
func (u *TenantUpsertOne) DoNothing() *TenantUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*TenantUpsertOne) Exec ¶
func (u *TenantUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*TenantUpsertOne) ExecX ¶
func (u *TenantUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TenantUpsertOne) ID ¶
func (u *TenantUpsertOne) ID(ctx context.Context) (id int, err error)
Exec executes the UPSERT query and returns the inserted/updated ID.
func (*TenantUpsertOne) IDX ¶
func (u *TenantUpsertOne) IDX(ctx context.Context) int
IDX is like ID, but panics if an error occurs.
func (*TenantUpsertOne) Ignore ¶
func (u *TenantUpsertOne) Ignore() *TenantUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Tenant.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*TenantUpsertOne) SetDisplayName ¶
func (u *TenantUpsertOne) SetDisplayName(v string) *TenantUpsertOne
SetDisplayName sets the "display_name" field.
func (*TenantUpsertOne) SetName ¶
func (u *TenantUpsertOne) SetName(v string) *TenantUpsertOne
SetName sets the "name" field.
func (*TenantUpsertOne) SetRegion ¶
func (u *TenantUpsertOne) SetRegion(v string) *TenantUpsertOne
SetRegion sets the "region" field.
func (*TenantUpsertOne) SetUpdateTime ¶
func (u *TenantUpsertOne) SetUpdateTime(v time.Time) *TenantUpsertOne
SetUpdateTime sets the "update_time" field.
func (*TenantUpsertOne) Update ¶
func (u *TenantUpsertOne) Update(set func(*TenantUpsert)) *TenantUpsertOne
Update allows overriding fields `UPDATE` values. See the TenantCreate.OnConflict documentation for more info.
func (*TenantUpsertOne) UpdateDisplayName ¶
func (u *TenantUpsertOne) UpdateDisplayName() *TenantUpsertOne
UpdateDisplayName sets the "display_name" field to the value that was provided on create.
func (*TenantUpsertOne) UpdateName ¶
func (u *TenantUpsertOne) UpdateName() *TenantUpsertOne
UpdateName sets the "name" field to the value that was provided on create.
func (*TenantUpsertOne) UpdateNewValues ¶
func (u *TenantUpsertOne) UpdateNewValues() *TenantUpsertOne
UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:
client.Tenant.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(tenant.FieldID) }), ). Exec(ctx)
func (*TenantUpsertOne) UpdateRegion ¶
func (u *TenantUpsertOne) UpdateRegion() *TenantUpsertOne
UpdateRegion sets the "region" field to the value that was provided on create.
func (*TenantUpsertOne) UpdateUpdateTime ¶
func (u *TenantUpsertOne) UpdateUpdateTime() *TenantUpsertOne
UpdateUpdateTime sets the "update_time" field to the value that was provided on create.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Post is the client for interacting with the Post builders. Post *PostClient // Tenant is the client for interacting with the Tenant builders. Tenant *TenantClient // TenantConn is the client for interacting with the TenantConn builders. TenantConn *TenantConnClient // 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.