ent

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Code generated by entfga, DO NOT EDIT.

Index

Constants

View Source
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

View Source
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.

View Source
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.

View Source
var ErrEmptyOrgMembershipWhereInput = errors.New("ent: empty predicate OrgMembershipWhereInput")

ErrEmptyOrgMembershipWhereInput is returned in case the OrgMembershipWhereInput is empty.

View Source
var ErrEmptyOrganizationWhereInput = errors.New("ent: empty predicate OrganizationWhereInput")

ErrEmptyOrganizationWhereInput is returned in case the OrganizationWhereInput is empty.

View Source
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 Asc

func Asc(fields ...string) func(*sql.Selector)

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) func(*sql.Selector)

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

IsConstraintError returns a boolean indicating whether the error is a constraint failure.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns a boolean indicating whether the error is a not found error.

func IsNotLoaded

func IsNotLoaded(err error) bool

IsNotLoaded returns a boolean indicating whether the error is a not loaded error.

func IsNotSingular

func IsNotSingular(err error) bool

IsNotSingular returns a boolean indicating whether the error is a not singular error.

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns a boolean indicating whether the error is a validation error.

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

func NewContext(parent context.Context, c *Client) context.Context

NewContext returns a new context with the given Client attached.

func NewTxContext

func NewTxContext(parent context.Context, tx *Tx) context.Context

NewTxContext returns a new context with the given Tx attached.

func OpenTxFromContext

func OpenTxFromContext(ctx context.Context) (context.Context, driver.Tx, error)

OpenTxFromContext open transactions from client stored in context.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

AggregateFunc applies an aggregation step on the group-by traversal/selector.

func As

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

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

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) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

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) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) Noder

func (c *Client) Noder(ctx context.Context, id string, opts ...NodeOption) (_ Noder, err error)

Noder returns a Node by its id. If the NodeType was not provided, it will be derived from the id value according to the universal-id configuration.

c.Noder(ctx, id)
c.Noder(ctx, id, ent.WithNodeType(typeResolver))

func (*Client) Noders

func (c *Client) Noders(ctx context.Context, ids []string, opts ...NodeOption) ([]Noder, error)

func (*Client) OpenTx

func (c *Client) OpenTx(ctx context.Context) (context.Context, driver.Tx, error)

OpenTx opens a transaction and returns a transactional context along with the created transaction.

func (*Client) Tx

func (c *Client) Tx(ctx context.Context) (*Tx, error)

Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.

func (*Client) Use

func (c *Client) Use(hooks ...Hook)

Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.

func (*Client) WithAuthz

func (c *Client) WithAuthz()

WithAuthz adds the authz hooks to the appropriate schemas - generated by entfga

type CommitFunc

type CommitFunc func(context.Context, *Tx) error

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.

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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 Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Commit method.

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

type CreateOrgMembershipInput struct {
	Role           *enums.Role
	UserID         string
	OrganizationID string
}

CreateOrgMembershipInput represents a mutation input for creating orgmemberships.

func (*CreateOrgMembershipInput) Mutate

Mutate applies the CreateOrgMembershipInput on the OrgMembershipMutation builder.

type CreateOrganizationInput

type CreateOrganizationInput struct {
	Name        string
	Description *string
}

CreateOrganizationInput represents a mutation input for creating organizations.

func (*CreateOrganizationInput) Mutate

Mutate applies the CreateOrganizationInput on the OrganizationMutation builder.

type Cursor

type Cursor = entgql.Cursor[string]

Common entgql types.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

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 Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NodeOption

type NodeOption func(*nodeOptions)

NodeOption allows configuring the Noder execution using functional options.

func WithFixedNodeType

func WithFixedNodeType(t string) NodeOption

WithFixedNodeType sets the Type of the node to a fixed value.

func WithNodeType

func WithNodeType(f func(context.Context, string) (string, error)) NodeOption

WithNodeType sets the node Type resolver function (i.e. the table to query). If was not provided, the table will be derived from the universal-id configuration as described in: https://entgo.io/docs/migrate/#universal-ids.

type Noder

type Noder interface {
	IsNode()
}

Noder wraps the basic Node method.

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 Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Authz

func Authz(v fgax.Client) Option

Authz configures the Authz.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderDirection

type OrderDirection = entgql.OrderDirection

Common entgql types.

type OrderFunc

type OrderFunc func(*sql.Selector)

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

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.

func (*OrgMembership) Value

