Documentation
¶
Index ¶
- Constants
- Variables
- 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 Account
- func (a *Account) Node(ctx context.Context) (node *Node, err error)
- func (a *Account) QueryTennants() *TennantQuery
- func (a *Account) String() string
- func (a *Account) Tennants(ctx context.Context) ([]*Tennant, error)
- func (a *Account) ToEdge(order *AccountOrder) *AccountEdge
- func (a *Account) Unwrap() *Account
- func (a *Account) Update() *AccountUpdateOne
- type AccountClient
- func (c *AccountClient) Create() *AccountCreate
- func (c *AccountClient) CreateBulk(builders ...*AccountCreate) *AccountCreateBulk
- func (c *AccountClient) Delete() *AccountDelete
- func (c *AccountClient) DeleteOne(a *Account) *AccountDeleteOne
- func (c *AccountClient) DeleteOneID(id uuid.UUID) *AccountDeleteOne
- func (c *AccountClient) Get(ctx context.Context, id uuid.UUID) (*Account, error)
- func (c *AccountClient) GetX(ctx context.Context, id uuid.UUID) *Account
- func (c *AccountClient) Hooks() []Hook
- func (c *AccountClient) Query() *AccountQuery
- func (c *AccountClient) QueryTennants(a *Account) *TennantQuery
- func (c *AccountClient) Update() *AccountUpdate
- func (c *AccountClient) UpdateOne(a *Account) *AccountUpdateOne
- func (c *AccountClient) UpdateOneID(id uuid.UUID) *AccountUpdateOne
- func (c *AccountClient) Use(hooks ...Hook)
- type AccountConnection
- type AccountCreate
- func (ac *AccountCreate) AddTennantIDs(ids ...uuid.UUID) *AccountCreate
- func (ac *AccountCreate) AddTennants(t ...*Tennant) *AccountCreate
- func (ac *AccountCreate) Exec(ctx context.Context) error
- func (ac *AccountCreate) ExecX(ctx context.Context)
- func (ac *AccountCreate) Mutation() *AccountMutation
- func (ac *AccountCreate) Save(ctx context.Context) (*Account, error)
- func (ac *AccountCreate) SaveX(ctx context.Context) *Account
- func (ac *AccountCreate) SetCreatedAt(t time.Time) *AccountCreate
- func (ac *AccountCreate) SetID(u uuid.UUID) *AccountCreate
- func (ac *AccountCreate) SetName(s string) *AccountCreate
- func (ac *AccountCreate) SetNillableCreatedAt(t *time.Time) *AccountCreate
- func (ac *AccountCreate) SetNillableID(u *uuid.UUID) *AccountCreate
- type AccountCreateBulk
- type AccountDelete
- type AccountDeleteOne
- type AccountEdge
- type AccountEdges
- type AccountGroupBy
- func (agb *AccountGroupBy) Aggregate(fns ...AggregateFunc) *AccountGroupBy
- func (s *AccountGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *AccountGroupBy) BoolX(ctx context.Context) bool
- func (s *AccountGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *AccountGroupBy) BoolsX(ctx context.Context) []bool
- func (s *AccountGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *AccountGroupBy) Float64X(ctx context.Context) float64
- func (s *AccountGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *AccountGroupBy) Float64sX(ctx context.Context) []float64
- func (s *AccountGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *AccountGroupBy) IntX(ctx context.Context) int
- func (s *AccountGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *AccountGroupBy) IntsX(ctx context.Context) []int
- func (agb *AccountGroupBy) Scan(ctx context.Context, v interface{}) error
- func (s *AccountGroupBy) ScanX(ctx context.Context, v interface{})
- func (s *AccountGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *AccountGroupBy) StringX(ctx context.Context) string
- func (s *AccountGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *AccountGroupBy) StringsX(ctx context.Context) []string
- type AccountMutation
- func (m *AccountMutation) AddField(name string, value ent.Value) error
- func (m *AccountMutation) AddTennantIDs(ids ...uuid.UUID)
- func (m *AccountMutation) AddedEdges() []string
- func (m *AccountMutation) AddedField(name string) (ent.Value, bool)
- func (m *AccountMutation) AddedFields() []string
- func (m *AccountMutation) AddedIDs(name string) []ent.Value
- func (m *AccountMutation) ClearEdge(name string) error
- func (m *AccountMutation) ClearField(name string) error
- func (m *AccountMutation) ClearTennants()
- func (m *AccountMutation) ClearedEdges() []string
- func (m *AccountMutation) ClearedFields() []string
- func (m AccountMutation) Client() *Client
- func (m *AccountMutation) CreatedAt() (r time.Time, exists bool)
- func (m *AccountMutation) EdgeCleared(name string) bool
- func (m *AccountMutation) Field(name string) (ent.Value, bool)
- func (m *AccountMutation) FieldCleared(name string) bool
- func (m *AccountMutation) Fields() []string
- func (m *AccountMutation) ID() (id uuid.UUID, exists bool)
- func (m *AccountMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *AccountMutation) Name() (r string, exists bool)
- func (m *AccountMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *AccountMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *AccountMutation) OldName(ctx context.Context) (v string, err error)
- func (m *AccountMutation) Op() Op
- func (m *AccountMutation) RemoveTennantIDs(ids ...uuid.UUID)
- func (m *AccountMutation) RemovedEdges() []string
- func (m *AccountMutation) RemovedIDs(name string) []ent.Value
- func (m *AccountMutation) RemovedTennantsIDs() (ids []uuid.UUID)
- func (m *AccountMutation) ResetCreatedAt()
- func (m *AccountMutation) ResetEdge(name string) error
- func (m *AccountMutation) ResetField(name string) error
- func (m *AccountMutation) ResetName()
- func (m *AccountMutation) ResetTennants()
- func (m *AccountMutation) SetCreatedAt(t time.Time)
- func (m *AccountMutation) SetField(name string, value ent.Value) error
- func (m *AccountMutation) SetID(id uuid.UUID)
- func (m *AccountMutation) SetName(s string)
- func (m *AccountMutation) TennantsCleared() bool
- func (m *AccountMutation) TennantsIDs() (ids []uuid.UUID)
- func (m AccountMutation) Tx() (*Tx, error)
- func (m *AccountMutation) Type() string
- func (m *AccountMutation) Where(ps ...predicate.Account)
- type AccountOrder
- type AccountOrderField
- type AccountPaginateOption
- type AccountQuery
- func (aq *AccountQuery) All(ctx context.Context) ([]*Account, error)
- func (aq *AccountQuery) AllX(ctx context.Context) []*Account
- func (aq *AccountQuery) Clone() *AccountQuery
- func (a *AccountQuery) CollectFields(ctx context.Context, satisfies ...string) (*AccountQuery, error)
- func (aq *AccountQuery) Count(ctx context.Context) (int, error)
- func (aq *AccountQuery) CountX(ctx context.Context) int
- func (aq *AccountQuery) Exist(ctx context.Context) (bool, error)
- func (aq *AccountQuery) ExistX(ctx context.Context) bool
- func (aq *AccountQuery) First(ctx context.Context) (*Account, error)
- func (aq *AccountQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (aq *AccountQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (aq *AccountQuery) FirstX(ctx context.Context) *Account
- func (aq *AccountQuery) GroupBy(field string, fields ...string) *AccountGroupBy
- func (aq *AccountQuery) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (aq *AccountQuery) IDsX(ctx context.Context) []uuid.UUID
- func (aq *AccountQuery) Limit(limit int) *AccountQuery
- func (aq *AccountQuery) Offset(offset int) *AccountQuery
- func (aq *AccountQuery) Only(ctx context.Context) (*Account, error)
- func (aq *AccountQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (aq *AccountQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (aq *AccountQuery) OnlyX(ctx context.Context) *Account
- func (aq *AccountQuery) Order(o ...OrderFunc) *AccountQuery
- func (a *AccountQuery) Paginate(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*AccountConnection, error)
- func (aq *AccountQuery) QueryTennants() *TennantQuery
- func (aq *AccountQuery) Select(fields ...string) *AccountSelect
- func (aq *AccountQuery) Unique(unique bool) *AccountQuery
- func (aq *AccountQuery) Where(ps ...predicate.Account) *AccountQuery
- func (aq *AccountQuery) WithTennants(opts ...func(*TennantQuery)) *AccountQuery
- type AccountSelect
- func (s *AccountSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *AccountSelect) BoolX(ctx context.Context) bool
- func (s *AccountSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *AccountSelect) BoolsX(ctx context.Context) []bool
- func (s *AccountSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *AccountSelect) Float64X(ctx context.Context) float64
- func (s *AccountSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *AccountSelect) Float64sX(ctx context.Context) []float64
- func (s *AccountSelect) Int(ctx context.Context) (_ int, err error)
- func (s *AccountSelect) IntX(ctx context.Context) int
- func (s *AccountSelect) Ints(ctx context.Context) ([]int, error)
- func (s *AccountSelect) IntsX(ctx context.Context) []int
- func (as *AccountSelect) Scan(ctx context.Context, v interface{}) error
- func (s *AccountSelect) ScanX(ctx context.Context, v interface{})
- func (s *AccountSelect) String(ctx context.Context) (_ string, err error)
- func (s *AccountSelect) StringX(ctx context.Context) string
- func (s *AccountSelect) Strings(ctx context.Context) ([]string, error)
- func (s *AccountSelect) StringsX(ctx context.Context) []string
- type AccountUpdate
- func (au *AccountUpdate) AddTennantIDs(ids ...uuid.UUID) *AccountUpdate
- func (au *AccountUpdate) AddTennants(t ...*Tennant) *AccountUpdate
- func (au *AccountUpdate) ClearTennants() *AccountUpdate
- func (au *AccountUpdate) Exec(ctx context.Context) error
- func (au *AccountUpdate) ExecX(ctx context.Context)
- func (au *AccountUpdate) Mutation() *AccountMutation
- func (au *AccountUpdate) RemoveTennantIDs(ids ...uuid.UUID) *AccountUpdate
- func (au *AccountUpdate) RemoveTennants(t ...*Tennant) *AccountUpdate
- func (au *AccountUpdate) Save(ctx context.Context) (int, error)
- func (au *AccountUpdate) SaveX(ctx context.Context) int
- func (au *AccountUpdate) SetCreatedAt(t time.Time) *AccountUpdate
- func (au *AccountUpdate) SetName(s string) *AccountUpdate
- func (au *AccountUpdate) SetNillableCreatedAt(t *time.Time) *AccountUpdate
- func (au *AccountUpdate) Where(ps ...predicate.Account) *AccountUpdate
- type AccountUpdateOne
- func (auo *AccountUpdateOne) AddTennantIDs(ids ...uuid.UUID) *AccountUpdateOne
- func (auo *AccountUpdateOne) AddTennants(t ...*Tennant) *AccountUpdateOne
- func (auo *AccountUpdateOne) ClearTennants() *AccountUpdateOne
- func (auo *AccountUpdateOne) Exec(ctx context.Context) error
- func (auo *AccountUpdateOne) ExecX(ctx context.Context)
- func (auo *AccountUpdateOne) Mutation() *AccountMutation
- func (auo *AccountUpdateOne) RemoveTennantIDs(ids ...uuid.UUID) *AccountUpdateOne
- func (auo *AccountUpdateOne) RemoveTennants(t ...*Tennant) *AccountUpdateOne
- func (auo *AccountUpdateOne) Save(ctx context.Context) (*Account, error)
- func (auo *AccountUpdateOne) SaveX(ctx context.Context) *Account
- func (auo *AccountUpdateOne) Select(field string, fields ...string) *AccountUpdateOne
- func (auo *AccountUpdateOne) SetCreatedAt(t time.Time) *AccountUpdateOne
- func (auo *AccountUpdateOne) SetName(s string) *AccountUpdateOne
- func (auo *AccountUpdateOne) SetNillableCreatedAt(t *time.Time) *AccountUpdateOne
- type AccountWhereInput
- type Accounts
- 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) Node(ctx context.Context, id uuid.UUID) (*Node, error)
- func (c *Client) Noder(ctx context.Context, id uuid.UUID, opts ...NodeOption) (_ Noder, err error)
- func (c *Client) Noders(ctx context.Context, ids []uuid.UUID, 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 Cursor
- type Edge
- type Field
- type Hook
- type MutateFunc
- type Mutation
- type Mutator
- type Node
- type NodeOption
- type Noder
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderDirection
- type OrderFunc
- type PageInfo
- type Policy
- type Query
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Tennant
- func (t *Tennant) Account(ctx context.Context) (*Account, error)
- func (t *Tennant) Node(ctx context.Context) (node *Node, err error)
- func (t *Tennant) QueryAccount() *AccountQuery
- func (t *Tennant) String() string
- func (t *Tennant) ToEdge(order *TennantOrder) *TennantEdge
- func (t *Tennant) Unwrap() *Tennant
- func (t *Tennant) Update() *TennantUpdateOne
- type TennantClient
- func (c *TennantClient) Create() *TennantCreate
- func (c *TennantClient) CreateBulk(builders ...*TennantCreate) *TennantCreateBulk
- func (c *TennantClient) Delete() *TennantDelete
- func (c *TennantClient) DeleteOne(t *Tennant) *TennantDeleteOne
- func (c *TennantClient) DeleteOneID(id uuid.UUID) *TennantDeleteOne
- func (c *TennantClient) Get(ctx context.Context, id uuid.UUID) (*Tennant, error)
- func (c *TennantClient) GetX(ctx context.Context, id uuid.UUID) *Tennant
- func (c *TennantClient) Hooks() []Hook
- func (c *TennantClient) Query() *TennantQuery
- func (c *TennantClient) QueryAccount(t *Tennant) *AccountQuery
- func (c *TennantClient) Update() *TennantUpdate
- func (c *TennantClient) UpdateOne(t *Tennant) *TennantUpdateOne
- func (c *TennantClient) UpdateOneID(id uuid.UUID) *TennantUpdateOne
- func (c *TennantClient) Use(hooks ...Hook)
- type TennantConnection
- type TennantCreate
- func (tc *TennantCreate) Exec(ctx context.Context) error
- func (tc *TennantCreate) ExecX(ctx context.Context)
- func (tc *TennantCreate) Mutation() *TennantMutation
- func (tc *TennantCreate) Save(ctx context.Context) (*Tennant, error)
- func (tc *TennantCreate) SaveX(ctx context.Context) *Tennant
- func (tc *TennantCreate) SetAccount(a *Account) *TennantCreate
- func (tc *TennantCreate) SetAccountID(u uuid.UUID) *TennantCreate
- func (tc *TennantCreate) SetCloud(s string) *TennantCreate
- func (tc *TennantCreate) SetCreatedAt(t time.Time) *TennantCreate
- func (tc *TennantCreate) SetExternalId(s string) *TennantCreate
- func (tc *TennantCreate) SetID(u uuid.UUID) *TennantCreate
- func (tc *TennantCreate) SetNillableCreatedAt(t *time.Time) *TennantCreate
- func (tc *TennantCreate) SetNillableID(u *uuid.UUID) *TennantCreate
- type TennantCreateBulk
- type TennantDelete
- type TennantDeleteOne
- type TennantEdge
- type TennantEdges
- type TennantGroupBy
- func (tgb *TennantGroupBy) Aggregate(fns ...AggregateFunc) *TennantGroupBy
- func (s *TennantGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *TennantGroupBy) BoolX(ctx context.Context) bool
- func (s *TennantGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *TennantGroupBy) BoolsX(ctx context.Context) []bool
- func (s *TennantGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *TennantGroupBy) Float64X(ctx context.Context) float64
- func (s *TennantGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *TennantGroupBy) Float64sX(ctx context.Context) []float64
- func (s *TennantGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *TennantGroupBy) IntX(ctx context.Context) int
- func (s *TennantGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *TennantGroupBy) IntsX(ctx context.Context) []int
- func (tgb *TennantGroupBy) Scan(ctx context.Context, v interface{}) error
- func (s *TennantGroupBy) ScanX(ctx context.Context, v interface{})
- func (s *TennantGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *TennantGroupBy) StringX(ctx context.Context) string
- func (s *TennantGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *TennantGroupBy) StringsX(ctx context.Context) []string
- type TennantMutation
- func (m *TennantMutation) AccountCleared() bool
- func (m *TennantMutation) AccountID() (r uuid.UUID, exists bool)
- func (m *TennantMutation) AccountIDs() (ids []uuid.UUID)
- func (m *TennantMutation) AddField(name string, value ent.Value) error
- func (m *TennantMutation) AddedEdges() []string
- func (m *TennantMutation) AddedField(name string) (ent.Value, bool)
- func (m *TennantMutation) AddedFields() []string
- func (m *TennantMutation) AddedIDs(name string) []ent.Value
- func (m *TennantMutation) ClearAccount()
- func (m *TennantMutation) ClearEdge(name string) error
- func (m *TennantMutation) ClearField(name string) error
- func (m *TennantMutation) ClearedEdges() []string
- func (m *TennantMutation) ClearedFields() []string
- func (m TennantMutation) Client() *Client
- func (m *TennantMutation) Cloud() (r string, exists bool)
- func (m *TennantMutation) CreatedAt() (r time.Time, exists bool)
- func (m *TennantMutation) EdgeCleared(name string) bool
- func (m *TennantMutation) ExternalId() (r string, exists bool)
- func (m *TennantMutation) Field(name string) (ent.Value, bool)
- func (m *TennantMutation) FieldCleared(name string) bool
- func (m *TennantMutation) Fields() []string
- func (m *TennantMutation) ID() (id uuid.UUID, exists bool)
- func (m *TennantMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *TennantMutation) OldAccountID(ctx context.Context) (v uuid.UUID, err error)
- func (m *TennantMutation) OldCloud(ctx context.Context) (v string, err error)
- func (m *TennantMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *TennantMutation) OldExternalId(ctx context.Context) (v string, err error)
- func (m *TennantMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TennantMutation) Op() Op
- func (m *TennantMutation) RemovedEdges() []string
- func (m *TennantMutation) RemovedIDs(name string) []ent.Value
- func (m *TennantMutation) ResetAccount()
- func (m *TennantMutation) ResetAccountID()
- func (m *TennantMutation) ResetCloud()
- func (m *TennantMutation) ResetCreatedAt()
- func (m *TennantMutation) ResetEdge(name string) error
- func (m *TennantMutation) ResetExternalId()
- func (m *TennantMutation) ResetField(name string) error
- func (m *TennantMutation) SetAccountID(u uuid.UUID)
- func (m *TennantMutation) SetCloud(s string)
- func (m *TennantMutation) SetCreatedAt(t time.Time)
- func (m *TennantMutation) SetExternalId(s string)
- func (m *TennantMutation) SetField(name string, value ent.Value) error
- func (m *TennantMutation) SetID(id uuid.UUID)
- func (m TennantMutation) Tx() (*Tx, error)
- func (m *TennantMutation) Type() string
- func (m *TennantMutation) Where(ps ...predicate.Tennant)
- type TennantOrder
- type TennantOrderField
- type TennantPaginateOption
- type TennantQuery
- func (tq *TennantQuery) All(ctx context.Context) ([]*Tennant, error)
- func (tq *TennantQuery) AllX(ctx context.Context) []*Tennant
- func (tq *TennantQuery) Clone() *TennantQuery
- func (t *TennantQuery) CollectFields(ctx context.Context, satisfies ...string) (*TennantQuery, error)
- func (tq *TennantQuery) Count(ctx context.Context) (int, error)
- func (tq *TennantQuery) CountX(ctx context.Context) int
- func (tq *TennantQuery) Exist(ctx context.Context) (bool, error)
- func (tq *TennantQuery) ExistX(ctx context.Context) bool
- func (tq *TennantQuery) First(ctx context.Context) (*Tennant, error)
- func (tq *TennantQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (tq *TennantQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (tq *TennantQuery) FirstX(ctx context.Context) *Tennant
- func (tq *TennantQuery) GroupBy(field string, fields ...string) *TennantGroupBy
- func (tq *TennantQuery) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (tq *TennantQuery) IDsX(ctx context.Context) []uuid.UUID
- func (tq *TennantQuery) Limit(limit int) *TennantQuery
- func (tq *TennantQuery) Offset(offset int) *TennantQuery
- func (tq *TennantQuery) Only(ctx context.Context) (*Tennant, error)
- func (tq *TennantQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (tq *TennantQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (tq *TennantQuery) OnlyX(ctx context.Context) *Tennant
- func (tq *TennantQuery) Order(o ...OrderFunc) *TennantQuery
- func (t *TennantQuery) Paginate(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*TennantConnection, error)
- func (tq *TennantQuery) QueryAccount() *AccountQuery
- func (tq *TennantQuery) Select(fields ...string) *TennantSelect
- func (tq *TennantQuery) Unique(unique bool) *TennantQuery
- func (tq *TennantQuery) Where(ps ...predicate.Tennant) *TennantQuery
- func (tq *TennantQuery) WithAccount(opts ...func(*AccountQuery)) *TennantQuery
- type TennantSelect
- func (s *TennantSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *TennantSelect) BoolX(ctx context.Context) bool
- func (s *TennantSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *TennantSelect) BoolsX(ctx context.Context) []bool
- func (s *TennantSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *TennantSelect) Float64X(ctx context.Context) float64
- func (s *TennantSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *TennantSelect) Float64sX(ctx context.Context) []float64
- func (s *TennantSelect) Int(ctx context.Context) (_ int, err error)
- func (s *TennantSelect) IntX(ctx context.Context) int
- func (s *TennantSelect) Ints(ctx context.Context) ([]int, error)
- func (s *TennantSelect) IntsX(ctx context.Context) []int
- func (ts *TennantSelect) Scan(ctx context.Context, v interface{}) error
- func (s *TennantSelect) ScanX(ctx context.Context, v interface{})
- func (s *TennantSelect) String(ctx context.Context) (_ string, err error)
- func (s *TennantSelect) StringX(ctx context.Context) string
- func (s *TennantSelect) Strings(ctx context.Context) ([]string, error)
- func (s *TennantSelect) StringsX(ctx context.Context) []string
- type TennantUpdate
- func (tu *TennantUpdate) ClearAccount() *TennantUpdate
- func (tu *TennantUpdate) Exec(ctx context.Context) error
- func (tu *TennantUpdate) ExecX(ctx context.Context)
- func (tu *TennantUpdate) Mutation() *TennantMutation
- func (tu *TennantUpdate) Save(ctx context.Context) (int, error)
- func (tu *TennantUpdate) SaveX(ctx context.Context) int
- func (tu *TennantUpdate) SetAccount(a *Account) *TennantUpdate
- func (tu *TennantUpdate) SetAccountID(u uuid.UUID) *TennantUpdate
- func (tu *TennantUpdate) SetCloud(s string) *TennantUpdate
- func (tu *TennantUpdate) SetCreatedAt(t time.Time) *TennantUpdate
- func (tu *TennantUpdate) SetExternalId(s string) *TennantUpdate
- func (tu *TennantUpdate) SetNillableCreatedAt(t *time.Time) *TennantUpdate
- func (tu *TennantUpdate) Where(ps ...predicate.Tennant) *TennantUpdate
- type TennantUpdateOne
- func (tuo *TennantUpdateOne) ClearAccount() *TennantUpdateOne
- func (tuo *TennantUpdateOne) Exec(ctx context.Context) error
- func (tuo *TennantUpdateOne) ExecX(ctx context.Context)
- func (tuo *TennantUpdateOne) Mutation() *TennantMutation
- func (tuo *TennantUpdateOne) Save(ctx context.Context) (*Tennant, error)
- func (tuo *TennantUpdateOne) SaveX(ctx context.Context) *Tennant
- func (tuo *TennantUpdateOne) Select(field string, fields ...string) *TennantUpdateOne
- func (tuo *TennantUpdateOne) SetAccount(a *Account) *TennantUpdateOne
- func (tuo *TennantUpdateOne) SetAccountID(u uuid.UUID) *TennantUpdateOne
- func (tuo *TennantUpdateOne) SetCloud(s string) *TennantUpdateOne
- func (tuo *TennantUpdateOne) SetCreatedAt(t time.Time) *TennantUpdateOne
- func (tuo *TennantUpdateOne) SetExternalId(s string) *TennantUpdateOne
- func (tuo *TennantUpdateOne) SetNillableCreatedAt(t *time.Time) *TennantUpdateOne
- type TennantWhereInput
- type Tennants
- 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. TypeAccount = "Account" TypeTennant = "Tennant" )
Variables ¶
var DefaultAccountOrder = &AccountOrder{ Direction: OrderDirectionAsc, Field: &AccountOrderField{ field: account.FieldID, toCursor: func(a *Account) Cursor { return Cursor{ID: a.ID} }, }, }
DefaultAccountOrder is the default ordering of Account.
var DefaultTennantOrder = &TennantOrder{ Direction: OrderDirectionAsc, Field: &TennantOrderField{ field: tennant.FieldID, toCursor: func(t *Tennant) Cursor { return Cursor{ID: t.ID} }, }, }
DefaultTennantOrder is the default ordering of Tennant.
var ErrEmptyAccountWhereInput = errors.New("ent: empty predicate AccountWhereInput")
ErrEmptyAccountWhereInput is returned in case the AccountWhereInput is empty.
var ErrEmptyTennantWhereInput = errors.New("ent: empty predicate TennantWhereInput")
ErrEmptyTennantWhereInput is returned in case the TennantWhereInput is empty.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
func NewTxContext ¶
NewTxContext returns a new context with the given Tx attached.
Types ¶
type Account ¶
type Account struct {
// ID of the ent.
ID uuid.UUID `json:"id,omitempty"`
// Name holds the value of the "name" field.
Name string `json:"name,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the AccountQuery when eager-loading is set.
Edges AccountEdges `json:"edges"`
// contains filtered or unexported fields
}
Account is the model entity for the Account schema.
func (*Account) QueryTennants ¶
func (a *Account) QueryTennants() *TennantQuery
QueryTennants queries the "tennants" edge of the Account entity.
func (*Account) ToEdge ¶
func (a *Account) ToEdge(order *AccountOrder) *AccountEdge
ToEdge converts Account into AccountEdge.
func (*Account) Unwrap ¶
Unwrap unwraps the Account 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 (*Account) Update ¶
func (a *Account) Update() *AccountUpdateOne
Update returns a builder for updating this Account. Note that you need to call Account.Unwrap() before calling this method if this Account was returned from a transaction, and the transaction was committed or rolled back.
type AccountClient ¶
type AccountClient struct {
// contains filtered or unexported fields
}
AccountClient is a client for the Account schema.
func NewAccountClient ¶
func NewAccountClient(c config) *AccountClient
NewAccountClient returns a client for the Account from the given config.
func (*AccountClient) Create ¶
func (c *AccountClient) Create() *AccountCreate
Create returns a builder for creating a Account entity.
func (*AccountClient) CreateBulk ¶
func (c *AccountClient) CreateBulk(builders ...*AccountCreate) *AccountCreateBulk
CreateBulk returns a builder for creating a bulk of Account entities.
func (*AccountClient) Delete ¶
func (c *AccountClient) Delete() *AccountDelete
Delete returns a delete builder for Account.
func (*AccountClient) DeleteOne ¶
func (c *AccountClient) DeleteOne(a *Account) *AccountDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*AccountClient) DeleteOneID ¶
func (c *AccountClient) DeleteOneID(id uuid.UUID) *AccountDeleteOne
DeleteOne returns a builder for deleting the given entity by its id.
func (*AccountClient) Hooks ¶
func (c *AccountClient) Hooks() []Hook
Hooks returns the client hooks.
func (*AccountClient) Query ¶
func (c *AccountClient) Query() *AccountQuery
Query returns a query builder for Account.
func (*AccountClient) QueryTennants ¶
func (c *AccountClient) QueryTennants(a *Account) *TennantQuery
QueryTennants queries the tennants edge of a Account.
func (*AccountClient) Update ¶
func (c *AccountClient) Update() *AccountUpdate
Update returns an update builder for Account.
func (*AccountClient) UpdateOne ¶
func (c *AccountClient) UpdateOne(a *Account) *AccountUpdateOne
UpdateOne returns an update builder for the given entity.
func (*AccountClient) UpdateOneID ¶
func (c *AccountClient) UpdateOneID(id uuid.UUID) *AccountUpdateOne
UpdateOneID returns an update builder for the given id.
func (*AccountClient) Use ¶
func (c *AccountClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `account.Hooks(f(g(h())))`.
type AccountConnection ¶
type AccountConnection struct {
Edges []*AccountEdge `json:"edges"`
PageInfo PageInfo `json:"pageInfo"`
TotalCount int `json:"totalCount"`
}
AccountConnection is the connection containing edges to Account.
type AccountCreate ¶
type AccountCreate struct {
// contains filtered or unexported fields
}
AccountCreate is the builder for creating a Account entity.
func (*AccountCreate) AddTennantIDs ¶
func (ac *AccountCreate) AddTennantIDs(ids ...uuid.UUID) *AccountCreate
AddTennantIDs adds the "tennants" edge to the Tennant entity by IDs.
func (*AccountCreate) AddTennants ¶
func (ac *AccountCreate) AddTennants(t ...*Tennant) *AccountCreate
AddTennants adds the "tennants" edges to the Tennant entity.
func (*AccountCreate) Exec ¶
func (ac *AccountCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*AccountCreate) ExecX ¶
func (ac *AccountCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AccountCreate) Mutation ¶
func (ac *AccountCreate) Mutation() *AccountMutation
Mutation returns the AccountMutation object of the builder.
func (*AccountCreate) Save ¶
func (ac *AccountCreate) Save(ctx context.Context) (*Account, error)
Save creates the Account in the database.
func (*AccountCreate) SaveX ¶
func (ac *AccountCreate) SaveX(ctx context.Context) *Account
SaveX calls Save and panics if Save returns an error.
func (*AccountCreate) SetCreatedAt ¶
func (ac *AccountCreate) SetCreatedAt(t time.Time) *AccountCreate
SetCreatedAt sets the "created_at" field.
func (*AccountCreate) SetID ¶
func (ac *AccountCreate) SetID(u uuid.UUID) *AccountCreate
SetID sets the "id" field.
func (*AccountCreate) SetName ¶
func (ac *AccountCreate) SetName(s string) *AccountCreate
SetName sets the "name" field.
func (*AccountCreate) SetNillableCreatedAt ¶
func (ac *AccountCreate) SetNillableCreatedAt(t *time.Time) *AccountCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*AccountCreate) SetNillableID ¶
func (ac *AccountCreate) SetNillableID(u *uuid.UUID) *AccountCreate
SetNillableID sets the "id" field if the given value is not nil.
type AccountCreateBulk ¶
type AccountCreateBulk struct {
// contains filtered or unexported fields
}
AccountCreateBulk is the builder for creating many Account entities in bulk.
func (*AccountCreateBulk) Exec ¶
func (acb *AccountCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*AccountCreateBulk) ExecX ¶
func (acb *AccountCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type AccountDelete ¶
type AccountDelete struct {
// contains filtered or unexported fields
}
AccountDelete is the builder for deleting a Account entity.
func (*AccountDelete) Exec ¶
func (ad *AccountDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*AccountDelete) ExecX ¶
func (ad *AccountDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*AccountDelete) Where ¶
func (ad *AccountDelete) Where(ps ...predicate.Account) *AccountDelete
Where appends a list predicates to the AccountDelete builder.
type AccountDeleteOne ¶
type AccountDeleteOne struct {
// contains filtered or unexported fields
}
AccountDeleteOne is the builder for deleting a single Account entity.
func (*AccountDeleteOne) Exec ¶
func (ado *AccountDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*AccountDeleteOne) ExecX ¶
func (ado *AccountDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type AccountEdge ¶
AccountEdge is the edge representation of Account.
type AccountEdges ¶
type AccountEdges struct {
// Tennants holds the value of the tennants edge.
Tennants []*Tennant `json:"tennants,omitempty"`
// contains filtered or unexported fields
}
AccountEdges holds the relations/edges for other nodes in the graph.
func (AccountEdges) TennantsOrErr ¶
func (e AccountEdges) TennantsOrErr() ([]*Tennant, error)
TennantsOrErr returns the Tennants value or an error if the edge was not loaded in eager-loading.
type AccountGroupBy ¶
type AccountGroupBy struct {
// contains filtered or unexported fields
}
AccountGroupBy is the group-by builder for Account entities.
func (*AccountGroupBy) Aggregate ¶
func (agb *AccountGroupBy) Aggregate(fns ...AggregateFunc) *AccountGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*AccountGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AccountGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AccountGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AccountGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AccountGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AccountGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AccountGroupBy) Scan ¶
func (agb *AccountGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*AccountGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AccountMutation ¶
type AccountMutation struct {
// contains filtered or unexported fields
}
AccountMutation represents an operation that mutates the Account nodes in the graph.
func (*AccountMutation) AddField ¶
func (m *AccountMutation) 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 (*AccountMutation) AddTennantIDs ¶
func (m *AccountMutation) AddTennantIDs(ids ...uuid.UUID)
AddTennantIDs adds the "tennants" edge to the Tennant entity by ids.
func (*AccountMutation) AddedEdges ¶
func (m *AccountMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*AccountMutation) AddedField ¶
func (m *AccountMutation) 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 (*AccountMutation) AddedFields ¶
func (m *AccountMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*AccountMutation) AddedIDs ¶
func (m *AccountMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*AccountMutation) ClearEdge ¶
func (m *AccountMutation) 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 (*AccountMutation) ClearField ¶
func (m *AccountMutation) 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 (*AccountMutation) ClearTennants ¶
func (m *AccountMutation) ClearTennants()
ClearTennants clears the "tennants" edge to the Tennant entity.
func (*AccountMutation) ClearedEdges ¶
func (m *AccountMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*AccountMutation) ClearedFields ¶
func (m *AccountMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (AccountMutation) Client ¶
func (m AccountMutation) 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 (*AccountMutation) CreatedAt ¶
func (m *AccountMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*AccountMutation) EdgeCleared ¶
func (m *AccountMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*AccountMutation) Field ¶
func (m *AccountMutation) 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 (*AccountMutation) FieldCleared ¶
func (m *AccountMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*AccountMutation) Fields ¶
func (m *AccountMutation) 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 (*AccountMutation) ID ¶
func (m *AccountMutation) ID() (id uuid.UUID, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*AccountMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*AccountMutation) Name ¶
func (m *AccountMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*AccountMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Account entity. If the Account 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 (*AccountMutation) 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 (*AccountMutation) OldName ¶
func (m *AccountMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Account entity. If the Account 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 (*AccountMutation) RemoveTennantIDs ¶
func (m *AccountMutation) RemoveTennantIDs(ids ...uuid.UUID)
RemoveTennantIDs removes the "tennants" edge to the Tennant entity by IDs.
func (*AccountMutation) RemovedEdges ¶
func (m *AccountMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*AccountMutation) RemovedIDs ¶
func (m *AccountMutation) 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 (*AccountMutation) RemovedTennantsIDs ¶
func (m *AccountMutation) RemovedTennantsIDs() (ids []uuid.UUID)
RemovedTennants returns the removed IDs of the "tennants" edge to the Tennant entity.
func (*AccountMutation) ResetCreatedAt ¶
func (m *AccountMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*AccountMutation) ResetEdge ¶
func (m *AccountMutation) 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 (*AccountMutation) ResetField ¶
func (m *AccountMutation) 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 (*AccountMutation) ResetName ¶
func (m *AccountMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*AccountMutation) ResetTennants ¶
func (m *AccountMutation) ResetTennants()
ResetTennants resets all changes to the "tennants" edge.
func (*AccountMutation) SetCreatedAt ¶
func (m *AccountMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*AccountMutation) SetField ¶
func (m *AccountMutation) 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 (*AccountMutation) SetID ¶
func (m *AccountMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Account entities.
func (*AccountMutation) SetName ¶
func (m *AccountMutation) SetName(s string)
SetName sets the "name" field.
func (*AccountMutation) TennantsCleared ¶
func (m *AccountMutation) TennantsCleared() bool
TennantsCleared reports if the "tennants" edge to the Tennant entity was cleared.
func (*AccountMutation) TennantsIDs ¶
func (m *AccountMutation) TennantsIDs() (ids []uuid.UUID)
TennantsIDs returns the "tennants" edge IDs in the mutation.
func (AccountMutation) Tx ¶
func (m AccountMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*AccountMutation) Type ¶
func (m *AccountMutation) Type() string
Type returns the node type of this mutation (Account).
func (*AccountMutation) Where ¶
func (m *AccountMutation) Where(ps ...predicate.Account)
Where appends a list predicates to the AccountMutation builder.
type AccountOrder ¶
type AccountOrder struct {
Direction OrderDirection `json:"direction"`
Field *AccountOrderField `json:"field"`
}
AccountOrder defines the ordering of Account.
type AccountOrderField ¶
type AccountOrderField struct {
// contains filtered or unexported fields
}
AccountOrderField defines the ordering field of Account.
type AccountPaginateOption ¶
type AccountPaginateOption func(*accountPager) error
AccountPaginateOption enables pagination customization.
func WithAccountFilter ¶
func WithAccountFilter(filter func(*AccountQuery) (*AccountQuery, error)) AccountPaginateOption
WithAccountFilter configures pagination filter.
func WithAccountOrder ¶
func WithAccountOrder(order *AccountOrder) AccountPaginateOption
WithAccountOrder configures pagination ordering.
type AccountQuery ¶
type AccountQuery struct {
// contains filtered or unexported fields
}
AccountQuery is the builder for querying Account entities.
func (*AccountQuery) All ¶
func (aq *AccountQuery) All(ctx context.Context) ([]*Account, error)
All executes the query and returns a list of Accounts.
func (*AccountQuery) AllX ¶
func (aq *AccountQuery) AllX(ctx context.Context) []*Account
AllX is like All, but panics if an error occurs.
func (*AccountQuery) Clone ¶
func (aq *AccountQuery) Clone() *AccountQuery
Clone returns a duplicate of the AccountQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*AccountQuery) CollectFields ¶
func (a *AccountQuery) CollectFields(ctx context.Context, satisfies ...string) (*AccountQuery, error)
CollectFields tells the query-builder to eagerly load connected nodes by resolver context.
func (*AccountQuery) Count ¶
func (aq *AccountQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*AccountQuery) CountX ¶
func (aq *AccountQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*AccountQuery) Exist ¶
func (aq *AccountQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*AccountQuery) ExistX ¶
func (aq *AccountQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*AccountQuery) First ¶
func (aq *AccountQuery) First(ctx context.Context) (*Account, error)
First returns the first Account entity from the query. Returns a *NotFoundError when no Account was found.
func (*AccountQuery) FirstID ¶
FirstID returns the first Account ID from the query. Returns a *NotFoundError when no Account ID was found.
func (*AccountQuery) FirstIDX ¶
func (aq *AccountQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*AccountQuery) FirstX ¶
func (aq *AccountQuery) FirstX(ctx context.Context) *Account
FirstX is like First, but panics if an error occurs.
func (*AccountQuery) GroupBy ¶
func (aq *AccountQuery) GroupBy(field string, fields ...string) *AccountGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct {
Name string `json:"name,omitempty"`
Count int `json:"count,omitempty"`
}
client.Account.Query().
GroupBy(account.FieldName).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*AccountQuery) IDsX ¶
func (aq *AccountQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*AccountQuery) Limit ¶
func (aq *AccountQuery) Limit(limit int) *AccountQuery
Limit adds a limit step to the query.
func (*AccountQuery) Offset ¶
func (aq *AccountQuery) Offset(offset int) *AccountQuery
Offset adds an offset step to the query.
func (*AccountQuery) Only ¶
func (aq *AccountQuery) Only(ctx context.Context) (*Account, error)
Only returns a single Account entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Account entity is found. Returns a *NotFoundError when no Account entities are found.
func (*AccountQuery) OnlyID ¶
OnlyID is like Only, but returns the only Account ID in the query. Returns a *NotSingularError when more than one Account ID is found. Returns a *NotFoundError when no entities are found.
func (*AccountQuery) OnlyIDX ¶
func (aq *AccountQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*AccountQuery) OnlyX ¶
func (aq *AccountQuery) OnlyX(ctx context.Context) *Account
OnlyX is like Only, but panics if an error occurs.
func (*AccountQuery) Order ¶
func (aq *AccountQuery) Order(o ...OrderFunc) *AccountQuery
Order adds an order step to the query.
func (*AccountQuery) Paginate ¶
func (a *AccountQuery) Paginate( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, opts ...AccountPaginateOption, ) (*AccountConnection, error)
Paginate executes the query and returns a relay based cursor connection to Account.
func (*AccountQuery) QueryTennants ¶
func (aq *AccountQuery) QueryTennants() *TennantQuery
QueryTennants chains the current query on the "tennants" edge.
func (*AccountQuery) Select ¶
func (aq *AccountQuery) Select(fields ...string) *AccountSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct {
Name string `json:"name,omitempty"`
}
client.Account.Query().
Select(account.FieldName).
Scan(ctx, &v)
func (*AccountQuery) Unique ¶
func (aq *AccountQuery) Unique(unique bool) *AccountQuery
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 (*AccountQuery) Where ¶
func (aq *AccountQuery) Where(ps ...predicate.Account) *AccountQuery
Where adds a new predicate for the AccountQuery builder.
func (*AccountQuery) WithTennants ¶
func (aq *AccountQuery) WithTennants(opts ...func(*TennantQuery)) *AccountQuery
WithTennants tells the query-builder to eager-load the nodes that are connected to the "tennants" edge. The optional arguments are used to configure the query builder of the edge.
type AccountSelect ¶
type AccountSelect struct {
*AccountQuery
// contains filtered or unexported fields
}
AccountSelect is the builder for selecting fields of Account entities.
func (*AccountSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AccountSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AccountSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AccountSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AccountSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AccountSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AccountSelect) Scan ¶
func (as *AccountSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*AccountSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AccountUpdate ¶
type AccountUpdate struct {
// contains filtered or unexported fields
}
AccountUpdate is the builder for updating Account entities.
func (*AccountUpdate) AddTennantIDs ¶
func (au *AccountUpdate) AddTennantIDs(ids ...uuid.UUID) *AccountUpdate
AddTennantIDs adds the "tennants" edge to the Tennant entity by IDs.
func (*AccountUpdate) AddTennants ¶
func (au *AccountUpdate) AddTennants(t ...*Tennant) *AccountUpdate
AddTennants adds the "tennants" edges to the Tennant entity.
func (*AccountUpdate) ClearTennants ¶
func (au *AccountUpdate) ClearTennants() *AccountUpdate
ClearTennants clears all "tennants" edges to the Tennant entity.
func (*AccountUpdate) Exec ¶
func (au *AccountUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*AccountUpdate) ExecX ¶
func (au *AccountUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AccountUpdate) Mutation ¶
func (au *AccountUpdate) Mutation() *AccountMutation
Mutation returns the AccountMutation object of the builder.
func (*AccountUpdate) RemoveTennantIDs ¶
func (au *AccountUpdate) RemoveTennantIDs(ids ...uuid.UUID) *AccountUpdate
RemoveTennantIDs removes the "tennants" edge to Tennant entities by IDs.
func (*AccountUpdate) RemoveTennants ¶
func (au *AccountUpdate) RemoveTennants(t ...*Tennant) *AccountUpdate
RemoveTennants removes "tennants" edges to Tennant entities.
func (*AccountUpdate) Save ¶
func (au *AccountUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*AccountUpdate) SaveX ¶
func (au *AccountUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*AccountUpdate) SetCreatedAt ¶
func (au *AccountUpdate) SetCreatedAt(t time.Time) *AccountUpdate
SetCreatedAt sets the "created_at" field.
func (*AccountUpdate) SetName ¶
func (au *AccountUpdate) SetName(s string) *AccountUpdate
SetName sets the "name" field.
func (*AccountUpdate) SetNillableCreatedAt ¶
func (au *AccountUpdate) SetNillableCreatedAt(t *time.Time) *AccountUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*AccountUpdate) Where ¶
func (au *AccountUpdate) Where(ps ...predicate.Account) *AccountUpdate
Where appends a list predicates to the AccountUpdate builder.
type AccountUpdateOne ¶
type AccountUpdateOne struct {
// contains filtered or unexported fields
}
AccountUpdateOne is the builder for updating a single Account entity.
func (*AccountUpdateOne) AddTennantIDs ¶
func (auo *AccountUpdateOne) AddTennantIDs(ids ...uuid.UUID) *AccountUpdateOne
AddTennantIDs adds the "tennants" edge to the Tennant entity by IDs.
func (*AccountUpdateOne) AddTennants ¶
func (auo *AccountUpdateOne) AddTennants(t ...*Tennant) *AccountUpdateOne
AddTennants adds the "tennants" edges to the Tennant entity.
func (*AccountUpdateOne) ClearTennants ¶
func (auo *AccountUpdateOne) ClearTennants() *AccountUpdateOne
ClearTennants clears all "tennants" edges to the Tennant entity.
func (*AccountUpdateOne) Exec ¶
func (auo *AccountUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*AccountUpdateOne) ExecX ¶
func (auo *AccountUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AccountUpdateOne) Mutation ¶
func (auo *AccountUpdateOne) Mutation() *AccountMutation
Mutation returns the AccountMutation object of the builder.
func (*AccountUpdateOne) RemoveTennantIDs ¶
func (auo *AccountUpdateOne) RemoveTennantIDs(ids ...uuid.UUID) *AccountUpdateOne
RemoveTennantIDs removes the "tennants" edge to Tennant entities by IDs.
func (*AccountUpdateOne) RemoveTennants ¶
func (auo *AccountUpdateOne) RemoveTennants(t ...*Tennant) *AccountUpdateOne
RemoveTennants removes "tennants" edges to Tennant entities.
func (*AccountUpdateOne) Save ¶
func (auo *AccountUpdateOne) Save(ctx context.Context) (*Account, error)
Save executes the query and returns the updated Account entity.
func (*AccountUpdateOne) SaveX ¶
func (auo *AccountUpdateOne) SaveX(ctx context.Context) *Account
SaveX is like Save, but panics if an error occurs.
func (*AccountUpdateOne) Select ¶
func (auo *AccountUpdateOne) Select(field string, fields ...string) *AccountUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*AccountUpdateOne) SetCreatedAt ¶
func (auo *AccountUpdateOne) SetCreatedAt(t time.Time) *AccountUpdateOne
SetCreatedAt sets the "created_at" field.
func (*AccountUpdateOne) SetName ¶
func (auo *AccountUpdateOne) SetName(s string) *AccountUpdateOne
SetName sets the "name" field.
func (*AccountUpdateOne) SetNillableCreatedAt ¶
func (auo *AccountUpdateOne) SetNillableCreatedAt(t *time.Time) *AccountUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
type AccountWhereInput ¶
type AccountWhereInput struct {
Predicates []predicate.Account `json:"-"`
Not *AccountWhereInput `json:"not,omitempty"`
Or []*AccountWhereInput `json:"or,omitempty"`
And []*AccountWhereInput `json:"and,omitempty"`
// "id" field predicates.
ID *uuid.UUID `json:"id,omitempty"`
IDNEQ *uuid.UUID `json:"idNEQ,omitempty"`
IDIn []uuid.UUID `json:"idIn,omitempty"`
IDNotIn []uuid.UUID `json:"idNotIn,omitempty"`
IDGT *uuid.UUID `json:"idGT,omitempty"`
IDGTE *uuid.UUID `json:"idGTE,omitempty"`
IDLT *uuid.UUID `json:"idLT,omitempty"`
IDLTE *uuid.UUID `json:"idLTE,omitempty"`
// "name" field predicates.
Name *string `json:"name,omitempty"`
NameNEQ *string `json:"nameNEQ,omitempty"`
NameIn []string `json:"nameIn,omitempty"`
NameNotIn []string `json:"nameNotIn,omitempty"`
NameGT *string `json:"nameGT,omitempty"`
NameGTE *string `json:"nameGTE,omitempty"`
NameLT *string `json:"nameLT,omitempty"`
NameLTE *string `json:"nameLTE,omitempty"`
NameContains *string `json:"nameContains,omitempty"`
NameHasPrefix *string `json:"nameHasPrefix,omitempty"`
NameHasSuffix *string `json:"nameHasSuffix,omitempty"`
NameEqualFold *string `json:"nameEqualFold,omitempty"`
NameContainsFold *string `json:"nameContainsFold,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"`
// "tennants" edge predicates.
HasTennants *bool `json:"hasTennants,omitempty"`
HasTennantsWith []*TennantWhereInput `json:"hasTennantsWith,omitempty"`
}
AccountWhereInput represents a where input for filtering Account queries.
func (*AccountWhereInput) AddPredicates ¶
func (i *AccountWhereInput) AddPredicates(predicates ...predicate.Account)
AddPredicates adds custom predicates to the where input to be used during the filtering phase.
func (*AccountWhereInput) Filter ¶
func (i *AccountWhereInput) Filter(q *AccountQuery) (*AccountQuery, error)
Filter applies the AccountWhereInput filter on the AccountQuery builder.
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
// Account is the client for interacting with the Account builders.
Account *AccountClient
// Tennant is the client for interacting with the Tennant builders.
Tennant *TennantClient
// 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(). Account. Query(). Count(ctx)
func (*Client) Noder ¶
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) 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 Cursor ¶
Cursor of an edge type.
func (Cursor) MarshalGQL ¶
MarshalGQL implements graphql.Marshaler interface.
func (*Cursor) UnmarshalGQL ¶
UnmarshalGQL implements graphql.Unmarshaler interface.
type Edge ¶
type Edge struct {
Type string `json:"type,omitempty"` // edge type.
Name string `json:"name,omitempty"` // edge name.
IDs []uuid.UUID `json:"ids,omitempty"` // node ids (where this edge point to).
}
Edges between two nodes.
type Field ¶
type Field struct {
Type string `json:"type,omitempty"` // field type.
Name string `json:"name,omitempty"` // field name (as in struct).
Value string `json:"value,omitempty"` // stringified value.
}
Field of a node.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type Node ¶
type Node struct {
ID uuid.UUID `json:"id,omitempty"` // node id.
Type string `json:"type,omitempty"` // node type.
Fields []*Field `json:"fields,omitempty"` // node fields.
Edges []*Edge `json:"edges,omitempty"` // node edges.
}
Node in the graph.
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 ¶
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 OrderDirection ¶
type OrderDirection string
OrderDirection defines the directions in which to order a list of items.
const ( // OrderDirectionAsc specifies an ascending order. OrderDirectionAsc OrderDirection = "ASC" // OrderDirectionDesc specifies a descending order. OrderDirectionDesc OrderDirection = "DESC" )
func (OrderDirection) MarshalGQL ¶
func (o OrderDirection) MarshalGQL(w io.Writer)
MarshalGQL implements graphql.Marshaler interface.
func (OrderDirection) String ¶
func (o OrderDirection) String() string
String implements fmt.Stringer interface.
func (*OrderDirection) UnmarshalGQL ¶
func (o *OrderDirection) UnmarshalGQL(val interface{}) error
UnmarshalGQL implements graphql.Unmarshaler interface.
func (OrderDirection) Validate ¶
func (o OrderDirection) Validate() error
Validate the order direction value.
type PageInfo ¶
type PageInfo struct {
HasNextPage bool `json:"hasNextPage"`
HasPreviousPage bool `json:"hasPreviousPage"`
StartCursor *Cursor `json:"startCursor"`
EndCursor *Cursor `json:"endCursor"`
}
PageInfo of a connection type.
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 Tennant ¶
type Tennant struct {
// ID of the ent.
ID uuid.UUID `json:"id,omitempty"`
// ExternalId holds the value of the "externalId" field.
ExternalId string `json:"externalId,omitempty"`
// Cloud holds the value of the "cloud" field.
Cloud string `json:"cloud,omitempty"`
// AccountID holds the value of the "account_id" field.
AccountID uuid.UUID `json:"account_id,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the TennantQuery when eager-loading is set.
Edges TennantEdges `json:"edges"`
// contains filtered or unexported fields
}
Tennant is the model entity for the Tennant schema.
func (*Tennant) QueryAccount ¶
func (t *Tennant) QueryAccount() *AccountQuery
QueryAccount queries the "account" edge of the Tennant entity.
func (*Tennant) ToEdge ¶
func (t *Tennant) ToEdge(order *TennantOrder) *TennantEdge
ToEdge converts Tennant into TennantEdge.
func (*Tennant) Unwrap ¶
Unwrap unwraps the Tennant 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 (*Tennant) Update ¶
func (t *Tennant) Update() *TennantUpdateOne
Update returns a builder for updating this Tennant. Note that you need to call Tennant.Unwrap() before calling this method if this Tennant was returned from a transaction, and the transaction was committed or rolled back.
type TennantClient ¶
type TennantClient struct {
// contains filtered or unexported fields
}
TennantClient is a client for the Tennant schema.
func NewTennantClient ¶
func NewTennantClient(c config) *TennantClient
NewTennantClient returns a client for the Tennant from the given config.
func (*TennantClient) Create ¶
func (c *TennantClient) Create() *TennantCreate
Create returns a builder for creating a Tennant entity.
func (*TennantClient) CreateBulk ¶
func (c *TennantClient) CreateBulk(builders ...*TennantCreate) *TennantCreateBulk
CreateBulk returns a builder for creating a bulk of Tennant entities.
func (*TennantClient) Delete ¶
func (c *TennantClient) Delete() *TennantDelete
Delete returns a delete builder for Tennant.
func (*TennantClient) DeleteOne ¶
func (c *TennantClient) DeleteOne(t *Tennant) *TennantDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*TennantClient) DeleteOneID ¶
func (c *TennantClient) DeleteOneID(id uuid.UUID) *TennantDeleteOne
DeleteOne returns a builder for deleting the given entity by its id.
func (*TennantClient) Hooks ¶
func (c *TennantClient) Hooks() []Hook
Hooks returns the client hooks.
func (*TennantClient) Query ¶
func (c *TennantClient) Query() *TennantQuery
Query returns a query builder for Tennant.
func (*TennantClient) QueryAccount ¶
func (c *TennantClient) QueryAccount(t *Tennant) *AccountQuery
QueryAccount queries the account edge of a Tennant.
func (*TennantClient) Update ¶
func (c *TennantClient) Update() *TennantUpdate
Update returns an update builder for Tennant.
func (*TennantClient) UpdateOne ¶
func (c *TennantClient) UpdateOne(t *Tennant) *TennantUpdateOne
UpdateOne returns an update builder for the given entity.
func (*TennantClient) UpdateOneID ¶
func (c *TennantClient) UpdateOneID(id uuid.UUID) *TennantUpdateOne
UpdateOneID returns an update builder for the given id.
func (*TennantClient) Use ¶
func (c *TennantClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tennant.Hooks(f(g(h())))`.
type TennantConnection ¶
type TennantConnection struct {
Edges []*TennantEdge `json:"edges"`
PageInfo PageInfo `json:"pageInfo"`
TotalCount int `json:"totalCount"`
}
TennantConnection is the connection containing edges to Tennant.
type TennantCreate ¶
type TennantCreate struct {
// contains filtered or unexported fields
}
TennantCreate is the builder for creating a Tennant entity.
func (*TennantCreate) Exec ¶
func (tc *TennantCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*TennantCreate) ExecX ¶
func (tc *TennantCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TennantCreate) Mutation ¶
func (tc *TennantCreate) Mutation() *TennantMutation
Mutation returns the TennantMutation object of the builder.
func (*TennantCreate) Save ¶
func (tc *TennantCreate) Save(ctx context.Context) (*Tennant, error)
Save creates the Tennant in the database.
func (*TennantCreate) SaveX ¶
func (tc *TennantCreate) SaveX(ctx context.Context) *Tennant
SaveX calls Save and panics if Save returns an error.
func (*TennantCreate) SetAccount ¶
func (tc *TennantCreate) SetAccount(a *Account) *TennantCreate
SetAccount sets the "account" edge to the Account entity.
func (*TennantCreate) SetAccountID ¶
func (tc *TennantCreate) SetAccountID(u uuid.UUID) *TennantCreate
SetAccountID sets the "account_id" field.
func (*TennantCreate) SetCloud ¶
func (tc *TennantCreate) SetCloud(s string) *TennantCreate
SetCloud sets the "cloud" field.
func (*TennantCreate) SetCreatedAt ¶
func (tc *TennantCreate) SetCreatedAt(t time.Time) *TennantCreate
SetCreatedAt sets the "created_at" field.
func (*TennantCreate) SetExternalId ¶
func (tc *TennantCreate) SetExternalId(s string) *TennantCreate
SetExternalId sets the "externalId" field.
func (*TennantCreate) SetID ¶
func (tc *TennantCreate) SetID(u uuid.UUID) *TennantCreate
SetID sets the "id" field.
func (*TennantCreate) SetNillableCreatedAt ¶
func (tc *TennantCreate) SetNillableCreatedAt(t *time.Time) *TennantCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*TennantCreate) SetNillableID ¶
func (tc *TennantCreate) SetNillableID(u *uuid.UUID) *TennantCreate
SetNillableID sets the "id" field if the given value is not nil.
type TennantCreateBulk ¶
type TennantCreateBulk struct {
// contains filtered or unexported fields
}
TennantCreateBulk is the builder for creating many Tennant entities in bulk.
func (*TennantCreateBulk) Exec ¶
func (tcb *TennantCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TennantCreateBulk) ExecX ¶
func (tcb *TennantCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type TennantDelete ¶
type TennantDelete struct {
// contains filtered or unexported fields
}
TennantDelete is the builder for deleting a Tennant entity.
func (*TennantDelete) Exec ¶
func (td *TennantDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*TennantDelete) ExecX ¶
func (td *TennantDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*TennantDelete) Where ¶
func (td *TennantDelete) Where(ps ...predicate.Tennant) *TennantDelete
Where appends a list predicates to the TennantDelete builder.
type TennantDeleteOne ¶
type TennantDeleteOne struct {
// contains filtered or unexported fields
}
TennantDeleteOne is the builder for deleting a single Tennant entity.
func (*TennantDeleteOne) Exec ¶
func (tdo *TennantDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*TennantDeleteOne) ExecX ¶
func (tdo *TennantDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type TennantEdge ¶
TennantEdge is the edge representation of Tennant.
type TennantEdges ¶
type TennantEdges struct {
// Account holds the value of the account edge.
Account *Account `json:"account,omitempty"`
// contains filtered or unexported fields
}
TennantEdges holds the relations/edges for other nodes in the graph.
func (TennantEdges) AccountOrErr ¶
func (e TennantEdges) AccountOrErr() (*Account, error)
AccountOrErr returns the Account value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type TennantGroupBy ¶
type TennantGroupBy struct {
// contains filtered or unexported fields
}
TennantGroupBy is the group-by builder for Tennant entities.
func (*TennantGroupBy) Aggregate ¶
func (tgb *TennantGroupBy) Aggregate(fns ...AggregateFunc) *TennantGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*TennantGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TennantGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TennantGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TennantGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TennantGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TennantGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TennantGroupBy) Scan ¶
func (tgb *TennantGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*TennantGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TennantMutation ¶
type TennantMutation struct {
// contains filtered or unexported fields
}
TennantMutation represents an operation that mutates the Tennant nodes in the graph.
func (*TennantMutation) AccountCleared ¶
func (m *TennantMutation) AccountCleared() bool
AccountCleared reports if the "account" edge to the Account entity was cleared.
func (*TennantMutation) AccountID ¶
func (m *TennantMutation) AccountID() (r uuid.UUID, exists bool)
AccountID returns the value of the "account_id" field in the mutation.
func (*TennantMutation) AccountIDs ¶
func (m *TennantMutation) AccountIDs() (ids []uuid.UUID)
AccountIDs returns the "account" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AccountID instead. It exists only for internal usage by the builders.
func (*TennantMutation) AddField ¶
func (m *TennantMutation) 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 (*TennantMutation) AddedEdges ¶
func (m *TennantMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*TennantMutation) AddedField ¶
func (m *TennantMutation) 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 (*TennantMutation) AddedFields ¶
func (m *TennantMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*TennantMutation) AddedIDs ¶
func (m *TennantMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*TennantMutation) ClearAccount ¶
func (m *TennantMutation) ClearAccount()
ClearAccount clears the "account" edge to the Account entity.
func (*TennantMutation) ClearEdge ¶
func (m *TennantMutation) 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 (*TennantMutation) ClearField ¶
func (m *TennantMutation) 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 (*TennantMutation) ClearedEdges ¶
func (m *TennantMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*TennantMutation) ClearedFields ¶
func (m *TennantMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (TennantMutation) Client ¶
func (m TennantMutation) 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 (*TennantMutation) Cloud ¶
func (m *TennantMutation) Cloud() (r string, exists bool)
Cloud returns the value of the "cloud" field in the mutation.
func (*TennantMutation) CreatedAt ¶
func (m *TennantMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*TennantMutation) EdgeCleared ¶
func (m *TennantMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*TennantMutation) ExternalId ¶
func (m *TennantMutation) ExternalId() (r string, exists bool)
ExternalId returns the value of the "externalId" field in the mutation.
func (*TennantMutation) Field ¶
func (m *TennantMutation) 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 (*TennantMutation) FieldCleared ¶
func (m *TennantMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*TennantMutation) Fields ¶
func (m *TennantMutation) 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 (*TennantMutation) ID ¶
func (m *TennantMutation) ID() (id uuid.UUID, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*TennantMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*TennantMutation) OldAccountID ¶
OldAccountID returns the old "account_id" field's value of the Tennant entity. If the Tennant 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 (*TennantMutation) OldCloud ¶
func (m *TennantMutation) OldCloud(ctx context.Context) (v string, err error)
OldCloud returns the old "cloud" field's value of the Tennant entity. If the Tennant 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 (*TennantMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Tennant entity. If the Tennant 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 (*TennantMutation) OldExternalId ¶
func (m *TennantMutation) OldExternalId(ctx context.Context) (v string, err error)
OldExternalId returns the old "externalId" field's value of the Tennant entity. If the Tennant 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 (*TennantMutation) 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 (*TennantMutation) RemovedEdges ¶
func (m *TennantMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*TennantMutation) RemovedIDs ¶
func (m *TennantMutation) 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 (*TennantMutation) ResetAccount ¶
func (m *TennantMutation) ResetAccount()
ResetAccount resets all changes to the "account" edge.
func (*TennantMutation) ResetAccountID ¶
func (m *TennantMutation) ResetAccountID()
ResetAccountID resets all changes to the "account_id" field.
func (*TennantMutation) ResetCloud ¶
func (m *TennantMutation) ResetCloud()
ResetCloud resets all changes to the "cloud" field.
func (*TennantMutation) ResetCreatedAt ¶
func (m *TennantMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*TennantMutation) ResetEdge ¶
func (m *TennantMutation) 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 (*TennantMutation) ResetExternalId ¶
func (m *TennantMutation) ResetExternalId()
ResetExternalId resets all changes to the "externalId" field.
func (*TennantMutation) ResetField ¶
func (m *TennantMutation) 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 (*TennantMutation) SetAccountID ¶
func (m *TennantMutation) SetAccountID(u uuid.UUID)
SetAccountID sets the "account_id" field.
func (*TennantMutation) SetCloud ¶
func (m *TennantMutation) SetCloud(s string)
SetCloud sets the "cloud" field.
func (*TennantMutation) SetCreatedAt ¶
func (m *TennantMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*TennantMutation) SetExternalId ¶
func (m *TennantMutation) SetExternalId(s string)
SetExternalId sets the "externalId" field.
func (*TennantMutation) SetField ¶
func (m *TennantMutation) 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 (*TennantMutation) SetID ¶
func (m *TennantMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Tennant entities.
func (TennantMutation) Tx ¶
func (m TennantMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*TennantMutation) Type ¶
func (m *TennantMutation) Type() string
Type returns the node type of this mutation (Tennant).
func (*TennantMutation) Where ¶
func (m *TennantMutation) Where(ps ...predicate.Tennant)
Where appends a list predicates to the TennantMutation builder.
type TennantOrder ¶
type TennantOrder struct {
Direction OrderDirection `json:"direction"`
Field *TennantOrderField `json:"field"`
}
TennantOrder defines the ordering of Tennant.
type TennantOrderField ¶
type TennantOrderField struct {
// contains filtered or unexported fields
}
TennantOrderField defines the ordering field of Tennant.
type TennantPaginateOption ¶
type TennantPaginateOption func(*tennantPager) error
TennantPaginateOption enables pagination customization.
func WithTennantFilter ¶
func WithTennantFilter(filter func(*TennantQuery) (*TennantQuery, error)) TennantPaginateOption
WithTennantFilter configures pagination filter.
func WithTennantOrder ¶
func WithTennantOrder(order *TennantOrder) TennantPaginateOption
WithTennantOrder configures pagination ordering.
type TennantQuery ¶
type TennantQuery struct {
// contains filtered or unexported fields
}
TennantQuery is the builder for querying Tennant entities.
func (*TennantQuery) All ¶
func (tq *TennantQuery) All(ctx context.Context) ([]*Tennant, error)
All executes the query and returns a list of Tennants.
func (*TennantQuery) AllX ¶
func (tq *TennantQuery) AllX(ctx context.Context) []*Tennant
AllX is like All, but panics if an error occurs.
func (*TennantQuery) Clone ¶
func (tq *TennantQuery) Clone() *TennantQuery
Clone returns a duplicate of the TennantQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*TennantQuery) CollectFields ¶
func (t *TennantQuery) CollectFields(ctx context.Context, satisfies ...string) (*TennantQuery, error)
CollectFields tells the query-builder to eagerly load connected nodes by resolver context.
func (*TennantQuery) Count ¶
func (tq *TennantQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*TennantQuery) CountX ¶
func (tq *TennantQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*TennantQuery) Exist ¶
func (tq *TennantQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*TennantQuery) ExistX ¶
func (tq *TennantQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*TennantQuery) First ¶
func (tq *TennantQuery) First(ctx context.Context) (*Tennant, error)
First returns the first Tennant entity from the query. Returns a *NotFoundError when no Tennant was found.
func (*TennantQuery) FirstID ¶
FirstID returns the first Tennant ID from the query. Returns a *NotFoundError when no Tennant ID was found.
func (*TennantQuery) FirstIDX ¶
func (tq *TennantQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*TennantQuery) FirstX ¶
func (tq *TennantQuery) FirstX(ctx context.Context) *Tennant
FirstX is like First, but panics if an error occurs.
func (*TennantQuery) GroupBy ¶
func (tq *TennantQuery) GroupBy(field string, fields ...string) *TennantGroupBy
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 {
ExternalId string `json:"externalId,omitempty"`
Count int `json:"count,omitempty"`
}
client.Tennant.Query().
GroupBy(tennant.FieldExternalId).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*TennantQuery) IDsX ¶
func (tq *TennantQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*TennantQuery) Limit ¶
func (tq *TennantQuery) Limit(limit int) *TennantQuery
Limit adds a limit step to the query.
func (*TennantQuery) Offset ¶
func (tq *TennantQuery) Offset(offset int) *TennantQuery
Offset adds an offset step to the query.
func (*TennantQuery) Only ¶
func (tq *TennantQuery) Only(ctx context.Context) (*Tennant, error)
Only returns a single Tennant entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Tennant entity is found. Returns a *NotFoundError when no Tennant entities are found.
func (*TennantQuery) OnlyID ¶
OnlyID is like Only, but returns the only Tennant ID in the query. Returns a *NotSingularError when more than one Tennant ID is found. Returns a *NotFoundError when no entities are found.
func (*TennantQuery) OnlyIDX ¶
func (tq *TennantQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*TennantQuery) OnlyX ¶
func (tq *TennantQuery) OnlyX(ctx context.Context) *Tennant
OnlyX is like Only, but panics if an error occurs.
func (*TennantQuery) Order ¶
func (tq *TennantQuery) Order(o ...OrderFunc) *TennantQuery
Order adds an order step to the query.
func (*TennantQuery) Paginate ¶
func (t *TennantQuery) Paginate( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, opts ...TennantPaginateOption, ) (*TennantConnection, error)
Paginate executes the query and returns a relay based cursor connection to Tennant.
func (*TennantQuery) QueryAccount ¶
func (tq *TennantQuery) QueryAccount() *AccountQuery
QueryAccount chains the current query on the "account" edge.
func (*TennantQuery) Select ¶
func (tq *TennantQuery) Select(fields ...string) *TennantSelect
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 {
ExternalId string `json:"externalId,omitempty"`
}
client.Tennant.Query().
Select(tennant.FieldExternalId).
Scan(ctx, &v)
func (*TennantQuery) Unique ¶
func (tq *TennantQuery) Unique(unique bool) *TennantQuery
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 (*TennantQuery) Where ¶
func (tq *TennantQuery) Where(ps ...predicate.Tennant) *TennantQuery
Where adds a new predicate for the TennantQuery builder.
func (*TennantQuery) WithAccount ¶
func (tq *TennantQuery) WithAccount(opts ...func(*AccountQuery)) *TennantQuery
WithAccount tells the query-builder to eager-load the nodes that are connected to the "account" edge. The optional arguments are used to configure the query builder of the edge.
type TennantSelect ¶
type TennantSelect struct {
*TennantQuery
// contains filtered or unexported fields
}
TennantSelect is the builder for selecting fields of Tennant entities.
func (*TennantSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TennantSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TennantSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TennantSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TennantSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TennantSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TennantSelect) Scan ¶
func (ts *TennantSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*TennantSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TennantUpdate ¶
type TennantUpdate struct {
// contains filtered or unexported fields
}
TennantUpdate is the builder for updating Tennant entities.
func (*TennantUpdate) ClearAccount ¶
func (tu *TennantUpdate) ClearAccount() *TennantUpdate
ClearAccount clears the "account" edge to the Account entity.
func (*TennantUpdate) Exec ¶
func (tu *TennantUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*TennantUpdate) ExecX ¶
func (tu *TennantUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TennantUpdate) Mutation ¶
func (tu *TennantUpdate) Mutation() *TennantMutation
Mutation returns the TennantMutation object of the builder.
func (*TennantUpdate) Save ¶
func (tu *TennantUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*TennantUpdate) SaveX ¶
func (tu *TennantUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*TennantUpdate) SetAccount ¶
func (tu *TennantUpdate) SetAccount(a *Account) *TennantUpdate
SetAccount sets the "account" edge to the Account entity.
func (*TennantUpdate) SetAccountID ¶
func (tu *TennantUpdate) SetAccountID(u uuid.UUID) *TennantUpdate
SetAccountID sets the "account_id" field.
func (*TennantUpdate) SetCloud ¶
func (tu *TennantUpdate) SetCloud(s string) *TennantUpdate
SetCloud sets the "cloud" field.
func (*TennantUpdate) SetCreatedAt ¶
func (tu *TennantUpdate) SetCreatedAt(t time.Time) *TennantUpdate
SetCreatedAt sets the "created_at" field.
func (*TennantUpdate) SetExternalId ¶
func (tu *TennantUpdate) SetExternalId(s string) *TennantUpdate
SetExternalId sets the "externalId" field.
func (*TennantUpdate) SetNillableCreatedAt ¶
func (tu *TennantUpdate) SetNillableCreatedAt(t *time.Time) *TennantUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*TennantUpdate) Where ¶
func (tu *TennantUpdate) Where(ps ...predicate.Tennant) *TennantUpdate
Where appends a list predicates to the TennantUpdate builder.
type TennantUpdateOne ¶
type TennantUpdateOne struct {
// contains filtered or unexported fields
}
TennantUpdateOne is the builder for updating a single Tennant entity.
func (*TennantUpdateOne) ClearAccount ¶
func (tuo *TennantUpdateOne) ClearAccount() *TennantUpdateOne
ClearAccount clears the "account" edge to the Account entity.
func (*TennantUpdateOne) Exec ¶
func (tuo *TennantUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*TennantUpdateOne) ExecX ¶
func (tuo *TennantUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TennantUpdateOne) Mutation ¶
func (tuo *TennantUpdateOne) Mutation() *TennantMutation
Mutation returns the TennantMutation object of the builder.
func (*TennantUpdateOne) Save ¶
func (tuo *TennantUpdateOne) Save(ctx context.Context) (*Tennant, error)
Save executes the query and returns the updated Tennant entity.
func (*TennantUpdateOne) SaveX ¶
func (tuo *TennantUpdateOne) SaveX(ctx context.Context) *Tennant
SaveX is like Save, but panics if an error occurs.
func (*TennantUpdateOne) Select ¶
func (tuo *TennantUpdateOne) Select(field string, fields ...string) *TennantUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*TennantUpdateOne) SetAccount ¶
func (tuo *TennantUpdateOne) SetAccount(a *Account) *TennantUpdateOne
SetAccount sets the "account" edge to the Account entity.
func (*TennantUpdateOne) SetAccountID ¶
func (tuo *TennantUpdateOne) SetAccountID(u uuid.UUID) *TennantUpdateOne
SetAccountID sets the "account_id" field.
func (*TennantUpdateOne) SetCloud ¶
func (tuo *TennantUpdateOne) SetCloud(s string) *TennantUpdateOne
SetCloud sets the "cloud" field.
func (*TennantUpdateOne) SetCreatedAt ¶
func (tuo *TennantUpdateOne) SetCreatedAt(t time.Time) *TennantUpdateOne
SetCreatedAt sets the "created_at" field.
func (*TennantUpdateOne) SetExternalId ¶
func (tuo *TennantUpdateOne) SetExternalId(s string) *TennantUpdateOne
SetExternalId sets the "externalId" field.
func (*TennantUpdateOne) SetNillableCreatedAt ¶
func (tuo *TennantUpdateOne) SetNillableCreatedAt(t *time.Time) *TennantUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
type TennantWhereInput ¶
type TennantWhereInput struct {
Predicates []predicate.Tennant `json:"-"`
Not *TennantWhereInput `json:"not,omitempty"`
Or []*TennantWhereInput `json:"or,omitempty"`
And []*TennantWhereInput `json:"and,omitempty"`
// "id" field predicates.
ID *uuid.UUID `json:"id,omitempty"`
IDNEQ *uuid.UUID `json:"idNEQ,omitempty"`
IDIn []uuid.UUID `json:"idIn,omitempty"`
IDNotIn []uuid.UUID `json:"idNotIn,omitempty"`
IDGT *uuid.UUID `json:"idGT,omitempty"`
IDGTE *uuid.UUID `json:"idGTE,omitempty"`
IDLT *uuid.UUID `json:"idLT,omitempty"`
IDLTE *uuid.UUID `json:"idLTE,omitempty"`
// "externalId" field predicates.
ExternalId *string `json:"externalid,omitempty"`
ExternalIdNEQ *string `json:"externalidNEQ,omitempty"`
ExternalIdIn []string `json:"externalidIn,omitempty"`
ExternalIdNotIn []string `json:"externalidNotIn,omitempty"`
ExternalIdGT *string `json:"externalidGT,omitempty"`
ExternalIdGTE *string `json:"externalidGTE,omitempty"`
ExternalIdLT *string `json:"externalidLT,omitempty"`
ExternalIdLTE *string `json:"externalidLTE,omitempty"`
ExternalIdContains *string `json:"externalidContains,omitempty"`
ExternalIdHasPrefix *string `json:"externalidHasPrefix,omitempty"`
ExternalIdHasSuffix *string `json:"externalidHasSuffix,omitempty"`
ExternalIdEqualFold *string `json:"externalidEqualFold,omitempty"`
ExternalIdContainsFold *string `json:"externalidContainsFold,omitempty"`
// "cloud" field predicates.
Cloud *string `json:"cloud,omitempty"`
CloudNEQ *string `json:"cloudNEQ,omitempty"`
CloudIn []string `json:"cloudIn,omitempty"`
CloudNotIn []string `json:"cloudNotIn,omitempty"`
CloudGT *string `json:"cloudGT,omitempty"`
CloudGTE *string `json:"cloudGTE,omitempty"`
CloudLT *string `json:"cloudLT,omitempty"`
CloudLTE *string `json:"cloudLTE,omitempty"`
CloudContains *string `json:"cloudContains,omitempty"`
CloudHasPrefix *string `json:"cloudHasPrefix,omitempty"`
CloudHasSuffix *string `json:"cloudHasSuffix,omitempty"`
CloudEqualFold *string `json:"cloudEqualFold,omitempty"`
CloudContainsFold *string `json:"cloudContainsFold,omitempty"`
// "account_id" field predicates.
AccountID *uuid.UUID `json:"accountID,omitempty"`
AccountIDNEQ *uuid.UUID `json:"accountIDNEQ,omitempty"`
AccountIDIn []uuid.UUID `json:"accountIDIn,omitempty"`
AccountIDNotIn []uuid.UUID `json:"accountIDNotIn,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"`
// "account" edge predicates.
HasAccount *bool `json:"hasAccount,omitempty"`
HasAccountWith []*AccountWhereInput `json:"hasAccountWith,omitempty"`
}
TennantWhereInput represents a where input for filtering Tennant queries.
func (*TennantWhereInput) AddPredicates ¶
func (i *TennantWhereInput) AddPredicates(predicates ...predicate.Tennant)
AddPredicates adds custom predicates to the where input to be used during the filtering phase.
func (*TennantWhereInput) Filter ¶
func (i *TennantWhereInput) Filter(q *TennantQuery) (*TennantQuery, error)
Filter applies the TennantWhereInput filter on the TennantQuery builder.
type Tx ¶
type Tx struct {
// Account is the client for interacting with the Account builders.
Account *AccountClient
// Tennant is the client for interacting with the Tennant builders.
Tennant *TennantClient
// 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.
Source Files
¶
- account.go
- account_create.go
- account_delete.go
- account_query.go
- account_update.go
- client.go
- config.go
- context.go
- ent.go
- generate.go
- gql_collection.go
- gql_edge.go
- gql_node.go
- gql_pagination.go
- gql_transaction.go
- gql_where_input.go
- mutation.go
- runtime.go
- tennant.go
- tennant_create.go
- tennant_delete.go
- tennant_query.go
- tennant_update.go
- tx.go