ent

package
v0.97.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeOrganization = "Organization"
	TypePlatform     = "Platform"
	TypeUser         = "User"
)

Variables

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.

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
	// Organization is the client for interacting with the Organization builders.
	Organization *OrganizationClient
	// Platform is the client for interacting with the Platform builders.
	Platform *PlatformClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// 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().
	Organization.
	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) 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(...)`.

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 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 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 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 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 Organization

type Organization struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CreatedByID holds the value of the "created_by_id" field.
	CreatedByID uuid.UUID `json:"created_by_id,omitempty"`
	// UpdatedByID holds the value of the "updated_by_id" field.
	UpdatedByID uuid.UUID `json:"updated_by_id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// DisplayName holds the value of the "display_name" field.
	DisplayName string `json:"display_name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the OrganizationQuery when eager-loading is set.
	Edges OrganizationEdges `json:"edges"`
	// contains filtered or unexported fields
}

Organization is the model entity for the Organization schema.

func (*Organization) QueryCreator

func (o *Organization) QueryCreator() *UserQuery

QueryCreator queries the "creator" edge of the Organization entity.

func (*Organization) QueryEditor

func (o *Organization) QueryEditor() *UserQuery

QueryEditor queries the "editor" edge of the Organization entity.

func (*Organization) QueryPlatforms

func (o *Organization) QueryPlatforms() *PlatformQuery

QueryPlatforms queries the "platforms" edge of the Organization entity.

func (*Organization) QueryUsers

func (o *Organization) QueryUsers() *UserQuery

QueryUsers queries the "users" edge of the Organization entity.

func (*Organization) String

func (o *Organization) String() string

String implements the fmt.Stringer.

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 uuid.UUID) *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) QueryCreator

func (c *OrganizationClient) QueryCreator(o *Organization) *UserQuery

QueryCreator queries the creator edge of a Organization.

func (*OrganizationClient) QueryEditor

func (c *OrganizationClient) QueryEditor(o *Organization) *UserQuery

QueryEditor queries the editor edge of a Organization.

func (*OrganizationClient) QueryPlatforms

func (c *OrganizationClient) QueryPlatforms(o *Organization) *PlatformQuery

QueryPlatforms queries the platforms edge of a Organization.

func (*OrganizationClient) QueryUsers

func (c *OrganizationClient) QueryUsers(o *Organization) *UserQuery

QueryUsers queries the users edge of a 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 uuid.UUID) *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 OrganizationCreate

type OrganizationCreate struct {
	// contains filtered or unexported fields
}

OrganizationCreate is the builder for creating a Organization entity.

func (*OrganizationCreate) AddPlatformIDs

func (oc *OrganizationCreate) AddPlatformIDs(ids ...uuid.UUID) *OrganizationCreate

AddPlatformIDs adds the "platforms" edge to the Platform entity by IDs.

func (*OrganizationCreate) AddPlatforms

func (oc *OrganizationCreate) AddPlatforms(p ...*Platform) *OrganizationCreate

AddPlatforms adds the "platforms" edges to the Platform entity.

func (*OrganizationCreate) AddUserIDs

func (oc *OrganizationCreate) AddUserIDs(ids ...uuid.UUID) *OrganizationCreate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*OrganizationCreate) AddUsers

func (oc *OrganizationCreate) AddUsers(u ...*User) *OrganizationCreate

AddUsers adds the "users" edges to the User 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) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Organization.Create().
	SetCreatedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.OrganizationUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*OrganizationCreate) OnConflictColumns

func (oc *OrganizationCreate) OnConflictColumns(columns ...string) *OrganizationUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Organization.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

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

func (oc *OrganizationCreate) SetCreatedAt(t time.Time) *OrganizationCreate

SetCreatedAt sets the "created_at" field.

func (*OrganizationCreate) SetCreatedByID

func (oc *OrganizationCreate) SetCreatedByID(u uuid.UUID) *OrganizationCreate

SetCreatedByID sets the "created_by_id" field.

func (*OrganizationCreate) SetCreator

func (oc *OrganizationCreate) SetCreator(u *User) *OrganizationCreate

SetCreator sets the "creator" edge to the User entity.

func (*OrganizationCreate) SetCreatorID

func (oc *OrganizationCreate) SetCreatorID(id uuid.UUID) *OrganizationCreate

SetCreatorID sets the "creator" edge to the User entity by ID.

func (*OrganizationCreate) SetDisplayName

func (oc *OrganizationCreate) SetDisplayName(s string) *OrganizationCreate

SetDisplayName sets the "display_name" field.

func (*OrganizationCreate) SetEditor

func (oc *OrganizationCreate) SetEditor(u *User) *OrganizationCreate

SetEditor sets the "editor" edge to the User entity.

func (*OrganizationCreate) SetEditorID

func (oc *OrganizationCreate) SetEditorID(id uuid.UUID) *OrganizationCreate

SetEditorID sets the "editor" edge to the User entity by ID.

func (*OrganizationCreate) SetID

SetID sets the "id" field.

func (*OrganizationCreate) SetName

SetName sets the "name" field.

func (*OrganizationCreate) SetNillableCreatedAt

func (oc *OrganizationCreate) SetNillableCreatedAt(t *time.Time) *OrganizationCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*OrganizationCreate) SetNillableID

func (oc *OrganizationCreate) SetNillableID(u *uuid.UUID) *OrganizationCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*OrganizationCreate) SetNillableUpdatedAt

func (oc *OrganizationCreate) SetNillableUpdatedAt(t *time.Time) *OrganizationCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*OrganizationCreate) SetUpdatedAt

func (oc *OrganizationCreate) SetUpdatedAt(t time.Time) *OrganizationCreate

SetUpdatedAt sets the "updated_at" field.

func (*OrganizationCreate) SetUpdatedByID

func (oc *OrganizationCreate) SetUpdatedByID(u uuid.UUID) *OrganizationCreate

SetUpdatedByID sets the "updated_by_id" field.

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

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Organization.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.OrganizationUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*OrganizationCreateBulk) OnConflictColumns

func (ocb *OrganizationCreateBulk) OnConflictColumns(columns ...string) *OrganizationUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Organization.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

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 OrganizationEdges

type OrganizationEdges struct {
	// Creator holds the value of the creator edge.
	Creator *User `json:"creator,omitempty"`
	// Editor holds the value of the editor edge.
	Editor *User `json:"editor,omitempty"`
	// Users holds the value of the users edge.
	Users []*User `json:"users,omitempty"`
	// Platforms holds the value of the platforms edge.
	Platforms []*Platform `json:"platforms,omitempty"`
	// contains filtered or unexported fields
}

OrganizationEdges holds the relations/edges for other nodes in the graph.

func (OrganizationEdges) CreatorOrErr

func (e OrganizationEdges) CreatorOrErr() (*User, error)

CreatorOrErr returns the Creator value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (OrganizationEdges) EditorOrErr

func (e OrganizationEdges) EditorOrErr() (*User, error)

EditorOrErr returns the Editor value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (OrganizationEdges) PlatformsOrErr

func (e OrganizationEdges) PlatformsOrErr() ([]*Platform, error)

PlatformsOrErr returns the Platforms value or an error if the edge was not loaded in eager-loading.

func (OrganizationEdges) UsersOrErr

func (e OrganizationEdges) UsersOrErr() ([]*User, error)

UsersOrErr returns the Users value or an error if the edge was not loaded in eager-loading.

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

func (m *OrganizationMutation) AddPlatformIDs(ids ...uuid.UUID)

AddPlatformIDs adds the "platforms" edge to the Platform entity by ids.

func (*OrganizationMutation) AddUserIDs

func (m *OrganizationMutation) AddUserIDs(ids ...uuid.UUID)

AddUserIDs adds the "users" edge to the User entity by ids.

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

func (m *OrganizationMutation) ClearCreator()

ClearCreator clears the "creator" edge to the User entity.

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

func (m *OrganizationMutation) ClearEditor()

ClearEditor clears the "editor" edge to the User entity.

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

func (m *OrganizationMutation) ClearPlatforms()

ClearPlatforms clears the "platforms" edge to the Platform entity.

func (*OrganizationMutation) ClearUsers

func (m *OrganizationMutation) ClearUsers()

ClearUsers clears the "users" edge to the User entity.

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

func (m *OrganizationMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*OrganizationMutation) CreatedByID

func (m *OrganizationMutation) CreatedByID() (r uuid.UUID, exists bool)

CreatedByID returns the value of the "created_by_id" field in the mutation.

func (*OrganizationMutation) CreatorCleared

func (m *OrganizationMutation) CreatorCleared() bool

CreatorCleared reports if the "creator" edge to the User entity was cleared.

func (*OrganizationMutation) CreatorID

func (m *OrganizationMutation) CreatorID() (id uuid.UUID, exists bool)

CreatorID returns the "creator" edge ID in the mutation.

func (*OrganizationMutation) CreatorIDs

func (m *OrganizationMutation) CreatorIDs() (ids []uuid.UUID)

CreatorIDs returns the "creator" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CreatorID instead. It exists only for internal usage by the builders.

func (*OrganizationMutation) DisplayName

func (m *OrganizationMutation) DisplayName() (r string, exists bool)

DisplayName returns the value of the "display_name" field in the 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) EditorCleared

func (m *OrganizationMutation) EditorCleared() bool

EditorCleared reports if the "editor" edge to the User entity was cleared.

func (*OrganizationMutation) EditorID

func (m *OrganizationMutation) EditorID() (id uuid.UUID, exists bool)

EditorID returns the "editor" edge ID in the mutation.

func (*OrganizationMutation) EditorIDs

func (m *OrganizationMutation) EditorIDs() (ids []uuid.UUID)

EditorIDs returns the "editor" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use EditorID instead. It exists only for internal usage by the builders.

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 uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*OrganizationMutation) 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 (*OrganizationMutation) Name

func (m *OrganizationMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*OrganizationMutation) OldCreatedAt

func (m *OrganizationMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" 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) OldCreatedByID

func (m *OrganizationMutation) OldCreatedByID(ctx context.Context) (v uuid.UUID, err error)

OldCreatedByID returns the old "created_by_id" 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) OldDisplayName

func (m *OrganizationMutation) OldDisplayName(ctx context.Context) (v string, err error)

OldDisplayName returns the old "display_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) 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) OldUpdatedAt

func (m *OrganizationMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" 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) OldUpdatedByID

func (m *OrganizationMutation) OldUpdatedByID(ctx context.Context) (v uuid.UUID, err error)

OldUpdatedByID returns the old "updated_by_id" 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) PlatformsCleared

func (m *OrganizationMutation) PlatformsCleared() bool

PlatformsCleared reports if the "platforms" edge to the Platform entity was cleared.

func (*OrganizationMutation) PlatformsIDs

func (m *OrganizationMutation) PlatformsIDs() (ids []uuid.UUID)

PlatformsIDs returns the "platforms" edge IDs in the mutation.

func (*OrganizationMutation) RemovePlatformIDs

func (m *OrganizationMutation) RemovePlatformIDs(ids ...uuid.UUID)

RemovePlatformIDs removes the "platforms" edge to the Platform entity by IDs.

func (*OrganizationMutation) RemoveUserIDs

func (m *OrganizationMutation) RemoveUserIDs(ids ...uuid.UUID)

RemoveUserIDs removes the "users" edge to the User entity by IDs.

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

func (m *OrganizationMutation) RemovedPlatformsIDs() (ids []uuid.UUID)

RemovedPlatforms returns the removed IDs of the "platforms" edge to the Platform entity.

func (*OrganizationMutation) RemovedUsersIDs

func (m *OrganizationMutation) RemovedUsersIDs() (ids []uuid.UUID)

RemovedUsers returns the removed IDs of the "users" edge to the User entity.

func (*OrganizationMutation) ResetCreatedAt

func (m *OrganizationMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*OrganizationMutation) ResetCreatedByID

func (m *OrganizationMutation) ResetCreatedByID()

ResetCreatedByID resets all changes to the "created_by_id" field.

func (*OrganizationMutation) ResetCreator

func (m *OrganizationMutation) ResetCreator()

ResetCreator resets all changes to the "creator" edge.

func (*OrganizationMutation) ResetDisplayName

func (m *OrganizationMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" 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) ResetEditor

func (m *OrganizationMutation) ResetEditor()

ResetEditor resets all changes to the "editor" edge.

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

func (m *OrganizationMutation) ResetPlatforms()

ResetPlatforms resets all changes to the "platforms" edge.

func (*OrganizationMutation) ResetUpdatedAt

func (m *OrganizationMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*OrganizationMutation) ResetUpdatedByID

func (m *OrganizationMutation) ResetUpdatedByID()

ResetUpdatedByID resets all changes to the "updated_by_id" field.

func (*OrganizationMutation) ResetUsers

func (m *OrganizationMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*OrganizationMutation) SetCreatedAt

func (m *OrganizationMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*OrganizationMutation) SetCreatedByID

func (m *OrganizationMutation) SetCreatedByID(u uuid.UUID)

SetCreatedByID sets the "created_by_id" field.

func (*OrganizationMutation) SetCreatorID

func (m *OrganizationMutation) SetCreatorID(id uuid.UUID)

SetCreatorID sets the "creator" edge to the User entity by id.

func (*OrganizationMutation) SetDisplayName

func (m *OrganizationMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" field.

func (*OrganizationMutation) SetEditorID

func (m *OrganizationMutation) SetEditorID(id uuid.UUID)

SetEditorID sets the "editor" edge to the User entity by id.

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 uuid.UUID)

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

func (m *OrganizationMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*OrganizationMutation) SetUpdatedByID

func (m *OrganizationMutation) SetUpdatedByID(u uuid.UUID)

SetUpdatedByID sets the "updated_by_id" field.

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

func (m *OrganizationMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*OrganizationMutation) UpdatedByID

func (m *OrganizationMutation) UpdatedByID() (r uuid.UUID, exists bool)

UpdatedByID returns the value of the "updated_by_id" field in the mutation.

func (*OrganizationMutation) UsersCleared

func (m *OrganizationMutation) UsersCleared() bool

UsersCleared reports if the "users" edge to the User entity was cleared.

func (*OrganizationMutation) UsersIDs

func (m *OrganizationMutation) UsersIDs() (ids []uuid.UUID)

UsersIDs returns the "users" edge IDs in the mutation.

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 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) 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) 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 uuid.UUID, 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) uuid.UUID

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Organization.Query().
	GroupBy(organization.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*OrganizationQuery) IDs

func (oq *OrganizationQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Organization IDs.

func (*OrganizationQuery) IDsX

func (oq *OrganizationQuery) IDsX(ctx context.Context) []uuid.UUID

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 uuid.UUID, 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) uuid.UUID

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

func (oq *OrganizationQuery) QueryCreator() *UserQuery

QueryCreator chains the current query on the "creator" edge.

func (*OrganizationQuery) QueryEditor

func (oq *OrganizationQuery) QueryEditor() *UserQuery

QueryEditor chains the current query on the "editor" edge.

func (*OrganizationQuery) QueryPlatforms

func (oq *OrganizationQuery) QueryPlatforms() *PlatformQuery

QueryPlatforms chains the current query on the "platforms" edge.

func (*OrganizationQuery) QueryUsers

func (oq *OrganizationQuery) QueryUsers() *UserQuery

QueryUsers chains the current query on the "users" edge.

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Organization.Query().
	Select(organization.FieldCreatedAt).
	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.

func (*OrganizationQuery) WithCreator

func (oq *OrganizationQuery) WithCreator(opts ...func(*UserQuery)) *OrganizationQuery

WithCreator tells the query-builder to eager-load the nodes that are connected to the "creator" edge. The optional arguments are used to configure the query builder of the edge.

func (*OrganizationQuery) WithEditor

func (oq *OrganizationQuery) WithEditor(opts ...func(*UserQuery)) *OrganizationQuery

WithEditor tells the query-builder to eager-load the nodes that are connected to the "editor" edge. The optional arguments are used to configure the query builder of the edge.

func (*OrganizationQuery) WithPlatforms

func (oq *OrganizationQuery) WithPlatforms(opts ...func(*PlatformQuery)) *OrganizationQuery

WithPlatforms tells the query-builder to eager-load the nodes that are connected to the "platforms" edge. The optional arguments are used to configure the query builder of the edge.

func (*OrganizationQuery) WithUsers

func (oq *OrganizationQuery) WithUsers(opts ...func(*UserQuery)) *OrganizationQuery

WithUsers tells the query-builder to eager-load the nodes that are connected to the "users" edge. The optional arguments are used to configure the query builder of the edge.

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

func (ou *OrganizationUpdate) AddPlatformIDs(ids ...uuid.UUID) *OrganizationUpdate

AddPlatformIDs adds the "platforms" edge to the Platform entity by IDs.

func (*OrganizationUpdate) AddPlatforms

func (ou *OrganizationUpdate) AddPlatforms(p ...*Platform) *OrganizationUpdate

AddPlatforms adds the "platforms" edges to the Platform entity.

func (*OrganizationUpdate) AddUserIDs

func (ou *OrganizationUpdate) AddUserIDs(ids ...uuid.UUID) *OrganizationUpdate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*OrganizationUpdate) AddUsers

func (ou *OrganizationUpdate) AddUsers(u ...*User) *OrganizationUpdate

AddUsers adds the "users" edges to the User entity.

func (*OrganizationUpdate) ClearEditor

func (ou *OrganizationUpdate) ClearEditor() *OrganizationUpdate

ClearEditor clears the "editor" edge to the User entity.

func (*OrganizationUpdate) ClearPlatforms

func (ou *OrganizationUpdate) ClearPlatforms() *OrganizationUpdate

ClearPlatforms clears all "platforms" edges to the Platform entity.

func (*OrganizationUpdate) ClearUsers

func (ou *OrganizationUpdate) ClearUsers() *OrganizationUpdate

ClearUsers clears all "users" edges to the User entity.

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

func (ou *OrganizationUpdate) RemovePlatformIDs(ids ...uuid.UUID) *OrganizationUpdate

RemovePlatformIDs removes the "platforms" edge to Platform entities by IDs.

func (*OrganizationUpdate) RemovePlatforms

func (ou *OrganizationUpdate) RemovePlatforms(p ...*Platform) *OrganizationUpdate

RemovePlatforms removes "platforms" edges to Platform entities.

func (*OrganizationUpdate) RemoveUserIDs

func (ou *OrganizationUpdate) RemoveUserIDs(ids ...uuid.UUID) *OrganizationUpdate

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*OrganizationUpdate) RemoveUsers

func (ou *OrganizationUpdate) RemoveUsers(u ...*User) *OrganizationUpdate

RemoveUsers removes "users" edges to User entities.

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

func (ou *OrganizationUpdate) SetDisplayName(s string) *OrganizationUpdate

SetDisplayName sets the "display_name" field.

func (*OrganizationUpdate) SetEditor

func (ou *OrganizationUpdate) SetEditor(u *User) *OrganizationUpdate

SetEditor sets the "editor" edge to the User entity.

func (*OrganizationUpdate) SetEditorID

func (ou *OrganizationUpdate) SetEditorID(id uuid.UUID) *OrganizationUpdate

SetEditorID sets the "editor" edge to the User entity by ID.

func (*OrganizationUpdate) SetName

SetName sets the "name" field.

func (*OrganizationUpdate) SetNillableDisplayName

func (ou *OrganizationUpdate) SetNillableDisplayName(s *string) *OrganizationUpdate

SetNillableDisplayName sets the "display_name" 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) SetNillableUpdatedByID

func (ou *OrganizationUpdate) SetNillableUpdatedByID(u *uuid.UUID) *OrganizationUpdate

SetNillableUpdatedByID sets the "updated_by_id" field if the given value is not nil.

func (*OrganizationUpdate) SetUpdatedAt

func (ou *OrganizationUpdate) SetUpdatedAt(t time.Time) *OrganizationUpdate

SetUpdatedAt sets the "updated_at" field.

func (*OrganizationUpdate) SetUpdatedByID

func (ou *OrganizationUpdate) SetUpdatedByID(u uuid.UUID) *OrganizationUpdate

SetUpdatedByID sets the "updated_by_id" field.

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

func (ouo *OrganizationUpdateOne) AddPlatformIDs(ids ...uuid.UUID) *OrganizationUpdateOne

AddPlatformIDs adds the "platforms" edge to the Platform entity by IDs.

func (*OrganizationUpdateOne) AddPlatforms

func (ouo *OrganizationUpdateOne) AddPlatforms(p ...*Platform) *OrganizationUpdateOne

AddPlatforms adds the "platforms" edges to the Platform entity.

func (*OrganizationUpdateOne) AddUserIDs

func (ouo *OrganizationUpdateOne) AddUserIDs(ids ...uuid.UUID) *OrganizationUpdateOne

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*OrganizationUpdateOne) AddUsers

func (ouo *OrganizationUpdateOne) AddUsers(u ...*User) *OrganizationUpdateOne

AddUsers adds the "users" edges to the User entity.

func (*OrganizationUpdateOne) ClearEditor

func (ouo *OrganizationUpdateOne) ClearEditor() *OrganizationUpdateOne

ClearEditor clears the "editor" edge to the User entity.

func (*OrganizationUpdateOne) ClearPlatforms

func (ouo *OrganizationUpdateOne) ClearPlatforms() *OrganizationUpdateOne

ClearPlatforms clears all "platforms" edges to the Platform entity.

func (*OrganizationUpdateOne) ClearUsers

func (ouo *OrganizationUpdateOne) ClearUsers() *OrganizationUpdateOne

ClearUsers clears all "users" edges to the User entity.

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

func (ouo *OrganizationUpdateOne) RemovePlatformIDs(ids ...uuid.UUID) *OrganizationUpdateOne

RemovePlatformIDs removes the "platforms" edge to Platform entities by IDs.

func (*OrganizationUpdateOne) RemovePlatforms

func (ouo *OrganizationUpdateOne) RemovePlatforms(p ...*Platform) *OrganizationUpdateOne

RemovePlatforms removes "platforms" edges to Platform entities.

func (*OrganizationUpdateOne) RemoveUserIDs

func (ouo *OrganizationUpdateOne) RemoveUserIDs(ids ...uuid.UUID) *OrganizationUpdateOne

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*OrganizationUpdateOne) RemoveUsers

func (ouo *OrganizationUpdateOne) RemoveUsers(u ...*User) *OrganizationUpdateOne

RemoveUsers removes "users" edges to User entities.

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

func (ouo *OrganizationUpdateOne) SetDisplayName(s string) *OrganizationUpdateOne

SetDisplayName sets the "display_name" field.

func (*OrganizationUpdateOne) SetEditor

func (ouo *OrganizationUpdateOne) SetEditor(u *User) *OrganizationUpdateOne

SetEditor sets the "editor" edge to the User entity.

func (*OrganizationUpdateOne) SetEditorID

func (ouo *OrganizationUpdateOne) SetEditorID(id uuid.UUID) *OrganizationUpdateOne

SetEditorID sets the "editor" edge to the User entity by ID.

func (*OrganizationUpdateOne) SetName

SetName sets the "name" field.

func (*OrganizationUpdateOne) SetNillableDisplayName

func (ouo *OrganizationUpdateOne) SetNillableDisplayName(s *string) *OrganizationUpdateOne

SetNillableDisplayName sets the "display_name" 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) SetNillableUpdatedByID

func (ouo *OrganizationUpdateOne) SetNillableUpdatedByID(u *uuid.UUID) *OrganizationUpdateOne

SetNillableUpdatedByID sets the "updated_by_id" field if the given value is not nil.

func (*OrganizationUpdateOne) SetUpdatedAt

func (ouo *OrganizationUpdateOne) SetUpdatedAt(t time.Time) *OrganizationUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*OrganizationUpdateOne) SetUpdatedByID

func (ouo *OrganizationUpdateOne) SetUpdatedByID(u uuid.UUID) *OrganizationUpdateOne

SetUpdatedByID sets the "updated_by_id" field.

func (*OrganizationUpdateOne) Where

Where appends a list predicates to the OrganizationUpdate builder.

type OrganizationUpsert

type OrganizationUpsert struct {
	*sql.UpdateSet
}

OrganizationUpsert is the "OnConflict" setter.

func (*OrganizationUpsert) SetDisplayName

func (u *OrganizationUpsert) SetDisplayName(v string) *OrganizationUpsert

SetDisplayName sets the "display_name" field.

func (*OrganizationUpsert) SetName

SetName sets the "name" field.

func (*OrganizationUpsert) SetUpdatedAt

func (u *OrganizationUpsert) SetUpdatedAt(v time.Time) *OrganizationUpsert

SetUpdatedAt sets the "updated_at" field.

func (*OrganizationUpsert) SetUpdatedByID

func (u *OrganizationUpsert) SetUpdatedByID(v uuid.UUID) *OrganizationUpsert

SetUpdatedByID sets the "updated_by_id" field.

func (*OrganizationUpsert) UpdateDisplayName

func (u *OrganizationUpsert) UpdateDisplayName() *OrganizationUpsert

UpdateDisplayName sets the "display_name" field to the value that was provided on create.

func (*OrganizationUpsert) UpdateName

func (u *OrganizationUpsert) UpdateName() *OrganizationUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*OrganizationUpsert) UpdateUpdatedAt

func (u *OrganizationUpsert) UpdateUpdatedAt() *OrganizationUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*OrganizationUpsert) UpdateUpdatedByID

func (u *OrganizationUpsert) UpdateUpdatedByID() *OrganizationUpsert

UpdateUpdatedByID sets the "updated_by_id" field to the value that was provided on create.

type OrganizationUpsertBulk

type OrganizationUpsertBulk struct {
	// contains filtered or unexported fields
}

OrganizationUpsertBulk is the builder for "upsert"-ing a bulk of Organization nodes.

func (*OrganizationUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*OrganizationUpsertBulk) Exec

Exec executes the query.

func (*OrganizationUpsertBulk) ExecX

func (u *OrganizationUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrganizationUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Organization.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*OrganizationUpsertBulk) SetDisplayName

SetDisplayName sets the "display_name" field.

func (*OrganizationUpsertBulk) SetName

SetName sets the "name" field.

func (*OrganizationUpsertBulk) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*OrganizationUpsertBulk) SetUpdatedByID

SetUpdatedByID sets the "updated_by_id" field.

func (*OrganizationUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the OrganizationCreateBulk.OnConflict documentation for more info.

func (*OrganizationUpsertBulk) UpdateDisplayName

func (u *OrganizationUpsertBulk) UpdateDisplayName() *OrganizationUpsertBulk

UpdateDisplayName sets the "display_name" field to the value that was provided on create.

func (*OrganizationUpsertBulk) UpdateName

UpdateName sets the "name" field to the value that was provided on create.

func (*OrganizationUpsertBulk) UpdateNewValues

func (u *OrganizationUpsertBulk) UpdateNewValues() *OrganizationUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Organization.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(organization.FieldID)
		}),
	).
	Exec(ctx)

func (*OrganizationUpsertBulk) UpdateUpdatedAt

func (u *OrganizationUpsertBulk) UpdateUpdatedAt() *OrganizationUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*OrganizationUpsertBulk) UpdateUpdatedByID

func (u *OrganizationUpsertBulk) UpdateUpdatedByID() *OrganizationUpsertBulk

UpdateUpdatedByID sets the "updated_by_id" field to the value that was provided on create.

type OrganizationUpsertOne

type OrganizationUpsertOne struct {
	// contains filtered or unexported fields
}

OrganizationUpsertOne is the builder for "upsert"-ing

one Organization node.

func (*OrganizationUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*OrganizationUpsertOne) Exec

Exec executes the query.

func (*OrganizationUpsertOne) ExecX

func (u *OrganizationUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrganizationUpsertOne) ID

func (u *OrganizationUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*OrganizationUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*OrganizationUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Organization.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*OrganizationUpsertOne) SetDisplayName

func (u *OrganizationUpsertOne) SetDisplayName(v string) *OrganizationUpsertOne

SetDisplayName sets the "display_name" field.

func (*OrganizationUpsertOne) SetName

SetName sets the "name" field.

func (*OrganizationUpsertOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*OrganizationUpsertOne) SetUpdatedByID

func (u *OrganizationUpsertOne) SetUpdatedByID(v uuid.UUID) *OrganizationUpsertOne

SetUpdatedByID sets the "updated_by_id" field.

func (*OrganizationUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the OrganizationCreate.OnConflict documentation for more info.

func (*OrganizationUpsertOne) UpdateDisplayName

func (u *OrganizationUpsertOne) UpdateDisplayName() *OrganizationUpsertOne

UpdateDisplayName sets the "display_name" field to the value that was provided on create.

func (*OrganizationUpsertOne) UpdateName

UpdateName sets the "name" field to the value that was provided on create.

func (*OrganizationUpsertOne) UpdateNewValues

func (u *OrganizationUpsertOne) UpdateNewValues() *OrganizationUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Organization.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(organization.FieldID)
		}),
	).
	Exec(ctx)

func (*OrganizationUpsertOne) UpdateUpdatedAt

func (u *OrganizationUpsertOne) UpdateUpdatedAt() *OrganizationUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*OrganizationUpsertOne) UpdateUpdatedByID

func (u *OrganizationUpsertOne) UpdateUpdatedByID() *OrganizationUpsertOne

UpdateUpdatedByID sets the "updated_by_id" field to the value that was provided on create.

type Organizations

type Organizations []*Organization

Organizations is a parsable slice of Organization.

type Platform

type Platform struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CreatedByID holds the value of the "created_by_id" field.
	CreatedByID uuid.UUID `json:"created_by_id,omitempty"`
	// UpdatedByID holds the value of the "updated_by_id" field.
	UpdatedByID uuid.UUID `json:"updated_by_id,omitempty"`
	// OrgID holds the value of the "org_id" field.
	OrgID uuid.UUID `json:"org_id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// DisplayName holds the value of the "display_name" field.
	DisplayName string `json:"display_name,omitempty"`
	// JSON representation of FormlyFormConfig[] refer to https://github.com/holos-run/holos/issues/161
	Form *storage.Form `json:"form,omitempty"`
	// JSON representation of the form model which holds user input values refer to https://github.com/holos-run/holos/issues/161
	Model *storage.Model `json:"model,omitempty"`
	// CUE definition to vet the model against e.g. #PlatformConfig
	Cue []byte `json:"cue,omitempty"`
	// The definition name to vet config_values against config_cue e.g. '#PlatformSpec'
	CueDefinition string `json:"cue_definition,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PlatformQuery when eager-loading is set.
	Edges PlatformEdges `json:"edges"`
	// contains filtered or unexported fields
}

Platform is the model entity for the Platform schema.

func (*Platform) QueryCreator

func (pl *Platform) QueryCreator() *UserQuery

QueryCreator queries the "creator" edge of the Platform entity.

func (*Platform) QueryEditor

func (pl *Platform) QueryEditor() *UserQuery

QueryEditor queries the "editor" edge of the Platform entity.

func (*Platform) QueryOrganization

func (pl *Platform) QueryOrganization() *OrganizationQuery

QueryOrganization queries the "organization" edge of the Platform entity.

func (*Platform) String

func (pl *Platform) String() string

String implements the fmt.Stringer.

func (*Platform) Unwrap

func (pl *Platform) Unwrap() *Platform

Unwrap unwraps the Platform 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 (*Platform) Update

func (pl *Platform) Update() *PlatformUpdateOne

Update returns a builder for updating this Platform. Note that you need to call Platform.Unwrap() before calling this method if this Platform was returned from a transaction, and the transaction was committed or rolled back.

func (*Platform) Value

func (pl *Platform) Value(name string) (ent.Value, error)

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

type PlatformClient

type PlatformClient struct {
	// contains filtered or unexported fields
}

PlatformClient is a client for the Platform schema.

func NewPlatformClient

func NewPlatformClient(c config) *PlatformClient

NewPlatformClient returns a client for the Platform from the given config.

func (*PlatformClient) Create

func (c *PlatformClient) Create() *PlatformCreate

Create returns a builder for creating a Platform entity.

func (*PlatformClient) CreateBulk

func (c *PlatformClient) CreateBulk(builders ...*PlatformCreate) *PlatformCreateBulk

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

func (*PlatformClient) Delete

func (c *PlatformClient) Delete() *PlatformDelete

Delete returns a delete builder for Platform.

func (*PlatformClient) DeleteOne

func (c *PlatformClient) DeleteOne(pl *Platform) *PlatformDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PlatformClient) DeleteOneID

func (c *PlatformClient) DeleteOneID(id uuid.UUID) *PlatformDeleteOne

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

func (*PlatformClient) Get

func (c *PlatformClient) Get(ctx context.Context, id uuid.UUID) (*Platform, error)

Get returns a Platform entity by its id.

func (*PlatformClient) GetX

func (c *PlatformClient) GetX(ctx context.Context, id uuid.UUID) *Platform

GetX is like Get, but panics if an error occurs.

func (*PlatformClient) Hooks

func (c *PlatformClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PlatformClient) Intercept

func (c *PlatformClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `platform.Intercept(f(g(h())))`.

func (*PlatformClient) Interceptors

func (c *PlatformClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PlatformClient) MapCreateBulk

func (c *PlatformClient) MapCreateBulk(slice any, setFunc func(*PlatformCreate, int)) *PlatformCreateBulk

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 (*PlatformClient) Query

func (c *PlatformClient) Query() *PlatformQuery

Query returns a query builder for Platform.

func (*PlatformClient) QueryCreator

func (c *PlatformClient) QueryCreator(pl *Platform) *UserQuery

QueryCreator queries the creator edge of a Platform.

func (*PlatformClient) QueryEditor

func (c *PlatformClient) QueryEditor(pl *Platform) *UserQuery

QueryEditor queries the editor edge of a Platform.

func (*PlatformClient) QueryOrganization

func (c *PlatformClient) QueryOrganization(pl *Platform) *OrganizationQuery

QueryOrganization queries the organization edge of a Platform.

func (*PlatformClient) Update

func (c *PlatformClient) Update() *PlatformUpdate

Update returns an update builder for Platform.

func (*PlatformClient) UpdateOne

func (c *PlatformClient) UpdateOne(pl *Platform) *PlatformUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PlatformClient) UpdateOneID

func (c *PlatformClient) UpdateOneID(id uuid.UUID) *PlatformUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PlatformClient) Use

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

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `platform.Hooks(f(g(h())))`.

type PlatformCreate

type PlatformCreate struct {
	// contains filtered or unexported fields
}

PlatformCreate is the builder for creating a Platform entity.

func (*PlatformCreate) Exec

func (pc *PlatformCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PlatformCreate) ExecX

func (pc *PlatformCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PlatformCreate) Mutation

func (pc *PlatformCreate) Mutation() *PlatformMutation

Mutation returns the PlatformMutation object of the builder.

func (*PlatformCreate) OnConflict

func (pc *PlatformCreate) OnConflict(opts ...sql.ConflictOption) *PlatformUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Platform.Create().
	SetCreatedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.PlatformUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*PlatformCreate) OnConflictColumns

func (pc *PlatformCreate) OnConflictColumns(columns ...string) *PlatformUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Platform.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*PlatformCreate) Save

func (pc *PlatformCreate) Save(ctx context.Context) (*Platform, error)

Save creates the Platform in the database.

func (*PlatformCreate) SaveX

func (pc *PlatformCreate) SaveX(ctx context.Context) *Platform

SaveX calls Save and panics if Save returns an error.

func (*PlatformCreate) SetCreatedAt

func (pc *PlatformCreate) SetCreatedAt(t time.Time) *PlatformCreate

SetCreatedAt sets the "created_at" field.

func (*PlatformCreate) SetCreatedByID

func (pc *PlatformCreate) SetCreatedByID(u uuid.UUID) *PlatformCreate

SetCreatedByID sets the "created_by_id" field.

func (*PlatformCreate) SetCreator

func (pc *PlatformCreate) SetCreator(u *User) *PlatformCreate

SetCreator sets the "creator" edge to the User entity.

func (*PlatformCreate) SetCreatorID

func (pc *PlatformCreate) SetCreatorID(id uuid.UUID) *PlatformCreate

SetCreatorID sets the "creator" edge to the User entity by ID.

func (*PlatformCreate) SetCue

func (pc *PlatformCreate) SetCue(b []byte) *PlatformCreate

SetCue sets the "cue" field.

func (*PlatformCreate) SetCueDefinition

func (pc *PlatformCreate) SetCueDefinition(s string) *PlatformCreate

SetCueDefinition sets the "cue_definition" field.

func (*PlatformCreate) SetDisplayName

func (pc *PlatformCreate) SetDisplayName(s string) *PlatformCreate

SetDisplayName sets the "display_name" field.

func (*PlatformCreate) SetEditor

func (pc *PlatformCreate) SetEditor(u *User) *PlatformCreate

SetEditor sets the "editor" edge to the User entity.

func (*PlatformCreate) SetEditorID

func (pc *PlatformCreate) SetEditorID(id uuid.UUID) *PlatformCreate

SetEditorID sets the "editor" edge to the User entity by ID.

func (*PlatformCreate) SetForm

func (pc *PlatformCreate) SetForm(s *storage.Form) *PlatformCreate

SetForm sets the "form" field.

func (*PlatformCreate) SetID

func (pc *PlatformCreate) SetID(u uuid.UUID) *PlatformCreate

SetID sets the "id" field.

func (*PlatformCreate) SetModel

func (pc *PlatformCreate) SetModel(s *storage.Model) *PlatformCreate

SetModel sets the "model" field.

func (*PlatformCreate) SetName

func (pc *PlatformCreate) SetName(s string) *PlatformCreate

SetName sets the "name" field.

func (*PlatformCreate) SetNillableCreatedAt

func (pc *PlatformCreate) SetNillableCreatedAt(t *time.Time) *PlatformCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PlatformCreate) SetNillableCueDefinition

func (pc *PlatformCreate) SetNillableCueDefinition(s *string) *PlatformCreate

SetNillableCueDefinition sets the "cue_definition" field if the given value is not nil.

func (*PlatformCreate) SetNillableID

func (pc *PlatformCreate) SetNillableID(u *uuid.UUID) *PlatformCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*PlatformCreate) SetNillableUpdatedAt

func (pc *PlatformCreate) SetNillableUpdatedAt(t *time.Time) *PlatformCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*PlatformCreate) SetOrgID

func (pc *PlatformCreate) SetOrgID(u uuid.UUID) *PlatformCreate

SetOrgID sets the "org_id" field.

func (*PlatformCreate) SetOrganization

func (pc *PlatformCreate) SetOrganization(o *Organization) *PlatformCreate

SetOrganization sets the "organization" edge to the Organization entity.

func (*PlatformCreate) SetOrganizationID

func (pc *PlatformCreate) SetOrganizationID(id uuid.UUID) *PlatformCreate

SetOrganizationID sets the "organization" edge to the Organization entity by ID.

func (*PlatformCreate) SetUpdatedAt

func (pc *PlatformCreate) SetUpdatedAt(t time.Time) *PlatformCreate

SetUpdatedAt sets the "updated_at" field.

func (*PlatformCreate) SetUpdatedByID

func (pc *PlatformCreate) SetUpdatedByID(u uuid.UUID) *PlatformCreate

SetUpdatedByID sets the "updated_by_id" field.

type PlatformCreateBulk

type PlatformCreateBulk struct {
	// contains filtered or unexported fields
}

PlatformCreateBulk is the builder for creating many Platform entities in bulk.

func (*PlatformCreateBulk) Exec

func (pcb *PlatformCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PlatformCreateBulk) ExecX

func (pcb *PlatformCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PlatformCreateBulk) OnConflict

func (pcb *PlatformCreateBulk) OnConflict(opts ...sql.ConflictOption) *PlatformUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Platform.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.PlatformUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*PlatformCreateBulk) OnConflictColumns

func (pcb *PlatformCreateBulk) OnConflictColumns(columns ...string) *PlatformUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Platform.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*PlatformCreateBulk) Save

func (pcb *PlatformCreateBulk) Save(ctx context.Context) ([]*Platform, error)

Save creates the Platform entities in the database.

func (*PlatformCreateBulk) SaveX

func (pcb *PlatformCreateBulk) SaveX(ctx context.Context) []*Platform

SaveX is like Save, but panics if an error occurs.

type PlatformDelete

type PlatformDelete struct {
	// contains filtered or unexported fields
}

PlatformDelete is the builder for deleting a Platform entity.

func (*PlatformDelete) Exec

func (pd *PlatformDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PlatformDelete) ExecX

func (pd *PlatformDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PlatformDelete) Where

func (pd *PlatformDelete) Where(ps ...predicate.Platform) *PlatformDelete

Where appends a list predicates to the PlatformDelete builder.

type PlatformDeleteOne

type PlatformDeleteOne struct {
	// contains filtered or unexported fields
}

PlatformDeleteOne is the builder for deleting a single Platform entity.

func (*PlatformDeleteOne) Exec

func (pdo *PlatformDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PlatformDeleteOne) ExecX

func (pdo *PlatformDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PlatformDeleteOne) Where

Where appends a list predicates to the PlatformDelete builder.

type PlatformEdges

type PlatformEdges struct {
	// Creator holds the value of the creator edge.
	Creator *User `json:"creator,omitempty"`
	// Editor holds the value of the editor edge.
	Editor *User `json:"editor,omitempty"`
	// Organization holds the value of the organization edge.
	Organization *Organization `json:"organization,omitempty"`
	// contains filtered or unexported fields
}

PlatformEdges holds the relations/edges for other nodes in the graph.

func (PlatformEdges) CreatorOrErr

func (e PlatformEdges) CreatorOrErr() (*User, error)

CreatorOrErr returns the Creator value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (PlatformEdges) EditorOrErr

func (e PlatformEdges) EditorOrErr() (*User, error)

EditorOrErr returns the Editor value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (PlatformEdges) OrganizationOrErr

func (e PlatformEdges) 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 PlatformGroupBy

type PlatformGroupBy struct {
	// contains filtered or unexported fields
}

PlatformGroupBy is the group-by builder for Platform entities.

func (*PlatformGroupBy) Aggregate

func (pgb *PlatformGroupBy) Aggregate(fns ...AggregateFunc) *PlatformGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PlatformGroupBy) Bool

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

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

func (*PlatformGroupBy) BoolX

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

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

func (*PlatformGroupBy) Bools

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

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

func (*PlatformGroupBy) BoolsX

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

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

func (*PlatformGroupBy) Float64

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

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

func (*PlatformGroupBy) Float64X

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

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

func (*PlatformGroupBy) Float64s

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

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

func (*PlatformGroupBy) Float64sX

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

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

func (*PlatformGroupBy) Int

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

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

func (*PlatformGroupBy) IntX

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

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

func (*PlatformGroupBy) Ints

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

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

func (*PlatformGroupBy) IntsX

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

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

func (*PlatformGroupBy) Scan

func (pgb *PlatformGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PlatformGroupBy) ScanX

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

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

func (*PlatformGroupBy) String

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

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

func (*PlatformGroupBy) StringX

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

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

func (*PlatformGroupBy) Strings

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

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

func (*PlatformGroupBy) StringsX

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

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

type PlatformMutation

type PlatformMutation struct {
	// contains filtered or unexported fields
}

PlatformMutation represents an operation that mutates the Platform nodes in the graph.

func (*PlatformMutation) AddField

func (m *PlatformMutation) 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 (*PlatformMutation) AddedEdges

func (m *PlatformMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PlatformMutation) AddedField

func (m *PlatformMutation) 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 (*PlatformMutation) AddedFields

func (m *PlatformMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PlatformMutation) AddedIDs

func (m *PlatformMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PlatformMutation) ClearCreator

func (m *PlatformMutation) ClearCreator()

ClearCreator clears the "creator" edge to the User entity.

func (*PlatformMutation) ClearCue

func (m *PlatformMutation) ClearCue()

ClearCue clears the value of the "cue" field.

func (*PlatformMutation) ClearCueDefinition

func (m *PlatformMutation) ClearCueDefinition()

ClearCueDefinition clears the value of the "cue_definition" field.

func (*PlatformMutation) ClearEdge

func (m *PlatformMutation) 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 (*PlatformMutation) ClearEditor

func (m *PlatformMutation) ClearEditor()

ClearEditor clears the "editor" edge to the User entity.

func (*PlatformMutation) ClearField

func (m *PlatformMutation) 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 (*PlatformMutation) ClearForm

func (m *PlatformMutation) ClearForm()

ClearForm clears the value of the "form" field.

func (*PlatformMutation) ClearModel

func (m *PlatformMutation) ClearModel()

ClearModel clears the value of the "model" field.

func (*PlatformMutation) ClearOrganization

func (m *PlatformMutation) ClearOrganization()

ClearOrganization clears the "organization" edge to the Organization entity.

func (*PlatformMutation) ClearedEdges

func (m *PlatformMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PlatformMutation) ClearedFields

func (m *PlatformMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PlatformMutation) Client

func (m PlatformMutation) 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 (*PlatformMutation) CreatedAt

func (m *PlatformMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PlatformMutation) CreatedByID

func (m *PlatformMutation) CreatedByID() (r uuid.UUID, exists bool)

CreatedByID returns the value of the "created_by_id" field in the mutation.

func (*PlatformMutation) CreatorCleared

func (m *PlatformMutation) CreatorCleared() bool

CreatorCleared reports if the "creator" edge to the User entity was cleared.

func (*PlatformMutation) CreatorID

func (m *PlatformMutation) CreatorID() (id uuid.UUID, exists bool)

CreatorID returns the "creator" edge ID in the mutation.

func (*PlatformMutation) CreatorIDs

func (m *PlatformMutation) CreatorIDs() (ids []uuid.UUID)

CreatorIDs returns the "creator" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CreatorID instead. It exists only for internal usage by the builders.

func (*PlatformMutation) Cue

func (m *PlatformMutation) Cue() (r []byte, exists bool)

Cue returns the value of the "cue" field in the mutation.

func (*PlatformMutation) CueCleared

func (m *PlatformMutation) CueCleared() bool

CueCleared returns if the "cue" field was cleared in this mutation.

func (*PlatformMutation) CueDefinition

func (m *PlatformMutation) CueDefinition() (r string, exists bool)

CueDefinition returns the value of the "cue_definition" field in the mutation.

func (*PlatformMutation) CueDefinitionCleared

func (m *PlatformMutation) CueDefinitionCleared() bool

CueDefinitionCleared returns if the "cue_definition" field was cleared in this mutation.

func (*PlatformMutation) DisplayName

func (m *PlatformMutation) DisplayName() (r string, exists bool)

DisplayName returns the value of the "display_name" field in the mutation.

func (*PlatformMutation) EdgeCleared

func (m *PlatformMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PlatformMutation) EditorCleared

func (m *PlatformMutation) EditorCleared() bool

EditorCleared reports if the "editor" edge to the User entity was cleared.

func (*PlatformMutation) EditorID

func (m *PlatformMutation) EditorID() (id uuid.UUID, exists bool)

EditorID returns the "editor" edge ID in the mutation.

func (*PlatformMutation) EditorIDs

func (m *PlatformMutation) EditorIDs() (ids []uuid.UUID)

EditorIDs returns the "editor" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use EditorID instead. It exists only for internal usage by the builders.

func (*PlatformMutation) Field

func (m *PlatformMutation) 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 (*PlatformMutation) FieldCleared

func (m *PlatformMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PlatformMutation) Fields

func (m *PlatformMutation) 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 (*PlatformMutation) Form

func (m *PlatformMutation) Form() (r *storage.Form, exists bool)

Form returns the value of the "form" field in the mutation.

func (*PlatformMutation) FormCleared

func (m *PlatformMutation) FormCleared() bool

FormCleared returns if the "form" field was cleared in this mutation.

func (*PlatformMutation) ID

func (m *PlatformMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*PlatformMutation) IDs

func (m *PlatformMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*PlatformMutation) Model

func (m *PlatformMutation) Model() (r *storage.Model, exists bool)

Model returns the value of the "model" field in the mutation.

func (*PlatformMutation) ModelCleared

func (m *PlatformMutation) ModelCleared() bool

ModelCleared returns if the "model" field was cleared in this mutation.

func (*PlatformMutation) Name

func (m *PlatformMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*PlatformMutation) OldCreatedAt

func (m *PlatformMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Platform entity. If the Platform 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 (*PlatformMutation) OldCreatedByID

func (m *PlatformMutation) OldCreatedByID(ctx context.Context) (v uuid.UUID, err error)

OldCreatedByID returns the old "created_by_id" field's value of the Platform entity. If the Platform 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 (*PlatformMutation) OldCue

func (m *PlatformMutation) OldCue(ctx context.Context) (v []byte, err error)

OldCue returns the old "cue" field's value of the Platform entity. If the Platform 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 (*PlatformMutation) OldCueDefinition

func (m *PlatformMutation) OldCueDefinition(ctx context.Context) (v string, err error)

OldCueDefinition returns the old "cue_definition" field's value of the Platform entity. If the Platform 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 (*PlatformMutation) OldDisplayName

func (m *PlatformMutation) OldDisplayName(ctx context.Context) (v string, err error)

OldDisplayName returns the old "display_name" field's value of the Platform entity. If the Platform 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 (*PlatformMutation) OldField

func (m *PlatformMutation) 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 (*PlatformMutation) OldForm

func (m *PlatformMutation) OldForm(ctx context.Context) (v *storage.Form, err error)

OldForm returns the old "form" field's value of the Platform entity. If the Platform 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 (*PlatformMutation) OldModel

func (m *PlatformMutation) OldModel(ctx context.Context) (v *storage.Model, err error)

OldModel returns the old "model" field's value of the Platform entity. If the Platform 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 (*PlatformMutation) OldName

func (m *PlatformMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Platform entity. If the Platform 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 (*PlatformMutation) OldOrgID

func (m *PlatformMutation) OldOrgID(ctx context.Context) (v uuid.UUID, err error)

OldOrgID returns the old "org_id" field's value of the Platform entity. If the Platform 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 (*PlatformMutation) OldUpdatedAt

func (m *PlatformMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Platform entity. If the Platform 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 (*PlatformMutation) OldUpdatedByID

func (m *PlatformMutation) OldUpdatedByID(ctx context.Context) (v uuid.UUID, err error)

OldUpdatedByID returns the old "updated_by_id" field's value of the Platform entity. If the Platform 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 (*PlatformMutation) Op

func (m *PlatformMutation) Op() Op

Op returns the operation name.

func (*PlatformMutation) OrgID

func (m *PlatformMutation) OrgID() (r uuid.UUID, exists bool)

OrgID returns the value of the "org_id" field in the mutation.

func (*PlatformMutation) OrganizationCleared

func (m *PlatformMutation) OrganizationCleared() bool

OrganizationCleared reports if the "organization" edge to the Organization entity was cleared.

func (*PlatformMutation) OrganizationID

func (m *PlatformMutation) OrganizationID() (id uuid.UUID, exists bool)

OrganizationID returns the "organization" edge ID in the mutation.

func (*PlatformMutation) OrganizationIDs

func (m *PlatformMutation) OrganizationIDs() (ids []uuid.UUID)

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 (*PlatformMutation) RemovedEdges

func (m *PlatformMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PlatformMutation) RemovedIDs

func (m *PlatformMutation) 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 (*PlatformMutation) ResetCreatedAt

func (m *PlatformMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PlatformMutation) ResetCreatedByID

func (m *PlatformMutation) ResetCreatedByID()

ResetCreatedByID resets all changes to the "created_by_id" field.

func (*PlatformMutation) ResetCreator

func (m *PlatformMutation) ResetCreator()

ResetCreator resets all changes to the "creator" edge.

func (*PlatformMutation) ResetCue

func (m *PlatformMutation) ResetCue()

ResetCue resets all changes to the "cue" field.

func (*PlatformMutation) ResetCueDefinition

func (m *PlatformMutation) ResetCueDefinition()

ResetCueDefinition resets all changes to the "cue_definition" field.

func (*PlatformMutation) ResetDisplayName

func (m *PlatformMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" field.

func (*PlatformMutation) ResetEdge

func (m *PlatformMutation) 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 (*PlatformMutation) ResetEditor

func (m *PlatformMutation) ResetEditor()

ResetEditor resets all changes to the "editor" edge.

func (*PlatformMutation) ResetField

func (m *PlatformMutation) 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 (*PlatformMutation) ResetForm

func (m *PlatformMutation) ResetForm()

ResetForm resets all changes to the "form" field.

func (*PlatformMutation) ResetModel

func (m *PlatformMutation) ResetModel()

ResetModel resets all changes to the "model" field.

func (*PlatformMutation) ResetName

func (m *PlatformMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*PlatformMutation) ResetOrgID

func (m *PlatformMutation) ResetOrgID()

ResetOrgID resets all changes to the "org_id" field.

func (*PlatformMutation) ResetOrganization

func (m *PlatformMutation) ResetOrganization()

ResetOrganization resets all changes to the "organization" edge.

func (*PlatformMutation) ResetUpdatedAt

func (m *PlatformMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PlatformMutation) ResetUpdatedByID

func (m *PlatformMutation) ResetUpdatedByID()

ResetUpdatedByID resets all changes to the "updated_by_id" field.

func (*PlatformMutation) SetCreatedAt

func (m *PlatformMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*PlatformMutation) SetCreatedByID

func (m *PlatformMutation) SetCreatedByID(u uuid.UUID)

SetCreatedByID sets the "created_by_id" field.

func (*PlatformMutation) SetCreatorID

func (m *PlatformMutation) SetCreatorID(id uuid.UUID)

SetCreatorID sets the "creator" edge to the User entity by id.

func (*PlatformMutation) SetCue

func (m *PlatformMutation) SetCue(b []byte)

SetCue sets the "cue" field.

func (*PlatformMutation) SetCueDefinition

func (m *PlatformMutation) SetCueDefinition(s string)

SetCueDefinition sets the "cue_definition" field.

func (*PlatformMutation) SetDisplayName

func (m *PlatformMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" field.

func (*PlatformMutation) SetEditorID

func (m *PlatformMutation) SetEditorID(id uuid.UUID)

SetEditorID sets the "editor" edge to the User entity by id.

func (*PlatformMutation) SetField

func (m *PlatformMutation) 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 (*PlatformMutation) SetForm

func (m *PlatformMutation) SetForm(s *storage.Form)

SetForm sets the "form" field.

func (*PlatformMutation) SetID

func (m *PlatformMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Platform entities.

func (*PlatformMutation) SetModel

func (m *PlatformMutation) SetModel(s *storage.Model)

SetModel sets the "model" field.

func (*PlatformMutation) SetName

func (m *PlatformMutation) SetName(s string)

SetName sets the "name" field.

func (*PlatformMutation) SetOp

func (m *PlatformMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PlatformMutation) SetOrgID

func (m *PlatformMutation) SetOrgID(u uuid.UUID)

SetOrgID sets the "org_id" field.

func (*PlatformMutation) SetOrganizationID

func (m *PlatformMutation) SetOrganizationID(id uuid.UUID)

SetOrganizationID sets the "organization" edge to the Organization entity by id.

func (*PlatformMutation) SetUpdatedAt

func (m *PlatformMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*PlatformMutation) SetUpdatedByID

func (m *PlatformMutation) SetUpdatedByID(u uuid.UUID)

SetUpdatedByID sets the "updated_by_id" field.

func (PlatformMutation) Tx

func (m PlatformMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PlatformMutation) Type

func (m *PlatformMutation) Type() string

Type returns the node type of this mutation (Platform).

func (*PlatformMutation) UpdatedAt

func (m *PlatformMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*PlatformMutation) UpdatedByID

func (m *PlatformMutation) UpdatedByID() (r uuid.UUID, exists bool)

UpdatedByID returns the value of the "updated_by_id" field in the mutation.

func (*PlatformMutation) Where

func (m *PlatformMutation) Where(ps ...predicate.Platform)

Where appends a list predicates to the PlatformMutation builder.

func (*PlatformMutation) WhereP

func (m *PlatformMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PlatformMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PlatformQuery

type PlatformQuery struct {
	// contains filtered or unexported fields
}

PlatformQuery is the builder for querying Platform entities.

func (*PlatformQuery) Aggregate

func (pq *PlatformQuery) Aggregate(fns ...AggregateFunc) *PlatformSelect

Aggregate returns a PlatformSelect configured with the given aggregations.

func (*PlatformQuery) All

func (pq *PlatformQuery) All(ctx context.Context) ([]*Platform, error)

All executes the query and returns a list of Platforms.

func (*PlatformQuery) AllX

func (pq *PlatformQuery) AllX(ctx context.Context) []*Platform

AllX is like All, but panics if an error occurs.

func (*PlatformQuery) Clone

func (pq *PlatformQuery) Clone() *PlatformQuery

Clone returns a duplicate of the PlatformQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PlatformQuery) Count

func (pq *PlatformQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PlatformQuery) CountX

func (pq *PlatformQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PlatformQuery) Exist

func (pq *PlatformQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PlatformQuery) ExistX

func (pq *PlatformQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PlatformQuery) First

func (pq *PlatformQuery) First(ctx context.Context) (*Platform, error)

First returns the first Platform entity from the query. Returns a *NotFoundError when no Platform was found.

func (*PlatformQuery) FirstID

func (pq *PlatformQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Platform ID from the query. Returns a *NotFoundError when no Platform ID was found.

func (*PlatformQuery) FirstIDX

func (pq *PlatformQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*PlatformQuery) FirstX

func (pq *PlatformQuery) FirstX(ctx context.Context) *Platform

FirstX is like First, but panics if an error occurs.

func (*PlatformQuery) GroupBy

func (pq *PlatformQuery) GroupBy(field string, fields ...string) *PlatformGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Platform.Query().
	GroupBy(platform.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PlatformQuery) IDs

func (pq *PlatformQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Platform IDs.

func (*PlatformQuery) IDsX

func (pq *PlatformQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*PlatformQuery) Limit

func (pq *PlatformQuery) Limit(limit int) *PlatformQuery

Limit the number of records to be returned by this query.

func (*PlatformQuery) Offset

func (pq *PlatformQuery) Offset(offset int) *PlatformQuery

Offset to start from.

func (*PlatformQuery) Only

func (pq *PlatformQuery) Only(ctx context.Context) (*Platform, error)

Only returns a single Platform entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Platform entity is found. Returns a *NotFoundError when no Platform entities are found.

func (*PlatformQuery) OnlyID

func (pq *PlatformQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Platform ID in the query. Returns a *NotSingularError when more than one Platform ID is found. Returns a *NotFoundError when no entities are found.

func (*PlatformQuery) OnlyIDX

func (pq *PlatformQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PlatformQuery) OnlyX

func (pq *PlatformQuery) OnlyX(ctx context.Context) *Platform

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

func (*PlatformQuery) Order

Order specifies how the records should be ordered.

func (*PlatformQuery) QueryCreator

func (pq *PlatformQuery) QueryCreator() *UserQuery

QueryCreator chains the current query on the "creator" edge.

func (*PlatformQuery) QueryEditor

func (pq *PlatformQuery) QueryEditor() *UserQuery

QueryEditor chains the current query on the "editor" edge.

func (*PlatformQuery) QueryOrganization

func (pq *PlatformQuery) QueryOrganization() *OrganizationQuery

QueryOrganization chains the current query on the "organization" edge.

func (*PlatformQuery) Select

func (pq *PlatformQuery) Select(fields ...string) *PlatformSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Platform.Query().
	Select(platform.FieldCreatedAt).
	Scan(ctx, &v)

func (*PlatformQuery) Unique

func (pq *PlatformQuery) Unique(unique bool) *PlatformQuery

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 (*PlatformQuery) Where

func (pq *PlatformQuery) Where(ps ...predicate.Platform) *PlatformQuery

Where adds a new predicate for the PlatformQuery builder.

func (*PlatformQuery) WithCreator

func (pq *PlatformQuery) WithCreator(opts ...func(*UserQuery)) *PlatformQuery

WithCreator tells the query-builder to eager-load the nodes that are connected to the "creator" edge. The optional arguments are used to configure the query builder of the edge.

func (*PlatformQuery) WithEditor

func (pq *PlatformQuery) WithEditor(opts ...func(*UserQuery)) *PlatformQuery

WithEditor tells the query-builder to eager-load the nodes that are connected to the "editor" edge. The optional arguments are used to configure the query builder of the edge.

func (*PlatformQuery) WithOrganization

func (pq *PlatformQuery) WithOrganization(opts ...func(*OrganizationQuery)) *PlatformQuery

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 PlatformSelect

type PlatformSelect struct {
	*PlatformQuery
	// contains filtered or unexported fields
}

PlatformSelect is the builder for selecting fields of Platform entities.

func (*PlatformSelect) Aggregate

func (ps *PlatformSelect) Aggregate(fns ...AggregateFunc) *PlatformSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PlatformSelect) Bool

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

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

func (*PlatformSelect) BoolX

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

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

func (*PlatformSelect) Bools

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

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

func (*PlatformSelect) BoolsX

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

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

func (*PlatformSelect) Float64

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

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

func (*PlatformSelect) Float64X

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

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

func (*PlatformSelect) Float64s

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

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

func (*PlatformSelect) Float64sX

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

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

func (*PlatformSelect) Int

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

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

func (*PlatformSelect) IntX

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

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

func (*PlatformSelect) Ints

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

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

func (*PlatformSelect) IntsX

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

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

func (*PlatformSelect) Scan

func (ps *PlatformSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PlatformSelect) ScanX

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

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

func (*PlatformSelect) String

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

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

func (*PlatformSelect) StringX

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

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

func (*PlatformSelect) Strings

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

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

func (*PlatformSelect) StringsX

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

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

type PlatformUpdate

type PlatformUpdate struct {
	// contains filtered or unexported fields
}

PlatformUpdate is the builder for updating Platform entities.

func (*PlatformUpdate) ClearCue

func (pu *PlatformUpdate) ClearCue() *PlatformUpdate

ClearCue clears the value of the "cue" field.

func (*PlatformUpdate) ClearCueDefinition

func (pu *PlatformUpdate) ClearCueDefinition() *PlatformUpdate

ClearCueDefinition clears the value of the "cue_definition" field.

func (*PlatformUpdate) ClearEditor

func (pu *PlatformUpdate) ClearEditor() *PlatformUpdate

ClearEditor clears the "editor" edge to the User entity.

func (*PlatformUpdate) ClearForm

func (pu *PlatformUpdate) ClearForm() *PlatformUpdate

ClearForm clears the value of the "form" field.

func (*PlatformUpdate) ClearModel

func (pu *PlatformUpdate) ClearModel() *PlatformUpdate

ClearModel clears the value of the "model" field.

func (*PlatformUpdate) ClearOrganization

func (pu *PlatformUpdate) ClearOrganization() *PlatformUpdate

ClearOrganization clears the "organization" edge to the Organization entity.

func (*PlatformUpdate) Exec

func (pu *PlatformUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PlatformUpdate) ExecX

func (pu *PlatformUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PlatformUpdate) Mutation

func (pu *PlatformUpdate) Mutation() *PlatformMutation

Mutation returns the PlatformMutation object of the builder.

func (*PlatformUpdate) Save

func (pu *PlatformUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PlatformUpdate) SaveX

func (pu *PlatformUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PlatformUpdate) SetCue

func (pu *PlatformUpdate) SetCue(b []byte) *PlatformUpdate

SetCue sets the "cue" field.

func (*PlatformUpdate) SetCueDefinition

func (pu *PlatformUpdate) SetCueDefinition(s string) *PlatformUpdate

SetCueDefinition sets the "cue_definition" field.

func (*PlatformUpdate) SetDisplayName

func (pu *PlatformUpdate) SetDisplayName(s string) *PlatformUpdate

SetDisplayName sets the "display_name" field.

func (*PlatformUpdate) SetEditor

func (pu *PlatformUpdate) SetEditor(u *User) *PlatformUpdate

SetEditor sets the "editor" edge to the User entity.

func (*PlatformUpdate) SetEditorID

func (pu *PlatformUpdate) SetEditorID(id uuid.UUID) *PlatformUpdate

SetEditorID sets the "editor" edge to the User entity by ID.

func (*PlatformUpdate) SetForm

func (pu *PlatformUpdate) SetForm(s *storage.Form) *PlatformUpdate

SetForm sets the "form" field.

func (*PlatformUpdate) SetModel

func (pu *PlatformUpdate) SetModel(s *storage.Model) *PlatformUpdate

SetModel sets the "model" field.

func (*PlatformUpdate) SetName

func (pu *PlatformUpdate) SetName(s string) *PlatformUpdate

SetName sets the "name" field.

func (*PlatformUpdate) SetNillableCueDefinition

func (pu *PlatformUpdate) SetNillableCueDefinition(s *string) *PlatformUpdate

SetNillableCueDefinition sets the "cue_definition" field if the given value is not nil.

func (*PlatformUpdate) SetNillableDisplayName

func (pu *PlatformUpdate) SetNillableDisplayName(s *string) *PlatformUpdate

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*PlatformUpdate) SetNillableName

func (pu *PlatformUpdate) SetNillableName(s *string) *PlatformUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*PlatformUpdate) SetNillableOrgID

func (pu *PlatformUpdate) SetNillableOrgID(u *uuid.UUID) *PlatformUpdate

SetNillableOrgID sets the "org_id" field if the given value is not nil.

func (*PlatformUpdate) SetNillableUpdatedByID

func (pu *PlatformUpdate) SetNillableUpdatedByID(u *uuid.UUID) *PlatformUpdate

SetNillableUpdatedByID sets the "updated_by_id" field if the given value is not nil.

func (*PlatformUpdate) SetOrgID

func (pu *PlatformUpdate) SetOrgID(u uuid.UUID) *PlatformUpdate

SetOrgID sets the "org_id" field.

func (*PlatformUpdate) SetOrganization

func (pu *PlatformUpdate) SetOrganization(o *Organization) *PlatformUpdate

SetOrganization sets the "organization" edge to the Organization entity.

func (*PlatformUpdate) SetOrganizationID

func (pu *PlatformUpdate) SetOrganizationID(id uuid.UUID) *PlatformUpdate

SetOrganizationID sets the "organization" edge to the Organization entity by ID.

func (*PlatformUpdate) SetUpdatedAt

func (pu *PlatformUpdate) SetUpdatedAt(t time.Time) *PlatformUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PlatformUpdate) SetUpdatedByID

func (pu *PlatformUpdate) SetUpdatedByID(u uuid.UUID) *PlatformUpdate

SetUpdatedByID sets the "updated_by_id" field.

func (*PlatformUpdate) Where

func (pu *PlatformUpdate) Where(ps ...predicate.Platform) *PlatformUpdate

Where appends a list predicates to the PlatformUpdate builder.

type PlatformUpdateOne

type PlatformUpdateOne struct {
	// contains filtered or unexported fields
}

PlatformUpdateOne is the builder for updating a single Platform entity.

func (*PlatformUpdateOne) ClearCue

func (puo *PlatformUpdateOne) ClearCue() *PlatformUpdateOne

ClearCue clears the value of the "cue" field.

func (*PlatformUpdateOne) ClearCueDefinition

func (puo *PlatformUpdateOne) ClearCueDefinition() *PlatformUpdateOne

ClearCueDefinition clears the value of the "cue_definition" field.

func (*PlatformUpdateOne) ClearEditor

func (puo *PlatformUpdateOne) ClearEditor() *PlatformUpdateOne

ClearEditor clears the "editor" edge to the User entity.

func (*PlatformUpdateOne) ClearForm

func (puo *PlatformUpdateOne) ClearForm() *PlatformUpdateOne

ClearForm clears the value of the "form" field.

func (*PlatformUpdateOne) ClearModel

func (puo *PlatformUpdateOne) ClearModel() *PlatformUpdateOne

ClearModel clears the value of the "model" field.

func (*PlatformUpdateOne) ClearOrganization

func (puo *PlatformUpdateOne) ClearOrganization() *PlatformUpdateOne

ClearOrganization clears the "organization" edge to the Organization entity.

func (*PlatformUpdateOne) Exec

func (puo *PlatformUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PlatformUpdateOne) ExecX

func (puo *PlatformUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PlatformUpdateOne) Mutation

func (puo *PlatformUpdateOne) Mutation() *PlatformMutation

Mutation returns the PlatformMutation object of the builder.

func (*PlatformUpdateOne) Save

func (puo *PlatformUpdateOne) Save(ctx context.Context) (*Platform, error)

Save executes the query and returns the updated Platform entity.

func (*PlatformUpdateOne) SaveX

func (puo *PlatformUpdateOne) SaveX(ctx context.Context) *Platform

SaveX is like Save, but panics if an error occurs.

func (*PlatformUpdateOne) Select

func (puo *PlatformUpdateOne) Select(field string, fields ...string) *PlatformUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PlatformUpdateOne) SetCue

func (puo *PlatformUpdateOne) SetCue(b []byte) *PlatformUpdateOne

SetCue sets the "cue" field.

func (*PlatformUpdateOne) SetCueDefinition

func (puo *PlatformUpdateOne) SetCueDefinition(s string) *PlatformUpdateOne

SetCueDefinition sets the "cue_definition" field.

func (*PlatformUpdateOne) SetDisplayName

func (puo *PlatformUpdateOne) SetDisplayName(s string) *PlatformUpdateOne

SetDisplayName sets the "display_name" field.

func (*PlatformUpdateOne) SetEditor

func (puo *PlatformUpdateOne) SetEditor(u *User) *PlatformUpdateOne

SetEditor sets the "editor" edge to the User entity.

func (*PlatformUpdateOne) SetEditorID

func (puo *PlatformUpdateOne) SetEditorID(id uuid.UUID) *PlatformUpdateOne

SetEditorID sets the "editor" edge to the User entity by ID.

func (*PlatformUpdateOne) SetForm

func (puo *PlatformUpdateOne) SetForm(s *storage.Form) *PlatformUpdateOne

SetForm sets the "form" field.

func (*PlatformUpdateOne) SetModel

func (puo *PlatformUpdateOne) SetModel(s *storage.Model) *PlatformUpdateOne

SetModel sets the "model" field.

func (*PlatformUpdateOne) SetName

func (puo *PlatformUpdateOne) SetName(s string) *PlatformUpdateOne

SetName sets the "name" field.

func (*PlatformUpdateOne) SetNillableCueDefinition

func (puo *PlatformUpdateOne) SetNillableCueDefinition(s *string) *PlatformUpdateOne

SetNillableCueDefinition sets the "cue_definition" field if the given value is not nil.

func (*PlatformUpdateOne) SetNillableDisplayName

func (puo *PlatformUpdateOne) SetNillableDisplayName(s *string) *PlatformUpdateOne

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*PlatformUpdateOne) SetNillableName

func (puo *PlatformUpdateOne) SetNillableName(s *string) *PlatformUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*PlatformUpdateOne) SetNillableOrgID

func (puo *PlatformUpdateOne) SetNillableOrgID(u *uuid.UUID) *PlatformUpdateOne

SetNillableOrgID sets the "org_id" field if the given value is not nil.

func (*PlatformUpdateOne) SetNillableUpdatedByID

func (puo *PlatformUpdateOne) SetNillableUpdatedByID(u *uuid.UUID) *PlatformUpdateOne

SetNillableUpdatedByID sets the "updated_by_id" field if the given value is not nil.

func (*PlatformUpdateOne) SetOrgID

func (puo *PlatformUpdateOne) SetOrgID(u uuid.UUID) *PlatformUpdateOne

SetOrgID sets the "org_id" field.

func (*PlatformUpdateOne) SetOrganization

func (puo *PlatformUpdateOne) SetOrganization(o *Organization) *PlatformUpdateOne

SetOrganization sets the "organization" edge to the Organization entity.

func (*PlatformUpdateOne) SetOrganizationID

func (puo *PlatformUpdateOne) SetOrganizationID(id uuid.UUID) *PlatformUpdateOne

SetOrganizationID sets the "organization" edge to the Organization entity by ID.

func (*PlatformUpdateOne) SetUpdatedAt

func (puo *PlatformUpdateOne) SetUpdatedAt(t time.Time) *PlatformUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*PlatformUpdateOne) SetUpdatedByID

func (puo *PlatformUpdateOne) SetUpdatedByID(u uuid.UUID) *PlatformUpdateOne

SetUpdatedByID sets the "updated_by_id" field.

func (*PlatformUpdateOne) Where

Where appends a list predicates to the PlatformUpdate builder.

type PlatformUpsert

type PlatformUpsert struct {
	*sql.UpdateSet
}

PlatformUpsert is the "OnConflict" setter.

func (*PlatformUpsert) ClearCue

func (u *PlatformUpsert) ClearCue() *PlatformUpsert

ClearCue clears the value of the "cue" field.

func (*PlatformUpsert) ClearCueDefinition

func (u *PlatformUpsert) ClearCueDefinition() *PlatformUpsert

ClearCueDefinition clears the value of the "cue_definition" field.

func (*PlatformUpsert) ClearForm

func (u *PlatformUpsert) ClearForm() *PlatformUpsert

ClearForm clears the value of the "form" field.

func (*PlatformUpsert) ClearModel

func (u *PlatformUpsert) ClearModel() *PlatformUpsert

ClearModel clears the value of the "model" field.

func (*PlatformUpsert) SetCue

func (u *PlatformUpsert) SetCue(v []byte) *PlatformUpsert

SetCue sets the "cue" field.

func (*PlatformUpsert) SetCueDefinition

func (u *PlatformUpsert) SetCueDefinition(v string) *PlatformUpsert

SetCueDefinition sets the "cue_definition" field.

func (*PlatformUpsert) SetDisplayName

func (u *PlatformUpsert) SetDisplayName(v string) *PlatformUpsert

SetDisplayName sets the "display_name" field.

func (*PlatformUpsert) SetForm

func (u *PlatformUpsert) SetForm(v *storage.Form) *PlatformUpsert

SetForm sets the "form" field.

func (*PlatformUpsert) SetModel

func (u *PlatformUpsert) SetModel(v *storage.Model) *PlatformUpsert

SetModel sets the "model" field.

func (*PlatformUpsert) SetName

func (u *PlatformUpsert) SetName(v string) *PlatformUpsert

SetName sets the "name" field.

func (*PlatformUpsert) SetOrgID

func (u *PlatformUpsert) SetOrgID(v uuid.UUID) *PlatformUpsert

SetOrgID sets the "org_id" field.

func (*PlatformUpsert) SetUpdatedAt

func (u *PlatformUpsert) SetUpdatedAt(v time.Time) *PlatformUpsert

SetUpdatedAt sets the "updated_at" field.

func (*PlatformUpsert) SetUpdatedByID

func (u *PlatformUpsert) SetUpdatedByID(v uuid.UUID) *PlatformUpsert

SetUpdatedByID sets the "updated_by_id" field.

func (*PlatformUpsert) UpdateCue

func (u *PlatformUpsert) UpdateCue() *PlatformUpsert

UpdateCue sets the "cue" field to the value that was provided on create.

func (*PlatformUpsert) UpdateCueDefinition

func (u *PlatformUpsert) UpdateCueDefinition() *PlatformUpsert

UpdateCueDefinition sets the "cue_definition" field to the value that was provided on create.

func (*PlatformUpsert) UpdateDisplayName

func (u *PlatformUpsert) UpdateDisplayName() *PlatformUpsert

UpdateDisplayName sets the "display_name" field to the value that was provided on create.

func (*PlatformUpsert) UpdateForm

func (u *PlatformUpsert) UpdateForm() *PlatformUpsert

UpdateForm sets the "form" field to the value that was provided on create.

func (*PlatformUpsert) UpdateModel

func (u *PlatformUpsert) UpdateModel() *PlatformUpsert

UpdateModel sets the "model" field to the value that was provided on create.

func (*PlatformUpsert) UpdateName

func (u *PlatformUpsert) UpdateName() *PlatformUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*PlatformUpsert) UpdateOrgID

func (u *PlatformUpsert) UpdateOrgID() *PlatformUpsert

UpdateOrgID sets the "org_id" field to the value that was provided on create.

func (*PlatformUpsert) UpdateUpdatedAt

func (u *PlatformUpsert) UpdateUpdatedAt() *PlatformUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*PlatformUpsert) UpdateUpdatedByID

func (u *PlatformUpsert) UpdateUpdatedByID() *PlatformUpsert

UpdateUpdatedByID sets the "updated_by_id" field to the value that was provided on create.

type PlatformUpsertBulk

type PlatformUpsertBulk struct {
	// contains filtered or unexported fields
}

PlatformUpsertBulk is the builder for "upsert"-ing a bulk of Platform nodes.

func (*PlatformUpsertBulk) ClearCue

func (u *PlatformUpsertBulk) ClearCue() *PlatformUpsertBulk

ClearCue clears the value of the "cue" field.

func (*PlatformUpsertBulk) ClearCueDefinition

func (u *PlatformUpsertBulk) ClearCueDefinition() *PlatformUpsertBulk

ClearCueDefinition clears the value of the "cue_definition" field.

func (*PlatformUpsertBulk) ClearForm

func (u *PlatformUpsertBulk) ClearForm() *PlatformUpsertBulk

ClearForm clears the value of the "form" field.

func (*PlatformUpsertBulk) ClearModel

func (u *PlatformUpsertBulk) ClearModel() *PlatformUpsertBulk

ClearModel clears the value of the "model" field.

func (*PlatformUpsertBulk) DoNothing

func (u *PlatformUpsertBulk) DoNothing() *PlatformUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*PlatformUpsertBulk) Exec

func (u *PlatformUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PlatformUpsertBulk) ExecX

func (u *PlatformUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PlatformUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Platform.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*PlatformUpsertBulk) SetCue

func (u *PlatformUpsertBulk) SetCue(v []byte) *PlatformUpsertBulk

SetCue sets the "cue" field.

func (*PlatformUpsertBulk) SetCueDefinition

func (u *PlatformUpsertBulk) SetCueDefinition(v string) *PlatformUpsertBulk

SetCueDefinition sets the "cue_definition" field.

func (*PlatformUpsertBulk) SetDisplayName

func (u *PlatformUpsertBulk) SetDisplayName(v string) *PlatformUpsertBulk

SetDisplayName sets the "display_name" field.

func (*PlatformUpsertBulk) SetForm

SetForm sets the "form" field.

func (*PlatformUpsertBulk) SetModel

SetModel sets the "model" field.

func (*PlatformUpsertBulk) SetName

SetName sets the "name" field.

func (*PlatformUpsertBulk) SetOrgID

SetOrgID sets the "org_id" field.

func (*PlatformUpsertBulk) SetUpdatedAt

func (u *PlatformUpsertBulk) SetUpdatedAt(v time.Time) *PlatformUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*PlatformUpsertBulk) SetUpdatedByID

func (u *PlatformUpsertBulk) SetUpdatedByID(v uuid.UUID) *PlatformUpsertBulk

SetUpdatedByID sets the "updated_by_id" field.

func (*PlatformUpsertBulk) Update

func (u *PlatformUpsertBulk) Update(set func(*PlatformUpsert)) *PlatformUpsertBulk

Update allows overriding fields `UPDATE` values. See the PlatformCreateBulk.OnConflict documentation for more info.

func (*PlatformUpsertBulk) UpdateCue

func (u *PlatformUpsertBulk) UpdateCue() *PlatformUpsertBulk

UpdateCue sets the "cue" field to the value that was provided on create.

func (*PlatformUpsertBulk) UpdateCueDefinition

func (u *PlatformUpsertBulk) UpdateCueDefinition() *PlatformUpsertBulk

UpdateCueDefinition sets the "cue_definition" field to the value that was provided on create.

func (*PlatformUpsertBulk) UpdateDisplayName

func (u *PlatformUpsertBulk) UpdateDisplayName() *PlatformUpsertBulk

UpdateDisplayName sets the "display_name" field to the value that was provided on create.

func (*PlatformUpsertBulk) UpdateForm

func (u *PlatformUpsertBulk) UpdateForm() *PlatformUpsertBulk

UpdateForm sets the "form" field to the value that was provided on create.

func (*PlatformUpsertBulk) UpdateModel

func (u *PlatformUpsertBulk) UpdateModel() *PlatformUpsertBulk

UpdateModel sets the "model" field to the value that was provided on create.

func (*PlatformUpsertBulk) UpdateName

func (u *PlatformUpsertBulk) UpdateName() *PlatformUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*PlatformUpsertBulk) UpdateNewValues

func (u *PlatformUpsertBulk) UpdateNewValues() *PlatformUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Platform.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(platform.FieldID)
		}),
	).
	Exec(ctx)

func (*PlatformUpsertBulk) UpdateOrgID

func (u *PlatformUpsertBulk) UpdateOrgID() *PlatformUpsertBulk

UpdateOrgID sets the "org_id" field to the value that was provided on create.

func (*PlatformUpsertBulk) UpdateUpdatedAt

func (u *PlatformUpsertBulk) UpdateUpdatedAt() *PlatformUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*PlatformUpsertBulk) UpdateUpdatedByID

func (u *PlatformUpsertBulk) UpdateUpdatedByID() *PlatformUpsertBulk

UpdateUpdatedByID sets the "updated_by_id" field to the value that was provided on create.

type PlatformUpsertOne

type PlatformUpsertOne struct {
	// contains filtered or unexported fields
}

PlatformUpsertOne is the builder for "upsert"-ing

one Platform node.

func (*PlatformUpsertOne) ClearCue

func (u *PlatformUpsertOne) ClearCue() *PlatformUpsertOne

ClearCue clears the value of the "cue" field.

func (*PlatformUpsertOne) ClearCueDefinition

func (u *PlatformUpsertOne) ClearCueDefinition() *PlatformUpsertOne

ClearCueDefinition clears the value of the "cue_definition" field.

func (*PlatformUpsertOne) ClearForm

func (u *PlatformUpsertOne) ClearForm() *PlatformUpsertOne

ClearForm clears the value of the "form" field.

func (*PlatformUpsertOne) ClearModel

func (u *PlatformUpsertOne) ClearModel() *PlatformUpsertOne

ClearModel clears the value of the "model" field.

func (*PlatformUpsertOne) DoNothing

func (u *PlatformUpsertOne) DoNothing() *PlatformUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*PlatformUpsertOne) Exec

func (u *PlatformUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*PlatformUpsertOne) ExecX

func (u *PlatformUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PlatformUpsertOne) ID

func (u *PlatformUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*PlatformUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*PlatformUpsertOne) Ignore

func (u *PlatformUpsertOne) Ignore() *PlatformUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Platform.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*PlatformUpsertOne) SetCue

func (u *PlatformUpsertOne) SetCue(v []byte) *PlatformUpsertOne

SetCue sets the "cue" field.

func (*PlatformUpsertOne) SetCueDefinition

func (u *PlatformUpsertOne) SetCueDefinition(v string) *PlatformUpsertOne

SetCueDefinition sets the "cue_definition" field.

func (*PlatformUpsertOne) SetDisplayName

func (u *PlatformUpsertOne) SetDisplayName(v string) *PlatformUpsertOne

SetDisplayName sets the "display_name" field.

func (*PlatformUpsertOne) SetForm

SetForm sets the "form" field.

func (*PlatformUpsertOne) SetModel

SetModel sets the "model" field.

func (*PlatformUpsertOne) SetName

SetName sets the "name" field.

func (*PlatformUpsertOne) SetOrgID

func (u *PlatformUpsertOne) SetOrgID(v uuid.UUID) *PlatformUpsertOne

SetOrgID sets the "org_id" field.

func (*PlatformUpsertOne) SetUpdatedAt

func (u *PlatformUpsertOne) SetUpdatedAt(v time.Time) *PlatformUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*PlatformUpsertOne) SetUpdatedByID

func (u *PlatformUpsertOne) SetUpdatedByID(v uuid.UUID) *PlatformUpsertOne

SetUpdatedByID sets the "updated_by_id" field.

func (*PlatformUpsertOne) Update

func (u *PlatformUpsertOne) Update(set func(*PlatformUpsert)) *PlatformUpsertOne

Update allows overriding fields `UPDATE` values. See the PlatformCreate.OnConflict documentation for more info.

func (*PlatformUpsertOne) UpdateCue

func (u *PlatformUpsertOne) UpdateCue() *PlatformUpsertOne

UpdateCue sets the "cue" field to the value that was provided on create.

func (*PlatformUpsertOne) UpdateCueDefinition

func (u *PlatformUpsertOne) UpdateCueDefinition() *PlatformUpsertOne

UpdateCueDefinition sets the "cue_definition" field to the value that was provided on create.

func (*PlatformUpsertOne) UpdateDisplayName

func (u *PlatformUpsertOne) UpdateDisplayName() *PlatformUpsertOne

UpdateDisplayName sets the "display_name" field to the value that was provided on create.

func (*PlatformUpsertOne) UpdateForm

func (u *PlatformUpsertOne) UpdateForm() *PlatformUpsertOne

UpdateForm sets the "form" field to the value that was provided on create.

func (*PlatformUpsertOne) UpdateModel

func (u *PlatformUpsertOne) UpdateModel() *PlatformUpsertOne

UpdateModel sets the "model" field to the value that was provided on create.

func (*PlatformUpsertOne) UpdateName

func (u *PlatformUpsertOne) UpdateName() *PlatformUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*PlatformUpsertOne) UpdateNewValues

func (u *PlatformUpsertOne) UpdateNewValues() *PlatformUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Platform.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(platform.FieldID)
		}),
	).
	Exec(ctx)

func (*PlatformUpsertOne) UpdateOrgID

func (u *PlatformUpsertOne) UpdateOrgID() *PlatformUpsertOne

UpdateOrgID sets the "org_id" field to the value that was provided on create.

func (*PlatformUpsertOne) UpdateUpdatedAt

func (u *PlatformUpsertOne) UpdateUpdatedAt() *PlatformUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*PlatformUpsertOne) UpdateUpdatedByID

func (u *PlatformUpsertOne) UpdateUpdatedByID() *PlatformUpsertOne

UpdateUpdatedByID sets the "updated_by_id" field to the value that was provided on create.

type Platforms

type Platforms []*Platform

Platforms is a parsable slice of Platform.

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 {

	// Organization is the client for interacting with the Organization builders.
	Organization *OrganizationClient
	// Platform is the client for interacting with the Platform builders.
	Platform *PlatformClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// 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 User

type User struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Iss holds the value of the "iss" field.
	Iss string `json:"iss,omitempty"`
	// Sub holds the value of the "sub" field.
	Sub string `json:"sub,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) QueryOrganizations