func (om *OrgMembership) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the OrgMembership. This includes values selected through modifiers, order, etc.

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

Create returns a builder for creating a OrgMembership entity.

func (*OrgMembershipClient) CreateBulk

CreateBulk returns a builder for creating a bulk of OrgMembership entities.

func (*OrgMembershipClient) Delete

Delete returns a delete builder for OrgMembership.

func (*OrgMembershipClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OrgMembershipClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*OrgMembershipClient) Get

Get returns a OrgMembership entity by its id.

func (*OrgMembershipClient) GetX

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

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

Update returns an update builder for OrgMembership.

func (*OrgMembershipClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*OrgMembershipClient) UpdateOneID

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

Save creates the OrgMembership in the database.

func (*OrgMembershipCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*OrgMembershipCreate) SetID

SetID sets the "id" field.

func (*OrgMembershipCreate) SetInput

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

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

Save creates the OrgMembership entities in the database.

func (*OrgMembershipCreateBulk) SaveX

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

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

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

func (s *OrgMembershipGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OrgMembershipGroupBy) BoolX

func (s *OrgMembershipGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OrgMembershipGroupBy) Bools

func (s *OrgMembershipGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OrgMembershipGroupBy) BoolsX

func (s *OrgMembershipGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OrgMembershipGroupBy) Float64

func (s *OrgMembershipGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OrgMembershipGroupBy) Float64X

func (s *OrgMembershipGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OrgMembershipGroupBy) Float64s

func (s *OrgMembershipGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OrgMembershipGroupBy) Float64sX

func (s *OrgMembershipGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OrgMembershipGroupBy) Int

func (s *OrgMembershipGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OrgMembershipGroupBy) IntX

func (s *OrgMembershipGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OrgMembershipGroupBy) Ints

func (s *OrgMembershipGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OrgMembershipGroupBy) IntsX

func (s *OrgMembershipGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

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) ScanX

func (s *OrgMembershipGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OrgMembershipGroupBy) String

func (s *OrgMembershipGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OrgMembershipGroupBy) StringX

func (s *OrgMembershipGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OrgMembershipGroupBy) Strings

func (s *OrgMembershipGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OrgMembershipGroupBy) StringsX

