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
- func OpenTxFromContext(ctx context.Context) (context.Context, driver.Tx, error)
- 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) Noder(ctx context.Context, id gidx.PrefixedID, opts ...NodeOption) (_ Noder, err error)
- func (c *Client) Noders(ctx context.Context, ids []gidx.PrefixedID, opts ...NodeOption) ([]Noder, error)
- func (c *Client) OpenTx(ctx context.Context) (context.Context, driver.Tx, 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 CreateTenantInput
- type Cursor
- type Hook
- type InterceptFunc
- type Interceptor
- type MetadataNode
- type MutateFunc
- type Mutation
- type Mutator
- type NodeOption
- type Noder
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderDirection
- type OrderFunc
- type PageInfo
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type ResourceOwner
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Tenant
- func (t *Tenant) Children(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*TenantConnection, error)
- func (t Tenant) IsEntity()
- func (*Tenant) IsMetadataNode()
- func (*Tenant) IsNode()
- func (*Tenant) IsResourceOwner()
- func (t *Tenant) NamedChildren(name string) ([]*Tenant, error)
- func (t *Tenant) Parent(ctx context.Context) (*Tenant, error)
- func (t *Tenant) QueryChildren() *TenantQuery
- func (t *Tenant) QueryParent() *TenantQuery
- func (t *Tenant) String() string
- func (t *Tenant) ToEdge(order *TenantOrder) *TenantEdge
- func (t *Tenant) Unwrap() *Tenant
- func (t *Tenant) Update() *TenantUpdateOne
- func (t *Tenant) Value(name string) (ent.Value, error)
- 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 gidx.PrefixedID) *TenantDeleteOne
- func (c *TenantClient) Get(ctx context.Context, id gidx.PrefixedID) (*Tenant, error)
- func (c *TenantClient) GetX(ctx context.Context, id gidx.PrefixedID) *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) QueryChildren(t *Tenant) *TenantQuery
- func (c *TenantClient) QueryParent(t *Tenant) *TenantQuery
- func (c *TenantClient) Update() *TenantUpdate
- func (c *TenantClient) UpdateOne(t *Tenant) *TenantUpdateOne
- func (c *TenantClient) UpdateOneID(id gidx.PrefixedID) *TenantUpdateOne
- func (c *TenantClient) Use(hooks ...Hook)
- type TenantConnection
- type TenantCreate
- func (tc *TenantCreate) AddChildIDs(ids ...gidx.PrefixedID) *TenantCreate
- func (tc *TenantCreate) AddChildren(t ...*Tenant) *TenantCreate
- func (tc *TenantCreate) Exec(ctx context.Context) error
- func (tc *TenantCreate) ExecX(ctx context.Context)
- func (tc *TenantCreate) Mutation() *TenantMutation
- func (tc *TenantCreate) Save(ctx context.Context) (*Tenant, error)
- func (tc *TenantCreate) SaveX(ctx context.Context) *Tenant
- func (tc *TenantCreate) SetCreatedAt(t time.Time) *TenantCreate
- func (tc *TenantCreate) SetDescription(s string) *TenantCreate
- func (tc *TenantCreate) SetID(gi gidx.PrefixedID) *TenantCreate
- func (c *TenantCreate) SetInput(i CreateTenantInput) *TenantCreate
- func (tc *TenantCreate) SetName(s string) *TenantCreate
- func (tc *TenantCreate) SetNillableCreatedAt(t *time.Time) *TenantCreate
- func (tc *TenantCreate) SetNillableDescription(s *string) *TenantCreate
- func (tc *TenantCreate) SetNillableID(gi *gidx.PrefixedID) *TenantCreate
- func (tc *TenantCreate) SetNillableParentID(id *gidx.PrefixedID) *TenantCreate
- func (tc *TenantCreate) SetNillableParentTenantID(gi *gidx.PrefixedID) *TenantCreate
- func (tc *TenantCreate) SetNillableUpdatedAt(t *time.Time) *TenantCreate
- func (tc *TenantCreate) SetParent(t *Tenant) *TenantCreate
- func (tc *TenantCreate) SetParentID(id gidx.PrefixedID) *TenantCreate
- func (tc *TenantCreate) SetParentTenantID(gi gidx.PrefixedID) *TenantCreate
- func (tc *TenantCreate) SetUpdatedAt(t time.Time) *TenantCreate
- type TenantCreateBulk
- type TenantDelete
- type TenantDeleteOne
- type TenantEdge
- 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) AddChildIDs(ids ...gidx.PrefixedID)
- 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) ChildrenCleared() bool
- func (m *TenantMutation) ChildrenIDs() (ids []gidx.PrefixedID)
- func (m *TenantMutation) ClearChildren()
- func (m *TenantMutation) ClearDescription()
- func (m *TenantMutation) ClearEdge(name string) error
- func (m *TenantMutation) ClearField(name string) error
- func (m *TenantMutation) ClearParent()
- func (m *TenantMutation) ClearParentTenantID()
- func (m *TenantMutation) ClearedEdges() []string
- func (m *TenantMutation) ClearedFields() []string
- func (m TenantMutation) Client() *Client
- func (m *TenantMutation) CreatedAt() (r time.Time, exists bool)
- func (m *TenantMutation) Description() (r string, exists bool)
- func (m *TenantMutation) DescriptionCleared() 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 gidx.PrefixedID, exists bool)
- func (m *TenantMutation) IDs(ctx context.Context) ([]gidx.PrefixedID, error)
- func (m *TenantMutation) Name() (r string, exists bool)
- func (m *TenantMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *TenantMutation) OldDescription(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) OldParentTenantID(ctx context.Context) (v gidx.PrefixedID, err error)
- func (m *TenantMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *TenantMutation) Op() Op
- func (m *TenantMutation) ParentCleared() bool
- func (m *TenantMutation) ParentID() (id gidx.PrefixedID, exists bool)
- func (m *TenantMutation) ParentIDs() (ids []gidx.PrefixedID)
- func (m *TenantMutation) ParentTenantID() (r gidx.PrefixedID, exists bool)
- func (m *TenantMutation) ParentTenantIDCleared() bool
- func (m *TenantMutation) RemoveChildIDs(ids ...gidx.PrefixedID)
- func (m *TenantMutation) RemovedChildrenIDs() (ids []gidx.PrefixedID)
- func (m *TenantMutation) RemovedEdges() []string
- func (m *TenantMutation) RemovedIDs(name string) []ent.Value
- func (m *TenantMutation) ResetChildren()
- func (m *TenantMutation) ResetCreatedAt()
- func (m *TenantMutation) ResetDescription()
- func (m *TenantMutation) ResetEdge(name string) error
- func (m *TenantMutation) ResetField(name string) error
- func (m *TenantMutation) ResetName()
- func (m *TenantMutation) ResetParent()
- func (m *TenantMutation) ResetParentTenantID()
- func (m *TenantMutation) ResetUpdatedAt()
- func (m *TenantMutation) SetCreatedAt(t time.Time)
- func (m *TenantMutation) SetDescription(s string)
- func (m *TenantMutation) SetField(name string, value ent.Value) error
- func (m *TenantMutation) SetID(id gidx.PrefixedID)
- func (m *TenantMutation) SetName(s string)
- func (m *TenantMutation) SetOp(op Op)
- func (m *TenantMutation) SetParentID(id gidx.PrefixedID)
- func (m *TenantMutation) SetParentTenantID(gi gidx.PrefixedID)
- func (m *TenantMutation) SetUpdatedAt(t time.Time)
- func (m TenantMutation) Tx() (*Tx, error)
- func (m *TenantMutation) Type() string
- func (m *TenantMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *TenantMutation) Where(ps ...predicate.Tenant)
- func (m *TenantMutation) WhereP(ps ...func(*sql.Selector))
- type TenantOrder
- type TenantOrderField
- type TenantPaginateOption
- 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 (t *TenantQuery) CollectFields(ctx context.Context, satisfies ...string) (*TenantQuery, error)
- 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 gidx.PrefixedID, err error)
- func (tq *TenantQuery) FirstIDX(ctx context.Context) gidx.PrefixedID
- 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 []gidx.PrefixedID, err error)
- func (tq *TenantQuery) IDsX(ctx context.Context) []gidx.PrefixedID
- 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 gidx.PrefixedID, err error)
- func (tq *TenantQuery) OnlyIDX(ctx context.Context) gidx.PrefixedID
- func (tq *TenantQuery) OnlyX(ctx context.Context) *Tenant
- func (tq *TenantQuery) Order(o ...tenant.OrderOption) *TenantQuery
- func (t *TenantQuery) Paginate(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*TenantConnection, error)
- func (tq *TenantQuery) QueryChildren() *TenantQuery
- func (tq *TenantQuery) QueryParent() *TenantQuery
- 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) WithChildren(opts ...func(*TenantQuery)) *TenantQuery
- func (tq *TenantQuery) WithNamedChildren(name string, opts ...func(*TenantQuery)) *TenantQuery
- func (tq *TenantQuery) WithParent(opts ...func(*TenantQuery)) *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) AddChildIDs(ids ...gidx.PrefixedID) *TenantUpdate
- func (tu *TenantUpdate) AddChildren(t ...*Tenant) *TenantUpdate
- func (tu *TenantUpdate) ClearChildren() *TenantUpdate
- func (tu *TenantUpdate) ClearDescription() *TenantUpdate
- func (tu *TenantUpdate) Exec(ctx context.Context) error
- func (tu *TenantUpdate) ExecX(ctx context.Context)
- func (tu *TenantUpdate) Mutation() *TenantMutation
- func (tu *TenantUpdate) RemoveChildIDs(ids ...gidx.PrefixedID) *TenantUpdate
- func (tu *TenantUpdate) RemoveChildren(t ...*Tenant) *TenantUpdate
- func (tu *TenantUpdate) Save(ctx context.Context) (int, error)
- func (tu *TenantUpdate) SaveX(ctx context.Context) int
- func (tu *TenantUpdate) SetDescription(s string) *TenantUpdate
- func (c *TenantUpdate) SetInput(i UpdateTenantInput) *TenantUpdate
- func (tu *TenantUpdate) SetName(s string) *TenantUpdate
- func (tu *TenantUpdate) SetNillableDescription(s *string) *TenantUpdate
- func (tu *TenantUpdate) SetNillableName(s *string) *TenantUpdate
- func (tu *TenantUpdate) Where(ps ...predicate.Tenant) *TenantUpdate
- type TenantUpdateOne
- func (tuo *TenantUpdateOne) AddChildIDs(ids ...gidx.PrefixedID) *TenantUpdateOne
- func (tuo *TenantUpdateOne) AddChildren(t ...*Tenant) *TenantUpdateOne
- func (tuo *TenantUpdateOne) ClearChildren() *TenantUpdateOne
- func (tuo *TenantUpdateOne) ClearDescription() *TenantUpdateOne
- func (tuo *TenantUpdateOne) Exec(ctx context.Context) error
- func (tuo *TenantUpdateOne) ExecX(ctx context.Context)
- func (tuo *TenantUpdateOne) Mutation() *TenantMutation
- func (tuo *TenantUpdateOne) RemoveChildIDs(ids ...gidx.PrefixedID) *TenantUpdateOne
- func (tuo *TenantUpdateOne) RemoveChildren(t ...*Tenant) *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) SetDescription(s string) *TenantUpdateOne
- func (c *TenantUpdateOne) SetInput(i UpdateTenantInput) *TenantUpdateOne
- func (tuo *TenantUpdateOne) SetName(s string) *TenantUpdateOne
- func (tuo *TenantUpdateOne) SetNillableDescription(s *string) *TenantUpdateOne
- func (tuo *TenantUpdateOne) SetNillableName(s *string) *TenantUpdateOne
- func (tuo *TenantUpdateOne) Where(ps ...predicate.Tenant) *TenantUpdateOne
- type TenantWhereInput
- type Tenants
- type TraverseFunc
- type Traverser
- type Tx
- type UpdateTenantInput
- 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. TypeTenant = "Tenant" )
Variables ¶
var ( // TenantOrderFieldCreatedAt orders Tenant by created_at. TenantOrderFieldCreatedAt = &TenantOrderField{ Value: func(t *Tenant) (ent.Value, error) { return t.CreatedAt, nil }, column: tenant.FieldCreatedAt, toTerm: tenant.ByCreatedAt, toCursor: func(t *Tenant) Cursor { return Cursor{ ID: t.ID, Value: t.CreatedAt, } }, } // TenantOrderFieldUpdatedAt orders Tenant by updated_at. TenantOrderFieldUpdatedAt = &TenantOrderField{ Value: func(t *Tenant) (ent.Value, error) { return t.UpdatedAt, nil }, column: tenant.FieldUpdatedAt, toTerm: tenant.ByUpdatedAt, toCursor: func(t *Tenant) Cursor { return Cursor{ ID: t.ID, Value: t.UpdatedAt, } }, } // TenantOrderFieldName orders Tenant by name. TenantOrderFieldName = &TenantOrderField{ Value: func(t *Tenant) (ent.Value, error) { return t.Name, nil }, column: tenant.FieldName, toTerm: tenant.ByName, toCursor: func(t *Tenant) Cursor { return Cursor{ ID: t.ID, Value: t.Name, } }, } )
var DefaultTenantOrder = &TenantOrder{ Direction: entgql.OrderDirectionAsc, Field: &TenantOrderField{ Value: func(t *Tenant) (ent.Value, error) { return t.ID, nil }, column: tenant.FieldID, toTerm: tenant.ByID, toCursor: func(t *Tenant) Cursor { return Cursor{ID: t.ID} }, }, }
DefaultTenantOrder is the default ordering of Tenant.
var ErrEmptyTenantWhereInput = errors.New("generated: empty predicate TenantWhereInput")
ErrEmptyTenantWhereInput is returned in case the TenantWhereInput is empty.
var ErrTxStarted = errors.New("generated: 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.
func NewTxContext ¶
NewTxContext returns a new context with the given Tx 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(generated.As(generated.Sum(field1), "sum_field1"), (generated.As(generated.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 // Tenant is the client for interacting with the Tenant builders. Tenant *TenantClient // 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(). Tenant. 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(...)`.
func (*Client) Noder ¶
func (c *Client) Noder(ctx context.Context, id gidx.PrefixedID, opts ...NodeOption) (_ Noder, err error)
Noder returns a Node by its id. If the NodeType was not provided, it will be derived from the id value according to the universal-id configuration.
c.Noder(ctx, id) c.Noder(ctx, id, ent.WithNodeType(typeResolver))
func (*Client) Noders ¶
func (c *Client) Noders(ctx context.Context, ids []gidx.PrefixedID, opts ...NodeOption) ([]Noder, error)
func (*Client) OpenTx ¶
OpenTx opens a transaction and returns a transactional context along with the created transaction.
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 CreateTenantInput ¶
type CreateTenantInput struct { Name string Description *string ParentID *gidx.PrefixedID }
CreateTenantInput represents a mutation input for creating tenants.
func (*CreateTenantInput) Mutate ¶
func (i *CreateTenantInput) Mutate(m *TenantMutation)
Mutate applies the CreateTenantInput on the TenantMutation builder.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type MetadataNode ¶
type MetadataNode interface { IsMetadataNode() IsEntity() }
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NodeOption ¶
type NodeOption func(*nodeOptions)
NodeOption allows configuring the Noder execution using functional options.
func WithFixedNodeType ¶
func WithFixedNodeType(t string) NodeOption
WithFixedNodeType sets the Type of the node to a fixed value.
func WithNodeType ¶
func WithNodeType(f func(context.Context, gidx.PrefixedID) (string, error)) NodeOption
WithNodeType sets the node Type resolver function (i.e. the table to query). If was not provided, the table will be derived from the universal-id configuration as described in: https://entgo.io/docs/migrate/#universal-ids.
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 Option ¶
type Option func(*config)
Option function to configure the client.
func EventsPublisher ¶
func EventsPublisher(v events.Connection) Option
EventsPublisher configures the EventsPublisher.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type ResourceOwner ¶
type ResourceOwner interface { IsResourceOwner() IsEntity() }
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 for the tenant. ID gidx.PrefixedID `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // The name of a tenant. Name string `json:"name,omitempty"` // An optional description of the tenant. Description string `json:"description,omitempty"` // The ID of the parent tenant for the tenant. ParentTenantID gidx.PrefixedID `json:"parent_tenant_id,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 }
Representation of a tenant.
func (*Tenant) Children ¶
func (t *Tenant) Children( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy *TenantOrder, where *TenantWhereInput, ) (*TenantConnection, error)
func (*Tenant) IsMetadataNode ¶
func (*Tenant) IsMetadataNode()
IsMetadataNode implements the MetadataNode interface check for GQLGen.
func (*Tenant) IsNode ¶
func (*Tenant) IsNode()
IsNode implements the Node interface check for GQLGen.
func (*Tenant) IsResourceOwner ¶
func (*Tenant) IsResourceOwner()
IsResourceOwner implements the ResourceOwner interface check for GQLGen.
func (*Tenant) NamedChildren ¶
NamedChildren returns the Children named value or an error if the edge was not loaded in eager-loading with this name.
func (*Tenant) QueryChildren ¶
func (t *Tenant) QueryChildren() *TenantQuery
QueryChildren queries the "children" edge of the Tenant entity.
func (*Tenant) QueryParent ¶
func (t *Tenant) QueryParent() *TenantQuery
QueryParent queries the "parent" edge of the Tenant entity.
func (*Tenant) ToEdge ¶
func (t *Tenant) ToEdge(order *TenantOrder) *TenantEdge
ToEdge converts Tenant into TenantEdge.
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 gidx.PrefixedID) *TenantDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*TenantClient) Get ¶
func (c *TenantClient) Get(ctx context.Context, id gidx.PrefixedID) (*Tenant, error)
Get returns a Tenant entity by its id.
func (*TenantClient) GetX ¶
func (c *TenantClient) GetX(ctx context.Context, id gidx.PrefixedID) *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 ¶ added in v0.2.2
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) QueryChildren ¶
func (c *TenantClient) QueryChildren(t *Tenant) *TenantQuery
QueryChildren queries the children edge of a Tenant.
func (*TenantClient) QueryParent ¶
func (c *TenantClient) QueryParent(t *Tenant) *TenantQuery
QueryParent queries the parent 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 gidx.PrefixedID) *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 TenantConnection ¶
type TenantConnection struct { Edges []*TenantEdge `json:"edges"` PageInfo PageInfo `json:"pageInfo"` TotalCount int `json:"totalCount"` }
TenantConnection is the connection containing edges to Tenant.
type TenantCreate ¶
type TenantCreate struct {
// contains filtered or unexported fields
}
TenantCreate is the builder for creating a Tenant entity.
func (*TenantCreate) AddChildIDs ¶
func (tc *TenantCreate) AddChildIDs(ids ...gidx.PrefixedID) *TenantCreate
AddChildIDs adds the "children" edge to the Tenant entity by IDs.
func (*TenantCreate) AddChildren ¶
func (tc *TenantCreate) AddChildren(t ...*Tenant) *TenantCreate
AddChildren adds the "children" edges to the Tenant entity.
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) 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) SetCreatedAt ¶
func (tc *TenantCreate) SetCreatedAt(t time.Time) *TenantCreate
SetCreatedAt sets the "created_at" field.
func (*TenantCreate) SetDescription ¶
func (tc *TenantCreate) SetDescription(s string) *TenantCreate
SetDescription sets the "description" field.
func (*TenantCreate) SetID ¶
func (tc *TenantCreate) SetID(gi gidx.PrefixedID) *TenantCreate
SetID sets the "id" field.
func (*TenantCreate) SetInput ¶
func (c *TenantCreate) SetInput(i CreateTenantInput) *TenantCreate
SetInput applies the change-set in the CreateTenantInput on the TenantCreate builder.
func (*TenantCreate) SetName ¶
func (tc *TenantCreate) SetName(s string) *TenantCreate
SetName sets the "name" field.
func (*TenantCreate) SetNillableCreatedAt ¶
func (tc *TenantCreate) SetNillableCreatedAt(t *time.Time) *TenantCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*TenantCreate) SetNillableDescription ¶
func (tc *TenantCreate) SetNillableDescription(s *string) *TenantCreate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*TenantCreate) SetNillableID ¶
func (tc *TenantCreate) SetNillableID(gi *gidx.PrefixedID) *TenantCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*TenantCreate) SetNillableParentID ¶
func (tc *TenantCreate) SetNillableParentID(id *gidx.PrefixedID) *TenantCreate
SetNillableParentID sets the "parent" edge to the Tenant entity by ID if the given value is not nil.
func (*TenantCreate) SetNillableParentTenantID ¶
func (tc *TenantCreate) SetNillableParentTenantID(gi *gidx.PrefixedID) *TenantCreate
SetNillableParentTenantID sets the "parent_tenant_id" field if the given value is not nil.
func (*TenantCreate) SetNillableUpdatedAt ¶
func (tc *TenantCreate) SetNillableUpdatedAt(t *time.Time) *TenantCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*TenantCreate) SetParent ¶
func (tc *TenantCreate) SetParent(t *Tenant) *TenantCreate
SetParent sets the "parent" edge to the Tenant entity.
func (*TenantCreate) SetParentID ¶
func (tc *TenantCreate) SetParentID(id gidx.PrefixedID) *TenantCreate
SetParentID sets the "parent" edge to the Tenant entity by ID.
func (*TenantCreate) SetParentTenantID ¶
func (tc *TenantCreate) SetParentTenantID(gi gidx.PrefixedID) *TenantCreate
SetParentTenantID sets the "parent_tenant_id" field.
func (*TenantCreate) SetUpdatedAt ¶
func (tc *TenantCreate) SetUpdatedAt(t time.Time) *TenantCreate
SetUpdatedAt sets the "updated_at" 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.
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 TenantEdge ¶
TenantEdge is the edge representation of Tenant.
type TenantEdges ¶
type TenantEdges struct { // Parent holds the value of the parent edge. Parent *Tenant `json:"parent,omitempty"` // Children holds the value of the children edge. Children []*Tenant `json:"children,omitempty"` // contains filtered or unexported fields }
TenantEdges holds the relations/edges for other nodes in the graph.
func (TenantEdges) ChildrenOrErr ¶
func (e TenantEdges) ChildrenOrErr() ([]*Tenant, error)
ChildrenOrErr returns the Children value or an error if the edge was not loaded in eager-loading.
func (TenantEdges) ParentOrErr ¶
func (e TenantEdges) ParentOrErr() (*Tenant, error)
ParentOrErr returns the Parent value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
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) AddChildIDs ¶
func (m *TenantMutation) AddChildIDs(ids ...gidx.PrefixedID)
AddChildIDs adds the "children" edge to the Tenant 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) ChildrenCleared ¶
func (m *TenantMutation) ChildrenCleared() bool
ChildrenCleared reports if the "children" edge to the Tenant entity was cleared.
func (*TenantMutation) ChildrenIDs ¶
func (m *TenantMutation) ChildrenIDs() (ids []gidx.PrefixedID)
ChildrenIDs returns the "children" edge IDs in the mutation.
func (*TenantMutation) ClearChildren ¶
func (m *TenantMutation) ClearChildren()
ClearChildren clears the "children" edge to the Tenant entity.
func (*TenantMutation) ClearDescription ¶
func (m *TenantMutation) ClearDescription()
ClearDescription clears the value of the "description" 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) ClearParent ¶
func (m *TenantMutation) ClearParent()
ClearParent clears the "parent" edge to the Tenant entity.
func (*TenantMutation) ClearParentTenantID ¶
func (m *TenantMutation) ClearParentTenantID()
ClearParentTenantID clears the value of the "parent_tenant_id" 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) CreatedAt ¶
func (m *TenantMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*TenantMutation) Description ¶
func (m *TenantMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*TenantMutation) DescriptionCleared ¶
func (m *TenantMutation) DescriptionCleared() bool
DescriptionCleared returns if the "description" 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 gidx.PrefixedID, 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) ([]gidx.PrefixedID, 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) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" 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) OldDescription ¶
func (m *TenantMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" 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) OldParentTenantID ¶
func (m *TenantMutation) OldParentTenantID(ctx context.Context) (v gidx.PrefixedID, err error)
OldParentTenantID returns the old "parent_tenant_id" 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) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" 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) ParentCleared ¶
func (m *TenantMutation) ParentCleared() bool
ParentCleared reports if the "parent" edge to the Tenant entity was cleared.
func (*TenantMutation) ParentID ¶
func (m *TenantMutation) ParentID() (id gidx.PrefixedID, exists bool)
ParentID returns the "parent" edge ID in the mutation.
func (*TenantMutation) ParentIDs ¶
func (m *TenantMutation) ParentIDs() (ids []gidx.PrefixedID)
ParentIDs returns the "parent" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ParentID instead. It exists only for internal usage by the builders.
func (*TenantMutation) ParentTenantID ¶
func (m *TenantMutation) ParentTenantID() (r gidx.PrefixedID, exists bool)
ParentTenantID returns the value of the "parent_tenant_id" field in the mutation.
func (*TenantMutation) ParentTenantIDCleared ¶
func (m *TenantMutation) ParentTenantIDCleared() bool
ParentTenantIDCleared returns if the "parent_tenant_id" field was cleared in this mutation.
func (*TenantMutation) RemoveChildIDs ¶
func (m *TenantMutation) RemoveChildIDs(ids ...gidx.PrefixedID)
RemoveChildIDs removes the "children" edge to the Tenant entity by IDs.
func (*TenantMutation) RemovedChildrenIDs ¶
func (m *TenantMutation) RemovedChildrenIDs() (ids []gidx.PrefixedID)
RemovedChildren returns the removed IDs of the "children" edge to the Tenant 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) ResetChildren ¶
func (m *TenantMutation) ResetChildren()
ResetChildren resets all changes to the "children" edge.
func (*TenantMutation) ResetCreatedAt ¶
func (m *TenantMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*TenantMutation) ResetDescription ¶
func (m *TenantMutation) ResetDescription()
ResetDescription resets all changes to the "description" 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) ResetParent ¶
func (m *TenantMutation) ResetParent()
ResetParent resets all changes to the "parent" edge.
func (*TenantMutation) ResetParentTenantID ¶
func (m *TenantMutation) ResetParentTenantID()
ResetParentTenantID resets all changes to the "parent_tenant_id" field.
func (*TenantMutation) ResetUpdatedAt ¶
func (m *TenantMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*TenantMutation) SetCreatedAt ¶
func (m *TenantMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*TenantMutation) SetDescription ¶
func (m *TenantMutation) SetDescription(s string)
SetDescription sets the "description" 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 gidx.PrefixedID)
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) SetParentID ¶
func (m *TenantMutation) SetParentID(id gidx.PrefixedID)
SetParentID sets the "parent" edge to the Tenant entity by id.
func (*TenantMutation) SetParentTenantID ¶
func (m *TenantMutation) SetParentTenantID(gi gidx.PrefixedID)
SetParentTenantID sets the "parent_tenant_id" field.
func (*TenantMutation) SetUpdatedAt ¶
func (m *TenantMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" 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) UpdatedAt ¶
func (m *TenantMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" 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 TenantOrder ¶
type TenantOrder struct { Direction OrderDirection `json:"direction"` Field *TenantOrderField `json:"field"` }
TenantOrder defines the ordering of Tenant.
type TenantOrderField ¶
type TenantOrderField struct { // Value extracts the ordering value from the given Tenant. Value func(*Tenant) (ent.Value, error) // contains filtered or unexported fields }
TenantOrderField defines the ordering field of Tenant.
func (TenantOrderField) MarshalGQL ¶
func (f TenantOrderField) MarshalGQL(w io.Writer)
MarshalGQL implements graphql.Marshaler interface.
func (TenantOrderField) String ¶
func (f TenantOrderField) String() string
String implement fmt.Stringer interface.
func (*TenantOrderField) UnmarshalGQL ¶
func (f *TenantOrderField) UnmarshalGQL(v interface{}) error
UnmarshalGQL implements graphql.Unmarshaler interface.
type TenantPaginateOption ¶
type TenantPaginateOption func(*tenantPager) error
TenantPaginateOption enables pagination customization.
func WithTenantFilter ¶
func WithTenantFilter(filter func(*TenantQuery) (*TenantQuery, error)) TenantPaginateOption
WithTenantFilter configures pagination filter.
func WithTenantOrder ¶
func WithTenantOrder(order *TenantOrder) TenantPaginateOption
WithTenantOrder configures pagination ordering.
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) CollectFields ¶
func (t *TenantQuery) CollectFields(ctx context.Context, satisfies ...string) (*TenantQuery, error)
CollectFields tells the query-builder to eagerly load connected nodes by resolver context.
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 gidx.PrefixedID, 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) gidx.PrefixedID
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 { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.Tenant.Query(). GroupBy(tenant.FieldCreatedAt). Aggregate(generated.Count()). Scan(ctx, &v)
func (*TenantQuery) IDs ¶
func (tq *TenantQuery) IDs(ctx context.Context) (ids []gidx.PrefixedID, err error)
IDs executes the query and returns a list of Tenant IDs.
func (*TenantQuery) IDsX ¶
func (tq *TenantQuery) IDsX(ctx context.Context) []gidx.PrefixedID
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 gidx.PrefixedID, 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) gidx.PrefixedID
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) Paginate ¶
func (t *TenantQuery) Paginate( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, opts ...TenantPaginateOption, ) (*TenantConnection, error)
Paginate executes the query and returns a relay based cursor connection to Tenant.
func (*TenantQuery) QueryChildren ¶
func (tq *TenantQuery) QueryChildren() *TenantQuery
QueryChildren chains the current query on the "children" edge.
func (*TenantQuery) QueryParent ¶
func (tq *TenantQuery) QueryParent() *TenantQuery
QueryParent chains the current query on the "parent" 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 { CreatedAt time.Time `json:"created_at,omitempty"` } client.Tenant.Query(). Select(tenant.FieldCreatedAt). 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) WithChildren ¶
func (tq *TenantQuery) WithChildren(opts ...func(*TenantQuery)) *TenantQuery
WithChildren tells the query-builder to eager-load the nodes that are connected to the "children" edge. The optional arguments are used to configure the query builder of the edge.
func (*TenantQuery) WithNamedChildren ¶
func (tq *TenantQuery) WithNamedChildren(name string, opts ...func(*TenantQuery)) *TenantQuery
WithNamedChildren tells the query-builder to eager-load the nodes that are connected to the "children" edge with the given name. The optional arguments are used to configure the query builder of the edge.
func (*TenantQuery) WithParent ¶
func (tq *TenantQuery) WithParent(opts ...func(*TenantQuery)) *TenantQuery
WithParent tells the query-builder to eager-load the nodes that are connected to the "parent" edge. The optional arguments are used to configure the query builder of the edge.
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) AddChildIDs ¶
func (tu *TenantUpdate) AddChildIDs(ids ...gidx.PrefixedID) *TenantUpdate
AddChildIDs adds the "children" edge to the Tenant entity by IDs.
func (*TenantUpdate) AddChildren ¶
func (tu *TenantUpdate) AddChildren(t ...*Tenant) *TenantUpdate
AddChildren adds the "children" edges to the Tenant entity.
func (*TenantUpdate) ClearChildren ¶
func (tu *TenantUpdate) ClearChildren() *TenantUpdate
ClearChildren clears all "children" edges to the Tenant entity.
func (*TenantUpdate) ClearDescription ¶
func (tu *TenantUpdate) ClearDescription() *TenantUpdate
ClearDescription clears the value of the "description" 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) RemoveChildIDs ¶
func (tu *TenantUpdate) RemoveChildIDs(ids ...gidx.PrefixedID) *TenantUpdate
RemoveChildIDs removes the "children" edge to Tenant entities by IDs.
func (*TenantUpdate) RemoveChildren ¶
func (tu *TenantUpdate) RemoveChildren(t ...*Tenant) *TenantUpdate
RemoveChildren removes "children" edges to Tenant entities.
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) SetDescription ¶
func (tu *TenantUpdate) SetDescription(s string) *TenantUpdate
SetDescription sets the "description" field.
func (*TenantUpdate) SetInput ¶
func (c *TenantUpdate) SetInput(i UpdateTenantInput) *TenantUpdate
SetInput applies the change-set in the UpdateTenantInput on the TenantUpdate builder.
func (*TenantUpdate) SetName ¶
func (tu *TenantUpdate) SetName(s string) *TenantUpdate
SetName sets the "name" field.
func (*TenantUpdate) SetNillableDescription ¶
func (tu *TenantUpdate) SetNillableDescription(s *string) *TenantUpdate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*TenantUpdate) SetNillableName ¶ added in v0.2.2
func (tu *TenantUpdate) SetNillableName(s *string) *TenantUpdate
SetNillableName sets the "name" field if the given value is not nil.
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) AddChildIDs ¶
func (tuo *TenantUpdateOne) AddChildIDs(ids ...gidx.PrefixedID) *TenantUpdateOne
AddChildIDs adds the "children" edge to the Tenant entity by IDs.
func (*TenantUpdateOne) AddChildren ¶
func (tuo *TenantUpdateOne) AddChildren(t ...*Tenant) *TenantUpdateOne
AddChildren adds the "children" edges to the Tenant entity.
func (*TenantUpdateOne) ClearChildren ¶
func (tuo *TenantUpdateOne) ClearChildren() *TenantUpdateOne
ClearChildren clears all "children" edges to the Tenant entity.
func (*TenantUpdateOne) ClearDescription ¶
func (tuo *TenantUpdateOne) ClearDescription() *TenantUpdateOne
ClearDescription clears the value of the "description" 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) RemoveChildIDs ¶
func (tuo *TenantUpdateOne) RemoveChildIDs(ids ...gidx.PrefixedID) *TenantUpdateOne
RemoveChildIDs removes the "children" edge to Tenant entities by IDs.
func (*TenantUpdateOne) RemoveChildren ¶
func (tuo *TenantUpdateOne) RemoveChildren(t ...*Tenant) *TenantUpdateOne
RemoveChildren removes "children" edges to Tenant entities.
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) SetDescription ¶
func (tuo *TenantUpdateOne) SetDescription(s string) *TenantUpdateOne
SetDescription sets the "description" field.
func (*TenantUpdateOne) SetInput ¶
func (c *TenantUpdateOne) SetInput(i UpdateTenantInput) *TenantUpdateOne
SetInput applies the change-set in the UpdateTenantInput on the TenantUpdateOne builder.
func (*TenantUpdateOne) SetName ¶
func (tuo *TenantUpdateOne) SetName(s string) *TenantUpdateOne
SetName sets the "name" field.
func (*TenantUpdateOne) SetNillableDescription ¶
func (tuo *TenantUpdateOne) SetNillableDescription(s *string) *TenantUpdateOne
SetNillableDescription sets the "description" field if the given value is not nil.
func (*TenantUpdateOne) SetNillableName ¶ added in v0.2.2
func (tuo *TenantUpdateOne) SetNillableName(s *string) *TenantUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*TenantUpdateOne) Where ¶
func (tuo *TenantUpdateOne) Where(ps ...predicate.Tenant) *TenantUpdateOne
Where appends a list predicates to the TenantUpdate builder.
type TenantWhereInput ¶
type TenantWhereInput struct { Predicates []predicate.Tenant `json:"-"` Not *TenantWhereInput `json:"not,omitempty"` Or []*TenantWhereInput `json:"or,omitempty"` And []*TenantWhereInput `json:"and,omitempty"` // "id" field predicates. ID *gidx.PrefixedID `json:"id,omitempty"` IDNEQ *gidx.PrefixedID `json:"idNEQ,omitempty"` IDIn []gidx.PrefixedID `json:"idIn,omitempty"` IDNotIn []gidx.PrefixedID `json:"idNotIn,omitempty"` IDGT *gidx.PrefixedID `json:"idGT,omitempty"` IDGTE *gidx.PrefixedID `json:"idGTE,omitempty"` IDLT *gidx.PrefixedID `json:"idLT,omitempty"` IDLTE *gidx.PrefixedID `json:"idLTE,omitempty"` // "created_at" field predicates. CreatedAt *time.Time `json:"createdAt,omitempty"` CreatedAtNEQ *time.Time `json:"createdAtNEQ,omitempty"` CreatedAtIn []time.Time `json:"createdAtIn,omitempty"` CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"` CreatedAtGT *time.Time `json:"createdAtGT,omitempty"` CreatedAtGTE *time.Time `json:"createdAtGTE,omitempty"` CreatedAtLT *time.Time `json:"createdAtLT,omitempty"` CreatedAtLTE *time.Time `json:"createdAtLTE,omitempty"` // "updated_at" field predicates. UpdatedAt *time.Time `json:"updatedAt,omitempty"` UpdatedAtNEQ *time.Time `json:"updatedAtNEQ,omitempty"` UpdatedAtIn []time.Time `json:"updatedAtIn,omitempty"` UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"` UpdatedAtGT *time.Time `json:"updatedAtGT,omitempty"` UpdatedAtGTE *time.Time `json:"updatedAtGTE,omitempty"` UpdatedAtLT *time.Time `json:"updatedAtLT,omitempty"` UpdatedAtLTE *time.Time `json:"updatedAtLTE,omitempty"` // "parent" edge predicates. HasParent *bool `json:"hasParent,omitempty"` HasParentWith []*TenantWhereInput `json:"hasParentWith,omitempty"` // "children" edge predicates. HasChildren *bool `json:"hasChildren,omitempty"` HasChildrenWith []*TenantWhereInput `json:"hasChildrenWith,omitempty"` }
TenantWhereInput represents a where input for filtering Tenant queries.
func (*TenantWhereInput) AddPredicates ¶
func (i *TenantWhereInput) AddPredicates(predicates ...predicate.Tenant)
AddPredicates adds custom predicates to the where input to be used during the filtering phase.
func (*TenantWhereInput) Filter ¶
func (i *TenantWhereInput) Filter(q *TenantQuery) (*TenantQuery, error)
Filter applies the TenantWhereInput filter on the TenantQuery builder.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Tenant is the client for interacting with the Tenant builders. Tenant *TenantClient // 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 UpdateTenantInput ¶
UpdateTenantInput represents a mutation input for updating tenants.
func (*UpdateTenantInput) Mutate ¶
func (i *UpdateTenantInput) Mutate(m *TenantMutation)
Mutate applies the UpdateTenantInput on the TenantMutation builder.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.