func (u *User) QueryOrganizations() *OrganizationQuery

QueryOrganizations queries the "organizations" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User 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 (*User) Update

func (u *User) Update() *UserUpdateOne

Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.

func (*User) Value

func (u *User) Value(name string) (ent.Value, error)

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

type UserClient

type UserClient struct {
	// contains filtered or unexported fields
}

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

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

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id uuid.UUID) *UserDeleteOne

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

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserClient) Intercept

func (c *UserClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.

func (*UserClient) Interceptors

func (c *UserClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserClient) MapCreateBulk

func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk

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 (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryOrganizations

func (c *UserClient) QueryOrganizations(u *User) *OrganizationQuery

QueryOrganizations queries the organizations edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id uuid.UUID) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

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

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddOrganizationIDs

func (uc *UserCreate) AddOrganizationIDs(ids ...uuid.UUID) *UserCreate

AddOrganizationIDs adds the "organizations" edge to the Organization entity by IDs.

func (*UserCreate) AddOrganizations

func (uc *UserCreate) AddOrganizations(o ...*Organization) *UserCreate

AddOrganizations adds the "organizations" edges to the Organization entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) OnConflict

func (uc *UserCreate) OnConflict(opts ...sql.ConflictOption) *UserUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.Create().
	SetCreatedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*UserCreate) OnConflictColumns

func (uc *UserCreate) OnConflictColumns(columns ...string) *UserUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetCreatedAt

func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetIss

func (uc *UserCreate) SetIss(s string) *UserCreate

SetIss sets the "iss" field.

func (*UserCreate) SetName

func (uc *UserCreate) SetName(s string) *UserCreate

SetName sets the "name" field.

func (*UserCreate) SetNillableCreatedAt

func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserCreate) SetNillableID

func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*UserCreate) SetNillableUpdatedAt

func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*UserCreate) SetSub

func (uc *UserCreate) SetSub(s string) *UserCreate

SetSub sets the "sub" field.

func (*UserCreate) SetUpdatedAt

func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate

SetUpdatedAt sets the "updated_at" field.

type UserCreateBulk

type UserCreateBulk struct {
	// contains filtered or unexported fields
}

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) OnConflict

func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*UserCreateBulk) OnConflictColumns

func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDeleteOne) Where

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserEdges

type UserEdges struct {
	// Organizations holds the value of the organizations edge.
	Organizations []*Organization `json:"organizations,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) OrganizationsOrErr

func (e UserEdges) OrganizationsOrErr() ([]*Organization, error)

OrganizationsOrErr returns the Organizations value or an error if the edge was not loaded in eager-loading.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

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

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

func (*UserGroupBy) BoolX

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

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

func (*UserGroupBy) Bools

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

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

func (*UserGroupBy) BoolsX

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

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

func (*UserGroupBy) Float64

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

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

func (*UserGroupBy) Float64X

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

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

func (*UserGroupBy) Float64s

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

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

func (*UserGroupBy) Float64sX

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

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

func (*UserGroupBy) Int

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

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

func (*UserGroupBy) IntX

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

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

func (*UserGroupBy) Ints

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

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

func (*UserGroupBy) IntsX

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

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

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupBy) ScanX

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

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

func (*UserGroupBy) String

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

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

func (*UserGroupBy) StringX

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

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

func (*UserGroupBy) Strings

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

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

func (*UserGroupBy) StringsX

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

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

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddField

func (m *UserMutation) 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 (*UserMutation) AddOrganizationIDs

func (m *UserMutation) AddOrganizationIDs(ids ...uuid.UUID)

AddOrganizationIDs adds the "organizations" edge to the Organization entity by ids.

func (*UserMutation) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField

func (m *UserMutation) 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 (*UserMutation) AddedFields

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) ClearEdge

func (m *UserMutation) 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 (*UserMutation) ClearField

func (m *UserMutation) 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 (*UserMutation) ClearOrganizations

func (m *UserMutation) ClearOrganizations()

ClearOrganizations clears the "organizations" edge to the Organization entity.

func (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) 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 (*UserMutation) CreatedAt

func (m *UserMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Email

func (m *UserMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*UserMutation) Field

func (m *UserMutation) 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 (*UserMutation) FieldCleared

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) 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 (*UserMutation) ID

func (m *UserMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*UserMutation) Iss

func (m *UserMutation) Iss() (r string, exists bool)

Iss returns the value of the "iss" field in the mutation.

func (*UserMutation) Name

func (m *UserMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*UserMutation) OldCreatedAt

func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the User entity. If the User 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 (*UserMutation) OldEmail

func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the User entity. If the User 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 (*UserMutation) OldField

func (m *UserMutation) 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 (*UserMutation) OldIss

func (m *UserMutation) OldIss(ctx context.Context) (v string, err error)

OldIss returns the old "iss" field's value of the User entity. If the User 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 (*UserMutation) OldName

func (m *UserMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the User entity. If the User 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 (*UserMutation) OldSub

func (m *UserMutation) OldSub(ctx context.Context) (v string, err error)

OldSub returns the old "sub" field's value of the User entity. If the User 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 (*UserMutation) OldUpdatedAt

func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the User entity. If the User 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 (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) OrganizationsCleared

func (m *UserMutation) OrganizationsCleared() bool

OrganizationsCleared reports if the "organizations" edge to the Organization entity was cleared.

func (*UserMutation) OrganizationsIDs

func (m *UserMutation) OrganizationsIDs() (ids []uuid.UUID)

OrganizationsIDs returns the "organizations" edge IDs in the mutation.

func (*UserMutation) RemoveOrganizationIDs

func (m *UserMutation) RemoveOrganizationIDs(ids ...uuid.UUID)

RemoveOrganizationIDs removes the "organizations" edge to the Organization entity by IDs.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedIDs

func (m *UserMutation) 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 (*UserMutation) RemovedOrganizationsIDs

func (m *UserMutation) RemovedOrganizationsIDs() (ids []uuid.UUID)

RemovedOrganizations returns the removed IDs of the "organizations" edge to the Organization entity.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) 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 (*UserMutation) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*UserMutation) ResetField

func (m *UserMutation) 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 (*UserMutation) ResetIss

func (m *UserMutation) ResetIss()

ResetIss resets all changes to the "iss" field.

func (*UserMutation) ResetName

func (m *UserMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*UserMutation) ResetOrganizations

func (m *UserMutation) ResetOrganizations()

ResetOrganizations resets all changes to the "organizations" edge.

func (*UserMutation) ResetSub

func (m *UserMutation) ResetSub()

ResetSub resets all changes to the "sub" field.

func (*UserMutation) ResetUpdatedAt

func (m *UserMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserMutation) SetCreatedAt

func (m *UserMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*UserMutation) SetField

func (m *UserMutation) 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 (*UserMutation) SetID

func (m *UserMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetIss

func (m *UserMutation) SetIss(s string)

SetIss sets the "iss" field.

func (*UserMutation) SetName

func (m *UserMutation) SetName(s string)

SetName sets the "name" field.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetSub

func (m *UserMutation) SetSub(s string)

SetSub sets the "sub" field.

func (*UserMutation) SetUpdatedAt

func (m *UserMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*UserMutation) Sub

func (m *UserMutation) Sub() (r string, exists bool)

Sub returns the value of the "sub" field in the mutation.

func (UserMutation) Tx

func (m UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMutation) Type

func (m *UserMutation) Type() string

Type returns the node type of this mutation (User).

func (*UserMutation) UpdatedAt

func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

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

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) QueryOrganizations

func (uq *UserQuery) QueryOrganizations() *OrganizationQuery

QueryOrganizations chains the current query on the "organizations" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.User.Query().
	Select(user.FieldCreatedAt).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

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 (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithOrganizations

func (uq *UserQuery) WithOrganizations(opts ...func(*OrganizationQuery)) *UserQuery

WithOrganizations tells the query-builder to eager-load the nodes that are connected to the "organizations" edge. The optional arguments are used to configure the query builder of the edge.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

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

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

func (*UserSelect) BoolX

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

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

func (*UserSelect) Bools

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

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

func (*UserSelect) BoolsX

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

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

func (*UserSelect) Float64

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

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

func (*UserSelect) Float64X

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

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

func (*UserSelect) Float64s

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

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

func (*UserSelect) Float64sX

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

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

func (*UserSelect) Int

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

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

func (*UserSelect) IntX

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

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

func (*UserSelect) Ints

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

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

func (*UserSelect) IntsX

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

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

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

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

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

func (*UserSelect) String

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

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

func (*UserSelect) StringX

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

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

func (*UserSelect) Strings

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

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

func (*UserSelect) StringsX

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

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

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddOrganizationIDs

func (uu *UserUpdate) AddOrganizationIDs(ids ...uuid.UUID) *UserUpdate

AddOrganizationIDs adds the "organizations" edge to the Organization entity by IDs.

func (*UserUpdate) AddOrganizations

func (uu *UserUpdate) AddOrganizations(o ...*Organization) *UserUpdate

AddOrganizations adds the "organizations" edges to the Organization entity.

func (*UserUpdate) ClearOrganizations

func (uu *UserUpdate) ClearOrganizations() *UserUpdate

ClearOrganizations clears all "organizations" edges to the Organization entity.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveOrganizationIDs

func (uu *UserUpdate) RemoveOrganizationIDs(ids ...uuid.UUID) *UserUpdate

RemoveOrganizationIDs removes the "organizations" edge to Organization entities by IDs.

func (*UserUpdate) RemoveOrganizations

func (uu *UserUpdate) RemoveOrganizations(o ...*Organization) *UserUpdate

RemoveOrganizations removes "organizations" edges to Organization entities.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetIss

func (uu *UserUpdate) SetIss(s string) *UserUpdate

SetIss sets the "iss" field.

func (*UserUpdate) SetName

func (uu *UserUpdate) SetName(s string) *UserUpdate

SetName sets the "name" field.

func (*UserUpdate) SetNillableEmail

func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdate) SetNillableIss

func (uu *UserUpdate) SetNillableIss(s *string) *UserUpdate

SetNillableIss sets the "iss" field if the given value is not nil.

func (*UserUpdate) SetNillableName

func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*UserUpdate) SetNillableSub

func (uu *UserUpdate) SetNillableSub(s *string) *UserUpdate

SetNillableSub sets the "sub" field if the given value is not nil.

func (*UserUpdate) SetSub

func (uu *UserUpdate) SetSub(s string) *UserUpdate

SetSub sets the "sub" field.

func (*UserUpdate) SetUpdatedAt

func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddOrganizationIDs

func (uuo *UserUpdateOne) AddOrganizationIDs(ids ...uuid.UUID) *UserUpdateOne

AddOrganizationIDs adds the "organizations" edge to the Organization entity by IDs.

func (*UserUpdateOne) AddOrganizations

func (uuo *UserUpdateOne) AddOrganizations(o ...*Organization) *UserUpdateOne

AddOrganizations adds the "organizations" edges to the Organization entity.

func (*UserUpdateOne) ClearOrganizations

func (uuo *UserUpdateOne) ClearOrganizations() *UserUpdateOne

ClearOrganizations clears all "organizations" edges to the Organization entity.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveOrganizationIDs

func (uuo *UserUpdateOne) RemoveOrganizationIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveOrganizationIDs removes the "organizations" edge to Organization entities by IDs.

func (*UserUpdateOne) RemoveOrganizations

func (uuo *UserUpdateOne) RemoveOrganizations(o ...*Organization) *UserUpdateOne

RemoveOrganizations removes "organizations" edges to Organization entities.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetIss

func (uuo *UserUpdateOne) SetIss(s string) *UserUpdateOne

SetIss sets the "iss" field.

func (*UserUpdateOne) SetName

func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne

SetName sets the "name" field.

func (*UserUpdateOne) SetNillableEmail

func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdateOne) SetNillableIss

func (uuo *UserUpdateOne) SetNillableIss(s *string) *UserUpdateOne

SetNillableIss sets the "iss" field if the given value is not nil.

func (*UserUpdateOne) SetNillableName

func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*UserUpdateOne) SetNillableSub

func (uuo *UserUpdateOne) SetNillableSub(s *string) *UserUpdateOne

SetNillableSub sets the "sub" field if the given value is not nil.

func (*UserUpdateOne) SetSub

func (uuo *UserUpdateOne) SetSub(s string) *UserUpdateOne

SetSub sets the "sub" field.

func (*UserUpdateOne) SetUpdatedAt

func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type UserUpsert

type UserUpsert struct {
	*sql.UpdateSet
}

UserUpsert is the "OnConflict" setter.

func (*UserUpsert) SetEmail

func (u *UserUpsert) SetEmail(v string) *UserUpsert

SetEmail sets the "email" field.

func (*UserUpsert) SetIss

func (u *UserUpsert) SetIss(v string) *UserUpsert

SetIss sets the "iss" field.

func (*UserUpsert) SetName

func (u *UserUpsert) SetName(v string) *UserUpsert

SetName sets the "name" field.

func (*UserUpsert) SetSub

func (u *UserUpsert) SetSub(v string) *UserUpsert

SetSub sets the "sub" field.

func (*UserUpsert) SetUpdatedAt

func (u *UserUpsert) SetUpdatedAt(v time.Time) *UserUpsert

SetUpdatedAt sets the "updated_at" field.

func (*UserUpsert) UpdateEmail

func (u *UserUpsert) UpdateEmail() *UserUpsert

UpdateEmail sets the "email" field to the value that was provided on create.

func (*UserUpsert) UpdateIss

func (u *UserUpsert) UpdateIss() *UserUpsert

UpdateIss sets the "iss" field to the value that was provided on create.

func (*UserUpsert) UpdateName

func (u *UserUpsert) UpdateName() *UserUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*UserUpsert) UpdateSub

func (u *UserUpsert) UpdateSub() *UserUpsert

UpdateSub sets the "sub" field to the value that was provided on create.

func (*UserUpsert) UpdateUpdatedAt

func (u *UserUpsert) UpdateUpdatedAt() *UserUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type UserUpsertBulk

type UserUpsertBulk struct {
	// contains filtered or unexported fields
}

UserUpsertBulk is the builder for "upsert"-ing a bulk of User nodes.

func (*UserUpsertBulk) DoNothing

func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertBulk) Exec

func (u *UserUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertBulk) ExecX

func (u *UserUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpsertBulk) Ignore

func (u *UserUpsertBulk) Ignore() *UserUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*UserUpsertBulk) SetEmail

func (u *UserUpsertBulk) SetEmail(v string) *UserUpsertBulk

SetEmail sets the "email" field.

func (*UserUpsertBulk) SetIss

func (u *UserUpsertBulk) SetIss(v string) *UserUpsertBulk

SetIss sets the "iss" field.

func (*UserUpsertBulk) SetName

func (u *UserUpsertBulk) SetName(v string) *UserUpsertBulk

SetName sets the "name" field.

func (*UserUpsertBulk) SetSub

func (u *UserUpsertBulk) SetSub(v string) *UserUpsertBulk

SetSub sets the "sub" field.

func (*UserUpsertBulk) SetUpdatedAt

func (u *UserUpsertBulk) SetUpdatedAt(v time.Time) *UserUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*UserUpsertBulk) Update

func (u *UserUpsertBulk) Update(set func(*UserUpsert)) *UserUpsertBulk

Update allows overriding fields `UPDATE` values. See the UserCreateBulk.OnConflict documentation for more info.

func (*UserUpsertBulk) UpdateEmail

func (u *UserUpsertBulk) UpdateEmail() *UserUpsertBulk

UpdateEmail sets the "email" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateIss

func (u *UserUpsertBulk) UpdateIss() *UserUpsertBulk

UpdateIss sets the "iss" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateName

func (u *UserUpsertBulk) UpdateName() *UserUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateNewValues

func (u *UserUpsertBulk) UpdateNewValues() *UserUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertBulk) UpdateSub

func (u *UserUpsertBulk) UpdateSub() *UserUpsertBulk

UpdateSub sets the "sub" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateUpdatedAt

func (u *UserUpsertBulk) UpdateUpdatedAt() *UserUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type UserUpsertOne

type UserUpsertOne struct {
	// contains filtered or unexported fields
}

UserUpsertOne is the builder for "upsert"-ing

one User node.

func (*UserUpsertOne) DoNothing

func (u *UserUpsertOne) DoNothing() *UserUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertOne) Exec

func (u *UserUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertOne) ExecX

func (u *UserUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpsertOne) ID

func (u *UserUpsertOne) ID(ctx context.Context) (id uuid.UUID, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*UserUpsertOne) IDX

func (u *UserUpsertOne) IDX(ctx context.Context) uuid.UUID

IDX is like ID, but panics if an error occurs.

func (*UserUpsertOne) Ignore

func (u *UserUpsertOne) Ignore() *UserUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*UserUpsertOne) SetEmail

func (u *UserUpsertOne) SetEmail(v string) *UserUpsertOne

SetEmail sets the "email" field.

func (*UserUpsertOne) SetIss

func (u *UserUpsertOne) SetIss(v string) *UserUpsertOne

SetIss sets the "iss" field.

func (*UserUpsertOne) SetName

func (u *UserUpsertOne) SetName(v string) *UserUpsertOne

SetName sets the "name" field.

func (*UserUpsertOne) SetSub

func (u *UserUpsertOne) SetSub(v string) *UserUpsertOne

SetSub sets the "sub" field.

func (*UserUpsertOne) SetUpdatedAt

func (u *UserUpsertOne) SetUpdatedAt(v time.Time) *UserUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpsertOne) Update

func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne

Update allows overriding fields `UPDATE` values. See the UserCreate.OnConflict documentation for more info.

func (*UserUpsertOne) UpdateEmail

func (u *UserUpsertOne) UpdateEmail() *UserUpsertOne

UpdateEmail sets the "email" field to the value that was provided on create.

func (*UserUpsertOne) UpdateIss

func (u *UserUpsertOne) UpdateIss() *UserUpsertOne

UpdateIss sets the "iss" field to the value that was provided on create.

func (*UserUpsertOne) UpdateName

func (u *UserUpsertOne) UpdateName() *UserUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*UserUpsertOne) UpdateNewValues

func (u *UserUpsertOne) UpdateNewValues() *UserUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertOne) UpdateSub

func (u *UserUpsertOne) UpdateSub() *UserUpsertOne

UpdateSub sets the "sub" field to the value that was provided on create.

func (*UserUpsertOne) UpdateUpdatedAt

func (u *UserUpsertOne) UpdateUpdatedAt() *UserUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type Users

type Users []*User

Users is a parsable slice of User.

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

Jump to

Keyboard shortcuts

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