func (s *OrgMembershipGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

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

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

func (m *OrgMembershipMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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

func (m *OrgMembershipMutation) OldRole(ctx context.Context) (v enums.Role, err error)

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

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

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

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

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

OnlyX is like Only, but panics if an error occurs.

func (*OrgMembershipQuery) Order

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

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

func (s *OrgMembershipSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OrgMembershipSelect) BoolX

func (s *OrgMembershipSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OrgMembershipSelect) Bools

func (s *OrgMembershipSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OrgMembershipSelect) BoolsX

func (s *OrgMembershipSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OrgMembershipSelect) Float64

func (s *OrgMembershipSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OrgMembershipSelect) Float64X

func (s *OrgMembershipSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OrgMembershipSelect) Float64s

func (s *OrgMembershipSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OrgMembershipSelect) Float64sX

func (s *OrgMembershipSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OrgMembershipSelect) Int

func (s *OrgMembershipSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OrgMembershipSelect) IntX

func (s *OrgMembershipSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OrgMembershipSelect) Ints

func (s *OrgMembershipSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OrgMembershipSelect) IntsX

func (s *OrgMembershipSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

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) ScanX

func (s *OrgMembershipSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OrgMembershipSelect) String

func (s *OrgMembershipSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OrgMembershipSelect) StringX

func (s *OrgMembershipSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OrgMembershipSelect) Strings

func (s *OrgMembershipSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OrgMembershipSelect) StringsX

func (s *OrgMembershipSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

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

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

SetRole sets the "role" field.

func (*OrgMembershipUpdate) Where

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

Mutation returns the OrgMembershipMutation object of the builder.

func (*OrgMembershipUpdateOne) Save

Save executes the query and returns the updated OrgMembership entity.

func (*OrgMembershipUpdateOne) SaveX

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

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

SetRole sets the "role" field.

func (*OrgMembershipUpdateOne) Where

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

Filter applies the OrgMembershipWhereInput filter on the OrgMembershipQuery builder.

func (*OrgMembershipWhereInput) P

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.

func (*Organization) Value

func (o *Organization) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Organization. This includes values selected through modifiers, order, etc.

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

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

Delete returns a delete builder for Organization.

func (*OrganizationClient) DeleteOne

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

Get returns a Organization entity by its id.

func (*OrganizationClient) GetX

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

Query returns a query builder for Organization.

func (*OrganizationClient) Update

Update returns an update builder for Organization.

func (*OrganizationClient) UpdateOne

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

Save creates the Organization in the database.

func (*OrganizationCreate) SaveX

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

SetID sets the "id" field.

func (*OrganizationCreate) SetInput

SetInput applies the change-set in the CreateOrganizationInput on the OrganizationCreate builder.

func (*OrganizationCreate) SetName

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

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

Save creates the Organization entities in the database.

func (*OrganizationCreateBulk) SaveX

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

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

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

func (s *OrganizationGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OrganizationGroupBy) BoolX

func (s *OrganizationGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OrganizationGroupBy) Bools

func (s *OrganizationGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OrganizationGroupBy) BoolsX

func (s *OrganizationGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OrganizationGroupBy) Float64

func (s *OrganizationGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OrganizationGroupBy) Float64X

func (s *OrganizationGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OrganizationGroupBy) Float64s

func (s *OrganizationGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OrganizationGroupBy) Float64sX

func (s *OrganizationGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OrganizationGroupBy) Int

func (s *OrganizationGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OrganizationGroupBy) IntX

func (s *OrganizationGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OrganizationGroupBy) Ints

func (s *OrganizationGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OrganizationGroupBy) IntsX

func (s *OrganizationGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

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) ScanX

func (s *OrganizationGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OrganizationGroupBy) String

func (s *OrganizationGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OrganizationGroupBy) StringX

func (s *OrganizationGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OrganizationGroupBy) Strings

func (s *OrganizationGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OrganizationGroupBy) StringsX

func (s *OrganizationGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

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

func (m *OrganizationMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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

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

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

OnlyX is like Only, but panics if an error occurs.

func (*OrganizationQuery) Order

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

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

func (s *OrganizationSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OrganizationSelect) BoolX

func (s *OrganizationSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OrganizationSelect) Bools

func (s *OrganizationSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OrganizationSelect) BoolsX

func (s *OrganizationSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OrganizationSelect) Float64

func (s *OrganizationSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OrganizationSelect) Float64X

func (s *OrganizationSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OrganizationSelect) Float64s

func (s *OrganizationSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OrganizationSelect) Float64sX

func (s *OrganizationSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OrganizationSelect) Int

func (s *OrganizationSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OrganizationSelect) IntX

func (s *OrganizationSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OrganizationSelect) Ints

func (s *OrganizationSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OrganizationSelect) IntsX

func (s *OrganizationSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

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) ScanX

func (s *OrganizationSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OrganizationSelect) String

func (s *OrganizationSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OrganizationSelect) StringX

func (s *OrganizationSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OrganizationSelect) Strings

func (s *OrganizationSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OrganizationSelect) StringsX

func (s *OrganizationSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

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

SetInput applies the change-set in the UpdateOrganizationInput on the OrganizationUpdate builder.

func (*OrganizationUpdate) SetName

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

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

Mutation returns the OrganizationMutation object of the builder.

func (*OrganizationUpdateOne) Save

Save executes the query and returns the updated Organization entity.

func (*OrganizationUpdateOne) SaveX

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

SetInput applies the change-set in the UpdateOrganizationInput on the OrganizationUpdateOne builder.

func (*OrganizationUpdateOne) SetName

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

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

Filter applies the OrganizationWhereInput filter on the OrganizationQuery builder.

func (*OrganizationWhereInput) P

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 PageInfo

type PageInfo = entgql.PageInfo[string]

Common entgql types.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

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

type RollbackFunc func(context.Context, *Tx) error

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.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

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

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

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 Traverser

type Traverser = ent.Traverser

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

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type UpdateOrgMembershipInput

type UpdateOrgMembershipInput struct {
	Role *enums.Role
}

UpdateOrgMembershipInput represents a mutation input for updating orgmemberships.

func (*UpdateOrgMembershipInput) Mutate

Mutate applies the UpdateOrgMembershipInput on the OrgMembershipMutation builder.

type UpdateOrganizationInput

type UpdateOrganizationInput struct {
	Name             *string
	ClearDescription bool
	Description      *string
}

UpdateOrganizationInput represents a mutation input for updating organizations.

func (*UpdateOrganizationInput) Mutate

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.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis
Package enums has enums
Package enums has enums

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL