Documentation ¶
Overview ¶
Code generated by entfga, DO NOT EDIT.
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- func OpenTxFromContext(ctx context.Context) (context.Context, driver.Tx, error)
- type AggregateFunc
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Noder(ctx context.Context, id string, opts ...NodeOption) (_ Noder, err error)
- func (c *Client) Noders(ctx context.Context, ids []string, 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)
- func (c *Client) WithAuthz()
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type CreateOrgMembershipInput
- type CreateOrganizationInput
- type Cursor
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NodeOption
- type Noder
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderDirection
- type OrderFunc
- type OrgMembership
- func (*OrgMembership) IsNode()
- func (om *OrgMembership) Organization(ctx context.Context) (*Organization, error)
- func (om *OrgMembership) QueryOrganization() *OrganizationQuery
- func (om *OrgMembership) String() string
- func (om *OrgMembership) ToEdge(order *OrgMembershipOrder) *OrgMembershipEdge
- func (om *OrgMembership) Unwrap() *OrgMembership
- func (om *OrgMembership) Update() *OrgMembershipUpdateOne
- func (om *OrgMembership) Value(name string) (ent.Value, error)
- type OrgMembershipClient
- func (c *OrgMembershipClient) Create() *OrgMembershipCreate
- func (c *OrgMembershipClient) CreateBulk(builders ...*OrgMembershipCreate) *OrgMembershipCreateBulk
- func (c *OrgMembershipClient) Delete() *OrgMembershipDelete
- func (c *OrgMembershipClient) DeleteOne(om *OrgMembership) *OrgMembershipDeleteOne
- func (c *OrgMembershipClient) DeleteOneID(id string) *OrgMembershipDeleteOne
- func (c *OrgMembershipClient) Get(ctx context.Context, id string) (*OrgMembership, error)
- func (c *OrgMembershipClient) GetX(ctx context.Context, id string) *OrgMembership
- func (c *OrgMembershipClient) Hooks() []Hook
- func (c *OrgMembershipClient) Intercept(interceptors ...Interceptor)
- func (c *OrgMembershipClient) Interceptors() []Interceptor
- func (c *OrgMembershipClient) MapCreateBulk(slice any, setFunc func(*OrgMembershipCreate, int)) *OrgMembershipCreateBulk
- func (c *OrgMembershipClient) Query() *OrgMembershipQuery
- func (c *OrgMembershipClient) QueryOrganization(om *OrgMembership) *OrganizationQuery
- func (c *OrgMembershipClient) Update() *OrgMembershipUpdate
- func (c *OrgMembershipClient) UpdateOne(om *OrgMembership) *OrgMembershipUpdateOne
- func (c *OrgMembershipClient) UpdateOneID(id string) *OrgMembershipUpdateOne
- func (c *OrgMembershipClient) Use(hooks ...Hook)
- type OrgMembershipConnection
- type OrgMembershipCreate
- func (omc *OrgMembershipCreate) Exec(ctx context.Context) error
- func (omc *OrgMembershipCreate) ExecX(ctx context.Context)
- func (omc *OrgMembershipCreate) Mutation() *OrgMembershipMutation
- func (omc *OrgMembershipCreate) Save(ctx context.Context) (*OrgMembership, error)
- func (omc *OrgMembershipCreate) SaveX(ctx context.Context) *OrgMembership
- func (omc *OrgMembershipCreate) SetID(s string) *OrgMembershipCreate
- func (c *OrgMembershipCreate) SetInput(i CreateOrgMembershipInput) *OrgMembershipCreate
- func (omc *OrgMembershipCreate) SetNillableRole(e *enums.Role) *OrgMembershipCreate
- func (omc *OrgMembershipCreate) SetOrganization(o *Organization) *OrgMembershipCreate
- func (omc *OrgMembershipCreate) SetOrganizationID(s string) *OrgMembershipCreate
- func (omc *OrgMembershipCreate) SetRole(e enums.Role) *OrgMembershipCreate
- func (omc *OrgMembershipCreate) SetUserID(s string) *OrgMembershipCreate
- type OrgMembershipCreateBulk
- func (omcb *OrgMembershipCreateBulk) Exec(ctx context.Context) error
- func (omcb *OrgMembershipCreateBulk) ExecX(ctx context.Context)
- func (omcb *OrgMembershipCreateBulk) Save(ctx context.Context) ([]*OrgMembership, error)
- func (omcb *OrgMembershipCreateBulk) SaveX(ctx context.Context) []*OrgMembership
- type OrgMembershipDelete
- type OrgMembershipDeleteOne
- type OrgMembershipEdge
- type OrgMembershipEdges
- type OrgMembershipGroupBy
- func (omgb *OrgMembershipGroupBy) Aggregate(fns ...AggregateFunc) *OrgMembershipGroupBy
- func (s *OrgMembershipGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *OrgMembershipGroupBy) BoolX(ctx context.Context) bool
- func (s *OrgMembershipGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *OrgMembershipGroupBy) BoolsX(ctx context.Context) []bool
- func (s *OrgMembershipGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *OrgMembershipGroupBy) Float64X(ctx context.Context) float64
- func (s *OrgMembershipGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *OrgMembershipGroupBy) Float64sX(ctx context.Context) []float64
- func (s *OrgMembershipGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *OrgMembershipGroupBy) IntX(ctx context.Context) int
- func (s *OrgMembershipGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *OrgMembershipGroupBy) IntsX(ctx context.Context) []int
- func (omgb *OrgMembershipGroupBy) Scan(ctx context.Context, v any) error
- func (s *OrgMembershipGroupBy) ScanX(ctx context.Context, v any)
- func (s *OrgMembershipGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *OrgMembershipGroupBy) StringX(ctx context.Context) string
- func (s *OrgMembershipGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *OrgMembershipGroupBy) StringsX(ctx context.Context) []string
- type OrgMembershipMutation
- func (m *OrgMembershipMutation) AddField(name string, value ent.Value) error
- func (m *OrgMembershipMutation) AddedEdges() []string
- func (m *OrgMembershipMutation) AddedField(name string) (ent.Value, bool)
- func (m *OrgMembershipMutation) AddedFields() []string
- func (m *OrgMembershipMutation) AddedIDs(name string) []ent.Value
- func (m *OrgMembershipMutation) CheckAccessForDelete(ctx context.Context) error
- func (m *OrgMembershipMutation) CheckAccessForEdit(ctx context.Context) error
- func (m *OrgMembershipMutation) ClearEdge(name string) error
- func (m *OrgMembershipMutation) ClearField(name string) error
- func (m *OrgMembershipMutation) ClearOrganization()
- func (m *OrgMembershipMutation) ClearedEdges() []string
- func (m *OrgMembershipMutation) ClearedFields() []string
- func (m OrgMembershipMutation) Client() *Client
- func (m *OrgMembershipMutation) CreateTuplesFromCreate(ctx context.Context) error
- func (m *OrgMembershipMutation) CreateTuplesFromDelete(ctx context.Context) error
- func (m *OrgMembershipMutation) CreateTuplesFromUpdate(ctx context.Context) error
- func (m *OrgMembershipMutation) EdgeCleared(name string) bool
- func (m *OrgMembershipMutation) Field(name string) (ent.Value, bool)
- func (m *OrgMembershipMutation) FieldCleared(name string) bool
- func (m *OrgMembershipMutation) Fields() []string
- func (m *OrgMembershipMutation) ID() (id string, exists bool)
- func (m *OrgMembershipMutation) IDs(ctx context.Context) ([]string, error)
- func (m *OrgMembershipMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *OrgMembershipMutation) OldOrganizationID(ctx context.Context) (v string, err error)
- func (m *OrgMembershipMutation) OldRole(ctx context.Context) (v enums.Role, err error)
- func (m *OrgMembershipMutation) OldUserID(ctx context.Context) (v string, err error)
- func (m *OrgMembershipMutation) Op() Op
- func (m *OrgMembershipMutation) OrganizationCleared() bool
- func (m *OrgMembershipMutation) OrganizationID() (r string, exists bool)
- func (m *OrgMembershipMutation) OrganizationIDs() (ids []string)
- func (m *OrgMembershipMutation) RemovedEdges() []string
- func (m *OrgMembershipMutation) RemovedIDs(name string) []ent.Value
- func (m *OrgMembershipMutation) ResetEdge(name string) error
- func (m *OrgMembershipMutation) ResetField(name string) error
- func (m *OrgMembershipMutation) ResetOrganization()
- func (m *OrgMembershipMutation) ResetOrganizationID()
- func (m *OrgMembershipMutation) ResetRole()
- func (m *OrgMembershipMutation) ResetUserID()
- func (m *OrgMembershipMutation) Role() (r enums.Role, exists bool)
- func (m *OrgMembershipMutation) SetField(name string, value ent.Value) error
- func (m *OrgMembershipMutation) SetID(id string)
- func (m *OrgMembershipMutation) SetOp(op Op)
- func (m *OrgMembershipMutation) SetOrganizationID(s string)
- func (m *OrgMembershipMutation) SetRole(e enums.Role)
- func (m *OrgMembershipMutation) SetUserID(s string)
- func (m OrgMembershipMutation) Tx() (*Tx, error)
- func (m *OrgMembershipMutation) Type() string
- func (m *OrgMembershipMutation) UserID() (r string, exists bool)
- func (m *OrgMembershipMutation) Where(ps ...predicate.OrgMembership)
- func (m *OrgMembershipMutation) WhereP(ps ...func(*sql.Selector))
- type OrgMembershipOrder
- type OrgMembershipOrderField
- type OrgMembershipPaginateOption
- type OrgMembershipQuery
- func (omq *OrgMembershipQuery) Aggregate(fns ...AggregateFunc) *OrgMembershipSelect
- func (omq *OrgMembershipQuery) All(ctx context.Context) ([]*OrgMembership, error)
- func (omq *OrgMembershipQuery) AllX(ctx context.Context) []*OrgMembership
- func (q *OrgMembershipQuery) CheckAccess(ctx context.Context) error
- func (omq *OrgMembershipQuery) Clone() *OrgMembershipQuery
- func (om *OrgMembershipQuery) CollectFields(ctx context.Context, satisfies ...string) (*OrgMembershipQuery, error)
- func (omq *OrgMembershipQuery) Count(ctx context.Context) (int, error)
- func (omq *OrgMembershipQuery) CountX(ctx context.Context) int
- func (omq *OrgMembershipQuery) Exist(ctx context.Context) (bool, error)
- func (omq *OrgMembershipQuery) ExistX(ctx context.Context) bool
- func (omq *OrgMembershipQuery) First(ctx context.Context) (*OrgMembership, error)
- func (omq *OrgMembershipQuery) FirstID(ctx context.Context) (id string, err error)
- func (omq *OrgMembershipQuery) FirstIDX(ctx context.Context) string
- func (omq *OrgMembershipQuery) FirstX(ctx context.Context) *OrgMembership
- func (omq *OrgMembershipQuery) GroupBy(field string, fields ...string) *OrgMembershipGroupBy
- func (omq *OrgMembershipQuery) IDs(ctx context.Context) (ids []string, err error)
- func (omq *OrgMembershipQuery) IDsX(ctx context.Context) []string
- func (omq *OrgMembershipQuery) Limit(limit int) *OrgMembershipQuery
- func (omq *OrgMembershipQuery) Offset(offset int) *OrgMembershipQuery
- func (omq *OrgMembershipQuery) Only(ctx context.Context) (*OrgMembership, error)
- func (omq *OrgMembershipQuery) OnlyID(ctx context.Context) (id string, err error)
- func (omq *OrgMembershipQuery) OnlyIDX(ctx context.Context) string
- func (omq *OrgMembershipQuery) OnlyX(ctx context.Context) *OrgMembership
- func (omq *OrgMembershipQuery) Order(o ...orgmembership.OrderOption) *OrgMembershipQuery
- func (om *OrgMembershipQuery) Paginate(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*OrgMembershipConnection, error)
- func (omq *OrgMembershipQuery) QueryOrganization() *OrganizationQuery
- func (omq *OrgMembershipQuery) Select(fields ...string) *OrgMembershipSelect
- func (omq *OrgMembershipQuery) Unique(unique bool) *OrgMembershipQuery
- func (omq *OrgMembershipQuery) Where(ps ...predicate.OrgMembership) *OrgMembershipQuery
- func (omq *OrgMembershipQuery) WithOrganization(opts ...func(*OrganizationQuery)) *OrgMembershipQuery
- type OrgMembershipSelect
- func (oms *OrgMembershipSelect) Aggregate(fns ...AggregateFunc) *OrgMembershipSelect
- func (s *OrgMembershipSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *OrgMembershipSelect) BoolX(ctx context.Context) bool
- func (s *OrgMembershipSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *OrgMembershipSelect) BoolsX(ctx context.Context) []bool
- func (s *OrgMembershipSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *OrgMembershipSelect) Float64X(ctx context.Context) float64
- func (s *OrgMembershipSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *OrgMembershipSelect) Float64sX(ctx context.Context) []float64
- func (s *OrgMembershipSelect) Int(ctx context.Context) (_ int, err error)
- func (s *OrgMembershipSelect) IntX(ctx context.Context) int
- func (s *OrgMembershipSelect) Ints(ctx context.Context) ([]int, error)
- func (s *OrgMembershipSelect) IntsX(ctx context.Context) []int
- func (oms *OrgMembershipSelect) Scan(ctx context.Context, v any) error
- func (s *OrgMembershipSelect) ScanX(ctx context.Context, v any)
- func (s *OrgMembershipSelect) String(ctx context.Context) (_ string, err error)
- func (s *OrgMembershipSelect) StringX(ctx context.Context) string
- func (s *OrgMembershipSelect) Strings(ctx context.Context) ([]string, error)
- func (s *OrgMembershipSelect) StringsX(ctx context.Context) []string
- type OrgMembershipUpdate
- func (omu *OrgMembershipUpdate) Exec(ctx context.Context) error
- func (omu *OrgMembershipUpdate) ExecX(ctx context.Context)
- func (omu *OrgMembershipUpdate) Mutation() *OrgMembershipMutation
- func (omu *OrgMembershipUpdate) Save(ctx context.Context) (int, error)
- func (omu *OrgMembershipUpdate) SaveX(ctx context.Context) int
- func (c *OrgMembershipUpdate) SetInput(i UpdateOrgMembershipInput) *OrgMembershipUpdate
- func (omu *OrgMembershipUpdate) SetNillableRole(e *enums.Role) *OrgMembershipUpdate
- func (omu *OrgMembershipUpdate) SetRole(e enums.Role) *OrgMembershipUpdate
- func (omu *OrgMembershipUpdate) Where(ps ...predicate.OrgMembership) *OrgMembershipUpdate
- type OrgMembershipUpdateOne
- func (omuo *OrgMembershipUpdateOne) Exec(ctx context.Context) error
- func (omuo *OrgMembershipUpdateOne) ExecX(ctx context.Context)
- func (omuo *OrgMembershipUpdateOne) Mutation() *OrgMembershipMutation
- func (omuo *OrgMembershipUpdateOne) Save(ctx context.Context) (*OrgMembership, error)
- func (omuo *OrgMembershipUpdateOne) SaveX(ctx context.Context) *OrgMembership
- func (omuo *OrgMembershipUpdateOne) Select(field string, fields ...string) *OrgMembershipUpdateOne
- func (c *OrgMembershipUpdateOne) SetInput(i UpdateOrgMembershipInput) *OrgMembershipUpdateOne
- func (omuo *OrgMembershipUpdateOne) SetNillableRole(e *enums.Role) *OrgMembershipUpdateOne
- func (omuo *OrgMembershipUpdateOne) SetRole(e enums.Role) *OrgMembershipUpdateOne
- func (omuo *OrgMembershipUpdateOne) Where(ps ...predicate.OrgMembership) *OrgMembershipUpdateOne
- type OrgMembershipWhereInput
- type OrgMemberships
- type Organization
- func (*Organization) IsNode()
- func (o *Organization) String() string
- func (o *Organization) ToEdge(order *OrganizationOrder) *OrganizationEdge
- func (o *Organization) Unwrap() *Organization
- func (o *Organization) Update() *OrganizationUpdateOne
- func (o *Organization) Value(name string) (ent.Value, error)
- type OrganizationClient
- func (c *OrganizationClient) Create() *OrganizationCreate
- func (c *OrganizationClient) CreateBulk(builders ...*OrganizationCreate) *OrganizationCreateBulk
- func (c *OrganizationClient) Delete() *OrganizationDelete
- func (c *OrganizationClient) DeleteOne(o *Organization) *OrganizationDeleteOne
- func (c *OrganizationClient) DeleteOneID(id string) *OrganizationDeleteOne
- func (c *OrganizationClient) Get(ctx context.Context, id string) (*Organization, error)
- func (c *OrganizationClient) GetX(ctx context.Context, id string) *Organization
- func (c *OrganizationClient) Hooks() []Hook
- func (c *OrganizationClient) Intercept(interceptors ...Interceptor)
- func (c *OrganizationClient) Interceptors() []Interceptor
- func (c *OrganizationClient) MapCreateBulk(slice any, setFunc func(*OrganizationCreate, int)) *OrganizationCreateBulk
- func (c *OrganizationClient) Query() *OrganizationQuery
- func (c *OrganizationClient) Update() *OrganizationUpdate
- func (c *OrganizationClient) UpdateOne(o *Organization) *OrganizationUpdateOne
- func (c *OrganizationClient) UpdateOneID(id string) *OrganizationUpdateOne
- func (c *OrganizationClient) Use(hooks ...Hook)
- type OrganizationConnection
- type OrganizationCreate
- func (oc *OrganizationCreate) Exec(ctx context.Context) error
- func (oc *OrganizationCreate) ExecX(ctx context.Context)
- func (oc *OrganizationCreate) Mutation() *OrganizationMutation
- func (oc *OrganizationCreate) Save(ctx context.Context) (*Organization, error)
- func (oc *OrganizationCreate) SaveX(ctx context.Context) *Organization
- func (oc *OrganizationCreate) SetDescription(s string) *OrganizationCreate
- func (oc *OrganizationCreate) SetID(s string) *OrganizationCreate
- func (c *OrganizationCreate) SetInput(i CreateOrganizationInput) *OrganizationCreate
- func (oc *OrganizationCreate) SetName(s string) *OrganizationCreate
- func (oc *OrganizationCreate) SetNillableDescription(s *string) *OrganizationCreate
- type OrganizationCreateBulk
- type OrganizationDelete
- type OrganizationDeleteOne
- type OrganizationEdge
- type OrganizationGroupBy
- func (ogb *OrganizationGroupBy) Aggregate(fns ...AggregateFunc) *OrganizationGroupBy
- func (s *OrganizationGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *OrganizationGroupBy) BoolX(ctx context.Context) bool
- func (s *OrganizationGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *OrganizationGroupBy) BoolsX(ctx context.Context) []bool
- func (s *OrganizationGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *OrganizationGroupBy) Float64X(ctx context.Context) float64
- func (s *OrganizationGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *OrganizationGroupBy) Float64sX(ctx context.Context) []float64
- func (s *OrganizationGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *OrganizationGroupBy) IntX(ctx context.Context) int
- func (s *OrganizationGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *OrganizationGroupBy) IntsX(ctx context.Context) []int
- func (ogb *OrganizationGroupBy) Scan(ctx context.Context, v any) error
- func (s *OrganizationGroupBy) ScanX(ctx context.Context, v any)
- func (s *OrganizationGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *OrganizationGroupBy) StringX(ctx context.Context) string
- func (s *OrganizationGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *OrganizationGroupBy) StringsX(ctx context.Context) []string
- type OrganizationMutation
- func (m *OrganizationMutation) AddField(name string, value ent.Value) error
- func (m *OrganizationMutation) AddedEdges() []string
- func (m *OrganizationMutation) AddedField(name string) (ent.Value, bool)
- func (m *OrganizationMutation) AddedFields() []string
- func (m *OrganizationMutation) AddedIDs(name string) []ent.Value
- func (m *OrganizationMutation) CheckAccessForDelete(ctx context.Context) error
- func (m *OrganizationMutation) CheckAccessForEdit(ctx context.Context) error
- func (m *OrganizationMutation) ClearDescription()
- func (m *OrganizationMutation) ClearEdge(name string) error
- func (m *OrganizationMutation) ClearField(name string) error
- func (m *OrganizationMutation) ClearedEdges() []string
- func (m *OrganizationMutation) ClearedFields() []string
- func (m OrganizationMutation) Client() *Client
- func (m *OrganizationMutation) Description() (r string, exists bool)
- func (m *OrganizationMutation) DescriptionCleared() bool
- func (m *OrganizationMutation) EdgeCleared(name string) bool
- func (m *OrganizationMutation) Field(name string) (ent.Value, bool)
- func (m *OrganizationMutation) FieldCleared(name string) bool
- func (m *OrganizationMutation) Fields() []string
- func (m *OrganizationMutation) ID() (id string, exists bool)
- func (m *OrganizationMutation) IDs(ctx context.Context) ([]string, error)
- func (m *OrganizationMutation) Name() (r string, exists bool)
- func (m *OrganizationMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *OrganizationMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *OrganizationMutation) OldName(ctx context.Context) (v string, err error)
- func (m *OrganizationMutation) Op() Op
- func (m *OrganizationMutation) RemovedEdges() []string
- func (m *OrganizationMutation) RemovedIDs(name string) []ent.Value
- func (m *OrganizationMutation) ResetDescription()
- func (m *OrganizationMutation) ResetEdge(name string) error
- func (m *OrganizationMutation) ResetField(name string) error
- func (m *OrganizationMutation) ResetName()
- func (m *OrganizationMutation) SetDescription(s string)
- func (m *OrganizationMutation) SetField(name string, value ent.Value) error
- func (m *OrganizationMutation) SetID(id string)
- func (m *OrganizationMutation) SetName(s string)
- func (m *OrganizationMutation) SetOp(op Op)
- func (m OrganizationMutation) Tx() (*Tx, error)
- func (m *OrganizationMutation) Type() string
- func (m *OrganizationMutation) Where(ps ...predicate.Organization)
- func (m *OrganizationMutation) WhereP(ps ...func(*sql.Selector))
- type OrganizationOrder
- type OrganizationOrderField
- type OrganizationPaginateOption
- type OrganizationQuery
- func (oq *OrganizationQuery) Aggregate(fns ...AggregateFunc) *OrganizationSelect
- func (oq *OrganizationQuery) All(ctx context.Context) ([]*Organization, error)
- func (oq *OrganizationQuery) AllX(ctx context.Context) []*Organization
- func (q *OrganizationQuery) CheckAccess(ctx context.Context) error
- func (oq *OrganizationQuery) Clone() *OrganizationQuery
- func (o *OrganizationQuery) CollectFields(ctx context.Context, satisfies ...string) (*OrganizationQuery, error)
- func (oq *OrganizationQuery) Count(ctx context.Context) (int, error)
- func (oq *OrganizationQuery) CountX(ctx context.Context) int
- func (oq *OrganizationQuery) Exist(ctx context.Context) (bool, error)
- func (oq *OrganizationQuery) ExistX(ctx context.Context) bool
- func (oq *OrganizationQuery) First(ctx context.Context) (*Organization, error)
- func (oq *OrganizationQuery) FirstID(ctx context.Context) (id string, err error)
- func (oq *OrganizationQuery) FirstIDX(ctx context.Context) string
- func (oq *OrganizationQuery) FirstX(ctx context.Context) *Organization
- func (oq *OrganizationQuery) GroupBy(field string, fields ...string) *OrganizationGroupBy
- func (oq *OrganizationQuery) IDs(ctx context.Context) (ids []string, err error)
- func (oq *OrganizationQuery) IDsX(ctx context.Context) []string
- func (oq *OrganizationQuery) Limit(limit int) *OrganizationQuery
- func (oq *OrganizationQuery) Offset(offset int) *OrganizationQuery
- func (oq *OrganizationQuery) Only(ctx context.Context) (*Organization, error)
- func (oq *OrganizationQuery) OnlyID(ctx context.Context) (id string, err error)
- func (oq *OrganizationQuery) OnlyIDX(ctx context.Context) string
- func (oq *OrganizationQuery) OnlyX(ctx context.Context) *Organization
- func (oq *OrganizationQuery) Order(o ...organization.OrderOption) *OrganizationQuery
- func (o *OrganizationQuery) Paginate(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*OrganizationConnection, error)
- func (oq *OrganizationQuery) Select(fields ...string) *OrganizationSelect
- func (oq *OrganizationQuery) Unique(unique bool) *OrganizationQuery
- func (oq *OrganizationQuery) Where(ps ...predicate.Organization) *OrganizationQuery
- type OrganizationSelect
- func (os *OrganizationSelect) Aggregate(fns ...AggregateFunc) *OrganizationSelect
- func (s *OrganizationSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *OrganizationSelect) BoolX(ctx context.Context) bool
- func (s *OrganizationSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *OrganizationSelect) BoolsX(ctx context.Context) []bool
- func (s *OrganizationSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *OrganizationSelect) Float64X(ctx context.Context) float64
- func (s *OrganizationSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *OrganizationSelect) Float64sX(ctx context.Context) []float64
- func (s *OrganizationSelect) Int(ctx context.Context) (_ int, err error)
- func (s *OrganizationSelect) IntX(ctx context.Context) int
- func (s *OrganizationSelect) Ints(ctx context.Context) ([]int, error)
- func (s *OrganizationSelect) IntsX(ctx context.Context) []int
- func (os *OrganizationSelect) Scan(ctx context.Context, v any) error
- func (s *OrganizationSelect) ScanX(ctx context.Context, v any)
- func (s *OrganizationSelect) String(ctx context.Context) (_ string, err error)
- func (s *OrganizationSelect) StringX(ctx context.Context) string
- func (s *OrganizationSelect) Strings(ctx context.Context) ([]string, error)
- func (s *OrganizationSelect) StringsX(ctx context.Context) []string
- type OrganizationUpdate
- func (ou *OrganizationUpdate) ClearDescription() *OrganizationUpdate
- func (ou *OrganizationUpdate) Exec(ctx context.Context) error
- func (ou *OrganizationUpdate) ExecX(ctx context.Context)
- func (ou *OrganizationUpdate) Mutation() *OrganizationMutation
- func (ou *OrganizationUpdate) Save(ctx context.Context) (int, error)
- func (ou *OrganizationUpdate) SaveX(ctx context.Context) int
- func (ou *OrganizationUpdate) SetDescription(s string) *OrganizationUpdate
- func (c *OrganizationUpdate) SetInput(i UpdateOrganizationInput) *OrganizationUpdate
- func (ou *OrganizationUpdate) SetName(s string) *OrganizationUpdate
- func (ou *OrganizationUpdate) SetNillableDescription(s *string) *OrganizationUpdate
- func (ou *OrganizationUpdate) SetNillableName(s *string) *OrganizationUpdate
- func (ou *OrganizationUpdate) Where(ps ...predicate.Organization) *OrganizationUpdate
- type OrganizationUpdateOne
- func (ouo *OrganizationUpdateOne) ClearDescription() *OrganizationUpdateOne
- func (ouo *OrganizationUpdateOne) Exec(ctx context.Context) error
- func (ouo *OrganizationUpdateOne) ExecX(ctx context.Context)
- func (ouo *OrganizationUpdateOne) Mutation() *OrganizationMutation
- func (ouo *OrganizationUpdateOne) Save(ctx context.Context) (*Organization, error)
- func (ouo *OrganizationUpdateOne) SaveX(ctx context.Context) *Organization
- func (ouo *OrganizationUpdateOne) Select(field string, fields ...string) *OrganizationUpdateOne
- func (ouo *OrganizationUpdateOne) SetDescription(s string) *OrganizationUpdateOne
- func (c *OrganizationUpdateOne) SetInput(i UpdateOrganizationInput) *OrganizationUpdateOne
- func (ouo *OrganizationUpdateOne) SetName(s string) *OrganizationUpdateOne
- func (ouo *OrganizationUpdateOne) SetNillableDescription(s *string) *OrganizationUpdateOne
- func (ouo *OrganizationUpdateOne) SetNillableName(s *string) *OrganizationUpdateOne
- func (ouo *OrganizationUpdateOne) Where(ps ...predicate.Organization) *OrganizationUpdateOne
- type OrganizationWhereInput
- type Organizations
- type PageInfo
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type TraverseFunc
- type Traverser
- type Tx
- type UpdateOrgMembershipInput
- type UpdateOrganizationInput
- 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. TypeOrgMembership = "OrgMembership" TypeOrganization = "Organization" )
Variables ¶
var DefaultOrgMembershipOrder = &OrgMembershipOrder{ Direction: entgql.OrderDirectionAsc, Field: &OrgMembershipOrderField{ Value: func(om *OrgMembership) (ent.Value, error) { return om.ID, nil }, column: orgmembership.FieldID, toTerm: orgmembership.ByID, toCursor: func(om *OrgMembership) Cursor { return Cursor{ID: om.ID} }, }, }
DefaultOrgMembershipOrder is the default ordering of OrgMembership.
var DefaultOrganizationOrder = &OrganizationOrder{ Direction: entgql.OrderDirectionAsc, Field: &OrganizationOrderField{ Value: func(o *Organization) (ent.Value, error) { return o.ID, nil }, column: organization.FieldID, toTerm: organization.ByID, toCursor: func(o *Organization) Cursor { return Cursor{ID: o.ID} }, }, }
DefaultOrganizationOrder is the default ordering of Organization.
var ErrEmptyOrgMembershipWhereInput = errors.New("ent: empty predicate OrgMembershipWhereInput")
ErrEmptyOrgMembershipWhereInput is returned in case the OrgMembershipWhereInput is empty.
var ErrEmptyOrganizationWhereInput = errors.New("ent: empty predicate OrganizationWhereInput")
ErrEmptyOrganizationWhereInput is returned in case the OrganizationWhereInput is empty.
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
func NewTxContext ¶
NewTxContext returns a new context with the given Tx attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(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 // OrgMembership is the client for interacting with the OrgMembership builders. OrgMembership *OrgMembershipClient // Organization is the client for interacting with the Organization builders. Organization *OrganizationClient // 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(). OrgMembership. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
func (*Client) Noder ¶
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.
func (*Client) Tx ¶
Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.
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 CreateOrgMembershipInput ¶
CreateOrgMembershipInput represents a mutation input for creating orgmemberships.
func (*CreateOrgMembershipInput) Mutate ¶
func (i *CreateOrgMembershipInput) Mutate(m *OrgMembershipMutation)
Mutate applies the CreateOrgMembershipInput on the OrgMembershipMutation builder.
type CreateOrganizationInput ¶
CreateOrganizationInput represents a mutation input for creating organizations.
func (*CreateOrganizationInput) Mutate ¶
func (i *CreateOrganizationInput) Mutate(m *OrganizationMutation)
Mutate applies the CreateOrganizationInput on the OrganizationMutation builder.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NodeOption ¶
type NodeOption func(*nodeOptions)
NodeOption allows configuring the Noder execution using functional options.
func WithFixedNodeType ¶
func WithFixedNodeType(t string) NodeOption
WithFixedNodeType sets the Type of the node to a fixed value.
func WithNodeType ¶
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 OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type OrgMembership ¶
type OrgMembership struct { // ID of the ent. ID string `json:"id,omitempty"` // Role holds the value of the "role" field. Role enums.Role `json:"role,omitempty"` // OrganizationID holds the value of the "organization_id" field. OrganizationID string `json:"organization_id,omitempty"` // UserID holds the value of the "user_id" field. UserID string `json:"user_id,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the OrgMembershipQuery when eager-loading is set. Edges OrgMembershipEdges `json:"edges"` // contains filtered or unexported fields }
OrgMembership is the model entity for the OrgMembership schema.
func (*OrgMembership) IsNode ¶
func (*OrgMembership) IsNode()
IsNode implements the Node interface check for GQLGen.
func (*OrgMembership) Organization ¶
func (om *OrgMembership) Organization(ctx context.Context) (*Organization, error)
func (*OrgMembership) QueryOrganization ¶
func (om *OrgMembership) QueryOrganization() *OrganizationQuery
QueryOrganization queries the "organization" edge of the OrgMembership entity.
func (*OrgMembership) String ¶
func (om *OrgMembership) String() string
String implements the fmt.Stringer.
func (*OrgMembership) ToEdge ¶
func (om *OrgMembership) ToEdge(order *OrgMembershipOrder) *OrgMembershipEdge
ToEdge converts OrgMembership into OrgMembershipEdge.
func (*OrgMembership) Unwrap ¶
func (om *OrgMembership) Unwrap() *OrgMembership
Unwrap unwraps the OrgMembership 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 (*OrgMembership) Update ¶
func (om *OrgMembership) Update() *OrgMembershipUpdateOne
Update returns a builder for updating this OrgMembership. Note that you need to call OrgMembership.Unwrap() before calling this method if this OrgMembership was returned from a transaction, and the transaction was committed or rolled back.
type OrgMembershipClient ¶
type OrgMembershipClient struct {
// contains filtered or unexported fields
}
OrgMembershipClient is a client for the OrgMembership schema.
func NewOrgMembershipClient ¶
func NewOrgMembershipClient(c config) *OrgMembershipClient
NewOrgMembershipClient returns a client for the OrgMembership from the given config.
func (*OrgMembershipClient) Create ¶
func (c *OrgMembershipClient) Create() *OrgMembershipCreate
Create returns a builder for creating a OrgMembership entity.
func (*OrgMembershipClient) CreateBulk ¶
func (c *OrgMembershipClient) CreateBulk(builders ...*OrgMembershipCreate) *OrgMembershipCreateBulk
CreateBulk returns a builder for creating a bulk of OrgMembership entities.
func (*OrgMembershipClient) Delete ¶
func (c *OrgMembershipClient) Delete() *OrgMembershipDelete
Delete returns a delete builder for OrgMembership.
func (*OrgMembershipClient) DeleteOne ¶
func (c *OrgMembershipClient) DeleteOne(om *OrgMembership) *OrgMembershipDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*OrgMembershipClient) DeleteOneID ¶
func (c *OrgMembershipClient) DeleteOneID(id string) *OrgMembershipDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*OrgMembershipClient) Get ¶
func (c *OrgMembershipClient) Get(ctx context.Context, id string) (*OrgMembership, error)
Get returns a OrgMembership entity by its id.
func (*OrgMembershipClient) GetX ¶
func (c *OrgMembershipClient) GetX(ctx context.Context, id string) *OrgMembership
GetX is like Get, but panics if an error occurs.
func (*OrgMembershipClient) Hooks ¶
func (c *OrgMembershipClient) Hooks() []Hook
Hooks returns the client hooks.
func (*OrgMembershipClient) Intercept ¶
func (c *OrgMembershipClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `orgmembership.Intercept(f(g(h())))`.
func (*OrgMembershipClient) Interceptors ¶
func (c *OrgMembershipClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*OrgMembershipClient) MapCreateBulk ¶
func (c *OrgMembershipClient) MapCreateBulk(slice any, setFunc func(*OrgMembershipCreate, int)) *OrgMembershipCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*OrgMembershipClient) Query ¶
func (c *OrgMembershipClient) Query() *OrgMembershipQuery
Query returns a query builder for OrgMembership.
func (*OrgMembershipClient) QueryOrganization ¶
func (c *OrgMembershipClient) QueryOrganization(om *OrgMembership) *OrganizationQuery
QueryOrganization queries the organization edge of a OrgMembership.
func (*OrgMembershipClient) Update ¶
func (c *OrgMembershipClient) Update() *OrgMembershipUpdate
Update returns an update builder for OrgMembership.
func (*OrgMembershipClient) UpdateOne ¶
func (c *OrgMembershipClient) UpdateOne(om *OrgMembership) *OrgMembershipUpdateOne
UpdateOne returns an update builder for the given entity.
func (*OrgMembershipClient) UpdateOneID ¶
func (c *OrgMembershipClient) UpdateOneID(id string) *OrgMembershipUpdateOne
UpdateOneID returns an update builder for the given id.
func (*OrgMembershipClient) Use ¶
func (c *OrgMembershipClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `orgmembership.Hooks(f(g(h())))`.
type OrgMembershipConnection ¶
type OrgMembershipConnection struct { Edges []*OrgMembershipEdge `json:"edges"` PageInfo PageInfo `json:"pageInfo"` TotalCount int `json:"totalCount"` }
OrgMembershipConnection is the connection containing edges to OrgMembership.
type OrgMembershipCreate ¶
type OrgMembershipCreate struct {
// contains filtered or unexported fields
}
OrgMembershipCreate is the builder for creating a OrgMembership entity.
func (*OrgMembershipCreate) Exec ¶
func (omc *OrgMembershipCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*OrgMembershipCreate) ExecX ¶
func (omc *OrgMembershipCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrgMembershipCreate) Mutation ¶
func (omc *OrgMembershipCreate) Mutation() *OrgMembershipMutation
Mutation returns the OrgMembershipMutation object of the builder.
func (*OrgMembershipCreate) Save ¶
func (omc *OrgMembershipCreate) Save(ctx context.Context) (*OrgMembership, error)
Save creates the OrgMembership in the database.
func (*OrgMembershipCreate) SaveX ¶
func (omc *OrgMembershipCreate) SaveX(ctx context.Context) *OrgMembership
SaveX calls Save and panics if Save returns an error.
func (*OrgMembershipCreate) SetID ¶
func (omc *OrgMembershipCreate) SetID(s string) *OrgMembershipCreate
SetID sets the "id" field.
func (*OrgMembershipCreate) SetInput ¶
func (c *OrgMembershipCreate) SetInput(i CreateOrgMembershipInput) *OrgMembershipCreate
SetInput applies the change-set in the CreateOrgMembershipInput on the OrgMembershipCreate builder.
func (*OrgMembershipCreate) SetNillableRole ¶
func (omc *OrgMembershipCreate) SetNillableRole(e *enums.Role) *OrgMembershipCreate
SetNillableRole sets the "role" field if the given value is not nil.
func (*OrgMembershipCreate) SetOrganization ¶
func (omc *OrgMembershipCreate) SetOrganization(o *Organization) *OrgMembershipCreate
SetOrganization sets the "organization" edge to the Organization entity.
func (*OrgMembershipCreate) SetOrganizationID ¶
func (omc *OrgMembershipCreate) SetOrganizationID(s string) *OrgMembershipCreate
SetOrganizationID sets the "organization_id" field.
func (*OrgMembershipCreate) SetRole ¶
func (omc *OrgMembershipCreate) SetRole(e enums.Role) *OrgMembershipCreate
SetRole sets the "role" field.
func (*OrgMembershipCreate) SetUserID ¶
func (omc *OrgMembershipCreate) SetUserID(s string) *OrgMembershipCreate
SetUserID sets the "user_id" field.
type OrgMembershipCreateBulk ¶
type OrgMembershipCreateBulk struct {
// contains filtered or unexported fields
}
OrgMembershipCreateBulk is the builder for creating many OrgMembership entities in bulk.
func (*OrgMembershipCreateBulk) Exec ¶
func (omcb *OrgMembershipCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*OrgMembershipCreateBulk) ExecX ¶
func (omcb *OrgMembershipCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrgMembershipCreateBulk) Save ¶
func (omcb *OrgMembershipCreateBulk) Save(ctx context.Context) ([]*OrgMembership, error)
Save creates the OrgMembership entities in the database.
func (*OrgMembershipCreateBulk) SaveX ¶
func (omcb *OrgMembershipCreateBulk) SaveX(ctx context.Context) []*OrgMembership
SaveX is like Save, but panics if an error occurs.
type OrgMembershipDelete ¶
type OrgMembershipDelete struct {
// contains filtered or unexported fields
}
OrgMembershipDelete is the builder for deleting a OrgMembership entity.
func (*OrgMembershipDelete) Exec ¶
func (omd *OrgMembershipDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*OrgMembershipDelete) ExecX ¶
func (omd *OrgMembershipDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*OrgMembershipDelete) Where ¶
func (omd *OrgMembershipDelete) Where(ps ...predicate.OrgMembership) *OrgMembershipDelete
Where appends a list predicates to the OrgMembershipDelete builder.
type OrgMembershipDeleteOne ¶
type OrgMembershipDeleteOne struct {
// contains filtered or unexported fields
}
OrgMembershipDeleteOne is the builder for deleting a single OrgMembership entity.
func (*OrgMembershipDeleteOne) Exec ¶
func (omdo *OrgMembershipDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*OrgMembershipDeleteOne) ExecX ¶
func (omdo *OrgMembershipDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrgMembershipDeleteOne) Where ¶
func (omdo *OrgMembershipDeleteOne) Where(ps ...predicate.OrgMembership) *OrgMembershipDeleteOne
Where appends a list predicates to the OrgMembershipDelete builder.
type OrgMembershipEdge ¶
type OrgMembershipEdge struct { Node *OrgMembership `json:"node"` Cursor Cursor `json:"cursor"` }
OrgMembershipEdge is the edge representation of OrgMembership.
type OrgMembershipEdges ¶
type OrgMembershipEdges struct { // Organization holds the value of the organization edge. Organization *Organization `json:"organization,omitempty"` // contains filtered or unexported fields }
OrgMembershipEdges holds the relations/edges for other nodes in the graph.
func (OrgMembershipEdges) OrganizationOrErr ¶
func (e OrgMembershipEdges) OrganizationOrErr() (*Organization, error)
OrganizationOrErr returns the Organization value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type OrgMembershipGroupBy ¶
type OrgMembershipGroupBy struct {
// contains filtered or unexported fields
}
OrgMembershipGroupBy is the group-by builder for OrgMembership entities.
func (*OrgMembershipGroupBy) Aggregate ¶
func (omgb *OrgMembershipGroupBy) Aggregate(fns ...AggregateFunc) *OrgMembershipGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*OrgMembershipGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*OrgMembershipGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*OrgMembershipGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*OrgMembershipGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*OrgMembershipGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*OrgMembershipGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*OrgMembershipGroupBy) Scan ¶
func (omgb *OrgMembershipGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*OrgMembershipGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type OrgMembershipMutation ¶
type OrgMembershipMutation struct {
// contains filtered or unexported fields
}
OrgMembershipMutation represents an operation that mutates the OrgMembership nodes in the graph.
func (*OrgMembershipMutation) AddField ¶
func (m *OrgMembershipMutation) 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 (*OrgMembershipMutation) AddedEdges ¶
func (m *OrgMembershipMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*OrgMembershipMutation) AddedField ¶
func (m *OrgMembershipMutation) 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 (*OrgMembershipMutation) AddedFields ¶
func (m *OrgMembershipMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*OrgMembershipMutation) AddedIDs ¶
func (m *OrgMembershipMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*OrgMembershipMutation) CheckAccessForDelete ¶
func (m *OrgMembershipMutation) CheckAccessForDelete(ctx context.Context) error
func (*OrgMembershipMutation) CheckAccessForEdit ¶
func (m *OrgMembershipMutation) CheckAccessForEdit(ctx context.Context) error
func (*OrgMembershipMutation) ClearEdge ¶
func (m *OrgMembershipMutation) 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 (*OrgMembershipMutation) ClearField ¶
func (m *OrgMembershipMutation) 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 (*OrgMembershipMutation) ClearOrganization ¶
func (m *OrgMembershipMutation) ClearOrganization()
ClearOrganization clears the "organization" edge to the Organization entity.
func (*OrgMembershipMutation) ClearedEdges ¶
func (m *OrgMembershipMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*OrgMembershipMutation) ClearedFields ¶
func (m *OrgMembershipMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (OrgMembershipMutation) Client ¶
func (m OrgMembershipMutation) 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 (*OrgMembershipMutation) CreateTuplesFromCreate ¶
func (m *OrgMembershipMutation) CreateTuplesFromCreate(ctx context.Context) error
func (*OrgMembershipMutation) CreateTuplesFromDelete ¶
func (m *OrgMembershipMutation) CreateTuplesFromDelete(ctx context.Context) error
func (*OrgMembershipMutation) CreateTuplesFromUpdate ¶
func (m *OrgMembershipMutation) CreateTuplesFromUpdate(ctx context.Context) error
func (*OrgMembershipMutation) EdgeCleared ¶
func (m *OrgMembershipMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*OrgMembershipMutation) Field ¶
func (m *OrgMembershipMutation) 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 (*OrgMembershipMutation) FieldCleared ¶
func (m *OrgMembershipMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*OrgMembershipMutation) Fields ¶
func (m *OrgMembershipMutation) 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 (*OrgMembershipMutation) ID ¶
func (m *OrgMembershipMutation) ID() (id string, 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 (*OrgMembershipMutation) IDs ¶
func (m *OrgMembershipMutation) IDs(ctx context.Context) ([]string, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*OrgMembershipMutation) 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 (*OrgMembershipMutation) OldOrganizationID ¶
func (m *OrgMembershipMutation) OldOrganizationID(ctx context.Context) (v string, err error)
OldOrganizationID returns the old "organization_id" field's value of the OrgMembership entity. If the OrgMembership 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 (*OrgMembershipMutation) OldRole ¶
OldRole returns the old "role" field's value of the OrgMembership entity. If the OrgMembership 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 (*OrgMembershipMutation) OldUserID ¶
func (m *OrgMembershipMutation) OldUserID(ctx context.Context) (v string, err error)
OldUserID returns the old "user_id" field's value of the OrgMembership entity. If the OrgMembership 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 (*OrgMembershipMutation) Op ¶
func (m *OrgMembershipMutation) Op() Op
Op returns the operation name.
func (*OrgMembershipMutation) OrganizationCleared ¶
func (m *OrgMembershipMutation) OrganizationCleared() bool
OrganizationCleared reports if the "organization" edge to the Organization entity was cleared.
func (*OrgMembershipMutation) OrganizationID ¶
func (m *OrgMembershipMutation) OrganizationID() (r string, exists bool)
OrganizationID returns the value of the "organization_id" field in the mutation.
func (*OrgMembershipMutation) OrganizationIDs ¶
func (m *OrgMembershipMutation) OrganizationIDs() (ids []string)
OrganizationIDs returns the "organization" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OrganizationID instead. It exists only for internal usage by the builders.
func (*OrgMembershipMutation) RemovedEdges ¶
func (m *OrgMembershipMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*OrgMembershipMutation) RemovedIDs ¶
func (m *OrgMembershipMutation) 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 (*OrgMembershipMutation) ResetEdge ¶
func (m *OrgMembershipMutation) 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 (*OrgMembershipMutation) ResetField ¶
func (m *OrgMembershipMutation) 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 (*OrgMembershipMutation) ResetOrganization ¶
func (m *OrgMembershipMutation) ResetOrganization()
ResetOrganization resets all changes to the "organization" edge.
func (*OrgMembershipMutation) ResetOrganizationID ¶
func (m *OrgMembershipMutation) ResetOrganizationID()
ResetOrganizationID resets all changes to the "organization_id" field.
func (*OrgMembershipMutation) ResetRole ¶
func (m *OrgMembershipMutation) ResetRole()
ResetRole resets all changes to the "role" field.
func (*OrgMembershipMutation) ResetUserID ¶
func (m *OrgMembershipMutation) ResetUserID()
ResetUserID resets all changes to the "user_id" field.
func (*OrgMembershipMutation) Role ¶
func (m *OrgMembershipMutation) Role() (r enums.Role, exists bool)
Role returns the value of the "role" field in the mutation.
func (*OrgMembershipMutation) SetField ¶
func (m *OrgMembershipMutation) 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 (*OrgMembershipMutation) SetID ¶
func (m *OrgMembershipMutation) SetID(id string)
SetID sets the value of the id field. Note that this operation is only accepted on creation of OrgMembership entities.
func (*OrgMembershipMutation) SetOp ¶
func (m *OrgMembershipMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*OrgMembershipMutation) SetOrganizationID ¶
func (m *OrgMembershipMutation) SetOrganizationID(s string)
SetOrganizationID sets the "organization_id" field.
func (*OrgMembershipMutation) SetRole ¶
func (m *OrgMembershipMutation) SetRole(e enums.Role)
SetRole sets the "role" field.
func (*OrgMembershipMutation) SetUserID ¶
func (m *OrgMembershipMutation) SetUserID(s string)
SetUserID sets the "user_id" field.
func (OrgMembershipMutation) Tx ¶
func (m OrgMembershipMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*OrgMembershipMutation) Type ¶
func (m *OrgMembershipMutation) Type() string
Type returns the node type of this mutation (OrgMembership).
func (*OrgMembershipMutation) UserID ¶
func (m *OrgMembershipMutation) UserID() (r string, exists bool)
UserID returns the value of the "user_id" field in the mutation.
func (*OrgMembershipMutation) Where ¶
func (m *OrgMembershipMutation) Where(ps ...predicate.OrgMembership)
Where appends a list predicates to the OrgMembershipMutation builder.
func (*OrgMembershipMutation) WhereP ¶
func (m *OrgMembershipMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the OrgMembershipMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type OrgMembershipOrder ¶
type OrgMembershipOrder struct { Direction OrderDirection `json:"direction"` Field *OrgMembershipOrderField `json:"field"` }
OrgMembershipOrder defines the ordering of OrgMembership.
type OrgMembershipOrderField ¶
type OrgMembershipOrderField struct { // Value extracts the ordering value from the given OrgMembership. Value func(*OrgMembership) (ent.Value, error) // contains filtered or unexported fields }
OrgMembershipOrderField defines the ordering field of OrgMembership.
type OrgMembershipPaginateOption ¶
type OrgMembershipPaginateOption func(*orgmembershipPager) error
OrgMembershipPaginateOption enables pagination customization.
func WithOrgMembershipFilter ¶
func WithOrgMembershipFilter(filter func(*OrgMembershipQuery) (*OrgMembershipQuery, error)) OrgMembershipPaginateOption
WithOrgMembershipFilter configures pagination filter.
func WithOrgMembershipOrder ¶
func WithOrgMembershipOrder(order *OrgMembershipOrder) OrgMembershipPaginateOption
WithOrgMembershipOrder configures pagination ordering.
type OrgMembershipQuery ¶
type OrgMembershipQuery struct {
// contains filtered or unexported fields
}
OrgMembershipQuery is the builder for querying OrgMembership entities.
func (*OrgMembershipQuery) Aggregate ¶
func (omq *OrgMembershipQuery) Aggregate(fns ...AggregateFunc) *OrgMembershipSelect
Aggregate returns a OrgMembershipSelect configured with the given aggregations.
func (*OrgMembershipQuery) All ¶
func (omq *OrgMembershipQuery) All(ctx context.Context) ([]*OrgMembership, error)
All executes the query and returns a list of OrgMemberships.
func (*OrgMembershipQuery) AllX ¶
func (omq *OrgMembershipQuery) AllX(ctx context.Context) []*OrgMembership
AllX is like All, but panics if an error occurs.
func (*OrgMembershipQuery) CheckAccess ¶
func (q *OrgMembershipQuery) CheckAccess(ctx context.Context) error
func (*OrgMembershipQuery) Clone ¶
func (omq *OrgMembershipQuery) Clone() *OrgMembershipQuery
Clone returns a duplicate of the OrgMembershipQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*OrgMembershipQuery) CollectFields ¶
func (om *OrgMembershipQuery) CollectFields(ctx context.Context, satisfies ...string) (*OrgMembershipQuery, error)
CollectFields tells the query-builder to eagerly load connected nodes by resolver context.
func (*OrgMembershipQuery) Count ¶
func (omq *OrgMembershipQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*OrgMembershipQuery) CountX ¶
func (omq *OrgMembershipQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*OrgMembershipQuery) Exist ¶
func (omq *OrgMembershipQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*OrgMembershipQuery) ExistX ¶
func (omq *OrgMembershipQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*OrgMembershipQuery) First ¶
func (omq *OrgMembershipQuery) First(ctx context.Context) (*OrgMembership, error)
First returns the first OrgMembership entity from the query. Returns a *NotFoundError when no OrgMembership was found.
func (*OrgMembershipQuery) FirstID ¶
func (omq *OrgMembershipQuery) FirstID(ctx context.Context) (id string, err error)
FirstID returns the first OrgMembership ID from the query. Returns a *NotFoundError when no OrgMembership ID was found.
func (*OrgMembershipQuery) FirstIDX ¶
func (omq *OrgMembershipQuery) FirstIDX(ctx context.Context) string
FirstIDX is like FirstID, but panics if an error occurs.
func (*OrgMembershipQuery) FirstX ¶
func (omq *OrgMembershipQuery) FirstX(ctx context.Context) *OrgMembership
FirstX is like First, but panics if an error occurs.
func (*OrgMembershipQuery) GroupBy ¶
func (omq *OrgMembershipQuery) GroupBy(field string, fields ...string) *OrgMembershipGroupBy
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 { Role enums.Role `json:"role,omitempty"` Count int `json:"count,omitempty"` } client.OrgMembership.Query(). GroupBy(orgmembership.FieldRole). Aggregate(ent.Count()). Scan(ctx, &v)
func (*OrgMembershipQuery) IDs ¶
func (omq *OrgMembershipQuery) IDs(ctx context.Context) (ids []string, err error)
IDs executes the query and returns a list of OrgMembership IDs.
func (*OrgMembershipQuery) IDsX ¶
func (omq *OrgMembershipQuery) IDsX(ctx context.Context) []string
IDsX is like IDs, but panics if an error occurs.
func (*OrgMembershipQuery) Limit ¶
func (omq *OrgMembershipQuery) Limit(limit int) *OrgMembershipQuery
Limit the number of records to be returned by this query.
func (*OrgMembershipQuery) Offset ¶
func (omq *OrgMembershipQuery) Offset(offset int) *OrgMembershipQuery
Offset to start from.
func (*OrgMembershipQuery) Only ¶
func (omq *OrgMembershipQuery) Only(ctx context.Context) (*OrgMembership, error)
Only returns a single OrgMembership entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one OrgMembership entity is found. Returns a *NotFoundError when no OrgMembership entities are found.
func (*OrgMembershipQuery) OnlyID ¶
func (omq *OrgMembershipQuery) OnlyID(ctx context.Context) (id string, err error)
OnlyID is like Only, but returns the only OrgMembership ID in the query. Returns a *NotSingularError when more than one OrgMembership ID is found. Returns a *NotFoundError when no entities are found.
func (*OrgMembershipQuery) OnlyIDX ¶
func (omq *OrgMembershipQuery) OnlyIDX(ctx context.Context) string
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*OrgMembershipQuery) OnlyX ¶
func (omq *OrgMembershipQuery) OnlyX(ctx context.Context) *OrgMembership
OnlyX is like Only, but panics if an error occurs.
func (*OrgMembershipQuery) Order ¶
func (omq *OrgMembershipQuery) Order(o ...orgmembership.OrderOption) *OrgMembershipQuery
Order specifies how the records should be ordered.
func (*OrgMembershipQuery) Paginate ¶
func (om *OrgMembershipQuery) Paginate( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, opts ...OrgMembershipPaginateOption, ) (*OrgMembershipConnection, error)
Paginate executes the query and returns a relay based cursor connection to OrgMembership.
func (*OrgMembershipQuery) QueryOrganization ¶
func (omq *OrgMembershipQuery) QueryOrganization() *OrganizationQuery
QueryOrganization chains the current query on the "organization" edge.
func (*OrgMembershipQuery) Select ¶
func (omq *OrgMembershipQuery) Select(fields ...string) *OrgMembershipSelect
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 { Role enums.Role `json:"role,omitempty"` } client.OrgMembership.Query(). Select(orgmembership.FieldRole). Scan(ctx, &v)
func (*OrgMembershipQuery) Unique ¶
func (omq *OrgMembershipQuery) Unique(unique bool) *OrgMembershipQuery
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 (*OrgMembershipQuery) Where ¶
func (omq *OrgMembershipQuery) Where(ps ...predicate.OrgMembership) *OrgMembershipQuery
Where adds a new predicate for the OrgMembershipQuery builder.
func (*OrgMembershipQuery) WithOrganization ¶
func (omq *OrgMembershipQuery) WithOrganization(opts ...func(*OrganizationQuery)) *OrgMembershipQuery
WithOrganization tells the query-builder to eager-load the nodes that are connected to the "organization" edge. The optional arguments are used to configure the query builder of the edge.
type OrgMembershipSelect ¶
type OrgMembershipSelect struct { *OrgMembershipQuery // contains filtered or unexported fields }
OrgMembershipSelect is the builder for selecting fields of OrgMembership entities.
func (*OrgMembershipSelect) Aggregate ¶
func (oms *OrgMembershipSelect) Aggregate(fns ...AggregateFunc) *OrgMembershipSelect
Aggregate adds the given aggregation functions to the selector query.
func (*OrgMembershipSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*OrgMembershipSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*OrgMembershipSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*OrgMembershipSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*OrgMembershipSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*OrgMembershipSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*OrgMembershipSelect) Scan ¶
func (oms *OrgMembershipSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*OrgMembershipSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type OrgMembershipUpdate ¶
type OrgMembershipUpdate struct {
// contains filtered or unexported fields
}
OrgMembershipUpdate is the builder for updating OrgMembership entities.
func (*OrgMembershipUpdate) Exec ¶
func (omu *OrgMembershipUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*OrgMembershipUpdate) ExecX ¶
func (omu *OrgMembershipUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrgMembershipUpdate) Mutation ¶
func (omu *OrgMembershipUpdate) Mutation() *OrgMembershipMutation
Mutation returns the OrgMembershipMutation object of the builder.
func (*OrgMembershipUpdate) Save ¶
func (omu *OrgMembershipUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*OrgMembershipUpdate) SaveX ¶
func (omu *OrgMembershipUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*OrgMembershipUpdate) SetInput ¶
func (c *OrgMembershipUpdate) SetInput(i UpdateOrgMembershipInput) *OrgMembershipUpdate
SetInput applies the change-set in the UpdateOrgMembershipInput on the OrgMembershipUpdate builder.
func (*OrgMembershipUpdate) SetNillableRole ¶
func (omu *OrgMembershipUpdate) SetNillableRole(e *enums.Role) *OrgMembershipUpdate
SetNillableRole sets the "role" field if the given value is not nil.
func (*OrgMembershipUpdate) SetRole ¶
func (omu *OrgMembershipUpdate) SetRole(e enums.Role) *OrgMembershipUpdate
SetRole sets the "role" field.
func (*OrgMembershipUpdate) Where ¶
func (omu *OrgMembershipUpdate) Where(ps ...predicate.OrgMembership) *OrgMembershipUpdate
Where appends a list predicates to the OrgMembershipUpdate builder.
type OrgMembershipUpdateOne ¶
type OrgMembershipUpdateOne struct {
// contains filtered or unexported fields
}
OrgMembershipUpdateOne is the builder for updating a single OrgMembership entity.
func (*OrgMembershipUpdateOne) Exec ¶
func (omuo *OrgMembershipUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*OrgMembershipUpdateOne) ExecX ¶
func (omuo *OrgMembershipUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrgMembershipUpdateOne) Mutation ¶
func (omuo *OrgMembershipUpdateOne) Mutation() *OrgMembershipMutation
Mutation returns the OrgMembershipMutation object of the builder.
func (*OrgMembershipUpdateOne) Save ¶
func (omuo *OrgMembershipUpdateOne) Save(ctx context.Context) (*OrgMembership, error)
Save executes the query and returns the updated OrgMembership entity.
func (*OrgMembershipUpdateOne) SaveX ¶
func (omuo *OrgMembershipUpdateOne) SaveX(ctx context.Context) *OrgMembership
SaveX is like Save, but panics if an error occurs.
func (*OrgMembershipUpdateOne) Select ¶
func (omuo *OrgMembershipUpdateOne) Select(field string, fields ...string) *OrgMembershipUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*OrgMembershipUpdateOne) SetInput ¶
func (c *OrgMembershipUpdateOne) SetInput(i UpdateOrgMembershipInput) *OrgMembershipUpdateOne
SetInput applies the change-set in the UpdateOrgMembershipInput on the OrgMembershipUpdateOne builder.
func (*OrgMembershipUpdateOne) SetNillableRole ¶
func (omuo *OrgMembershipUpdateOne) SetNillableRole(e *enums.Role) *OrgMembershipUpdateOne
SetNillableRole sets the "role" field if the given value is not nil.
func (*OrgMembershipUpdateOne) SetRole ¶
func (omuo *OrgMembershipUpdateOne) SetRole(e enums.Role) *OrgMembershipUpdateOne
SetRole sets the "role" field.
func (*OrgMembershipUpdateOne) Where ¶
func (omuo *OrgMembershipUpdateOne) Where(ps ...predicate.OrgMembership) *OrgMembershipUpdateOne
Where appends a list predicates to the OrgMembershipUpdate builder.
type OrgMembershipWhereInput ¶
type OrgMembershipWhereInput struct { Predicates []predicate.OrgMembership `json:"-"` Not *OrgMembershipWhereInput `json:"not,omitempty"` Or []*OrgMembershipWhereInput `json:"or,omitempty"` And []*OrgMembershipWhereInput `json:"and,omitempty"` // "id" field predicates. ID *string `json:"id,omitempty"` IDNEQ *string `json:"idNEQ,omitempty"` IDIn []string `json:"idIn,omitempty"` IDNotIn []string `json:"idNotIn,omitempty"` IDGT *string `json:"idGT,omitempty"` IDGTE *string `json:"idGTE,omitempty"` IDLT *string `json:"idLT,omitempty"` IDLTE *string `json:"idLTE,omitempty"` IDEqualFold *string `json:"idEqualFold,omitempty"` IDContainsFold *string `json:"idContainsFold,omitempty"` // "role" field predicates. Role *enums.Role `json:"role,omitempty"` RoleNEQ *enums.Role `json:"roleNEQ,omitempty"` RoleIn []enums.Role `json:"roleIn,omitempty"` RoleNotIn []enums.Role `json:"roleNotIn,omitempty"` // "organization_id" field predicates. OrganizationID *string `json:"organizationID,omitempty"` OrganizationIDNEQ *string `json:"organizationIDNEQ,omitempty"` OrganizationIDIn []string `json:"organizationIDIn,omitempty"` OrganizationIDNotIn []string `json:"organizationIDNotIn,omitempty"` OrganizationIDGT *string `json:"organizationIDGT,omitempty"` OrganizationIDGTE *string `json:"organizationIDGTE,omitempty"` OrganizationIDLT *string `json:"organizationIDLT,omitempty"` OrganizationIDLTE *string `json:"organizationIDLTE,omitempty"` OrganizationIDContains *string `json:"organizationIDContains,omitempty"` OrganizationIDHasPrefix *string `json:"organizationIDHasPrefix,omitempty"` OrganizationIDHasSuffix *string `json:"organizationIDHasSuffix,omitempty"` OrganizationIDEqualFold *string `json:"organizationIDEqualFold,omitempty"` OrganizationIDContainsFold *string `json:"organizationIDContainsFold,omitempty"` // "user_id" field predicates. UserID *string `json:"userID,omitempty"` UserIDNEQ *string `json:"userIDNEQ,omitempty"` UserIDIn []string `json:"userIDIn,omitempty"` UserIDNotIn []string `json:"userIDNotIn,omitempty"` UserIDGT *string `json:"userIDGT,omitempty"` UserIDGTE *string `json:"userIDGTE,omitempty"` UserIDLT *string `json:"userIDLT,omitempty"` UserIDLTE *string `json:"userIDLTE,omitempty"` UserIDContains *string `json:"userIDContains,omitempty"` UserIDHasPrefix *string `json:"userIDHasPrefix,omitempty"` UserIDHasSuffix *string `json:"userIDHasSuffix,omitempty"` UserIDEqualFold *string `json:"userIDEqualFold,omitempty"` UserIDContainsFold *string `json:"userIDContainsFold,omitempty"` // "organization" edge predicates. HasOrganization *bool `json:"hasOrganization,omitempty"` HasOrganizationWith []*OrganizationWhereInput `json:"hasOrganizationWith,omitempty"` }
OrgMembershipWhereInput represents a where input for filtering OrgMembership queries.
func (*OrgMembershipWhereInput) AddPredicates ¶
func (i *OrgMembershipWhereInput) AddPredicates(predicates ...predicate.OrgMembership)
AddPredicates adds custom predicates to the where input to be used during the filtering phase.
func (*OrgMembershipWhereInput) Filter ¶
func (i *OrgMembershipWhereInput) Filter(q *OrgMembershipQuery) (*OrgMembershipQuery, error)
Filter applies the OrgMembershipWhereInput filter on the OrgMembershipQuery builder.
func (*OrgMembershipWhereInput) P ¶
func (i *OrgMembershipWhereInput) P() (predicate.OrgMembership, error)
P returns a predicate for filtering orgmemberships. An error is returned if the input is empty or invalid.
type OrgMemberships ¶
type OrgMemberships []*OrgMembership
OrgMemberships is a parsable slice of OrgMembership.
type Organization ¶
type Organization struct { // ID of the ent. ID string `json:"id,omitempty"` // the name of the organization Name string `json:"name,omitempty"` // An optional description of the organization Description string `json:"description,omitempty"` // contains filtered or unexported fields }
Organization is the model entity for the Organization schema.
func (*Organization) IsNode ¶
func (*Organization) IsNode()
IsNode implements the Node interface check for GQLGen.
func (*Organization) String ¶
func (o *Organization) String() string
String implements the fmt.Stringer.
func (*Organization) ToEdge ¶
func (o *Organization) ToEdge(order *OrganizationOrder) *OrganizationEdge
ToEdge converts Organization into OrganizationEdge.
func (*Organization) Unwrap ¶
func (o *Organization) Unwrap() *Organization
Unwrap unwraps the Organization 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 (*Organization) Update ¶
func (o *Organization) Update() *OrganizationUpdateOne
Update returns a builder for updating this Organization. Note that you need to call Organization.Unwrap() before calling this method if this Organization was returned from a transaction, and the transaction was committed or rolled back.
type OrganizationClient ¶
type OrganizationClient struct {
// contains filtered or unexported fields
}
OrganizationClient is a client for the Organization schema.
func NewOrganizationClient ¶
func NewOrganizationClient(c config) *OrganizationClient
NewOrganizationClient returns a client for the Organization from the given config.
func (*OrganizationClient) Create ¶
func (c *OrganizationClient) Create() *OrganizationCreate
Create returns a builder for creating a Organization entity.
func (*OrganizationClient) CreateBulk ¶
func (c *OrganizationClient) CreateBulk(builders ...*OrganizationCreate) *OrganizationCreateBulk
CreateBulk returns a builder for creating a bulk of Organization entities.
func (*OrganizationClient) Delete ¶
func (c *OrganizationClient) Delete() *OrganizationDelete
Delete returns a delete builder for Organization.
func (*OrganizationClient) DeleteOne ¶
func (c *OrganizationClient) DeleteOne(o *Organization) *OrganizationDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*OrganizationClient) DeleteOneID ¶
func (c *OrganizationClient) DeleteOneID(id string) *OrganizationDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*OrganizationClient) Get ¶
func (c *OrganizationClient) Get(ctx context.Context, id string) (*Organization, error)
Get returns a Organization entity by its id.
func (*OrganizationClient) GetX ¶
func (c *OrganizationClient) GetX(ctx context.Context, id string) *Organization
GetX is like Get, but panics if an error occurs.
func (*OrganizationClient) Hooks ¶
func (c *OrganizationClient) Hooks() []Hook
Hooks returns the client hooks.
func (*OrganizationClient) Intercept ¶
func (c *OrganizationClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `organization.Intercept(f(g(h())))`.
func (*OrganizationClient) Interceptors ¶
func (c *OrganizationClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*OrganizationClient) MapCreateBulk ¶
func (c *OrganizationClient) MapCreateBulk(slice any, setFunc func(*OrganizationCreate, int)) *OrganizationCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*OrganizationClient) Query ¶
func (c *OrganizationClient) Query() *OrganizationQuery
Query returns a query builder for Organization.
func (*OrganizationClient) Update ¶
func (c *OrganizationClient) Update() *OrganizationUpdate
Update returns an update builder for Organization.
func (*OrganizationClient) UpdateOne ¶
func (c *OrganizationClient) UpdateOne(o *Organization) *OrganizationUpdateOne
UpdateOne returns an update builder for the given entity.
func (*OrganizationClient) UpdateOneID ¶
func (c *OrganizationClient) UpdateOneID(id string) *OrganizationUpdateOne
UpdateOneID returns an update builder for the given id.
func (*OrganizationClient) Use ¶
func (c *OrganizationClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `organization.Hooks(f(g(h())))`.
type OrganizationConnection ¶
type OrganizationConnection struct { Edges []*OrganizationEdge `json:"edges"` PageInfo PageInfo `json:"pageInfo"` TotalCount int `json:"totalCount"` }
OrganizationConnection is the connection containing edges to Organization.
type OrganizationCreate ¶
type OrganizationCreate struct {
// contains filtered or unexported fields
}
OrganizationCreate is the builder for creating a Organization entity.
func (*OrganizationCreate) Exec ¶
func (oc *OrganizationCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*OrganizationCreate) ExecX ¶
func (oc *OrganizationCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrganizationCreate) Mutation ¶
func (oc *OrganizationCreate) Mutation() *OrganizationMutation
Mutation returns the OrganizationMutation object of the builder.
func (*OrganizationCreate) Save ¶
func (oc *OrganizationCreate) Save(ctx context.Context) (*Organization, error)
Save creates the Organization in the database.
func (*OrganizationCreate) SaveX ¶
func (oc *OrganizationCreate) SaveX(ctx context.Context) *Organization
SaveX calls Save and panics if Save returns an error.
func (*OrganizationCreate) SetDescription ¶
func (oc *OrganizationCreate) SetDescription(s string) *OrganizationCreate
SetDescription sets the "description" field.
func (*OrganizationCreate) SetID ¶
func (oc *OrganizationCreate) SetID(s string) *OrganizationCreate
SetID sets the "id" field.
func (*OrganizationCreate) SetInput ¶
func (c *OrganizationCreate) SetInput(i CreateOrganizationInput) *OrganizationCreate
SetInput applies the change-set in the CreateOrganizationInput on the OrganizationCreate builder.
func (*OrganizationCreate) SetName ¶
func (oc *OrganizationCreate) SetName(s string) *OrganizationCreate
SetName sets the "name" field.
func (*OrganizationCreate) SetNillableDescription ¶
func (oc *OrganizationCreate) SetNillableDescription(s *string) *OrganizationCreate
SetNillableDescription sets the "description" field if the given value is not nil.
type OrganizationCreateBulk ¶
type OrganizationCreateBulk struct {
// contains filtered or unexported fields
}
OrganizationCreateBulk is the builder for creating many Organization entities in bulk.
func (*OrganizationCreateBulk) Exec ¶
func (ocb *OrganizationCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*OrganizationCreateBulk) ExecX ¶
func (ocb *OrganizationCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrganizationCreateBulk) Save ¶
func (ocb *OrganizationCreateBulk) Save(ctx context.Context) ([]*Organization, error)
Save creates the Organization entities in the database.
func (*OrganizationCreateBulk) SaveX ¶
func (ocb *OrganizationCreateBulk) SaveX(ctx context.Context) []*Organization
SaveX is like Save, but panics if an error occurs.
type OrganizationDelete ¶
type OrganizationDelete struct {
// contains filtered or unexported fields
}
OrganizationDelete is the builder for deleting a Organization entity.
func (*OrganizationDelete) Exec ¶
func (od *OrganizationDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*OrganizationDelete) ExecX ¶
func (od *OrganizationDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*OrganizationDelete) Where ¶
func (od *OrganizationDelete) Where(ps ...predicate.Organization) *OrganizationDelete
Where appends a list predicates to the OrganizationDelete builder.
type OrganizationDeleteOne ¶
type OrganizationDeleteOne struct {
// contains filtered or unexported fields
}
OrganizationDeleteOne is the builder for deleting a single Organization entity.
func (*OrganizationDeleteOne) Exec ¶
func (odo *OrganizationDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*OrganizationDeleteOne) ExecX ¶
func (odo *OrganizationDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrganizationDeleteOne) Where ¶
func (odo *OrganizationDeleteOne) Where(ps ...predicate.Organization) *OrganizationDeleteOne
Where appends a list predicates to the OrganizationDelete builder.
type OrganizationEdge ¶
type OrganizationEdge struct { Node *Organization `json:"node"` Cursor Cursor `json:"cursor"` }
OrganizationEdge is the edge representation of Organization.
type OrganizationGroupBy ¶
type OrganizationGroupBy struct {
// contains filtered or unexported fields
}
OrganizationGroupBy is the group-by builder for Organization entities.
func (*OrganizationGroupBy) Aggregate ¶
func (ogb *OrganizationGroupBy) Aggregate(fns ...AggregateFunc) *OrganizationGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*OrganizationGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*OrganizationGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*OrganizationGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*OrganizationGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*OrganizationGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*OrganizationGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*OrganizationGroupBy) Scan ¶
func (ogb *OrganizationGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*OrganizationGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type OrganizationMutation ¶
type OrganizationMutation struct {
// contains filtered or unexported fields
}
OrganizationMutation represents an operation that mutates the Organization nodes in the graph.
func (*OrganizationMutation) AddField ¶
func (m *OrganizationMutation) 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 (*OrganizationMutation) AddedEdges ¶
func (m *OrganizationMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*OrganizationMutation) AddedField ¶
func (m *OrganizationMutation) 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 (*OrganizationMutation) AddedFields ¶
func (m *OrganizationMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*OrganizationMutation) AddedIDs ¶
func (m *OrganizationMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*OrganizationMutation) CheckAccessForDelete ¶
func (m *OrganizationMutation) CheckAccessForDelete(ctx context.Context) error
func (*OrganizationMutation) CheckAccessForEdit ¶
func (m *OrganizationMutation) CheckAccessForEdit(ctx context.Context) error
func (*OrganizationMutation) ClearDescription ¶
func (m *OrganizationMutation) ClearDescription()
ClearDescription clears the value of the "description" field.
func (*OrganizationMutation) ClearEdge ¶
func (m *OrganizationMutation) 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 (*OrganizationMutation) ClearField ¶
func (m *OrganizationMutation) 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 (*OrganizationMutation) ClearedEdges ¶
func (m *OrganizationMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*OrganizationMutation) ClearedFields ¶
func (m *OrganizationMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (OrganizationMutation) Client ¶
func (m OrganizationMutation) 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 (*OrganizationMutation) Description ¶
func (m *OrganizationMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*OrganizationMutation) DescriptionCleared ¶
func (m *OrganizationMutation) DescriptionCleared() bool
DescriptionCleared returns if the "description" field was cleared in this mutation.
func (*OrganizationMutation) EdgeCleared ¶
func (m *OrganizationMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*OrganizationMutation) Field ¶
func (m *OrganizationMutation) 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 (*OrganizationMutation) FieldCleared ¶
func (m *OrganizationMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*OrganizationMutation) Fields ¶
func (m *OrganizationMutation) 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 (*OrganizationMutation) ID ¶
func (m *OrganizationMutation) ID() (id string, 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 (*OrganizationMutation) IDs ¶
func (m *OrganizationMutation) IDs(ctx context.Context) ([]string, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*OrganizationMutation) Name ¶
func (m *OrganizationMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*OrganizationMutation) OldDescription ¶
func (m *OrganizationMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the Organization entity. If the Organization 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 (*OrganizationMutation) 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 (*OrganizationMutation) OldName ¶
func (m *OrganizationMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Organization entity. If the Organization 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 (*OrganizationMutation) Op ¶
func (m *OrganizationMutation) Op() Op
Op returns the operation name.
func (*OrganizationMutation) RemovedEdges ¶
func (m *OrganizationMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*OrganizationMutation) RemovedIDs ¶
func (m *OrganizationMutation) 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 (*OrganizationMutation) ResetDescription ¶
func (m *OrganizationMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*OrganizationMutation) ResetEdge ¶
func (m *OrganizationMutation) 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 (*OrganizationMutation) ResetField ¶
func (m *OrganizationMutation) 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 (*OrganizationMutation) ResetName ¶
func (m *OrganizationMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*OrganizationMutation) SetDescription ¶
func (m *OrganizationMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*OrganizationMutation) SetField ¶
func (m *OrganizationMutation) 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 (*OrganizationMutation) SetID ¶
func (m *OrganizationMutation) SetID(id string)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Organization entities.
func (*OrganizationMutation) SetName ¶
func (m *OrganizationMutation) SetName(s string)
SetName sets the "name" field.
func (*OrganizationMutation) SetOp ¶
func (m *OrganizationMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (OrganizationMutation) Tx ¶
func (m OrganizationMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*OrganizationMutation) Type ¶
func (m *OrganizationMutation) Type() string
Type returns the node type of this mutation (Organization).
func (*OrganizationMutation) Where ¶
func (m *OrganizationMutation) Where(ps ...predicate.Organization)
Where appends a list predicates to the OrganizationMutation builder.
func (*OrganizationMutation) WhereP ¶
func (m *OrganizationMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the OrganizationMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type OrganizationOrder ¶
type OrganizationOrder struct { Direction OrderDirection `json:"direction"` Field *OrganizationOrderField `json:"field"` }
OrganizationOrder defines the ordering of Organization.
type OrganizationOrderField ¶
type OrganizationOrderField struct { // Value extracts the ordering value from the given Organization. Value func(*Organization) (ent.Value, error) // contains filtered or unexported fields }
OrganizationOrderField defines the ordering field of Organization.
type OrganizationPaginateOption ¶
type OrganizationPaginateOption func(*organizationPager) error
OrganizationPaginateOption enables pagination customization.
func WithOrganizationFilter ¶
func WithOrganizationFilter(filter func(*OrganizationQuery) (*OrganizationQuery, error)) OrganizationPaginateOption
WithOrganizationFilter configures pagination filter.
func WithOrganizationOrder ¶
func WithOrganizationOrder(order *OrganizationOrder) OrganizationPaginateOption
WithOrganizationOrder configures pagination ordering.
type OrganizationQuery ¶
type OrganizationQuery struct {
// contains filtered or unexported fields
}
OrganizationQuery is the builder for querying Organization entities.
func (*OrganizationQuery) Aggregate ¶
func (oq *OrganizationQuery) Aggregate(fns ...AggregateFunc) *OrganizationSelect
Aggregate returns a OrganizationSelect configured with the given aggregations.
func (*OrganizationQuery) All ¶
func (oq *OrganizationQuery) All(ctx context.Context) ([]*Organization, error)
All executes the query and returns a list of Organizations.
func (*OrganizationQuery) AllX ¶
func (oq *OrganizationQuery) AllX(ctx context.Context) []*Organization
AllX is like All, but panics if an error occurs.
func (*OrganizationQuery) CheckAccess ¶
func (q *OrganizationQuery) CheckAccess(ctx context.Context) error
func (*OrganizationQuery) Clone ¶
func (oq *OrganizationQuery) Clone() *OrganizationQuery
Clone returns a duplicate of the OrganizationQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*OrganizationQuery) CollectFields ¶
func (o *OrganizationQuery) CollectFields(ctx context.Context, satisfies ...string) (*OrganizationQuery, error)
CollectFields tells the query-builder to eagerly load connected nodes by resolver context.
func (*OrganizationQuery) Count ¶
func (oq *OrganizationQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*OrganizationQuery) CountX ¶
func (oq *OrganizationQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*OrganizationQuery) Exist ¶
func (oq *OrganizationQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*OrganizationQuery) ExistX ¶
func (oq *OrganizationQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*OrganizationQuery) First ¶
func (oq *OrganizationQuery) First(ctx context.Context) (*Organization, error)
First returns the first Organization entity from the query. Returns a *NotFoundError when no Organization was found.
func (*OrganizationQuery) FirstID ¶
func (oq *OrganizationQuery) FirstID(ctx context.Context) (id string, err error)
FirstID returns the first Organization ID from the query. Returns a *NotFoundError when no Organization ID was found.
func (*OrganizationQuery) FirstIDX ¶
func (oq *OrganizationQuery) FirstIDX(ctx context.Context) string
FirstIDX is like FirstID, but panics if an error occurs.
func (*OrganizationQuery) FirstX ¶
func (oq *OrganizationQuery) FirstX(ctx context.Context) *Organization
FirstX is like First, but panics if an error occurs.
func (*OrganizationQuery) GroupBy ¶
func (oq *OrganizationQuery) GroupBy(field string, fields ...string) *OrganizationGroupBy
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.Organization.Query(). GroupBy(organization.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*OrganizationQuery) IDs ¶
func (oq *OrganizationQuery) IDs(ctx context.Context) (ids []string, err error)
IDs executes the query and returns a list of Organization IDs.
func (*OrganizationQuery) IDsX ¶
func (oq *OrganizationQuery) IDsX(ctx context.Context) []string
IDsX is like IDs, but panics if an error occurs.
func (*OrganizationQuery) Limit ¶
func (oq *OrganizationQuery) Limit(limit int) *OrganizationQuery
Limit the number of records to be returned by this query.
func (*OrganizationQuery) Offset ¶
func (oq *OrganizationQuery) Offset(offset int) *OrganizationQuery
Offset to start from.
func (*OrganizationQuery) Only ¶
func (oq *OrganizationQuery) Only(ctx context.Context) (*Organization, error)
Only returns a single Organization entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Organization entity is found. Returns a *NotFoundError when no Organization entities are found.
func (*OrganizationQuery) OnlyID ¶
func (oq *OrganizationQuery) OnlyID(ctx context.Context) (id string, err error)
OnlyID is like Only, but returns the only Organization ID in the query. Returns a *NotSingularError when more than one Organization ID is found. Returns a *NotFoundError when no entities are found.
func (*OrganizationQuery) OnlyIDX ¶
func (oq *OrganizationQuery) OnlyIDX(ctx context.Context) string
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*OrganizationQuery) OnlyX ¶
func (oq *OrganizationQuery) OnlyX(ctx context.Context) *Organization
OnlyX is like Only, but panics if an error occurs.
func (*OrganizationQuery) Order ¶
func (oq *OrganizationQuery) Order(o ...organization.OrderOption) *OrganizationQuery
Order specifies how the records should be ordered.
func (*OrganizationQuery) Paginate ¶
func (o *OrganizationQuery) Paginate( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, opts ...OrganizationPaginateOption, ) (*OrganizationConnection, error)
Paginate executes the query and returns a relay based cursor connection to Organization.
func (*OrganizationQuery) Select ¶
func (oq *OrganizationQuery) Select(fields ...string) *OrganizationSelect
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.Organization.Query(). Select(organization.FieldName). Scan(ctx, &v)
func (*OrganizationQuery) Unique ¶
func (oq *OrganizationQuery) Unique(unique bool) *OrganizationQuery
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 (*OrganizationQuery) Where ¶
func (oq *OrganizationQuery) Where(ps ...predicate.Organization) *OrganizationQuery
Where adds a new predicate for the OrganizationQuery builder.
type OrganizationSelect ¶
type OrganizationSelect struct { *OrganizationQuery // contains filtered or unexported fields }
OrganizationSelect is the builder for selecting fields of Organization entities.
func (*OrganizationSelect) Aggregate ¶
func (os *OrganizationSelect) Aggregate(fns ...AggregateFunc) *OrganizationSelect
Aggregate adds the given aggregation functions to the selector query.
func (*OrganizationSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*OrganizationSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*OrganizationSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*OrganizationSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*OrganizationSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*OrganizationSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*OrganizationSelect) Scan ¶
func (os *OrganizationSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*OrganizationSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type OrganizationUpdate ¶
type OrganizationUpdate struct {
// contains filtered or unexported fields
}
OrganizationUpdate is the builder for updating Organization entities.
func (*OrganizationUpdate) ClearDescription ¶
func (ou *OrganizationUpdate) ClearDescription() *OrganizationUpdate
ClearDescription clears the value of the "description" field.
func (*OrganizationUpdate) Exec ¶
func (ou *OrganizationUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*OrganizationUpdate) ExecX ¶
func (ou *OrganizationUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrganizationUpdate) Mutation ¶
func (ou *OrganizationUpdate) Mutation() *OrganizationMutation
Mutation returns the OrganizationMutation object of the builder.
func (*OrganizationUpdate) Save ¶
func (ou *OrganizationUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*OrganizationUpdate) SaveX ¶
func (ou *OrganizationUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*OrganizationUpdate) SetDescription ¶
func (ou *OrganizationUpdate) SetDescription(s string) *OrganizationUpdate
SetDescription sets the "description" field.
func (*OrganizationUpdate) SetInput ¶
func (c *OrganizationUpdate) SetInput(i UpdateOrganizationInput) *OrganizationUpdate
SetInput applies the change-set in the UpdateOrganizationInput on the OrganizationUpdate builder.
func (*OrganizationUpdate) SetName ¶
func (ou *OrganizationUpdate) SetName(s string) *OrganizationUpdate
SetName sets the "name" field.
func (*OrganizationUpdate) SetNillableDescription ¶
func (ou *OrganizationUpdate) SetNillableDescription(s *string) *OrganizationUpdate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*OrganizationUpdate) SetNillableName ¶
func (ou *OrganizationUpdate) SetNillableName(s *string) *OrganizationUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*OrganizationUpdate) Where ¶
func (ou *OrganizationUpdate) Where(ps ...predicate.Organization) *OrganizationUpdate
Where appends a list predicates to the OrganizationUpdate builder.
type OrganizationUpdateOne ¶
type OrganizationUpdateOne struct {
// contains filtered or unexported fields
}
OrganizationUpdateOne is the builder for updating a single Organization entity.
func (*OrganizationUpdateOne) ClearDescription ¶
func (ouo *OrganizationUpdateOne) ClearDescription() *OrganizationUpdateOne
ClearDescription clears the value of the "description" field.
func (*OrganizationUpdateOne) Exec ¶
func (ouo *OrganizationUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*OrganizationUpdateOne) ExecX ¶
func (ouo *OrganizationUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrganizationUpdateOne) Mutation ¶
func (ouo *OrganizationUpdateOne) Mutation() *OrganizationMutation
Mutation returns the OrganizationMutation object of the builder.
func (*OrganizationUpdateOne) Save ¶
func (ouo *OrganizationUpdateOne) Save(ctx context.Context) (*Organization, error)
Save executes the query and returns the updated Organization entity.
func (*OrganizationUpdateOne) SaveX ¶
func (ouo *OrganizationUpdateOne) SaveX(ctx context.Context) *Organization
SaveX is like Save, but panics if an error occurs.
func (*OrganizationUpdateOne) Select ¶
func (ouo *OrganizationUpdateOne) Select(field string, fields ...string) *OrganizationUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*OrganizationUpdateOne) SetDescription ¶
func (ouo *OrganizationUpdateOne) SetDescription(s string) *OrganizationUpdateOne
SetDescription sets the "description" field.
func (*OrganizationUpdateOne) SetInput ¶
func (c *OrganizationUpdateOne) SetInput(i UpdateOrganizationInput) *OrganizationUpdateOne
SetInput applies the change-set in the UpdateOrganizationInput on the OrganizationUpdateOne builder.
func (*OrganizationUpdateOne) SetName ¶
func (ouo *OrganizationUpdateOne) SetName(s string) *OrganizationUpdateOne
SetName sets the "name" field.
func (*OrganizationUpdateOne) SetNillableDescription ¶
func (ouo *OrganizationUpdateOne) SetNillableDescription(s *string) *OrganizationUpdateOne
SetNillableDescription sets the "description" field if the given value is not nil.
func (*OrganizationUpdateOne) SetNillableName ¶
func (ouo *OrganizationUpdateOne) SetNillableName(s *string) *OrganizationUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*OrganizationUpdateOne) Where ¶
func (ouo *OrganizationUpdateOne) Where(ps ...predicate.Organization) *OrganizationUpdateOne
Where appends a list predicates to the OrganizationUpdate builder.
type OrganizationWhereInput ¶
type OrganizationWhereInput struct { Predicates []predicate.Organization `json:"-"` Not *OrganizationWhereInput `json:"not,omitempty"` Or []*OrganizationWhereInput `json:"or,omitempty"` And []*OrganizationWhereInput `json:"and,omitempty"` // "id" field predicates. ID *string `json:"id,omitempty"` IDNEQ *string `json:"idNEQ,omitempty"` IDIn []string `json:"idIn,omitempty"` IDNotIn []string `json:"idNotIn,omitempty"` IDGT *string `json:"idGT,omitempty"` IDGTE *string `json:"idGTE,omitempty"` IDLT *string `json:"idLT,omitempty"` IDLTE *string `json:"idLTE,omitempty"` IDEqualFold *string `json:"idEqualFold,omitempty"` IDContainsFold *string `json:"idContainsFold,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"` // "description" field predicates. Description *string `json:"description,omitempty"` DescriptionNEQ *string `json:"descriptionNEQ,omitempty"` DescriptionIn []string `json:"descriptionIn,omitempty"` DescriptionNotIn []string `json:"descriptionNotIn,omitempty"` DescriptionGT *string `json:"descriptionGT,omitempty"` DescriptionGTE *string `json:"descriptionGTE,omitempty"` DescriptionLT *string `json:"descriptionLT,omitempty"` DescriptionLTE *string `json:"descriptionLTE,omitempty"` DescriptionContains *string `json:"descriptionContains,omitempty"` DescriptionHasPrefix *string `json:"descriptionHasPrefix,omitempty"` DescriptionHasSuffix *string `json:"descriptionHasSuffix,omitempty"` DescriptionIsNil bool `json:"descriptionIsNil,omitempty"` DescriptionNotNil bool `json:"descriptionNotNil,omitempty"` DescriptionEqualFold *string `json:"descriptionEqualFold,omitempty"` DescriptionContainsFold *string `json:"descriptionContainsFold,omitempty"` }
OrganizationWhereInput represents a where input for filtering Organization queries.
func (*OrganizationWhereInput) AddPredicates ¶
func (i *OrganizationWhereInput) AddPredicates(predicates ...predicate.Organization)
AddPredicates adds custom predicates to the where input to be used during the filtering phase.
func (*OrganizationWhereInput) Filter ¶
func (i *OrganizationWhereInput) Filter(q *OrganizationQuery) (*OrganizationQuery, error)
Filter applies the OrganizationWhereInput filter on the OrganizationQuery builder.
func (*OrganizationWhereInput) P ¶
func (i *OrganizationWhereInput) P() (predicate.Organization, error)
P returns a predicate for filtering organizations. An error is returned if the input is empty or invalid.
type Organizations ¶
type Organizations []*Organization
Organizations is a parsable slice of Organization.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // OrgMembership is the client for interacting with the OrgMembership builders. OrgMembership *OrgMembershipClient // Organization is the client for interacting with the Organization builders. Organization *OrganizationClient // 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 UpdateOrgMembershipInput ¶
UpdateOrgMembershipInput represents a mutation input for updating orgmemberships.
func (*UpdateOrgMembershipInput) Mutate ¶
func (i *UpdateOrgMembershipInput) Mutate(m *OrgMembershipMutation)
Mutate applies the UpdateOrgMembershipInput on the OrgMembershipMutation builder.
type UpdateOrganizationInput ¶
UpdateOrganizationInput represents a mutation input for updating organizations.
func (*UpdateOrganizationInput) Mutate ¶
func (i *UpdateOrganizationInput) Mutate(m *OrganizationMutation)
Mutate applies the UpdateOrganizationInput on the OrganizationMutation builder.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
Source Files ¶
- auth_from_mutation.go
- authz_checks.go
- client.go
- ent.go
- generate.go
- gql_collection.go
- gql_edge.go
- gql_mutation_input.go
- gql_node.go
- gql_pagination.go
- gql_transaction.go
- gql_where_input.go
- mutation.go
- organization.go
- organization_create.go
- organization_delete.go
- organization_query.go
- organization_update.go
- orgmembership.go
- orgmembership_create.go
- orgmembership_delete.go
- orgmembership_query.go
- orgmembership_update.go
- runtime.go
- tx.go